instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Could someone please tell me which objects types can be tested using Regular Expressions in C#?</p>
<p>If I understand you correctly and you are asking which object types can be tested against regular expressions then the answer is: strings and only strings.</p> <p>Thus your test would be: </p> <pre><code>if(obj is string){...} </code></pre>
<pre><code>Regex.IsMatch() </code></pre>
33,491
<p>On my website, I have several html files I do not link off the main portal page. Without other people linking to them, is it possible for Jimmy Evil Hacker to find them?</p>
<p>If anyone accesses the pages with advanced options turned on on their Google toolbar, then the address will be sent to Google. This is the only reason I have can figure out why some pages I have are on Google.</p> <p>So, the answer is yes. Ensure you have a robots.txt or even .htaccess or something.</p>
<p>Yes, it is.</p>
27,745
<p>Are there any good books or website that go over creating a <code>JTable</code>? I want to make one column editable. I would like to actually put a inherited <code>JCheckBox</code> component (that we created here) into one of the table columns instead of just having the table put <code>JCheckBox</code> in based on ...
<p>To make a column editable you have to override the <code>isCellEditable</code> method in the <code>TableModel</code>. Creating a <code>TableModel</code> is fairly easy if you inherit <code>AbstractTableModel</code> and I'd recommend it for all but the most simple <code>JTable</code>s.</p> <p>However, adapting the <...
<p>Some useful classes are:</p> <p><code>Package javax.swing.table</code> :</p> <p><code>TableModel</code> - Interface for a <code>tablemodel</code> <code>AbstractTableModel</code> - Nice class to extend for creating your own table with custom data structures <code>DefaultTableModel</code> - Default table model which...
11,059
<p>From what I've seen, you can take a typical extruder heater, apply the designated supply voltage without temperature control, and as long as the heater isn't contacting something with a flashpoint below the temperature the heater reaches, the heater will not catch on fire. Thus, unless one catches the filament on f...
<p>A normal hotend will not melt or cause fires, usually, see first video. However, if the power regulating unit fails as well and higher voltage is supplied (19 V on 12 V cartridge are enough) it can happen, see second video.</p> <p>Fires are more likely caused by overheating wires, especially where joints are present...
<p>A normal hotend will not melt or cause fires, usually, see first video. However, if the power regulating unit fails as well and higher voltage is supplied (19 V on 12 V cartridge are enough) it can happen, see second video.</p> <p>Fires are more likely caused by overheating wires, especially where joints are present...
1,827
<p>I am writing a script which is likely to be modified by users. Currently I am storing the configuration settings inside the script. It exists in the form of a hash-of-hashes.</p> <p>I would like to guard against people accidentally using lowercase characters in the hash keys, because that will break my script.</p> ...
<p>Andy's answer is a good answer, except he <code>uc</code>s every key, and then <code>uc</code>s it again if it doesn't match. </p> <p>This <code>uc</code>s it once: </p> <pre><code>%hash = map { uc $_ =&gt; $hash{$_} } keys %hash; </code></pre> <p>But since you spoke of users <em>storing keys</em>, a tie is a muc...
<p>Came this way looking for an answer and thought I'd share some of my learning. To ensure compatibility between GET/POST parameters, templates, and stored procedures I wanted to ensure all keys obtained via $cgi-&gt;Vars were in upper case and there were no residual lower case 'duplicate' keys. Here's the basic scrip...
39,957
<pre><code>class Trial { static int i; int getI() { return i;} void setI(int value) { i = value;} } public class ttest { public static void main(String args[]) { Trial t1 = new Trial(); t1.setI(10); System.out.println(t1.getI()); Trial t2 = new Tr...
<p>Yes it's the correct way.</p> <p>When a class is not static you need to instance it with new keyword. Like you did </p> <pre><code>Trial t1 = new Trial(); </code></pre> <p>The static variable i shouldn't be static if you do not want to share its value between all Trial object. If you want to use this value (in "...
<p>Others have already mention that get and set methods should be static, since they are referring to a static variable.</p> <p>Further, there is no such thing as <strong>static class</strong> in java. Also you aught to make that static variable private. So in that sense I am opposed to @Daok's suggestion of making it...
45,934
<p>How can I bring a console application window to front in C# (especially when running the Visual Studio debugger)?</p>
<p>It's hacky, it's horrible, but it works for me (thanks, <a href="http://pinvoke.net/" rel="noreferrer">pinvoke.net</a>!):</p> <pre><code>using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; public class Test { [DllImport("user32.dll")] [return: MarshalAs(U...
<p>Get two monitors (at least) and open VisualStudio in the secondary monitor. When you run your app from within VisualStudio it will start up by default on the primary monitor. Since it's the last app to be opened, it starts on top and changing over to VisualStudio doesn't affect it. Works for me anyway.</p> <p>If...
26,244
<p>Since the speed of the top Javascript engines seems to be on par, the next criteria is footprint. What are the code and data footprints of the leading javascript engines?</p>
<p>squirrelfish should have the smallest footprint ( i remember i read somewhere that it uses a really simple translation table from JS code to native code), but if you want something very small you should look at earlier js engines (that dont use native code tables) as they interpret code as they go, and dont compile ...
<p>V8 is the best engine AFAIK with higher performance metrics which has smaller memory footprint. V8 loads each JS objects based on the context into the memory and also uses generational garbage collector which means more runtime memory gets collected with lesser performance overhead. </p> <p>If you mean code and dat...
38,667
<p>I'm using Forms Authentication (and the built in Login controls) and letting users click the "remember me" checkbox when logging in. When they return to the site, they are automatically logged in as expected. Is there an event I can catch when this happens? I've been studying the FormsAuthenticationModule.Authentica...
<p>Look in the Application_AuthenticateRequest event in Global.asax. </p> <p><a href="http://msdn.microsoft.com/en-us/library/system.web.httpapplication.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.web.httpapplication.aspx</a></p> <p>This event fires after the user has been authenticated (via...
<p>First of all, look into using the Login control that's available in 2.0+ (as I remember). There is a Authenticate event you can handle on that control, which is where you can set your session variable.</p> <p>Additionally, let's assume after authenticating the user is taken to some "home" page. So you can set you...
35,386
<p>I have a class that defines a CallRate type. I need to add the ability to create multiple instances of my class by reading the data from a file.</p> <p>I added a static method to my class CallRate that returns a <code>List&lt;CallRate&gt;</code>. Is it ok for a class to generate new instances of itself by calling o...
<p>It is perfectly fine to get object(s) of its own from the static method.</p> <p>e.g.</p> <p>One of the dot net libraries does the same thing as you did,</p> <pre><code>XmlReadrer reader = XmlReader.Create(filepathString); </code></pre>
<p>It's perfectly acceptable to do this. When I do, I typically make the real constructors for the class private so that it's clear that the <em>only</em> way to construct instances is through the static method.</p> <p>This is very useful in cases where "construction" may not always return a new instance. For example,...
31,984
<p>Compared to most people on this site I am admittedly a novice. I wanted to get some advice from the pros on how to avoid making stupid errors in your code. </p> <p>Is there anyone else who had the problem when they were first starting out of missing some detail that causes big problems? Are there any habits or beha...
<p>Here's a list of common pitfalls, and/or suggestions to avoid them: </p> <ol> <li>Experience, the best way to avoid mistakes is to have already had them happen to you.</li> <li>Review other people's code</li> <li>Have other people review your code</li> <li>Use source control, even if you are the only developer</li>...
<p>We all make stupid mistakes, because we're human.</p> <p>I'm a novice, but I've worked with a number of seasoned professionals that make the same silly mistakes that I make. These are the mistakes that you'll learn from and be able to correct almost immediately.</p> <p>Aside from that, the best thing I can recomme...
23,024
<p>If I have a separate system with its own concept of users and presence, what is the most appropriate architecture for creating a bridge to an XMPP server network? As far as I can tell there are three primary ways:</p> <ol> <li><p>Act as a server. This creates one touchpoint, but I fear it has implications for com...
<p>The XMPP gateway protocol you've heard of is most likely to do with transports. A transport is a server that connects to both a XMPP server and a non-XMPP server. By running a transport, I can use my Jabber client to talk to someone using, say, MSN Messenger.</p> <p>A transport typically connects once to the remo...
<p>One other approach is to work with your XMPP server vendor. Most have internal APIs that make injecting presence possible from third party applications. For example, <a href="http://www.jabber.com/CE/JabberXCP" rel="nofollow noreferrer">Jabber XCP</a> provides an API for this that's really easy to use.</p> <p>(Di...
5,622
<p>How would you design a database to support the following tagging features:</p> <ul> <li>items can have a large number of tags</li> <li>searches for all items that are tagged with a given set of tags must be quick (the items must have ALL tags, so it's an AND-search, not an OR-search)</li> <li>creating/writing items...
<p>About ANDing: It sounds like you are looking for the "relational division" operation. <a href="http://www.dbazine.com/ofinterest/oi-articles/celko1" rel="noreferrer">This article</a> covers relational division in concise and yet comprehendible way.</p> <p>About performance: A bitmap-based approach intuitively sound...
<p>You won't be able to avoid joins and still be somewhat normalized.</p> <p>My approach is to have a Tag Table.</p> <pre><code> TagId (PK)| TagName (Indexed) </code></pre> <p>Then, you have a TagXREFID column in your items table.</p> <p>This TagXREFID column is a FK to a 3rd table, I'll call it TagXREF:</p> <pre>...
7,092
<p>I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the structure (xsd) that I created.</p> <p>One way to do that is to write my own serializer, but is there a built in support for it or open source...
<p>You can generate serializable C# classes from a schema (xsd) using xsd.exe:</p> <pre><code>xsd.exe dependency1.xsd dependency2.xsd schema.xsd /out:outputDir </code></pre> <p>If the schema has dependencies (included/imported schemas), they must all be included on the same command line.</p>
<p>I'll bet NetDataContractSerializer can do what you want.</p>
11,319
<p>I need to warn users about unsaved changes before they leave a page (a pretty common problem).</p> <pre><code>window.onbeforeunload = handler </code></pre> <p>This works but it raises a default dialog with an irritating standard message that wraps my own text. I need to either completely replace the standard message...
<p>You can't modify the default dialogue for <code>onbeforeunload</code>, so your best bet may be to work with it.</p> <pre><code>window.onbeforeunload = function() { return 'You have unsaved changes!'; } </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/ms536907(VS.85).aspx" rel="noreferrer">Here...
<p>Try this</p> <pre><code>$(window).bind('beforeunload', function (event) { setTimeout(function () { var retVal = confirm(&quot;Do you want to continue ?&quot;); if (retVal == true) { alert(&quot;User wants to continue!&quot;); return ...
34,891
<p>Kind of a special case problem:</p> <ul> <li>I start a process with <code>System.Diagnostics.Process.Start(..)</code></li> <li>The process opens a splash screen -- this splash screen becomes the main window.</li> <li>The splash screen closes and the 'real' UI is shown. The main window (splash screen) is now invali...
<p>If you don't mind using the Windows API, you could use <a href="http://msdn.microsoft.com/en-gb/library/windows/desktop/ms633498.aspx" rel="nofollow noreferrer"><code>EnumWindowsProc</code></a>, and check each of the handles that that turns up using <a href="http://msdn.microsoft.com/en-gb/library/windows/desktop/ms...
<p>Somewhere in the code, the "real" main window is created. You can just save the window handle at that time and then after the splash screen closes you can set Application.MainWindow to the real window.</p>
10,448
<p>I've got two branches that are fully merged together.</p> <p>However, after the merge is done, I realise that one file has been messed up by the merge (someone else did an auto-format, gah), and it would just be easier to change to the new version in the other branch, and then reinsert my one line change after bring...
<p>Run this from the branch where you want the file to end up:</p> <pre><code>git checkout otherbranch myfile.txt </code></pre> <p>General formulas:</p> <pre><code>git checkout &lt;commit_hash&gt; &lt;relative_path_to_file_or_dir&gt; git checkout &lt;remote_name&gt;/&lt;branch_name&gt; &lt;file_or_dir&gt; </code></pre>...
<p>Sorry, no one mentioned that before restoring a file you really want to preview local changes in relation to that branch, so:</p> <pre><code>git diff &lt;other-branch-name&gt; -- &lt;filename&gt; </code></pre> <p>Then when you're accepting a lost (overwritting), you can follow by:</p> <pre><code>git restore --source...
39,586
<p>I'm new to 3D printing. I've made some projects before just fine, but this project is giving me problems.</p> <p>I 3D printed a trumpet mouthpiece, and the printer made supports inside the mouthpiece funnel. I can easily remove the exterior supports, but I don't know how to get to the supports inside. Does anyone k...
<p>That model didn’t need supports. Most of the time you can break the connections with the supports to the model by inserting a knife or flat object into the cavity. In this case you could use a probe to loosen the joins then wedge it out. If that doesn’t work you can use needle nose pliers to remove prices. </p> <p>...
<p>&quot;Don't use supports&quot;&lt;-- that is the best answer.</p> <h2>Warning</h2> <p>Sadly, if you print vertically, you end up with an extremely fragile piece -it'll snap between layers. The OP properly printed horizontally for strength, and possibly by using a very &quot;thin&quot; layer height he can get by wi...
1,522
<p>I thought these were synonomous, but I wrote the following in Microsoft SQL:</p> <pre><code>Select Unique col from (select col from table1 union select col from table2) alias </code></pre> <p>And it failed. Changing it to </p> <pre><code>Select Distinct col from (select col from table1 union select c...
<p>Unique is a keyword used in the Create Table() directive to denote that a field will contain unique data, usually used for natural keys, foreign keys etc.</p> <p>For example:</p> <pre><code>Create Table Employee( Emp_PKey Int Identity(1, 1) Constraint PK_Employee_Emp_PKey Primary Key, Emp_SSN Numeric ...
<ol> <li><strong>Unique</strong> was the old syntax while <strong>Distinct</strong> is the new syntax,which is now the Standard sql.</li> <li><strong>Unique</strong> creates a constraint that all values to be inserted must be different from the others. An error can be witnessed if one tries to enter a duplicate value. ...
43,621
<p>One of the more interesting things I've run into lately is the art and science of laying out chip floorplan and determining packaging for the silicon. I would like to read some materials on the subject for the "Interested Software Guy".</p> <p>Does anyone have any recommendations (Website or book, so long as it is ...
<p>This is a result of my search on the subject as I was curious about your question and this is where I would start myself. Sorry I am not a specialist on the subject but hope it can kick-start you!</p> <p>Seems <a href="http://en.wikipedia.org/wiki/Floorplan_(microelectronics)" rel="noreferrer">floorplan</a> optimiz...
<p>There seems to be a class on this at Carnegie Mellon</p> <p><a href="http://www.ece.cmu.edu/~ee760/" rel="nofollow noreferrer">VLSI CAD</a></p> <p>some of the lecture notes that looked more interesting than others:</p> <ul> <li><a href="http://www.ece.cmu.edu/~ee760/760assignments.html" rel="nofollow noreferrer">...
44,850
<p>Convert a .doc or .pdf to an image and display a thumbnail in Ruby?<br> Does anyone know how to generate document thumbnails in Ruby (or C, python...)</p>
<p>A simple RMagick example to convert a PDF to a PNG would be:</p> <pre><code>require 'RMagick' pdf = Magick::ImageList.new("doc.pdf") thumb = pdf.scale(300, 300) thumb.write "doc.png" </code></pre> <p>To convert a MS Word document, it won't be as easy. Your best option may be to first convert it to a PDF before ge...
<p>Not sure about .doc support in any open source library but ImageMagick (and the RMagick gem) can be compiled with pdf support (I think it's on by default)</p>
9,101
<p>I'm looking for a method to acurately determine if an interface is the physical 802.3 ethernet port on a pc in windows.</p> <p>Using ipconfig /all I can list all the interfaces, and when I do this on my pc several entries can be listed here including VPN, Bluetooth, Wifi and the physical ethernet interface.</p> <p...
<p>Call <a href="http://msdn.microsoft.com/en-us/library/aa365939(VS.85).aspx" rel="nofollow noreferrer">GetIfEntry</a> and look for a dwType of IF_TYPE_ETHERNET_CSMACD in the <a href="http://msdn.microsoft.com/en-us/library/aa366836(VS.85).aspx" rel="nofollow noreferrer">MIB_IFROW</a> structure returned.</p> <p>Or in...
<p>I'm not sure of the answer - but be aware that it is possible to have multiple ethernet interfaces.</p>
24,923
<p>I personally used Mercurial and Subversion in a limited way and I just can't see why 95% of the people will chose SVN over something else. Is it just a monopoly case or is there a lot of good hidden in SVN that other systems don't have?</p>
<p>It is free, is open source, has good documentation, is widely used, simple/easy to use, has a significant functionality set, available on lots of platforms, support available.</p> <p>There is not much more that you can ask of a piece of software.</p> <p>EDIT I know it is not as good as other tools at dealing with ...
<p>It's much better than CVS, that people used before. And it has so few disadvantages, that people don't have the feeling, they should try something else. Subversion is enough for most needs, so they try nothing else, even it may be more productive. I haven't used mercurial yet (I want to give it a try, but don't have...
42,868
<p>Looking at adding some data graphing to a new iPhone app in development (ala the Stocks app).</p> <p>I realize I could buckle down and do some Quartz drawing but I'm hoping that someone somewhere has a tip on a Cocoa graphing framework that works on iOS.</p>
<h1>Core Plot</h1> <p>There's a plotting framework in active development on <a href="https://github.com/core-plot/core-plot" rel="noreferrer">Core Plot</a>.</p> <p>It works on both Mac and iPhone.</p>
<p>I was wondering the same thing and came across this sample code (AccelerometerGraph).</p> <p><a href="http://developer.apple.com/iphone/library/samplecode/AccelerometerGraph/index.html" rel="nofollow noreferrer">link to Apple Dev site</a>.</p> <p>I have begun to play with core-plot as well. It is quite nice.</p>
32,985
<p>I'm guessing the StackOverflow code has something along the lines of a UsersController that defines a function like this:</p> <pre><code>public ActionResult Profile(string id, string username, string sort) { } </code></pre> <p>From what I can tell, there's two ways to go about implementing the Profile function...
<p>Personally, I would create an action and view for each tab section and use a partial view for the top part that is shared across the others. I'm just getting started with MVC though, so I don't have a lot of experience to back up that suggestion.</p> <p>The URL route scheme I would use is /{controller}/{id}/{sectio...
<p>You could build the view name from the sort value</p> <pre><code>&lt;% RenderPartial(sort + "View") %&gt; </code></pre> <p>However, it does default back to the stats view if the parameter doesn't exist so I don't think they are doing that.</p> <p>A switch on sort would probably work just fine with the default on ...
48,403
<p>How can I use XPath to select an XML-node based on its content? </p> <p>If I e.g. have the following xml and I want to select the &lt;author&gt;-node that contains Ritchie to get the author's full name:</p> <pre><code>&lt;books&gt; &lt;book isbn='0131103628'&gt; &lt;title&gt;The C Programming Language&...
<pre><code>/books/book/authors/author[contains(., 'Ritchie')] </code></pre> <p>or</p> <pre><code>//author[contains(., 'Ritchie')] </code></pre>
<p>The XPath for this is: </p> <pre><code>/books/book/authors/author[contains(., 'Ritchie')] </code></pre> <p>In C# the following code would return "Ritchie, Dennis M.":</p> <pre><code>xmlDoc.SelectSingleNode("/books/book/authors/author[contains(., 'Ritchie')]").InnerText; </code></pre>
4,986
<p>I am trying to print a wing for a rc plane with my 3D printer. In order to make the wing as light as possible I need to hollow it (and afterwards put some stable structure there). I've tried the Blender Solidify modifier to do this but without success. The material on the sharp edge on the rear part of the wing gets...
<p>I am sorry to inform you, that the answer to "How do I fix the thickness" is "Remodel them" - especially in this case as the whole design is... awkward.</p> <p>But you don't necessarily need to resign them from scratch, if you can fix it... But beware, fixing does only work <strong>sometimes</strong>...</p> <p>Fir...
<p>Don't design your part as hollow. Make it solid. Then put it in the slicer and chose the infill (i recomment cubic pattern in cura) you want. So you have a mainly hollow wing with a nice structure in it. </p>
1,079
<p>We have a DLL used as the middle layer between our website front end and our back end ticketing system. The method of insertion into the ticketing system is a bit complicated to explain, but the short version is that it's slow. The best case scenario I've gotten is a 9 second submission time.</p> <p>The real prob...
<p>Potentially the location of the web service in relation to the web server could be having an issue. Also, the page structure and other processing inside your web UI could be having an impact on how long it takes the application to process.</p> <p>As mentioned logging items on both sides is a great idea, if that do...
<p>Pepper your application on both sides with logs - that will show you where the time is going. If that doesn't help, use <a href="http://www.wireshark.org/" rel="nofollow noreferrer">Wireshark</a> to trace the network activity.</p>
24,673
<p>As part of a VBA program, I have to set the background colors of certain cells to green, yellow or red, based on their values (basically a health monitor where green is okay, yellow is borderline and red is dangerous).</p> <p>I know how to set the values of those cells, but how do I set the background color.</p>
<p>You can use either:</p> <pre><code>ActiveCell.Interior.ColorIndex = 28 </code></pre> <p>or </p> <pre><code>ActiveCell.Interior.Color = RGB(255,0,0) </code></pre>
<p>It doesn't work if you use Function, but works if you Sub. However, you cannot call a sub from a cell using formula. </p>
47,669
<p>I am declaring an array of void pointers. Each of which points to a value of arbitary type.<br> <code>void **values; // Array of void pointers to each value of arbitary type</code></p> <p>Initializing values as follows:</p> <pre><code> values = (void**)calloc(3,sizeof(void*)); //can initialize va...
<p>You have 3 things that are dynamically allocated that need to be freed in 2 different ways:</p> <pre><code>delete reinterpret_cast&lt;int*&gt;( values[0]); delete reinterpret_cast&lt;float*&gt;( values[1]); free( values); // I'm not sure why this would have failed in your example, // but it ...
<p>You'd have to keep track of how many void* were originally calloc'd, and iterate over them, free-ing each one, then free the original values variable.</p> <p>darn formatting... (the preview is working fine).</p> <pre><code>int ct = 3; values = (void*)calloc(ct,sizeof(void)); //can initialize values as: values = ne...
25,271
<p>A couple of months ago, the MRU list in Visual Studio stopped working. Neither the File menu or the start page shows any recently opened projects or solutions. I honestly have no clue what I did to cause this, but perhaps someone who knows more about the murky depths of VS might be able to hazard a guess at what ca...
<p>You might run RegMon / FileMon (ProcessMon) from SysInternals as to ensure it is access the correct path, and that there are not permissions problems, etc</p>
<p>Forgive me if you've already checked the obvious: there's a setting under Tools, Options, Environment, General, where you can set the # of items to be displayed in MRU lists. Is it possible that somehow this has gotten set to zero?</p>
42,504
<p>I work in a Microsoft environment, so I can use my C# hammer on any nails I come across. That being said, what languages (compiled, interpreted, scripting, functional, any types!) complement knowing C#, and for what purposes? For example, I've moved a lot of script functionality away from compiled console apps and i...
<p>Python/Perl/Ruby/PowerShell are great supplements to C#/VB.NET. If your boss hands you a text file and says insert it into the database once or twice, then any of Perl/Python/Ruby (I'm not sure about powershell but I imagine it is not that much more difficult) should be fine to parse it. Either way, for your main ...
<p>I'm with jjnguy. Try one of the scripting languages. Plus as a bonus, when you learn Ruby/PythonPearl, etc...it's a gateway drug...err language to developing for other environments.</p>
12,873
<p>What assemblies are loaded by default when you create a new ASP.NET 2.0 Web Application Project ?</p>
<p>This class is in half the WS Java libraries out there. It's really easy to load it from multiple classloaders and later compare them, causing a LinkageError.</p> <p>One effective (but sledgehammer) technique to tracking this down is to modify Classloader from the Java source to dump which jar this particular class...
<p>May be it's completely unrelated, but I remember a problem Weblogic had with the very same class. The reason for the problem was the changed serial id of the class (Sun changed it accidentally). The workaround was to provide a -Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0 to the JVM.</p> <p>Could ...
16,219
<p>I'm looking for an .xsd schema file to drop into my Visual Studio directory to provide intellisense for the xml configuration file for the Castle Windsor IoC container. I've looked in the downloaded code for Windsor, as well as googled several different ways. I see many people asking the same question, but no answer...
<p>Perhaps this is what you are looking for:</p> <p><a href="http://jimblogdog.blogspot.com/2008/05/castlewindsor-schema-enables-visual.html" rel="nofollow noreferrer">http://jimblogdog.blogspot.com/2008/05/castlewindsor-schema-enables-visual.html</a></p> <p>Here is the link to download the castle windsor schema:</p>...
<p>I have rehosted the project-distributor schema zip on google code <a href="http://code.google.com/p/castlewindsorschema/" rel="nofollow noreferrer">here</a>. The zip contains schema, example usage and a readme to install it.</p>
13,639
<p>Application has an auxiliary thread. This thread is not meant to run all the time, but main process can call it very often.</p> <p>So, my question is, what is more optimal in terms of CPU performance: suspend thread when it is not being used or keep it alive and use WaitForSingleObject function in order to wait for...
<p>In terms of CPU resources used, both solutions are the same - the thread which is suspended and thread which is waiting in WaitForSingleObject for an object which is not signalled both get no CPU cycles at all.</p> <p>That said, WaitForSingleObject is almost always a prefered solution because the code using it will...
<p>Another option would be the TMonitor introduced in Delphi 2009, which has functions like Wait, Pulse and PulseAll to keep threads inactive when there is nothing to do for them, and notify them as soon as they should continue with their work. It is loosely modeled after the object locks in Java. Like there, Delphi ob...
15,992
<p>I need to choose a database management system (DBMS) that uses the least amount of main memory since we are severely constrained. Since a DBMS will use more and more memory to hold the index in main memory, how exactly do I tell which DBMS has the smallest memory footprint? </p> <p>Right now I just have a memory ...
<p>Just use SQLite. In a single process. With C++, preferably.</p>
<p>Ultimately, this kind of optimization is probably answering the wrong question. </p> <p>Most likely the answers you gather through this sort of testing are going to be misleading, because the DBMS will react differently under "live" circumstances than during your testing. Futhermore, you're locking yourself in ...
29,936
<p>I was wondering if there are any alternatives to Microsoft's SQL Server Management Studio?</p> <p>Not there's anything wrong with SSMS, but sometimes it just seem too big an application where all I want todo is browse/edit tables and run queries.</p>
<p>I've started using <a href="http://www.linqpad.net/" rel="noreferrer" title="Linq Pad">LinqPad</a>. In addition to being more lightweight than SSMS, you can also practice writing LINQ queries- way more fun than boring old TSQL!</p>
<p>You can still install and use Query Analyzer from previous SQL Server versions.</p>
2,714
<p>I've been working on a SharePoint project and I have gone the route of loading User Controls through a custom web part.</p> <p>I have several web controls where I need to dynamically generate hyperlinks (in a loop from a database) that will call certain functions of the User Control when clicked.</p> <p>When I'm b...
<p>You should use <code>svn:externals</code> as <strong>external</strong> references from different repositories. So <code>svn:externals</code> should refer to components, modules, 3rd party tools, etc.</p> <p>You should <strong>not</strong> use <code>svn:externals</code> to emulate a "symbolic link"-behaviour by usin...
<p>When you create a branch within Subversion you are simply creating a cheap copy of the trunk, branch, or tag that you are branching from. This cheap copy will contain all of the same files and properties as the trunk, branch, or tag that you branched from until you begin to modify the properties or files of the new ...
30,432
<p>What combination of CSS or attributes are needed?</p>
<ul> <li>Hide the actual control</li> <li>Made a DIV with the controls and styling you want on top of it</li> </ul> <p>The button is not a standard HTML control.</p> <p>See: <a href="http://www.quirksmode.org/dom/inputfile.html" rel="noreferrer">http://www.quirksmode.org/dom/inputfile.html</a></p>
<p>In addition to the quirksmode tutorial, here's another good resource: <a href="http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom" rel="noreferrer">http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom</a></p> <p>If you're hiding the actual control,...
33,867
<p>I like to keep my shell sessions named with useful titles as I work, this helps me keep track of what I'm using each of the many tabs for.</p> <p>Currently to rename a session I double click its name on the tabbed part of the console - is there any command that I can use to do this from within the shell? It would s...
<p>The article <a href="http://www.faqs.org/docs/Linux-mini/Xterm-Title.html" rel="nofollow noreferrer">How to change the title of an xterm</a> should help.</p>
<p>The answer to this really depends on the terminal program you're using. </p> <p>However, I'll just assume it's sensible, and emulates an xterm enough that it respects xterm escape codes - in which case, you probably want to look here : <a href="http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#s3" rel="nofollow ...
27,263
<p>I'm looking for advice on the built-in unit testing feature provided in VS08. Can any body please tell me if they know of any reasons NOT to use this feature over any of the other packages available (I'm vaguely familiar with NUnit)?</p> <p>I'm planning on applying unit testing to an older project just to learn the...
<p>It looks like the discussion <a href="https://stackoverflow.com/questions/92869/nunit-vs-visual-studio-2008s-test-projects-for-unit-testing">here</a> can answer your question.</p>
<p>The syntax can be a little clumsy, but if you're only trying to get to grips with unit testing, then there will be no harm in using the built-in stuff</p>
11,854
<p>We are using Hibernate Spring MVC with OpenSessionInView filter. Here is a problem we are running into (pseudo code)</p> <pre><code>transaction 1 load object foo transaction 1 end update foo's properties (not calling session.save or session.update but only foo's setters) validate foo (using hibernate validator) ...
<p>You can run a get on foo to put it into the hibernate session, and then replace it with the object you created elsewhere. But for this to work, you have to know all the ids for your objects so that the ids will look correct to Hibernate.</p>
<p>What about using Session.clear() and/or Session.evict()?</p>
30,301
<p>does anybody know how to save and retrieve files in MS SQL-Server 2000? I guess the image data type could be used as a container.</p> <p>I want to import/export the following file types: DOC, XLS, PDF, BMP, TIFF, etc.</p> <p>Due to resource issues we are using MS-Access 2007 as the front end, so I am looking for VB...
<p>I advise you (really!) not to try (ever!) to save files as data in a database. You will quickly face critical space problems. </p> <p>Please think about creating folders for file storage. These will be used to save/archive your files. Folders paths can be stored in one of your tables (<code>Tbl_Folder</code>, for e...
<p>You can do this using GetChunk and AppendChunk.</p> <p>From <a href="http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/9acef36c-0f2d-4fa1-b71f-172a0ac89c4b/" rel="nofollow noreferrer">this post</a> you might find <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;194975" rel="nofollow nor...
38,808
<p>Does everyone just use XML in the message? Are there any good alternatives to XML? If you do use XML, do you define an XML Schema so clients know how to send messages to your service?</p>
<p>We use XML, but I think the important thing is to tailor the solution to the problem. The reason we use XML is that we are basically sending an object across in the message. There's no reason it can't be plain text, if applicable for the message you are sending, using headers to send along properties if appropriat...
<p>XML, CSV, HTML, a simple word or sentence, ... Any of these are valid depending on the context in which the message is used and created. Just keep it simple and send what is needed in that context.</p> <p>It is very flexible and can be adapted to the problem space.</p>
30,143
<p>I've been using VMWare for a while and am very happy with it, but I would like to compare it with VirtualBox. Apparently the disk images are compatible, and I have successfully booted my Fedora based VM created by VMWare in VirtualBox... but the network is completely unavailable. How do you port a virtual machine ...
<p>have you tried going into the options in virtual box and changing the network adapter to the VB one? VB is a bit different in it's virtual adapters, you might have to create a new one attached to the nic and then specify that one as the primary nic.</p>
<p>If the network is unavailable, you may want to check your VirtualBox configuration and make sure you have a network card configured. If you do, then the next stop would be the OS running in the virtual machine. An unfortunate fact of some operating systems is that they don't always appreciate hardware changes. If th...
11,095
<p>After reading Evan's and Nilsson's books I am still not sure how to manage Data access in a domain driven project. Should the CRUD methods be part of the repositories, i.e. OrderRepository.GetOrdersByCustomer(customer) or should they be part of the entities: Customer.GetOrders(). The latter approach seems more OO, b...
<p>CRUD-ish methods should be part of the Repository...ish. But I think you should ask why you have a bunch of CRUD methods. What do they <em>really</em> do? What are they <em>really</em> for? If you actually call out the data access patterns your application uses I think it makes the repository a lot more useful and k...
<p>The annoying thing with Nilsson's Applying DDD&amp;P is that he always starts with "I wouldn't do that in a real-world-application but..." and then his example follows. Back to the topic: I think OrderRepository.GetOrdersByCustomer(customer) is the way to go, but there is also a discussion on the ALT.Net Mailing lis...
10,275
<p>I'm trying to ftp a folder using the command line ftp client, but so far I've only been able to use 'get' to get individual files. </p>
<p>You could rely on wget which usually handles ftp get properly (at least in my own experience). For example:</p> <pre><code>wget -r ftp://user:pass@server.com/ </code></pre> <p>You can also use <code>-m</code> which is suitable for mirroring. It is currently equivalent to <code>-r -N -l inf</code>.</p> <p>If you've s...
<p>toggle the prompt by PROMPT command.</p> <p>Usage:</p> <pre><code>ftp&gt;cd /to/directory ftp&gt;prompt ftp&gt;mget * </code></pre>
13,906
<p>I have an application that uploads an Excel .xls file to the file system, opens the file with an oledbconnection object using the .open() method on the object instance and then stores the data in a database. The upload and writing of the file to the file system works fine but I get an error when trying to open the ...
<p>While the permissions issue may be more common you can also encounter this error from Windows file system/Access Jet DB Engine connection limits, 64/255 I think. If you bust the 255 Access read/write concurrent connections or the 64(?) connection limit per process you can get this exact same error. At least I've c...
<p>Anything in the inner exception? Is this a 64-bit application? The OLEDB providers don't work in 64-bit. You have to have your application target x86. Found this when getting an error trying to open access DB on my 64-bit computer.</p>
12,172
<p>I would like to know what the pros and cons are for using an Anemic Domain Model (see link below).</p> <p><a href="http://www.martinfowler.com/bliki/AnemicDomainModel.html" rel="noreferrer" title="Fowler Article">Fowler Article</a></p>
<p>With "Anemic Domain Model" being anti-pattern, why are there so many systems that implement this?</p> <p>I think there are several reasons </p> <p><strong>1. Complexity of the system</strong></p> <p>In a simple system (which is almost all the examples and sample code you find on internet) if I want to implement:...
<p>An <a href="http://www.martinfowler.com/bliki/AnemicDomainModel.html" rel="nofollow noreferrer">anemic domain model</a> is an anti-pattern. Anti-patterns don't have pros.</p>
32,276
<p>Do you have a good experience with a control library? Something that is kind of robust, well documented, consistent (across different controls) and quite well integrated into the Visual Studio.</p>
<p>I'll second the vote for <a href="http://www.telerik.com" rel="nofollow noreferrer">Telerik</a>. Their controls for the most part &quot;just work&quot; and their support has been excellent. I primarily use their forums and I still receive a response within a day (unlike some other vendors who barely seem to notice t...
<p><a href="http://www.componentart.com" rel="nofollow noreferrer">ComponentArt</a> has some pretty cool controls. You might want to check out <a href="http://www.telerik.com" rel="nofollow noreferrer">Telerik</a> as well. Both companies offer pretty easy to use controls that look nice.</p>
5,356
<p>Using ANTLR v3 and the CSharp2 language specifier, is there any way to indicate that you want the generated lexer or parser to be internal versus the default of public?</p> <p>The namespace is specified with:</p> <pre><code>@lexer::namespace {My.Namespace} </code></pre> <p>and I would assume something similar exi...
<p>This <a href="http://antlr.markmail.org/message/hwddx4xi7da4czre" rel="nofollow noreferrer">thread</a> on the antlr-interest mailing list talks about it. At the time of writing they are adding access specifiers to rules, but don't support access specifiers on the entire parser/lexer class. Will update if that change...
<p>I wanted to know the same thing, from looking at the template that it uses, it doesn't look like you can. "public" is hard coded.</p>
46,644
<p>I'm trying to make an item on ToolBar (specifically a Label, TextBlock, or a TextBox) That will fill all available horizontal space. I've gotten the ToolBar itself to stretch out by taking it out of its ToolBarTray, but I can't figure out how to make items stretch.</p> <p>I tried setting Width to Percenatage or St...
<p>Unfortunately it looks like the default ControlTemplate for ToolBar doesn't use an ItemsPresenter, it uses a ToolBarPanel, so setting ToolBar.ItemsPanel won't have any effect.</p> <p>ToolBarPanel inherits from StackPanel. By default its Orientation is bound to the parent ToolBar.Orientation, but you can override t...
<p>Try putting a horizontal StackPanel in the ToolBar and then the element you want inside of that StackPanel.</p>
28,759
<p>I've found an interesting article about Lucene and geosearching:</p> <p><a href="http://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html" rel="nofollow noreferrer">http://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html</a></p> <p>Is there an equivilant .NET implementation out there that ...
<p>I came across this article, as well. I do not see a .NET-specific in my Googling, so I am planning on probably porting this code when the need arises, as well. Right now, I am just getting my feet wet with Lucene.NET and have not gotten to the point that I am comfortable enough with it to start extending it, yet.<...
<p>With Lucene.NET 3.0.3, soon to be released, there is a brand new spatial contrib. See:</p> <p><a href="http://www.code972.com/blog/2012/05/the-future-of-geo-spatial-searches-with-lucene/" rel="nofollow">http://www.code972.com/blog/2012/05/the-future-of-geo-spatial-searches-with-lucene/</a></p>
41,878
<p>I just started using <a href="http://www.lizardl.com/PageHtml.aspx?lng=2&amp;PageId=18" rel="nofollow noreferrer">Log Parser Lizard</a> to examine my IIS and Event logs. </p> <p>What UI tool do you use on top of LogParser 2.2 to view your log files on production?</p>
<p>Microsoft Exchange team just releases a new tool,</p> <p><a href="http://blogs.technet.com/b/exchange/archive/2012/03/07/introducing-log-parser-studio.aspx">http://blogs.technet.com/b/exchange/archive/2012/03/07/introducing-log-parser-studio.aspx</a></p>
<p>I've been using <a href="http://en.serialcoder.net/logiciels/visual-logparser.aspx" rel="nofollow noreferrer">http://en.serialcoder.net/logiciels/visual-logparser.aspx</a></p>
21,075
<p>Say I have two tables I want to join. Categories:</p> <pre><code>id name ---------- 1 Cars 2 Games 3 Pencils </code></pre> <p>And items:</p> <pre><code>id categoryid itemname --------------------------- 1 1 Ford 2 1 BMW 3 1 VW 4 2 Tetris 5 ...
<p>Just done a quick test. This seems to work:</p> <pre><code>mysql&gt; select * from categories c, items i -&gt; where i.categoryid = c.id -&gt; group by c.id; +------+---------+------+------------+----------------+ | id | name | id | categoryid | name | +------+---------+------+------------+...
<p>Mysql lets you to have columns not included in grouping or aggregate, in which case they've got random values:</p> <pre><code> select category.id, category.name, itemid, itemname inner join (select item.categoryid, item.id as itemid, item.name as itemname from item group by categoryid) on c...
19,714
<p>I'm new with Objective-C, so there probably is a simple solution to this.</p> <p>I want a number to increment, but each iteration to be show on a label. (for example, it shows 1, 2, 3, 4, 5... displayed apart by an amount of time).</p> <p>I tried:</p> <pre><code>#import "testNums.h" @implementation testNums - (I...
<p>To allow the run loop to run between messages, use an <code>NSTimer</code> or delayed perform. Here's the latter:</p> <pre><code>- (IBAction) start:(id)sender { [self performSelector:@selector(updateTextFieldWithNumber:) withObject:[NSNumber numberWithInt:0] afterDelay:1.0]; } - (void) updateTextFieldWithNumbe...
<p>Yes, because that is what you told it to do. The graphics will not actually update until the main run loop is free to display them. You'll need to use <code>NSTimer</code> or some such method to do what you want.</p> <p>A better question might be why you want to do this?</p>
29,402
<p>I'm looking for a cross-browser method of detecting that a client web browser is scrolled all the way to the bottom (or top) of the screen.</p> <p>Really, the top is fairly easy, as<br> <code>scrY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop</code><br> is zero if you're ...
<p><a href="http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html" rel="nofollow noreferrer">http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html</a></p> <p><a href="http://www.sitepoint.com/article/preserve-page-scroll-position/" rel="nofollow noreferrer">http://www.sitepo...
<p>A sum up of what works in FF 3.5:</p> <pre><code>function isTop() { return window.pageYOffset == 0; } function isBottom() { return window.pageYOffset &gt;= window.scrollMaxY; } </code></pre>
18,262
<p>I let user enter some code in my Flex3 (Flash 10) app and I want to do syntax highlighting.</p> <p>Is there any open-source library that would help me?</p> <p>I'll need a Lua syntax support, but I can add it myself if library has a resonable interface to do this.</p>
<p>Update on 21 Jan, 2009:</p> <p>Check out <a href="http://code.google.com/p/as3syntaxhighlight/" rel="nofollow noreferrer">Anirudh's port of google-code-prettify to ActionScript3</a>, it has a very good example app as well.</p>
<p>I guess this wasn't even feasible till now.</p> <p>With the new <a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Text+Primitives" rel="nofollow noreferrer">Flash Text Engine</a>, maybe such text-based features will start showing up, and hopefully open source libraries that work like the <a href="http...
47,837
<p>I want to add a single model object that has been instantiated <em>once</em> in XAML, and add it to two different collections (in xaml).</p> <p>The following code renders fine in Blend's Design Time, but I get the following errors at run time:</p> <p><em>For "Post1"</em><br> Object of type 'WpfBlog.Models.Tag' can...
<p>I was able to avoid the problem by explicitly initializing a new collection within the Tags property. Something like this:</p> <pre><code>&lt;local:PostViewModel Title="Post1"&gt; &lt;local:PostViewModel.Tags&gt; &lt;model:TagCollection&gt; &lt;StaticResource ResourceKey="TDD" /&gt; &lt;/model:T...
<p>This is very similar to the problem described in <a href="https://stackoverflow.com/questions/150150/how-do-i-share-a-menu-definition-between-a-context-menu-and-a-regular-menu-in-w#150706">this question</a>, I think.</p> <p>The solution should be to add an x:Shared="False" attribute to your &lt;model:Tag&gt; elemen...
46,627
<p>I want to convert for example a particular date 12-11-2008 11:33:04.510 to UTC datetime. Can anyone help me how to do this. I want to do this in c# coding.</p>
<p>Just use <a href="http://msdn.microsoft.com/en-us/library/system.datetime.touniversaltime.aspx" rel="nofollow noreferrer">DateTime.ToUniversalTime</a>, assuming it's in the local timezone of your computer at the moment.</p>
<p>If you want the DateTime to be identified as a UTC, you can also assign it a DateTimeKind,</p> <p>DateTime saveNow = DateTime.Now; DateTime myDt; myDt = DateTime.SpecifyKind(saveNow, DateTimeKind.Utc);</p> <p>Or if you know it's local: string formattedDate = "12-11-2008 11:33:04.510"; DateTime localDt = DateTim...
36,309
<p>We recently installed Team Foundation Server 2008 and we are using it for both Visual Studio 2008 code and Visual FoxPro 9 code that we are still migrating to .Net. I had to install the TFS MSSCCI provider to get connectivity from the VFP9 IDE. That works fine, but Visual Studio now seems to get confused about which...
<p>Have you tried switching which source control pluggin VS 2008 is using to TFS? You can find the option under Tools>Options>Source Control. It does not appear to have a default setting option but it should save the value if you close VS after setting it.</p> <p>Good Luck.</p>
<p>From VS2008 Tools menu: VS2008->Tools -> Options -> Source Control -> Plug-in Selection -> Choose the plug-in you want.</p>
24,177
<p>I'm missing something here:</p> <pre><code>$objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry $objSearcher.Filter = ("(objectclass=computer)") $computers = $objSearcher.findall() </code></pre> <p>So the question ...
<p>When you included $_.properties.name in the string, it was returning the type name of the property. When a variable is included in a string and the string is evaluated, it calls the ToString method on that object referenced by the variable (not including the members specified after). </p> <p>In this case, the ToS...
<p>I believe it has to do with the way that PS interpolates information in the "". Try this:</p> <p>"Server name in quotes $($_.properties).name" </p> <p>Or you may even need one more set of $(). I'm not somewhere that I can test it at right now.</p>
3,469
<p>Issue: Printing is not continuous.</p> <p>Observation: While printing, the upper layer of the nozzle is leaking. And also the printing is not continuous, the layers are not formed properly.</p> <p>Practices: Alternate nozzle has been fastened, Bed leveling has been checked, Even used the other softwares to print. ...
<p>Grinding is due to attempts to advance filament faster than it can be melted and dispensed. Try one or more of the following:</p> <ul> <li>Raise the head temperature (to meet current throughput demand)</li> <li>Lower the print speed (to reduce throughput demand)</li> <li>Slice for thinner layers (to reduce throughp...
<p>A 0.27 mm layer height is not correct for any printer, any nozzle/hotend, any file, and should never be used as a layer height variable for any FDM printer.</p> <p>Layer height should be a factor of the diameter of your nozzle size. i.e. Your nozzle is 0.4 mm, so depending on your printer, your range of resolutions/...
1,016
<p>I have an application with a main form. In this form I have placed three TActionMainMenuBars, because the application essentially runs in three different modes. </p> <p>The menu bars are all constructed from actions stored(proxied) in an TActionManager on the main form. The ActionManager actually references actionl...
<p>Enabling/disabling or showing/hiding of a ActioneMenuBar has no consequences for the actions on the menu bar. If you want to make some actions not available in a certain context/situation, you need to implement the "OnUpdate" event of either the action itself or the action list or action manager it is part of.</p> ...
<p>Be sure that the actions you want to use are actually enabled.<br> If you disable every action within an ActionMainMenuBar when you disable the bar, then you have a problem.<br> Be sure also to use available shortcuts, not conflicting with Windows global shortcuts.<br> Other than that I don't see why it wouldn't wor...
33,705
<p>I am writing a script for MS PowerShell. This script uses the <code>Copy-Item</code> command. One of the optional arguments to this command is "<code>-container</code>". The documentation for the argument states that specifying this argument "Preserves container objects during the copy operation."</p> <p>This is ...
<p>The container the documentation is talking about is the folder structure. If you are doing a recursive copy and want to preserve the folder structure, you would use the -container switch. (Note: by default the -container switch is set to true, so you really would not need to specify it. If you wanted to turn it of...
<p>The container the documentation is talking about is the folder structure. If you are doing a recursive copy and want to preserve the folder structure, you would use the -container switch. (Note: by default the -container switch is set to true, so you really would not need to specify it. If you wanted to turn it of...
15,699
<p>I am wondering what everyone thinks the best method of handling results from your own database is. Other teams may be involved and there is always the chance the procedure/data could be altered and erroneous results would occur. My question is this. Is it better to let and exception occur, catch and log it or try to...
<p>Personally I like failing fast - with an appropriately apologetic user message, of course. There are some things it's worth recovering from, but something like a column you expect to be non-null being null sounds more significant to me.</p> <p>Of course, I'd also try to set up some smoke tests to make sure you find...
<p>Database constraints should be taking care of most of this for you. For what isn't, I would suggest going back to the db design and fixing those constraints. </p> <p>Failing that, returning an exception on that field would be best so that the data can be fixed (or removed).</p>
21,582
<p>What is the smartest way to design a math parser? What I mean is a function that takes a math string (like: "2 + 3 / 2 + (2 * 5)") and returns the calculated value? I did write one in VB6 ages ago but it ended up being way to bloated and not very portable (or smart for that matter...). General ideas, psuedo code or ...
<p>A pretty good approach would involve two steps. The first step involves <a href="http://scriptasylum.com/tutorials/infix_postfix/algorithms/infix-postfix/index.htm" rel="noreferrer">converting the expression from infix to postfix</a> (e.g. via <a href="http://en.wikipedia.org/wiki/Shunting-yard_algorithm" rel="noref...
<p>Assuming your input is an infix expression in string format, you could convert it to <a href="http://en.wikipedia.org/wiki/Reverse_Polish_notation" rel="nofollow noreferrer">postfix</a> and, using a pair of stacks: an operator stack and an operand stack, work the solution from there. You can find general algorithm i...
13,990
<p>I want to find in a vector of Object pointers for a matching object. Here's a sample code to illustrate my problem:</p> <pre><code>class A { public: A(string a):_a(a) {} bool operator==(const A&amp; p) { return p._a == _a; } private: string _a; }; vector&lt;A*&gt; va; va.push_back(new A...
<p>Use find_if with a functor:</p> <pre><code>template &lt;typename T&gt; struct pointer_values_equal { const T* to_find; bool operator()(const T* other) const { return *to_find == *other; } }; // usage: void test(const vector&lt;A*&gt;&amp; va) { A* to_find = new A("two"); pointer_v...
<p>Try using find_if instead. It has a parameter for a predicate where you can decide exactly how to check wheter you found the right element.</p> <p><a href="http://www.sgi.com/tech/stl/find_if.html" rel="nofollow noreferrer">http://www.sgi.com/tech/stl/find_if.html</a></p>
32,323
<p>When should one do the following?</p> <pre><code>class Foo : Control { protected override void OnClick(EventArgs e) { // new code here } } </code></pre> <p>As opposed to this?</p> <pre><code>class Foo : Control { public Foo() { this.Click += new EventHandler(Clicked); } ...
<p>Overriding rather than attaching a delegate will result in more efficient code, so it is generally recommended that you always do this where possible. For more information see <a href="http://msdn.microsoft.com/en-us/library/wkzf914z(VS.71).aspx" rel="noreferrer">this MSDN article</a>. Here is a pertinent quote:</p>...
<p>If you override like Kent Boogaart comments you'll need to be carefull to call back base.OnClick to allow event suscriptions to be called</p>
19,274
<p>In a web application, I have a page that contains a DIV that has an auto-width depending on the width of the browser window.</p> <p>I need an auto-height for the object. The DIV starts about 300px from the top screen, and its height should make it stretch to the bottom of the browser screen. I have a max height f...
<p>Try this simple, specific function:</p> <pre><code>function resizeElementHeight(element) { var height = 0; var body = window.document.body; if (window.innerHeight) { height = window.innerHeight; } else if (body.parentElement.clientHeight) { height = body.parentElement.clientHeight; } else if (...
<p>If I understand what you're asking, this should do the trick:</p> <pre><code>// the more standards compliant browsers (mozilla/netscape/opera/IE7) use // window.innerWidth and window.innerHeight var windowHeight; if (typeof window.innerWidth != 'undefined') { windowHeight = window.innerHeight; } // IE6 in st...
5,306
<p>I have a Delphi Web Server setup and running, publishing Web Services, and I want to know some stuff on the calls to the web services:</p> <ul> <li>The IP address of the client who calls the web service.</li> <li>Some SOAP information on the call, such as username and password.</li> </ul> <p>How can I get this inf...
<p>You should be able to get a <a href="http://docs.codegear.com/docs/radstudio/radstudio2007/RS2007_helpupdates/HUpdate3/EN/html/delphivclwin32/HTTPApp_TWebRequest.html" rel="nofollow noreferrer">TWebRequest</a> from the Request property of the TWebModule object you get from calling <a href="http://docs.codegear.com/d...
<p>See GetSOAPWebModule.Request (uses WebBrokerSoap;).</p>
28,589
<p>Hi I'd like to schedule an existing job in the Sql Server 2005 agent via C# code... i.e. when someone clicks a button on an asp.net web page.</p> <p>How can I do this?</p> <p>Thanks!</p>
<p>Have a look here: <a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.agent.job.aspx" rel="nofollow noreferrer">SMO Job Class</a></p> <p>The <a href="http://msdn.microsoft.com/en-us/library/cc285859.aspx" rel="nofollow noreferrer">SQL Server Management Objects (SMO) Class Library</a...
<p>Check out:</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms186273(SQL.90).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms186273(SQL.90).aspx</a></p> <p>Covers both SMO and T-SQL methods.</p>
15,767
<p>I am trying to run client server UDP program . My both machines are in different networks. I have set up port forwarding in my router.</p> <p>My server has two IP Address : 1) External 200.?.?.? 2) Internal 192.168.0.100</p> <p>While creating UDP server I need to create a socket which is binded to addresss.</p> <...
<p>Given the fact that you said you set up port forwarding, did you assign the proper ports within the UPD program? or are you just sending data to an IP address? If you specify the External IP address and a port number, the port forwarding on your router should send it to the appropriate node on the network.</p>
<p>Easy may. In case you have 2 ip address. Try both once to other. You will find one. . Use this logic. Only two ip. Find the right one which will works. .</p>
43,640
<p>I frequently make use of <code>Request.QueryString[]</code> variables.</p> <p>In my <code>Page_load</code> I often do things like:</p> <pre><code> int id = -1; if (Request.QueryString["id"] != null) { try { id = int.Parse(Request.QueryString["id"]); ...
<p>Below is an extension method that will allow you to write code like this:</p> <pre><code>int id = request.QueryString.GetValue&lt;int&gt;("id"); DateTime date = request.QueryString.GetValue&lt;DateTime&gt;("date"); </code></pre> <p>It makes use of <code>TypeDescriptor</code> to perform the conversion. Based on you...
<p>I do have functions for each (actually it's one small class, with lots of statics):</p> <ul> <li><code>GetIntegerFromQuerystring(val)</code></li> <li><code>GetIntegerFromPost(val)</code></li> <li><code>....</code></li> </ul> <p>It returns -1 if fails (<em>which is almost always OK for me, I have some other functio...
45,503
<p>I come from a world that favors building your own rather than rely on libraries and frameworks built by others. After escaping this world I have found the joy, and ease, of using such tools as Typed DataSets within Visual Studio. So besides the loss of flexibility what else do you lose? Are there performance factors...
<p>Typed datasets are by far an upgrade from the world of classic ADO disconnected recordsets. I have found that they are still nice to use in simple situations where you need to perform some sort task that's row oriented -- i.e. you still want to work in the context of a database paradigm of rows, columns, constraint...
<p>Datasets are nice for quickly slapping something together with visual studio, if all the issues mentioned previously are ignored. One problem I did not see mentioned is the visual scalability of datasets within the design surface of Visual Studio. As the system grows, the size of the datasets inevitably becomes unwi...
7,673
<p>If you have an API, and you are a UK-based developer with a highly international audience, should your API be </p> <pre><code>setColour() </code></pre> <p>or</p> <pre><code>setColor() </code></pre> <p>(To take one word as a simple example.)</p> <p>UK-based engineers are often quite defensive about their 'correc...
<p>I would tend to use US-English as that has become the norm in other APIs. Speaking as an English programmer, I don't have any problem using "color", for example.</p>
<p>If all of your programmers are British, use en-gb. If your code will be seen by programmers outside of Britain, then en-us would be a better choice. </p> <p>One minor point, we rely on a translation service to copy our documentation in to other languages. We have found we get better translations when using en-us as...
19,081
<p>I have a c# .NET DLL compiled against the .NET 2.0 framework.</p> <p>A customer uses classic ASP but needs the functionality of the .NET DLL. Is there a way for them to use the DLL?</p>
<p>You would need to consume the .NET dll as a <a href="http://msdn.microsoft.com/en-us/library/ms973802.aspx" rel="nofollow noreferrer">COM callable wrapper</a>. This generally involves marking it as COM-visible (via attributes), and registering it as a COM component (regasm?).</p> <p>See <a href="http://msdn.microso...
<p>i think exposing it to COM is your only option (might be wrong)</p>
41,529
<p>Vim is acting slow when I scroll. The cursor skips some lines when I'm pressing j/k continually.</p> <p>I'm using xterm and urxvt. In both vim acts like this.</p> <p>This happens locally, with small or big files. I do use Control + F/B they work just fine.</p> <p>EDIT: ttyfast in small files did the trick but in ...
<p>Have you tried the 'ttyfast' option? See:</p> <pre><code>:help 'ttyfast' </code></pre> <p>for help, and:</p> <pre><code>:set ttyfast </code></pre> <p>to enable it.</p> <p>Also, what version are you using? And have you tried this with no customizations to see if something you've set is interfering?</p> <p>Run i...
<p>I was running vim on a Raspberry Pi 1. Disabling this one line sped things up for me:</p> <pre><code>set foldmethod=syntax &quot;slow! </code></pre>
39,526
<p>I have an absolutely positioned <code>div</code> containing several children, one of which is a relatively positioned <code>div</code>. When I use a <code>percentage-based width</code> on the child <code>div</code>, it collapses to <code>0 width</code> on IE7, but not on Firefox or Safari.</p> <p>If I use <code>pixe...
<p>The parent <code>div</code> needs to have a defined <code>width</code>, either in pixels or as a percentage. In Internet&nbsp;Explorer&nbsp;7, the parent <code>div</code> needs a defined <code>width</code> for child percentage <code>div</code>s to work correctly.</p>
<p>The <code>div</code> needs to have a defined width:</p> <pre><code>&lt;div id="parent" style="width:230px;"&gt; &lt;div id="child1"&gt;&lt;/div&gt; &lt;div id="child2"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
2,231
<p>What are good libraries for C with datastructures like vectors, deques, stacks, hashmaps, treemaps, sets, etc.? Plain C, please, and platform-independent.</p>
<p>The <a href="http://library.gnome.org/devel/glib/stable/" rel="noreferrer">Glib</a> library used on the Gnome project may also be some use. Moreover it is pretty well tested.</p> <p>IBM developer works has a good tutorial on its use: <a href="https://www.ibm.com/developerworks/linux/tutorials/l-glib/" rel="noreferr...
<p>Maybe <a href="http://sglib.sourceforge.net/" rel="nofollow noreferrer">http://sglib.sourceforge.net/</a> if you want an easy to use, very fast, macro based library.</p>
2,467
<p>I'm using <a href="http://enunciate.codehaus.org" rel="nofollow noreferrer">Enunciate</a> to build a prototype REST api and need to include a jar containing custom code as a library.</p> <p>My Ant Script looks like this:</p> <p></p> <pre><code>&lt;!--include all jars--&gt; &lt;path id="en.classpath"&gt; &lt;f...
<p>I never used enunciate, but as a quick hack you can add the jars to the war:</p> <pre><code>&lt;jar jarfile="${dist}/${war.name}" update="true"&gt; &lt;fileset dir="${lib}"&gt; &lt;include name="**/*.jar" /&gt; &lt;/fileset&gt; &lt;/jar&gt; </code></pre> <p>Note: you probably want to add the jars to...
<p>In enunciate.xml I tell it not to copy any libs itself:</p> <pre><code>&lt;webapp doLibCopy="false"&gt; </code></pre> <p>Then in the ant build file at the end of the enunciate task I update the war (you can do this to update the included/excluded jars whether or not you have Enunciate copy the jars for you in the ...
19,694
<p>I tend to implement UI functionality using fairly self-documenting void doSomething() methods, i.e. if the user presses this button then perform this action then enable this list box, disable that button, etc. Is this the best approach? Is there a better pattern for general UI management i.e. how to control when con...
<p>You can try <a href="http://danbunea.blogspot.com/2005/11/model-view-presenter-is-testing_27.html" rel="noreferrer">MVP</a> if you want to put the logic of the UI in a separate class..</p> <p>In model view presenter just as Martin Fowler or Michael Feathers say, the logic of the UI is separated into a class called ...
<p>I would only put UI logic in the Form class and put any application logic in its own class:</p> <pre><code>class Form1 : Form { void Button1_Click { Program.DoCommand1(); } } static class Program { internal static void DoCommand1() {/* ... */} } </code></pre>
15,093
<p>Poppler is a classic example of something without documentation that you would prefer be documented. This question is language agnostic, just asking about the general idea.. In short, how do you make a PDF viewer control with poppler?<br> From what I can tell, you'd need to use poppler to render it to some surface, ...
<p>You have to code it all yourself -- Poppler only handles the PDF part, you have to write the GUI. Look at the code to <a href="http://www.gnome.org/projects/evince/" rel="nofollow noreferrer">Evince</a> for a good example. </p>
<p>If you are making a app in GLib, then there is good documentation here. <a href="http://developer.gnome.org/poppler/unstable/index.html" rel="nofollow">http://developer.gnome.org/poppler/unstable/index.html</a></p> <p>If you can compile this documentations by doxygen, Just checkout the code. :) </p>
10,579
<p>What are some simple algorithm or data structure related "white boarding" problems that you find effective during the candidate screening process?</p> <p>I have some simple ones that I use to validate problem solving skills and that can be simply expressed but have some opportunity for the application of some heuri...
<p>I enjoy the classic "what's the difference between a LinkedList and an ArrayList (or between a linked list and an array/vector) and why would you choose one or the other?"</p> <p>The kind of answer I hope for is one that includes discussion of:</p> <ul> <li>insertion performance</li> <li>iteration performance</li>...
<p>I like to go over a code the person actually wrote and have them explain it to me.</p>
8,272
<p>I want to do something like this :</p> <pre><code>myYear = record.GetValueOrNull&lt;int?&gt;("myYear"), </code></pre> <p>Notice the nullable type as the generic parameter. </p> <p>Since the <code>GetValueOrNull</code> function could return null my first attempt was this: </p> <pre><code>public static T GetValueO...
<p>Change the return type to <code>Nullable&lt;T&gt;</code>, and call the method with the non nullable parameter</p> <pre><code>static void Main(string[] args) { int? i = GetValueOrNull&lt;int&gt;(null, string.Empty); } public static Nullable&lt;T&gt; GetValueOrNull&lt;T&gt;(DbDataRecord reader, string columnName...
<p>Here is an extension method I've used for years:</p> <pre><code>public static T GetValue&lt;T&gt;(this DbDataReader reader, string columnName) { if (reader == null) throw new ArgumentNullException(nameof(reader)); if (string.IsNullOrWhiteSpace(columnName)) throw new ArgumentException(&quot;Value cann...
25,663
<p>I have a webapp that I am in the middle of doing some load/performance testing on, particularily on a feature where we expect a few hundred users to be accessing the same page and hitting refresh about every 10 seconds on this page. One area of improvement that we found we could make with this function was to cache ...
<p>Without putting my brain fully into gear, from a quick scan of what you say it looks as though you need to intern() your Strings:</p> <pre><code>final String firstkey = "Data-" + email; final String key = firstkey.intern(); </code></pre> <p>Two Strings with the same value are otherwise not necessarily the same obj...
<p>other way synchronizing on string object : </p> <pre><code>String cacheKey = ...; Object obj = cache.get(cacheKey) if(obj==null){ synchronized (Integer.valueOf(Math.abs(cacheKey.hashCode()) % 127)){ obj = cache.get(cacheKey) if(obj==null){ //some cal obtain obj value,an...
16,217
<p>I've had my Ender 3 for almost three weeks, gone through about a kilogram of PLA filament (printing a mix of upgrade parts for the Ender 3 and stuff I actually want to use) and made one PETG object, generally with good results.</p> <p>I've noticed however, as seems relatively common (per YouTubers, anyway), that my ...
<p>I may be biased as my question/answer is the one I believe you're asking this question in reference to, but I would say that yes, it not only competes but is a far better solution. &quot;Auto-leveling&quot; systems <strong>do not level</strong> your bed. They just partially compensate for poor adhesion by adjusting ...
<p>So, the difference between the shimming vs. auto-leveling is that auto-leveling goes around in a 4x4 grid taking measurements of the bed (you do need to set the Z calibration first, as you know) vs. the shimming method where you go to 4 corners on your build plate where you stick a piece of paper or something under ...
1,947
<p>I have just ordered some filament samples (each sample is 10m x 1.75mm). How should I test the samples, given that there is only 10 metres of each to play with? Just printing a benchy will use about 4 metres. I would probably want to print a benchy, so that leaves 6 metres to play with. I am mostly interested in pro...
<p>Select an STL that exhibits characteristics you want to test (bridging, resistance to various pressures) and print it with each material. Preferably, run the <strong>same exact gcode</strong>, only changing temperatures, so that you get an apples-to-apples comparison.</p>
<p>Select an STL that exhibits characteristics you want to test (bridging, resistance to various pressures) and print it with each material. Preferably, run the <strong>same exact gcode</strong>, only changing temperatures, so that you get an apples-to-apples comparison.</p>
648
<p>Can you cast a <code>List&lt;int&gt;</code> to <code>List&lt;string&gt;</code> somehow?</p> <p>I know I could loop through and .ToString() the thing, but a cast would be awesome.</p> <p>I'm in C# 2.0 (so no <a href="http://en.wikipedia.org/wiki/Language_Integrated_Query" rel="noreferrer">LINQ</a>).</p>
<p>.NET 2.0 has the <code>ConvertAll</code> method where you can pass in a converter function:</p> <pre><code>List&lt;int&gt; l1 = new List&lt;int&gt;(new int[] { 1, 2, 3 } ); List&lt;string&gt; l2 = l1.ConvertAll&lt;string&gt;(delegate(int i) { return i.ToString(); }); </code></pre>
<p>You have to build a new list. The underlying bit representations of <code>List&lt;int&gt;</code> and <code>List&lt;string&gt;</code> are completely incompatible -- on a 64-bit platform, for instance, the individual members aren't even the same size.</p> <p>It is theoretically possible to treat a <code>List&lt;stri...
6,673
<p>What is classpath hell and is/was it really a problem for Java? </p>
<p>Classpath hell is an unfortunate consequence of dynamic linking of the kind carried out by Java.</p> <p>Your program is not a fixed entity but rather the exact set of classes loaded by a JVM in a particular instance. </p> <p>It is very possible to be in situations where the same command line on different platforms...
<p>There's lot of good stuff here <a href="http://mindprod.com/jgloss/classpath.html" rel="nofollow noreferrer">http://mindprod.com/jgloss/classpath.html</a> and <a href="http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html" rel="nofollow noreferrer">http://java.sun.com/javase/6/docs/technotes/tools...
48,799
<pre><code>void addNewNode (struct node *head, int n) { struct node* temp = (struct node*) malloc(sizeof(struct node)); temp -&gt; data = n; temp -&gt; link = head; head = temp; } </code></pre> <p>The code give above is the popularly wrong version of a function for adding a new node at the head of a li...
<p>The flaw is that you're relying on the caller to perform the last step of updating the head pointer to the list.</p> <p>If the caller neglects to do this, the compiler will not complain, and for all intents and purposes the list will appear to not have changed (and you'll have leaked the memory for a node).</p>
<p>I see no problems in any of the mentioned correct code. To change or not to change the head is a matter of design - and how to return modified list. Good interface is implemented in std::list&lt;> as an example where OOP is used, such approach is free of potential problems. head pointer is hidden and you can modif...
32,100
<p>I have been tasked with creating a program what will create take files in specified folders and create an installer based on those files.</p> <p>For example, having a folder for "All User's Desktop", "Start menu", "Application Data", and "Program Files"</p> <p>My boss wants to put the files into each folder, then ...
<p>Check out <a href="http://www.sparxsystems.com.au/products/ea/index.html" rel="nofollow noreferrer">Enterprise Architect</a>. It's not expensive and does a lot of things well.</p>
<p>I did check out Enterprise Architect on SpareX's web site but could not find any reference stating that it handles reverse engineering or code generation for VB6.</p>
47,970
<p>Is there a simple way to <strong>set the focus</strong> (input cursor) of a web page <strong>on the first input element</strong> (textbox, dropdownlist, ...) on loading the page without having to know the id of the element?</p> <p>I would like to implement it as a common script for all my pages/forms of my web appl...
<p>You can also try jQuery based method:</p> <pre><code>$(document).ready(function() { $('form:first *:input[type!=hidden]:first').focus(); }); </code></pre>
<p>With <code>AngularJS</code> :</p> <pre><code>angular.element('#Element')[0].focus(); </code></pre>
35,025
<p>I get the name of a variable from the script user as the first argument and I echo the value of said variable back to the console:</p> <pre><code>#!/bin/bash variablename=$1 echo "The value of $variablename is: " ${!variablename} </code></pre> <p>This works great!</p> <p>What I can't get to work is if I want to c...
<p>I had a flash all of a sudden, minutes after asking for help, and I think I have a solution:</p> <pre><code>#!/bin/bash variablename=$1 echo "The value of $variablename is: " ${!variablename} echo "I will now try to change the value into $2." eval "$variablename=$2" echo "Success! $variablename now has the value ${...
<p>Your solution will work but the variable will only have that value within your script. It won't affect the "calling" application's variable.</p> <p>When you run a script or program it spawns a new shell with a copy of the environment. This is by design so your script doesn't modify things like <code>PATH</code>.<...
48,748
<p>Searched stackoverflow for this and found no answer</p> <p>Coming from Ruby On Rails and Rspec, I need a tool like rspec (easier transition). Installed it through PEAR and tried to run it but it's not working (yet)</p> <p>Just wanna ask around if anyone's using it have the same problem, since it's not running at a...
<p>Development on PHPSpec has restarted since August 2010, after a 2 years break. The code base looks more stable now. I would give another try.</p> <p>The website is now located at www.phpspec.net</p> <p>You can find the documentation at <a href="http://www.phpspec.net/documentation" rel="noreferrer">http://www.phps...
<p>I also couldn't get it to run, but you can also use BDD with PHPUnit. Check the <a href="http://www.phpunit.de/manual/3.3/en/behaviour-driven-development.html" rel="nofollow noreferrer">documentation</a>:</p>
41,818
<p>I have my WCF service defined as follows [ServiceContract] public interface IService1 { [OperationContract] IList GetMyTable();</p> <pre><code> [OperationContract] void SendMyTable(List&lt;RatePositions&gt; ratePositions); [OperationContract] void SendString(string value);...
<p>The problem may be the message size problem with WCF. Look at both the clientconfig file that is created in your silverlight project as well as the web.config in your server project to make sure the size of the data you're returning is not too large. </p> <p>The 404 error is a catch all for any WCF failure. Can you...
<p>Because Silverlight doesn't like "List", but rather it will convert that (on the client) to "ObservableCollection". Try using ObservableCollection instead of List. That should solve your problem.</p>
42,079
<p>How do you even look at the web.config file? I don't know where to go to turn custom errors off...help! </p> <p>I tried command prompt and java script....can any one help me?</p>
<p>Keep in mind that IIS errors and asp.net errors are two separate things,</p> <p>For remote requests, by default IIS has custom errors enabled, what that means is if you are returning a none 200 response from your application, IIS will discard the body you were sending back and replace it with its own custom page. w...
<p>Run the Internet Information Services (IIS) Manager tool from the Administrative Tools (on the start menu if admin tools are enabled there). Open up the system, and right click on your web site. Select Properties. Choose the ASP.NET tab. Click on "Edit Configuration". Click the Custom Errors tab. Select <code>...
46,479
<p>I have a large, hi-def JavaScript-intensive image banner for a site I'm designing. What is everyone's opinion of using iframes so that you incur the load time only once? Is there a CSS alternative to the iframe?</p> <p>Feel free to <a href="http://csm.dev11.com" rel="nofollow noreferrer">preview the site</a>.</p>...
<blockquote> <p>I should also have mentioned that I would like the banner rotation to keep moving. When the visitor clicks on a link, the banner rotation starts over. It would be nice if the "animation" kept rotating, regardless of the page the user visits.Blockquote</p> </blockquote> <p>Well, in that case I would s...
<p>I find the main challenge with iFrame headers is resizing. Since the font in your header is of static size, I don't see a problem with using an iFrame. Although I'm not sure if it's really intensive enough to be worth it.</p>
3,797
<p>Our Test DB is suddenly missing rows. We want them back.</p> <p>Is there a way to sift through everything that has happened to the database today? Each SQL statement? I presume this kind of stuff is in the transaction log, but am not sure how to view it.</p> <p>Is there a way to undo delete operations?</p> <p>BTW...
<p>You can do this with some of <a href="http://www.red-gate.com" rel="nofollow noreferrer">Red Gate</a>'s tools, but it costs. Take a look at <a href="http://www.red-gate.com/products/SQL_Log_Rescue/index.htm" rel="nofollow noreferrer">SQL Log Rescue</a>.</p> <p>Otherwise, I'd be tempted to do a restore.</p>
<p>You can undo a transaction by using <code>Rollback</code> command in SQL Server. But, you need to know the transaction can be rolledback if the transaction were performed within <code>Begin</code> transaction. </p>
24,609
<p>I need to write an application that essentially functions like a <strong>week-view</strong> of a calendar, columns for the days and then rows for appointments. Where the height of the appointment box visually represents time.</p> <p>In my case, I just don't want the time of day as the vertical axis, I just want ho...
<p>I recommend you do use some existing toolkit, lib or js widget that does that. I find this lib may fit you: <a href="http://code.google.com/p/ftr-gwt-library/" rel="nofollow noreferrer">ftr-gwt-library</a>. I started to write a GWT component just for that, but I dont' have alot of time to finish it. The site is <a h...
<p>You're right - you shouldn't have to reinvent the wheel. </p> <p>Take a look at the <a href="http://www.telerik.com/products/aspnet-ajax/controls/calendar/overview.aspx" rel="nofollow noreferrer">Telerik Calendar control</a>. It offers template support: "A collection of dynamic templates can be used for achieving...
22,668