instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I want to create a new net.tcp://localhost:x/Service endpoint for a WCF service call, with a dynamically assigned new open TCP port.</p> <p>I know that TcpClient will assign a new client side port when I open a connection to a given server.</p> <p>Is there a simple way to find the next open TCP port in .NET?</p> ...
<p>Here is what I was looking for:</p> <pre><code>static int FreeTcpPort() { TcpListener l = new TcpListener(IPAddress.Loopback, 0); l.Start(); int port = ((IPEndPoint)l.LocalEndpoint).Port; l.Stop(); return port; } </code></pre>
<p>If you want to get a free port in a specific range in order to use it as local port / end point:</p> <pre><code>private int GetFreePortInRange(int PortStartIndex, int PortEndIndex) { DevUtils.LogDebugMessage(string.Format("GetFreePortInRange, PortStartIndex: {0} PortEndIndex: {1}", PortStartIndex, PortEndIndex)...
16,696
<p>I'm using Django and Python 2.6, and I want to grow my application using a MySQL backend. Problem is that there isn't a win32 package for MySQLdb on Python 2.6.</p> <p>Now I'm no hacker, but I thought I might compile it myself using MSVC++9 Express. But I run into a problem that the compiler quickly can't find <c...
<p>I think that the header files are shipped with MySQL, just make sure you check the appropriate options when installing (I think that sources and headers are under "developer components" in the installation dialog).</p>
<p>Have you considered using a pre-built stack with Python, MySQL, Apache, etc.?</p> <p>For example: <a href="http://bitnami.org/stack/djangostack" rel="nofollow noreferrer">http://bitnami.org/stack/djangostack</a></p>
40,865
<p>What do you recommend as minimum specs for a Windows laptop running Vista, an IDE, and Apache, MySQL, and PHP?</p>
<p>Like others have said, you can use the PIVOT and UNPIVOT operators. Unfortunately, one of the problems with both PIVOT and UNPIVOT are that you need to know the values you will be pivoting on in advance or else use dynamic SQL.</p> <p>It sounds like, in your case, you're going to need to use dynamic SQL. To get thi...
<p>in sql2005, there are functions called "PIVOT" and "UNPIVOT" which can be used to transform between rows and columns.</p> <p>Hope that could help you.</p>
45,241
<p>Photoshop has a lot of cool <a href="http://alanwho.com/photoshop/photoshop-artistic-filters/" rel="noreferrer">artistic filters</a>, and I'd love to understand the underlying algorithms.</p> <p>One algorithm that's particularly interesting is the Cutout filter (number 2 at the link above).</p> <p>It has three tun...
<p>Very old question but maybe someone searching for an answer and maybe this helps. Opencv's findcontours and approxPolyDP functions can do this. But we need to prepare the image before main process. First; find most used N colors with k-means. For example find 8 colors.Find contours for each color and then calculate ...
<p>Maybe not exactly what you are looking for, but if you like knowing how filters work, you could check out the source code of GIMP. I can't say if GIMP has an equivalent of cutout filter you mentioned, but it's worth taking a look if you are truly interested in this field.</p>
29,380
<p>I bought a buddha statue and I would like to scan it using photogrammetry and publish the result. </p> <p><strong>Am I allowed to do that?</strong></p> <p>Is this the same like scanning a book and publishing it? Sketchfab on the other hand is full of 3d models of commercial products.</p>
<p>If the design was made from an artist and is not public domain, than you should not upload that scan without the (written) permission of the creator of the design. Espacially a scan of a decorative object will likely be protected, so costumers buy the original instead of printing itself or buy a printed version. If ...
<p>First thing to do is get a lawyer skilled in copyright law as applicable where you live. It's going to depend in no small part on whether your scanned model is considered a copy or a transformative work of art. </p> <p>Personally, I see scanning an object as similar to photographing it (or sketching it). Lots of...
1,000
<p>Suppose you have two models, User and City, joined by a third model CityPermission:</p> <pre><code>class CityPermission &lt; ActiveRecord::Base belongs_to :city belongs_to :user end class City &lt; ActiveRecord::Base has_many :city_permissions has_many :users, :through =&gt; :city_permissions end class Us...
<p>Looks good to me.</p> <p>The joins generated should just be on either the PK IDs of the entity tables, or on the FK IDs in the join table - which are both indexes.</p> <p>Probably would be good to look at the generated ActiveRecord SQL and compare it against the indexes.</p> <p>Depending on what database you're o...
<p>Here is the SQL that ActiveRecord generates for <code>user.cities</code>:</p> <pre><code>SELECT `cities`.* FROM `cities` INNER JOIN city_permissions ON (cities.id = city_permissions.city_id) WHERE (city_permissions.user_id = 1 ) </code></pre> <p>EXPLAIN results below:</p> <pre><code>+----+-------------+----------...
27,641
<p>For RMI on server-side, do we need to start <code>rmiregistry</code> program, or just call <code>LocateRegistry.createRegistry</code>? If both are possible, what are the advantages and disadvantages?</p>
<p>They're the same thing... <code>rmiregistry</code> is a separate program, which you can run from a command line or a script, while <code>LocateRegistry.createRegistry</code> does the same thing programatically.</p> <p>In my experience, for "real" servers you will want to use <code>rmiregistry</code> so that you kno...
<p>If you are writing a standalone java application you would want to start your own rmiregistry but if you are writing a J2EE app that obviously runs inside a J2EE container then you want to "LocateRegistry" as there is already one running on the app server!</p>
12,446
<p>In C++, I'm trying to catch all types of exceptions in one catch (like <code>catch(Exception)</code> in C#). How is it done? And what's more, how can one catch divide-by-zero exceptions?</p>
<pre><code>catch (...) { // Handle exceptions not covered. } </code></pre> <p>Important considerations:</p> <ul> <li>A better approach is to catch specific types of exception that you can actually recover from as opposed to all possible exceptions.</li> <li>catch(...) will also catch certain serious system level e...
<p>If I recall correctly (it's been a while since I've looked at C++), I think the following should do the trick</p> <pre><code>try { // some code } catch(...) { // catch anything } </code></pre> <p>and a quick google(<a href="http://www.oreillynet.com/pub/a/network/2003/05/05/cpluspocketref.html" rel="nofollow nor...
7,969
<p>I wish to perform an experiment many different times. After every trial, I am left with a "large" set of output statistics -- let's say, 1000. I would like to store the outputs of my experiments in a table, but what's the best way...?</p> <h3>Option 1</h3> <p>Have a table with 1000 columns. Seems like a bad ide...
<p>Option 2, with ID, TrialID, StatisticID, StatisticValue</p> <p>With proper indexing, it will perform fairly well (you can use PIVOT to get the values out on columns fairly easily in SQL Server 2005).</p> <p>When the statistics are different datatypes, the problem becomes more interesting, but in many cases, I just...
<p>Three columns: ID, Experiment and Value. It's not that complicated to get the result from one experiment, for example: <code>SELECT * FROM table WHERE Experiment = 5;</code></p>
20,379
<p>Do I need a UUID to program for the iPhone? I was told I need this, how can I get a UUID</p>
<p>Absolutely! Boost ASIO allows you to access the native/underlying data, which in this case is the SOCKET itself. So, let's say you have:</p> <pre><code>boost::asio::ip::tcp::socket my_socket; </code></pre> <p>And let's say you've already called <code>open</code> or <code>bind</code> or some member function that ...
<p>An easy work-around to this problem would be to use the native read and write functions.</p> <p>For writing with 1sec timeout:</p> <pre><code>struct timeval tv = { 1, 0 }; setsockopt(socket.native_handle(), SOL_SOCKET, SO_SNDTIMEO, &amp;tv, sizeof(tv)); ssize_t nsent = ::write(socket-&gt;native_handle(), buff, siz...
37,391
<p>I'm not sure if Vim makes me more productive compared to other editors/ide's like Eclipse for example.</p> <p>But somehow I get an empowering feeling when using Vim and noticed resistance to trying others editors.</p> <p>Example: As soon a I see some cool feature in an other editor I'm thinking "<em>Vi can do that...
<p>I'd say those symptoms are subjective clues that you're probably more productive in Vim - frustration with other tools is likely to be a fairly good indicator.</p> <p>I would say with a huge degree of certainty that if you're into Vim deep enough to get frustrated with other editors, any productivity gain from swit...
<p>Why not just try out several different editors and see if you can <em>notice</em> any productivity gains from them. If you don't then pick the one that appeals to you the most, if you do you will need to decide if the productivity gain outweighs the happiness you feel when using vim.</p> <p>You might also want to ...
47,595
<p>I have a greasemonkey user script with this single line of code...</p> <pre><code>window.close(); </code></pre> <p>but firefox does not allow a user script to close a window (as reported by an error message in the error console)</p> <p>Is there a work around to this problem?</p>
<p><strong>You need to change configuration settings of Firefox (about:config) to allow this.</strong></p> <h2>Steps:</h2> <ol> <li>Go to address bar and type <strong>about:config</strong></li> <li>Go to parameter <strong>dom.allow_scripts_to_close_windows</strong></li> <li>Set its value as <strong>true</strong></li>...
<p>Since Firefox treats Greasemonkey code with the same privilages as the script code on external websites, it is not possible to only allow Greasemonkey code to be able to close the windows, but not regular scripts.</p>
42,791
<p>I find the concept of the programmable, tiling, keyboard-focuessed window manager <a href="http://www.modeemi.fi/~tuomov/ion/" rel="nofollow noreferrer">ion3</a> very appealing, but I think it takes some time to customize it to your needs until you can really evaluate this totally different UI-concept.</p> <p>There...
<p>I've used it off and on for the last few years, I think its a great window manager, but I keep crawling back to kde3 whatever I use. </p> <p>Its however difficult to put into quantifiable terms why this happens, but its right up there with the gnome-vs-kde battle. Neither side can understand the other. </p> <p>I w...
<p>I've used it off and on for the last few years, I think its a great window manager, but I keep crawling back to kde3 whatever I use. </p> <p>Its however difficult to put into quantifiable terms why this happens, but its right up there with the gnome-vs-kde battle. Neither side can understand the other. </p> <p>I w...
10,826
<p>I used to do this:</p> <pre><code>SELECT layerID FROM layers WHERE ownerID = ? AND collectionID = ? </code></pre> <p>Which would give me an array of layerID's, and then I'd loop and do this for each one:</p> <pre><code>SELECT DATA FROM drawings WHERE layerID = ? </code></pre> <p>And it all worked fine. So now I'...
<p>Try a join. ANY ends up looking a lot like an unoptimizable UNION to the query optimizer.</p> <pre><code>SELECT d.DATA, d.layerID FROM drawings AS d INNER JOIN layers AS l ON d.layerID = l.layerID WHERE l.ownerID = ? AND l.collectionID = ? </code></pre>
<p>I have never seen the ANY keyword before, but if you try </p> <pre> SELECT DATA , layerID FROM drawings WHERE layerID IN ( SELECT layerID FROM layers WHERE ownerID = ? AND collectionID = ? ) </pre> <p>will that have the same problem? I believe it shouldn't. However, the INNER JOIN is probably a little bit ...
36,682
<p>I want a pure virtual parent class to call a child implementation of a function like so:</p> <pre><code>class parent { public: void Read() { //read stuff } virtual void Process() = 0; parent() { Read(); Process(); } } class child : public parent { public: virtual void Pr...
<p>Title of the following article says it all: <a href="http://www.artima.com/cppsource/nevercall.html" rel="noreferrer">Never Call Virtual Functions during Construction or Destruction</a>.</p>
<p>You need to wrap in inside an object that calls the virtual method after the object is fully constructed:</p> <pre><code>class parent { public: void Read() { /*read stuff*/ } virtual void Process() = 0; parent() { Read(); } }; class child: public parent { public: virtual void Pr...
28,720
<p>Is there a way to comment out markup in an <code>.ASPX</code> page so that it isn't delivered to the client? I have tried the standard comments <code>&lt;!-- --&gt;</code> but this just gets delivered as a comment and doesn't prevent the control from rendering. </p>
<pre><code>&lt;%-- Commented out HTML/CODE/Markup. Anything with this block will not be parsed/handled by ASP.NET. &lt;asp:Calendar runat="server"&gt;&lt;/asp:Calendar&gt; &lt;%# Eval(“SomeProperty”) %&gt; --%&gt; </code></pre> <p><a href="http://weblogs.asp.net...
<p>Another way assuming it's not server side code you want to comment out is...</p> <pre><code>&lt;asp:panel runat="server" visible="false"&gt; html here &lt;/asp:panel&gt; </code></pre>
14,763
<p>Is there some library for using some sort of cursor over a file? I have to read big files, but can't afford to read them all at once into memory. I'm aware of java.nio, but I want to use a higher level API.</p> <p>A little backgrond: I have a tool written in GWT that analyzes submitted xml documents and then pretty...
<p>Have you taken a look at using FileChannels (i.e., memory mapped files)? Memory mapped files allow you to manipulate large files without bringing the entire file into memory.</p> <p>Here's a link to a good introduction: <a href="http://www.developer.com/java/other/article.php/1548681" rel="nofollow noreferrer">http...
<p>I don't understand when you ask for a "higher level API" when positioning the file pointer. It is the higher levels that may need to control the "cursor". If you want control, go lower, not higher. </p> <p>I am certain that lower level Java io clases allow you to position yourself anywhere within any sized file wit...
30,630
<p><a href="https://stackoverflow.com/questions/180/function-for-creating-color-wheels">Original Question</a></p> <p>If you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to bein...
<p>This also sounds to me like some kind of <em>resistance graph</em> where you try to map out the path of least resistance. If you inverse the requirements, path of maximum resistance, it could perhaps be used to produce a set that from the start produces maximum difference as you go, and towards the end starts to go ...
<p>Do you mean that from a set of N colors, you need to pick M colors, where M &lt; N, such that M is the <em>best</em> representation of the N colors in the M space?</p> <p>As a better example, reduce a true-color (24 bit color space) to a 8-bit mapped color space (GIF?).</p> <p>There are quantization algorithms for...
2,374
<p>I was just reading the intro to the Boost::Spirit LL Parser framework. The preface suggests that the author and creator likes to use such parsing technology to read in program options. Doesn't Boost have its own library for program options?</p> <p>I am wondering, does the Boost committee review all the library note...
<p>You're right, not all boost libraries are particularly boost-like. Spirit is a very good example of this. Part of the reason is that when it was accepted, other boost libraries were not yet accepted/sufficiently mature for Spirit to use them. (That's why there are something like 3 Boost libraries that define their <...
<p>There's no such thing as a Boost style committee. ISO's WG21 will spend a bit more time on common style, but even they managed to forget std::ifstream::ifstream((std::string const&amp; filename)</p>
49,689
<p>And if you do, can you give some background information on the implementation and the reasons for implementing this pattern?</p> <p>The pattern is described in more detail in these articles:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms997506.aspx" rel="nofollow noreferrer">Microsoft Inductive U...
<p>Yes - we had a problem in that many of the administrators of our software found it too difficult to use. To solve this we used Microsoft's WinForms IUI framework build a new configuration and management tool for our software. </p> <p>User feedback has been extremely positive, particularly with everything being task...
<p>You should be careful about making a too simple system. Expert users (bankers, insurers, CRMs, etc) should have as much information an possibilites on the screen as possible. Proceeding through forms that validate slowly has been found to be annyoing if you use that form several times during the workday.</p>
9,620
<p>Is there any way in Linq to check to see if a record of a parent exists in its children? </p> <p>I have a table that has a foreign key relationship with 12 other tables. All I want to do is see if any records in those child tables depend on the parent, so I can delete it without causing errors with FK constraints. ...
<p>You could brute-force it and wrap the delete in a try-catch. As long as all the deletes are part of the same context, if one child can't be deleted due to a FK relationship, it will roll back all the deletes in that block.</p>
<p>This may be kinda cludgy, and you would have to loop through your child tables and union them all, but here's a start...</p> <pre><code> ParentChildrenDataContext context = new ParentChildrenDataContext(); var child1Ids = from c in context.ChildType1s select c.ParentId; ...
39,059
<p>I want to salt a hashed username and password (submitted via http POST) in JS on the client-side with a higher-order time value (&lt; 1 minute resolution) to avoid sending the username and password hash as a constant value that could be used for a log-in attempt via POST fabrication by an unauthorized user (i.e. a s...
<p>The <a href="https://stackoverflow.com/questions/213380/the-necessity-of-hiding-the-salt-for-a-hash#215165">salt doesn't need to be secret</a>. In that sense, your solution is okay. </p> <p>MD5 is broken in some applications; this one might be alright, but why not use a hash from the <a href="http://en.wikipedia.or...
<p>you could use code obfuscation to make the salt harder to find</p>
45,369
<p>I have been working with our SLA printer (Facture Draken) for a couple weeks now printing in makerjuice waxcast. . I have had some successful prints, but the majority (80%) end up as pancakes stuck to the bottom of the resin tray. Some others break in half mid print. </p> <p>I have experimented with laying my m...
<p>Prints could end up on tray for couple of reasons. </p> <ul> <li>Vacuum force on early layers - Usually you should lose pieces on the center of platform <ul> <li>Put holes or channels on platform</li> <li>Very slow speed on early layers</li> <li>Use smaller platform</li> <li>Use tilt mechanism</li> <li>Use larger ...
<p>I also had issues with the first layer sticking to the build plate and I did not want to sand the plate. As most people will mention you need to make sure that your plate is perfectly level and the z height is right (lots of friction on the paper). You also need the correct exposure times for your resin and the firs...
646
<p>Simple question:</p> <p>How do I do this on one line:</p> <pre><code>my $foo = $bar-&gt;{baz}; fizz(\$foo); </code></pre> <p>I've tried \$bar->{baz}, \${$bar->{baz}}, and numerous others. Is this even possible?</p> <p>-fREW</p> <p><strong>Update</strong>: Ok, the hashref is coming from DBI and I am passing the...
<pre><code>\$bar-&gt;{baz} </code></pre> <p>should work.</p> <p>E.g.:</p> <pre><code>my $foo; $foo-&gt;{bar} = 123; my $bar = \$foo-&gt;{bar}; $$bar = 456; print "$foo-&gt;{bar}\n"; # prints "456" </code></pre> <p>In answer to the update in the OP, you can do:</p> <pre><code>\@$row{qw(body data)}; </code></pr...
<p>I am not even sure what you are doing. You also should put quotes around baz.</p> <p>Now let's consider that you assign a scalar to the scalar in the first line then the second line should work. However I don't really know if this is what you are trying here and it does not really make sense in Perl. Using referenc...
41,095
<p>I'm quickly falling in love with ASP.NET MVC beta, and one of the things I've decided I won't sacrifice in deploying to my IIS 6 hosting environment is the extensionless URL. Therefore, I'm weighing the consideration of adding a wildcard mapping, but everything I read suggests a potential performance hit when using ...
<p>Chris, very handy post.</p> <p>Many who suggest a performance disadvantage infer that the code processed in a web application is some how different/inferior to code processed in the standard workflow. The base code type maybe different, and sure you'll be needing the MSIL interpreter, but MS has shown in many case...
<p>That's quite an impressive post there, thanks very much for that.</p> <p>We're also assessing the security and performance concerns with removing a piece of software that's always been in place to filter out unwanted traffic.</p> <p>Will there by any further benchmarking on your part?</p> <p>Cheers,</p> <p>Karl....
41,850
<p>There are a whole raft of questions regarding payment processors for <b>web</b> applications but I haven't seen one yet for desktop applications. What are your experiences?</p> <p>Perhaps to put this into a little context, the requirements:</p> <ol> <li>Should be customisable</li> <li>Should be available in Austra...
<p>Unless you're looking for a world of hurt, you should not have Credit Card processing code in your client software! You might want to have an online component that responds to your client-software events and processes payments, through HTTPS requests, preferably. </p> <p>It is essential that you remember to never ...
<p>Times may be a changing, but I don't think that you can get all of the above.</p> <p>I do have some experience a couple years back with credit cards in North America. At the time the company I worked for needed recurring billing for a different amount each month (much like your requirement). At the time, none of t...
28,174
<p>I notice that get/set is not the c++ way as far as I can tell by looking at boost/stl, and even reading the writings of some of the top c++ experts.</p> <p>Does anyone use get/set in their c++ class design, and can someone suggest a rule of thumb on where if at all this paradigm belongs in the c++ world?</p> <p>It...
<p>C++ does not have properties like C#. It is possible to write methods with "get" and "set" in the their names, but they don't automatically create properties. So is it good practice to use get and set methods then?</p> <p>Using get and set methods in C++ is not bad for accessing class properties. The STL and boo...
<p>My experience is through C++ and Java, though nowadays I'm working in PHP. My general rules of thumb that I use for PHP and C++ are:</p> <ol> <li><p>If you need to have a member variable be readable from outside the class but not writable: use getVariableX() only.</p></li> <li><p>If you want to allow member variab...
48,721
<p>I have something similar to the following method: </p> <pre><code> public ActionResult Details(int id) { var viewData = new DetailsViewData { Booth = BoothRepository.Find(id), Category = ItemType.HotBuy }; return View(viewData); } </code></pre> <p>...
<p>It's hard for me to tell what you expect to happen and what is happening from your post. Is it possible there's an error in your BoothRepository.Find method such that it returns the same thing every time?</p> <p>ModelBinder should not be affecting this method because the parameter to the action method is a simple t...
<p>if you use spring.net modify Controller's singleton to "false"</p>
27,421
<p>Me and some friends are writing a MORPG in Java, and we would like to use a scripting language to, eg. to create quests.</p> <p>We have non experience with scripting in Java. We have used Python, but we are very inexperienced with it. One of us also have used Javascript. </p> <p>What scripting language should we u...
<p>Java supports a variety of (scripting) languages, some are listed in Wikipedia <a href="http://en.wikipedia.org/wiki/List_of_Java_scripting_languages" rel="nofollow noreferrer">here</a> and <a href="http://en.wikipedia.org/wiki/JVM_Languages" rel="nofollow noreferrer">here</a>. You probably should choose language wi...
<p>I am a big fan of Python/Jython due to the clean syntax - which may suit you if you have some python experience. </p> <p>Otherwise Groovy which is based on Java syntax and may be an easier learning curve if most of your developers are Java guys. It also has the advantage of closer ties with the Java language and li...
26,000
<p>I am writing a Java Application for Data Entry using Eclipse and SWT. Naturally it has a great many Text objects. </p> <p>What I would like to happen is that when user enters something into one field focus automatically changes to the next field.</p> <p>Thanks in advance</p>
<pre><code>final Text textBox = new Text(shell, SWT.NONE); textBox.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (x.getText().length() == 1); { x.traverse(SWT.TRAVERSE_TAB_NEXT); } } }); </code></pre>
<p>I assume you want to change the focus <em>after</em> the field has been filled. I suggest using a DocumentListener (or whatever SWT calls it) to be notified of changes to the field's content: if it has the right number of characters, jump to the next field.</p>
31,578
<p>I have been searching for info on this to no avail. The context of why i need this is <a href="https://stackoverflow.com/questions/271944/storing-temporary-user-files-in-aspnet-in-medium-trust">another question I asked here</a>. More specifically, does creating/updating/deleting files in App_Data cause a pool recycl...
<p>Two different effects:</p> <ul> <li><p>The AppPool process is the host for potentially multiple AppDomains. Typically this can be recycled by a number of effects. These could be time (every <em>n</em> hours), lack of requests, memory use, etc.; all configured in IIS Config Manager.</p> </li> <li><p>The AppDomain, t...
<p><code>w3wp.exe</code> was erroring out. This was causing <code>Application_Start</code> to be called in <code>Global.asax</code>. </p> <p>To find this out, I opened <strong>Event Viewer</strong>.</p> <p>Under <strong>Windows Logs</strong> I went to <strong>Application</strong>.</p> <p>I saw an <strong>Application...
38,782
<p>How do I check if a user/password pair works without actually making a connection to the database? The DBMS in question is MySQL.</p> <p>That was my original question. Since most people get this question wrong, then I should rephrase it as: How do I check if a MySQL username/password is valid, without connecting to...
<p>If you want to check if a <em>MySQL username/password</em> is valid, without connecting to MySQL as <em>that</em> user, then you should take a look at the the users table in the mysql database.</p> <p>But I'd recommend not doing this; that is really an internal MySQL implementation detail, and you really shouldn't ...
<p>If the username and password are stored in the database, then there's obviously no other way to check them other than to connect first.</p> <p>The best you could do is perhaps only connect to the DB when they log in. Once they're authenticated, you could store some form of session information on disk, but it's not ...
49,813
<p>When a ComboBox is clicked this causes it to be selected in the window. Is there a way to perform the equivalent of a javascript blur()</p>
<p>Not directly. You can try focusing the root parent of the combobox or another element, though.</p> <pre><code>comboBox1.TopLevelControl.Focus(); </code></pre> <p>or</p> <pre><code>someControl.Focus(); </code></pre>
<p>I had this similar problem and I managed to fix it by disabling and re-enabling the combobox.</p> <pre><code>comboBox1.Enabled = false; comboBox1.Enabled = true; </code></pre>
46,840
<p>For my acceptance testing I'm writing text into the auto complete extender and I need to click on the populated list.</p> <p>In order to populate the list I have to use AppendText instead of TypeText, otherwise the textbox looses focus before the list is populated.</p> <p>Now my problem is when I try to click on t...
<p>The best solution (if we're talking .NET) seem to be to use WCF and streaming http. The client makes the first http connection to the server at port 80, the connection is then kept open with a streaming response that never ends. (And if it does it reconnects).</p> <p>Here's a sample that demonstrates this: <a href=...
<p>I would go with XML. XML is widely supported on all platforms and has lots of libraries and tools available for it. And since it's text, there are no issues when you pass it between platforms.</p> <p>I know JSON is another alternative, but I'm not familiar enough with it to know whether or not to recommend it in ...
7,368
<p>For example I have 2 tables, <code>Users</code> and <code>UserRelations</code>, and it is a one to many relationship.</p> <p>For the <code>UserRelations</code> table, I can have an identity column and make it the primary key: </p> <pre><code>[RelationID] [int] IDENTITY(1,1) NOT NULL, [UserID] [int] NOT NULL, [Targ...
<p>If you use the former design, with the superfluous identity column, there's no constraint against inserting two rows with identical UserID and TargetID. You'd have to create a <code>UNIQUE</code> constraint over the other two columns, which creates a compound index anyway.</p> <p>On the other hand, some frameworks...
<p>Assuming you're doing a many-to-many relation between Users and Targets using the UserRelations table, the first one is incorrect. You want the UserID+TargetID to be unique, or else you can end up with multiple redundant entries joining the same User and Target.</p>
45,685
<p>As the topic suggests I wish to be able to pass table names as parameters using .NET (doesn't matter which language really) and SQL Server.</p> <p>I know how to do this for values, e.g. <code>command.Parameters.AddWithValue("whatever", whatever)</code> using <code>@whatever</code> in the query to denote the paramet...
<p>I don't <em>think</em> I've ever seen this capability in any SQL dialect I've seen, but it's not an area of expertise.</p> <p>I would suggest restricting the characters to A-Z, a-z, 0-9, '.', '_' and ' ' - and then use whatever the appropriate bracketing is for the database (e.g. [] for SQL Server, I believe) to wr...
<p>Please see this post answer by user Vimvq1987: <a href="https://stackoverflow.com/questions/6041496/mysqlparameter-as-tablename">MySqlParameter as TableName</a></p> <p>Essentially you first check the table name against the schema, in which the table name is used in a parameterized fashion. Then if all is ok, the t...
48,626
<p>I've used DTCTester before to diagnose MSDTC problems. However, I just noticed DTCPing seems to do about the same thing. What's the difference between these two?</p> <p>From what I can tell so far, DTCPing needs to run on both client and server machines, whereas DTCTester only needs to run from the client. Are ther...
<p>Testing DTC settings is very common when installing BizTalk Server, so from the BTS documentation, so - from <a href="http://msdn.microsoft.com/en-us/library/aa561924.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa561924.aspx</a></p> <blockquote> <p>Use the DTCTester utility to verify transact...
<p>This is not a direct answer to this question – but an important point to note.</p> <ol> <li><p>The <strong>DTCPing</strong> windows application should be open in both the servers before you start test.</p></li> <li><p>As per <a href="http://support.microsoft.com/en-us/kb/293799" rel="nofollow">How To Use <strong>DT...
19,256
<p>Im searching a Template Lib or Template Engine for generating HTML (XML) that runs under Jython (Jython 2.5 Alpha is ok).</p>
<p>Have you tried <a href="http://www.cheetahtemplate.org/" rel="nofollow noreferrer">Cheetah</a>, I don't have direct experience running it under Jython but there seem to be some people that do. </p>
<p>Have you tried <a href="http://www.cheetahtemplate.org/" rel="nofollow noreferrer">Cheetah</a>, I don't have direct experience running it under Jython but there seem to be some people that do. </p>
19,035
<p>How would you get tree-structured data from a database with the best performance? For example, say you have a folder-hierarchy in a database. Where the folder-database-row has <strong>ID</strong>, <strong>Name</strong> and <strong>ParentID</strong> columns.</p> <p>Would you use a special algorithm to get all the da...
<p>It really depends on how you are going to access the tree.</p> <p>One clever technique is to give every node a string id, where the parent's id is a predictable substring of the child. For example, the parent could be '01', and the children would be '0100', '0101', '0102', etc. This way you can select an entire s...
<p><a href="http://www.sqlteam.com/article/more-trees-hierarchies-in-sql" rel="nofollow noreferrer">This article</a> is interesting as it shows some retrieval methods as well as a way to store the lineage as a derived column. The lineage provides a shortcut method to retrieve the hierarchy without too many joins.</p>
40,987
<p>Is the Sql Server 2008 control available for download? Does it yet support the 2008 RDL schema?</p>
<p>If you are talking about the ReportViewer control, it is <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e-bb5f-416d75a1b9ef&amp;DisplayLang=en" rel="nofollow noreferrer">available</a>.</p> <p>However you need Windows XP, Windows Vista or Windows Server 2003 to install it. It is a...
<p>The ReportViewer control should work just fine with SQL Server 2008.</p>
5,294
<p>Over the past year or so my production platform has been plagued by an odd TCP/IP issue. I've spent zillions of hours working with competent &amp; knowledgeable sysadmins, scouring the net, reading source code, been jerked around by RH's pathetic support, and <strong>crying tears of blood</strong>! To no avail. (...
<p>Dave Miller (person in charge of networking in the linux kernel) and their fellow henchmen all inhabit the lkml or <a href="http://lkml.org" rel="noreferrer">Linux Kernel Mailing List</a>. If you can provide a reasonably decent bug report they'll get you a reasonable answer. </p> <p>On the other hand if you tell th...
<p>The linux-net mailing list might interest you. There should be more details <a href="http://vger.kernel.org/vger-lists.html" rel="nofollow noreferrer">here</a>.</p>
7,268
<p>I have created a user control to handle adding comments to certain business entities, like contacts and customers. Works great ... except for one issue.</p> <p>I am using a ListView control to edit and delete comments, and a separate area, on the same user control to add a new comment. All of this is wrapped in a...
<p>You could try using the <a href="http://www.theserverside.com/patterns/thread.tss?thread_id=20936" rel="nofollow noreferrer">Post/Redirect/Get</a> pattern. Basically instead of letting the postback send the data, redirect to the page. That way, if a user refreshes, s/he is refreshing the GET command rather than th...
<p>I haven't used ASP.NET in a few years, but you should wrap your "do this on postback" code in <code>Page.IsPostBack</code>:</p> <pre><code>if(IsPostBack) { //do your data-saving code... } </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback(VS.71).aspx" rel="nofollow...
20,268
<p>I am trying to create a new instance of Excel using VBA using:</p> <pre class="lang-vb prettyprint-override"><code>Set XlApp = New Excel.Application </code></pre> <p>The problem is that this new instance of Excel doesn't load all the addins that load when I open Excel normally...Is there anything in the Excel Appl...
<p>I looked into this problem again, and the Application.Addins collection seems to have all the addins listed in the Tools->Addins menu, with a boolean value stating whether or not an addin is installed. So what seems to work for me now is to loop through all addins and if .Installed = true then I set .Installed to F...
<p>I'm leaving this answer here for anyone else who ran into this problem, but using JavaScript.</p> <p>A little background... In my company we have a 3rd party web app that used JavaScript to launch Excel and generate a spreadsheet on the fly. We also have an Excel add-in that overrides the behavior of the Save butto...
26,227
<p>I am having problems getting text within a table to appear centered in IE. </p> <p>In Firefox 2, 3 and Safari everything work fine, but for some reason, the text doesn't appear centered in IE 6 or 7. </p> <p>I'm using:</p> <pre class="lang-css prettyprint-override"><code>h2 { font: 300 12px "Helvetica", serif; ...
<p>The table cell needs the text-align: center.</p>
<p>The <code>text-align: center</code> should be sufficient, since you're centering the text inside a block element (h2) - adjusting the margins will change the position of the block, not the text.</p> <p>I wonder if it's just that IE is having a dummy-spit at that <code>font</code> declaration you've got there?</p>
9,413
<p>I want to execute a php-script from php that will use different constants and different versions of classes that are already defined.</p> <p>Is there a sandbox php_module where i could just:</p> <pre><code>sandbox('script.php'); // run in a new php environment </code></pre> <p>instead of </p> <pre><code>include(...
<p>There is <a href="http://www.php.net/runkit" rel="noreferrer">runkit</a>, but you may find it simpler to just call the script over the command line (Use <a href="http://www.php.net/shell_exec" rel="noreferrer">shell_exec</a>), if you don't need any interaction between the master and child processes.</p>
<p>i know its not 100% topic related, but maybe useful for somebody n__n</p> <pre><code>function require_sandbox($__file,$__params=null,$__output=true) { /* original from http://stackoverflow.com/a/3850454/209797 */ if($__params and is_array($__params)) extract($__params); ob_start(); $__return...
42,052
<p>I have some code that reads 10 registry keys, sometimes the values are not present sometimes the keys are not present, sometimes the value isn't boolean etc etc. How should I add error handling to this, currently it is placed in one big try{} catch{} but if the second value I read fails then the rest are not read as...
<p>First, swallowing exceptions is <em>generally</em> a bad idea - could you not write a method that checks the keys etc for existance, and returns the value if one?</p> <p>If that <em>absolutely, positively</em> isn't possible, you can refactor the code into multiple calls to a single method that (for each) does a tr...
<p>Refactor the code that reads the values into its own function that handles the errors how you want them to be handled.</p>
40,776
<p>I periodically am called upon to do maintenance work on a system that was built by a real rocket surgeon. There's so much wrong with it that it's hard to know where to start. </p> <p>No, wait, I'll start at the beginning: in the early days of the project, the designer was told that the system would need to scale...
<p>I once tried to write an <a href="http://en.wikipedia.org/wiki/MP3" rel="noreferrer">MP3</a> decoder. It didn't work.</p>
<p>Maintaining ASP applications for a specific company who hires developers to maintain their previous hires... All these applications are not documented, neither there are any comments.</p> <p>Every function is copied and pasted in every ASP page. So no functions are defined or whatsoever... Every day I'm crippled by...
26,407
<p>Is it possible to send my own developed exceptions over Soap to a client using http.sys??</p>
<p>To the best of my knowledge unfortunately the answer is no. You cannot build your own custom exceptions on the server side and expect to use them on the client side through WSE. I can't give much technical background as to why (as in why this is not allowed by WSE), but I am sure about my answer because I tested thi...
<p>Yes, you can throw your own exceptions. Any uncaught exception that does not derive from SoapException will be bottled up by the .NET framework into a SoapException. You can derive from SoapException if you want to control how certain parts of the SoapException are formed (for instance, the fault and detail portions...
16,765
<p>Has anyone converted a large (ours is 550,000 lines) program of Fortran 77 code to C++ ? What pitfalls did you run into ? Was the conversion a success ? Did you use a tool like <code>for_c</code> ( <a href="http://www.cobalt-blue.com/fc/fcmain.htm" rel="noreferrer">http://www.cobalt-blue.com/fc/fcmain.htm</a> ) ?...
<p>This adds to EvilTeach's advice. Keep in mind that it's fairly easy to <em>link</em> Fortran 77 and C/C++ code, so you can convert parts of your application incrementally and link them together with the old parts. You'll have to think about all the usual fortran/c discrepancies (row/column-major arrays, array inde...
<p>I've worked on a application that, at its heart, was code converted from FORTRAN using <strong>for_c</strong> . The code it created was god awful. It was very difficult to maintain since most of it was indecipherable. Luckily that code was pretty stable and it was rare that anything had to be done to it.</p> <p>How...
34,719
<p>I have a route</p> <pre><code>// Sample URL: /Fixtures/Team/id routes.MapRoute( "Fixtures-by-TeamID", "Fixtures/Team/{teamId}", new { controller = "Fixtures", action = "GetByTeamID", }, new { teamId = @"\d{1,3}" } ); </code></pre> <p>and I am trying to use ActionLink in ASP.net MVC p5. </p> <p...
<p>In my experience, the only time action routes really work properly is when you only have the single default route. As soon as you start adding custom routes like yours above, action routes become... I guess "finicky" is the right word. The matching system doesn't work exactly how you'd expect it to.</p> <p>In this ...
<p>When a parameter ("action" in this case) is defined only in defaults and not in the route url, it has to be an exact match (unless you force it to go against a particular route as in the RouteUrl case).</p> <p>To make everything work as is right now, you could add another route to the list just below the above rout...
29,470
<p>Due to the nature of the live server I deploy to, my mail settings are using deliveryMethod="PickupDirectoryFromIis". I'm using log4net to send logs via email and I need find a way of getting it to do the same thing.</p> <p>I can see from the docs that there is an SmtpPickupDirAppender, which has a pickupDir settin...
<p>AFAIK, that's not possible. Although it sounds like a good idea.</p> <p>One of the greatest things about log4net is that you can change your configuration without having to restart or recompile the application (check the <a href="http://logging.apache.org/log4net/release/faq.html" rel="nofollow noreferrer">FAQ</a>)...
<p>It is a shame because the <a href="http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.deliverymethod.aspx" rel="nofollow noreferrer"><code>SmtpClient.DeliveryMethod</code></a> property supports a value of <a href="http://msdn.microsoft.com/en-us/library/system.net.mail.smtpdeliverymethod.aspx" rel="n...
30,082
<p>How do you debug your SharePoint 2007 code? Since SharePoint runs on a remote server, and I'm developing on a windows xp machine (with the necessary .dll files copied into my GAC), I haven't had much luck with finding easy ways to debug. Breakpoints don't work, etc.</p> <p>The best way I've come up with is to ena...
<p>From <a href="http://www.andrewconnell.com/blog/archive/2008/06/11/SharePoint-Debugging-and-Logging-Tips-and-Tricks.aspx" rel="nofollow noreferrer">Andrew Connell's blog post</a> on the subject:</p> <blockquote> <p>Attaching the debugger to GAC'd assemblies: "Why aren't my breakpoints being hit?!?!" Ever been...
<p>I recommend you develop on a Windows 2003 server with Sharepoint. It's a hassle to debug on a remote server. You can do it in a virtual machine with VMWare or Virtual PC, if you have XP on your workstation.</p>
17,528
<p>How do I go about specifying and using an ENUM in a Django model?</p>
<p>From the <a href="https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.choices" rel="noreferrer">Django documentation</a>:</p> <pre><code>MAYBECHOICE = ( ('y', 'Yes'), ('n', 'No'), ('u', 'Unknown'), ) </code></pre> <p>And you define a charfield in your model :</p> <pre><code...
<p>A the top of your models.py file, add this line after you do your imports:</p> <pre><code> enum = lambda *l: [(s,_(s)) for s in l] </code></pre>
4,162
<p>As described before, <a href="https://stackoverflow.com/questions/30824/book-on-system-archaeology">I work in IT consultancy and move through various customer environments</a>. It is natural to encounter a variety of security policies, and in most environments we have had to go through a security checklist before au...
<p>That's tough. The root cause here is management that doesn't understand that there are real cost implications to their choice of environments. </p> <p>Your problem is that while you may be billing by the hour, you probably aren't getting paid that way, so your customers' wasted time goes into the pockets of your ...
<p>I just went through this and found a pretty good solution : get a different job</p>
49,808
<p>According to <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.startinfo(VS.80).aspx" rel="nofollow noreferrer">MSDN</a>:</p> <blockquote> <p>If you did not use the <code>Start</code> method to start a process, the <code>StartInfo</code> property does not reflect the parameters used to star...
<p>You are still doing a GetProcess, thus it continues to work the same. The fact that you started it doesn't make a difference.</p> <p>Process.Start(...) returns the process that you started. I expect that if you check the StartInfo property on that, it will be populated.</p>
<p>Ugh, that is frustrating. I think they could probably make that documentation a little clearer as it's easy to read that as "if you do use Process.Start then that information will be available".</p> <p>Guess I'll have to use WMI after all, ah well.</p>
44,748
<p>For some reason, lately the *.UDL files on many of my client systems are no longer compatible as they were once saved as ANSI files, which is no longer compatible with the expected UNICODE file format. The end result is an error dialog which states "the file is not a valid compound file". </p> <p>What is the easi...
<p>This is very simple to do with my <a href="http://gp.17slon.com/gp/gptextfile.htm" rel="noreferrer">TGpTextFile</a> unit. I'll put together a short sample and post it here.</p> <p>It should also be very simple with the new Delphi 2009 - are you maybe using it?</p> <p>EDIT: This his how you can do it using my stuff...
<p>Ok, using delphi 2009, I was able to come up with the following code which appears to work, but is it the proper way of doing this conversion?</p> <pre><code>var sl : TStrings; FileName : string; begin FileName := fServerDir+'configuration\hdconfig4.udl'; sl := TStringList.Create; try sl.LoadFromFile(...
19,152
<p>I know the colours are changed in Environment > Fonts and Colors but I haven't found out which Display Item the object is.</p> <p>Can someone please tell how I can colour the following code:</p> <blockquote> <p>lblMessage.Text = "You have successfully answered my question!"</p> </blockquote> <p>I have the strin...
<p>For my big apps I just use a incrementing version number id (1.0, 1.1, ...) that i store in a comment of the main file (usually index.php).<Br /> For just websites I usually just have a revision number (1,2,3,...).</p>
<p>I maintain a system of web applications with various components that live in separate SVN repos. To be able to version track the system as a whole, I have another SVN repo which contains all other repos as external references. It also contains install / setup script(s) to deploy the whole thing. With that setup, the...
4,959
<p>How can I add Page transitions effects like IE in Safari for web pages?</p>
<p>You could check out this example: <a href="http://sachiniscool.blogspot.com/2006/01/implementing-page-transitions-in.html" rel="nofollow noreferrer">http://sachiniscool.blogspot.com/2006/01/implementing-page-transitions-in.html</a>. It describes how to emulate page transitions in Firefox using AJAX and CSS. The same...
<p>Check out <a href="http://github.com/madrobby/scriptaculous/wikis" rel="nofollow noreferrer">Scriptaculous</a>. Avoid IE-Only JS if that's what you are referring to (no idea what kind of effect you mean).</p>
12,738
<p>Python has a <a href="https://stackoverflow.com/questions/206154/whats-the-best-soap-client-library-for-python-and-where-is-the-documentation-fo">number of soap stacks</a>; as near as I can tell, all have substantial defects.</p> <p>Has anyone had luck consuming <i>and</i> using WSDL for S3, EC2, and SQS in python?...
<p>The REST or "Query" APIs are definitely easier to use than SOAP, but unfortunately at least once service (EC2) doesn't provide any alternatives to SOAP. As you've already discovered, Python's existing SOAP implementations are woefully inadequate for most purposes; one workaround approach is to just generate the XML ...
<p>Check out <a href="http://boto.googlecode.com" rel="nofollow noreferrer">http://boto.googlecode.com</a>. This is the best way to use AWS in Python.</p>
28,712
<p>I have a Ruby/Rails app that has two or three main "sections". When a user visits that section, I wish to display some sub-navigation. All three sections use the same layout, so I can't "hard code" the navigation into the layout.</p> <p>I can think of a few different methods to do this. I guess in order to help peo...
<p>You can easily do this using partials, assuming each section has it's own controller.</p> <p>Let's say you have three sections called <strong>Posts</strong>, <strong>Users</strong> and <strong>Admin</strong>, each with it's own controller: <code>PostsController</code>, <code>UsersController</code> and <code>AdminCo...
<p>There are few approaches to this problem.</p> <p>You might want to use different layouts for each section.</p> <p>You might want to use a partial included by all views in a given directory. </p> <p>You might want to use <code>content_for</code> that is filled by either a view or a partial, and called in the globa...
18,214
<p>We're using TFS Build Server to ensure that all files checked in by developers are going to compile to a working source tree, cuz there's nothing worse than a broken build!</p> <p>Anyway we've having some problems with the drop location that Build Server wants to use, we keep getting this error:</p> <blockquote> ...
<p>Could you keep a record of each of the length of each file? When the current length subsequently goes back to zero or is smaller than the last time you recorded the length, you know the file has been restarted by the app?</p>
<p>You could indicate somewhere on the filesystem that indicates you are reading a given file. Suppose next to the file being read (a.txt), you create a file next to it (a.txt.lock) that indicates a.txt is being read. When your process is done with it, a.txt.lock is deleted. Every time a process goes to open a file to ...
16,700
<p>I'm trying to figure out a way to make user controls run in their own UI threads. Is this possible? I'm trying to prevent a module-based application from crashing due to a single module.</p> <p>Any thoughts?</p>
<p>That's not possible. However, with some non-trivial code, you can have different windows running in separate threads. Each window will have its own message loop.</p> <p>Update:</p> <p>Another way you could think of is to write your controls in a special way. You can handle all events in your controls by creating a...
<p>I suppose it's not a matter of the program crashing. Exceptions can be caught of course, but the issue is in hanging controls. For the sake of this situation, here's an example:</p> <pre><code>public void Button1_Click(object sender, EventArgs args) { while(true) {} } </code></pre> <p>If this code were to run...
13,185
<p>We want to be able to advance our business by utilizing both of the power of KOFAX and SharePoint 2007. Any pointers Development-wise?</p>
<p>We looked into doing something like this a couple of years ago. We were thinking of having printed documents scanned in, converted with OCR, and organized digitally in a type of repository. </p> <p>We actually did an analysis of OCR tools and repository / collaboration tools and which would be the easiest to integr...
<p>We have done it by building a custom release script from Kofax. </p> <p>Key question is how much flexibility to you want in the integration for expanding in the future. It is easy to build a one-off release script that handles a single document library or list. It is a lot more to build something that is configu...
20,641
<p>I am currently writting a programe about Conway's Game of life and I am really a beginner of python, I don't know how to start at all. Anybody can help me with it?</p>
<p>You probably don't need to pay to learn python. Implementing cellular automata makes for good starting project. The best place to start with python is the <a href="http://docs.python.org/tutorial/" rel="nofollow noreferrer">official tutorial</a> and you can follow that with <a href="http://www.diveintopython.org/" ...
<p>try here instead.</p> <p><a href="http://www.elance.com/p/landing/buyer.html" rel="nofollow noreferrer">http://www.elance.com/p/landing/buyer.html</a></p> <p><a href="http://www.rentacoder.com/RentACoder/DotNet/default.aspx" rel="nofollow noreferrer">http://www.rentacoder.com/RentACoder/DotNet/default.aspx</a></p>...
45,581
<p>In my master pages I have <code>&lt;form ... action="" ...&gt;</code>, in pre SP1, if I viewed the source the action attribute would be an empty string. In SP1 the action attribute is overridden "MyPage.aspx?MyParams", unfortunately, this causes my postbacks to fail as I have additional pathinfo in the URL (ie. MyP...
<p>Maybe you can find the solution here in <a href="http://forums.asp.net/t/1305800.aspx" rel="nofollow noreferrer">this ASP.NET Forum post</a> (Known Issues / Breaking Changes for ASP.NET in .NET 3.5 Service Pack 1).</p> <h2>Issue</h2> <p>The HtmlForm action attribute is now honored when defined in declarative marku...
<p>What we did in the end was just overode the action user a controladapter. This works for us but is <strong>NOT</strong> a general solution. </p> <pre><code>public class HtmlFormAdapter : ControlAdapter { protected override void Render(HtmlTextWriter writer) { HtmlForm form = this.Co...
37,353
<p>How do I remove html elements in a text field from SQL Server?</p>
<p>I assume you mean removing html tags from a field stored in a database. If so, and if you can code the solution in .NET, I would have used the <a href="http://www.codeplex.com/htmlagilitypack" rel="nofollow noreferrer">HTML agility pack</a> to traverse the html contents, and save the InnerText (i think that's the pr...
<p>You could use a CLR Procedure (SQL Server 2005 and above) to decode the HTML , stripping out the tags. </p> <p>This looks like an example of what you want to achieve.</p> <p><a href="http://www.sqlclr.net/Examples/tabid/55/articleType/ArticleView/articleId/31/Default.aspx" rel="nofollow noreferrer">SQL Server CLR ...
44,634
<p>I have a webservice that when called without specifying a callback will return a JSON string using <code>application/json</code> as the content type.</p> <p>When a callback is specified it will wrap the JSON string in a callback function, so it's not really valid JSON anymore. My question is, should I serve it as <...
<p>Use application/javascript. In that way, clients can rely on the content-type without having to manually check whether a response has padding or not.</p>
<p>Use <code>application/json</code> <a href="http://www.ietf.org/rfc/rfc4627.txt" rel="noreferrer">as per rfc4627.txt</a> if what you return is plain JSON.</p> <p>If you return JavaScript (which is really what JSONP is), then use <code>application/javascript</code> <a href="http://www.rfc-editor.org/rfc/rfc4329.txt" ...
13,645
<p>I know it is customary, but why? Are there real technical reasons why any other way would be a really bad idea or is it just based on the history of encoding and backwards compatibility? In addition, what are the dangers of not using <code>UTF-8</code>, but some other encoding (most notably, <code>UTF-16</code>)? </...
<p>Partly because the file systems expect NUL ('\0') bytes to terminate file names, so UTF-16 would not work well. You'd have to modify a lot of code to make that change.</p>
<p>Yes, it's for compatibility reasons. UTF-8 is backwards comptable with ASCII. Linux/Unix were ASCII based, so it just made/makes sense.</p>
19,883
<p>Does anyone have any recommendations for implementations of ActiveRecord in PHP? I've been using <a href="http://31tools.com/cbl_activerecord/" rel="nofollow noreferrer">CBL ActiveRecord</a>, but I was wondering if there were any viable alternatives.</p>
<p>I realize this is old, but there is an absolutely fabulous PHP Activecord library called, appropriately, PHP Activerecord. I've used it for several months and it blows away the other libraries.</p> <p>Check it out:</p> <p><a href="http://www.phpactiverecord.org/">http://www.phpactiverecord.org/</a></p>
<p>Whilst not strictly ActiveRecord, <a href="http://framework.zend.com/manual/en/zend.db.table.html" rel="nofollow noreferrer">Zend_Db_Table</a> is pretty good.</p>
5,883
<p>When you use Zedgraph for linegraphs and set IsSmooth to true, the lines are nicely curved instead of having hard corners/angles.</p> <p>While this looks much better for most graphs -in my humble opinion- there is a small catch. The smoothing algorithm makes the line take a little 'dive' or 'bump' before going upwa...
<p>No simple answer for this. Keeping the tension near zero will be your simplest solution.</p> <p>ZedGraph uses GDI's DrawCurve tension parameter to apply smoothness, which is probably Hermite Interpolation. You can try to implement your own Cosine Interpolation, which will keep local extremes because of its nature...
<p>You could try to alter the myCurve.Line.SmoothTension property up or down and see if that helps.</p>
8,543
<p>I have some .NET remoting code where a factory method, implemented in some server side class, returns interfaces to concrete objects, also executing on the very same server. .NET remoting automagically creates proxies and allows me to pass the interfaces across to the client, which can then call them directly.</p> ...
<p><a href="http://msdn.microsoft.com/en-us/library/aa730857%28VS.80%29.aspx#netremotewcf_topic6" rel="nofollow noreferrer">Use Sessions instead of Client-Activated Objects (MSDN)</a></p>
<p>The ChannelFactory class does exactly this, generates a proxy dynamically at runtime given an interface.</p>
36,696
<p>Given a Stream as input, how do I safely create an XPathNavigator against an XML data source?</p> <p>The XML data source:</p> <ul> <li>May possibly contain invalid hexadecimal characters that need to be removed.</li> <li>May contain characters that do not match the declared encoding of the document.</li> </ul> <p...
<p>I had a similar issue when some XML fragments were imported into a CRM system using the wrong encoding (there was no encoding stored along with the XML fragments).</p> <p>In a loop I created a wrapper stream using the current encoding from a list. The encoding was constructed using the DecoderExceptionFallback and ...
<p>When using a XmlTextReader or something similiar, the reader itself will figure out the encoding declared in the xml file.</p>
31,839
<p>Can you suggest a tool for testing accessibility and section 508/ADA compliance of a Website with MS Share Point and .Net 2.0 as the underlying platform?</p>
<p>In my experience, testing Sharepoint for accessibility is not worth it. Even if you've used the Accessibility Toolkit for Sharepoint (AKS) with Sharepoint 2007, the end result is far from accessible.</p> <p>The trouble is that accessibility was not, and still is not a big consideration for MS when they made Sharepo...
<p>You can try FireEyes(http://www.deque.com/products/worldspace-fireeyes/download-worldspace-fireeyes) . You can run it in firebug and can set up your own set of rules through a dedicated server.</p> <p>FireEyes is an unprecedented, nextgen web accessibility tool that ensures both static and dynamic content within a ...
9,654
<p>I have an installation package that installs a service process that I create. I'd like to prompt the user for the username/password of the account that the service process should run under. I'd like to verify the the username/password combination are valid before continuing with the installation. I have a C DLL t...
<p>The function you want to use is <a href="http://msdn.microsoft.com/en-us/library/aa378184.aspx" rel="noreferrer">LogonUser</a>. You can even be extra-cool and specify the LOGON32_LOGON_SERVICE flag which checks to make sure the user has the appropriate permissions to run a service.</p>
<p>I've implemented this using the LogonUser function as you guys have mentioned (by the way, this service requires WinXP SP2 or later so I'm not worried about the privilege issue). However, this isn't quite working as I had hoped. If I call QueryServiceConfig, lpServiceStartName is in the format ".\accountname". If...
27,069
<p>Aside from DeployerFTP, are there any plugins that offer the ability to deploy a project to an FTP location? I would love a way to do this on an individual file basis, possibly even storing the FTP information within each project.</p>
<p>ANT: <a href="http://ant.apache.org/manual/Tasks/ftp.html" rel="nofollow noreferrer">http://ant.apache.org/manual/Tasks/ftp.html</a></p> <p>Maven: <a href="http://maven.apache.org/wagon/wagon-providers/wagon-ftp/" rel="nofollow noreferrer">http://maven.apache.org/wagon/wagon-providers/wagon-ftp/</a></p>
<p>You may want to look at Eclipse Remote System Explorer tools. There is some screen casts on the project web site <a href="http://www.eclipse.org/dsdp/tm/" rel="nofollow noreferrer">http://www.eclipse.org/dsdp/tm/</a></p> <p>EDIT:</p> <p>The web site is now <a href="http://www.eclipse.org/tm/" rel="nofollow norefer...
46,555
<p>I'm looking for material on persistent data structures that can be used to implement a relational model.</p> <p>Persistence in the meaning of immutable data structures.</p> <p>Anyone know of some good resources, books, papers and such?</p> <p>(I already have the book <a href="http://www.cs.cmu.edu/~rwh/theses/oka...
<p>It is straightforward to modify the ubiquitous <a href="http://en.wikipedia.org/wiki/B-tree" rel="noreferrer">B-tree</a> to be persistent. Simply always alloctate a new node whenever a node is modified, and return the new node to the recursive caller, who will insert it at that level by allocating a new node, etc. U...
<p>SQLite has an <a href="http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/btreeInt.h&amp;v=1.36" rel="nofollow noreferrer">b-tree data structure implementation</a> you can take a look at; </p>
38,985
<p>I have a following object model:</p> <pre> - Book -- Chapter 1 --- Page 1 ---- Image 1 ---- Image 2 ---- Text 1 --- Page 2 ... </pre> <p>Resources are way down at the page level. But, I need to know the full path to resources, from the resources' point of view. </p> <p>One way, is to have resources be aware of...
<p>I'd suggest a tree structure, whereas each of your classes inherits from a tree node.</p> <p>Example in c#:</p> <pre><code>class TreeNode { public TreeNode Parent { get; set; } public List&lt;TreeNode&gt; Children { get; set; } } class Book : TreeNode { ... book attributes ... } ... other classes ... </code><...
<p>Sounds like you want a <a href="http://en.wikipedia.org/wiki/Doubly_linked_list#Doubly-linked_list" rel="nofollow noreferrer">doubly-linked list</a> or possibly to even consider using a <a href="http://en.wikipedia.org/wiki/Tree_(data_structure)" rel="nofollow noreferrer">tree structure</a>.</p>
39,411
<p>I have a gridview control which displays data returned from DB. The datakey property of the gridview is bound to the ID column of the DB</p> <p>Each record in the GV had 2 buttons and one Checkbox. When either of these controls is clicked I want to obtain the row that this was clicked on and perform action dependin...
<p>The application you're likely to get the most out of is the one you most want to actually use. That way you'll have much more motivation to add features, consider usability etc than if you just do one for the sake of learning.</p> <p>Implementation requirements which are handy to have had experience with though:</p...
<p>A simple contacts database is a pretty good starting project.</p>
44,443
<p>Can a Linq query retrieve BLOBs from a Sql Database?<br> And how do they come out?</p>
<p>LINQ-To-SQL classes create properties of type System.Data.Linq.Binary for all binary and varbinary fields in SQL-Server. The Binary type has a .ToArray() method that returns a byte[], and its constructor can take a byte[].</p> <p>Older versions of SQLMetal generated properties of type byte[], but the problem with t...
<p>If I'm not mistaken LINQ to SQL teats BLOB as System.Byte[]<br> I recall that there was some problem with SqlMetal, it generated wrong type for BLOB, but MSVS dmbl designer should work.</p>
7,746
<p>I'm using the following regex to capture a fixed width "description" field that is always 50 characters long:</p> <pre><code>(?.{50}) </code></pre> <p>My problem is that the descriptions sometimes contain a <em>lot</em> of whitespace, e.g.</p> <pre><code>"FLUID COMPRESSOR " </code>...
<p>Substitute two or more spaces for one space:</p> <pre><code>s/ +/ /g </code></pre> <p>Edit: for any white space (not just spaces) you can use \s if you're using a perl-compatible regex library, and the curly brace syntax for number of occurrences, e.g.</p> <pre><code>s/\s\s+/ /g </code></pre> <p>or</p> <pre><c...
<p>/(^[\s\t]+|[\s\t]+([\s\t]|$))/g replace with $2 (beginning|middle/end)</p>
26,663
<p>Why is the generic.list slower than array?</p>
<p>A generic list is slightly slower than an array, but not so you'd notice in most cases. Mostly it has to do with the lookup being slightly more complex: List is said to use an array "under the hood", but it's not not guaranteed to keep nodes in adjacent memory in the same way in array is. </p> <p>However, I saw so...
<p>In terms of read performance, there are two factors:</p> <ul> <li>an extra dereference (i.e. the <code>List&lt;T&gt;</code> will contain a <code>T[]</code> field, and has to de-reference it)</li> <li>it can't use some compiler optimisations that that exist for <code>T[]</code> - such as eliminating bounds checking ...
33,855
<p>VBA solutions can vary widely in size. </p> <p>I would like to add <strong>user help</strong> documentation to all solutions but the level of effort to create and deploy the <strong>help</strong> needs to match the size of the solution.</p>
<p>You should check the <a href="http://www.mztools.com/v3/mztools3.aspx" rel="noreferrer">VBA version of MZ-Tools</a>. It is an add-in for VBA that can automatically generate documentation from your code (function name, parameters, comments, subject, etc.). You can also use it to automatically generate line numbers, o...
<p>You may wish to consider <a href="http://msdn.microsoft.com/en-us/library/ms669985.aspx" rel="nofollow noreferrer">HTML Help</a>. It allows you to produce help files that are similar to standard Microsoft help. It is not particularly difficult to use, for the most part.</p>
21,278
<p>I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this?</p> <pre><code>Traceback (most recent call last): File "C:\Python25\Lib\site-packages\django\bin\django-admin.py", line 2, in &lt;module&gt; ...
<p>You must make sure that django is in your PYTHONPATH.</p> <p>To test, just do a <code>import django</code> from a python shell. There should be no output:</p> <pre><code>ActivePython 2.5.1.1 (ActiveState Software Inc.) based on Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on win32 T...
<p>As usual, an install script failed to set world read/execute permissions :) Do this:</p> <pre><code>sudo find /usr/lib/python2.5/site-packages/django -type d -exec chmod go+rx {} \; sudo find /usr/lib/python2.5/site-packages/django -type f -exec chmod go+r {} \; </code></pre>
40,280
<p>My office has a central Source Safe 2005 install that we use for source control. I can't change what the office uses on the server. </p> <p>I develop on a laptop and would like to have a different local source control repository that can sync with the central server (when available) regardless of the what that cent...
<p>Well... KernelTrap has <a href="http://kerneltrap.org/mailarchive/git/2008/5/27/1952124" rel="nofollow noreferrer">something on this</a>. Looks like you can use <a href="http://www.pumacode.org/projects/vss2svn/wiki/RunningTheMigration" rel="nofollow noreferrer">vss2svn</a> to pipe the Source Safe repo into a Subve...
<p>some day I work in a company that use VSS (and in other companies that use other less unknow <a href="http://en.wikipedia.org/wiki/Source_Code_Management" rel="nofollow noreferrer">SCM</a>) but i prefer use SVN (someday I'll try GIT) for active development, for me and my group.</p> <p>First of all, this situation it...
2,387
<p>This one has been stumping me for a while. But I'm no expert. This is a bit long...</p> <p>I have a WinForms app with an Outlook style UI. That it to say there is a bar on the left hand pane that allows you to select a 'screen' which is a WinForms control, say the customer screen, and on the right hand pane ther...
<p>I'm going to restate your problem to make sure I've understood it.</p> <p>You have a widget which presents a list of entities (the LIST). When you click an item in the LIST, another widget appears which allows the user to edit the entity. When the user has finished editing the entity, their changes are committed ...
<p>I'm currently attempting to implement an identical scenario in our WinForms SmartClient app.</p> <p>Did you come to a good solution with this?</p> <p>In our app we have the same concurrent UI requirement, and the need to refresh the data from a shared source, however we are using WCF services instead of LinqToSql....
49,933
<p>I saw this in <a href="https://stackoverflow.com/a/4384/697449">an answer to another question</a>, in reference to shortcomings of the Java spec:</p> <blockquote> <p>There are more shortcomings and this is a subtle topic. Check <a href="http://kiranthakkar.blogspot.com/2007/05/method-overloading-with-new-features-of...
<p>In the first case, you have a widening conversion happening. This can be see when runinng the "javap" utility program (included w/ the JDK), on the compiled class:</p> <pre><code>public static void main(java.lang.String[]); Code: 0: iconst_ 5 1: istore_ 1 2: iload_ 1 3: i2l 4: invokestati...
<p>Another interesting thing with this example is the method overloading. The combination of type widening and method overloading only working because the compiler has to make a decision of which method to choose. Consider the following example:</p> <pre><code>public static void hello(Collection x){ System.out.prin...
2,691
<p>I have a windows service I am trying to debug.</p> <p>Is it a bad idea to add error logging in the Catch() clause?</p> <p>My logging is using a database to log the errors btw.</p>
<p>I'm not 100% clear and what you're trying to do as you mention both debugging and logging.</p> <p>Logging on the catch clause is generally a good idea if part of an overall logging approach. </p> <p>if you are after debugging the service you have two option - if you can control when the code you are trying to debu...
<p>It depends on the code. On some of my services, I log information to the database (because that is the policy here), but I have a secondary logging mechanism that add messages to the event log in the event that logging to the database fails. The question you have to ask yourself is "what happens to the erros if yo...
46,467
<p>Why should I or shouldn't I use dirty reads:</p> <pre><code>set transaction isolation level read uncommitted </code></pre> <p>in SQL Server?</p>
<p>From <a href="http://msdn.microsoft.com/en-us/library/aa259216(SQL.80).aspx" rel="noreferrer">MSDN</a>:</p> <blockquote> <p>When this option is set, it is possible to read uncommitted or dirty data; values in the data can be changed and rows can appear or disappear in the data set before the end of the transactio...
<p>The Thing is when you want to read the data before committing, we can do with the help of set transaction isolation level read uncommitted, the data may, or may not change.</p> <p>We can read the data by using the query:</p> <pre><code>Select * from table_name with(nolock) </code></pre> <p>This is applicable to ...
4,119
<p>I have a long running SQL statement that I want to run, and no matter what I put in the "timeout=" clause of my connection string, it always seems to end after 30 seconds. </p> <p>I'm just using <code>SqlHelper.ExecuteNonQuery()</code> to execute it, and letting it take care of opening connections, etc.</p> <p>Is...
<p>What are you using to set the timeout in your connection string? From memory that's "ConnectionTimeout" and only affects the time it takes to actually <em>connect</em> to the server.</p> <p>Each individual command has a separate "CommandTimeout" which would be what you're looking for. Not sure how SqlHelper impleme...
<p><s>In addition to timeout in connection string,</s> try using the timeout property of the SQL command. Below is a C# sample, using the SqlCommand class. Its equivalent should be applicable to what you are using.</p> <pre><code>SqlCommand command = new SqlCommand(sqlQuery, _Database.Connection); command.CommandTimeo...
4,706
<p>I created a few mediawiki custom tags, using the guide found here</p> <p><a href="http://www.mediawiki.org/wiki/Manual:Tag_extensions" rel="nofollow noreferrer">http://www.mediawiki.org/wiki/Manual:Tag_extensions</a></p> <p>I will post my code below, but the problem is after it hits the first custom tag in the pag...
<p>Easy!</p> <pre><code>&lt;xsl:template match="/"&gt; &lt;xsl:apply-templates select="root/node"&gt; &lt;xsl:sort select="position()" data-type="number" order="descending"/&gt; &lt;/xsl:apply-templates&gt; &lt;/xsl:template&gt; &lt;xsl:template match="node"&gt; &lt;xsl:value-of select="."/&gt; &l...
<pre><code>&lt;xsl:template match="/"&gt; &lt;xsl:apply-templates select="root/node[3]"/&gt; &lt;xsl:apply-templates select="root/node[2]"/&gt; &lt;xsl:apply-templates select="root/node[1]"/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="node"&gt; &lt;xsl:value-of select="."/&...
7,247
<p>I have an old ASP.NET 1.1 site that I am maintaining. We are working with Google to place analytics code on all pages. Since I can't take advantage of master pages in 1.1, I have my pages include headers/footers/sidebars with User Controls.</p> <p>What came to mind first is to place the JavaScript in my footer as...
<p>What keeps you from simply referencing your script in the user control?</p> <pre><code>&lt;asp:SomeControl ID="SomeControl1" runat="server&gt; &lt;script src="some.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/asp:SomeControl&gt; </code></pre> <p>You could also do this:</p> <pre><code>protected void Page_L...
<p>Create a base page class and load the script in base page. Further inherit all pages from base page.</p> <p>Other way could be same as that suggested by Tomalak</p> <pre><code>HtmlGenericControl jscriptFile = new HtmlGenericControl(); jscriptFile.TagName = "script"; jscriptFile.Attributes.Add("type", "text/javascr...
26,437
<p>Some time ago I put together a <strong>time</strong> based library that could be used for working out relative times within a year for someone. I noted at the time, that it did the one hour shift in both directions for daylight savings. It just occurred to me that <a href="http://aa.usno.navy.mil/faq/docs/daylight...
<p>Most Unix-like systems use the Olson tz database for their timezone information:</p> <p><a href="http://www.twinsun.com/tz/tz-link.htm" rel="nofollow noreferrer">http://www.twinsun.com/tz/tz-link.htm</a></p> <p>The changes to the US timezone rules were implemented in version 2005l of the tz database.</p>
<p>Since internal clocks should be set to UTC, daylight saving time is just a matter of changing timezone. For example, on my locale, on October 26 my Mac switched from CEST ( central european summer time ) to 'normal' CET ( central european time ). My clock's display changed, but not the computer's time.</p> <p><a hr...
34,784
<p>I have two classes: Media and Container.</p> <p>I have two lists <code>List&lt;Media&gt;</code> and <code>List&lt;Container&gt;</code></p> <p>I'm passing these lists to another function (one at a time);</p> <p>it can be one or another; </p> <p>what's the proper way to check for the "template" type of the list so...
<p>The proper thing to do is to have two overloads for this function, accepting each type:</p> <pre><code>public void MyMethod(List&lt;Media&gt; source) { //do stuff with a Media List } public void MyMethod(List&lt;Container&gt; source) { //do stuff with a Container List } </code></pre>
<p>Well, it depends on what your "//do this" method is... If it's a method that operates on a Media, or a Container object, and does different things based on which it is, then you should put that method in those classes... </p> <p>Declare an interface named ICanDoThis</p> <pre><code>public interface ICanDoThis { ...
46,598
<p>I have a query:</p> <pre><code>SELECT * FROM Items WHERE column LIKE '%foo%' OR column LIKE '%bar%' </code></pre> <p>How do I order the results?</p> <p>Let's say I have rows that match 'foo' and rows that match 'bar' but I also have a row with 'foobar'.</p> <p>How do I order the returned rows so that the firs...
<p>Case or the kind of conditional construct your RDBMS supports is a way to do it</p> <pre><code>select *, case when col like '%foo%' and col like '%bar%' then 2 end else 1 end as ordcol from items where col like '%foo%' or col like '%bar%' order by ordcol </code></pre>
<p>Which DBMS?</p> <p>It can be done via CTE or Union for example, but if you are using, for example, MySQL, then you can forget about it.</p>
10,472
<p>I am looking for a framework to turn given Java class into WebService (may be with some limitations on method parameters etc)</p> <p>Thanks</p>
<p>You can use <a href="http://ws.apache.org/axis2/" rel="nofollow noreferrer">axis2</a>, or <a href="http://xfire.codehaus.org/" rel="nofollow noreferrer">xfire</a>. I'm sure there are other ways also, but these are the two that I've used.</p>
<p>The de-facto standard for this is Apache Axis: <a href="http://ws.apache.org/axis/" rel="nofollow noreferrer">http://ws.apache.org/axis/</a> and <a href="http://ws.apache.org/axis2/" rel="nofollow noreferrer">http://ws.apache.org/axis2/</a></p>
22,829
<p>Is it ready for that?</p> <p>I've been playing with it for a short amount of time and it seems quite reasonable. Is anyone using it for live sites?</p> <p>any issues to be aware of?</p>
<p>Well, <a href="http://stackoverflow.com">stackoverflow.com</a> is.</p>
<p>Stackoverflow uses ASP.Net MVC. Seems to be doing pretty well here from my experience with the site.</p>
9,394
<p>I have a particular PHP page that, for various reasons, needs to save ~200 fields to a database. These are 200 separate insert and/or update statements. Now the obvious thing to do is reduce this number but, like I said, for reasons I won't bother going into I can't do this.</p> <p>I wasn't expecting this problem...
<p>You should be able to do 200 inserts relatively quickly, but it will depend on lots of factors. If you are using a transactional engine and doing each one in its own transaction, don't - that creates way too much I/O.</p> <p>If you are using a non-transactional engine, it's a bit trickier. Using a single multi-row ...
<p>you can use CURL with PHP to do Asynchronous database manipulations.</p> <p>One possible solution is fork each query into a separate thread but, PHP doesnot support threads. We can use <a href="http://php.net/manual/en/book.pcntl.php" rel="nofollow">PCNTL</a> functions but it’s a bit tricky for me to use them. I pr...
42,370
<p>Is there a best practice for instantiating / calling business logic layer service in a web app? I've got a large number services that I keep instantiating and then disposing for just one method call. </p> <p>Should these be implemented as providers? Or maybe accessed from a singleton?</p> <p>Example code:</p> <...
<p>I've done both actually. It depends on what goal you are trying to accomplish. If you're trying to increase the brevity of your code, a singleton / static reference to the service you're trying to call helps.</p> <pre><code>Services.ProductService.Ship(aProduct) </code></pre> <p>However, you have to remember that...
<p>I've done both actually. It depends on what goal you are trying to accomplish. If you're trying to increase the brevity of your code, a singleton / static reference to the service you're trying to call helps.</p> <pre><code>Services.ProductService.Ship(aProduct) </code></pre> <p>However, you have to remember that...
49,297
<p>I've had little exp. with java and since now i've worked with c++. what makes this one more special and preferred?</p> <p>Moreover I would like to know about the use of System.in classes and parseInt classes.</p>
<p>Java is vastly easier to work with, especially when developing large programs.</p> <ul> <li>Debugging: Java generates nice Stacktraces</li> <li>Stability: You can catch every exception</li> <li>Development Speed: you need no linker (which can take many minutes in C++); with a modern IDE (e.g. eclipse) you can edit ...
<p>If you like to program really the object oriented way, then you need to go from C++ to Java. One of the problems with C++ is that most programmers actually use it as C and don't exploit all its OO features. Java is here stricter.</p>
45,043
<p>Does ASP.Net 2.0 and Visual Studio 2005 has the possibility of working with MVC or I have to move to VS2008 and asp.net 3.5?</p>
<p>It's not supported but you can read up on how to do it here...</p> <p><a href="http://www.hanselman.com/blog/DeployingASPNETMVCOnASPNET20.aspx" rel="nofollow noreferrer">http://www.hanselman.com/blog/DeployingASPNETMVCOnASPNET20.aspx</a></p>
<p>It isn't intended to work but I remember reading something from Scott Hanselman saying it may be possible with a bit of hacking. It would be dodgy as though.</p>
28,706