Search Results

Search found 1001 results on 41 pages for 'evil coder'.

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

  • Is static universally "evil" for unit testing and if so why does resharper recommend it?

    - by Vaccano
    I have found that there are only 3 ways to unit test (mock/stub) dependencies that are static in C#.NET: Moles TypeMock JustMock Given that two of these are not free and one has not hit release 1.0, mocking static stuff is not too easy. Does that make static methods and such "evil" (in the unit testing sense)? And if so, why does resharper want me to make anything that can be static, static? (Assuming resharper is not also "evil".) Clarification: I am talking about the scenario when you want to unit test a method and that method calls a static method in a different unit/class. By most definitions of unit testing, if you just let the method under test call the static method in the other unit/class then you are not unit testing, you are integration testing. (Useful, but not a unit test.)

    Read the article

  • Getting rid of the evil delay caused by ShellExecute

    - by korona
    This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before ShellExecute spawns the new process and returns. Does anyone know how to solve or work around this? EDIT: And as the tags might indicate, this is on Win32 using C++.

    Read the article

  • Are free operator->* overloads evil?

    - by Potatoswatter
    I was perusing section 13.5 after refuting the notion that built-in operators do not participate in overload resolution, and noticed that there is no section on operator->*. It is just a generic binary operator. Its brethren, operator->, operator*, and operator[], are all required to be non-static member functions. This precludes definition of a free function overload to an operator commonly used to obtain a reference from an object. But the uncommon operator->* is left out. In particular, operator[] has many similarities. It is binary (they missed a golden opportunity to make it n-ary), and it accepts some kind of container on the left and some kind of locator on the right. Its special-rules section, 13.5.5, doesn't seem to have any actual effect except to outlaw free functions. (And that restriction even precludes support for commutativity!) So, for example, this is perfectly legal (in C++0x, remove obvious stuff to translate to C++03): #include <utility> #include <iostream> #include <type_traits> using namespace std; template< class F, class S > typename common_type< F,S >::type operator->*( pair<F,S> const &l, bool r ) { return r? l.second : l.first; } template< class T > T & operator->*( pair<T,T> &l, bool r ) { return r? l.second : l.first; } template< class T > T & operator->*( bool l, pair<T,T> &r ) { return l? r.second : r.first; } int main() { auto x = make_pair( 1, 2.3 ); cerr << x->*false << " " << x->*4 << endl; auto y = make_pair( 5, 6 ); y->*(0) = 7; y->*0->*y = 8; // evaluates to 7->*y = y.second cerr << y.first << " " << y.second << endl; } I can certainly imagine myself giving into temp[la]tation. For example, scaled indexes for vector: v->*matrix_width[2][5] = x; Did the standards committee forget to prevent this, was it considered too ugly to bother, or are there real-world use cases?

    Read the article

  • Why is JFormattedTextField evil?

    - by kwutchak
    Hi, In this question Is there any way to accept only numeric values in a JTextField? one of the answers suggested that JFormattedTextField had issues. I've not yet used it, but could somebody please expand (or disagree) on the issues with this class? Thanks...

    Read the article

  • Is assert evil?

    - by dehmann
    The Go language creators write: Go doesn't provide assertions. (...) Programmers use them as a crutch to avoid thinking about proper error handling and reporting. What is your opinion about this?

    Read the article

  • Getters and Setters: Code smell, Necessary Evil, or Can't Live Without Them [closed]

    - by Avery Payne
    Possible Duplicate: Allen Holub wrote “You should never use get/set functions”, is he correct? Is there a good, no, a very good reason, to go through all the trouble of using getters and setters for object-oriented languages? What's wrong with just using a direct reference to a property or method? Is there some kind of "semantical coverup" that people don't want to talk about in polite company? Was I just too tired and fell asleep when someone walked out and said "Thou Shalt Write Copious Amounts of Code to Obtain Getters and Setters"? Follow-up after a year: It seems to be a common occurrence with Java, less so with Python. I'm beginning to wonder if this is more of a cultural phenomena (related to the limitations of the language) rather than "sage advice". The -1 question score is complete for-the-lulz as far as I am concerned. It's interesting that there are specific questions that are downvoted, not because they are "bad questions", but rather, because they hit someone's raw nerve.

    Read the article

  • Is reverse engineering evil?

    - by Amir Arad
    Lately I've been pondering on how a specific beloved old game actually works. I had some mild progress, but then a friend pointed out that if I really loved the game and appreciate it, I wouldn't try to reverse-engineer it. Note that the game is long considered an abandonware and is offerd for download publicly in lawful game sites, and I have no commercial / other large scale intentions - just to learn and "mess around" with it. Did I miss something? Is there an ethical taboo regarding reverse-engeneering? Alternatively, is there a legal issue?

    Read the article

  • Focus stealing is evil.

    - by lunixbochs
    A quick Google search for solutions to Focus Stealing in Windows reveals two main result categories: People suggesting incomplete solutions involving the ForegroundLockTimeout registry entry (or TweakUI, which I believe simply changes the aforementioned registry entry), which isn't very effective. Incessant hordes of Windows users complaining about it. It's particularly annoying in two common scenarios: Something triggers a program to popup a dialog window in the background while a fullscreen app is focused, causing the fullscreen app to minimize. A window steals focus while you are typing, stealing all of your keystrokes. If you happen to press Space, Enter, or trigger a keyboard shortcut (like Y for Yes), it can cause completely undesirable outcomes. What creative solutions can be applied to fix this problem for either or both of these scenarios?

    Read the article

  • Which adjustable ergonomic keyboard do you recommend to a fellow coder and why?

    - by thefonso
    My beloved Goldtouch has died (a moment of silence)....the hinge at the middle which allows you to adjust the board finally broke and the manufacturer does not do repairs for free. I'd have to buy a new board. So...since this I'm in the market for a new keyboard and I'm looking for an adjustable one comparable or better to the Goldentouch. I post this question to all you coders out there. Which adjustable ergo keyboard do you recommend to a fellow coder and why?

    Read the article

  • Which adjustable ergo keyboard do you recommend to a fellow coder and why?

    - by thefonso
    My beloved Goldtouch has died (a moment of silence)....the hinge at the middle which allows you to adjust the board finally broke and the manufacturer does not do repairs for free. I'd have to buy a new board. So...since this I'm in the market for a new keyboard and I'm looking for an adjustable one comparable or better to the Goldentouch. I post this question to all you coders out there. Which adjustable ergo keyboard do you recommend to a fellow coder and why?

    Read the article

  • CallContext and ApplicationHost

    - by p2u
    I tried to create an ApplicationHost. But I had errors like SerializationException and FileNotFoundException. Then I found this blog entry, where it's seem to be a remoting problem. In my little application I use the CallContext, so I tried some approaches. When I empty the CallContext before I create the ApplicationHost, it works: Programm class: namespace ApplicationHostDemo { public class Program { public static void Main(string[] args) { Evil evil = new Evil(); CallContext.SetData(Evil.CALLCONTEXT, evil); CallContext.FreeNamedDataSlot(Evil.CALLCONTEXT); Console.WriteLine("Simple Host-Demo\r\n"); Host host = CreateHost(); CallContext.SetData(Evil.CALLCONTEXT, evil); host.ProcessRequest("Index.aspx"); Console.WriteLine("\r\n\r\nSimple Host-Demo end"); Console.ReadLine(); } public static Host CreateHost() { return (Host)ApplicationHost.CreateApplicationHost(typeof(Host), "/", Directory.GetCurrentDirectory()); } public class Host : MarshalByRefObject { public void ProcessRequest(string page) { SimpleWorkerRequest swr = new SimpleWorkerRequest(page, "", Console.Out); HttpRuntime.ProcessRequest(swr); } } } } Evil class: namespace ApplicationHostDemo { [Serializable] public class Evil : ILogicalThreadAffinative { public const string CALLCONTEXT = "evil"; public string Name { get; set; } } } Do you know or could you explain why it works?

    Read the article

  • Would a cut and paste coder ever get past a job interview?

    - by bigdave
    As a long time cut and paste coder I never committed much of the syntax of a language to memory. Even worse, I now use google to solve many of the coding problems which are of the type typically used in job interviews. This has greatly increased my productivity, the quality of the end result and stops me perpetuating the same bugs across all my code. However it means I don't actually remember the detail of the solution. For some reason in a job interview "I would look that up on google" does not seem to be the right answer. Am I better off in the interview to pass no comment on my coding style and simply pull out an iPad and produce the solution?

    Read the article

  • Quel Environnements de Développement Intégré utilisez-vous pour coder avec Symfony, le framework MVC libre en PHP ?

    Quel EDI utilisez-vous pour coder avec Symfony ? Cela fait déjà un petit temps que je développe avec symfony, en utilisant un bon vieux Notepad++. Et je remarque que, pour le C++, je code quand même bien plus vite avec un EDI plus que correct (Visual Studio) qu'avec Notepad++. Ce n'est pas le premier que je tente d'utiliser mais c'est le seul qui me convient. J'ai déjà essayé NetBeans avec support de symfony, mais je n'ai pas vraiment réussi à le prendre en main, pas hypra intuitif, etc. Ce qui fait que je suis retourné vite fait à mon Notepad++. Mais c'était au tout début du support de symfony (6.5, il me semble). Depuis, on en est à la 6.9 (7.0 en beta), est-ce que ça vaut la peine de réessayer cet EDI ? ...

    Read the article

  • L'empire Google est-il « Evil » ? le géant se développe-t-il trop ?

    L'empire Google est-il "Evil" ? le géant se développe-t-il trop ? Une vidéo (pas très objective) publiée récemment sur le Net tend à raviver la psychose qui tourne autour de Google et du contrôle quasi-mondial que la firme pourrait opèrer sur les êtres humains. En reprenant certains chiffres liés aux activités de l'entreprise, la dimension tentaculaire de l'énorme empire Google est montrée avec force. Même si le groupe de Moutain View n'a pas encore dépassé les bornes, pourrait-il le faire ?

    Read the article

  • Best practices for team workflow with RoR/Github for designer + coder?

    - by Josh
    My friend and I have started to try to collaborate on some projects. For background, I come from a PHP/Wordpress/Drupal coding background, but recently I've become more experienced with the RoR framework, while he is more experienced as an HTML/CSS designer, working with PHP and WordPress. We're both relatively new to RoR I think, and so we're trying to figure out our collaborative workflow, but we have no idea where to start. For instance, we were trying to figure out how he could do some minor edits to the CSS file without having to do a full RoR deploy on his box. We still haven't figured out a solution, so I think it's best if we start to set some sort of workflow based on best practices. I was wondering if you guys have any insight or links to articles/case studies regarding this topic?

    Read the article

  • Is it evil to model JSON responses to classes when they are mostly smilar?

    - by Aybe
    Here's the problem : While implementing a C# wrapper for an online API (Discogs) I've been faced to a dilemma : quite often the responses returned have mostly similar members and while modeling these responses to classes, some questions surfaces on which way to go would be the best. Example : Querying for a 'release' or a 'master' will return an object that contains an array of 'artist', however these 'artists' do not exactly have the same members. Currently I decided to represent these 'artists' as a single 'Artist' class, against having respective 'ReleaseArtist' and 'MasterArtist' classes which soon becomes very confusing even though another problem arises : when a category (master or release) does not return these members, they will be null. Though it might sound confusing as well I find it less confusing than the former situation as I've tackled the problem by simply not showing null members when visualizing these objects. Is this the right approach to follow ? An example of these differences : public class Artist { public List<Alias> Aliases { get; set; } public string DataQuality { get; set; } public List<Image> Images { get; set; } public string Name { get; set; } public List<string> NameVariations { get; set; } public string Profile { get; set; } public string Realname { get; set; } public string ReleasesUrl { get; set; } public string ResourceUrl { get; set; } public string Uri { get; set; } public List<string> Urls { get; set; } } public class ReleaseArtist { public string Join { get; set; } public string Name { get; set; } public string Anv { get; set; } public string Tracks { get; set; } public string Role { get; set; } public string ResourceUrl { get; set; } public int Id { get; set; } }

    Read the article

  • Why didn't IE8 support border-radius, evil or ignorance?

    - by Mark Rogers
    When I think back to the time of the release of IE7, I was surprised that there wasn't border-radius support. It seems like an obviously great idea to have a css-property name for rounded corners, which can potentially make a site look less like it came from the computer stone-age. Finally, today we have IE9 and Microsoft finally decided to play ball with the rest of the world. But the question remains, why didn't Microsoft bother to support border-radius in IE8? The problem probably became obvious to the company as the growing chorus of complaints from web developers got louder after the release of IE7. Was the company so isolated or in group-think mode that they were blind for that many years? Or did Microsoft have some additional motive to suppress the border-radius property?

    Read the article

  • Is premature optimization really the root of all evil?

    - by Craig Day
    A colleague of mine today committed a class called ThreadLocalFormat, which basically moved instances of Java Format classes into a thread local, since they are not thread safe and "relatively expensive" to create. I wrote a quick test and calculated that I could create 200,000 instances a second, asked him was he creating that many, to which he answered "nowhere near that many". He's a great programmer and everyone on the team is highly skilled so we have no problem understanding the resulting code, but it was clearly a case of optimizing where there is no real need. He backed the code out at my request. What do you think? Is this a case of "premature optimization" and how bad is it really?

    Read the article

  • Good SEO - Why is Good SEO Better Than Its Evil 'Black Hat' Brother?

    With the rise of today's technology, a number of bad and dodgy practices have come into play that can seriously put your website at risk from being banned in the search engines - no questions asked. The constant shift of techniques and 'state of flux' the search engines remain in makes it difficult to differentiate between good and bad SEO.

    Read the article

  • What is the most EVIL code you have ever seen in a production enterprise environment?

    - by Registered User
    What is the most evil or dangerous code fragment you have ever seen in a production environment at a company? I've never encountered production code that I would consider to be deliberately malicious and evil, so I'm quite curious to see what others have found. The most dangerous code I have ever seen was a stored procedure two linked-servers away from our core production database server. The stored procedure accepted any NVARCHAR(8000) parameter and executed the parameter on the target production server via an double-jump sp_executeSQL command. That is to say, the sp_executeSQL command executed another sp_executeSQL command in order to jump two linked servers. Oh, and the linked server account had sysadmin rights on the target production server.

    Read the article

  • Does constantly checking the documentation make you a bad coder?

    - by cdburgess
    When writing PHP code for any given project, do you find you can write code off the top of your head? Or do you make multiple round trips to php.net? If it is the later, can you still be considered a good coder. This is a legitimate question as I find I have difficulty always remembering all of the functions that are available to me so I find I use php.net as a crutch. Is there anyway to improve this?

    Read the article

  • If innerHTML is evil, then what's a better way change the text of a link?

    - by sanj
    I know innerHTML is supposedly evil, but I think it's the simplest way to change link text. For example: <a id="mylink" href="">click me</a> In JS you can change the text with: document.getElementById("mylink").innerHTML = new_text; And in Prototype/jQuery: $("mylink").innerHTML = new_text; works fine. Otherwise you have to replace all of the child nodes first and then add a text node. Why bother?

    Read the article

  • initWithCoder works, but init seems to be overwriting my objects properties?

    - by Zigrivers
    Hi guys, I've been trying to teach myself how to use the Archiving/Unarchiving methods of NSCoder, but I'm stumped. I have a Singleton class that I have defined with 8 NSInteger properties. I am trying to save this object to disk and then load from disk as needed. I've got the save part down and I have the load part down as well (according to NSLogs), but after my "initWithCoder:" method loads the object's properties appropriately, the "init" method runs and resets my object's properties back to zero. I'm probably missing something basic here, but would appreciate any help! My class methods for the Singleton class: + (Actor *)shareActorState { static Actor *actorState; @synchronized(self) { if (!actorState) { actorState = [[Actor alloc] init]; } } return actorState; } -(id)init { if (self = [super init]) { NSLog(@"New Init for Actor started...\nStrength: %d", self.strength); } return self; } -(id)initWithCoder:(NSCoder *)coder { if (self = [super init]) { strength = [coder decodeIntegerForKey:@"strength"]; dexterity = [coder decodeIntegerForKey:@"dexterity"]; stamina = [coder decodeIntegerForKey:@"stamina"]; will = [coder decodeIntegerForKey:@"will"]; intelligence = [coder decodeIntegerForKey:@"intelligence"]; agility = [coder decodeIntegerForKey:@"agility"]; aura = [coder decodeIntegerForKey:@"aura"]; eyesight = [coder decodeIntegerForKey:@"eyesight"]; NSLog(@"InitWithCoder executed....\nStrength: %d\nDexterity: %d", self.strength, self.dexterity); [self retain]; } return self; } -(void) encodeWithCoder:(NSCoder *)encoder { [encoder encodeInteger:strength forKey:@"strength"]; [encoder encodeInteger:dexterity forKey:@"dexterity"]; [encoder encodeInteger:stamina forKey:@"stamina"]; [encoder encodeInteger:will forKey:@"will"]; [encoder encodeInteger:intelligence forKey:@"intelligence"]; [encoder encodeInteger:agility forKey:@"agility"]; [encoder encodeInteger:aura forKey:@"aura"]; [encoder encodeInteger:eyesight forKey:@"eyesight"]; NSLog(@"encodeWithCoder executed...."); } -(void)dealloc { //My dealloc stuff goes here [super dealloc]; } I'm a noob when it comes to this stuff and have been trying to teach myself for the last month, so forgive anything obvious. Thanks for the help!

    Read the article

  • Premature optimization is the root of all evil, but can it ever be too late?

    - by polygenelubricants
    "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil" So what is that 3% like? Can the avoidance of premature optimization ever be taken too extreme that it does more harm than good? Even if it's rare, has there been a case of a real measurable software engineering disaster due to complete negligence to optimize early in the process? Bonus question: is software engineering pretty much the only field that has such a counter intuitive principle regarding doing something earlier rather than later before things potentially become too big a problem to fix? Personal question: how do you justify something as premature optimization and not just a case of you being lazy/ignorant/dumb?

    Read the article

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