input
stringlengths
51
42.3k
output
stringlengths
18
55k
What is the best way to program against powershell's x64 vs. x86 variability <p>We have several scripts we use to install and configure the dependencies backing the systems we maintain. We run these anytime we establish a dev, test, demo, train, prod, etc. environment. We often find that we have to deal with x64 vs. x8...
<p>I run into this issue a lot with my configuration scripts. The basic approach I take is to </p> <ol> <li>Use several functions to test if I'm in a 64 bit environment (<a href="http://blogs.msdn.com/jaredpar/archive/2008/10/16/powershell-and-64-bit-windows-helper-functions.aspx">http://blogs.msdn.com/jaredpar/arch...
Changing font colour in Textboxes in IE which are disabled <p>I noticed that you can change the colour of text in textboxes which are disabled in Firefox applying a simple class but could not get a way to do it in IE 6/7. Does anyone out there have a elegant solution to achieve this.</p>
<blockquote> <p>I noticed that you can change the colour of text in textboxes which are disabled in Firefox</p> </blockquote> <p>I think what the question is trying to say is that this:</p> <pre><code>&lt;textarea disabled="disabled" style="color: red;"&gt;Hello&lt;/textarea&gt; </code></pre> <p>Results in grey te...
$.blockUI loading mask <p>i am using jQuery BlockUI Plugin (v2) to block and unblock while loading and when on clicking some button.but my problem is masking is working fine while loading page but it is not working when we click button,here is my code</p> <pre><code>$("input[name^=filtera]").click(function(){ $.block...
<p>You can rearrange the code a bit here to call it using <a href="http://api.jquery.com/ajaxStart/" rel="nofollow"><code>$.ajaxStart()</code></a> to go with your <a href="http://api.jquery.com/ajaxStop/" rel="nofollow"><code>$.ajaxStop()</code></a> like this:</p> <pre><code>$(document).ajaxStart(function() { $.block...
Best place to check for property values <p>Assuming you have a class Photo:</p> <pre><code>class Photo { public string Title {get; set;} public string FileExtension {get; set;} public void Save() { // Save to backing store here } } </code></pre> <p>Which would be the best place to check whether the v...
<p>If those are the only options, then in the property setter. <a href="http://en.wikipedia.org/wiki/Separation%5Fof%5Fconcerns" rel="nofollow">Separation of concerns</a> dictates that <code>Save</code> should do the saving, and not anything else.</p> <p>Also, that is the beauty of properties. They look like fields, b...
Mod rewrite issue <p>As many others I am having issues with doing some very simple mod_rewriting in apache.</p> <p>I have the following in my .htaccess:</p> <pre><code>Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^view/([0-9]+)/([0-9]+)$ view.php?advertId=$1&amp;publisherId=$2 [NC,QSA,L] </code>...
<p><a href="http://httpd.apache.org/docs/2.2/content-negotiation.html#multiviews"><code>MultiViews</code></a> might cause this behavior, that is trying to map the request to a siminar existing file before passing the request to mod_rewrite. Try to disable it:</p> <pre><code>Options -MultiViews </code></pre>
may COM server reallocate ([in, out] CACLSID * arg)? <p>With a COM interface method declared as this:</p> <pre><code>[ object, uuid(....), ] interface IFoo : IUnknown { HRESULT Foo([in, out] CACLSID * items); } </code></pre> <p>With regards to marshalling, is the server allowed to reallocate the counted array? (...
<p>I have not done COM for a very long time but is it even possible to allocate a new array? In that case should it not be <code>CACLSID ** items</code> ?</p>
How to initialize an NSObject's subclass on iPhone? <p>I want to write some methods in a class so that other classes can call these methods using <code>[instance methodName:Parameter]</code>.</p> <p>If the class is a subclass of <code>UIViewController</code>, I can use <code>initWithNibName</code> to initialize it. B...
<p>iphony is correct, but he or she doesn't say that you need to write the init method yourself. Your init method should generally look something like this:</p> <pre><code>- (id) init { if (self = [super init]) { myMember1 = 0; // do your own initialisation here myMember2 = 0; ...
How can I use C++ class in Python? <p>I have implemented a class in C++. I want to use it with Python. <strong>Please suggest step by step method and elaborate each step.</strong> Somthing like this...</p> <pre><code>class Test{ private: int n; public: Test(int k){ n=k; } ...
<p>Look into <a href="http://www.boost.org/doc/libs/1%5F38%5F0/libs/python/doc/index.html">Boost.Python</a>. It's a library to write python modules with C++.</p> <p>Also look into <a href="http://www.swig.org/">SWIG</a> which can also handle modules for other scripting languages. I've used it in the past to write modu...
how do I override a setter function at runtime in actionscript? <p>I have an AS class with setter and getter functions. I need to tweak one of this class's instances so that it's setter function will process the input before assigning it to the local variable.</p> <p>or, in a more elaborated way, what should I use ins...
<p>Why don't you pass the instance a processed input? </p> <pre><code>mc.legend = process(legend); </code></pre> <p>If this is not possible, you can modify the setter in MyClass and take an optional boolean to do processing.</p> <pre><code>function set legend(legend:Array, flag:bool = false):void{ _legen...
TFS Client APIs for creating workitem templates? <p>Of course, it is pretty possible to create work items, get a list of work items etc in TFS.</p> <p>In addition to this, we need to have the functionality of allowing our users to create their own work item templates, for various file types.</p> <p>Whether the TFS Cl...
<p>There is a method to get the (XML) definition: <a href="http://msdn.microsoft.com/en-gb/library/microsoft.teamfoundation.workitemtracking.client.workitemtype.export.aspx"><code>Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemType.Export</code></a></p> <p>And, <a href="http://msdn.microsoft.com/en-gb/librar...
How would you programmatically test a file for viruses? <p>I want to programmatically test a file for viruses.</p> <p>I'm aware of <a href="http://stackoverflow.com/questions/446999/is-there-any-anti-virus-product-which-provides-a-net-or-com-api">this thread</a>, which didn't get a satisfactory answer in my opinion, b...
<p>Assuming you wish to integrate with whatever antivirus is already present on the system rather than bundling your own, you should check out the way Firefox 3 does this.</p> <blockquote> <p>Bugs 103487 and 408153 - Inform anti-virus software when Firefox downloads an executable (using the Windows "<a href="h...
Can I selectively create a backup of Postgres database, with only certian tables? <p>Can I programatically(or whichever way works fine) create the backup of a database, with only the tables I want? I have around 100 tables in my database and I want only 10 tables backup(ofcourse all are interdependant). How can I achie...
<p>Of course. <a href="http://www.postgresql.org/docs/8.3/interactive/app-pgdump.html">pg_dump</a> lets you pass list of tables with parameter <code>-t</code> </p> <p>To clear some doubts. True, the <code>-t</code> parameter accepts only one pattern. But it's a <a href="http://www.postgresql.org/docs/8.3/interactive/a...
Hibernate: Identifier <p>When using Hibernate:</p> <p>Must I identify an id or composite id for each entity, What about if I want to use table without any primary key and without composite key ...</p> <p>Thanx in advance</p>
<p>A table without a key isn't a good relational model. I would not recommend it.</p> <p>Hibernate's best practices say you should have an id. Composite ids are workable for legacy apps, but not always the best idea.</p> <p>If you really must have a table without a key, I'd suggest that you shouldn't use Hibernate....
Multiple MySQL versions <p>We have a Linux server running Red Hat Enterprise 3 and MySQL 3.23. This server has a number of websites on it.</p> <p>We have a new website that we want to put on this server that uses MySQL 4/5. Is it possible to run the two versions of MySQL in parallel?</p> <p>If so, how?</p>
<p>Yes, it's possible, but tricky.</p> <p>Firstly, it's probably best not to use the RedHat supplied RPMS - they'll cause all sorts of dependency issues.</p> <p>In essence, all you need to do is to build the two versions, and install them into completely different directories.</p> <p>Then you need to make sure that ...
ExecuteXmlReader and null Resultset Throws TargetInvocationException <p>I'm calling a stored procedure on a SQL Server 2005 database which returns an XML resultset. Sometimes it will return an null resultset becuase there are not rows to return. When this happens athe ExecuteXmlReader method throws a TargetInvocationEx...
<p>I can think of 3 choices</p> <ol> <li>Modify <strong>stored procedure</strong> to return a dummy/empty value</li> <li>Modify <strong>code</strong> - catch exception and do nothing - or log error</li> <li>Use <strong>DataSet</strong> - You should get an empty DataSet so just check if DataSet is empty or not.</li> </...
Should I return an array or a collection from a function? <p>What's the preferred container type when returning multiple objects of the same type from a function? </p> <p>Is it against good practice to return a simple array (like MyType[]), or should you wrap it in some generic container (like ICollection&lt;MyType&gt...
<p>Eric Lippert has a good <a href="http://blogs.msdn.com/ericlippert/archive/2008/09/22/arrays-considered-somewhat-harmful.aspx" rel="nofollow">article</a> on this. In case you can't be bothered to read the entire article, the answer is: return the interface.</p>
Using a Website-specific ConnectionString with a DLL <p><strong>The Setup:</strong></p> <p>I have a DLL that uses a ConnectionString to connect to a SQL database. When I add the DLL to my website i have to add the connectionstring into my web.config in order for my DLL to function properly (this is by design). Once ...
<p>You have to look for the section from the general ASP.Net configuration settings, which can be retrieved through the WebConfigurationManager class, rather than looking for a connection string via ConfigurationManager.ConnectionStrings.</p> <pre><code> // Get the connectionStrings section. ConnectionStringsSectio...
How do you fight design complexity? <p>I often find myself fighting overengineering -- the person in charge of designing the software comes up with an architecture that's, way, way overcomplicated.</p> <p>It's all fine and dandy to have all the esoteric features that users will never know about and get that sense of a...
<p>Tooth and nail, and sometimes you lose. The problem is that it's always easy to be tempted to build something <em>cool</em>.</p> <blockquote> <p><em>Why build something simple and efficient when it can be complicated and wonderful?</em></p> </blockquote> <p>Try to remind people of the XP rule of building the si...
Multi-language build tools <p>I have a build process for a large enterprise system comprising several dozen separate EXEs and DLLs. These use multiple languages, C, C++, Fortran, Python, Awk and a couple more. The build scripts are 4DOS batch processes which evolved over 4 decades. They are large and unwieldy and need ...
<p>For example <a href="http://ant.apache.org/" rel="nofollow">Apache Ant</a></p>
Need help understanding jQuery .val() function <pre><code>alert("data going into $hidden: " + selected.data[1]); hidden.val(selected.data[1]); alert("data now in $hidden: " + $hidden.val()); </code></pre> <p>What would be a reason that $hidden.val() in the last line above would return undefined? I have verified tha...
<p>Thanks Paolo Bergantino. I discovered that I wasn't passing the initial hidden in with a # in front of the hidden field id, so $hidden was never getting set properly. It was difficult for me to debug because the the autocomplete is inside an ascx control as an embedded resource. Once I ensured that the value of h...
madExcept + UPX <p>I'm having problems using madExcept + UPX on Delphi 2007. Whenever I open the compressed application, a Windows exception dialog appears code 0xc0000005. Anyone has the solution for this?</p> <p>Thanks!</p>
<p>Stack tracing on exceptions etc. requires mapping in-memory code addresses to virtual addresses as stored in the executable, so that they can be correlated with either a .map file or debug info which indicates the function or source file and line. Normally, the mapping is straight-forward and relatively linear.</p> ...
Making a WPF application retain focus at all times <p>I've got an issue with a WPF application that I'm writing. The app needs to be able to keep focus at all times. The computer it's running on is a highly specialized machine with the only purpose of running this application. </p> <p>There is no keyboard connected to...
<p>Look at the source of <a href="http://www.codeplex.com/babysmash" rel="nofollow">BabySmash</a>. It is specifically designed to keep focus even under quite bizar circumstances. (It is a program designed to run at full screen and let babys smash on a keyboard - so quite some focus went into capturing all kinds of weir...
GUI frontend for cURL for testing an API <p>I'm (manually) testing a RESTful API that makes full use of GET/POST/PUT/DELETE methods. Rather than using cURL on the command line to quickly test different input options, it would be handy if there were a windows GUI application to make this easier. Does anything like that ...
<p>Use <a href="https://addons.mozilla.org/en-US/firefox/addon/2691">Poster</a> with <a href="http://www.mozilla.com/firefox/">Firefox</a>.</p>
Legacy ASP.NET 1.1 with jQuery integration problem <p>I am working on a legacy web application written in VB.NET for ASP.NET 1.1. One particular page has a form with a number of fields. In response to a drop down box changing value, I am clearing a number of fields, resetting a number of drop down boxes to the first ...
<p>why do you need to disable those fields? Disabling controls can make them not post values to the server ... at least that is what happens when an asp.net control is disabled server side.</p> <p><strong>Update 1:</strong> couldn't take having the doubt if it was only server side, so I looked it up :) <a href="http:/...
Security Warning message displayed on some pages <p>I am using Jboss application server. I have implemented the whole website on ssl (https), the site is working fine on internet explorer browser but the site displays the below information on Mozilla/Konqueror browser but only on a particular page.</p> <p><strong>Secu...
<p>Check for images or other resources that are being requested from non-SSL locations. This is usually the problem.</p>
asp:Button inside asp:hyperlink does not navigate to page in internet explorer <p>I have an asp:button which is inside an asp:hyperlink. When you click the button in firefox, it goes to the correct url specified by the asp:hyperlink, but if you click the button in internet explorer, it stays on the same page. I am ju...
<p>What you did is not very correct.</p> <p>Just add the button and in its click handler do:</p> <pre><code>Response.Redirect("Page2.aspx"); </code></pre> <p>Alternatively you can write a line of javascript:</p> <pre><code>&lt;input type="button" value="Text" onclick="location='Page2.aspx'" /&gt; </code></pre>
What do you keep in your Perl toolbox? <p>I am a Perl developer and have gravitated towards a specific suite of modules that I use for almost everything. I primarily build GIS and database oriented web applications for reporting and data entry and the like.</p> <p>I'm curious what groups of modules other Perl devs ha...
<p>Checking over recent stuff, here's what I see most often: </p> <ul> <li><a href="http://search.cpan.org/perldoc?Getopt::Long" rel="nofollow">Getopt::Long</a> and <a href="http://search.cpan.org/perldoc?Pod::Usage" rel="nofollow">Pod::Usage</a> make options and man pages a breeze</li> <li><a href="http://search.cpan...
Left Outer Join and Exists in Linq To SQL C# .NET 3.5 <p>I'm stuck on translating a left outer join from LINQToSQL that returns unique parent rows.</p> <p>I have 2 tables (Project, Project_Notes, and it's a 1-many relationship linked by Project_ID). I am doing a keyword search on multiple columns on the 2 table and I ...
<blockquote> <p>it seems to be returning multiple Project rows</p> </blockquote> <p>Yes, that's how join works. If a project has 5 matching notes, it show up 5 times.</p> <p><hr /></p> <p>What if the problem is - "Join" is the wrong idiom!</p> <p>You want to filter the projects to those whose notes contain certa...
Inline member functions in C++ <p>ISO C++ says that the inline definition of member function in C++ is the same as declaring it with inline. This means that the function will be defined in every compilation unit the member function is used. However, if the function call cannot be inlined for whatever reason, the functi...
<p>Just my two cents. This is not about virtual function in particular, but about inline and member-functions generally. Maybe it is useful.</p> <h3>C++</h3> <p>As far as Standard C++ is concerned, a inline function <em>must</em> be defined in every translation unit in which it is used. And an non-static inline funct...
Finding a Thinkmap-like engine <p>I try to find a Thinkmap-like engine on flash to visualize structured data. Does anybody know any free engines?</p>
<p>Your best bet is <a href="http://flare.prefuse.org/">flare</a>.</p>
Submitting HTML Forms with Slider as input (WebFX) <p>How can I submit the value of <a href="http://webfx.eae.net/dhtml/slider/slider.html" rel="nofollow">this slider</a> to a CGI application (like you would a check box)? Not sure if the input tag for the slider is messing something up?</p> <pre><code>&lt;div class="s...
<p>If I were you, I'd try tweaking the <code>&lt;input&gt;</code> tag's <code>type</code> attribute, setting it to <code>text</code> or <code>hidden</code>.</p> <p>(I don't know enough about the framework/environment you're using to say for sure.)</p>
Reading a formatted array into a variable from a file <p>I am trying to read a formatted 2D array from a file on disk into a variable. I have the write operation, which is rather simple, but am stuck on reading the same file. Could someone point me to a sample/writeup on how to do this? The net seems saturated, but ...
<p>I've actually found that the physical documentation that comes with the compiler is generally the most readable and most informative for Fortran compilers. Of course, that's not an option if you're using g95 or something like that.</p> <p>Here's a <a href="http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/chap05/for...
How to make use of Tags property of an xml node to get its information and attributes? <p>How would I make use of the Tags property of a node, so that I can get the attributes of an xml node?</p> <p>I have to display an xml tree in a Windows Form. When I click on any node, its attributes should get displayed on a list...
<p>When adding the TreeNode class, your code would look like this:</p> <pre><code>// Create the node. TreeNode newNode = new TreeNode(); // Configure. ... // Set the tag property to hold the XML element. XmlElement currentElement = ...; newNode.Tag = currentElement; // Add to the tree view. ... </code></pre> <p>Th...
Using Linq to map facebook profile with my user info <p>After reading a book on LINQ I'm thinking about re-writing a mapper class that I wrote in c# to use LINQ. I'm wondering if anyone can give me a hand. Note: its a bit confusing, but the User object is the local user and user (lowercase) is the object generated fr...
<p>Okay, it's not clear exactly what <code>IMapper</code> has in it, but I'd suggest a few things, some of which may not be feasible due to other restrictions. I've written this out pretty much as I've thought about it - I think it helps to see the train of thought in action, as that'll make it easier for you to do the...
PHP File Operations list <p>I'm looking for a list of each file operation. I Googled on <a href="http://www.google.se/search?q=Php+File+Operations" rel="nofollow">http://www.google.se/search?q=Php+File+Operations</a>, but didn't found anything. </p> <p>Do you know a where I could find a list of PHP file operations?</p...
<p>Your question needs clarifying, but try the <a href="http://uk3.php.net/ref.filesystem" rel="nofollow">PHP Filesystem Functions</a> section in the PHP manual. (All I did was search for 'PHP file functions' on Google).</p> <p>If what you're looking for is the <strong>file open <em>modes</em></strong> (such as "r", ...
Using GetSaveFileName. I specify OFN_EXPLORER flag, but always get old dialog appearance unless I avoid using both hook and template <p>Using GetSaveFileName. I specify the OFN_EXPLORER flag, but I always get old dialog appearance unless I avoid using both hook and template. (lpfnHook and lpfnTemplate (and their respe...
<p>If you use both <code>OFN_EXPLORER</code> and <code>OFN_ENABLEHOOK</code> in Windows Vista and 7, you will get the dialog boxes with XP style. If you remove <code>OFN_EXPLORER</code> you will get the older Win2k style. If you use <code>OFN_ENABLEHOOK</code> (or <code>OFN_ENABLETEMPLATE</code>) then the system will ...
Attaching chained methods to collections of elements in JavaScript <p>This is—at least at the moment—purely experimentation, but I'm curious: is there a way to attach methods (via prototyping) to collections of elements? I've tested the following code:</p> <pre><code>&lt;div&gt;a&lt;/div&gt; &lt;div&gt;b&lt;/div&g...
<p>I've cooked up what I suppose could stay as a viable solution; is there anything fundamentally bad about using this method to chain-modify a collection of elements?</p> <pre><code>&lt;script&gt; _ = function() { for (x = 0; x &lt; arguments[0].length; x++) { for (y = 0; y &lt; arguments[1].length; y+...
Serialize Flex Objects to Save/Restore Application State <p>Is it possible to serialize a hierarchy of objects in Flex, send the binary data to a URL for storage/retrieval on/from a server, and deserialize the data to restore the objects' original state?</p> <p>I know it's possible to convert the objects into an XML f...
<p>Take a look at <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/ByteArray.html#writeObject%28%29" rel="nofollow">ByteArray.writeObject()</a>. which saves the passed object in AMF format into the byte array. I have not used this function too much, I don't exactly know what kind of object...
WCF Test Client error: Failed to Invoke the service <p>I'm getting an error when trying to use the WCF Test Client with my WCF service. Here is the service code:</p> <pre><code>[ServiceContract] public interface IEmployeeService { [OperationContract(Name = "GetEmployee")] [WebGet(RequestFormat = WebMessageForm...
<p>Please ignore my earlier answer. I don't think the problem is at the client-side config.</p> <p>See <a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/deabd25b-a219-4e95-9826-d40dc2f75543/">WCF Test Client and WebHttpBinding</a>.</p> <blockquote> <p>This is a limitation of the web programming mo...
Software Bandwidth/Database Growth Formulas <p>Are there any industry standard formulas or rules of thumb for determining:</p> <ol> <li>Application bandwidth usage/requirements</li> <li>Database growth requirements</li> </ol> <p>I have recently started managing a new .NET 3.5/SQL Server project and would like to take...
<p>I am not an SQL Server expert, but in general, for database Sizing, the best way to go forward is to understand the schema little bit. For example, are there partitions present in the database ? Are there lot of indexes etc. Now Multiply number of records coming to the database in each transaction with the frequency...
Switch from Microsofts STL to STLport <p>I'm using quite much STL in performance critical C++ code under windows. One possible "cheap" way to get some extra performance would be to change to a faster STL library.</p> <p>According to this <a href="http://garrys-brain.blogspot.com/2007/01/development-stlport-versus-micr...
<p>I haven't compared the performance of STLPort to MSCVC but I'd be surprised if there were a <em>significant</em> difference. (In release mode of course - debug builds are likely to be quite different.) Unfortunately the link you provided - and any other comparison I've seen - is too light on details to be useful.<...
"Padding is invalid and cannot be removed" using AesManaged <p>I'm trying to get simple encryption/decryption working with AesManaged, but I keep getting an exception when trying to close the decryption stream. The string here gets encrypted and decrypted correctly, and then I get the CryptographicException "Padding w...
<p>The trick is to use <code>MemoryStream.ToArray()</code>. I also changed your code so that it uses the <code>CryptoStream</code> to Write, in both encrypting and decrypting. And you don't need to call <code>CryptoStream.FlushFinalBlock()</code> explicitly, because you have it in a <code>using()</code> statement, and...
how to parse hex or decimal int in Python <p>I have a string that can be a hex number prefixed with "0x" or a decimal number without a special prefix except for possibly a minus sign. "0x123" is in base 16 and "-298" is in base 10.</p> <p>How do I convert this to an int or long in Python?</p> <p>I don't want to use e...
<pre><code>int("0x123", 0) </code></pre> <p>(why doesn't <code>int("0x123")</code> do that?)</p>
Good, secure encryption <p>Hi im thinking about developing a sort of File Transfer program and was wondering if i want as good encryption that i can get what should i use?</p> <p>ill be developing this with c# so i got access to the .net lib :P having a certificate with me on my usb to access the server is no problem ...
<p>The simplest built in way with the .NET Framework is probably to use the <a href="http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx" rel="nofollow">SslStream </a> class which is built in. Example of usage <a href="http://geekswithblogs.net/luskan/archive/2007/10/01/115758.aspx" rel="nofollow...
Detect web user's language, e.g. in JavaScript? <p>I'm thinking of doing multiple language versions of my website (e.g. English and German). I'd like to offer a reasonable default based on the user's language.</p> <p>What's the easiest and least obstrusive way to do that?</p> <p>EDIT: The ideal solution would be not ...
<p>The easiest way would be to parse the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4" rel="nofollow"><code>Accept-Language</code> header field</a>.</p>
Flash Encoding (FLV): What are the prefered bitrates? <p>I inherited a project that is sending videos off to a remote encoder to encode into FLVs.</p> <p>Today, I noticed that we are asking them to encode at 1024kbps To me, this seems extremely high. </p> <p>What is everyone else using? What is YouTube using for "...
<p>Typically somewhere between 400-600kbps is average for 'standard' quality video. Higher quality video is often 800-1200kbps, but for many people this is too high a bit rate to maintain, so you shouldn't really have something this high as your only rate unless you know your target audience will have fast connections....
Global keyboard capture in C# application <p>I want to capture a keyboard shortcut in my application and trigger a dialog to appear if the user presses a keyboard combo even outside of the app. Similar to Google Desktop Search's Ctrl, Ctrl to bring up the search dialog.</p> <p>I have tried using some keyboard hook mod...
<p>Stephen Toub <a href="http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx" rel="nofollow">wrote a great article</a> on implementing global keyboard hooks in C#:</p> <pre><code>using System; using System.Diagnostics; using System.Windows.Forms; using System.Runtime.InteropServices; class InterceptKeys { p...
ADO.net without writing SQL (esp. WHERE) <p>I have this idea that using SQL VIEWS to abstract simple database computations (such as a count on a relation) is sufficient, and you don't need procedures (== procedural code)</p> <p>A simple sql <strong><em>view</em></strong> + a <strong><em>where</em></strong> clause >> a...
<p><a href="http://fluentado.codeplex.com/" rel="nofollow">FluentADO</a></p>
Using SVG to create separate images files <p>I've previously processed XSLT to output single HTML files that were supposed to be viewed in a browser.</p> <p>Now I was hoping if someone could outline would it be possible to use XML data and XSLT to create separate image files auto magically?</p>
<p>If your XSLT processor supports EXSLT, the <a href="http://exslt.org/exsl/elements/document/index.html" rel="nofollow">exsl:document</a> element will allow you to create multiple output files from a single input file.</p> <p>AFAIK, only <a href="http://xmlsoft.org/XSLT/" rel="nofollow">libxslt</a>-based processors ...
How to deny Assert with CAS? <p>In this code, I'd like the ReadFileSystem method to be forbidden to Assert a permission on the filesystem.</p> <p>I expected this will throw at fileIo.Assert(), but it doesn't. Why?</p> <pre><code>using System.Security.Permissions; static void Main(string[] args) { var fileIo = new...
<p>The subsequent Assert negates the effects of the Deny.</p> <p>The ability to assert FileIOPermission mainly depends on whether your assembly is trusted. It is not affected by a previous Deny of FileIOPermission. It turns out that it is also not affected by the previous Deny of the Assertion SecurityPermission. <str...
Getting at unmanaged C++ functions from C# <p>I have some ANSI standard C code which is authoritative. What that means is that although I have the source, I can not translate to another language nor modify calling arguments, as those actions would invalidate the authority. There are over 150 functions.</p> <p>I can ...
<p>Sample C/C++ implementation:</p> <pre><code>extern "C" __declspec(dllexport) double SomeFunction(double a, double vec[3], double mat[3][3]) { double sum = a; for (int ix = 0; ix &lt; 3; ++ix) { sum += vec[ix]; for (int iy = 0; iy &lt; 3; ++iy) { sum += mat[ix][iy]; } } return sum; } </code...
Converting/accessing QueryString values in ASP.NET <p>I'm curious what everyone does for handling/abstracting the QueryString in ASP.NET. In some of our web apps I see a lot of this all over the site:</p> <pre><code>int val = 0; if(Request.QueryString["someKey"] != null) { val = Convert.ToInt32(Request.QueryString["s...
<p>I tend to like the idea of abstracting them as properties. For example:</p> <pre><code> public int age { get { if (Request.QueryString["Age"] == null) return 0; else return int.Parse(Request.QueryString["Age"]); ...
Sending login information via AJAX <p>Im using jQuery validate plugin and every form has multiple validation levels.</p> <ol> <li>level is by validate plugin</li> <li>level is: <ul> <li>data is submitted to site</li> <li>I get a reply <ul> <li>if everything is ok -> JS redirects to url</li> <li>if there is an error, i...
<blockquote> <p>is it safe to send login info via ajax</p> </blockquote> <p>You do use HTTPS, do you? If you do it's as safe as form submit.</p>
Read file access/modification timestamp <p>What win32 API C functions can I use to read the modification/access/created dates of a file?</p>
<p>Use the <a href="http://msdn.microsoft.com/en-us/library/ms724320%28VS.85%29.aspx" rel="nofollow">GetFileTime</a> function. You need to open the file to use this function.</p> <p>Also, the appropriately named <a href="http://msdn.microsoft.com/en-us/library/ms724933%28VS.85%29.aspx" rel="nofollow">SetFileTime</a> f...
Is there a way to put inner controls inside a ASP.NET Custom Control? <p>I want to do something like (Updated example):</p> <pre><code>&lt;uc:Tabs&gt; &lt;Tab Name="A handy tab"&gt; &lt;Node Url="~/Default.aspx" /&gt; &lt;Node Url="~/Node2.aspx" /&gt; &lt;/Tab&gt; &lt;Tab Name="Another handy tab"&g...
<p>Use the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.parsechildrenattribute.aspx">ParseChildrenAttribute</a> and <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.persistchildrenattribute.aspx">PersistChildrenAttribute</a> attributes:</p> <pre><code>[ParseChildren(false)] [PersistChil...
Uploading multiple images + text fields in ASP.NET MVC <p>I'm very new to ASP.net MVC, so please be as descriptive as possible in your answer :)</p> <p>Let me simplify what I'm trying to do. Imagine I have a form where you want to enter some information about a car. The fields might be: Make, Model, Year, Image1, Im...
<p>In your controller you can access the uploaded files as:</p> <pre><code> if(Request.Files.Count &gt; 0 &amp;&amp; Request.Files[0].ContentLength &gt; 0) { HttpPostedFileBase postFile = Request.Files.Get(0); string filename = GenerateUniqueFileName(postFile.FileName); postFile.SaveAs(serve...
XDocument.Descendants() not returning any elements <p>I'm trying to bind a Silverlight DataGrid to the results of a WCF service call. I was not seeing the data displayed in the grid, so when I ran through the debugger, I notice that XDocument.Descendants() was not returning any elements even when I was passing in a val...
<p>The string parameter passed to Descendents is actually implicitly converted to an XName object. An XName represents a fully qualified element name.</p> <p>The document defines a namespace "i", therefore I believe you need to use the fully qualified name to access Employee. ie. i:Employee, where the prefix "i: act...
Select from MySQL records that sums <p>I know there are a few post out here about selecting records until a certain number is met from the sum of one field but there isn't any that suits me. I'm using PHP and MySQL.</p> <p>I have a table named quantity. Inside there are records of product name, product price and produ...
<p><strong>Option 1: Use program logic instead of a query:</strong></p> <p>There is nothing wrong with using the programming layer to do more advanced database interactions. SQL is not an answer to everything... (Also consider a stored procedure).</p> <pre><code>enough = 35 running_total = 0 START TRANSACTION while...
Subdomain mapping to another external subdomain <p>I'm trying to map help.domain1.com to help.domain2.com. I've seen this on UserVoice. They let you map something.yourdomain.com to something.uservoice.com.</p> <p>On domain1.com I've set up a CNAME to help.domain2.com.</p> <p>It works fine but when I open help.domain1...
<p>I was facing the same problem for the last couple of days, and just found the solution...</p> <p>In /etc/apache2/site-available/default, I had two virtual hosts, first one was for my domain, and the second one was for my sub domain. All I had to do was reverse the order of the virtual host blocks, placing the sub d...
Flex: Passing MXML file as XML Parameter <p>Is it Possible to pass MXML it self as parameter(XML param) from external application and load in Flash Player dynamically to create page. For e.g</p> <p>passing xml = &lt;mx:canvas&gt;&lt;mx:label text="hello" /&gt;&lt;/mx:canvas&gt; to Flex and flex should create canvas wi...
<p>MXML code needs to be compiled down to ActionScript before Flash Player can do anything with it. MXML is not interpreted by Flash Player at runtime.</p>
Interesting test of Javascript RegExp <p>I wrote a Javascript RegExp test to detect date string format, I added an redundant "g" flag by mistake and found something interesting.</p> <pre class="lang-js prettyprint-override"><code>var s = "2009/03/10"; var regex=/^\d{4}[/]\d{2}[/]\d{2}$/g; alert(regex.test(s)); alert(r...
<p>When you use a global flag on a JS RegExp the "test" and "exec" methods each halt at the first match but keep a pointer to where they stopped searching in the string. That pointer can be inspected on the <code>lastIndex</code> property. When you call "test" or "exec" again it begins searching for a match starting ...
Can I do STI and still use polymorphic path helpers? <p>I am using Single Table Inheritance and have comments on all the subclasses. I am only using 1 controller for all the different STI types. When the form_for helper generates a URL for a subtype it tries to use a helper for the subtype, but I want it to use the hel...
<p>Yep, just use <code>AR::Base#becomes</code>.</p> <p>Say your base class is <code>Account</code>, which is subclassed to <code>GuestAccount</code> and <code>LoginAccount</code>.</p> <pre><code>@account.is_a? LoginAccount? #=&gt; true </code></pre> <p>Then you can just do a</p> <pre><code>form_for [@account.become...
Nant, Booc, and x64 <p>I have a .NET project that's always been built/run by/on 32 bit machines. I got a new a 64 bit computer and am trying to tackle the task of getting it working there. The build script is in nant, and at one point we compile some boo code using the nant task. The boo code references our core DLL, ...
<p>The problem is dependencies on third-party DLL's that require 32 bit mode, which is possible even if they don't have corflags set.</p>
How to get SSRS Data Source credentials and open an SQL Connection in .NET <p>I am using an ASP.Net and C# front end to run some reports. I want to open an SQL Connection to the data source used by the report.</p> <p>When the report uses integrated security it is easy enough to create a connection, however I want to c...
<p>I really don't think it's possible, as this would pretty much constitute a security hole. I know this isn't the answer you are looking for, but I would parameterise the location of your reports (i.e. the IP/name of your MSRS server) and store them in your web.config along with a matching SQL instance. While it's not...
Setting a cell's format using Excel 2007 Interop and C# <p>I'm using the office 2007 interop assemblies to create some excel spreadsheets.</p> <p>There are plenty of questions on here about getting started and MSDN contains heaps of articles, like <a href="http://msdn.microsoft.com/en-us/library/bb491102.aspx" rel="no...
<p>VBA based code. However same should work with c# (ignore the syntax).</p> <pre> <code> cells(1,1).Value = 39875 cells(1,1).NumberFormat = "dd-mmm-yyyy" </code> </pre> <p>The best way to learn Excel Object Model is to create a macro of actions you wish to take, look at the code &amp; modify the parts which require ...
NTFS Alternate Data Streams - .NET <p>How would I create/ delete/ read/ write/ NTFS alternate data streams from .NET?</p> <p>If there is no native .NET support, which Win32 API's would I use? Also, how would I use them, as I don't think this is documented?</p>
<p>Here is a version for C#</p> <pre><code>using System.Runtime.InteropServices; class Program { static void Main(string[] args) { var mainStream = NativeMethods.CreateFileW( "testfile", NativeConstants.GENERIC_WRITE, NativeConstants.FILE_SHARE_WRITE, In...
How to display a customized code in C# & DevExexpress TextEditor with mask <p>I am trying to display a code like ABC/DEF/00012 or ABC/EDF/01234 or ABC/DEF/00009</p> <p>I use RegEx mask \w{3}/\w{3}/?????</p> <p>The question mark is hard part that I could not figure it out.</p> <p>Basically, I try to display the code ...
<p>Seems that you're trying to match 5 digits at the end:</p> <p>\w{3}/\w{3}/\d{5}</p>
how to run the batch file from any folder <pre><code>cd ../../jobs set CLASSPATH=.;../xyz.jar;../mysql-connector-java-5.1.6-bin.jar java folser.folder1 ../Files/MySQL.xml cd .. </code></pre> <p>I need to run the batch file from any directory. I have set the paths for java. Can anybody help me?</p>
<p>Under *nix (e.g. Linux):</p> <pre><code>cd "`dirname \"$0\"`" # your current directoy is now the script's directory cd ../../jobs set CLASSPATH=.:../xyz.jar:../mysql-connector-java-5.1.6-bin.jar java folder.folder1 ../Files/MySQL.xml cd .. # when the script terminates, you are automatically # back to the original ...
Socket Programming <p>Am trying to create a server application in c#.In the code am using the TcpListener class.</p> <pre> <code> TcpListener t = new TcpListener(5555); t.Start(); </code> </pre> <p>However it is providing an error saying: Invalid token '(' in class, struct, or interface member declaration. <...
<p>Works fine for me. You need to add following line in your code.</p> <p>using System.Net.Sockets;</p>
Non-collapsing but still (line-)breakable space in HTML? <p>What can I use in HTML if I want to have whitespace in the middle of the line that looks like three spaces, but can still be broken if the line gets too long?</p> <p>Regular whitespace gets collapsed (a run of spaces looks the same as a single space), and at ...
<p>I actually have the exact answer you’re looking for. I searched everywhere for this answer and nothing anyone suggested worked perfectly. So, I thought up a solution and tried it and was floored that it worked without any flaw!</p> <p><a href="http://stackoverflow.com/a/605470/578288">Garrow</a> was actually ri...
Working over networks <p>I am using a aix box over a network. I am using putty to work on the box. The problem is its too slow,But we do have a high speed network.</p> <p>Is there any terminal program other than putty that can help me work comfortably..by doing some buffering or other mechanism by which i wont feel l...
<p>PuTTY is perfectly fast - I've never had any problems with it.</p> <p>Have you established where the bottleneck is? What's the exact setup of the network between your client and the server? Is perhaps the AIX server too heavily loaded?</p>
How can one compute the optimal parameters to a start-step-stop coding scheme? <p>A start-step-stop code is a data compression technique that is used to compress number that are relatively small.</p> <p>The code works as follows: It has three parameters, start, step and stop. Start determines the amount of bits used t...
<p>These "start-step-stop" codes looks like a different way of calling <a href="http://en.wikipedia.org/wiki/Huffman%5Fcoding" rel="nofollow">Huffman codes</a>. See the <a href="http://en.wikipedia.org/wiki/Huffman%5Fcoding#Basic%5Ftechnique" rel="nofollow">basic technique</a> for an outline of the pseudo-code for calc...
PHP Parse error <pre><code>&lt;?php $this_is_my_array = array("John","Johan"); for(int i = 5; i &lt; 5; i++){ echo "$this_is_my_array[i] "; } //Adding name Markus array_push($this_is_my_array,"Markus"); for(int i = 5; i &lt; 5; i++){ echo "$this_is_my_array[i] "; } //Removing name from array $this_is_my_array2= array_p...
<p>For starters, your variable i should be $i, with a dollar sign. That's the bulk of your error. But there's a few other problems. Try this.</p> <pre><code>echo("start"); $this_is_my_array = array("John","Johan"); for($i = 5; $i &lt; 5; $i++){ echo $this_is_my_array[$i]; } //Adding name Markus array_push($this_...
Multiplying 23 bit datatypes in a system with no long long <p>I am trying to implement floating point operations in a microcontroller and so far I have had ample success.</p> <p>The problem lies in the way I do multiplication in my computer and it works fine:</p> <pre><code>unsigned long long gig,mm1,mm2; unsigned l...
<p>Apologizes for the short answer, I hope that someone else will take the time to write a fuller explanation, but basically you do exactly as when you multiply two big numbers by hand on a paper! It's just that instead of working with base 10, you work in base 256. That is, treat your numbers as a byte vectors, and do...
Web service cast exception why? <pre><code>Error Cannot implicitly convert type 'string[]' to 'System.Collections.Generic.List&lt;string&gt;' </code></pre> <p>The above error is caused when I call a method to a web service</p> <pre><code>List&lt;string&gt; bob = myService.GetAllList(); </code></pre> <p>Where: GetAl...
<p>you need to do this:</p> <pre><code>List&lt;string&gt; bob = new List&lt;string&gt;(myService.GetAllList()); </code></pre> <p>An overload for the constructor of a generic list takes an IEnumerable of the specified type to initialize the array. You can not, like the exception states, implicitly cast it staright to...
Indy Write Buffering / Efficient TCP communication <p>I know, I'm asking a lot of questions...but as a new delphi developer I keep falling over all these questions :)</p> <p>This one deals with TCP communication using indy 10. To make communication efficient, I code a client operation request as a single byte (in most...
<p>Write buffering is disabled by default. You can check write buffering to see if it's active in your code by testing the fConnection.IOHandler.WriteBufferingActive property.</p> <p>As far as the best way to send an integer... 'it depends' on your protocol and overall goals. Specifically, use FConnection.IOHandler....
How to select html nodes by ID with jquery when the id contains a dot? <p>If my html looked like this:</p> <pre><code>&lt;td class="controlCell"&gt; &lt;input class="inputText" id="SearchBag.CompanyName" name="SearchBag.CompanyName" type="text" value="" /&gt; &lt;/td&gt; </code></pre> <p>How could I select #Searc...
<p>@Tomalak in comments:</p> <blockquote> <p>since ID selectors must be preceded by a hash #, there should be no ambiguity here</p> </blockquote> <p>“#id.class” is a valid selector that requires both an id and a separate class to match; it's valid and not always totally redundant.</p> <p>The correct way to sel...
Entity framework and VARBINARY <p>I’m using the .NET entity framework and I’ve got one entity containing a varbinary. Is there an easy way to get the size of the varbinary in the codebehind, efter it’s been retrieved from the database?</p> <p>I’m thinking there might be some way to get the size directly from t...
<p>A varbinary translates to a byte[] field in the entity framework, which means you can check the Length property of the array:</p> <pre><code>int fieldSize = entity.MyVarBinaryField.Length; </code></pre> <p>As mentioned by <a href="http://stackoverflow.com/a/5409481/137471">tster</a>: In a LINQ to Entities query, y...
Reasons for why a WinForms label does not want to be transparent? <p>Why can't I set the BackColor of a Label to Transparent? I have done it before, but now it just don't want to...</p> <p>I created a new UserControl, added a progressbar and a label to it. When I set the BackColor of the label to transparent it is sti...
<p>Add a new class to your project and post the code shown below. Build. Drop the new control from the top of the toolbox onto your form.</p> <pre><code>using System; using System.Windows.Forms; public class TransparentLabel : Label { public TransparentLabel() { this.SetStyle(ControlStyles.Opaque, true); ...
Command line video editing tools <p>I'm looking for (linux) command line tools that can help with video editing. I am mostly interested in:</p> <ul> <li>Cutting</li> <li>Transitions</li> <li>Effects</li> </ul> <p>Any pointers would be appreciated (I know ffmpeg can do basic cutting, but not much beyond that afaik).</...
<p>Two tools I use are <a href="http://www.transcoding.org/cgi-bin/transcode" rel="nofollow">transcode</a> and <a href="http://en.wikipedia.org/wiki/MEncoder" rel="nofollow">mencoder</a>.</p> <blockquote> <p>Transcode is a suite of command line utilities for transcoding video and audio codecs, and for converting...
What is the current best validation framework for asp.net apps? <p>To make sure its a DRY approach all validation logic should of course go in the business logic (model).</p> <ul> <li>How are validation messages presented to views, should be able to localize error messages</li> <li>Can you generate javascript from the...
<p><a href="http://msdn.microsoft.com/en-us/library/cc309509.aspx" rel="nofollow">Validation Application Block</a></p> <p>from Microsoft is one alternative but I have no experience with it</p>
Saving element position and size (JQuery ui resizable and draggable) <p>I'm new to jquery and even javascript. I'm trying to create a system where you can edit very simple, static page by logging in and just dragging and resizing divs. The system works to the point where you get to edit the site, but the problem is how...
<p>You could store the variables in a cookie on the user's machine (jQuery doesn't have native cookie support, but <a href="http://plugins.jquery.com/project/cookie" rel="nofollow">this plugin</a> gives it to you).</p> <p>However, that requires Javascripw, which you mention that you don't want to require. However, if ...
Ruby? How to ignore newlines in cut and pasted user input? <p>I've written a little Ruby script that requires some user input. I anticipate that users might be a little lazy at some point during the data entry where long entries are required and that they might cut and paste from another document containing newlines.<...
<p>Here's what the author uses in his example: (from highline-1.5.0/examples)</p> <pre><code>#!/usr/local/bin/ruby -w # asking_for_arrays.rb # # Created by James Edward Gray II on 2005-07-05. # Copyright 2005 Gray Productions. All rights reserved. require "rubygems" require "highline/import" require "pp" grades =...
Updating multiple selected INofityPropertyChange objects in DataGridView <p>I'm working with a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.aspx" rel="nofollow"><code>DataGridView</code> (Windows Forms)</a> with MultiSelect enabled which is placed in a User Control. I'd like to upd...
<p>If your DGV is bound to a regular List, it only subscribes to the PropertyChanged event for the currently-selected row. Try using a BindingList instead, or calling BindingSource.ResetItem(n) for each item changed.</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms184414.aspx" rel="nofollow">MSDN gives an ex...
How can I change the color of the gridlines of a Grid in WPF? <p>I have a <code>Grid</code> (not a DataGrid, but a real Grid), with <code>GridLines</code> set to <code>True</code>. How can I change the color of the gridlines? Hardcoded in XAML is ok, since it is just for development-reasons.</p> <pre><code>&lt;Grid Sh...
<p>Sorry, can't be done with ShowGridLines - you need to style the elements contained.</p> <p><strong>Exhibit A:</strong> </p> <p>MSDN docs say "Only dotted lines are available because this property is intended as a design tool to debug layout problems and is not intended for use in production quality code. If you wa...
WPF RichTextBox does not delete text <p>I am trying to cancel (prevent) some text editing in RichTextBox. I am using TextChanged event, but I did not find the way how to cancel or rollback some changes, any ideas?</p> <pre><code>private void mainRTB_TextChanged(object sender, TextChangedEventArgs e) { ...
<p>I do not believe there is a way to prevent the edit because there is only a ChangedEvent and no Changing or PreviewChange event. What you could try though is undoing the change.</p> <pre><code>private void mainRTB_TextChanged(object sender, TextChangedEventArgs e) { TextRange text = new TextRange(main...
Launching a C# dialog from an unmanaged C++ mfc active x dll <p>I've been told to write a dialog in C# which must be instantiated from an unmanaged c++ dll. We do this in other places in our code by simply adding a managed c++ class to the C++ project, then calling the C# dll from the managed c++ class. However I'm f...
<p>You must now register it with "regasm" instead of "regsvr32".</p>
NHibernate mappings when self-join relationships have additional properties <p>How do you map a class to other instances of the same class <em>when that relationship has properties itself</em>?</p> <p>I have a class called Person which is mapped to a table Person</p> <pre><code>PersonID PersonName PersonAge ---...
<p>I think I would do it like that as well, but, I think it is a bit 'clumsy' to model it like this. I mean: you have a collection of persons to which a certain person is related, but you also have a 'back-relation'.<br /> Is this really necessary ? Isn't it an option to remove this back-collection and instead, specif...
How can I debug a regular expression in python? <p>Is there a way to debug a regular expression in Python? And I'm not referring to the process of trying and trying till they work :)</p> <p>EDIT: here is how regexes can be debugged in perl :</p> <pre><code> use re 'debug'; my $str = "GET http://some-site.com HTTP/1....
<pre> <code> >>> p = re.compile('.*', re.DEBUG) max_repeat 0 65535 any None >>> </code> </pre> <p><a href="http://stackoverflow.com/questions/580993/regex-operator-vs-separate-runs-for-each-sub-expression/582227#582227">http://stackoverflow.com/questions/580993/regex-operator-vs-separate-run...
XAML Vector to Illustrator or similar <p>I can easily enough go from Adobe Illustrator and make a XAML file via the XPS Virtual Printer, but is there any way to import Vector graphics defined in XAML into Adobe Illustrator to continue working on it?</p> <p>Cheers</p> <pre><code>Nik </code></pre>
<p>You could try using <a href="http://www.inkscape.org/">Inkscape</a> to convert your XAML into a format Illustrator understands. It support XAML import and export.</p>
Is there a cross browser way of setting style.float in Javascript? <p>Usually, if you need to set a style attribute in JavaScript, you say something like:</p> <pre><code>element.style.attribute = "value"; </code></pre> <p>There are slight variations but usually the attribute name is a similar, albeit camelcased, vers...
<p>Use cssFloat as in...</p> <pre><code>element.style.cssFloat = "value"; </code></pre> <p>That works in everything <em>except</em> IE 8 and older, but you can always detect the browser and switch, or just set them both. Unfortuantely, there is no way to set just one style value to work in all browsers.</p> <p>So t...
subversion/cruise control/nant/nunit with visual studio projects and solutions <p>I work in a team of 2 developers and currently we use VSS and have no continuous integration or daily build and few Unit tests.</p> <p>I'm looking to change our source control to Subversion and at the same time get up and running with a ...
<p>I've been using subversion for quite some years now and I have to say that the best introduction I've found is included in the help file for TortoiseSVN. TortoiseSVN is another free client for Windows with Explorer integration. I highly recommend reading the Tortoise help first, even before the original subversion...
How to validate the clients database against my database schema? <p>Our clients use SQLServer/Oracle databases. Over the years, we've sent them many update scripts which they had to run manually. Most of the time, everything went smooth, but every now and then a script did not run completely to the end or had some erro...
<p>I've used this technique before and it doesn't require buying any tools. </p> <p>Enterprise Manager has a "Create Script" feature. Perform this on your reference database and the comparison database. Select the appropriate options to generate scripts for the objects you care about. Next, just compare the two ge...
Generating and Displaying PDF file in Flex/Java <p>We have Flex on the front end and Java on the back end. When a user will request for a PDF file, request will go to the Java backend, where a PDF file will be generated using Jasper Reports. What we dont know is how to display this PDF file in browser; since we dont wa...
<p>Flash Player cannot natively render PDF files. This is possible using Adobe AIR but not in a Flex application. Your best bet is to call navigateToURL() and open a Servlet in a new browser tab/window. The Servlet can simply write contents of the PDF file to the OutputStream and set the appropriate HTTP headers.</p>
Does Msbuild recognise any build configurations other than DEBUG|RELEASE <p>I created a configuration named Test via Visual Studio which currently just takes all of DEBUG settings, however I employ compiler conditions to determine some specific actions if the build happens to be TEST|DEBUG|RELEASE. </p> <p>However how...
<p>I haven't done much with defining an MSBUILD configuration file but I have done builds of different configurations using a batch file like this</p> <pre><code>msbuild /v:n /p:Configuration=Release "Capture.sln" msbuild /v:n /p:Configuration=ReleaseNoUploads "Capture.sln" </code></pre> <p>I defined the <strong>Rel...
Can I use VS2005 to build extensions for a Python system built with VS2003 <p><a href="http://rdflib.net/" rel="nofollow">RDFLib</a> needs C extensions to be compiled to install on ActiveState Python 2.5; as far as I can tell, there's no binary installer anywhere obvious on the web. On attempting to install with <code...
<p>The main problem is C run-time library. Python 2.4/2.5 linked against msvcr71.dll and therefore all C-extensions should be linked against this dll.</p> <p>Another option is to use gcc (mingw) instead of VS2005, you can use it to compile python extensions only. There is decent installer that allows you to configure ...
Link to table showing CultureInfo for ALL cultures <p>I'm losing my mind trying to find a table showing all the formats of datetimes for cultures</p> <p>I've been googling like crazy and all i want is that table! ARG</p> <p>i.e. </p> <p>en-CA = DD/MM/YYYY 0.00 en-FR = MM/DD/YYYY 0,00</p> <p>I'm looking for a link...
<pre><code>foreach (var c in System.Globalization.CultureInfo. GetCultures(CultureTypes.AllCultures)) { Console.WriteLine("{0} = {1}", c.Name, c.DateTimeFormat.FullDateTimePattern); } </code></pre>
Numeric precision issue in Excel 2007 when saving as XML <p>I am encountering a strange issue when saving documents in XML Spreadsheet 2003 format using Excel 2007.</p> <p>It seems to randomly change numeric values such as "0.58" to "0.57999999999999996".</p> <p>What's really odd is that you CANNOT see this issue whe...
<p>Excel stores numeric data as floating point. The number to the right of the decimal place (the fractional portion) is only approximate. There is no work around, 0.58 cannot be represented as a floating point number that is exactly 0.58.</p> <p>When loading the XML file at that point you should convert the number ba...
Is there a Java library to access the native Windows API? <p>Is there a Java library to access the native Windows API? Either with COM or JNI.</p>
<p>You could try these two, I have seen success with both.</p> <p><a href="http://jawinproject.sourceforge.net">http://jawinproject.sourceforge.net</a></p> <blockquote> <p>The Java/Win32 integration project (Jawin) is a free, open source architecture for interoperation between Java and components exposed t...
What should I do when my boss tells me to make passwords the same as usernames by default in our software? <p>My boss is against requiring our users to have secure passwords, even going so far to request they be setup by default to have passwords the same as their username. What should I do in this situation? What woul...
<p>Make the best case you can for strong passwords and then, unfortunately, if they do not see your point of view either do what they asked or find a better job.</p>