instruction
stringlengths
0
30k
If you have to use them use capitals, this draws attention to them and singles them out from being mistakenly interpreted as "Class" names. Drawing attention to them has the additional benefit of catching someone's eye that will come along and refactor your code and remove them. ;)
I vaguely recall having problems with SSRS on one machine when we changed the "Enable HTTP Keep-Alives" setting in IIS. Try toggling that checkbox (I don't remember whether it was checked or unchecked when it caused us problems).
if ($entry.EntryType -eq "Error") Being Object Oriented, you want to test the property in question with one of the standard comparison operators you can find [here][1]. I have a [PS script][2] watching logs remotely for me right now - some simple modification should make it work for you. [1]: http://www.computerperformance.co.uk/powershell/powershell_syntax.htm#Operators_ [2]: http://slipsec.blogspot.com/2008/04/monitoring-remote-event-logs-from.html
if ($entry.EntryType -eq "Error") Being Object Oriented, you want to test the property in question with one of the standard comparison operators you can find [here][1]. I have a [PS script][2] watching logs remotely for me right now - some simple modification should make it work for you. edit: I suppose I should also add that is a cmdlet built for this already if you don't want to unroll the way I did. Check out: man Get-EventLog Get-EventLog -newest 5 -logname System -EntryType Error [1]: http://www.computerperformance.co.uk/powershell/powershell_syntax.htm#Operators_ [2]: http://slipsec.blogspot.com/2008/04/monitoring-remote-event-logs-from.html
They are kind of the goto of Java - not sure if C# has them. I have never used them in practice, I can't think of a case where avoiding them wouldn't result in much more readable code. But if you have to- I think all caps is ok. Most people won't use labelled breaks, so when they see the code, the caps will jump out at them and will force them to realise what is going on.
> I know, I should not use labels. >But just assume, I have some code, that could gain a lot in readability from labeled breaks, how do I format them. Mo, your premise is wrong. The question shouldn't be 'how do I format them?' Your question should be 'I have code that has a large amount of logic inside loops - how do I make it more readable?' The answer to that question is to move the code into individual, well named functions. Then you don't need to label the breaks at all.
I find VisualSVN to be well worth the money. There are ways to do it with Tortoise, but the integration of VisualSVN is very nice. I had tried over VS-integration tools before like Ankh and was not impressed. V-SVN has really upped the level of interaction with the repository from the IDE. The quick trick in TortoiseSVN to fix the move sounds pretty nice as well, I need to try that out. Another bonus: I've yet to "forgot" to add a file to the repository since I got Visual SVN.
Flyweight really is just a way of conserving resources in situations where there are thousands of objects with intrinsic shared state, so it could be useful in higher level languages than C/C++. Maybe the GOFs example using glyphs in a document was not the best choice to illustrate this pattern. I think there's a lot more to building a high performance word processor than just these basic patterns though - not sure whether there is anything in GOF that rules out being able to successfully do this. Generally, Visual Studio is more advanced and performs significantly better than Eclipse - at least, the versions of VS that I have seen. Eclipse is one of the most impressive Java applications out there though, it runs quite well on more recent machines with lots of RAM.
Like Rob Allen, I use SQL Compare / Data Compare by Redgate. I also use the Database publishing wizard by Microsoft. I also have a console app I wrote in C# that takes a sql script and runs it on a server. This way you can run large scripts with 'GO' commands in it from a command line or in a batch script. I use Microsoft.SqlServer.BatchParser.dll and Microsoft.SqlServer.ConnectionInfo.dll libraries in the console application.
Version Control for Graphics
|version-control|graphics|versioning|
Say a development team includes (or makes use of) graphic artists who create all the images that go into a product. Such things include icons, bitmaps, screen backgrounds, button images, animations, etc. Obviously, everything needed to build a piece of software should be under some form of version control. Should the graphics people use the same version-control system and repository that the coders do? If not, what should they use, and what is the best way to keep everything synchronized?
I think John is correct. "My main concern is that instantiating and disposing one huge DataContext class all the time for individual operations that relate to specific areas of the Database would be impose an unnecessary imposition on application resources" How do you support that statement? What is your experiment that shows that a large DataContext is a performance bottleneck? Having multiple datacontexts is a lot like having multiple databases and makes sense in similar scenarios, that is, hardly ever. If you are working with multiple datacontexts you need to keep track of which objects belong to which datacontext and you can't relate objects that are not in the same data context. That is a costly design smell for no real benefit. @Evan "The DataContext (or Linq to Entities ObjectContext) is more of a "unit of work" than a connection" That is precisely why you should not have more than one datacontext. Why would you want more that one "unit of work" at a time?
What are the best practices when using SWIG with C#?
|swig|c#|c|
Has anybody out there used the [SWIG][1] library with C#? If you have, what pitfalls did you find and what is the best way to use the library? I am thinking about using it as a wrapper for a program that was written in C and I want to wrap the header files where I can use them in my .NET application. [1]: http://www.swig.org/exec.html
|c#|c|swig|
Has anybody out there used the [SWIG][1] library with C#? If you have, what pitfalls did you find and what is the best way to use the library? I am thinking about using it as a wrapper for a program that was written in C and I want to wrap the header files where I can use them in my .NET application. ####Edit: Some clarification on target OS's. I plan on running the application on Linux and Windows, therefore the reasone I am looking into SWIG. P/Invoke is not an option. [1]: http://www.swig.org/exec.html
Has anybody out there used the [SWIG][1] library with C#? If you have, what pitfalls did you find and what is the best way to use the library? I am thinking about using it as a wrapper for a program that was written in C and I want to wrap the header files where I can use them in my .NET application. ####Edit: Some clarification on target OS's. I plan on running the application on Linux and Windows, therefore the reason I am looking into SWIG. P/Invoke is not an option. [1]: http://www.swig.org/exec.html
The best way that I know of because of leap years and everything is: DateTime birthDate = new DateTime(2000, 1, 1); int age = (DateTime.Now - birthDate).Days /365; Hope this helps.
The best way that I know of because of leap years and everything is: DateTime birthDate = new DateTime(2000, 1, 1); int age = Convert.ToInt32((DateTime.Now - birthDate).TotalDays /365.25D); Hope this helps.
The best way that I know of because of leap years and everything is: DateTime birthDate = new DateTime(2000,3,1); int age = (int)Math.Floor((DateTime.Now - birthDate).TotalDays / 365.25D); Hope this helps.
I have been using the 64Bit version of TortoiseSVN for ages and I have never had issues with it on Windows 64Bit or Vista 64Bit. I am currently not aware of any other similiar SVN clients that do work on Vista. Is it possible the problem could lie within the configuration of TortoiseSVN or even the installation of Vista? Is the problem occurring on Vista native or SP 1?
I'll second Diago's answer. I use TortoiseSVN on Vista x64 pretty heavily. I did upgrade directly from an older version to 1.5.2 though, and never used 1.5.1. Have you tried 1.5.2?
TortoiseSVN in combination with VisualSVN for VS.
I too get explorer crashes in Vista (I'm not in the 64Bit version though). I'm using Vista Super Saijen (or whatever they are calling the most expensive version). I'm not having any bugs with Tortoise. My explorer does, however, crash about every other day (sometimes multiple times a day if it's having an "off" day). I'm not positive it's being caused by TortoiseSVN though. From what I hear, the explorer just crashes a lot in Vista... Have you tried uninstalling Tortoise and using Windows for a day or two and seeing if it still crashes? Do you restart your computer at least once a day (It seems the longer I go between restarts, the worse the crashes get)?
The answer above is correct but I think there is a lot of confusing additional detail there. The basic answer is "in a BLOB column". BLOB is short for Binary Large OBject and that column type is specifically for handling binary data. See [the relevant manual page][1]. [1]: http://http://dev.mysql.com/doc/refman/5.0/en/blob.html
The answer above is correct but I think there is a lot of confusing additional detail there. The basic answer is "in a BLOB column". BLOB is short for Binary Large OBject and that column type is specifically for handling binary data. See [the relevant manual page][1]. [1]: http://dev.mysql.com/doc/refman/5.0/en/blob.html
Wound up using this, kind of a hack, but actually works pretty well. Only thing is you have to be very careful with your semicolons. : D var strSql:String = stream.readUTFBytes(stream.bytesAvailable); var i:Number = 0; var strSqlSplit:Array = strSql.split(";"); for (i = 0; i < strSqlSplit.length; i++){ NonQuery(strSqlSplit[i].toString()); }
It depends on how the property is used. For example, say you have a student object that has a name property. You could use your Get method to pull the name from the database, if it hasn't been retrieved already. This way you are reducing unnecessary calls to the database. Now let's say you have a private integer counter in your object that counts the number of times the name has been called. You may want to not use the Get method from inside the object because it would produce an invalid count.
[OpenNETCF][1] is a large collection of classes, components and controls for the compact framework. I'm not sure that they have anything that'll jazz up your UI, but it'd be worth a look. [1]: http://www.opennetcf.com/
I tried mono 1.9.1 (Mono 2.0 beta) and had some problems with sorting, generated columns, and some nasty exceptions.
A number of vendors provide controls for the Windows Mobile environment. [Component One Mobile][1] [Pocket PC Controls][2] [Resco Mobile Forms Toolkit][3] [1]: http://www.componentone.com/SuperProducts/StudioMobile/ [2]: http://www.pocketpccontrols.com/ [3]: http://www.resco.net/developer/mobileformstoolkit/overview.aspx
You didn't specify what you meant by fastest. If you want to get the answer quickly without writing any code, I would give the [gpsbabel radius filter][1] a go. [1]: http://www.gpsbabel.org/htmldoc-1.3.3/filter_radius.html
Why is git better than Subversion?
|subversion|git|
I've been using Subversion for a few years and after using SourceSafe, I just love Subversion. Combined with TortoiseSVN, I can't really imagine how it could be any better. Yet there's a growing number of developers claiming that Subversion has problems and that we should be moving to the new breed of distributed version control systems, such as [Git][1]. Can anyone explain how Git improves upon Subversion? [1]: http://git.or.cz/ "Git Distributed Version Control System"
|svn|subversion|git|
|svn|git|
|svn|git|
Use the value of the $TMP environment variable, and if that doesn't exist, use `/tmp`.
Use the value of the $TMPDIR environment variable, and if that doesn't exist, use `/tmp`.
Run them as a two stage process with your "autorun" script calling the second script in a new terminal eg gnome-terminal -e top --title Testing Would run top in a new gnome terminal window with the title "Testing" You can add additional arguments like setting the geometry to determine the size and location of the window checkout the man page for *gnome-terminal* and the "X" man page for more details
xterm -e shellscript.sh or (if xterm isn't installed) gnome-terminal -e shellscript.sh or (if you're using kubuntu / kde) konsole -e shellscript.sh
If you query the registry, you can retrieve the data about the registered file type and then call the app directly passing the command line arguments. See [Programmatically Checking and Setting File Types][1] for an example of retrieving shell information for a file type. [1]: http://www.blackwasp.co.uk/ProgrammaticFileTypes.aspx
Using my code from [this][1] answer you can get command associated with xls extension. Then you can pass this command to Process.Start method. [1]: http://stackoverflow.com/questions/24954/windows-list-and-launch-applications-associated-with-an-extension#24974
From the demos of the designer I've seen, it's not a flawless tool. It is a version 1.0 product, so it's bound to have some pain points. The change type is one of them it seems. From watching the designer and the code generation, I figured that one would break either at compile time (not likely) or at run-time (when the model is actually executed).
I feel your pain. We have an application which is 'cross-platform'. A typical client/server application where the client needs to be able to run on windows and linux. Since our client base mostly uses windows we work using VS2008 (the debugger makes life a lot easier) - however we still need to perform linux builds. The major problem with this was we were checking in code that we didn't know would build under gcc, which would more than likely break the CI stuff we had setup. So we installed [MingGW][1] on all our developer's machines which allows us to test that working copy will build under gcc before we commit it back to the repository. [1]: http://www.mingw.org/
Well, flyweight is a ridiculous pattern to use in a word processor. IIRC, they had each character being referenced as a object. With a pointer being wider than a character and all the processing associated with indirection, you'd be mad to use that particular pattern that way in a word processor.
Well, [flyweight][1] is a ridiculous pattern to use in a word processor. IIRC, they had each character being referenced as a object [note: it was for each *glyph*, which is still crazy because your OS will happily draw that for you]. With a pointer being wider than a character and all the processing associated with indirection, you'd be mad to use that particular pattern that way in a word processor. If you're interested in the design of word processors, I found an article that doesn't address patterns but does look at some of the [data structures underlying word processor design and design considerations][2]. [1]: http://en.wikipedia.org/wiki/Flyweight_pattern [2]: http://www.bluemug.com/research/text.pdf
Well, [flyweight][1] is a ridiculous pattern to use in a word processor. IIRC, they had each character being referenced as a object [note: it was for each *glyph*, which is still crazy because your OS will happily draw that for you]. With a pointer being wider than a character and all the processing associated with indirection, you'd be mad to use that particular pattern that way in a word processor. If you're interested in the design of word processors, I found an article that doesn't address patterns but does look at some of the [data structures underlying word processor design and design considerations][2]. Try to remember that design patterns are there to make your life easier, not for you to be pure. There has to be a reason to use a pattern, it has to offer some benefit. [1]: http://en.wikipedia.org/wiki/Flyweight_pattern [2]: http://www.bluemug.com/research/text.pdf
You should really check the Free as in Beer option of [AnkhSVN][1]. They made some major improvements in v2.x and I don't feel penalized anymore when doing ReSharper refactoring-ninja moves inside Visual Studio. [1]: http://ankhsvn.open.collab.net/
PHP doesn't support enums, which might be one area of mismatch. Also, watch out for collection types, PHP despite it's OO features, tends to have no alternative to over-using the array datatype. Check out the sections on the PHP manual on iterators if you would like to see beyond this. Public, protected, private, and static properties of classes all work roughly as expected.
Use something like Host Monitor <http://www.ks-soft.net/hostmon.eng/> to monitor the Event Log for messages related to the failover event, which can send you an alert via email/SMS. I'm curious though how you wouldn't need to know that the failover happened, because don't you have to then update the datasources in your applications to point to the new server that you failed over to? Mirroring takes place on different hosts (the primary and the mirror), unlike clustering which has multiple nodes that appear to be a single device from the outside. Also, are you using a witness server in order to automatically fail over from the primary to the mirror? This is the only way I know of to make it happen automatically, and in my experience, you get a lot of false-positives where network hiccups can fool the mirror and witness into thinking the primary is down when in fact it is not.
We use subversion. Just place a folder under /trunk/docs for comps and have designers check out and commit to that folder. Works like a champ.
I found the answer to my own question by finding a more compatible implementation of <code>stdbool.h</code> that is compliant with the C99 standard. <pre><code>#ifndef _STDBOOL_H #define _STDBOOL_H #include <stdint.h> /* C99 Boolean types for compilers without C99 support */ /* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */ #if !defined(__cplusplus) #if !defined(__GNUC__) /* _Bool builtin type is included in GCC */ /* ISO C Standard: 5.2.5 An object declared as type _Bool is large enough to store the values 0 and 1. */ /* We choose 8 bit to match C++ */ /* It must also promote to integer */ typedef int8_t _Bool; #endif /* ISO C Standard: 7.16 Boolean type */ #define bool _Bool #define true 1 #define false 0 #define __bool_true_false_are_defined 1 #endif #endif</code></pre> This is taken from the [Ada Class Library](http://sourceforge.net/projects/adacl) project.
'goto' usage
|language-agnostic|
I've long been under the impression that 'goto' should never be used if possible. While perusing libavcodec (which is written in C) the other day, I noticed multiple uses of it. Is it ever advantageous to use 'goto' in a language that supports loops and functions? If so, why?
|language-agnostic|
I would definately put the graphics under version control. The diff might not be very useful from within a diff tool like diffmerge, but you can still checkout two versions of the graphic and view them side by side to see the differences. I don't see any reason why the resultant graphics shouldn't be kept in the save version control system that the coders use however when you're creating graphics using PSD files or PDN files you might want to create a seperate repository for those as they have a different context to the actual end jpeg or gif that is produced and deployed with the developed application.
@lomaxx TortoiseSVN includes a program called TortoiseIDiff which looks to be a diff for images. I haven't used it but looks intriguing.
Interesting question. I don't have a bunch of experience working directly with designers on a project. When I have, it's been through a contractual sort of agreement where they "delivered" a design. I have done some of my own design work for both web sites and desktop applications, and though I have not used source control in the past, I am in the process of implementing SVN for my own use as I am starting to do some paid freelance work. I intend to utilize version/source control precisely the way I would with source code. It just becomes another folder in the project trunk. The way I have worked without source control is to create an *assets* folder in which all media files that are equivalents of source code reside. I like to think of Photoshop PSD's as *graphics source code* while the JPEG output for a web site or otherwise is the *compiled version*. In the case of working with designers, which is a distinct possibility I face in the near future, I'd like to make an attempt to have them "check-in" their different versions of their source files on a regular basis. I'll be curious to read what others with some experience will say in response to this.
I'm agreeing with Mike Stone also. My company recently implemented a new user table for outside clients (as opposed to internal users who authenticate through LDAP). For the external users, we chose to store the GUID as the primary key, and store the username as varchar with unique constraints on the username field. Also, if you are going to store the password field, I highly recommend storing the password as a salted, hashed binary in the database. This way, if someone were to hack your database, they would not have access to your customer's passwords.
Learning a new programming language or technology is for one of three reasons:<br/> 1. Need: you're starting a project for building a web application and you don't know anything about ASP.NET<br/> 2. Enthusiasm: you're very excited about ASP.NET MVC. why not try that?<br/> 3. Free time: but who has that anyway. The best reason to learn something new is Need. If you need to do something that the .NET framework can't do (like performance for example) then WinAPI is your solution. Until then we keep ourself busy with learning about .NET
Compressing / Decompressing Folders & Files in C#?
|c#|compression|folders|file|
Anyone know of a good way to do this in C# quickly? Handling large files might be necessary. Thanks in advance? :)
Compressing / Decompressing Folders & Files in C#?
Anyone know of a good way to do this in C# quickly? Handling large files might be necessary. Thanks in advance? :) ![alt text][1] [1]: http://kevinx.net/labs/php/badge.php?txt=FireFox%20ReloadEvery%20Power%20User&c=g
Anyone know of a good way to do this in C# quickly? Handling large files might be necessary. Thanks in advance? :) ![alt text][1] [1]: http://kevinx.net/labs/php/badge.php?txt=F5%20F5%20F5%20F5%20&c=g
Anyone know of a good way to do this in C# quickly? Handling large files might be necessary. Thanks in advance? :) ![alt text][1] [1]: http://kevinx.net/labs/php/badge.php?txt=F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20&c=g
Anyone know of a good way to do this in C# quickly? Handling large files might be necessary. Thanks in advance? :) ![alt text][1] [1]: http://kevinx.net/labs/php/badge.php?txt=F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5%20F5&c=g
@Daniel You could just add a second host header and internal IP address to the site for internal non-ssl access 172.16.3.1:443:portal.mycompany.com 172.16.3.2:80:internalportal
It's important to know what is available with the Windows API. I don't think you need to crank out code with it, but you should know how it works. The .NET Framework contains a lot of functionality, but it doesn't provide managed code equivalents for the entire Windows API. Sometimes you have to get a bit closer to the metal, and knowing what's down there and how it behaves will give you a better understanding of how to use it.
We are using a similar solution to what you described. We have our code stored on the Windows side of the world and UNIX (QNX 4.25 to be exact) has access though an NFS mount (thanks to UNIX services for Windows). We have an ssh into UNIX to run make and the pipe to output into VS. Accessing the code is fast, builds are a little slower than before, but our longest compile is currently less than two minutes, not a big deal. Using VS for UNIX development has been worth the effort to set it up, because we now have IntelliSense. Less typing = happy developer.
This is due to how subversion works. Each revision is really a snapshot of the repository identified by that revision number. If all your projects share a repository then it is unavoidable. Typically, in my experience, however you would setup separate repositories for completely unrelated projects. So short answer is no you are doing nothing wrong it is a common question surrounding subversion but it makes sense when you think about how it stores repository information.
Can I configure VisualStudio 2008 to always build the startup project?
|visual-studio|
I have a solution with several projects, where the startup project has a post-build event that does all the copying of "plugin" projects and other organizing tasks. After upgrading the solution from VS 2005 to VS 2008, it appears as though the post-build event only fires if I modify the startup project, which means my updated plugins don't get plugged in to the current debugging session. This makes sense, but it seems like a change in behavior. Is anyone else noticing a change in behavior with regard to which projects get built? Does anyone know of a workaround that I can use to force the startup project to rebuild whenever I hit F5? Perhaps I configured VS 2005 to work this way so long ago that I've forgotten all about it ...
I store one project per repository, and like a previous [commenter][1] on this [subversion question][2], I mark shared projects as external, so that they are only in source control once. I'm just starting to add a CI build server (CruiseControl.NET), so I'll have to see how that all works out, but if my build scripts are right it should not be a problem. Other than appearance though, it is really a matter of preference (in my opinion). [1]: http://stackoverflow.com/questions/15621/subversion-question#15651 [2]: http://stackoverflow.com/questions/15621/subversion-question
The revision number should really only be an identifier for a particular version. Whether it's sequential for a project or not shouldn't matter. That being said, I can understand that it's less than ideal. Most projects I've encountered have been setup in a single repository and the revision ids behave in this way. I don't know any SVN configuration option to change this behavior, and IMHO, maintaining multiple repositories seems like an unnecessary overhead.
Developer Setup for Starting Out with Cocoa/Mac Programming
|mac|macos|cocoa|
I'd like to start experimenting with Cocoa and programming for Mac OSX. I'm not terribly concerned with Objective C syntax/constructs/bheaviors at this point, but more curious as to an efficient setup on in terms of an editor and/or IDE that will get me going quickly. Is there any IDE even remotely similar to Visual Studio (since that's where I've spent most of my time over the last 7 years) in terms of it's solution/project concept? Any other tools, tips, suggestions and/or resources to get up and experimenting quickly? I'd like to avoid a lot of the intro stuff and get into things like "If you want to create an Mac desktop application, you can use <i>Acme IDE</i> and set up your project like this."
This may be too basic or limited of a solution, but couldn't you do a [String.split()][1] on each line of the file, remembering the result array of the first line to generate the XML, and just spit each line's array data out with the proper XML elements padding each iteration of a loop? [1]: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#split(java.lang.String)
This has religious war potential, but it seems to me that if you're using a getter/setter, you should use it internally as well - using both will lead to maintenance problems down the road (e.g. some adds code to a setter that *needs* to run every time that property is set, and the property is being set internally w/o that setter being called).
This has religious war potential, but it seems to me that if you're using a getter/setter, you should use it internally as well - using both will lead to maintenance problems down the road (e.g. somebody adds code to a setter that *needs* to run every time that property is set, and the property is being set internally w/o that setter being called).
Rolling your own PHP solution will certainly work though I'm not sure if there is a good way to automatically duplicate the schema from one DB to the other (maybe this was your question). If you are just copying data, and/or you need custom code anyway to convert between modified schemas between the two DB's, I would recommend using PHP 5.2+ and the PDO libraries. You'll be able to connect using PDO ODBC (and use MSSQL drivers). I had a lot of problems getting large text fields and multi-byte characters from MSSQL into PHP using other libraries.
> Am I just going overboard here? Perhaps ;) Another approach would be to utilize a private/protected method to actually do the getting (caching/db/etc), and a public wrapper for it that increments the count: PHP: public function getName() { $this->incrementNameCalled(); return $this->_getName(); } protected function _getName() { return $this->name; } and then from within the object itself: PHP: $name = $this->_getName(); This way you can still use that first argument for something else (like sending a flag for whether or not to used cached data here perhaps).
Another tool to try would be the SQLMaestro suite - http://www.sqlmaestro.com It is a little tricky nailing down the precise tool, but they have a variety of tools, both free and for purchase that handle a wide variety of tasks for multiple database platforms. I'd suggest trying the Data Wizard tool first for MySQL, since I believe that will have the proper "import" tool you need.
Well, it seems with C# 3.0 properties' default implementation, the decision is taken for you; you HAVE to set the property using the (possibly private) property setter. I personally only use the private member-behind when not doing so would cause the object to fall in an less than desirable state, such as when initializing or when caching/lazy loading is involved.
As stated in some of the comments: Sometimes you should, sometimes you shouldn't. The great part about private variables is that you are able to see all the places they are used when you change something. If your getter/setter does something you need, use it. If it doesn't matter you decide. The opposite case could be made that if you use the getter/setter and somebody changes the getter/setter they have to analyze all the places the getter and setter is used internally to see if it messes something up.
In college I've had numerous design and [UML][1] oriented courses, and I recognize that UML can be used to benefit a software project, especially [use-case][2] mapping, but is it really practical? I've done a few co-op work terms, and it appears that UML is not used heavily in the industry. Is it worth the time during a project to create UML diagrams? Also, I find that class diagrams are generally not useful, because it's just faster to look at the header file for a class. Specifically which diagrams are the most useful? **Edit:** My experience is limited to small, under 10 developer projects. **Edit:** Many good answers, and though not the most verbose, I belive the one selected is the most balanced. [1]: http://en.wikipedia.org/wiki/Unified_Modeling_Language [2]: http://en.wikipedia.org/wiki/Use_case
Getting Started with Unit Testing
|bestpractices|unit-testing|
Unit tests are small blocks of innocuous code that use your assumptions to see if a function returns the expected result. My question is, what are the current "best practices" in terms of tools as well as when and where to use unit testing as part of your daily coding? Lets try to be somewhat language agnostic and cover all the bases.
|bestpractices|unittesting|
|unit-testing|
C# Database Access: DBNull vs null