Search Results

Search found 64 results on 3 pages for 'laziness'.

Page 1/3 | 1 2 3  | Next Page >

  • How do laziness and I/O work together in Haskell?

    - by Bill
    I'm trying to get a deeper understanding of laziness in Haskell. I was imagining the following snippet today: data Image = Image { name :: String, pixels :: String } image :: String -> IO Image image path = Image path <$> readFile path The appeal here is that I could simply create an Image instance and pass it around; if I need the image data it would be read lazily - if not, the time and memory cost of reading the file would be avoided: main = do image <- image "file" putStrLn $ length $ pixels image But is that how it actually works? How is laziness compatible with IO? Will readFile be called regardless of whether I access pixels image or will the runtime leave that thunk unevaluated if I never refer to it? If the image is indeed read lazily, then isn't it possible I/O actions could occur out of order? For example, what if immediately after calling image I delete the file? Now the putStrLn call will find nothing when it tries to read.

    Read the article

  • Creative ways to punish (or just curb) laziness in coworkers

    - by FerretallicA
    Like the subject suggests, what are some creative ways to curb laziness in co-workers? By laziness I'm talking about things like using variable names like "inttheemplrcd" instead of "intEmployerCode" or not keeping their projects synced with SVN, not just people who use the last of the sugar in the coffee room and don't refill the jar. So far the two most effective things I've done both involve the core library my company uses. Since most of our programs are in VB.net the lack of case sensitivity is abused a lot. I've got certain features of the library using Reflection to access data in the client apps, which has a negligible performance hit and introduces case sensitivity in a lot places where it is used. In instances where we have an agreed standard which is compromised by blatant laziness I take it a step further, like the DatabaseController class which will blatantly reject any DataTable passed to it which isn't named dtSomething (ie- must begin with dt and third letter must be capitalised). It's frustrating to have to resort to things like this but it has also gradually helped drill more attention to detail into their heads. Another is adding some code to the library's initialisation function to display a big and potentially embarrassing (only if seen by a client) message advising that the program is running in debug mode. We have had many instances where projects are sent to clients built in debug mode which has a lot of implications for us (especially with regard to error recovery) and doing that has made sure they always build to release before distributing. Any other creative (ie- not StyleCop etc) approaches like this?

    Read the article

  • Confusion regarding laziness

    - by Abhinav Kaushik
    I have a function myLength = foldl (\ x _ -> x + 1) 0 which fails with stack overflow with input around 10^6 elements (myLength [1..1000000] fails). I believe that is due to the thunk build up since when I replace foldl with foldl', it works. So far so good. But now I have another function to reverse a list : myReverse = foldl (\ acc x -> x : acc) [] which uses the lazy version foldl (instead of foldl') When I do myLength . myReverse $ [1.1000000]. This time it works fine. I fail to understand why foldl works for the later case and not for former?

    Read the article

  • What is "Call By Name"?

    - by forellana
    Hi to everyone! I'm working in a homework, and the professor asked me to implement the evaluation strategy called "call by name" in scheme in a certain language that we developed and he gave us an example at http://www.scala-lang.org/node/138 in the scala language, but i don't understand in what consists the call by name evaluation strategy? what differences it has with call by need? thanks, greetings

    Read the article

  • iPhone OS: implementing your own achievements, how do I do it?

    - by nickthedude
    I'm working on a game where really the only game part is (at least right now) that the user can unlock achievements as she does various things throughout the game. I have a database that can keep track of certain user actions and record how many times a user does something but I'm having trouble figuring out the best way to architect the app so that I have to do the least amount of work. Kind of suck with the timing because gamecenter is not ready and it seems like openfeint is changing gears, but maybe I'm wrong. I'd prefer to do everything "in house" if it is not too ridiculous. looking for suggestions. Thanks, Nick

    Read the article

  • How do I write a constant-space length function in Haskell?

    - by Bill
    The canonical implementation of length :: [a] -> Int is: length [] = 0 length (x:xs) = 1 + length xs which is very beautiful but suffers from stack overflow as it uses linear space. The tail-recursive version: length xs = length' xs 0 where length' [] n = n length' (x:xs) n = length xs (n + 1) doesn't suffer from this problem, but I don't understand how this can run in constant space in a lazy language. Isn't the runtime accumulating numerous (n + 1) thunks as it moves through the list? Shouldn't this function Haskell to consume O(n) space and lead to stack overflow? (if it matters, I'm using GHC)

    Read the article

  • Why toInteger :: Int -> Integer is lazy?

    - by joppux
    I have the following code: {-# NOINLINE i2i #-} i2i :: Int -> Integer i2i x = toInteger x main = print $ i2i 2 Running GHC with -ddump-simpl flag gives: [Arity 1 NoCafRefs Str: DmdType U(L)] Main.i2i = GHC.Real.toInteger1 Seems that conversion from Int to Integer is lazy. Why is it so - is there a case when I can have (toInteger _|_ ::Int) /= _|_ ?

    Read the article

  • Convert Stream to IEnumerable. If possible when "keeping laziness"

    - by Binary255
    Hi, I recieve a Stream and need to pass in a IEnumerable to another method. public static void streamPairSwitchCipher(Stream someStream) { ... someStreamAsIEnumerable = ... IEnumerable returned = anotherMethodWhichWantsAnIEnumerable(someStreamAsIEnumerable); ... } One way is to read the entire Stream, convert it to an Array of bytes and pass it in, as Array implements IEnumerable. But it would be much nicer if I could pass in it in such a way that I don't have to read the entire Stream before passing it in. public static IEnumerable<T> anotherMethodWhichWantsAnIEnumerable<T>(IEnumerable<T> p) { ... // Something uninteresting }

    Read the article

  • SQL SERVER – Auto Complete and Format T-SQL Code – Devart SQL Complete

    - by pinaldave
    Some people call it laziness, some will call it efficiency, some think it is the right thing to do. At any rate, tools are meant to make a job easier, and I like to use various tools. If we consider the history of the world, if we all wanted to keep traditional practices, we would have never invented the wheel.  But as time progressed, people wanted convenience and efficiency, which then led to laziness. Wanting a more efficient way to do something is not inherently lazy.  That’s how I see any efficiency tools. A few days ago I found Devart SQL Complete.  It took less than a minute to install, and after installation it just worked without needing any tweaking.  Once I started using it I was impressed with how fast it formats SQL code – you can write down any terms or even copy and paste.  You can start typing right away, and it will complete keywords, object names, and fragmentations. It completes statement expressions.  How many times do we write insert, update, delete?  Take this example: to alter a stored procedure name, we don’t remember the code written in it, you have to write it over again, or go back to SQL Server Studio Manager to create and alter which is very difficult.  With SQL Complete , you can write “alter stored procedure,” and it will finish it for you, and you can modify as needed. I love to write code, and I love well-written code.  When I am working with clients, and I find people whose code have not been written properly, I feel a little uncomfortable.  It is difficult to deal with code that is in the wrong case, with no line breaks, no white spaces, improper indents, and no text wrapping.  The worst thing to encounter is code that goes all the way to the right side, and you have to scroll a million times because there are no breaks or indents.  SQL Complete will take care of this for you – if a developer is too lazy for proper formatting, then Devart’s SQL formatter tool will make them better, not lazier. SQL Management Studio gives information about your code when you hover your mouse over it, however SQL Complete goes further in it, going into the work table, and the current rate idea, too. It gives you more information about the parameters; and last but not least, it will just take you to the help file of code navigation.  It will open object explorer in a document viewer.  You can start going through the various properties of your code – a very important thing to do. Here are are interesting Intellisense examples: 1) We are often very lazy to expand *however, when we are using SQL Complete we can just mouse over the * and it will give us all the the column names and we can select the appropriate columns. 2) We can put the cursor after * and it will give us option to expand it to all the column names by pressing the Tab key. 3) Here is one more Intellisense feature I really liked it. I always alias my tables and I always select the alias with special logic. When I was using SQL Complete I selected just a tablename (without schema name) and…(just like below image) … and it autocompleted the schema and alias name (the way I needed it). I believe using SQL Complete we can work faster.  It supports all versions of SQL Server, and works SQL formatting.  Many businesses perform code review and have code standards, so why not use an efficiency tool on everyone’s computer and make sure the code is written correctly from the first time?  If you’re interested in this tool, there are free editions available.  If you like it, you can buy it.  I bought it because it works.  I love it, and I want to hear all your opinions on it, too. You can get the product for FREE.  Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQL Utility, T SQL, Technology

    Read the article

  • Can you give one directory two SELinux Policies?

    - by Mike
    Out of laziness I want to be able FTP into my WWW directory. However, the SELinux permissions for apache(user_u:object_r:httpd_sys_content_t) to be able to use the WWW directory and for the user(system_u:object_r:user_home_dir_t ) to use the WWW directory are different. Anyway, around this problem without disabling SELinux? Thanks.

    Read the article

  • C#: System.Lazy&lt;T&gt; and the Singleton Design Pattern

    - by James Michael Hare
    So we've all coded a Singleton at one time or another.  It's a really simple pattern and can be a slightly more elegant alternative to global variables.  Make no mistake, Singletons can be abused and are often over-used -- but occasionally you find a Singleton is the most elegant solution. For those of you not familiar with a Singleton, the basic Design Pattern is that a Singleton class is one where there is only ever one instance of the class created.  This means that constructors must be private to avoid users creating their own instances, and a static property (or method in languages without properties) is defined that returns a single static instance. 1: public class Singleton 2: { 3: // the single instance is defined in a static field 4: private static readonly Singleton _instance = new Singleton(); 5:  6: // constructor private so users can't instantiate on their own 7: private Singleton() 8: { 9: } 10:  11: // read-only property that returns the static field 12: public static Singleton Instance 13: { 14: get 15: { 16: return _instance; 17: } 18: } 19: } This is the most basic singleton, notice the key features: Static readonly field that contains the one and only instance. Constructor is private so it can only be called by the class itself. Static property that returns the single instance. Looks like it satisfies, right?  There's just one (potential) problem.  C# gives you no guarantee of when the static field _instance will be created.  This is because the C# standard simply states that classes (which are marked in the IL as BeforeFieldInit) can have their static fields initialized any time before the field is accessed.  This means that they may be initialized on first use, they may be initialized at some other time before, you can't be sure when. So what if you want to guarantee your instance is truly lazy.  That is, that it is only created on first call to Instance?  Well, there's a few ways to do this.  First we'll show the old ways, and then talk about how .Net 4.0's new System.Lazy<T> type can help make the lazy-Singleton cleaner. Obviously, we could take on the lazy construction ourselves, but being that our Singleton may be accessed by many different threads, we'd need to lock it down. 1: public class LazySingleton1 2: { 3: // lock for thread-safety laziness 4: private static readonly object _mutex = new object(); 5:  6: // static field to hold single instance 7: private static LazySingleton1 _instance = null; 8:  9: // property that does some locking and then creates on first call 10: public static LazySingleton1 Instance 11: { 12: get 13: { 14: if (_instance == null) 15: { 16: lock (_mutex) 17: { 18: if (_instance == null) 19: { 20: _instance = new LazySingleton1(); 21: } 22: } 23: } 24:  25: return _instance; 26: } 27: } 28:  29: private LazySingleton1() 30: { 31: } 32: } This is a standard double-check algorithm so that you don't lock if the instance has already been created.  However, because it's possible two threads can go through the first if at the same time the first time back in, you need to check again after the lock is acquired to avoid creating two instances. Pretty straightforward, but ugly as all heck.  Well, you could also take advantage of the C# standard's BeforeFieldInit and define your class with a static constructor.  It need not have a body, just the presence of the static constructor will remove the BeforeFieldInit attribute on the class and guarantee that no fields are initialized until the first static field, property, or method is called.   1: public class LazySingleton2 2: { 3: // because of the static constructor, this won't get created until first use 4: private static readonly LazySingleton2 _instance = new LazySingleton2(); 5:  6: // Returns the singleton instance using lazy-instantiation 7: public static LazySingleton2 Instance 8: { 9: get { return _instance; } 10: } 11:  12: // private to prevent direct instantiation 13: private LazySingleton2() 14: { 15: } 16:  17: // removes BeforeFieldInit on class so static fields not 18: // initialized before they are used 19: static LazySingleton2() 20: { 21: } 22: } Now, while this works perfectly, I hate it.  Why?  Because it's relying on a non-obvious trick of the IL to guarantee laziness.  Just looking at this code, you'd have no idea that it's doing what it's doing.  Worse yet, you may decide that the empty static constructor serves no purpose and delete it (which removes your lazy guarantee).  Worse-worse yet, they may alter the rules around BeforeFieldInit in the future which could change this. So, what do I propose instead?  .Net 4.0 adds the System.Lazy type which guarantees thread-safe lazy-construction.  Using System.Lazy<T>, we get: 1: public class LazySingleton3 2: { 3: // static holder for instance, need to use lambda to construct since constructor private 4: private static readonly Lazy<LazySingleton3> _instance 5: = new Lazy<LazySingleton3>(() => new LazySingleton3()); 6:  7: // private to prevent direct instantiation. 8: private LazySingleton3() 9: { 10: } 11:  12: // accessor for instance 13: public static LazySingleton3 Instance 14: { 15: get 16: { 17: return _instance.Value; 18: } 19: } 20: } Note, you need your lambda to call the private constructor as Lazy's default constructor can only call public constructors of the type passed in (which we can't have by definition of a Singleton).  But, because the lambda is defined inside our type, it has access to the private members so it's perfect. Note how the Lazy<T> makes it obvious what you're doing (lazy construction), instead of relying on an IL generation side-effect.  This way, it's more maintainable.  Lazy<T> has many other uses as well, obviously, but I really love how elegant and readable it makes the lazy Singleton.

    Read the article

  • Best methods for Lazy Initialization with properties

    - by Stuart Pegg
    I'm currently altering a widely used class to move as much of the expensive initialization from the class constructor into Lazy Initialized properties. Below is an example (in c#): Before: public class ClassA { public readonly ClassB B; public void ClassA() { B = new ClassB(); } } After: public class ClassA { private ClassB _b; public ClassB B { get { if (_b == null) { _b = new ClassB(); } return _b; } } } There are a fair few more of these properties in the class I'm altering, and some are not used in certain contexts (hence the Laziness), but if they are used they're likely to be called repeatedly. Unfortunately, the properties are often also used inside the class. This means there is a potential for the private variable (_b) to be used directly by a method without it being initialized. Is there a way to make only the public property (B) available inside the class, or even an alternative method with the same initialized-when-needed?

    Read the article

  • jQuery AJAX Validation Using The Validity Plugin

    - by schnieds
    Input validation is one of those areas that most developers view as a necessary evil. We know that it is necessary and we really do want to ensure that we get good input from our users. But most of us are lazy (me included) and input validation is one of those things that gets done but usually is a quick and dirty implementation. This is partly due to laziness and partly do to input validation being painful. Thanks to the amazing jQuery Validity plug in, input validation can be really slick, easy and robust enough to work any any scenario. I specifically like the Validity plugin because it supports jQuery AJAX input validation. Other input validation implementations that I have worked with require a form post to take place. However, if you are using jQuery.ajax methods then there isn’t a form and you need to validate the formless input. [Read More] Aaron Schniederhttp://www.churchofficeonline.com

    Read the article

  • Don't Call it a Comeback

    - by Chris Haaker
    I received the email like most of you about Jeff and crew stepping down and selling the blog to another company. That it is a long time associate and friend of the team we have all grown to know and love, I feel much better about the move. Who cares, Chris, you haven't blogged religiously in ages! I know, and its a crime. Blame life, Twitter, my kids, laziness or whatever else you can think of. I always tell myself I am going to make a comeback - - "Don't call it a comeback - I been here for years." But after a few posts I seem to lose my steam. Its hard to explain, hell, I can't explain it. But we'll see what happens this time. Just don't call it a comeback.  2012 rMBP 15" Quad Core 2.33 GHz 16GB Memory 258GB SSDMarsEdit 3.5 (Please Microsoft Live Team - Make LiveWriter for OS X)

    Read the article

  • Coming back from (blog) retirement

    - by leo.pasta
    So, it has been more than 3 years without a single blog post. I wished I could have a decent excuse for it, but in the end, I guess it boils down to laziness and procrastination. :-) Even though I learned a lot in that period (and added a feel tricks to my bag), I couldn’t find the will to sit down and write. I hope all my readers (yes mom and dad, I’m talking to you) have not been disappointed. I will try really hard not to let routine take over. I don’t expect I will be the most active blogger in the community, but hopefully a couple of posts per month is a good target to aim.

    Read the article

  • Web hosting announced downtime and how it affects FORWARD domain names?

    - by maple_shaft
    Our web hosting provider that holds our FORWARD domain names announced that at some point in the next couple weeks they will be migrating servers and that this will cause a 5-10 minute downtime at some point in that week during what happens to be our core business hours. They cite for technical reasons it is impossible to give an exact date or time when this downtime will occur. My questions are: If my domains are set to FORWARD to a static IP on servers not hosted by the web hosting provider in question then will this affect the DNS servers correctly routing to my website? Are their legitimate technical reasons for such a wide window of time, or could this just be a blanket statement to cover laziness in not being more organized with their server migrations? Are such downtimes normal for web hosting providers, or should I start to consider other providers?

    Read the article

  • dynamically decorating objects in c#

    - by Oren Mazor
    is it possible to easily and dynamically decorate an object? for example, lets say I have a List<PointF>. this list is actually a plot of the sine function. I'd like to go through these points and add a flag to each PointF of whether it's a peak or not. but I don't want to create a new extended SpecialPointF or whatever, that has a boolean property. judge me all you want for being lazy, but laziness is how awesome ideas are born (also bad ideas)

    Read the article

  • Windows 7 homegroup sharing problem

    - by Steve Crane
    I have two machines in a homegroup. My desktop and my wife's laptop. The public folders like pictures, videos, etc. are shared fine. But if I try to share a single folder with the homegroup from the laptop, I don't see it on my desktop. I see suggestions of rebooting, leaving and rejoining the homegroup; even recreating the homegroup. Frankly, that's just ridiculous. If those are the only solutions then the feature is just not working as it should. Is it possible I'm experiencing these problems because I am still running the public beta of WIndows 7 (yeah I know, I need to get over my laziness and reinstall) while my wife is running the release version? Are there solutions to this problem that don't involve the somewhat drastic measures mentioned above?

    Read the article

  • Linux: disbale USB without disabling power

    - by Ergot
    TLDR I want toggle between the following usages of a usb-port via the terminal: use like a normal usb-port only supply energy to charge Story I recently got me something like a magna doodle that can save your drawings to pdf, which can be moved to your computer via usb afterwards. Now the thing is that you can't save anything while it's plugged in. Because it's the only way to charge it, it bugs me that I can't find a software solution and laziness I want to keep it plugged in and toggle the connection to the computer only when needed. I noticed that it's charging and usable when it is plugged in and the computer is shut down or suspened. So I guess that there's a way to do it. Tech info computer: ThinkPad X201 Linux Kernel: 3.14.5-1-ARCH "Magna doodle": Boogie Board Sync

    Read the article

  • Same command on multiple servers

    - by w00t
    Hello everyone. I'm just wondering if there is any fellow sysadmin with the need to execute one command on multiple servers. If so, what technique are you using? I have grown tired to ssh-ing to 3-5 servers and executing the same thing over and over again, so I'm thinking to make my life easier. Also, I think I should create keys so I don't have to enter passwords anymore (though I'm using root). After 2 years of doing this, I kind of developed a laziness. I googled it up, I know about cssh, pssh, tentakel (this one seems cool), and the more pro-genre - Puppet (of which I just heard of, didn't invest the time to read the docs). BTW, I'm using XP+putty, so if there is any putty-cool-thingy available, that's welcome too. If not, I can always ssh to one server and from there start my rest-of-the-servers-conquest :) *evil* Hit me up. Thanks.

    Read the article

  • Migrating to ssh key authentication; implications of adding sbin's to users $PATH

    - by ancillary
    I'm in the process of migrating to key's for authentication on my CentOS boxes. I have it all set up and working, but was a bit taken aback when I noticed service (and other things) didn't work the way I was accustomed to. Even after su'ing to root, still had to call the full path for it to work (which I assume to be expected/normal behavior). I also assume this is because there are different $PATH's for root (what I was using and am used to) and the newly created, key-using user. Specifically, I noticed the sbin's of the world missing from the user path. If I were to add those paths (/sbin/,/usr/sbin/,/usr/local/sbin) to a profile.d .sh script for this new key-loving user, would: I be opening up the system in ways I shouldn't be? I be doing something I needn't do save for reasons of laziness? I create other potential problems? Thanks.

    Read the article

  • How to put fear of God (law) into Wi-Fi hacking neighbors [closed]

    - by Shakehar
    I live in an apartment and some new guys have apparently moved into one of the apartments. They have been shamelessly hacking into my WiFi. Mine was initially a WEP encrypted network and out of laziness I just limited and reserved the IPS on my router for the people in my house. Yesterday I had to free up an IP for a guest in my house but before he could join the network these guys connected in. I have changed my encryption to WPA2 and hope they dont have the hardware/patience required to hack into it, but there are many wi-fi networks in my apartment most of which are secured using WEP. I don't really want to call the police on them. Is there any way to deter them from misusing other people's wi-fi ? I have gone through I think someone else has access to my wireless network. What next? but I have already taken the steps mentioned there.

    Read the article

  • IIM Calcutta &ndash; EPBM 14 &ndash; Campus Visit &ndash; Day 1 &ndash; Registration &amp; Beginning

    - by Ram Shankar Yadav
    Hey Guys! I’m back with the updates, it was an awesome Monday morning, for me it started when Sun came on my face, and the time was 5:30AM~~ I was amazed that this part of the country gets the sunrise quite early, but I ignored the sunlight for a while by covering my face, but…finally the door knocked….~ It was Mukesh, and the time was 6 AM, so I thought let’s get rid of laziness and start my day~ After having my brush and bath, I shaved and we headed for the Breakfast~ We quickly had our bread butter jam combo, and left for the Auditorium for Registration~ We searched for our names and signed the Registration paper and got a cool IIM C bag, with following in it: - a IIMC Notepad - Cello X Caliber pen - a book “What the Best MBAs Know”, and - Reading Material for Campus Sessions Today we had lectures on “Evolution of Indian Corporate Sector” (2 Session of 1.5 hrs each) and “Indian Economy: Crisis & Response” (2 Sessions of 1.5 hrs). “Evolution of Indian Corporate Sector” was by Prof. Raghabendra Chattopadhyay, was one of my best lectures I’ve ever attended in my life, he started with a question that saying that “The Indian Capitalists didn’t wanted the economy to open up till the economic reforms occurred?”, he is one of the best story tellers I’ve ever met, he started with the ancient European and Indian history and linked the trade & economics with it, simply amazing~ I can’t believe I didn’t get bore even after a 2hour long session…awesome~~ Afterward we had our lunch break, we did our lunch in “New Hostel” building and got back for “Indian Economy” sessions. Indian Economy session was taken by Sudip Chaudhuri, for us he’s a well known face as we have already attended his sessions on Macroeconomics~ It was an interactive, easy going, and a laughable session, and we did discussed some serious issues as well. After the class got over we went out and got few T-Shirts and Mugs for ourselves, and yep not to forget it “Rained” in Kolkata today~~ We got back and had our dinner and dispersed finally… I loved this amazing Monday, and hope the spirit continues till Saturday~ I’m feeling the enrichment in my thought and perceptions~ I’m lovin’ it~~ ram :)

    Read the article

  • From The OU Classrooms...

    - by rajeshr
    No excuses for not doing this systematically, and I'm trying my best to break this bad habit of bulk uploads of class photographs and do it regularly instead. But for the time being, please forgive my laziness and live by my mass introduction of all fun loving, yet talented folks whom I met in the OU classrooms during the last three months or so through these picture essay that follow. It's unfortunate, I don't get to do this for my Live Virtual Classes for obvious reason,but let me take a moment to thank them all as well for choosing OU programs on various products. Thanks again to each one for memorable moments in the OU classrooms: Pillar Axiom MaxRep session at Bangkok. For detailed information on the OU course on Pillar Axiom Max Rep, access this page. Pillar Axiom SAN Administration Session at Bangkok. Know more about the product here. Details on the Pillar Axiom training program from Oracle University can be found here. Oracle Solaris ZFS Administration & Oracle Solaris Containers session at Hyderabad. Read more about ZFS here. Gain information on Solaris Containers by going here. Oracle University courses on Solaris 10 and its features can be viewed at this page. Oracle Solaris Cluster program at Hyderabad. Here's the OU landing page for the training programs on Oracle Solaris Cluster. Oracle Solaris 11 Administration Session at Bangalore. If you are interested to get trained on Solaris 11, get more details at this webpage. Sun Identity Manager Deployment Fundamentals session at Bangalore. The product is n.k.a Oracle Waveset IDM. Click here to get detailed description on this fabulous hands on training program. With Don Kawahigashi at Taipei for Pillar Axiom Storage training.

    Read the article

  • Should I create my own Assert class based on these reasons?

    - by Mike
    The main reason I don't like Debug.Assert is the fact that these assertions are disabled in Release. I know that there's a performance reason for that, but at least in my situation I believe the gains would outweigh the cost. (By the way, I'm guessing this is the situation in most cases). And yes, I know that you can use Trace.Assert instead. But even though that would work, I find the name Trace distracting, since I don't see this as tracing. The other reason to create my own class is laziness I guess, since I could write methods for the most usual cases like Assert.IsNotNull, Assert.Equals and so forth. The second part of my question has to do with using Environment.FailFast in this class. Would that be a good idea? I do like the ideas put forth in this document. That's pretty much where I got the idea from. One last point. Does creating a design like this imply having an untestable code path, as described in this answer by Eric Lippert on a different (but related) question?

    Read the article

1 2 3  | Next Page >