Search Results

Search found 206 results on 9 pages for 'danger angell'.

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

  • SIlverlight 4RC threading - can a new Thread return the UI Thread

    - by Darko Z
    Hi all, Let's say I have a situation in Silverlight where there is a background thread (guaranteed to NOT be the UI thread) doing some work and it needs to create a new thread. Something like this: //running in a background thread Thread t = new Thread(new ThreadStart(delegate{}); t.Start(); Lets also say that the UI thread at this particular time is just hanging around doing nothing. Keeping in mind that I am not that knowledgeable about the Silverlight threading model, is there any danger of the new Thread() call giving me the UI thread? The motivation or what I am trying to achieve is not important - I do not want modification to the existing code. I just want to know if there is a possibility of getting the UI thread back unexpectedly. Cheers

    Read the article

  • Explicit return from a Ruby method - implementation hiding, reuse and optimisations.

    - by Chris McCauley
    Hi, Rather than allowing a Ruby method to blindly return the last statement evaluated, is there any advantage to returning nil explicitly? In terms of implementation hiding and reuse, it seems dangerous to blindly allow the last expression evaluated to be returned - isn't there a danger that a user will rely on this only to get a nasty surprise when the implementation is modified? Surely returning nil would be better unless an explicit return value was given. Following on, is there an optimisation that Ruby can make when the return is a simple type rather than a reference to a more complex object? Chris

    Read the article

  • Ctypes pro and con

    - by phreaki
    I have heard that Ctypes can cause crashes (or stop errors) in Python and windows. Should I stay away from their use? Where did I hear? It was back when I tried to control various aspects of windows, automation, that sort of thing. I hear of swig, but I see Ctypes more often than not. Any danger here? If so, what should I watch out for? I did search for ctype pro con python.

    Read the article

  • Explicit return form a Ruby method - implementation hiding, reuse and optimisations.

    - by Chris McCauley
    Hi, Rather than allowing a Ruby method to blindly return the last statement evaluated, is there any advantage to returning nil explicitly? In terms of implementation hiding and reuse, it seems dangerous to blindly allow the last expression evaluated to be returned - isn't there a danger that a user will rely on this only to get a nasty surprise when the implementation is modified? Surely returning nil would be better unless an explicit return value was given. Following on, is there an optimisation that Ruby can make when the return is a simple type rather than a reference to a more complex object? Chris

    Read the article

  • making urllib request in Python from the client side

    - by mridang
    Hi Guys, I've written a Python application that makes web requests using the urllib2 library after which it scrapes the data. I could deploy this as a web application which means all urllib2 requests go through my web-server. This leads to the danger of the server's IP being banned due to the high number of web requests for many users. The other option is to create an desktop application which I don't want to do. Is there any way I could deploy my application so that I can get my web-requests through the client side. One way was to use Jython to create an applet but I've read that Java applets can only make web-requests to the server it is deployed on and the only way to to circumvent this is to create a server side proxy which leads us back to the problem of the server's ip getting banned. This might sounds sound like and impossible situation and I'll probably end up creating a desktop application but I thought I'd ask if anyone knew of an alternate solution. Thanks.

    Read the article

  • How to stop worker threads in a multithreaded Windows service on service stop

    - by RobW
    I have a Windows service that uses the producer/consumer queue model with multiple worker threads processing tasks off a queue. These tasks can be very long running, in the order of many minutes if not hours, and do not involve loops. My question is about the best way to handle the service stop to gracefully end processing on these worker threads. I have read in another SO question that using thread.Abort() is a sign of bad design, but it seems that the service OnStop() method is only given a limited amount of time to finish before the service is terminated. I can do sufficient clean-up in the catch for ThreadAbortException (there is no danger of inconsistent state) so calling thread.Abort() on the worker threads seems OK to me. Is it? What are the alternatives?

    Read the article

  • What is the scope of xsl apply-imports?

    - by calavera.info
    My original idea about apply-imports was that if there are two templates which matches the same node, then using apply-imports in a template with higher priority runs the template with the lower priority. But I recently find out that it's important how are imports organized. Two cases interests me particularly. Will apply imports work on a template which is imported in imported file (nested import)? How about a "sibling import" (master file imports two files with templates matching the same nodes) It seems to me that this is not clearly described in specification. Could someone provide authoritative guidelines? EDIT: I can try those cases on my own, but there is always a danger that it will be implementation specific behavior.

    Read the article

  • Undocumented Mac Calls

    - by Brian Postow
    I'm working on a couple of mac products, and in order to do what I need to do, I'm using some calls to undocumented methods on Mac Classes. Like IKImageView's doRotate:(id) and PDFDocument's (NSPrintOperation *)getPrintOperationForPrintInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate; How common is it for Objective C programmers to use methods like this? How do you find out about them (other than Google)? How dangerous is it to use them? Is there a danger other than that Apple will make them no-longer available in some future rev, and so your program will break?

    Read the article

  • What is the most you've charged for a single programming job?

    - by David Murdoch
    This question/wiki is more aimed at my fellow freelancers rather than companies or groups...but any and all feedback definitely is welcome. When quoting jobs for anything over $10,000 I always feel uneasy and unsure about the estimate I'm providing (though, I'm not sure why, I know what I'm worth [ I think :-) ] and I charge appropriately. I'm sure there are more (noob) freelancers here on S.O. that feel the same way. In danger of being voted closed because of its subjective (but factual) nature - the question(s): What is the largest amount you have charged for a single programming job (not including maintenance, support, or residual income). What are some of the details of the specific job? (research, q&a, challenges, etc) What languages did you use to get the job done? Assuming you bill your work at an hourly rate, what was the rate? How long did the job actually take you to complete? (from start to deployment, how many weeks, months, years?)

    Read the article

  • Handling over-long UTF-8 sequences

    - by Grant McLean
    I've just been reworking my Encoding::FixLatin Perl module to handle over-long utf8 byte sequences and convert them to the shortest normal form. My question is quite simply "is this a bad idea"? A number of sources (including this RFC) suggest that any over-long utf8 should be treated as an error and rejected. They caution against "naive implementations" and leave me with the impression that these things are inherently unsafe. Since the whole purpose of my module is to clean up messy data files with mixed encodings and convert them to nice clean utf8, this seems like just one more thing I can clean up so the application layer doesn't have to deal with it. My code does not concern itself with any semantic meaning the resulting characters might have, it simply converts them into a normalised form. Am I missing something. Is there a hidden danger I haven't considered?

    Read the article

  • What was the most surprising failure of your 'Engineer's intuition'?

    - by Bubba88
    Hi! This may seem as an open-ended question but I'll surely accept the most impressive and upvoted answer ;) Basically, I could describe my own case - I just fail 5 times a day with my intuition cause very frequently I can be just not up-to-the-speed with my requirements/manager/team/etc. and I just have to make code quickly - that's why proper formalization in many cases stands aside. I want to gather some experience of yours - what was the most epic failure when you did rely on you implicit reasoning/intuitive knowledge/immediate perception etc. of course everything you describe should be related to programming/computers. It's mostly just to measure the danger of using that 'it's obvious..' words. I've made it com. wiki to be properly transformed after gathering enough views count. Thank you!

    Read the article

  • How to handle an "infinite" IEnumerable?

    - by Danvil
    A trivial example of an "infinite" IEnumerable would be IEnumerable<int> Numbers() { int i=0; while(true) { yield return i++; } } I know, that foreach(int i in Numbers().Take(10)) { Console.WriteLine(i); } and var q = Numbers(); foreach(int i in q.Take(10)) { Console.WriteLine(i); } both work fine (and print out the number 0-9). But are there any pitfalls when copying or handling expressions like q? Can I rely on the fact, that they are always evaluated "lazy"? Is there any danger to produce an infinite loop?

    Read the article

  • .NET Framework - Possible memory-leaky classes?

    - by Robert Fraser
    Just the other day I was investigating a memory leak that was ballooning the app from ~50MB to ~130MB in under two minutes. Turns out that the problem was with the ConcurrentQueue class. Internally, the class stores a linked list of arrays. When an item is dequeued from the ConcurrentQueue, the index in the array is bumped, but the item remains in the array (i.e. it's not set to null). The entire array node is dropped after enough enqueues/dequeues, so it's not technically a leak, but if storing only a few large objects in the ConcurrentQueue, this can get out of hand fast. The documentation makes no note of this danger. I was wondering what other potential memory pitfalls are in the Base Class Library? I know about the Substring one (that is, if you call substring and just hold onto the result, the whole string will still be in memory). Any others you've encountered?

    Read the article

  • Can running object be garbage collected?

    - by Kugel
    I have a simple class: public class Runner { public void RunAndForget(RunDelegate method) { ThreadPool.QueueUserWorkItem(new WaitCallback(Run), method); } private void Run(object o) { ((RunDelegate )o).Invoke(); } } And if I use this like so: private void RunSomethingASync() { Runner runner = new Runner(); runner.FireAndForget(new RunDelegate(Something)); } Is there any danger using it like this? My C++ guts tell me that runner object should be destroyed after RunSomethingASync is finished. Am I right? What happens then to the method running on different thread? Or perhaps it is other way around and runner will not be collected? That would be a problem considering I may call RunSomethingASync() many times.

    Read the article

  • Should I convert overlong UTF-8 strings to their shortest normal form?

    - by Grant McLean
    I've just been reworking my Encoding::FixLatin Perl module to handle overlong UTF-8 byte sequences and convert them to the shortest normal form. My question is quite simply "is this a bad idea"? A number of sources (including this RFC) suggest that any over-long UTF-8 should be treated as an error and rejected. They caution against "naive implementations" and leave me with the impression that these things are inherently unsafe. Since the whole purpose of my module is to clean up messy data files with mixed encodings and convert them to nice clean utf8, this seems like just one more thing I can clean up so the application layer doesn't have to deal with it. My code does not concern itself with any semantic meaning the resulting characters might have, it simply converts them into a normalised form. Am I missing something. Is there a hidden danger I haven't considered?

    Read the article

  • Replicating iPhone Calendar View Lame?

    - by John Wright
    I am building an iPhone app that will need to display info primarily in a calendar view. Users will need to be able to search for entries and view them by day, month or in a list view. It seems like the built-in calendar type interface is ideal for my app. So I could build a similar calendar with 3 buttons at the bottom for list/day/month view as well as a button for today, in short a very similar interface to the built in iPhone calendar with different colors primarily. However, if I replicate it am I a) a lame copycat for replicating the built-in interface or smart for using a well-known iPhone metaphor and b) in danger of having my app rejected?

    Read the article

  • A good approach to db planing for reporting service

    - by Itay Moav
    The scenario: Big system (~200 tables). 60,000 users. Complex reports that will require me to do multiple queries for each report and even those will be complex queries with inner queries all over the place + some processing in PHP. I have seen an approach, which I am not sure about: Having one centralized, de-normalized, table that registers any activity in the system which is reportable. This table will hold mostly foreign keys, so she should be fairly compact and fast. So, for example (My system is a virtual learning management system), A user enrolls to course, the table stores the user id, date, course id, organization id, activity type (enrollment). Of course I also store this data in a normalized DB, which the actual application uses. Pros I see: easy, maintainable queries and code to process data and fast retrieval. Cons: there is a danger of the de-normalized table to be out of sync with the real DB. Is this approach worth considering, or (preferably from experience) is total $#%#%t?

    Read the article

  • C# : What if a static method is called from multiple threads?

    - by Holli
    In my Application I have a static method that is called from multiple threads at the same time. Is there any danger of my data being mixed up? In my first attempt the method was not static and I was creating multiple instance of the class. In that case my data got mixed up somehow. I am not sure how this happens because it only happens sometimes. I am still debugging. But now the method is static on I have no problems so far. Maybe it's just luck. I don't know for sure.

    Read the article

  • forcing Management Studio to use alter table instead of drop/recreate

    - by marco
    Hi! I'm wondering if is there a way to force MSSQL Management Studio to produce a script like this: ALTER TABLE Mytable ADD MyCol bit NOT NULL CONSTRAINT MyColDefault DEFAULT 0 WITH VALUES ALTER TABLE [dbo].Mytable ALTER COLUMN MyCol2 int NULL GO when I alter a very simple property of a column on a table. If I do this in the designer and ask for the produced script, the script doesn't do such simple tasks, but instead copies all the data in a tmp table, drops the original table, renames the tmp table with the original table name. And, of course, drops and recreates every constraint and relationships. Is there any option I can change to change this behaviour? Or, this may be possible, is there some danger I don't see in using the simple ALTER TABLE above? thanks.

    Read the article

  • StringBuilder/StringBuffer vs. "+" Operator

    - by matt.seil
    I'm reading "Better, Faster, Lighter Java" (by Bruce Tate and Justin Gehtland) and am familiar with the readability requirements in agile type teams, such as what Robert Martin discusses in his clean coding books. On the team I'm on now, I've been told explicitly not to use the "+" operator because it creates extra (and unnecessary) string objects during runtime. But this article: http://www.ibm.com/developerworks/java/library/j-jtp01274.html Written back in '04 talks about how object allocation is about 10 machine instructions. (essentially free) It also talks about how the GC also helps to reduce costs in this environment. What is the actual performance tradeoffs between using "+," "StringBuilder," or "StringBuffer?" (In my case it is StringBuffer only as we are limited to Java 1.4.2.) StringBuffer to me results in ugly, less readable code, as a couple of examples in Tate's book demonstrates. And StringBuffer is thread-synchronized which seems to have its own costs that outweigh the "danger" in using the "+" operator. Thoughts/Opinions?

    Read the article

  • can anyone explain the why the the 1st example gets different results than the following 2

    - by klumsy
    $b = (2,3) $myarray1 = @(,$b,$b) $myarray1[0].length #this will be 1 $myarray1[1].length $myarray2 = @( ,$b ,$b ) $myarray2[0].length #this will be 2 $myarray[1].length $myarray3 = @(,$b ,$b ) $myarray3[0].length #this will be 2 $myarray3[1].length UPDATE I think on #powershell IRC we have worked it out, Here is another example that demonstrates the danger of breaking with the comma on the following line rather than the top line when listing multiple items in an array over multiple lines. $b = (1..20) $a = @( $b, $b ,$b, $b, $b ,$b) for($i=0;$i -lt $a.length;$i++) { $a[$i].length } "--------" $a = @( $b, $b ,$b ,$b, $b ,$b) for($i=0;$i -lt $a.length;$i++) { $a[$i].length } produces 20 20 20 20 20 20 -------- 20 20 20 1 20 20 I'm curious how people will explain this. I think i understand it now, but would have trouble explaining it in a concise understandable fashion, though the above example goes somewhat towards that goal.

    Read the article

  • Create a link to delete membership in web2py

    - by user1741325
    I'm trying to do something really simple but it's taking me ages to figure out how to do it properly. I want to have a button that simply deletes a member from a group. So in my view I have <div id="del-role">{{=A('Delete Role',_class="btn btn-danger", callback=URL('test'),delete='#del-role')}}</div> However, when I click the button, the only thing I get is a Javascript prompt asking whether I'm sure I want to delete the specified object, yes/no. That's fine but, what I'd really like to do is just auth.del_membership('role') What needs to go in my controller? I do not want any page redirection, I just want to auth.del_membership(role) This seemingly simple thing is taking me forever to understand. Thanks!

    Read the article

  • Should I convert overly-long UTF-8 strings to their shortest normal form?

    - by Grant McLean
    I've just been reworking my Encoding::FixLatin Perl module to handle overly-long UTF-8 byte sequences and convert them to the shortest normal form. My question is quite simply "is this a bad idea"? A number of sources (including this RFC) suggest that any over-long UTF-8 should be treated as an error and rejected. They caution against "naive implementations" and leave me with the impression that these things are inherently unsafe. Since the whole purpose of my module is to clean up messy data files with mixed encodings and convert them to nice clean utf8, this seems like just one more thing I can clean up so the application layer doesn't have to deal with it. My code does not concern itself with any semantic meaning the resulting characters might have, it simply converts them into a normalised form. Am I missing something. Is there a hidden danger I haven't considered?

    Read the article

  • How to deploy updates to .NET website in cluster

    - by royappa
    We are operating a corporate web application on a load-balanced cluster that consists of two identical IIS servers talking to a single MSSQL database. To deploy updates I am using this primitive process: 1) Make a copy of the entire site folder (wwwroot\inetpub\whatever) on each IIS box 2) Download the updated, compiled files onto each IIS box from our development area 3) Shut down IIS both web servers 4) Copy the new and updated files into the wwwroot folder (overwriting any same files) 5) Then restart IIS on both machines When there are database changes involved there are a few other steps. The whole process is fairly quick but it is ugly and fraught with danger, so it has to be done with full concentration. I would like to just push one button to make it all happen. And I want a one-click rollback in case there is a problem (that's the reason I make the copy in step #1). I am looking for tools to manage and improve this process. If it also helped us maintain a changelog, that would be nice. Thanks.

    Read the article

  • How does ruby allow a method and a Class with the same name?

    - by Daniel Beardsley
    I happened to be working on a Singleton class in ruby and just remembered the way it works in factory_girl. They worked it out so you can use both the long way Factory.create(...) and the short way Factory(...) I thought about it and was curious to see how they made the class Factory also behave like a method. They simply used Factory twice like so: def Factory (args) ... end class Factory ... end My Question is: How does ruby accomplish this? and Is there danger in using this seemingly quirky pattern?

    Read the article

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