instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>In Access, I have a table like this one:</p>
<pre><code>Date | EmployeeNum | Award
11-JAN-08 | 34 | GoldStar
13-JAN-08 | 875 | BronzeTrophy
13-JAN-08 | 34 | BronzeTrophy
18-JAN-08 | 875 | BronzeTrophy
</code></pre>
<p>And I want to have a table count them like this:</p>
<pre... | <p>You will need a crosstab (aka pivot) query for that. Try the following SQL and modify to suit your needs:</p>
<pre><code>TRANSFORM Count(MyTable.EmployeeNum) AS AantalVanEmployeeNum
SELECT MyTable.EmployeeNum
FROM MyTable
GROUP BY MyTable.EmployeeNum
PIVOT MyTable.Award;
</code></pre>
| <p>I would use the query below to get your totals:</p>
<pre><code>SELECT EmployeeNum,
SUM(Case [Award] WHEN 'GoldStar' THEN 1 ELSE 0 END) As [GoldStar],
SUM(CASE [Award] WHEN 'BronzeTrophy' THEN 1 ELSE 0 END) As [BronzeTrophy]
FROM MyTable
Group By EmployeeNum
</code></pre>
| 45,631 |
<p>Oracle is giving me an error (ORA-00907: missing right parenthesis) when I run this query:</p>
<pre><code>select *
from reason_for_appointment
where reason_for_appointment_id in
(
select reason_for_appointment_id
from appointment_reason
where appointment_id = 11
order by appointment_reason_id
... | <p>The inner query results will never be displayed, so theres no point in doing the order by in the nested select. Apply it to the outer query instead. </p>
| <p>select * from reason_for_appointment where reason_for_appointment_id in (select reason_for_appointment_id from appointment_reason where appointment_id = 11 order by appointment_reason_id)</p>
<p>try something like:
with auxiliar as (select reason_for_appointment_id from appointment_reason where appointment_id = 11... | 30,820 |
<p>Is it possible to intercept every request made from a page using javascript? i.e. Clicking on a link, loading an image, ajax request...</p>
| <p>In a word, no. There's no place you can hook into to get all the requests.</p>
<p>Having said that, you can us javascript to place event handlers on the links, look at the src attribute of image tags and so on. There's no "generic" way to hook into all the AJAX requests - it depends on the library you're using.</... | <p>Greg's right, there's no one place you can hook into all the requests. Having said that, what is your end goal in rewriting <em>all</em> the requests? If you need to add a "parameter" to every request and then use it on the server side, one way to do it is the host header. You can modify the host header on the serve... | 40,647 |
<p>I want to make this specialized w/o changing main. Is it possible to specialize something based on its base class? I hope so.</p>
<p>-edit-</p>
<p>I'll have several classes that inherit from SomeTag. I don't want to write the same specialization for each of them.</p>
<pre><code>class SomeTag {};
class InheritSome... | <p>This article describes a neat trick: <a href="http://www.gotw.ca/publications/mxc++-item-4.htm" rel="noreferrer">http://www.gotw.ca/publications/mxc++-item-4.htm</a></p>
<p>Here's the basic idea. You first need an IsDerivedFrom class (this provides runtime and compile-time checking):</p>
<pre><code>template<typ... | <p>Using concepts and the requires keyword from C++20 is an even simpler and more expressive way to do this without having to introduce a redundant boolean non-type template parameter like in C++11:</p>
<pre><code>// C++20:
#include <concepts>
#include <iostream>
struct SomeTag { };
struct InheritSomeTag :... | 35,659 |
<p>Is it possible to intercept requests in the ASP.NET MVC Framework (beta 1) in order to interact and inspect them?</p>
<p>I need to attach some logging and in some cases dynamically work out if the URL needs authorizing (like applying the Authorize attribute - but at run-time).</p>
| <p>Standard HttpModules work just fine.</p>
<p>You can also choose to add your own custom IRouteHandler, and specifically register routes with that (or hijack the current route definitions and replace them with your route handler).</p>
<p>This should give you the flexibility you need.</p>
| <p>Standard HttpModules work just fine.</p>
<p>You can also choose to add your own custom IRouteHandler, and specifically register routes with that (or hijack the current route definitions and replace them with your route handler).</p>
<p>This should give you the flexibility you need.</p>
| 34,354 |
<p>Are there any Common Lisp implementations for .Net?</p>
| <p>I haven't looked at it recently, but at least in the past there were some problems with fully implementing common lisp on the CLR, and I'd be a little surprised if this has changed. The issues come up with things like the handling of floats where .net/clr has a way to do it that is a) subtly incorrect b) disagrees ... | <p>You could try <a href="http://weitz.de/rdnzl/" rel="nofollow noreferrer">this</a> (Disclaimer, I haven't tested it myself). Also read <a href="https://stackoverflow.com/questions/126790/if-you-already-know-lisp-why-would-you-also-want-to-learn-f">this</a>. that's where the link came from.</p>
| 13,569 |
<p>Occasionally, I find that while debugging an ASP.Net application (written in visual studio 2008, running on Vista 64-bit) the local ASP.Net development server (i.e. 'Cassini') stops responding.</p>
<p>A message often comes up telling me that "Data Execution Prevention (DEP)" has killed WebDev.WebServer.exe</p>
<p>... | <p>The only way to know for sure would be to dig through the Cassini source and see if there are any areas where it generates code on the heap and then executes it without clearing the NX flag.</p>
<p>However, instead of doing that, why not use IIS?</p>
<p>EDIT:</p>
<p>The danger of disabling DEP is that you open up... | <p>Thanks for the answers. I guess I developed such an aversion to IIS in the .net 1.x era that I've refused to consider re-using it -- until now.</p>
<p><em>aside: when choosing between two equally acceptable answers from ChanChan and Jonathan, I arbitrarily marked Jonathan's as 'accepted' because a) he got in first ... | 3,978 |
<p>I have a custom DataGridView column that uses an embedded control that pops up a search window for the value of that column. The important thing is that the databound column is a numeric ID, but the custom column cells display a text description. </p>
<p>How do I get the column to sort on the text description rat... | <p>You can use a technique described in the following article <a href="http://msdn.microsoft.com/en-us/library/95scxcdy.aspx" rel="nofollow noreferrer">Column Sort Modes</a> </p>
<pre><code>private bool ascending;
private int sortColumn;
private void dgv_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEvent... | <p>What are you using as the data-source? a <code>DataTable</code>? The sort is most commonly provided by the list itself, so you could actually write a custom list with your own specific sort behaviour. The simplest approach (although still non-trivial) would be to inherit from <code>BindingList<T></code>, and o... | 43,478 |
<p>I just bought an Ender 3 Max and from the start I knew something was wrong. I figured out the problem: it is with the first few millimeters of the Z axis movement.</p>
<p>I turn on my 3D printer, go to prepare, move axis, move Z, move 1 mm.</p>
<p>Then I tell the printer to move up 1 mm. But in reality it only moves... | <p>Your printer probably has an issue with binding in the lower region (binding means extra friction possibly causing the Z stepper to skip steps). Disconnect the lead screw an manually move the X gantry up and down. If there is binding, you need to find why this happens, with the unfortunate design of the Ender, many ... | <p>The problem turned out to be that the two extruded pieces of aluminium on the z axis were too close together - I tightened the screws too tight. This made the gap between the z axis bars smaller than desired and the z movement only lifted one side of the bar in the beginning.</p>
<p>After I loosed those screws holdi... | 1,833 |
<p>Assuming that writing nhibernate mapping files is not a big issue....or polluting your domain objects with attributes is not a big issue either....</p>
<p>what are the pros and cons?</p>
<p>is there any fundamental technical issues? What tends to influence peoples choice?</p>
<p>not quite sure what all the trade... | <p>The biggest pro of AR is that it gives you a ready-made repository and takes care of session management for you. Either of <code>ActiveRecordBase<T></code> and <code>ActiveRecordMediator<T></code> are a gift that you would have ended up assembling yourself under NHibernate. Avoiding the XML mapping is an... | <p>When I started using <a href="http://www.nhibernate.org" rel="nofollow noreferrer">NHibernate</a>, I didn't learn about Castle ActiveRecord until I had written my Mapping files and made my classes. At that point, I couldn't visibly discern what Castle Activerecord would give me, so I didn't use it.</p>
<p>The seco... | 48,323 |
<p>I want to recreate the the update panel postback without using an update panel to do the postback. What is the generic method for doing this?</p>
<p>For example, on Stackoverflow, when you vote up or down on a question it does a postback to update the database and I would bet they didn't use an update panel.</p>
... | <p>The way that Stack Overflow works differs in two important ways from that CodeProject article.</p>
<ul>
<li><p>Stack Overflow is making its AJAX request against an ASP.NET MVC controller action, not a standalone ASPX page. You might consider this as the MVC analogue of an ASP.NET AJAX page method. In both cases, t... | <p>You can just use a standard AJAX call to accomplish this. Create a .aspx page which updates the database in its Page_Load method, and displays any desired information (like the current DB value after the update) as XML. Then make an AJAX call to that page using jQuery.</p>
<p>You can also return an HTML fragment ... | 20,624 |
<p>What is the fastest way to do Bulk insert to Oracle using .NET? I need to transfer about 160K records using .NET to Oracle. Currently, I'm using insert statement and execute it 160K times.It takes about 25 minutes to complete. The source data is stored in a DataTable, as a result of query from another database (MySQ... | <p>I'm loading 50,000 records in 15 or so seconds using Array Binding in ODP.NET</p>
<p>It works by repeatedly invoking a stored procedure you specify (and in which you can do updates/inserts/deletes), but it passes the multiple parameter values from .NET to the database in bulk.</p>
<p>Instead of specifying a single... | <p>I guess that OracleBulkCopy is one of the fastest ways. I had some trouble to learn, that I needed a new ODAC version. Cf. <a href="https://stackoverflow.com/questions/4912944/where-is-type-oracle-dataaccess-client-oraclebulkcopy">Where is type [Oracle.DataAccess.Client.OracleBulkCopy] ?</a></p>
<p>Here is the comp... | 44,645 |
<p>Pour in your posts. I'll start with a couple, let us see how much we can collect.</p>
<p>To provide inline event handlers like</p>
<pre><code>button.Click += (sender,args) =>
{
};
</code></pre>
<p>To find items in a collection</p>
<pre><code> var dogs= animals.Where(animal => animal.Type == "dog");
</code>... | <p>Returning an custom object:</p>
<pre><code>var dude = mySource.Select(x => new {Name = x.name, Surname = x.surname});
</code></pre>
| <p>To express an unnamed function.</p>
| 47,680 |
<p>I'm working on a solution that has two projects: One ASP.NET web application, and one Custom Web Control library.
The custom control library is used in the asp.net application. When I compile the solution, the app.config file of the custom web control library is not transfered with the dll to the ASP.NET apllicatio... | <p><a href="http://docs.python.org/library/itertools.html#itertools.combinations" rel="noreferrer">itertools.combinations</a> is your friend if you have Python 2.6 or greater. Otherwise, check the link for an implementation of an equivalent function.</p>
<pre><code>import itertools
def findsubsets(S,m):
return se... | <p><code>
$ python -c "import itertools; a=[2,3,5,7,11]; print sum([list(itertools.combinations(a, i)) for i in range(len(a)+1)], [])"
[(), (2,), (3,), (5,), (7,), (11,), (2, 3), (2, 5), (2, 7), (2, 11), (3, 5), (3, 7), (3, 11), (5, 7), (5, 11), (7, 11), (2, 3, 5), (2, 3, 7), (2, 3, 11), (2, 5, 7), (2, 5, 11), (2, 7, 1... | 49,001 |
<p>Has anybody come up with a better technique for managing tags and branches in subversion than what is generally recommended (the parallel directories called 'tags' and 'branches')?</p>
| <p>Using the repository namespace to convey information like branches / tags / etc is fundamentally the SVN model; if what you want is a different model, you probably really want something other than SVN.</p>
<p>The lack of metadata like CVS-style labels in SVN is an intentional design decision. No matter what arrange... | <p>The only other thing you can do besides having parallel directories when you have Branches is to do an SVN Switch between two branches whenever you want to work on one or the other. Perhaps you should clarify what you want to be "better" about this system and people could make suggestions.</p>
| 9,212 |
<p>I have a structured XML file format that needs to be mapped to a flatter XML format. Ordinarily I would create a custom XSLT file for this and have the BizTalk map use it. However, I do like the idea of using the graphical maps where possible - it's all too easy to dive straight into XSLT but not so easy for those f... | <p>I finally found the answer to my problem. It's origin are within the application code (like 99% of a programmer's 3rd party tools 'bugs'). I decided to post it anyway in case someone is in a similar scenario.</p>
<p>This code was part of WebServiceRequester class. The web service requester class was instanciated wh... | <p>Not strictly an answer to your question, but have you tried it using a sql server based session store? (Search on MSDN for the permanent script rather than the temp script that's provided with asp.net)</p>
<p>I've heard "bad things" about the executable session service, and consequently have not used it. Never had ... | 41,721 |
<p>In MS Transact SQL, let's say I have a table (Orders) like this:</p>
<pre><code> Order Date Order Total Customer #
09/30/2008 8.00 1
09/15/2008 6.00 1
09/01/2008 9.50 1
09/01/2008 1.45 2
09/16/2008 4.50 2
09/17/2008... | <p>This should make it</p>
<pre><code>select avg(total), customer
from orders o1
where orderdate in
( select top 2 date
from orders o2
where o2.customer = o1.customer
order by date desc )
group by customer
</code></pre>
| <p>In SQL Server 2005 you have the RANK function, used with partition:</p>
<pre><code>USE AdventureWorks;
GO
SELECT i.ProductID, p.Name, i.LocationID, i.Quantity
,RANK() OVER
(PARTITION BY i.LocationID ORDER BY i.Quantity DESC) AS 'RANK'
FROM Production.ProductInventory i
INNER JOIN Production.Product p ... | 18,543 |
<p>Does anyone know of any free frameworks that help you create thumbnails for web pages, that when clicked, the original image loads ontop of the page (modal like), as oppossed to opening a separate page.
Thanks!</p>
| <p>This is really 2 questions in 1. The "lightbox" display of the original, larger sized, images in a modal box is handled in JavaScript with a library such as <a href="http://jquery.com/demo/thickbox/" rel="nofollow noreferrer">ThickBox</a>. The resizing of the images can be done manually, or via some kind of code on ... | <p>Lightbox.</p>
<p><a href="http://planetozh.com/projects/lightbox-clones/" rel="nofollow noreferrer">http://planetozh.com/projects/lightbox-clones/</a></p>
| 15,002 |
<p>If I have java-webapp (servlets), what is the best way to create automated tests for this application?</p>
<p>Should I start a server? But that is very fragile. Should I call the servlets directly? But how can this be done? I don't know how to create a ServletResponse/ServletRequest.</p>
<p>And what is the best wa... | <p>Have a look at <a href="http://selenium.openqa.org/" rel="nofollow noreferrer">Selenium</a>. It's a very nice tool, and should at least point you in the right direction for the integrated tests. Beyond that, use unit tests of your servlets and other support classes using JUnit.</p>
| <p>I test web applications all day, and I use <a href="http://wtr.rubyforge.org/" rel="nofollow noreferrer">Watir</a>.</p>
| 34,205 |
<p>Our current project has a large team, and we have come near the end of the project</p>
<p>Like most end of projects, dozens of dependencies are popping up - everyone is waiting on someone else to complete a task. What is the best strategy for dealing with this.</p>
<p>I have thought of scaling the size of the team... | <p>The only way I know how to handle this is to split the team in two. If you're lucky you can set the other half up to work with the next release. The message to BOTH teams is that the release version has priority over work on the next version. So the people who're working on the release version can enlist people from... | <p>It's the ole' <em>line them up and knock them down</em> approach. Make sure you're really at the end of the project and not uncovering any missing deliverables, prioritize the deliverables and based on the top priority items determine the remaining work, dependencies, etc. Priority could be based on most value of ... | 46,346 |
<p>I am curious about how do you protect your software against cracking, hacking etc.</p>
<p>Do you employ some kind of serial number check? Hardware keys? </p>
<p>Do you use any third-party solutions?</p>
<p>How do you go about solving licensing issues? (e.g. managing floating licenses)</p>
<p>EDIT: I'm not talkin... | <p>There are many, many, many protections available. The key is:</p>
<ul>
<li>Assessing your target audience, and what they're willing to put up with</li>
<li>Understanding your audience's desire to play with no pay</li>
<li>Assessing the amount someone is willing to put forth to break your protection</li>
<li>Applyi... | <p>Make part of your product an online component which requires connection and authentication. Here are some examples:</p>
<ul>
<li>Online Games</li>
<li>Virus Protection</li>
<li>Spam Protection</li>
<li>Laptop tracking software</li>
</ul>
<p>This paradigm only goes so far though and can turn some consumers off.</p>... | 13,523 |
<p>To support multiple platforms in C/C++, one would use the preprocessor to enable conditional compiles. E.g.,</p>
<pre><code>#ifdef _WIN32
#include <windows.h>
#endif
</code></pre>
<p>How can you do this in Ada? Does Ada have a preprocessor?</p>
| <p>The answer to your question is no, Ada does not have a pre-processor that is built into the language. That means each compiler may or may not have one and there is not "uniform" syntax for pre-processing and things like conditional compilation. This was intentional: it's considered "harmful" to the Ada ethos.</p>
<... | <p>No, it does not. </p>
<p>If you really want one, there are ways to get one (Use C's, use a stand-alone one, etc.) However I'd argue against it. It was a purposeful design decision to not have one. The whole idea of a preprocessor is very un-Ada.</p>
<p>Most of what C's preprocessor is used for can be accomplished ... | 36,007 |
<p>Pretty simple question: When i have a persistable object, it usually has a property called ID (for abstract classes).</p>
<p>So .. is the naming convention ID or Id?</p>
<p>eg.</p>
<pre><code>public int ID { get; set; }
</code></pre>
<p>or</p>
<pre><code>public int Id { get; set; }
</code></pre>
<p>cheers :)</... | <p>I usually go with <em>Identifier</em>. If I really want to keep it short (as part of a longer identifier, for example), I use Id, unless it's a parameter or private member.</p>
<p>The <a href="http://msdn.microsoft.com/en-us/library/ms229043.aspx" rel="noreferrer">.NET Framework Naming Guidelines</a> say this:</p>
<... | <p>We around here see things like "Id" or other acronyms as a word, and "Id" is the easy one because in the banking business we do get lots of strange letter combinations. So we treat it as a word, only with the first letter capitalized, and that's how we ended up being defined in our internal coding conventions paper.... | 33,182 |
<p>I have an abstract base class which acts as an interface.</p>
<p>I have two "sets" of derived classes, which implement half of the abstract class. ( one "set" defines the abstract virtual methods related to initialization, the other "set" defines those related to the actual "work". )</p>
<p>I then have derived cla... | <p>It looks like you want to do virtual inheritance. Whether that turns out to actually be a good idea is another question, but here's how you do it:</p>
<pre><code>
class AbsBase {...};
class AbsInit: public virtual AbsBase {...};
class AbsWork: public virtual AbsBase {...};
class NotAbsTotal: public AbsInit, public... | <p>You have to start thinking in the terms of what you are trying to model here.</p>
<p>Public inheritance should only ever be used to model an "isa" relationship, e.g. a dog is a animal, a square is a shape, etc.</p>
<p>Have a look at Scott Meyer's book Effective C++ for an excellent essay on what the various aspect... | 31,770 |
<p>I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. Am I missing something truly wonderful I haven't heard of?</p>
<p>This is similar to what I'm actually doing:</p>
<pre><code>import xml.etree.ElementTree as ET
root = ET.Element('html')
head = ET.SubElement(root,'h... | <p>Another way is using the <a href="http://codespeak.net/lxml/tutorial.html#the-e-factory" rel="nofollow noreferrer">E Factory</a> builder from lxml (available in <a href="http://effbot.org/zone/element-builder.htm" rel="nofollow noreferrer">Elementtree</a> too)</p>
<pre><code>>>> from lxml import etree
>... | <p>Try <a href="http://uche.ogbuji.net/tech/4suite/amara" rel="nofollow noreferrer">http://uche.ogbuji.net/tech/4suite/amara</a>. It is quite complete and has a straight forward set of access tools. Normal Unicode support, etc. </p>
<pre><code>#
#Output the XML entry
#
def genFileOLD(out,label,term,idval):
filenam... | 8,012 |
<p>I might be starting a new project in .NET soon, and would prefer not to use an XML-based build tool like Nant or MSBuild. I like Rake, but I'm thinking it may be better to have something based on a .NET dynamic language (such as Boo), similar in spirit to gant or BuildR for Java. Is there such a thing for .NET? If n... | <p>There is always the <a href="http://code.google.com/p/boo-build-system/" rel="nofollow noreferrer">Boo Build System</a> or "Boobs" for short (yes it's a silly name) and looks very similar to Rake.</p>
<p>Ayende has written about this previously in <a href="http://ayende.com/Blog/archive/2007/09/22/Introducing-Boob... | <p>I haven't heard of anything like that, but maybe you could port Rake to IronRuby, and then extend it to understand building C#/VB.NET and running other .NET tools.</p>
| 17,193 |
<p>I believe the application has some parts that target .NET, and some that don't. I'm particularly interested in looking at the resource files, if there are any.</p>
| <p>If you want to disassemble native x86/64 app use <a href="http://www.idapro.ru" rel="nofollow noreferrer">IDA</a>, .NET exe/dll can be disassembled using Reflector. There are <a href="http://www.google.ru/search?complete=1&hl=en&newwindow=1&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=v... | <p>Looking at the resource files isn't really "disassembling" (not really) and if that's all you want to do you can just open the .exe or .dll inside Visual Studio or a similar tool and it will give you a resources view.</p>
| 8,617 |
<p>Our clients will be uploading images to be printed on their documents and we have been asked to come up with a way to get the resolution of the image in order to warn them if the image has too low of a resolution and will look pixalated in the end-product</p>
<p>If it comes to it we could also go with the dimension... | <p><a href="http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx" rel="noreferrer">System.Drawing.Image</a></p>
<pre><code>Image newImage = Image.FromFile("SampImag.jpg");
newImage.HorizontalResolution
</code></pre>
| <pre><code>Image image = Image.FromFile( [file] );
GraphicsUnit unit = GraphicsUnit.Point;
RectangleF rect = image.GetBounds( ref unit );
float hres = image.HorizontalResolution;
float vres = image.VerticalResolution;
</code></pre>
| 15,063 |
<p>I've always heard that in C you have to really watch how you manage memory. And I'm still beginning to learn C, but thus far, I have not had to do any memory managing related activities at all.. I always imagined having to release variables and do all sorts of ugly things. But this doesn't seem to be the case.</p>
... | <p>There are two places where variables can be put in memory. When you create a variable like this:</p>
<pre><code>int a;
char c;
char d[16];
</code></pre>
<p>The variables are created in the "<strong>stack</strong>". Stack variables are automatically freed when they go out of scope (that is, when the code c... | <p>Sure. If you create an object that exists outside of the scope you use it in. Here is a contrived example (bear in mind my syntax will be off; my C is rusty, but this example will still illustrate the concept):</p>
<pre><code>class MyClass
{
SomeOtherClass *myObject;
public MyClass()
{
//The object ... | 4,453 |
<p>Anybody in the know of a viewer (or Notepad++ plugin) that can read txt files in a streaming way?
I would like to see for example the last 10 lines of a txt file that gets appended continiously.</p>
| <p><a href="http://tailforwin32.sourceforge.net/" rel="noreferrer">Tail for Win32</a> is a simple open-source program I've been using for a couple of years already.</p>
<p>Notepad++ can actually do it out of the box. </p>
<p>From within Notepad++: Settings > Preferences > MISC.</p>
<p>From there, you can check "Upda... | <p>In UNIX, tail -f . In Windows? Don't know. The Cygnus tools probably have the tail command as well.</p>
| 25,052 |
<p>Anyone know what the C# "M" syntax means?</p>
<pre><code>var1 = Math.Ceiling(hours / (40.00M * 4.3M));
</code></pre>
| <p>M is the suffix for Decimal. Stands for "money" I assume.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/364x0z75(VS.71).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/364x0z75(VS.71).aspx</a></p>
| <p>it means that the number is a <code>decimal</code> type.</p>
| 46,100 |
<p>I need to implement webservices in an upcoming project and wanted to know what are the main points to base the decision on whether to implement using java or .NET</p>
<p>I'm a C++er...</p>
| <p>If you're a Java shop use Java. If you're a .NET shop use .NET. </p>
<p>There really is no difference that makes one of the two languages superior to the other in regards to web services.</p>
| <p>i've never really developed web services in java, but i have in .NET and if you're using Visual Studio they're an absolute cinch to whip up (i expect they're a little more difficult to do without the aid of VS).</p>
<p>if you're already working in java, and don't have any .NET stuff in place, stick with java - it'l... | 48,195 |
<p>My MakerBot 2 jams after a couple hours of prints. It is a couple months old, and the tip stops extruding after a couple straight hours of prints. I am guessing that there is a design flaw and that the media is melting inside the extruder before the feeding teeth. Does anyone have experience with this?</p>
| <p>You may wish to consider <a href="https://craftunique.com/craftware" rel="nofollow">Craftware</a> for your purposes. It's a free program in beta form that does provide a tool-path animation for printing the layers. It is not so much specific to a printer as it is configurable for your own requirements. <a href="http... | <p>I'm using <a href="http://www.mattercontrol.com" rel="nofollow">MatterControl</a> and it has such visualization. User can see synchronized animation which shows how the object is actually printed and user is able to see each path of filament put onto the layer.</p>
<p>It's possible to control starting and ending po... | 270 |
<p>One of our customers wants to be able to enter a date with only 2 digits for the year component. The date will be in the past, so we want it to work for the previous century if the 2 digit year is after the current year, but work for the current century if the 2 digit year is equal to or less than the current year.<... | <p>Groovy script (easy enough to throw into java) demonstrating the point @bobince made about SimpleDateFormat.</p>
<pre><code>import java.text.SimpleDateFormat
SimpleDateFormat sdf = new SimpleDateFormat('MM/dd/yy')
SimpleDateFormat fmt = new SimpleDateFormat('yyyy-MM-dd')
Calendar cal = Calendar.getInstance()
cal.... | <pre><code>Date deliverDate = new SimpleDateFormat("MM/dd/yy").parse(deliverDateString);
String dateString2 = new SimpleDateFormat("yyyy-MM-dd").format(deliverDate);
</code></pre>
<p>Working for me.</p>
| 31,331 |
<p>I'm trying to get an event to fire whenever a choice is made from a <code>JComboBox</code>.</p>
<p>The problem I'm having is that there is no obvious <code>addSelectionListener()</code> method.</p>
<p>I've tried to use <code>actionPerformed()</code>, but it never fires.</p>
<p>Short of overriding the model for th... | <p>It should respond to <a href="http://docs.oracle.com/javase/7/docs/api/java/awt/event/ActionListener.html" rel="noreferrer">ActionListeners</a>, like this:</p>
<pre><code>combo.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
doSomething();
}
});
</code></pre>
... | <p>I was recently looking for this very same solution and managed to find a simple one without assigning specific variables for the last selected item and the new selected item. And this question, although very helpful, didn't provide the solution I needed. This solved my problem, I hope it solves yours and others. Tha... | 8,340 |
<p>I'm trying to make a class that will execute any one of a number of stored procedures with any amount of variables</p>
<p>Im using php and mysqli</p>
<ul>
<li>My class enumerates an array and constructs a string based on the number of elements if any</li>
<li>giving something like this <code>CALL spTestLogin(?,?)<... | <p>You have to do something like this:</p>
<pre><code>$params=array_merge(
array($this->paramTypes),
$this->paramValues
);
call_user_func_array(array($stmt, 'bind_param'), $params);
</code></pre>
<p>given that <code>$this->paramTypes</code> is a string in the format required by <code>mysqli_stmt::bi... | <p>You have to do something like this:</p>
<pre><code>$params=array_merge(
array($this->paramTypes),
$this->paramValues
);
call_user_func_array(array($stmt, 'bind_param'), $params);
</code></pre>
<p>given that <code>$this->paramTypes</code> is a string in the format required by <code>mysqli_stmt::bi... | 35,517 |
<p>I would like to have some suggestions about which third-part controls can we use in our Visual C++ MFC application? </p>
| <p>We've deployed <a href="http://iocomp.com/" rel="nofollow noreferrer">IOComp</a>'s Plot Pack in both ActiveX and .Net flavors with great success. Great API, incredibly flexible, provides a toolbar that lets users pan/zoom/customize. It's solid, has a long track record, relatively inexpensive, and is very fast.</p>... | <p>If you don't mind paying, there's FarPoint Spread:</p>
<p><a href="http://www.componentsource.com/selec/products/farpoint-spread/summary.html" rel="nofollow noreferrer">http://www.componentsource.com/selec/products/farpoint-spread/summary.html</a></p>
| 10,350 |
<p>In Visual Studio 2005, is there an easy way to automatically increment the assembly/file build numbers after a successful build?</p>
<p>Emphasis on <strong><em>easy</em></strong>. I would like to track my build version, without having to set up CruiseControl or some similar tool.</p>
| <p>You can use this project and include it your .proj file
</p>
<p>This url might be of use <a href="https://web.archive.org/web/20100515233947/http://geekswithblogs.net:80/narent/archive/2006/02/15/69532.aspx" rel="nofollow noreferrer">Updating Porj build number</a></p>
<p>This didn't fit my needs and I took to adding... | <p>What about writing a little macro, which increments the version?</p>
<p>Or what about this VS <a href="http://yogesh.jagotagroup.com/blog/page/Solution-level-Auto-build-increment-Add-In.aspx" rel="nofollow noreferrer">AddIn</a> ?</p>
| 44,224 |
<p>Have GHC 6.8.3 and wxHaskell-0.10.3 on a Windows XP computer. Installed both as binary distributions, not by building from sources. Built a sample with the following command:</p>
<p>ghc --make Paint.hs</p>
<p>It works on that same computer it was built on (with GHC and wxHaskell installed), but fails if transferre... | <p>The error comes from dependencies that are mentioned in the manifests of DLL's (presumably the third-party ones with wxHaskell) that your system is expecting to find installed in places such as WinSxS and SoftwareDistribution in your Windows directory. I am guessing the wxHaskell installation puts the files there.</... | <p>My guess is, you want to install the VC++ runtime redistributable files onto the target computer. The redistributable files for applications built with visual studio 2005 are available from here:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displa... | 46,772 |
<p>I have two tables with the following columns:</p>
<p>table1:</p>
<pre><code>id, agent_name, ticket_id, category, date_logged
</code></pre>
<p>table2:</p>
<pre><code>id, agent_name, department, admin_status
</code></pre>
<p>What I'm trying to achieve is to Select all rows from table1 where an agents department i... | <p>I don't quite understand your question...
Only table2 have a department, the only thing they have in common is agent_name.</p>
<p>I do suspect what you really mean is: that you want all rows from Table1 where the agent is from a certain department, is that what you want? In that case, something like this should do ... | <p>Although I cannot exactly understand, what you need and how are tables related, I'd try someting similar:</p>
<pre><code>select
a.id, a.agent_name, a.ticket_id,
a.category, a.date_logged, b.department
from
table1 a inner join table2 b on b.agent_name=a.agent_name
</code></pre>
<p>Currently I'm assum... | 44,194 |
<p>Say I have a file with any number of lines, say, 125. I want to get all the lines except the first n, say, 20. So, I want lines 21–125.</p>
<p>Is there a way to do this with with <code>tail</code>/<code>head</code>, or some other tool?</p>
| <p>Try</p>
<pre><code>tail -n +21 myfile.txt
</code></pre>
| <p>Awk power can be used too:</p>
<pre><code>awk -- 'NR > 20' /etc/passwd
</code></pre>
| 40,553 |
<p>Is a cfront tool available for the new C++? For any other modern languages?</p>
| <p>What do you mean by “cfront tool”? Cfront was the first C++ compiler. But since failure to add exception support, <a href="http://en.wikipedia.org/wiki/Cfront" rel="nofollow noreferrer">it has been discontinued</a>. Modern C++ is way beyond the scope of Cfront.</p>
<blockquote>
<p>For any other modern languages?<... | <p>What do you mean by “cfront tool”? Cfront was the first C++ compiler. But since failure to add exception support, <a href="http://en.wikipedia.org/wiki/Cfront" rel="nofollow noreferrer">it has been discontinued</a>. Modern C++ is way beyond the scope of Cfront.</p>
<blockquote>
<p>For any other modern languages?<... | 39,940 |
<p>I want to be able to push out application updates to windows mobile 5 devices over the air, is this possible? Note, this is just an application, not a rom update.</p>
<p>It doesn't have to be a strict push. It is just as well to have the user go to a web page and download a .cab file. Has anyone had success doin... | <p>If by "over the air" you mean wi-fi, then yes, I've done this. </p>
<p>At first I gave my users a step by step (close the app, open Internet Explorer, visit this page, click this link etc), but in recent versions of my app I've provided an "Update" menu item, which (after prompting) starts a download/run of a cab f... | <p>Another simple way of updating a Windows Mobile app is to have the application call a web service and get the latest version of itself (the latest EXE file) as a byte array. The running application then renames itself (from "MyApp.exe" to "MyApp.old"), saves the byte array as a file with the old name ("MyApp.exe"),... | 45,172 |
<p>If I have several classes with functions that I need but want to store separately for organisation, can I extend a class to have both?</p>
<p>i.e. <code>class a extends b extends c</code></p>
<p>edit: I know how to extend classes one at a time, but I'm looking for a method to instantly extend a class using multipl... | <p>If you really want to fake multiple inheritance in PHP 5.3, you can use the magic function __call().</p>
<p>This is ugly though it works from class A user's point of view :</p>
<pre><code>class B {
public function method_from_b($s) {
echo $s;
}
}
class C {
public function method_from_c($s) {
... | <p>class A extends B {}</p>
<p>class B extends C {}</p>
<p>Then A has extended both B and C</p>
| 46,432 |
<p>I know that this is a simple question for PHP guys but I don't know the language and just need to do a simple "get" from another web page when my page is hit. i.e. signal the other page that this page has been hit.</p>
<p>EDIT: curl is not available to me.</p>
| <p>If curl wrappers are on (they are per default), you can use:</p>
<pre><code>file_get_contents('http://www.example.org');
</code></pre>
<p>Note that this happens synchronous, so before the request has completed, your page won't either. It would be better to log access to a logfile (or database) and export the data ... | <p>You'll probably want to use <a href="http://us3.php.net/manual/en/curl.examples.php" rel="nofollow noreferrer">cURL</a></p>
| 26,644 |
<p>I'm setting up a solution to deploy, driven by a batch file so it's reproducible
- I've got a binding file that works but I've now added on my MSMQ adapters
- works on my local machine, but I've found I have to add a userid and password to get it to work on the actual server
- it's in the domain, my virtual dev ... | <p>You can put the userid and password into any BizTalk binding that supports authentication, including MSMQ. For security, the password is not exported, you just get a mask.</p>
<p>The userName and password sections of the binding file are not exported unless they have been configured, so the simplest thing to do is ... | <blockquote>
<p>For security reasons, when you export
bindings, BizTalk Server removes the
passwords for the bindings from the
file. After importing the bindings,
you must reconfigure passwords for
send ports and receive locations
before they will function. You
configure passwords in the Transport
Pro... | 33,890 |
<p>I've been lead to believe, without research, that server controls are forfeited in the MVC model. I am both very curious to know if this is true, and if so, how would one achieve something equivalent to a Repeater control, or any other view whose exact structure depends on the content of the model?</p>
| <p>I disagree, Yuriy, that controls aren't useful. A set of data-bound MVC controls, easily bound to viewdata, sans obstinate ID rewriting, with no reliance on nasty viewstate or postback gunk and complete control over templating (defaulting to sensible markup), would be an excellent addition to the MVC framework. Cont... | <p>That's incorrect, you can <strong>still</strong> use Server Controls. The engine that parses/ processes the views is still the same ASP.NET runtime that Web Forms uses.</p>
<p>An <a href="http://codebetter.com/blogs/david.hayden/archive/2007/12/27/asp-net-mvc-and-accessing-server-controls-in-codebehind.aspx" rel="n... | 41,084 |
<p>I'm working on a project for OSX where the user can pick a collection of documents (from any application) which I need to generate PDF's from. The standard Macintosh Print dialog has a PDF button which has a number of PDF-related commands including "Save as PDF...". However, I need to generate the PDF file without ... | <p>I think you could use applescript to open a document and then use <a href="https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/AutomatetheUserInterface.html" rel="nofollow noreferrer">applescript UI scripting</a> to invoke print menu. </p>
<p>For exam... | <p>I typed up the code below with the assistance of Automator (recording an action, and then dragging the specific action out of the "Watch Me Do" window in order to get the Applescript). If you want to print a PDF from an application other than Safari, you might have to run through the same process and tweak this App... | 34,849 |
<p>I'm dealing with game dialogue files (conversation between player and non-playable-characters) where dialogue choices and their outcome depend on certain conditions and result in certain actions. Now, I could write a simple parser to handle some sort of language for specifying the pre and post-conditions, but a frie... | <p>Unless your game will have less than half a dozen unique dialogs, you should definitely put this information in some kind of data file. XML is a strong contender for the format. I don't speak Ruby, so it may not work in this case, but another option would be to define the dialog as data directly in Ruby code. (I kno... | <p>A DSL would be a Mercedes-Benz implementation for this and would be fun to write in Ruby. You are right, it would take a lot of work but it might pay off if it
was well written and this game really took off.</p>
<p>One thing to consider if going the XML route is the parser/engine you will be using to render it. Las... | 48,755 |
<p>We have had SharePoint where I work for a little while now, but we've not done a lot with it. We have an intranet with hundreds of ASP/ASP.Net applications and I'm wondering what kind of things can be done to integrate with SharePoint to make a more seamless environment? We put documentation and production move requ... | <p>A great idea for you would be move your most used asp.net apps to run within the SharePoint site. Each app can be added either as a control directly on a pagelayout or integrated into a webpart (use the webpart to load child controls).</p>
<p>This would allow you to use the flexible moss interface to move the asp.n... | <p>Create libraries</p>
<p>Form libraries, documents libraries, slide libraries </p>
<p>Create standard or custom lists</p>
<p>Standard lists - announcements, tasks, contacts</p>
<p>Custom lists - suppliers, contractors, inventories, orders</p>
<p>Setup secure team discussion areas</p>
<p>Build shared team calen... | 15,543 |
<p>I'm looking to use: </p>
<pre><code>#define
</code></pre>
<p>and</p>
<pre><code>#if
</code></pre>
<p>to allow me to simulate potentially absent hardware during unit tests. What are the rules for using the <code>#define</code> statements? </p>
<p>i.e. what is its default scope? can I change the scope of the dire... | <p>As Chris said, the scope of #define is just the file. (It's worth noting that this isn't the same as "the class" - if you have a partial type, it may consist of two files, one of which has symbol defined and one of which doesn't!</p>
<p>You can also define a symbol project-wide, but that's done with <a href="http:/... | <p>Although could you not go down the route of Mock objects, ala <a href="http://ayende.com/projects/rhino-mocks.aspx" rel="nofollow noreferrer">Mock.Rhinos</a> ?</p>
| 37,697 |
<p>I have the following string and I would like to remove <code><bpt *>*</bpt></code> and <code><ept *>*</ept></code> (notice the additional tag content inside them that also needs to be removed) without using a XML parser (overhead too large for tiny strings).</p>
<pre><code>The big <bpt i... | <p>If you just want to remove all the tags from the string, use this (C#):</p>
<pre><code>try {
yourstring = Regex.Replace(yourstring, "(<[be]pt[^>]+>.+?</[be]pt>)", "");
} catch (ArgumentException ex) {
// Syntax error in the regular expression
}
</code></pre>
<p>EDIT:</p>
<p>I decided to add... | <p>Does the .NET regex engine support negative lookaheads? If yes, then you can use</p>
<pre><code>(<([eb])pt[^>]+>((?!</\2pt>).)+</\2pt>)
</code></pre>
<p>Which makes <em>The big black cat sleeps.</em> out of the string above if you remove all matches. However keep in mind that it will not work ... | 14,789 |
<p>I want to learn MVC "architecture pattern" but I don't want to jump into a framework like Rails or Django just yet. I want to understand the concept first and write some simple code in my currently familiar environment, which happens to be PHP/HTML/CSS/MySQL. I don't necessarily need a tutorial that is based on PH... | <p>Almost every framework does MVC differently, so you might end up getting even more confused. The general principles of MVC are very simple: "Model is state; view reacts to model; controller reacts to view; controller changes model". The model, view and controller are concepts - they are whatever you feel them to be.... | <p>The main advantage of MVC is separation of concerns. When you write code, and if you're not careful, it can become a big mess. So knowing how to put Models, Views, and Controllers in different "silos" saves you time in the long term. Any strategy is good.</p>
<p>So here is mine :</p>
<ul>
<li>models are files foun... | 18,344 |
<p>I have the VS2005 standard edition and MS says this:</p>
<blockquote>
<p>Note: The Windows Service Application
project templates and associated
functionality are not available in the
Standard Edition of Visual Basic and
Visual C# .NET...</p>
</blockquote>
<p>Is it possible to write a Windows Service ap... | <p>If you can cut and paste, an example is enough.</p>
<p>A simple service to periodically log the status of another service. The example does not include the <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.serviceinstaller.aspx" rel="nofollow noreferrer">ServiceInstaller class</a> (to be called... | <p>Yes, look here:</p>
<p><a href="http://www.codeproject.com/KB/system/WindowsService.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/system/WindowsService.aspx</a></p>
| 36,471 |
<p>I'm currently trying out db4o (the java version) and I pretty much like what I see. But I cannot help wondering how it does perform in a real live (web-)environment. Does anyone have any experiences (good or bad) to share about running db4o? </p>
| <p>We run DB40 .NET version in a large client/server project.</p>
<p>Our experiences is that you can potentially get much better performance than typical relational databases.</p>
<p>However, you really have to tweak your objects to get this kind of performance. For example, if you've got a list containing a lot of o... | <p>Judah, it sounds like you are not using transparent activation, which is a feature of the latest production version (7.4)? Perhaps if you specified the version you are using as there may be other issues which are now resolved in the latest version?</p>
| 4,145 |
<p>Does anyone have links to tutorials regarding the new IModelBinder in asp.net mvc beta?</p>
<p>I can't get my head around it properly, so much has changed.</p>
<p>Thanks</p>
| <p>Take a look at the source of DefaultModelBinder. That'll give you some clues. </p>
| <p>Take a look at the source of DefaultModelBinder. That'll give you some clues. </p>
| 28,480 |
<p>I would like to develop Adobe Flex applications using Linux and a free environment. I'd prefer a free as in freedom alternative, but as in beer would work as well. ;-)</p>
<p>Are any of you developing Adobe Flex rich internet applications using such an environment? Or should I face the "facts" that Flex Builder is ... | <p>I use TextMate to do some Flex hacking on my home computer (a PowerBook G4 which can't run FlexBuilder) and I have no trouble writing applications. It depends if you are so used to IDE support that you cannot live without it. I like code completion, project management and the debugger in Flex Builder but I can live ... | <p>You can get a (kinda) functional Flex environment in Linux with Eclipse and FDT. You can find instructions <a href="http://www.brighthub.com/hubfolio/matthew-casperson/articles/73648.aspx" rel="nofollow noreferrer">here</a>.</p>
| 24,416 |
<p>I am interested in moving a number of my projects from Visual Studio and Access/Office Basic with a SQL back-end to the Linux world. </p>
<p>Are there any utilities available to move code over to a similar platform on Linux?</p>
| <p>Here's a link to the <a href="http://www.mono-project.com/MoMA" rel="nofollow noreferrer">Mono Migration Analyzer</a> to get started. It will help you pinpoint Microsoft specific calls, but you'll probably have to do the db conversion and data access layer manually. You may be surprised - mono does have a System.D... | <p>There are some flavours of OpenOffice that include native support for VBA. The version included with Ubuntu is one example, and the <a href="http://www.novell.com/products/openworkgroupsuite/product_evals.html" rel="nofollow noreferrer">Novell version for Windows</a> is another. For more details and a list of versio... | 5,364 |
<p>Is there a way to send a file using POST from a Python script?</p>
| <p>From: <a href="https://requests.readthedocs.io/en/latest/user/quickstart/#post-a-multipart-encoded-file" rel="noreferrer">https://requests.readthedocs.io/en/latest/user/quickstart/#post-a-multipart-encoded-file</a></p>
<p>Requests makes it very simple to upload Multipart-encoded files:</p>
<pre><code>with open('re... | <p>You may also want to have a look at <a href="http://code.google.com/p/httplib2/" rel="nofollow noreferrer">httplib2</a>, with <a href="http://bitworking.org/projects/httplib2/doc/html/libhttplib2.html#examples" rel="nofollow noreferrer">examples</a>. I find using httplib2 is more concise than using the built-in HTTP... | 9,396 |
<p>I've learned that <a href="http://en.wikipedia.org/wiki/Static_scoping#Static_scoping_.28also_known_as_lexical_scoping.29" rel="noreferrer">static scoping</a> is the only sane way to do things, and that <a href="http://en.wikipedia.org/wiki/Static_scoping#Dynamic_scoping" rel="noreferrer">dynamic scoping</a> is the ... | <p>Like everything else, Dynamic Scoping is merely a tool. Used well it can make certain tasks easier. Used poorly it can introduce bugs and headaches.</p>
<p>I can certainly see some uses for it. One can eliminate the need to pass variables to some functions.</p>
<p>For instance, I might set the display up at the... | <p>An example whats convenient for me at the Emacs way of binding -
not sure if lexical or dynamic is the right term BTW.</p>
<p>A variable bound inside a let is seen downward, no explicit hand-over as argument needed, which saves a lot of keystrokes.</p>
<pre><code>(defun foo1 ()
(message "%s" a))
(defun foo2 ()... | 41,531 |
<p>From Wikipedia, the free encyclopedia: <strong>Closure (computer science)</strong></p>
<blockquote>
<p>In computer science, a closure is a
function that is evaluated in an
environment containing one or more
bound variables. When called, the
function can access these variables.
The explicit use of closur... | <p>Searching for "javascript closures" gave plenty of encouraging-looking links. The top three were these two (the third link was a reformatted version of the second):</p>
<ul>
<li><a href="http://www.jibbering.com/faq/faq_notes/closures.html" rel="nofollow noreferrer">Javascript closures</a></li>
<li><a href="http://... | <p>A practical example of closures is when they are used to create "Private" variables, like</p>
<pre><code>function incrementer(){
var i=0;
this.increment=function(){
i++;
}
this.get=function(){
return i;
}
}
</code></pre>
<p>The only way to access i is to use the method get, and ... | 26,105 |
<p>For example, I am trying to get a min date, a max date, and a sum in different instances. I am trying to avoid hard coding a SQL string or looping through an IList to get these values.</p>
| <p>For starters, instead of beginning your search at n / 2, start it at the square root of n. You'll get half of the factors, the other half being their complement.</p>
<p>eg:</p>
<pre><code>n = 27
start at floor(sqrt(27)) = 5
is 5 a factor? no
is 4 a factor? no
is 3 a factor? yes. 27 / 3 = 9. 9 is also a factor.
is ... | <p>Try using the <a href="http://en.wikipedia.org/wiki/Miller-Rabin_primality_test" rel="nofollow noreferrer">Miller-Rabin Primality Test</a> to test for a number being prime. That should speed things up considerably.</p>
| 24,587 |
<p>I am trying to solve numerically a set of partial differential equations in three dimensions. In each of the equations the next value of the unknown in a point depends on the current value of each unknown in the closest points.</p>
<p>To write an efficient code I need to keep the points close in the three dimension... | <p>Octtrees are the way to go. You subdivide the array into 8 octants:</p>
<pre>
1 2
3 4
---
5 6
7 8
</pre>
<p>And then lay them out in memory in the order 1, 2, 3, 4, 5, 6, 7, 8 as above. You repeat this recursively within each octant until you get down to some base size, probably around 128 bytes or so (this is... | <p>The book <a href="https://rads.stackoverflow.com/amzn/click/com/0123694469" rel="nofollow noreferrer" rel="nofollow noreferrer">Foundations of Multidimensional and Metric Data Structures</a> can help you decide which data structure is fastest for range queries: octrees, kd-trees, R-trees, ...
It also describes data ... | 10,170 |
<p>With the best will in the world, whatever software you (and me) write will have some kind of defect in it.</p>
<p>What can I do, as a developer, to make things easier for the support department (first line, through to third line, and development) to diagnose, workaround and fix problems that the user encounters.</p... | <p>Technical features:</p>
<ul>
<li>In the error dialogue for a desktop app, include a clickable button that opens up and email, and attaches the stacktrace, and log, including system properties.</li>
<li>On an error screen in a webapp, report a timestamp including nano-seconds and error code, pid, etc so server logs ... | <ul>
<li><p>Provide a mechanism for capturing what the user was doing when the problem happened, a logging or tracing capability that can help provide you and your colleagues with data (what exception was thrown, stack traces, program state, what the user had been doing, etc.) so that you can recreate the issue.</p></l... | 19,024 |
<p><a href="http://www.eclipse.org/mylyn/" rel="noreferrer">Mylyn</a> is a task oriented plugin that allows for example to assign a set of files to a task. Is there a Mylyn type plugin for Visual Studio?</p>
| <p>Tasktop has just announced that it is bringing the productivity of Mylyn into Visual Studio! The beta version that is being released will support bringing tasks from HP ALM, Quality Center, and Bugzilla. It includes Mylyn's <strong>Task List</strong> and <strong>Task Editor</strong>. The next level of support, whi... | <p>I'll second tasktop. The newest version especially looks nice. Like orip said, it doesn't provide VS integration, but there's a Firefox extension which should be pretty nice... beats using Eclipse purely for Mylyn.</p>
| 27,348 |
<p>What's the best way to specify a proxy with username and password for an http connection in python?</p>
| <p>This works for me: </p>
<pre><code>import urllib2
proxy = urllib2.ProxyHandler({'http': 'http://
username:password@proxyurl:proxyport'})
auth = urllib2.HTTPBasicAuthHandler()
opener = urllib2.build_opener(proxy, auth, urllib2.HTTPHandler)
urllib2.install_opener(opener)
conn = urllib2.urlopen('http://python.org')... | <p>Or if you want to install it, so that it is always used with urllib2.urlopen (so you don't need to keep a reference to the opener around):</p>
<pre><code>import urllib2
url = 'www.proxyurl.com'
username = 'user'
password = 'pass'
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
# None, with the "WithDefault... | 5,423 |
<p>Whenever I drop a new database object from server explorer into the dbml, Visual Studio replaces the connection string in the designer file with a new one that it automatically adds to the connection strings in my config file. They both have exactly the same parameters, just different names.</p>
<p>How do I force V... | <p>There's a good post that pretty much explains your options here: </p>
<p><a href="http://blog.jongallant.com/2007/11/linq-web-app-connection-strings.html#.UGA8Q42PUg0" rel="nofollow noreferrer">http://blog.jongallant.com/2007/11/linq-web-app-connection-strings.html#.UGA8Q42PUg0</a></p>
| <p>You'll need to make sure the connectionstring used in the Server Explorer of your Visual Studio is the same as the one already defined within the dbml file. </p>
<p>I'm not too sure what do you mean by different name, do you mean database name? When I have a different database name for development and production, w... | 28,949 |
<p>As part of learning jQuery, I decided to do a simple tic-tac-toe game in JavaScript and, at the moment, I'm using a HTML table for spacing and using graphic images within the table.</p>
<p>The images are either a small circle or a big X or O. When the user clicks on a circle, it changes to an X or O then checks wh... | <p>Go ahead and use tables for layout -- tic-tac-toe is a grid, so it makes sense to use a grid for containing the play area. CSS can be used for colors, fonts, borders etc.</p>
<p>You can use CSS to override the colors and underline styles of anchors, but it's easier IMO to just use images. PNG would be better than J... | <p>Eventually (when browsers catch up, notably with IE8), the "CSS way" to get table-like layout without the HTML <code><table></code> semantics, will be to use <code>display: table-row;</code> and <code>display: table-cell;</code>.</p>
<p>There's a good write-up in the article: <a href="http://www.digital-web.c... | 23,548 |
<p>I have a 5 ASPX page <code>wizard</code>.
Each one contains a <code>SaveAndExit</code> button that executes a C# function on a common static class. After saving, the C# code redirects to another page.</p>
<p>Is there a way for running <code>javascript: alert('Data Saved');</code> after the saving, and before new pa... | <p>You'll have to register a startup script on postback to do the alert. Then redirect via javascript after the alert.</p>
| <p>You can't do it exactly like you want.</p>
<p>The C# code (server-side) can't run until the page has already posted back and unloaded from the browser. So by the time your server-side code is running the page doesn't even exist any more as far as the browser is concerned and it's too late to run your javascript co... | 38,274 |
<p>Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an <a href="https://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project">uninstall option in the start menu</a> (thanks Giovanni Galbo), however we now need to GAC... | <p>According to <a href="http://jrsoftware.org/files/is5-whatsnew.htm" rel="noreferrer">http://jrsoftware.org/files/is5-whatsnew.htm</a> you should be able to do it with v5.3 and above</p>
<blockquote>
<p>Added .NET support (these cause an
internal error if used on a system
with no .NET Framework present):</p>
... | <p>Not sure about library, but you can call <a href="http://msdn.microsoft.com/en-us/library/ex0ss12c%28VS.80%29.aspx" rel="nofollow noreferrer">gacutil.exe</a> to install/uninstall assemblies.</p>
| 8,696 |
<p>Does anyone know how to clear the filter drop down (combo) contents in Wireshark? Are the contents stored in a file somewhere?</p>
<p>For the life of me, I can't figure this out. And, the Wireshark help file only tells me "The entries in the pull down list will remain available even after a program restart."</p>
| <p>Sigh...</p>
<p>Answered my own question. </p>
<p>The filter history is stored in
c:\documents and settings\foo\Application Data\Wireshark\recent, where "foo" is your windows user name. </p>
<p>I don't use Wireshark in Linux, so I don't know where this file lives there. I would imagine in your home directory. ... | <p>This is now in %APPDATA%\Wireshark\recent_common</p>
<p>AKA C:\Users\username\AppData\Roaming\Wireshark\recent_common</p>
<p>Look for the ######## Recent display filters (latest last), cannot be altered through command line ######## section.</p>
| 48,601 |
<p>With a vector defined as <code>std::vector<std::string></code>,
Wondering why the following is valid:</p>
<pre><code>if ( vecMetaData[0] != "Some string" )
{
...
</code></pre>
<p>But not this:</p>
<pre><code>switch ( vecMetaData[1] )
{
...
</code></pre>
<p>Visual studio complains :</p>
<pre>... | <p>switch() needs an integral type (like int, char, ...)</p>
<p>string is not an integral type, neither does string have an implicit conversion to an integral type, so it can't be used in a switch statement</p>
| <p>The easiest alternative BTW is a <code>std::map<std::string, boost::function> StringSwitch;</code></p>
<p>This lets you say <code>StringSwitch["Some string"](arguments...)</code></p>
| 39,759 |
<p>Is it possible to set up a Grid or other container control to be sort of an event dam? So that when any events, specifically a left click, that start within it are working their way up that they stop at that control and go no further?</p>
| <p>PreviewMouseDown is your friend...</p>
<p>Add this event to your control, and set the Handled property on true...</p>
<p>All events tunnel first from root to leaves in the preview fase, then they are handled from leaves to root in the actual event case...</p>
<p>So PreviewMouseDown handles the Grid before the But... | <p>You should be able to extend whatever control you want (assuming it is not sealed). In your extended class you can override the click event and swallow it (do not pass it to the base class).</p>
| 35,095 |
<p>I'm trying to create an ASP page that has a bridged connection with an SQL Server 2005 database (separate sever from the ASP's server). For this I am trying to use a Windows Authentication setup. I have my name with full rights to the SQL server yet I am still getting the error 'Login failed for user COMPANY\name'. ... | <p>I assume these are on the same domain (since you mentioned COMPANY\name)?</p>
<p>Manke sure SQL Server is set to allow remote connections. (Surface Area Configuration for Services and Connections)</p>
<p>If you are using Windows Auth, are you trying to specify a single user to connect as, or is the current user's... | <p>Dont use Windows authentication for this kind of connection. </p>
<p>Can you post a copy of the connection string (sanitized - change the password) you are using for both WA and SQLauth?</p>
| 33,317 |
<p>I've read somewhere that functional programming is suitable to take advantage of multi-core trend in computing. I didn't really get the idea. Is it related to the lambda calculus and von neumann architecture?</p>
| <p>Functional programming minimizes or eliminates side effects and thus is better suited to distributed programming. i.e. multicore processing.</p>
<p>In other words, lots of pieces of the puzzle can be solved independently on separate cores simultaneously without having to worry about one operation affecting anothe... | <p>Omitting any technical/scientific terms the reason is because functional program doesn't share data. Data is copied and transfered among functions, thus there is no shared data in the application.</p>
<p>And shared data is what causes half the headaches with multithreading.</p>
| 21,879 |
<p>"Spring.NET is an open source application framework that makes building enterprise .NET applications easier."
<a href="http://www.springframework.net/" rel="noreferrer">Springframework</a></p>
<p>They say that Spring makes .Net development easier. Then I see the manual which is long as anything.
<a href="http://ww... | <p>Note that it says it makes <em>enterprise .net applications</em> easier. Enterprise applications are not really the same as normal applications. They are very large scale applications, requiring designing around massive scalability, portability and extremely flexible configuration. Frameworks that simplify this proc... | <p>I agree with you that it has some learning curve, but that alone should not discourage anybody from learning this really awesome tool. </p>
| 24,973 |
<p>I have a bunch of JUnit 3 classes which extend TestCase and would like to automatically migrate them to be JUnit4 tests with annotations such as <code>@Before</code>, <code>@After</code>, <code>@Test</code>, etc.<br>
Any tool out there to do this in a big batch run?</p>
| <p>In my opinion, it cannot be that hard. So let's try it:</p>
<h2>0. Imports</h2>
<p>You need to import three annotations:</p>
<pre><code>import org.junit.After;
import org.junit.Before;
import org.junit.Test;`
</code></pre>
<p>After you've made the next few changes, you won't need <code>import junit.framework.Tes... | <p>Nice post. I did the upgrade using Netbeans with the following RegEx strings:
(First line search-string, second one replace-string)</p>
<pre><code>public void test
@Test\n public void test
@Override\n.*protected void onSetUp
@Before\n protected void onSetUp
@Override\n.*protected void onTearDown
@After\n ... | 33,159 |
<p>A few months ago, I have programmed an ASP.NET GridView with a custom "Delete" LinkButton and Client-Side JavaScript Confirmation according to this msdn article:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb428868.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb428868.aspx</a>... | <p>Try this :</p>
<pre><code><asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete"
OnClientClick="return confirm('Delete Id : '<%# (string)Eval('id')%>')" >
</asp:LinkButton>
</code></pre>
| <p>Finally found a solution at <a href="http://forums.asp.net/t/1161858.aspx" rel="nofollow noreferrer">http://forums.asp.net/t/1161858.aspx</a></p>
<p>In that thread, the root of the problem was ultimately assigned to "The cause was McAfee Phising Filter".</p>
<p>I had to replace the evident line</p>
<pre><code>OnC... | 44,243 |
<p>I look for a tool/framework to make automatic acceptance-testing. The interface to create new tests should be so easy, that a non-programmer (customer, boss) will be able to add specifications for which will be tested automatically.</p>
<p>It should be some way to execute the tests from command-line, to include a r... | <p><a href="http://fitnesse.org/" rel="nofollow noreferrer">http://fitnesse.org/</a> appears to meet all of the qualifications you want. It is one I have used with success.</p>
| <p>What you ask for appears to be for a very well-defined system with a very specific sets of inputs and a high degree of automation built-into the system or developed for your system. </p>
<p>Commercial applications such as <a href="http://en.wikipedia.org/wiki/QuickTest_Professional" rel="nofollow noreferrer">HP Qui... | 15,774 |
<p>What is the fastest, yet secure way to encrypt passwords (in PHP preferably), and for whichever method you choose, is it portable?</p>
<p>In other words, if I later migrate my website to a different server, will my passwords continue to work?</p>
<p>The method I am using now, as I was told, is dependent on the exa... | <p>If you are choosing an encryption method for your login system then speed is not your friend, Jeff had a to-and-frow with Thomas Ptacek about passwords and the <a href="http://chargen.matasano.com/chargen/2007/9/7/enough-with-the-rainbow-tables-what-you-need-to-know-about-s.html" rel="noreferrer">conclusion</a> was ... | <p><a href="http://php.net/password_hash" rel="nofollow noreferrer"><code>password_hash ( string $password , int $algo [, array $options ] )</code></a>. (PHP 5 >= 5.5.0, PHP 7)</p>
<p><code>password_hash()</code> creates a new password hash using a strong one-way hashing algorithm. <code>password_hash()</code> is c... | 2,309 |
<p>I have an issue where when a <code>textField</code> is clicked on in a <code>UITableViewCell</code>, the method <code>tableView:didSelectRowAtIndexPath:</code> does not get invoked. The problem is, I need to scroll my <code>tableView</code> into proper position, otherwise the keyboard goes right over the first respo... | <p>I found the following works well (It assumes you're in a table view controller)</p>
<pre><code>- (void)textFieldDidBeginEditing:(UITextField *)textField{
CGPoint pnt = [self.tableView convertPoint:textField.bounds.origin fromView:textField];
NSIndexPath* path = [self.tableView indexPathForRowAtPoint:pnt];... | <p>Register for UIKeyboardWillShowNotification and UIKeyboardWillHideNotification, then adjust your view as necessary in the notification handlers. One of the example apps shows how to do this, but I forget which...SQLiteBooks, or maybe EditableDetailView.</p>
| 45,674 |
<p>I'm using Solidworks to design parts to be 3d-printed.</p>
<p>I've noticed that if I'm making an assembly, where one part has features that touch other parts, then when I try to save that assembly as an STL for printing, I'll get a dialog from Solidworks saying "This assembly has coincident or interfering geometry ... | <p>Solidworks has means for detection and eradication of these errors. If there's unwanted intersection, then you can either separate the parts or merge them (by saving assembly as a part). If you work with SLDPRTs, then use mating options correctly, avoid manual mating, make sure that the design of your components act... | <p>When saving assembly as part, do not use the save external faces option. Exterior components is best option to use to try an aviod these problems.</p>
<p><em>btw I dont have soldiworks, this is just some reseacrch I did</em></p>
| 694 |
<p>I am using trigger_error to "throw" errors in a custom class. My problem is that trigger_error prints out the line number where trigger_error was called. For example, given the following code:</p>
<pre><code>01 <?php
02 class Test {
03 function doAction() {
04 $this->doSubA... | <p>The best thing to do is set up an error handler that shows a full stack trace.</p>
<p>Set up a custom error handler, and call debug_print_backtrace() in it. You will find this useful in general, as well in this specific circumstance.</p>
| <p>Two options, neither one are particularly palatable:</p>
<ul>
<li><p>Override Have test() provide <code>__LINE__</code> in the arguments (eg. "<code>test(__LINE__)</code>", and give the argument to trigger_error). Set an error handler to print a custom error message. <strong>NOTE:</strong> This is horrifically ugly... | 22,473 |
<p>Is there a problem using VMware on Windows to host a virtual linux box running iptables? I have a configuration that seems to work on physical hardware but is flaky under VMware.</p>
<p>I'm using VMware to run a virtual linux 2.6.24 machine on a Windows 2003 Server host. The linux application is essentially a NAT... | <p>Your second log line is trying to match packets sent to 10.10.1.33, but you changed the destination address to 192.168.0.33 on the line above it. </p>
<p>I'm not sure why you don't see the outgoing packets in tcpdump yet. I assume you're running tcpdump on the linux VM itself. Is the VM sending packets on the same ... | <p>After your edit, I suggest an experiment: on your physical machine, configure your NIC to disable all hardware acceleration.</p>
| 34,714 |
<p>Selecting the union:</p>
<pre><code>select * from table1
union
select * from table1_backup
</code></pre>
<p>What is the query to select the intersection?</p>
| <p>In SQL Server <a href="http://msdn.microsoft.com/en-us/library/ms188055.aspx" rel="noreferrer">intersect</a></p>
<blockquote>
<pre><code>select * from table1
intersect
select * from table1_backup
</code></pre>
</blockquote>
| <pre><code>select distinct * from (select * from table1 union select * from table1_backup)
</code></pre>
| 17,924 |
<p>I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specifi... | <p>As it hasn't been mentioned yet: <a href="http://ui.jquery.com/" rel="noreferrer">jQuery.UI</a></p>
| <p>Sproutcore would be a good choice.</p>
<p>If you're unfamiliar with it you might find that the time required to learn the basics is too long for throw-away code but once you've got the basics down it's quite quick to develop with.</p>
| 37,701 |
<p>I am using Oracle form 10
I want to know how can I access the parameters of URL in oracle form </p>
<p>Ex:
whenever I run the form it opens in a browser and the URL for the same is</p>
<p><a href="http://112.10.0.10:7778/forms/frmservlet?config=pkamble" rel="nofollow noreferrer">http://112.10.0.10:7778/forms/frmse... | <p>I don't know if you can read config parameter, but to read another parameter from URL your URL have to be like:</p>
<pre><code>http://112.10.0.10:7778/forms/frmservlet?config=pkamble&otherparams=name=value
</code></pre>
<p>In your .fmb you will have to add 'name' parameter in the parameters block and then you ... | <p>You are trying assign the inbuilt variable config to the parameter
but actualy you have to name the parameter like </p>
<p><a href="http://112.10.0.10:7778/forms/frmservlet?config=pkamble&otherparams=confing1=pkamble" rel="nofollow noreferrer">http://112.10.0.10:7778/forms/frmservlet?config=pkamble&otherp... | 38,656 |
<p>MS is calling Azure an Operating System. </p>
<p>To me, it feels much more like a framework. I am having a bit of trouble defining the two separately. I have a general intuition, but I am not articulate enough to really say if Azure is really an OS or just a framework sitting on top of Operating Systems.</p>
| <p>I've just been listening to the <a href="http://deepfriedbytes.com/podcast/episode-20-windows-azure-the-overlord-in-the-cloud/" rel="noreferrer">Deep Fried Bytes Podcast #20</a> wherein, they interview Steve Marx, the Windows Azure Program Manager, and he explains it all.</p>
<p>From what I can gather thus far (hav... | <p><a href="https://stackoverflow.com/questions/240455/what-is-windows-azure">What is Windows Azure?</a> seems to answer this, perhaps?</p>
<p>Quoting @<a href="https://stackoverflow.com/questions/240455/what-is-windows-azure#240533">daok</a>:</p>
<h2>Description</h2>
<p>The Azure™ Services Platform (Azure) <strong>is ... | 40,785 |
<p>I want to 3d print my own icing smoothers, but I'm not sure if its safe to have plastic from a 3D printer in contact with cake icing. Is there any harm in this?</p>
| <p>Only certain plastics are safe enough to be used to contain or manipulate food. ABS and PET-G are such materials. The 3d printing process however is not food safe because, it creates crevices in the printed part into which bacteria and other contaminants can cling to. A printed part would need to be coated in a sili... | <p>As mentioned, FDM 3D printed parts are flawed for food service and prep use regardless of the material, because of the small gaps between lines where bacteria can grow, and because your printer isn't used in a way to keep it from introducing contaminants into otherwise clean material.</p>
<p>However, there are some ... | 1,241 |
<p>I'd like a concise introduction to the different options.</p>
| <p>From <a href="http://en.wikipedia.org/wiki/Flash_video" rel="nofollow noreferrer">Wikipedia</a></p>
<blockquote>
<blockquote>
<p><strong>Embedded in an SWF file</strong> using the Flash authoring tool (supported in Flash Player 6 and later). The entire file must be transferred before playback can begin. Chang... | <p>Further to yoavf's answer, you can also use haxevideo as an open source rtmp video streaming server.</p>
| 2,934 |
<p>I need to empty an LDF file before sending to a colleague. How do I force SQL Server to truncate the log?</p>
| <p>In management studio:</p>
<ul>
<li>Don't do this on a live environment, but to ensure you shrink your dev db as much as you can:
<ul>
<li>Right-click the database, choose <code>Properties</code>, then <code>Options</code>.</li>
<li>Make sure "Recovery model" is set to "Simple", not "Full"</li>
<li>Click OK</li>
</... | <p>Another option altogether is to detach the database via Management Studio. Then simply delete the log file, or rename it and delete later. </p>
<p>Back in Management Studio attach the database again. In the attach window remove the log file from list of files.</p>
<p>The DB attaches and creates a new empty log fil... | 6,163 |
<p>Can someone tell me method to define the MIME-Type of a static XHTML File as text/html …. I don’t want to use php, asp.net…….. javascript would be ok</p>
| <p>You shouldn't. Here's why:</p>
<p><strong>Sending XHTML as text/html Considered Harmful</strong> (<a href="http://hixie.ch/advocacy/xhtml" rel="nofollow noreferrer">http://hixie.ch/advocacy/xhtml</a>)</p>
<blockquote>
<p>If you use XHTML, you should deliver
it with the application/xhtml+xml MIME
type. If you... | <p>Use your web server to do it. If you are using apache, create a file called .htaccess in the directory with the file and add this line:</p>
<p>AddType text/html .html</p>
| 31,829 |
<p>Ok guys its time to be stupid, I want to start looking at WCF but to be honest before I do I would like to understand more about SOA in general. </p>
<p>I dont really understand the concept of a "Enterprise service bus", and am not sure whether it is a pattern/methodology or piece of software. Additionally, the sam... | <p>SOA in simple terms decouples your presentation related components from the mechanism that fetches the content.</p>
<p>It sounds very trivial but the idea is that the presentation components should not only be independent of the program that fetches the data but also be agnostic of it.</p>
<p>To achieve this, a "S... | <p>ESB provides a standards-based integration platform that combines messaging, web services, data transformation, and intelligent routing in an event-driven SOA. ESB is one of the important steps in moving towards a complete SOA.</p>
<p>Frameworks like Biztalk Server 2006 alongwith it's ESB Guidance toolkit aim at b... | 31,254 |
<p>I've been trying to figure out a regex to allow me to search for a particular string while automatically skipping comments. Anyone have an RE like this or know of one? It doesn't even need to be sophisticated enough to skip <code>#if 0</code> blocks; I just want it to skip over <code>//</code> and <code>/*</code> ... | <p>This is a harder problem than it might at first appear, since you need to consider comment tokens inside strings, comment tokens that are themselves commented out etc.</p>
<p>I wrote a string and comment parser for C#, let me see if I can dig out something that will help... I'll update if I find anything.</p>
<p>E... | <p>I would make a copy and strip out the comments first, then search the string the regular way.</p>
| 7,764 |
<p>Is there a programming language "below" Assembly?</p>
| <p>Actually there's a level of code that sits below machine code, called <a href="http://en.wikipedia.org/wiki/Microcode" rel="noreferrer">Microcode</a>.</p>
| <p>Well, you can always write code in binary (or hex, or some other representation). You'll then have to calculate jump offsets etc in your head. Not recommended. ;)</p>
| 33,383 |
<p>I have a large legacy system to maintain. The codebase uses threads all over the place and those threads share a lot of mutable data. I know, sounds bad. Anyway, don't answer "rewrite the whole application from scratch" or I'll vote you down :-) I have tried to run some static analysis tools on the codebase, but non... | <p>Chris Grindstaff wrote an article <a href="http://www.ibm.com/developerworks/java/library/j-findbug2/" rel="noreferrer">FindBugs, Part 2: Writing custom detectors</a> in which he describes how to use the <a href="http://jakarta.apache.org/bcel/index.html" rel="noreferrer">BCEL</a> to add your own rules. (BCEL isn't ... | <p>FindBugs and professional tools based on it are your best hope, but don't count on them finding all of the concurrency woes in your code.</p>
<p>If things are in that bad a shape, then you should supplement the tooling with analysis by a human java concurrency expert.</p>
<p>This is a hard problem because <em>conc... | 22,641 |
<p>I am trying to plan a way for 5 developers to use Visual Studio 2005/2008 to collaboratively develop an ASP.NET web app on a development web server against an Oracle 8i(soon to be 10g) Database.</p>
<p>The developers are either on the local network or coming in over a vpn (not a very fast connection), </p>
<p>I ev... | <p>I have used <a href="http://subversion.tigris.org/" rel="nofollow noreferrer">Subversion</a> and <a href="http://tortoisesvn.tigris.org/" rel="nofollow noreferrer">TortoiseSVN</a> and was very pleased.</p>
| <p>I would say SVN on price (free), <a href="http://www.perforce.com/" rel="nofollow noreferrer">Perforce</a> on ease of integration. </p>
<p>You will undoubtedly hear about GIT and CVS as well and there are good reasons to look at them.</p>
| 19,820 |
<p>Is there a list somewhere on common Attributes which are used in objects like <code>Serializable</code>?</p>
<p>Thanks</p>
<p>Edit ~ The reason I asked is that I came across an StoredProcedure attribute in ntiers ORMS.</p>
| <p>Yes, look msdn has you covered please look <a href="http://msdn.microsoft.com/en-us/library/system.attribute.aspx#inheritanceContinued" rel="nofollow noreferrer">here</a>.</p>
<p>EDIT: This link only answer sucked. Here is a working extractor for all loadable types (gac) that have Attribute in the name. </p>
<pre>... | <p>You may not find what you're looking for because it's possible that you're looking at a custom attribute.</p>
<p><a href="http://www.code-magazine.com/Article.aspx?quickid=0307041" rel="nofollow noreferrer">http://www.code-magazine.com/Article.aspx?quickid=0307041</a></p>
| 21,647 |
<p>I'm looking at having certain users access one database and other users accessing another database based on the company they belong to. What would be the best way to handle the connection strings and make sure the user connects to the right db when they login?</p>
<p>Thanks for any ideas.</p>
| <p>In Web.Config or App.Config </p>
<pre><code><connectionStrings>
<add name="ConnectionForDudes" providerName="System.Data.SqlClient"
connectionString="Data Source=___MALECONNECTIONHERE___"/>
<add name="ConnectionForChicks" providerName="System.Data.SqlClient"
connectionString="Data Sou... | <p>Have a database table that stores the connection info for each user. Maybe something like the <a href="http://msdn.microsoft.com/en-us/library/aa479030.aspx" rel="nofollow noreferrer">Provider Model</a> would be useful?</p>
| 33,374 |
<p>Instead of returning a common string, is there a way to return classic objects?
If not: what are the best practices? Do you transpose your object to xml and rebuild the object on the other side? What are the other possibilities? </p>
| <p>As mentioned, you can do this in .net via serialization. By default all native types are serializable so this happens automagically for you.</p>
<p>However if you have complex types, you need to mark the object with the [Serializable] attribute. The same goes with complex types as properties.</p>
<p>So for example... | <p>As others have said, it is possible. However, if both the service and client use an object that has the exact same domain behavior on both sides, you probably didn't need a service in the first place. </p>
| 3,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.