instruction
stringlengths
0
30k
For Eclipse, I use: bin .* .* gets all the project configuration. You almost never want to check in a 'hidden' directory or file, but if it comes up, you can still svn add it.
|software-design|
How many people actually write an SDD document before writing a single line of code? How do you handle large CSCI's? What standard do you use for SDD content? What tailoring have you done?
I believe that the slow playing is caused by audio drivers problems. Can you give a link to the player?
I found a solution on the [MSDN Forums][1]. The sample code below will remove all `Click` events from `button1`. public partial class Form1 : Form { public Form1() { InitializeComponent(); button1.Click += button1_Click; butt...
Try this: git-fsck | awk '/dangling commit/ {print $3} It’s *much* faster than passing `--unreachable`, though it doesn’t show you all the unreachable commits, only the tips of the tree. The easiest way to then get at your commit is to pass that list to `gitk`: gitk --all $( git-fsck | awk '/danglin...
Try this: git-fsck | awk '/dangling commit/ {print $3}' It’s *much* faster than passing `--unreachable`, though it doesn’t show you all the unreachable commits, only the tips of the tree. The easiest way to then get at your commit is to pass that list to `gitk`: gitk --all $( git-fsck | awk '/dangli...
Reduced to the essential distinction, identity matters for entities, but does not matter for value objects. For example, someone's Name is a value object. A Customer entity might be composed of a customer Name (value object), List<Order> OrderHistory (List of entities), and perhaps a default Address (typically a value ...
Script everything (object creation, etc) and store those scripts in source control. How do the changes get there? It's part of the standard practice of how things are done. Need to add a table? Write a CREATE TABLE script. Update a sproc? Edit the stored procedure script. I prefer one script per object.
the main reason for avoiding throwing an exception is that there is a lot of overhead involved with throwing an exception. One thing the article below states is that an exception is for an exceptional conditions and errors. A wrong user name is not necessarily a program error but a user error... Here is a dece...
What does BlazeDS Livecycle Data Services do, that something like PyAMF or RubyAMF not do?
|python|ruby|ruby-on-rails|apache-flex|blazeds|
I'm doing a tech review and looking at AMF integration with various backends (Rails, Python, Grails etc). Lots of options are out there, question is, what do the Adobe products do (BlazeDS etc) that something like RubyAMF / pyAMF don't?
For the most part, external drives aren't a good option - unless your database is really small. Other than some of the options others have listed, you can also use UNC/Network shares as a great 'off-box' option. Check out the following video for some other options: [SQL Server Backup Options (Free Video)][1]...
Thanks for the excellent advice. We ended up using a custom HTTP header to pass an identity token from the client to the service, in preparation for integrating our RESTful API with the the upcoming Zermatt Identity framework from Microsoft. I have described the problem [here][1] and our solution [here][2]. I also took...
How do I limit the number of simultaneous downloads in Asp.net and/or IIS?
|asp.net|iis|website|internet|webpage|
I have a website with a lot of large files. However, I want don't want users to start downloading like 10 files at a time. I noticed there are website out there where they only allow 2 simultaneous downloads. My website is programmed using ASP.net running on IIS. Does anyone know how I can limit simultaneous downloa...
MSDN has the answer: <a href="http://msdn.microsoft.com/en-us/library/ms229017.aspx">Choosing Between Classes and Structures</a>. Basically, that page gives you a 4-item checklist and says to use a class unless your type meets all of the criteria.
MSDN has the answer: <a href="http://msdn.microsoft.com/en-us/library/ms229017.aspx">Choosing Between Classes and Structures</a>. Basically, that page gives you a 4-item checklist and says to use a class unless your type meets all of the criteria. Do not define a structure unless the type has all of the follo...
The standard method to attack this problem is to consider one block of data, hopefully at least twice the actual frequency (taking more data isn't bad, so it's good to overestimate a bit), then take the [FFT][1] and guess that the frequency corresponds to the largest number in the resulting FFT spectrum. By the way,...
Even with the same currency, you may have to display values with a different format (separators for instance), so I would recommend that you associate a LOCALE instead of the currency only with your values. You can use a simple Integer to hold the LCID (locale ID). See the list here: http://msdn.microsoft.com/en-...
You could do the truncate after the 'create if not exists'. That way it will always exist... and always be empty at that point. CREATE TABLE fubar IF NOT EXISTS TRUNCATE TABLE fubar
How do you create a MANIFEST.MF that's available when you're testing and running from a jar in production?
|java|ant|versioning|jar|manifest.mf|
I've spent far too much time trying to figure this out. This should be the simplest thing and everyone who distributes Java applications in jars must have to deal with it. I just want to know the proper way to add versioning to my Java app so that I can access the version information when I'm testing, e.g. debuggin...
I'm not sure if there's an official API for this, but if you have your heart set on it you could use Sysinternal's [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) and see what registry keys get touched when you set an HTML desktop background via the UI. Then you'd just need to repeat t...
Stored procedures should be created based on the data you intend to return, not the application making the request. If you have a stored procedure that is GetAllItems, it should return all of the items in the database. If one of the applications would like to get all of the items by category, create GetAllItemsByCatego...
TSQL: Are indexes on temporary tables deleted when the table is deleted?
|t-sql|
Would the following sql remove also the index or does it have to be removed seperately? CREATE TABLE #Tbl (field int) CREATE NONCLUSTERED INDEX idx ON #Tbl (field) DROP TABLE #Tbl
Well, it would appear that Silverlight does support the TileBrush, as referenced on MSDN: <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.tilebrush(VS.95).aspx">System.Windows.Media.TileBrush</a>. It first appears in Silverlight 2.0 Beta 2.
getattr(p, s) setattr(p, s, new_value)
Scripts are inappropriate for implementing certain mission-critical functions, since they must have both +r and +x permissions to function. Executables need only have +x. The fact that a script has +r means users might be able to make a copy of the script, edit/subvert it, and execute their edited Cuckoo's-Egg versi...
It will be removed automatically, as there is nothing left to index. Think of it as a child object in this respect.
[Ayende][1] has some good blog posts about building multi-tenancy apps. How NHibernate is used for it would depend on the type of multi-tenancy you are going for. [1]: http://www.ayende.com/Blog/archive/2008/08/06/Multi-Tenancy.aspx
I wouldn't rename cygdrive as I don't know what that would do, but you can map other directories at root to various windows directories using the `mount` command.
Yes, you can. See [The Cygwin Mount Table][1] in Cygwin's documentation. I have my documents folder mounted as /doc. These mounts end up in the registry and are retained across reboots etc. [1]: http://www.cygwin.com/cygwin-ug-net/using.html#mount-table
If you really can't use stl (and I regret believing that was true when I was in the games industry) then can you not create your own string class? The most basic of string class would allocate memory on construction and assignment, and handle the delete in the destructor. Later you could add further functionality as yo...
ORA-03113: end-of-file on communication channel Is the database letting you know that the network connection is no more. This could be because: 1. A network issue - faulty connection, or firewall issue 2. The server process on the database that is servicing you died unexpectedly. For 1) (firewall) search ta...
The important question you need to answer is if your feature will solve a real business need given the design you've come up with. Then it's only a matter of making the implementation match the design - making the "bugs" being non-bugs by defining them as not part of the intended behaviour of the feature (which should ...
I would say you should roam through github or some other open source site and find an existing young or old project that you can contribute to. Maybe there is something that is barely off the ground, or maybe there is a mature project that could use some improvement.
To summarize what I have learned so far: Here is the Base function that makes Class.extend() work in jquery (Copied from [Simple JavaScript Inheritance][1] by John Resig): // Inspired by base2 and Prototype (function(){ var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/...
It's worth figuring out css and divs so the central content column loads and renders before the sidebar in a page layout. But if you are struggling to use floating divs to vertically align a logo with some sponsorship text, just use the table and move on with life. The zen garden religion just doesn't give much bang ...
Dr. Dobb's had an article on the concept last year: Transactional Programming by Calum Grant -- http://www.ddj.com/cpp/202802978 It includes some examples, comparisons, and conclusions using his example library.
It is legal. We use it sometime to provide a default value which we might want to ignore. int dosomething(error_code& _e = ignore_errorcode()) { //do something } In the above case it will construct an empty error code object if no `error_code` is passed to the function.
If you are using .Net web controls then it is sometimes a lot easier just to use classes as .Net alters web contol div id's at run time (where they are using runat="server"). Using classes allows you to easily build up styles with separate classes for fonts, spacing, borders etc. I generally use multiple files to s...
If the class file you want to look into is open source, you should not decompile it, but instead attach the source files directly into your IDE. that way, you can just view the code of some library class as if it were your own
Yes, as MySQL doesn't support function-based indexes (like `ADD INDEX myIndex(LENGTH(text)))`, you'll need a new int column and define a [trigger][1] to auto-update it after inserts and updates. [1]: http://dev.mysql.com/doc/refman/5.1/en/create-trigger.html
In addition to the excellent answers above, I would also like to add: If your code runs on linux or if you can compile it on linux then I would suggest running it through [Valgrind][1]. It is an excellent tool, among the myriad of useful warnings it produces it also will tell you when you allocate memory as an array...
As well, an element you give a specific id to can be manipulated via JavaScript and DOM commands - GetElementById, for example. In general, I find it useful to give all of the main structural divs an id - even if initially, I don't have any specific CSS rules to apply, I have that capability there for the future. O...
[CodeBlocks][1] is a very good IDE that can use besides many other compilers CL.EXE (from visual studio) and gcc. It comes also in a version with gcc included. Visual Studio Express edition is avery good choice also (with Platform SDK if you will develop application that call winapi functions). [1]: http://w...
Can Access be set up to support 10-20 users? Yes. It, as well as all file-based databases use the file system for locking and concurrency control, however. And, Access data files are more susceptible to database corruption than are database servers. And, while you can set it up for this, you MUST, as David Fenton m...
create a "Database project" in Visual Studio to write and manage your sQL code and keep the project under version control together with the rest of your solution.
In short: No. Longer answer: Kinda. Any item stored in sharepoint is in a list, including files. But not all lists have files. A document library is a list with each element being a file+metadata. Other lists (like announcments) are just metadata. Only lists that contain files are exposed via webdav, and even then ...
I've used the [Win32::GuiTest](http://winguitest.sourceforge.net) Perl module to do this kind of thing in the past.
This will probably sound silly but... I used to have this kind of problem all the time until I decided in the end that if I'm always _deploying_ on Linux, I ought really to at least try _developing_ on Linux also. I did. It was pain free. I never went back. Now. I am not suggesting this is for everyone. But, if you...
For procs, write the procs with script wrappers into plain files, and apply the changes from those files. If it applied correctly, then you can check in that file, and you'll be able to reproduce it from that file as well. For schema changes, you may need to check in scripts to incrementally make the changes you've...
gcc with -Wall (enable all warnings) -Werror (change warnings into errors), -pedantic (get warnings for non-standard code) and -ansi (make the standard c++98). If a warning is something you're aware of and need to turn off, you can always turn them back into warnings.
Is There Any Advantage in Passing a UI wrapper to a view
|design-patterns|oop|
Most of the MVC samples I have seen pass an instance of the view to the controller like this public class View { Controller controller = new Controller(this); } Is there any advantage to passing a class which provides access to just the the properties and events the controller is intere...
Try this, from java.awt.Toolkit, returns a boolean: Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)
I tried doing this myself a while ago, and I never got it to work perfectly. Actually I never got it to work at all under Windows, as it kept crashing the entire OS and I ran out of patience. I continued to use it though as it was only important it ran on Linux, and was only a small project. I'd strongly recommend you ...
I find to complete a project, it needs to be something I am passionate about. I feel you need to find your own project I'm afraid. There is always the [Netflix Prize][1] though! [1]: http://www.netflixprize.com/
I just found that the equivalent to mouse hovering is `View -> IntelliSense -> Quick Info`. If the solution does not arise here, I'll just use the shortcut `Ctrl+K, Ctrl+I`.
here is some info on the class http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Toolkit.html#getLockingKeyState(int)
I'l try the book [About face: Essential of User Interface Design][1], its centered on design practices for UI as well as designing taking into account the user goals, that is, what the user wants to acomplish trying to get you away for the "developer GUI design". It also reviews some history about GUI design from Mi...
VS 2008 has the ability to debug though the .NET framework (http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx) This is probably your best bet, you can see what's happening and what all the properties are at the exact point in time
I would write a <a href="http://www.cs.unc.edu/~rademach/xroads-RT/RTarticle.html">ray tracer</a>. Oops, sorry... you're looking for an original idea. :) Ray tracers are still cool, though, and easy to get started on. Maybe you'll get an idea for a game while you're working on it.
String is a final class means it cannot be extended to work on your own implementation.
*HACK* you're going to have to check all types in the graph of objects being serialized for the serializable attribute. The easiest way is to try to serialize the object and catch the exception. (But that's not the cleanest solution).
You're going to have to check all types in the graph of objects being serialized for the serializable attribute. The easiest way is to try to serialize the object and catch the exception. (But that's not the cleanest solution). Type.IsSerializable and checking for the serializalbe attribute don't take the graph into ac...
It's a hard-wired feature of garbage collector. Running threads are not collected.
You can create a custom page for the particular table you want to change. There's an example [here][1]. Within your custom page, you can then set `AutoGenerateColumns="false"` within the `asp:GridView` control, and then define exactly the columns you want, like this: <Columns> ... <asp:Dyna...
[TestMethod] public void GetFoo_NotNull_Test_ForFile() { GetFoo_NotNull(new FileRepository().GetRepository()); } [TestMethod] public void GetFoo_NotNull_Test_ForSql() { GetFoo_NotNull(new SqlRepository().GetRepository()); } private void...
Actually, the recommended way now is to use `mkp.yield`, e.g., src.p { mkp.yield 'Some element that has a ' strong 'child element' mkp.yield ' which seems pretty basic.' } to produce <p>Some element that has a <strong>child element</strong> which seems pretty basic.</p> ...
It is not possible, since String is a final class in Java. You could use a helper method all the time you want to prefix something. If you don't like that you could look into Groovy or Scala, JRuby or JPython both are languages for the JVM compatible with Java and which allow such extensions.
I think you should write a script which automatically sets up your database, including any stored procedures. This script should then be placed in source control.
The Windows API SendMessage can be used to do this. http://msdn.microsoft.com/en-us/library/ms644950(VS.85).aspx IS ti possible it's not responding because some other running process has responded with a zero (making the system wait on it.)
You can use a combination of the RequiredFieldValidator and CompareValidator (Set to DataTypeCheck for the operator and Type set to Integer) That will get it with a normal textbox if you would like, otherwise the recommendation above is good.
PHP and Python are similiar enough to not warrent any kind of switching. Any performance improvement you might get from switching from one language to another would be vastly outgunned by simply not spending the money on converting the code (you don't code for free right?) and just buy more hardware.
Bah, I should have included versions tried in the original question. I've tried a combination of swfobject 1.5, 2.0, and 2.1 (current) and both the 1.7.x and 1.8.x versions of scriptaculous, which rely on 1.5.x and 1.6.x of prototype.js, respectively. I've tried loading swfobject both before and after the protoype/...
How to Setup a Low cost cluster
|cluster-analysis|
At my house I have about 10 computers all different processors and speeds (all x86 compatible). I would like to cluster these. I have looked at openMosix but since they stopped development on it I am deciding against using it. I would prefer to use the latest or next to latest version of a mainstream distribution of Li...
At my house I have about 10 computers all different processors and speeds (all x86 compatible). I would like to cluster these. I have looked at openMosix but since they stopped development on it I am deciding against using it. I would prefer to use the latest or next to latest version of a mainstream distribution of Li...
In [8]: str('2'.__class__)<br /> Out[8]: "<type 'str'>"<br /> In [9]: str(len.__class__)<br /> Out[9]: "<type 'builtin_function_or_method'>"<br /> In [10]: str(4.6.__class__)<br /> Out[10]: "<type 'float'>"<br /> Or, as was pointed out before,<br /> In [11]: 4.6.__class__.__name__<br /> Out[11]: 'float'...
for //2 you need a const reference for //1 I think it's legal but useless
In Rails, What's the Best Way to Get Autocomplete that Shows Names but Uses IDs?
|ruby-on-rails|autocomplete|model-driven|model|
I want to have a text box that the user can type in that shows an Ajax-populated list of my model's names, and then when the user selects one I want the HTML to save the model's ID, and use that when the form is submitted. I've been poking at the auto_complete plugin that got excised in Rails 2, but it seems to have...
|ruby-on-rails|model|autocomplete|model-driven|model-auto-completer|
The last portion of your question I believe answered itself. With already poor communication, sharing procedures between development teams would just add to the potential points of failure and could cause either team hardship. If I'm on the same team working on multiple projects we will save some time and share p...
My experience has been that having SPs shared by multiple applications is a cause of pain. In fact, I would argue that having a database that is accessed directly by more than one applicaiton is not the best long term architecture. The pattern I recommend and have implemented is that only one application should "ow...
I suppose the answer depends on your db. For example SQL Server has full text search and also English Language Queries if ever needed.
I guess I don't get bonus points, but Zend Studio works for me on my Mac connecting to Apache running in VMware.
No, not using the default System.Xml.XmlSerializer: you'd need to change the data type to an int to achieve that, or muck around with providing your own serialization code (possible, but not much fun). However, you can simply post-process the generated XML instead, of course, either using XSLT, or simply using stri...
How do you clear your MRU list in Visual Studio?
|visual-studio|mru|