input
stringlengths
51
42.3k
output
stringlengths
18
55k
C# Stack with deletable elements <p>I need a stack structure that also allows the for the deleting of elements. I can't find anything like this in the .Net framework. Which structure provides the best basis for me to implement this?</p>
<p>I would use a LinkedList as it has methods for AddFirst (Push) and RemoveFirst (Pop). But then it also has a simple Remove method that can be used to remove in middle.</p>
Delphi - Network ODBC Database (MS Access) <p>I have a Database program which uses MS Access. The time has come and I need to make it a client/server app. The idea behind the scheme is: Server holds the database, and one or multiple clients need to access it simultaneously. The program will still need to operate under ...
<p>File-based databases like Access are inherently single user. You can share them, but you are opening yourself up to a world of corrupt databases and pain. If you have a multi-user application, you need a multi-user, server-based database.</p>
What are the alternatives to dll registration for ActiveX <p>An application I have recently started work on has to register two dll's, "because of ActiveX". </p> <p>This makes it difficult to have multiple version of the application present on your machine - say the installed product version, and Debug and Release ve...
<p>If your application loads the ActiveX objects, there are a couple of options. The first option if you are using XP or newer, it to use a Registration-Free COM with a Manifest file as explained on <a href="http://msdn.microsoft.com/en-us/library/fh1h056h.aspx" rel="nofollow">MSDN</a>. The idea is to declare your CO...
How do I get the "Add Controller" and "Add View" menu options in my ASP.NET MVC project? <p>I added ASP.NET MVC manually to an existing WebForms application... thanks to <a href="http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc" rel="nofollow">this tutorial</a>.</p> <p>However, now I do not hav...
<p>Technically controllers are just .CS files that are put in the controllers folder and views are just .ASPX files that are put in the views folder. Your controllers classes need to inherit from the base Controller class and your ASPX page needs to inherit from System.Web.Mvc.ViewPage.</p> <p>As far as getting those...
How do I make a file:// hyperlink that works in both IE and Firefox? <p>In my documentation web pages, I often need to provide links to locations, files and applications (.xbap) stored on the intranet. </p> <p>In IE, this works fine with URLs formatted like this:</p> <pre><code>&lt;a href="file://///company.org/Proje...
<p>just use </p> <pre><code>file:/// </code></pre> <p>works in IE, Firefox and Chrome as far as I can tell.</p> <p>see <a href="http://msdn.microsoft.com/en-us/library/aa767731">http://msdn.microsoft.com/en-us/library/aa767731</a>(VS.85).aspx for more info</p>
How do I call a webservice over SSL in Java? <p>I have recently been working on a C# application that calls a webservice over SSL and handles the certificate security using a delegate for the ServerCertificateValidationCallback event like so:</p> <pre><code> System.Net.ServicePointManager.ServerCertificateValid...
<p>Recent java version do it for you. Just point to an HTTPS URL (https://)</p>
How can I create a locked-down python environment? <p>I'm responsible for developing a large Python/Windows/Excel application used by a financial institution which has offices all round the world. Recently the regulations in one country have changed, and as a result we have been told that we need to create a "locked-do...
<p>"reasonably safe" defined arbitrarily as "safer than Excel and VBA".</p> <p>You can't win that fight. Because the fight is over the wrong thing. Anyone can use any EXE or DLL.</p> <p>You need to define "locked down" differently -- in a way that you can succeed.</p> <p>You need to define "locked down" as "cannot...
Problem with imports in java? <p>I'm having a problem with imports in one of my java applications.</p> <p>I've Taken a working JSP out of one Eclipse project, Jar'd up all the classes from that project and put it into a new project.</p> <p>In the new Project I've imported the jar file generated from the original, and...
<p>I have an issue like this once in awhile. Try removing the JAR, rebuilding, and adding the JAR again. This should fix it. </p> <p>It's an Eclipse bug.</p> <p>Edit: The above answer is assuming the jar is actually on the build path.</p>
C++ How to compile dll in a .exe <p>I am creating a c++ program, but I want to be able to offer just a .exe file to the user. However, I am using libraries (curl among others) which have some dll's. Is it possible to compile these dll's into the .exe file?</p> <p>I use Code::Blocks and mingw.</p>
<p>In order to achieve that you will need <a href="http://en.wikipedia.org/wiki/Static%5Flinking">static linking</a>. This requires that all your libraries (and the libraries they depend upon recursively) need to be available as static libraries. Be aware that the size of your executable will be large, as it will carry...
How can I get jquery to execute animations in exact parallel? <p>I'm trying to create an accordion widget in jquery similar to <a href="http://jqueryui.com/demos/accordion/">jquery's accordion plugin</a>, with the difference that I want the handles to appear below their respective content instead of above. My accordio...
<p>One more answer, hopefully my last one...</p> <p>Unfortunately, John Resig's syncAnimate method is not quite up to snuff for the accordion-type animation I want to do. While it works great on Firefox, I couldn't get it working smoothly on IE or Safari.</p> <p>With that said, I decided to bite the bullet and write...
AS3 retrieving xml from aspx page <p>I'm an AS3 noob on training wheels...</p> <p>I have an XML Loader class which is doing what it's supposed to with a test.xml file, however I need the flash to read the xml written by an aspx file.</p> <p>So I tried:</p> <pre><code>var urlRequest:URLRequest = new URLRequest("../x...
<p>A frequent problem with xml being supplied from a WebForm is newlines occuring before the actual xml. When I generate xml in .Net, I usually use a Generic Handler instead of a WebForm. That way, you get better control of the output. When I have to use a WebForm (in some cases when working with a CMS, the easiest way...
Is there a noticable difference between innodb and XtraDB? <p>Today on serverfault I read about XtraDB. I read that it was a fork of innoDB and was woundering how big are the differences? Would I notice the change or do you think its just wasted time if I would try it out?</p>
<p>XtraDB is designed to be a drop in replacement. Most of the enhancements either fall under the category of better diagnostics, or improved scalability.</p> <p>You can see a list of enhancements on the Percona blog: <a href="http://www.percona.com/docs/wiki/percona-xtradb%3Apatch%3Astart">http://www.percona.com/doc...
Opening C# 2008 in 2005 <p>I have Visual C# 2008 on my home computer but 2005 on my computer at school. Is there a patch or something I can download to be able to run 2008 files on 2005?</p>
<p>Most of your code should work just fine. The stuff that will not work in Visual Studio 2005 is anything new in C# 3 as those language features require the C# 3 compiler.</p> <p>Here is a non-exhaustive list of things that C# 3 has that will not build with the C# 2 compiler:</p> <blockquote> <p>lambda expression...
How can I enumerate a radiobuttonlist in .NET? <p>How can I enumerate a radiobuttonlist in .NET?</p>
<pre><code>foreach (ListItem item in RadioButtonList1.Items) { if (item .Selected == true) { Response.Write("You selected " + rbtn.Text); } } </code></pre>
How to filter with XPath on all elements without a specific attribute <p>My XPath is a little bit rusty... Let's say I have this simple XML file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;States xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt...
<p><strong>One XPath expression that selects the wanted elements</strong>:</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><code>/*/States/StateProvince[not(@territory='true')]</code></strong></p> <p><strong>Do note</strong> that <em>one must avoid the <strong><code>//</code></strong> abbreviation when...
An easy bulletproof technique to check if the system has jre (windows) <p>Sorry my newbie question :P If I promp "java -version" in the cmd on a windows system, am I <em>guaranteed</em> that the system will be able to run .jar files <em>if I don't get any error</em>?</p>
<p>I guess the only guaranteed way to check for a JRE is to try to run a small Java program. </p> <p>Or maybe not even that - I suppose conceivably a system could have only part of the Java standard library installed, in which case a small test JAR might work fine but a full program might not. Although I can't imagine...
How to automatically upgrade deployed database for end-users <p>I've read a fair number of questions on how to upgrade a database for developer and such, and I'm leaning towards using <a href="http://code.google.com/p/migratordotnet/" rel="nofollow">migratordotnet</a> or something similar, however it seems the the upgr...
<p><strong>Here is an option:</strong></p> <ol> <li>Store a db version somewhere in you database</li> <li>At startup ensure that the database is current by comparing a constant in your code to the db version.</li> <li>If not current run a set of scripts to create/alter tables, convert data etc.</li> </ol> <p>If you h...
Where can I find a good implementation of Adapter Patterns with good examples in C#? <p>Where can I find a good implementation of <a href="http://en.wikipedia.org/wiki/Adapter%5Fpattern" rel="nofollow">Adapter Patterns</a> with good examples in C#?</p>
<p>(I'm going to throw in something similar to the Wikipedia sample here...)</p> <p>Say you had a requirement to provide an <code>IDeque&lt;T&gt;</code> interface for some library, with the following signature:</p> <pre><code>public interface IDeque&lt;T&gt; { void PushFront(T element); T PopFront(); void...
how to create random folder names 12 characters long in .NET <p>I would like to create random folder names on my website to store images and their thumbnails, but instead of using the full version of a generated guid, i was thinking about using just part of it, maybe just the first 8 characters and possibly base64 enco...
<p>Why not just use something like this, and loop round until you can create the file without conflict?</p> <pre><code> const string ValidChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; static string GenerateName(Random random, int length) { char[] chars = new char[length]; for (int i=0; i &lt; length; i+...
What is the best way to code up a Month and Year drop down list for ASP.NET? <p>I have an internal application that I needs to have a drop down list for two date type elements: <strong>Month</strong> and <strong>Year</strong>. These values are not in a database or other repository of information.</p> <p>I know I cou...
<p>You could use this to get a list of all the Month names and loop through it.</p> <pre><code>CultureInfo.CurrentCulture.DateTimeFormat.MonthNames </code></pre> <p>You can use it like this...using the index of the Month as the value for your dropdown</p> <pre><code>var months = CultureInfo.CurrentCulture.DateTimeFo...
How can I stop my while loop? <p>I would like to use the following code in C# but I just can't seem to get out of it. I would like to terminate the application if the user presses a key or moves the rodent (aka mouse). Here is my code (no laughing!).</p> <pre><code>private void frmDots_KeyDown(object sender, KeyEventA...
<p>Your "busy waiting" strategy is poor design. Instead, you should use event handlers that are fired:</p> <ul> <li>On keypress.</li> <li>When the mouse is moved. </li> </ul> <p>In either case, you can respond by terminating the application.</p>
Embed ContentPlaceHolder between double quotes <p>I am using .NET MVC, and within view pages I set a contentplaceholder that contains an ID to be used on the master page like so:</p> <p>View page:</p> <pre><code>&lt;asp:Content ID="CDomBodyId" ContentPlaceHolderID="DomBodyId" runat="server"&gt;LmpDemoRequests&lt;/asp...
<p>This is an issue with ASP.NET editor. It's not specific to MVC. I think the workaround is pretty good and I don't see a specific drawback.</p>
How can I generate NHibernate mapping files and DB constructs from my domain logic? <p>I want to implement NHibernate on my domain objects in my project, but I'm not sure how I should go about generating the mapping file, and the database.</p> <p>I've found some questions that kind of touch on this <a href="http://sta...
<p>I like <a href="http://code.google.com/p/fluent-nhibernate/" rel="nofollow">Fluent-NHibernate</a>. See example below for mapping a User class, of course you can use XML.</p> <p>The x value in the lamda expression represents the domain class.</p> <p>This is very much like RoR which I like very much</p> <pre><code>...
Why would I not want a central repository in versioning? SVN vs. Git question <p><strong>Duplicates:</strong> </p> <ul> <li><a href="http://stackoverflow.com/questions/740053/why-should-i-use-git-instead-of-svn">http://stackoverflow.com/questions/740053/why-should-i-use-git-instead-of-svn</a></li> <li><a href="http://...
<p>That always confused me too before I started using Git. People like to overemphasise how different it is.</p> <p>The truth is that you can, and most likely will, set up your Git system to have a single "master" repostiory. What's different with Git is that every "working directory" also gets its own client reposito...
How can I reorder rows in sql database <p>Is it possible to reorder rows in SQL database? For example; how can I swap the order of 2nd row and 3rd row's values?</p> <p>The order of the row is important to me since i need to display the value according to the order.</p> <hr> <p>Thanks for all the answers. But 'Order ...
<p>It sounds like you need another column like "ListOrder". So your table might look like:</p> <pre><code>BookMark ListOrder ======== ========= d 1 g 2 b 3 f 4 a 5 </code></pre> <p>Then you can "order by" ListOrder.</p> <pre><code>Select * from MyTable Order By ListOrder ...
JSF Faces Bridge get java.lang.NullPointerException when deploying to oc4j container <p>I am running JDeveloper 10.1.3.4 with the webcenter pre-configured oc4j. I'm trying to portletize a vanilla JSF webcenter project. </p> <ol> <li>I create a application using the webcenter application template.</li> <li>Add a JSF JS...
<p>you should move to jdev 11g which uses wls which is much better than oc4j</p>
Restrict word list in XML schema <p>I'm writing an XML schema and need to prevent the text of an element from matching certain values. (Eg. the variableName element cannot match 'int', 'byte', 'string' etc.)</p> <p>I have tried using a restriction with a pattern element similar to "^(int|byte|string)", but without suc...
<p>After triple-checking that XML Schema (XSD) regexes <em>really</em> don't support any of the features that would make this task easy (particularly lookaheads and anchors), I've come up with an approach that seems to work. I used free-spacing mode to make it easier to read, but that's another feature the XSD flavor ...
Method-level documentation in n-Tier applications <p>My Situation:</p> <p>The data request chain of my application looks like this:</p> <pre><code>(Client) -&gt; (WebService) -&gt; (SQL or OLAP Cube) </code></pre> <p>The client is a Silverlight Application that uses a generated proxy to communicate with a WCF webser...
<p>I would think that most people would expect a web service to be documented more heavily than a DAL (especially if the DAL is mostly generated code: I'm guessing so as these are pass-through methods). I would add a pointer to the web service documentation in the DAL comments for those who work with it in the future.<...
Thread Finished Event in Python <p>I have a PyQt program, in this program I start a new thread for drawing a complicated image. I want to know when the thread has finished so I can print the image on the form.</p> <p>The only obstacle I'm facing is that I need to invoke the method of drawing from inside the GUI thread...
<p>In the samples with <a href="http://www.riverbankcomputing.co.uk/software/pyqt/download" rel="nofollow">PyQt-Py2.6-gpl-4.4.4-2.exe</a>, there's the Mandelbrot app. In my install, the source is in C:\Python26\Lib\site-packages\PyQt4\examples\threads\mandelbrot.pyw. It uses a thread to render the pixmap and a signal...
rails replace path in string <p>I have a string that may have a path to a file. Example src="/folder/whatever". How do I replace that path with src="http://www.sitename.com/folder/whatever ?</p>
<p>If your string contains <code>src="/..."</code>, possibly many times, do this:</p> <pre><code>string.gsub!(/\bsrc="(\/[^"]*)"/, 'src="http://www.sitename.com\1"') </code></pre> <p>If your string contains the URL only, do this:</p> <pre><code>src.replace('http://www.sitename.com' + src) </code></pre> <p>More info...
Structuremap Stackoverflow Exception <p>I keep getting a stackoverflow exception when I call "GetInstance" (the last line). All, yes ALL of my types implement ITracker. MultiTracker has a constructor with a single parameter, which is an array of ITracker's.</p> <p>It seems like StructureMap is ignoring the fact that I...
<p>I'm not sure if I would do it this way but it works.....</p> <pre><code> public void Initialize() { var container = new Container(x =&gt; x.ForRequestedType&lt;ITracker&gt;() .TheDefaultIsConcreteType&lt;MultiTracker&gt;() .OnCreation(y =&gt; ((Mu...
What is an "opaque" key? <p>I know what a key is, I know what opaque is in other contexts - but what is an opaque key in a database context?</p>
<p>It means it has no real meaning beyond being used to look up records - it should just be treated as arbitrary data, for no purpose other than keying. This almost always applies to GUIDs, for example. Compare this with situations where the primary key might be a social security number.</p> <p>These are also known as...
UITableView - how to make search bar scroll with table <p>How can I make the search bar to scroll together with the table view? When I scroll my table view I want my search bar to go with it and disappear. I want to have done something similar to contacts app on the iPhone.</p>
<p>You can place your searchbar in the <a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableView%5FClass/Reference/Reference.html#//apple%5Fref/doc/uid/TP40006943-CH3-SW32" rel="nofollow">tableView's header row</a>. This will make it part of the tableView.</p>
Using System.IO.Delete to remove certain files from a directory? <p>I have 2 images inside a folder called Pics..... Image1.jpg and Image2.jpg.</p> <p>What code must i place inside my Submit button to just delete Image1.jpg located here "~/Pics/Image1.jpg"</p> <p>Any help would be great!!!</p>
<p>You need to use <a href="http://msdn.microsoft.com/en-us/library/system.io.file.delete.aspx">System.IO.File.Delete</a> not System.IO.Delete</p> <pre><code>string path = "~/Pics/Image1.jpg"; System.IO.File.Delete(Server.MapPath(path)) </code></pre>
iPhone app Submission under company name <p>My team and I have been contracted by a company to develop our first iPhone Application. </p> <p>I am wondering how this contractor relationship is best handled. Does the $99 SDK/Dev connection account need to be established under the contractor's name, so that when the appl...
<p>You get an account and they get an account. Accounts serve two functions. Access to the development tools and access to the business interface for the company publishing the app.</p> <p>You sign up once. Each client signs up for their own account for the most important reason. That's where the bank information is ...
MaxValue Partition Name <p>In Oracle 10g I'm creating a range partitioned table. Each partition will be a year. My question is what do you use for the name of the MaxValue partition? I was planning to call my partitions P2001, P2002, P2003 ... P2009. Suggestions welcome, I've considered P9999, PCurrent, PThisYear, ...
<p>We've used <code>FY2002_PART, FY2003_PART</code>, etc. </p> <p>Truly, the only obvious suggestion would be to name it something that makes sense to you and your group (and future maintainers) ... Its all in the usage!</p>
NHibernate update on single property updates all properties in sql <p>I am performing a standard update in NHibernate to a single property. However on commit of the transaction the sql update seems to set all fields I have mapped on the table even though they have not changed. Surely this can't be normal behaviour in N...
<p>This is the normal behavior. You can try adding <code>dynamic-update="true"</code> to your class definition to override this behavior.</p>
How do I convert a datetime field to a formatted string in SQL Server 2005? <p>I want to SELECT a formatted date string from a <code>datetime</code> type in SQL Server 2005.</p> <p>In the format "yyyy/mm/dd hh:mm:ss".</p> <p>What is the best way to do using only a query?</p>
<p>Check out the CONVERT statement.</p> <pre><code>SELECT CONVERT(VARCHAR(20), getdate(), 120) </code></pre> <p>is closest to what you want. (Note the different separators (- instead of / ))</p>
Convert a JSON object to nested form fields? <p>Anyone know of a good way to convert a JSON object to nested form fields.</p> <p>For example: consider a JSON object:</p> <pre><code>{'a':{'b':{'c':'1200'}}}, 'z':'foo', 'bar':{'baz':'1', 'id':2}} </code></pre> <p>I should get:</p> <pre><code>{'a[b][c]':'1200', 'z':'f...
<p>So, I have no clue why you want to do what you say you want to do, and I hope you will fill us all in, but this code should be close enough for you to be able to tweak it (this is based on <a href="http://stackoverflow.com/questions/264430/how-can-i-get-a-list-of-the-differences-between-two-javascript-object-graphs"...
How do you export and import Visual Studio macros? <p>I would like to export some macros that I have defined and be able to import them into another clean install of Visual Studio with the same module/naming structure that I have defined.</p> <p>I have some menu command customizations that execute my macros - so to wo...
<p>Tools->Macros->Macros IDE... (or Alt+F11)</p> <p>Export: Expand your macros until you find the module you want to export, right-click it, choose Export ModuleName..., select a file, and Save.</p> <p>Import: Select "MyMacros" or any other, right-click it, and choose Add->Add Existing Item... Select the file you jus...
Print an Envelope from a website? <p>I'm wanting to print a standard sized envelope from a webpage using c#. Does anyone know how to do something like this? I would load the data from the system for the address and pass it. I just need the basic steps for doing so.</p>
<p>I did end up going with a PDF. We use <a href="http://www.pdfsharp.net" rel="nofollow">PDFSharp</a>, which is a free PDF creator tool for .NET. I create the PDF on the fly using the function here, and then on the page I just load this page as a new window. Here's the method I ended up creating for anyone who wants t...
Using C# , LINQ how to pick items between markers again and again? <p>Say I have an array of strings:</p> <pre><code>string[] strArray = {"aa", "bb", "xx", "cc", "xx", "dd", "ee", "ff", "xx","xx","gg","xx"}; </code></pre> <p>How do I use LINQ to extract the strings between the "xx" markers as groups?</p> <p>Say by w...
<p>A pure-functional solution (mutation-free):</p> <pre><code>string[] strArray = { "aa", "bb", "xx", "cc", "xx", "dd", "ee", "ff", "xx", "xx", "gg", "xx" }; var result = strArray.Aggregate((IEnumerable&lt;IEnumerable&lt;string&gt;&gt;)new IEnumerable&lt;string&gt;[0], (a, s) =&gt; s == "x...
What are good ways to get something like D-Bus to work across multiple Linux machines, possibly through firewalls? <p>The <a href="http://www.freedesktop.org/wiki/Software/dbus" rel="nofollow">D-Bus specification</a> says that</p> <blockquote> <p>D-Bus is.. a simple way for applications to talk to one another... Cur...
<p>The "new thing" for managing messages and communication between apps, apparently is Rabbit.</p> <p>Is an implementation of AMQP, that establishes messaing, routing and security...</p> <p>check this:</p> <p><a href="http://www.rabbitmq.com" rel="nofollow">http://www.rabbitmq.com</a></p> <p><a href="http://en.wiki...
Java 1.6 - determine symbolic links <p>In a DirectoryWalker class I want to find out if a File instance is actually a symbolic link to a directory (assuming, the walker walks on UNIX systems). Given, I already know the instance is a directory, would the following be a reliable condition to determine the symbolic link?<...
<p>The technique used in Apache Commons uses the canonical path to the parent directory, not the file itself. I don't think that you can guarantee that a mismatch is due to a symbolic link, but it's a good indication that the file needs special treatment.</p> <p>This is <a href="http://svn.apache.org/viewvc/commons/pr...
Database auto-increment column <p>Is it possible to create a Database which has 1 column (but not the column of primary key) to be auto-increment? So that when I insert value to the database, i don't need to fill in the value myself, and DB will fill in that value for that column for me (and increment every time I do a...
<p>Yes, of course it is possible. Just make this column a unique key (not a primary key) and it has to be declared with a special attribute: "IDENTITY" for SQL Server, and "AUTO_INCREMENT" for MySQL (see the example below) . And another column can be a primary key. </p> <p>On MySQL database the table could be declar...
C# Contract Implementations and Exceptions <p>I have a BO method that must do two operations to fulfill its contract.</p> <ol> <li>insert a record into the db</li> <li>send an email notification containing the metadata for the record</li> </ol> <p>Both are handled with calls to individual DAO methods responsible for ...
<p>Yes, it's very possible. Check out Enterprise Library <a href="http://msdn.microsoft.com/en-us/library/dd203116.aspx" rel="nofollow">exception handling block</a>. Lots of great stuff on raising, wrapping, logging exceptions from and between layers as well as setting up policies so you can handle it in configuratio...
Too many TIME_WAIT connections <p>We have a fairly busy website (1 million page views/day) using Apache mod proxy that keeps getting overloaded with connections (>1,000) in the TIME_WAIT state. The connections are to port 3306 (mysql), but mysql only shows a few connections (show process list) and is performing fine. W...
<p>Each time_wait connection is a connection that has been closed.</p> <p>You're probably connecting to mysql, issuing a query, then disconnecting. Repeat for each query on the page. Consider using a connection pooling tool, or at very least, a global variable that holds on to your database connection. If you use a...
Can I place ASP.NET user controls on pages without a control declaration? <p>I would like to put user controls on pages without registering the tag at the top of the page. For example:</p> <pre><code>&lt;p&gt;some text&lt;/p&gt; &lt;myname:mycontrol runat="server" /&gt; </code></pre> <p>Is this possible? I've heard t...
<p>in .net 2.0 web.config :</p> <pre><code>&lt;pages&gt; &lt;controls&gt; &lt;add tagPrefix="MYPREFIX" namespace=="MyNamespace.Stuff" assembly="MyAssembly" /&gt; </code></pre> <p>Much more thorough discussion <a href="http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-an...
How to create a FileUpload control in WPF? <p>How do I create a Fileupload control in WPF?</p> <p>I want to upload jpg image files. </p>
<p>It depends on what you're uploading to. Most likely you'll want to build some sort of service class that takes care of copying the file to the new location. </p> <p>Then in your XAML you'll have to create a <code>TextBox</code> and a <code>Button</code> to show a dialog.</p> <p>Although, you're design options ar...
How can I manipulate a web page (re-arranging some HTML controls) through the Browser? <p>I want to be able to open my website and use some kind of firefox plugin to re-arrange some Html on the site by drag-and-drop and be able to use that modified source. I used to use a css plug-in but do not remember it anymore. Are...
<p>It's not drag-and-drop, but <a href="https://addons.mozilla.org/en-US/firefox/addon/1843" rel="nofollow">Firebug</a> will let you modify any web page in Firefox. You'll have to edit the HTML/CSS source directly, though; once you're done, you should be able to copy and paste into a text editor.</p>
Why isn't all code compiled position independent? <p>When compiling shared libraries in gcc the -fPIC option compiles the code as position independent. Is there any reason (performance or otherwise) why you would not compile all code position independent? </p>
<p>It adds an indirection. With position independent code you have to load the address of your function and then jump to it. Normally the address of the function is already present in the instruction stream.</p>
How can I set up my domain name on Google App Engine? <p>I've made a website to go on App Engine, and have deployed it. I've redirected my domain name to ghs.google.com, and it successfully goes to my site.</p> <p>The problem is that in the address bar, 'www.mysite.com' turns into 'myappid.appspot.com', and I haven't ...
<p>Have a look at <a href="http://aralbalkan.com/1466" rel="nofollow">this quick guide</a>, in essence:</p> <blockquote> <p>Add a CNAME for www.yourdomain.com and point it to ghs.googlehosted.com.</p> <p>Sign in to your application via appspot.com.</p> <p>Click the Administration → Application Sett...
Call VB program from Java <p>I was wondering if someone could tell me the best way to call a Visual Basic program from Java. I have a few VB applications that I want to run from a Java application that I'm building.</p>
<p>You can use <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html#start%28%29" rel="nofollow">ProcessBuilder.start()</a> or the older <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html#exec%28java.lang.String%29" rel="nofollow">Runtime.exec()</a> to launch processes. Thi...
Help in J2ME for creating image and parse it <p>Can anyone tell me how i can parse a png image into many png images in J2ME???</p> <p>for examole:I just wnat to have a source image 150*150 pixel and parse it to 10 image with 15*15 pixel. </p> <p>I write an elemantary code that have exeption.</p> <p>This is my code:<...
<p>Maybe if I understand it right, you have a single image 150x150 that contains many other images put into one. If that is the case, have indexes for each of the image and use Graphics.setClip() when you paint and paint the image in the appropriate coordinate. For example you want to paint the image at say 15, 15 of t...
How to create Web based visual Process Designer? <p>I have been ask to design web based process designer (Business Process designer) in asp.net/c# . I have currently one programmer in my team and we have two months for this.We have found some open source BPM designers but we want to design our own as for our learning t...
<p>Take a look at <a href="http://js-graph-it.sourceforge.net/" rel="nofollow">js-graph-it</a> which is a javascript and CSS based diagramming technology. Though not a complete solution, it could be something you can start with.</p>
How to set a checkbox to "checked" using mshtml? <p>I can do most things I need to with mshtml, but I'm a bit stuck with how to set a checkbox input element to "checked". Here's the situation...</p> <pre><code>IHTMLElementCollection inputElements = (IHTMLElementCollection)doc.all.tags("input"); foreach (IHTMLElement e...
<p><a href="http://msdn.microsoft.com/en-us/library/dd347093%28VS.85%29.aspx" rel="nofollow">HTMLInputElement</a> exposes the Checked property as a Boolean</p>
how to compare a NSURLconnection http response data with a string value in iphone? <p>i am new in iphone programming......i want to do an activation module which will send a http request with a PIN numbr and then read the response...if the response is "OK" it opens up with a main menu...........the problem is that i am...
<p>I would use the following line, to see that the response is actually the OK string, cause it may contain white space or other characters.</p> <pre><code>NSLog(@"string1 = '%@' temp = '%@'", string1, temp); </code></pre> <p>put this line before the if statement like this...</p> <pre><code>NSString *string1 = @"OK"...
Using UIAlertView in a manner similar to Windows' MessageBox()? <p>I'm new to the iPhone and I would like to be able to use UIAlertView in a manner similar to the Windows <code>MessageBox()</code> or the <code>MessageDlg()</code> in <code>Delphi</code>.</p> <p>For example, I have a method that needs to ask the user fo...
<p>There's no reason to subclass UIAlertView at all. That's what delegates are for. All you need is a class (such as your view controller) supporting the UIAlertViewDelegate protocol, and set the UIAlertView's delegate property to that class. You then implement the alertView:clickedButtonAtIndex: method in this class, ...
Should I apply state pattern here? <p>I have a panel that draws alot of things. To make drawing effecient I am using a BufferedImage so that I dont have to draw everything, everytime something happens.</p> <p>My paintComponent only has to 'if' statements:</p> <pre><code>if(!extraOnly) //paint something paint somethi...
<p>I see nothing wrong with having state in the view. This is clearly not the same state as in the model though. </p> <p>An example would be a webbrowser. The model in this case is the web page DOM and the browser view is rendering the DOM into a screen presentation. While scrolling down the web page it would be very ...
NHibernate Sorting a has many collection <p>I have entity Recipes and it has a HasMany collection comments.</p> <p>In a MVC controller action I am getting the recipe and then displaying the comments.</p> <p>How do I sort the comments in descending order of "EnteredOn"?</p> <p>Where do I sort them?</p> <pre><code> ...
<p>I think I would just retrieve the comments as-is (not particulary sorted), and then just sort the Comments collection of the recipe, before you display the comments.</p> <p>Depending on how you've created your class, and your mapping, I think this is the only way since a set and bag mapping, represent un-ordered co...
WPF - Databind slider value to StoryBoard? <p>I'm trying to create a sound volume control and for that I've created a storyboard which is animating the volume visually. And I've put this inside an common slider control. And I want to databind the value of the slider directly to the storyboards timeline position. If the...
<p>It depends on what you plan to achieve. The point is that property binding should be performed across items on the visual tree. If you show the animation I can tell how is the proper way to bind the animation and the slider value.</p> <p>For example, if your animation is a turning knob the way to do it is binding t...
How to troubleshoot .NET 2.0 Error Reporting messages in the event log? <p>I work on an open source product called <a href="http://evemon.battleclinic.com/">EVEMon</a> written in C# targeting the .NET 2.0 platform, I have one user who is suffering from a strange .NET crash that we have been unable to resolve.</p> <pre...
<p>This is how I would tackle the problem for a end user with a crash.</p> <ol> <li><p>Download and install Debugging Tools for Windows at <a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx">http://www.microsoft.com/whdc/devtools/debugging/default.mspx</a></p></li> <li><p>Once the tools are install...
Multilanguage in WPF <p>Can you recommend a good way to implement a Multilanguage system for a WPF app? The method I'm using right now involves XML, classes and a xaml extension. It Works fine in most of cases, but when I have to deal with dynamic labels or dynamic text in general it require some extra effort. I would...
<p>Follow these steps:</p> <p><strong>1)</strong> Place all <code>String</code> fragments in a separate resource file. </p> <p>Example: <code>StringResources.xaml</code>:</p> <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/win...
HTTP URL - allowed characters in parameter names <p>Is there any formal restriction as to which characters are allowed in URL parameter names?</p> <p>I've been reading <a href="http://tools.ietf.org/html/rfc3986">RFC3986</a> ("Uniform Resource Identifier (URI): Generic Syntax") but came to no definitive conclusion.</p...
<p>There are no restrictions on escaped parameter names in the URI specs. There might be restrictions in the server-side software that you use, though. This is especially true if you use “homemade” scripts to interpret URIs.</p>
What are the most important patterns for line of business web-applications? <p>What are the most important patterns you should know, when developing testable n-tier <a href="http://en.wikipedia.org/wiki/Line%5Fof%5Fbusiness" rel="nofollow">line of business</a> web applications?</p> <ul> <li>Repository pattern</li> <li...
<p>Since you asking about the connection between design patterns and best practice for business, there is a bit of subjectivity you have to deal with. I would focus entirely on making your code easy to understand and reuse. </p> <p>I would focus less on design patterns (no single pattern is better than another) and in...
Animating Background Image <p>I Like using Jquery and its companion Jquery Ui but can not find a way to animate background image over a certain period of time like 5 seconds. I can not do something like:</p> <pre><code>$('sampleelement').animate({'background-image':'url(hello.jpg)'},5000); </code></pre> <p>Any ideas?...
<p>This is not possible like this. Css does not allow for backgound image manipulation like this. You should put in a div with the background behind your content and fade that in:</p> <pre><code>&lt;div id='background_img' style='display:none; position:absolute;'&gt;&lt;!-- position me behind the content!--&gt;&lt;img...
Searching Specific Data From a File <p>I have a File having text and few numbers.I just want to extract numbers from it.How do I go about it ???</p> <p>I tried using all that split thing but no luck so far. My File is like this:</p> <p>*AT+CMGL="ALL" +CMGL: 5566,"REC READ","Ufone" Dear customer, your DAY_BUCKET subsc...
<p>If the numbers are all at the end of the lines then you can use code like the following</p> <pre><code>foreach ( string line in File.ReadAllLines(@"c:\path\to\file.txt") ) { Match result = Regex.Match(line, @"\+(\d+)""$"); if ( result.Success ) { var number = result.Groups[1].Value; // do what you want...
Is there a Zend_Form_Element that renders a plain div with some content? <p>Working on a bunch of forms at the moment and I'm finding that I want to be able to split a form into sections with some text in between. Is there a Zend_Form_Element that simply allows me to place some text mixed in with my form (not as a labe...
<p>I think there's not.</p> <p>Although, you can do one of the following things:</p> <ul> <li>If the text inbetween is more like a title, you can group them in <a href="http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.displaygroups" rel="nofollow">display groups</a>.</li> <li>If you want to pu...
Is there a decorator to simply cache function return values? <p>Consider the following:</p> <pre><code>@property def name(self): if not hasattr(self, '_name'): # expensive calculation self._name = 1 + 1 return self._name </code></pre> <p>I'm new, but I think the caching could be factored out into...
<p>Starting from Python 3.2 there is a built-in decorator:</p> <p><a href="http://docs.python.org/dev/library/functools.html#functools.lru_cache"><code>@functools.lru_cache(maxsize=100, typed=False)</code></a></p> <blockquote> Decorator to wrap a function with a memoizing callable that saves up to the maxsize most re...
Adding UITabBar <p>I have a UINavigationBar based application - only a one navigation bar that is handling all the work with views in my app.</p> <p>And I want to have a tab bar at a bottom part of every view that will take the user to whatever view he would like to go.</p> <p>What is the easiest way to add a tab bar...
<p>If you want to have a tab bar that is the same for all your views and is always visible, then you have to:</p> <ol> <li>In your application delegate class, add an IBOutlet for the new UITabBarController named e.g. tabBarController</li> <li>In your mainwindow.xib file, you have to add a tab bar view controller, inte...
Murphy's Law applied to Internet Security <p>I'm a fanatic of Murphy's Law and I have it in mind at programming time. There are a lot of "applied" versions in a variety of fields. Maybe (as stack overflow users) we can compile a list of them <strong>applied to Internet Security</strong>. I suggest this because in times...
<p>The only truly secure system is one that is powered off, cast in a block of concrete and sealed in a lead-lined room with armed guards - and even then I have my doubts.</p> <p>-- Eugene H. Spafford</p>
How to know which classes inside a .jar file are referenced? <p>I need to deploy only the referenced classes in a very limited environment as <a href="http://en.wikipedia.org/wiki/Data%5Fand%5Fobject%5Fcarousel" rel="nofollow">A data carousel</a> for Interactive TV. Bandwidth is expensive and .jar files are not support...
<p>Check out <a href="http://proguard.sourceforge.net/" rel="nofollow">ProGuard</a> which is an obfuscator that will list code and classes that are not used. Obfuscating itself usually results in a smaller foot print.</p> <blockquote> <p>ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preveri...
How to designate unreachable python code <p>What's the pythonic way to designate unreachable code in python as in:</p> <pre><code>gender = readFromDB(...) # either 'm' or 'f' if gender == 'm': greeting = 'Mr.' elif gender == 'f': greeting = 'Ms.' else: # What should this line say? </code></pre>
<pre><code>raise ValueError('invalid gender %r' % gender) </code></pre>
How do I get a list of installed updates and hotfixes? <p>A list of every update and hotfix that has been installed on my computer, coming from either Microsoft Windows Update or from the knowledge base. I need the ID of each in the form of KBxxxxxx or some similar representation...</p> <p>Currently I have:</p> <pre>...
<p>After some further search on what I've found earlier. (Yes, the same as VolkerK suggests first)</p> <ol> <li>Under VS2008 CMD in %SystemRoot%\System32\ run a command to get a managed dll:<br /> <strong>tlbimp.exe wuapi.dll /out=WUApiInterop.dll</strong></li> <li>Add WUApiInterop.dll as a project reference so we see...
IIS5 or IIS6 Web Application running under IIS7? <p>I have a web application that runs fine under IIS5 or IIS6. I just installed Vista, which has IIS7. I just copied the entire web app over as-is, no changes to any files. I went into the IIS7 manager and created a web appliction under the Default Web Site and pointe...
<p>0) Check if you have asp.net extensions installed under Programs and Features - Windows Features - WWW services - Application Development Features - .Net Extensibility / ASP.Net</p> <p>1) The Microsoft .net framework</p> <p>2) Try copying the whole directory to your IIS's root folder (usually wwwroot), common erro...
Wait until QWidget closes <p>I'm working on a project in C++ and QT, and I want to open a new QWidget window, have the user interact with it, etc, then have execution return to the method that opened the window. Example (MyClass inherits QWidiget):</p> <pre><code>void doStuff(){ MyClass newWindow = new Myclass()...
<p>Have <code>MyClass</code> inherit <code>QDialog</code>. Then open it as a modal dialog with <code>exec()</code>.</p> <pre><code>void MainWindow::createMyDialog() { MyClass dialog(this); dialog.exec(); } </code></pre> <p>Check out <a href="http://qt-project.org/doc/qt-4.8/qdialog.html">http://qt-project.org/do...
What cell phone has the widest potential market for software? <p>I developed a flashcard program a while back for learning Japanese. I've been considering porting it to a cell-phone. What is a good target platfrom? I'm thinking about iPhone, HTC Touch HD (system software: Windows Mobile) or a Nokia (system software: Sy...
<p><a href="http://en.wikipedia.org/wiki/File:Market%5Fshare%5Fof%5Fmobile%5Fos%5Fs%5F2008.JPG" rel="nofollow">Here's the most recent market share data</a>. Have you considered building a web-based product consumable by all smartphones with decent web browsers? Sites like <a href="http://x.facebook.com" rel="nofollo...
How do you get search capability similar to Spotlight or iTunes? <p>I have an NSTableView that contains a few columns that are populated with data. How do I set up a search bar that can filter the rows based on the content of a specific column? I am looking for the type of thing that is done with Spotlight in the Fin...
<p>"Spotlight" capability is actually given to you with the SearchKit API, although for a simple case like what you're describing NSPredicate would probably be a better choice. If anyone's interested though, I wrote a SearchKit presentation for CocoaHeads you can <a href="http://blog.mbcharbonneau.com/2009/02/26/search...
How to use subversion Ctypes Python Bindings? <p>Subversion 1.6 introduce something that is called 'Ctypes Python Binding', but it is not documented. Is it any information available what this bindings are and how to use it? For example, i have a fresh windows XP and want to control SVN repository using subversiion 1.6 ...
<p>You need the Subversion source distribution, Python (>= 2.5), and <a href="http://code.google.com/p/ctypesgen/" rel="nofollow">ctypesgen</a>.</p> <p>Instructions for building the ctypes bindings are <a href="http://svn.apache.org/repos/asf/subversion/trunk/subversion/bindings/ctypes-python/README" rel="nofollow">he...
Emacs: keep region selected after operation <p>In emacs, after an operation such as <code>comment-region</code>, the selected region is automatically deselected.</p> <p>Is there any way of disabling this behaviour?</p>
<p>If the region is deselected, that sounds like you must be using <a href="http://www.gnu.org/software/emacs/manual/html%5Fmono/emacs.html#Transient-Mark"><code>transient-mark-mode</code></a>. In <code>transient-mark-mode</code>, when you execute a command that operates on the region, the region is deselected (in part...
How can I serve an image with a Perl CGI script? <p>My google fu in failing me. How do I use Perl to serve up an already generated image?</p> <p>Example:</p> <pre><code>&lt;html&gt;&lt;body&gt;&lt;img src="getimage.pl"&gt;&lt;/body&gt;&lt;/html&gt; </code></pre> <p>What goes in getimage.pl?</p>
<p>Here you go:</p> <pre><code>#!/usr/bin/perl -w my $file = "inner-nav.gif"; my $length = (stat($file)) [10]; print "Content-type: image/gif\n"; print "Content-length: $length \n\n"; binmode STDOUT; open (FH,'&lt;', $file) || die "Could not open $file: $!"; my $buffer = ""; while (read(FH, $buffer, 10240)) { prin...
Sending Messages to Yahoo IM using PHP <p>I am trying to connect to an Yahoo Messenger account and send PMs using PHP or CURL. I downloaded the below class from phpclasses.org which connects to eBuddy Web Messenger(<a href="http://www.ebuddy.com/" rel="nofollow">http://www.ebuddy.com/</a>) to send messages to the desir...
<p>may be you forget var $password = '', var $to = '', i'm not sure 'cos i not expert in php...</p>
Hide UITabBar? <p>In my app I have a tab bar. And in some views I as well have a toolbar. So when I come to those views with a toolbar it looks ugly - two bars at the bottom of the view. I thought that it would be a best solution to hide a tab bar when entering those particular views. But I just couldn't figure out how...
<p>You have to use set the hidesBottomBarWhenPushed property to YES on the controller that you are pushing and NOT to the UITabBarController.</p> <pre><code>otherController.hidesBottomBarWhenPushed = YES; [navigationController pushViewController: otherController animated: TRUE]; </code></pre> <p>Or you can set the pr...
Running a .NET application from a file share without code signing <p>The .NET security model throws security errors whenever a .NET exe is run from a file share. The error does not appear when ran from a local drive. Does anyone know of a way around this without requiring the code to be signed?</p>
<p><a href="http://blogs.msdn.com/shawnfa/archive/2004/12/30/344554.aspx" rel="nofollow">Using CasPol to Fully Trust a Share</a></p> <p>more answers here:</p> <p><a href="http://stackoverflow.com/questions/148879/why-does-my-net-application-crash-when-run-from-a-network-drive">Why does my .NET application crash when ...
Can source control software be used for your technical documents? <p>I know you can use source control software for source code, but can you use it for your technical documents as well? For example, can you store a Word document and it keep a history of changes (I know it has track changes, it's just and example)? Tha...
<p>If you are on a Windows platform, then <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a> has some really useful features that will let you diff (but unfortunately not merge) Word documents. It interacts with an installed Word directly, and when you request a diff it runs a script that loads both documents to ...
Calling global variables in the AppSettings from a Javascript function <p>In my javascript function I am trying to call my global variable that is currently defined in the webconfig file of my Asp.net project. What is the syntax for this? I've looked around and nothing seems to work so far. I've tried the following ...
<p>What do you expect to get from it? Even if you manage to get the value, the code doesn't do anything at all with it. It just declares a string literal and throws it away...</p> <p>You can put the value in a Javascript variable like this:</p> <pre><code>&lt;script type="text/javascript"&gt; var var1 = '&lt;%=System...
Question: can the title of my setting differ from the title of my executable/application? <p>I'm developing an application which has a Settings pane, following the AppPrefs sample by Apple. If my application is named AppPrefs, this is the exact name/prompt/ title the Settings application will provide. Is there anyw...
<p>Unfortuntely, nope, due to the why the settings system works. From Apple's <a href="http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/iPhoneAppProgrammingGuide.pdf" rel="nofollow">iPhone Application Programming Guide</a>:</p> <blockquote> <p>When the Settings appl...
What Steps do you Take to Troubleshoot Problems with PHP cURL? <p>Almost any working PHP programmer has faced having to use CURL to send raw HTTP requests, whether it's for credit card payment processing, nefarious screen scraping, or something in-between.</p> <p>Almost any forum where PHP programmers congregate has a...
<p>I find the CURLINFO_HEADER_OUT option to be very useful.</p> <pre>&lt;?php $curl = curl_init('http://www.php.net'); curl_setopt($curl, CURLOPT_HEADERFUNCTION, 'dbg_curl_data'); curl_setopt($curl, CURLOPT_WRITEFUNCTION, 'dbg_curl_data'); curl_setopt($curl, CURLINFO_HEADER_OUT, true); curl_exec($curl); echo '&lt;f...
How can I prevent all Firefox browser instances from using the same authentication cookie? <p>I implemented Forms authentication by creating <code>Default.aspx</code> and custom login page named <code>login.aspx</code>. If unauthenticated users brows to <code>Default.aspx</code>, they are redirected to <code>login.aspx...
<p>Each browser instance will have its own set of cookies. And history. And bookmarks. Because each running instance will need to be attached to its own profile. </p> <p>Any given instance can have multiple tabs and windows open however. And those will share cookies. If that doesn't work for you, then don't use cookie...
Unable to expand Mac's manuals to have Ubuntu's manuals <p>My Leopard has no manuals for Wget and compinit, for example. It lacks in many other areas such as in examples and documentation about options too.</p> <p>Ubuntu has often better manuals than Mac: for instance, it has manuals for the two commands.</p> <p><em>...
<p><strong>Original Post:</strong> You might want to start by installing said programs on your Mac. The installation will probably include the man pages.</p> <p><strong>Update to reflect discussion:</strong> MacPorts stores its man pages in <code>/opt/local/share/man</code> and adds these to the <code>$MANPATH</code>...
How can I make my entire flex widget have rounded corners? <p>I am creating a Flex widget and would like to make the corners rounded. In other words, I don't want some component inside the widget rounded, I want the actual widget to be rounded. </p> <p>I have seen this done in many places so it cannot be too hard, b...
<p>If you're creating an AIR Application, you can set a custom chrome, and you're whole application will have the shape you want.</p> <p><a href="http://technoracle.blogspot.com/2007/07/making-custom-chrome-air-applications.html" rel="nofollow">Here</a>'s a handy article.</p> <p>Not sure what kind of widget you're ta...
Generating a link within a controller with an HTTP verb <p>Using a restful resource in Rails, I would like to be able to insert a link into my flash hash that the user can click to destroy the object in question. The only problem seems to be that I cannot get the generated link to work with the RESTful controller! </p>...
<p><code>ApplicationController.helpers.link_to</code> will allow you to use helper methods in the controllers, although I'm not sure that's strictly following MVC. Although occasionally I've found a need, i.e. calling <code>number_to_currency</code>.</p> <p>Another problem arises when you use the :delete option in tha...
Advanced GUI Possible in Java? <p>Perhaps a philosophical question. I’ve seen some interesting visuals lately in GUIs, mostly on native platform APIs. I know that “it’s just software” and that likely, with enough work, anything can be done with pixels. The question is (finally!), is Java really an option for...
<p>Take a look at <a href="http://javafx.com/">JavaFX</a>.</p>
How do I crawl my own website? <p>I've inherited an old Classic ASP website to modify. Although not requested up-front, I'd like to delete a bunch of the old "orphaned" pages. </p> <p>For some reason, The old developer decided to create muliple instances of the file instead of using source control (eg. <code>index-t...
<p>My favorite tool is <a href="http://home.snafu.de/tilman/xenulink.html" rel="nofollow">Xenu</a>.</p>
C/D line drawing package <p>I find my self in need of a line drawing package. I need to pop a window and draw lines and points. Text would be nice but I can live without it. Most importantly, I need something that is dirt simple to get running. I don't have time to dink around with libs (if I did have time I'd be willi...
<p>If you want an out-of-process solution, for getting something up and running quickly it's hard to beat <strong>generating PostScript and launching a PostScript viewer</strong>. The great advantage of this trick is that you generate something, you don't like the way it looks, you can edit it by hand until it looks b...
Printing ASP.NET 3.5 Chart Control <p>Any info out there on how to print the generated charts in say PDF format? They look fabulous on screen but the end users want to print them and file as needed.</p>
<p>I was looking for a way to do this and found this answer for winforms</p> <p>This is the way that I got the asp:chart to print</p> <p>Add javascript on the web page:</p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; function printChart() { var html = '&lt;HTML&gt;\n&lt;HEAD&gt;\n...
Google Maps zoomOut-Pan-zoomIn animation <p>I'm wondering how I get a smooth zoom in animation with the Google Maps API.</p> <p>I have 2 points, one in, let say China, and one in France. When I'm zoomed in on China, and click the button France. I want it to gradually zoom out smooth, one zoom level at the time. When i...
<p>You need the <a href="http://code.google.com/apis/maps/documentation/reference.html#GMap2.zoomOut"><code>zoomOut</code></a> method with the continuous zoom parameter set to do the zoom and the <a href="http://code.google.com/apis/maps/documentation/reference.html#GMap2.panTo"><code>panTo</code></a> method to do the ...
Will more CPU cache help compliation/development in Visual Studio 2008? <p>I'm thinking of a new laptop to replace my current machine. I notice a lot of machines have the P8xx and T9xxx Intel Core 2 Duo. The T9xxx have a premium but they have I believe 6 megs of cache compared to the 3 megs in the P8xx. Will this help ...
<p>Usually that's not as helpful as increasing the number of CPU cores (which can run parallel build if you don't have one-by-one dependency tree) or the speed of CPU itself - but the result may still vary by your real project to work with.</p>
How to keep my code simple? <p>--EDIT--</p> <p>I believe this is a valid question that may have multiple answers (as defined <a href="http://stackoverflow.com/questions/157125/do-we-really-need-the-subjective-tag-and-is-it-commonly-mis-used/157227#157227">here</a>). This is NOT a discussion nor a poll. Furthermore, th...
<p>As <a href="http://stackoverflow.com/questions/816130/how-do-i-keep-my-code-simple/816158#816158">@neodymium</a> points out in a zenly fashion, <em>don't let your algorithms drive the code</em>. To exemplify what that actually means consider the following griefing contraption in C# that you've written a week ago:</p...
Best practices for populating rails with processed data <p>I've been working for some months on a program for processing some data, and it's now at a stage where rather than displaying information (stored using ActiveRecord) via the command-line, I'd like to display the processed information via a Rails app.</p> <p>Th...
<p>Can't really say whether to split applications or not without more context.</p> <p>Re the second question, you can work fine without schema and migrations, back in the Rails 0.5 days with did fine without any of these fancy schmancy features.</p> <p>Just be sure that you have a solid database schema that'll equall...