input
stringlengths
51
42.3k
output
stringlengths
18
55k
Implementing sort/page feature when using POCOs with ASP.net Data Controls <p>I am not a big fan of datasets so I use POCO to return data. I have achieved paging and sorting using custom methods that I create for a POCO type that work on page size and give me a set of the complete POCO collection at a time, I use metho...
<p>I agree with the base class idea as this will save all the duplicate code. One thing I did that takes a step in this direction is to create a class to handle the sorting of any generic list (for DTO/POCO). This allowed me to sort a list in my presenter or code-behind with only 1 line of code.</p> <p>Typically for...
Capture characters from standard input without waiting for enter to be pressed <p>I can never remember how I do this because it comes up so infrequently for me. But in C or C++, what is the best way to read a character from standard input without waiting for a newline (press enter).</p> <p>Also ideally it wouldn't ech...
<p>That's not possible portably in pure C++, because it depends too much on the terminal used that may be connected with stdin (they are usually line buffered). You can, however use a library for that:</p> <ol> <li>conio available with windows compilers. Use the function <code>_getch()</code> to give you a character w...
Do you keep your build tools in version control? <p>Do you keep tools that are necessary to build your project under version control?</p> <p>If you do, what are your guidelines for which tools to include? I guess noone puts Visual Studio in version control, but how about your unit-test-runner? The Nant/Ant/Maven execu...
<p>Yes, I keep EVERYTHING that is part of the process of delivering a software production in version control.</p>
What Are the Pros and Cons of Filemaker? <p>A potential customer has asked me to look at some promotional flyers for a couple of apps which fall into the contact management / scheduler category. Both use Filemaker as their backend. It looks like these two apps are sold as web apps. At any rate I had not heard of Fil...
<p>Pros:</p> <ul> <li>It's cheap</li> </ul> <p>Cons:</p> <ul> <li>It's cheap(ly made) </li> <li>It's non-standard (easy to find MySQL/Oracle/MSSQL/Access experts but nobody knows Filemaker)</li> </ul> <p>Using subpar and/or nonstandard technologies only creates <a href="http://onstartups.com/tabid/3339/bid/165/Deve...
ASP.NET Datagrid - hiding a specific row/column <p>I am using a Datagrid with several columns of data (call it myDG) and one of these columns is a DateTime bound to a datasource. Its value is dependent on a "job" object completing a job and assigning the date time value. Since this normally takes up to a minute the val...
<p>I would probably hook OnItemDataBound, check the value, and replace/reformat if required.</p>
In C# check that filename is *possibly* valid (not that it exists) <p>Is there a method in the System.IO namespace that checks the validity of a filename?</p> <p>For example, <code>C:\foo\bar</code> would validate and <code>:"~-*</code> would not</p> <p>Or a little trickier, <code>X:\foo\bar</code> would validate is ...
<p>Just do</p> <pre><code>System.IO.FileInfo fi = null; try { fi = new System.IO.FileInfo(fileName); } catch (ArgumentException) { } catch (System.IO.PathTooLongException) { } catch (NotSupportedException) { } if (ReferenceEquals(fi, null)) { ... // file name is not valid } else { ... // file name is valid.....
How to access the user profile in a Django template? <p>I'm storing some additional per-user information using the <a href="http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users"><code>AUTH_PROFILE_MODULE</code></a>.</p> <p>We can access the user in a Django template using <code>...
<p>Use <code>{{ request.user.get_profile.whatever }}</code>. Django's templating language automatically calls things that are callable - in this case, the <code>.get_profile()</code> method.</p>
How can I include a CDATA section in a ConfigurationElement? <p>I'm using the .NET Fx 3.5 and have written my own configuration classes which inherit from ConfigurationSection/ConfigurationElement. Currently I end up with something that looks like this in my configuration file:</p> <pre><code>&lt;blah.mail&gt; &l...
<p>In your custom configuration element class you need to override method <code>OnDeserializeUnrecognizedElement</code>. </p> <p>Example:</p> <pre><code>public class PluginConfigurationElement : ConfigurationElement { public NameValueCollection CustomProperies { get; set; } public PluginConfigurationElement(...
Php Framework or template engine or something else? <p>I have a relatively simple application up and working with some basic functionality which i have built as a bit of a project. I would like to now build on that, and add some more complex features, including login.</p> <p>The code has got quite complex, and it's wr...
<p>As stated very eloquently <a href="http://stackoverflow.com/questions/350053/php-frameworks-are-they-solely-personal-preference">here already</a>, frameworks are good until you want to do something they're not suited for, plus they can <a href="http://stackoverflow.com/questions/313364/should-a-beginning-php-program...
Difference between DBEngine.BeginTrans and DBEngine.Workspaces(0).BeginTrans <p>In Access, what is the difference between these two statements?</p> <pre><code>DBEngine.BeginTrans </code></pre> <p>and</p> <pre><code>DBEngine.Workspaces(0).BeginTrans </code></pre> <p>The documentation for both leads to the same place...
<p>Have a look here: <a href="http://msdn.microsoft.com/en-us/library/aa293491(VS.60).aspx">DAO Workspace</a><br /> And then here: <a href="http://msdn.microsoft.com/en-us/library/aa293489(VS.60).aspx">DAO Workspace: Opening a Separate Transaction Space</a></p> <p>(The links are for MFC, but they're applicable to wh...
Using Factories in Presenters in a Model View Presenter and Domain Driven Design Project <p>In domain driven design, it appears to be a good practice to use Factories to create your domain objects in your domain layer (as opposed to using a direct constructor or IoC). </p> <p>But what about using the domain object fac...
<p>I'd advise against letting your domain objects out of the domain layer and into the presentation layer. Keep the presentation layer focused on presentation.</p> <p>For this reason, I construct Data Transfer Objects to shuffle data to and from the domain and presentation layers. In your case, have the dialog populat...
write to fifo/pipe from shell, with timeout <p>I have a pair of shell programs that talk over a named pipe. The reader creates the pipe when it starts, and removes it when it exits.</p> <p>Sometimes, the writer will attempt to write to the pipe between the time that the reader stops reading and the time that it remove...
<p>This question comes up periodically (though I couldn't find it with a search). I've written two shell scripts to use as timeout commands: one for things that read standard input and one for things that don't read standard input. This stinks, and I've been meaning to write a C program, but I haven't gotten around t...
Canonical operator overloading? <p>Is there a canonical or recommended pattern for implementing arithmetic operator overloading in C++ number-like classes?</p> <p>From the C++ FAQ, we have an exception-safe assignment operator that avoids most problems:</p> <pre><code>class NumberImpl; class Number { NumberImpl *...
<p>In Bjarne Stroustrup's book "<a href="http://rads.stackoverflow.com/amzn/click/0201700735" rel="nofollow">The C++ Programming Language</a>", in chapter 11 (the one devoted to Operator Overloading) he goes through witting a class for a complex number type (section 11.3). </p> <p>One thing I do notice from that sect...
How do you debug app crash with no stack trace referencing source code? <p><a href="http://support.microsoft.com/kb/953102" rel="nofollow">http://support.microsoft.com/kb/953102</a></p> <p>We spent about 50 hours during Christmas holiday to identify this problem, causing our business critical production app to crash r...
<p>If you can tolerate it, add lots of logging.</p> <p>Take a guess at where it's happening and bracket that code in <code>entered Foo</code> and <code>exited Foo</code> logs. Then if you see one but not the other on a crash, you known it's in there somewhere so start a binary (or n-ary) search diving into functions a...
Structure of a C++ Object in Memory Vs a Struct <p>If I have a class as follows</p> <pre><code> class Example_Class { private: int x; int y; public: Example_Class() { x = 8; y = 9; } ~Example_Class() { } ...
<p>The C++ standard <em>guarantees</em> that memory layouts of a C <code>struct</code> and a C++ <code>class</code> (or <code>struct</code> -- same thing) will be identical, provided that the C++ <code>class</code>/<code>struct</code> fits the criteria of being <strong>POD</strong> ("Plain Old Data"). So what does POD...
how to convert string to binary integer file using command line under linux <p>What i want is to take an integer represented as a string, for example "1234", and convert it to a file called int, containing a 32-bit big endian integer, with the value 1234.</p> <p>The only way I have figured out to do this is something ...
<p>A slightly simpler way would be:</p> <pre><code>printf "0: %08X" 1234 | xxd -r &gt; int </code></pre>
What's a good way to view dojo's javascript source files in Eclipse with Aptana? <p>I have Aptana installed within Eclipse. I'm working on a project with the dojo 1.2 JavaScript library installed. </p> <p>When I open one of dojo's dijit .js files, the code is formatted in a rather difficult to read way. The Eclipse "O...
<p>You should be able to download uncompressed versions of the library at <a href="http://www.dojotoolkit.org" rel="nofollow">dojotoolkit.org</a>. <a href="http://download.dojotoolkit.org/release-1.2.2/dojo-release-1.2.2/" rel="nofollow">Here</a> is the source tree for 1.2.2.</p>
print_int and other F# print functions <p>I am trying to do simple tutorial in Visual Studio let someNumber = (2 + 2) print_int someNumber but it says print_int is undefined. printfn works. Could the book I'm using be outdated? </p>
<p>print_int is a part of the F# power pack. Adding a reference to the PowerPack (c:\program files\FSharp-1.9.6.2\bin\FSharp.PowerPack.dll on my machine) should fix the issue.</p> <p>Here is a blog entry from Don that mentions the current plans for the Power Pack:</p> <p><a href="http://blogs.msdn.com/dsyme/archive/...
Get source of website in java <p>I would like to use java to get the source of a website (secure) and then parse that website for links that are in it. I have found how to connect to that url, but then how can i easily get just the source, preferraby as the DOM Document oso that I could easily get the info I want.</p> ...
<p>You can get low level and just request it with a socket. In java it looks like</p> <pre><code>// Arg[0] = Hostname // Arg[1] = File like index.html public static void main(String[] args) throws Exception { SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault(); SSLSocket sslsock = (SSL...
Flex 3 - Must I add components before setting their attributes when using AS3? <p>Let us say that I have a Flex 3 mxml component, call it A. A has a get/set attribute called 'b'. Within A I have another internal component C, which is specified using mxml. When "instantiating" component A within mxml, I can specify the ...
<p>To force a control to create its child controls you have to call the initialize method.</p> <p>i.e. this should work :</p> <pre><code>var a:A = new A(); a.initialize(); a.b = "woopy"; this.addChild(a); </code></pre> <p>However, what I've been doing so far when declaring mxml controls is binding the internal contr...
Ignoring try block in C# command line program <p>I have a command line program in C# that I've wrapped with a try-catch block to keep it from crashing the console. However, while I am debugging it, if an exception is thrown somewhere in the DoStuff() method, Visual Studio will break on the "catch" statement. I want V...
<p>You can turn on <a href="http://blogs.msdn.com/davidklinems/archive/2005/07/18/440150.aspx" rel="nofollow">First chance exceptions</a> in VS. This will allow you to be notified as soon as an exception is raised.</p>
Rails form validation conditional bypass <p>I have a rails model that validates uniqueness of 2 form values. If these 2 values aren't unique the validation errors are shows and the "submit" button is changed to "resubmit". I want to allow a user to click the "resubmit" button and bypass the model validation. I want...
<p>In my opinion this is the best way to do it:</p> <pre><code>class FooBar &lt; ActiveRecord::Base validates_uniqueness_of :foo, :bar, :unless =&gt; :force_submit attr_accessor :force_submit end </code></pre> <p>then in your view, make sure you name the submit tag like</p> <pre><code>&lt;%= submit_tag 'Resubmit...
How to speed up the eclipse project 'refresh' <p>I have a fairly large PHP codebase (10k files) that I work with using Eclipse 3.4/PDT 2 on a windows machine, while the files are hosted on a Debian fileserver. I connect via a mapped drive on windows.</p> <p>Despite having a 1gbit ethernet connection, doing an eclipse ...
<p>Thanks all for your suggestions. Basically, JW was on the right track. Work locally.</p> <p>To that end, I discovered a plugin called FileSync: <a href="http://andrei.gmxhome.de/filesync/" rel="nofollow">http://andrei.gmxhome.de/filesync/</a></p> <p>This automatically copies the changed files to the network share....
How Ethernet receives the bits and forms the Data Link Layer Frame <p>I am curious to know how the incoming bits at the physical layer are properly framed and sent to the data link layer. How the OS deal with this process.</p> <p>It would be grateful if you explained it in detail or give me some links/pdf.</p> <p>I a...
<p>The physical layer depends on your hardware. You're probably connected via ethernet, see <a href="http://en.wikipedia.org/wiki/Ethernet" rel="nofollow">here</a>. The operating system doesn't do a lot here, it's mostly left up to the network card and the device drivers written by the card's manufacturer.</p>
Can I symlink multiple directories into one? <p>I have a feeling that I already know the answer to this one, but I thought I'd check.</p> <p>I have a number of different folders:</p> <pre><code>images_a/ images_b/ images_c/ </code></pre> <p>Can I create some sort of symlink such that this new directory has the conte...
<p>No. You would have to symbolically link all the individual files.</p> <p>What you <em>could</em> do is to create a job to run periodically which basically removed all of the existing symbolic links in <code>images_all</code>, then re-create the links for all files from the three other directories, but it's a bit of...
Why can't DynaLoader.pm load SSleay.dll for Net::SSLeay and Crypt::SSLeay? <p>I have Perl v5.10. I am trying to install Net::SSLeay 1.30 and Crypt::SSLeay 0.57. I have already installed OpenSSL 0.9.8e.</p> <p>For Net::SSLeay 1.30 I followed these steps:</p> <pre> perl Makefile.PL -windows C:\openssl nmake nmake test ...
<p>Randy Kobes has <a href="http://www.mail-archive.com/perl-win32-users@listserv.activestate.com/msg32520.html" rel="nofollow">an answer for this on the Perl Win32 mailing list</a>. Does your PATH environment variable contain the directory that contains libeay32.dll or ssleay32.dll?</p> <p>There are many other answer...
Vehicle tracking system/Jan08 <p>we are developing cost effective vehicle tracking system, for my knowledge Using GPS to track vehicle costs more. So we are looking to develop using GPRS system which costs less.</p> <p>my doubt is can track the vehicle using only GPRS (not using GPS at all) is this possible .please...
<p>If you don't need an exact location you can use cell tower information and some external api to get the coordinates for each tower. It's the same function that google uses in their mobile Maps application.</p> <p>Example: <a href="http://www.codeproject.com/KB/mobile/DeepCast.aspx" rel="nofollow">http://www.codepro...
Using a #! comment in ruby running in Ubuntu <p>I am new to programming and am trying to follow an example which uses #! comment in ruby.</p> <p>I am consistently get the message: bash: matz.rb: command not found</p> <p>I am using this comment: #! /usr/bin/env ruby</p> <p>I have tried it with and without the ...
<p>The <code>/usr/bin/env</code> part is fine. You need to give bash the path to matz.rb when you run it. If you're in the directory with matz.rb, type "./matz.rb". The directory "." means the current directory - bash doesn't look there by default when running programs (like Windows does).</p> <p>The env program (/us...
Accessing TextBox Column in RadGrid By Telerik <p>Hi There Do you know how to access textboxes added to a radgrid that are not bound but are used to trap any row related input a user typed in to the textbox for that column. I need to access this data server side when a postback occurs. Your thoughts are greatly appreci...
<p>That depends on how those textboxes are being added/created. If by 'not bound' you mean they are in Template columns you should be able to use .FindControl in one of the grid's events to grab that textbox. And again which event will depend on what is causing the postback to happen. For the purpose of this code exa...
Grouping by a report item in SSRS 2005 - textbox - any workarounds? <p>I want to group by a report item, but that's not allowed. So I tried creating a parameter...not allowed as well. Tried referencing from footer...failed again.</p> <p>This is somewhat complicated. Let me explain:</p> <p>I have textbox22, it's value...
<p>Have you tried adding a calculated field to your dataset?</p> <p>Here is how it works:</p> <ul> <li><p>While you are in the layout view of the report, open "datasets" tool window(in my environment it is on the left). </p></li> <li><p>Right click on the DataSet you are working with and add a field, you can use a ca...
How to return more than one value from a function in Python? <p>How to return more than one variable from a function in Python?</p>
<p>You separate the values you want to return by commas:</p> <pre><code>def get_name(): # you code return first_name, last_name </code></pre> <p>The commas indicate it's a tuple, so you could wrap your values by parentheses:</p> <pre><code>return (first_name, last_name) </code></pre> <p>Then when you call the...
How to pass a COM method as a function argument? And Microsoft Compiler error C3867 <p>I would like to pass a COM method as a function argument but I get this error (Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86):</p> <p>error C3867: 'IDispatch::GetTypeInfoCount': function call missin...
<p>Looks like a straight c++ problem.</p> <p>Your method expects a pointer to a function.</p> <p>You have a member function - (which is different from a function).</p> <p>Typically you will need to either:<br> 1. Change the function that you want to pass to being static.<br> 2. Change the type of pointer expected to...
C# multiple string match <p>I need C# string search algorithm which can match multiple occurance of pattern. For example, if pattern is 'AA' and string is 'BAAABBB' Regex produce match result Index = 1, but I need result Index = 1,2. Can I force Regex to give such result? </p>
<p>Use a lookahead pattern:-</p> <p>"A(?=A)"</p> <p>This finds any A that is followed by another A without consuming the following A. Hence AAA will match this pattern twice.</p>
Change Control Document <p>I'm starting to lead a lot of reforms at the company where I work and the next thing I want try get in place is a decent change control document. I've searched but I can't find a template so far.</p> <p>Would it be possible to maybe share some Change Control documents amongest ourselves?</p>...
<p>Found <a href="http://www.iturls.com/English/SoftwareEngineering/SE_c.asp" rel="nofollow">this</a> page from a quick Google search. Contains lots of links to document templates and checklists for all sorts of doc types, including change control.</p>
Integer.Parse vs. CInt <p>Basically, I have been using both <code>Integer.Parse</code> and <a href="https://msdn.microsoft.com/en-us/library/s2dy91zy.aspx" rel="nofollow">CInt</a> in most of my daily programming tasks, but I'm a little bit confused of what the difference is between the two.</p> <p>What is the differen...
<p>CInt does a whole lot more than integer.Parse.</p> <p>Cint will first check to see if what it was passed is an integer, and then simply casts it and returns it. If it's a double it will try to convert it without first converting the double to a string.</p> <p>See this from the help for CInt and other <a href="http...
In statement for LINQ to objects <p>Is there an equivalent of a SQL IN statement in LINQ to objects?</p>
<p>Yes - <a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.contains.aspx">Contains</a>.</p> <pre><code>var desiredNames = new[] { "Jon", "Marc" }; var people = new[] { new { FirstName="Jon", Surname="Skeet" }, new { FirstName="Marc", Surname="Gravell" }, new { FirstName="Jeff", Surna...
PHP Header redirect not working <pre><code>include('header.php'); $name = $_POST['name']; $score = $_POST['score']; $dept = $_POST['dept']; $MyDB-&gt;prep("INSERT INTO demo (`id`,`name`,`score`,`dept`, `date`) VALUES ('','$name','$score','$dept','$date')"); // Bind a value to our :id hook // Produces: SELECT * FROM d...
<p>Look carefully at your includes - perhaps you have a blank line after a closing ?> ?</p> <p>This will cause some literal whitespace to be sent as output, preventing you from making subsequent header calls. </p> <p>Note that it is legal to leave the close ?> off the include file, which is a useful idiom for avoidin...
PHP PDF-Generation - IE7/Acrobat8: "Website cannot be displayed" <p>I've got some trouble with displaying pdfs in IE7 (which were generated by R&amp;OS' ezpdf).</p> <p>IE7 with Acrobat Reader 8.1.2. says "The page cannot be displayed"</p> <p>Other Browsers (like FF3/Acrobat 8.1.2. or IE6/Acrobat 7) have no problem wi...
<blockquote> <p>Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache</p> </blockquote> <p>...so IE won't store the file in the Temporary Internet Files folder. However the mechanism used to directly 'Open' a file from the browser in IE often requires it to be opened from i...
modelbinder with dropdownlist in asp.net mvc <p>Here's what I'm trying to do : </p> <p>I have an entity <strong>Task</strong> with a TaskName property and a <strong>TaskPriority</strong> property.</p> <p>Now, in the html I have :</p> <pre><code>&lt;td&gt;&lt;%=Html.TextBox("Task.TaskName") %&gt;&lt;/td&gt; &lt;td&gt...
<p>This should work.</p> <p>Three classes:</p> <pre><code> public class Container { public string name { get; set; } public List&lt;Dropdown&gt; drops { get; set; } } public class Dropdown { public int id { get; set; } public string value { get; set; } } pu...
Rounded Swing JButton using Java <p>Well, I have an image that I would like to put as a background to a button (or something clicable). The problem is that this image is round, so I need to show this image, without any borders, etc.</p> <p>The JComponent that holds this button has a custom background, so the button re...
<p>Did you try the following?</p> <pre><code>button.setOpaque(false); button.setFocusPainted(false); button.setBorderPainted(false); button.setContentAreaFilled(false); setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); // Especially important </code></pre> <p><code>setBorder(null)</code> might work, but there is <...
StringDictionary not saving as user setting <p>I've created a user scoped setting with the type "System.Collections.Specialized.StringDictionary". Whenever I open the local settings, I can see it in the config, but it's empty.</p> <p>I have other user settings that save correctly, but this dictionary doesn't seem to ...
<p>If you're setting it from code, are you remembering to call <code>Settings.Save()</code>?</p> <p>Edit: Boy am I dumb, I just remembered I had the same problem myself and labored over it for hours. The problem is that the <code>Dictionary</code> doesn't serialize to XML (even though it really should). You have two o...
Grouping Regular expression BackReferences <p>I have the following RegEx</p> <pre><code>id=(.*?) | id="(.*?)" </code></pre> <p>The reason for this is I am trying to replace Ids from the browsers DOM using JavaScript. IE, however strips quotes from element atributes as it appears not to require them in the DOM</p> <p...
<p>what about:</p> <pre><code>id="?(.*?)"? </code></pre> <p><em>(possibly that . should be [^"] - I didn't test it)</em></p>
SQL Server 2000 intermittent connection exceptions on production server - specific environment problem? <p>We've been having intermittent problems causing users to be forcibly logged out of out application.</p> <p>Our set-up is ASP.Net/C# web application on Windows Server 2003 Standard Edition with SQL Server 2000 on ...
<p>The Invalid Viewstate error is pretty common in a high traffic web site. Though, if you recently moved to multiple web servers, make sure you're sharing the same machine key so Viewstate is signed with the same key on all servers. <a href="http://www.codinghorror.com/blog/archives/000132.html" rel="nofollow">http://...
\\\\$ converted to \$ in jsp template data <p>I just stumbled unto a weirdness in my JSP code. It seems that a double backslash followed by a dollar or percent symbol gets converted to a single backslash (plus symbol).</p> <p>That is, the following JSP:</p> <pre><code>&lt;%@ page contentType="text/html;charset=UTF-8"...
<p>\$ is in the <a href="http://jcp.org/aboutJava/communityprocess/final/jsr152/index.html" rel="nofollow">spec</a> (Section JSP.1.6). "Only when EL is enabled for the page...., a literal $ can be quoted by \$.</p> <p>\% will probably be because "A literal &lt;% is quoted by &lt;\%". I suspect that the parser isn't ch...
Preventing Brute Force Logins on Websites <p>As a response to the recent <a href="http://blog.wired.com/27bstroke6/2009/01/professed-twitt.html">Twitter hijackings</a> and <a href="http://www.codinghorror.com/blog/archives/001206.html">Jeff's post on Dictionary Attacks</a>, what is the best way to secure your website a...
<p>I think database-persisted short lockout period for the given account (1-5 minutes) is the only way to handle this. Each userid in your database contains a TimeOfLastFailedLogin and numberOfFailedAttempts. When numbeOfFailedAttempts > X you lockout for some minutes.</p> <p>This means you're locking the userid in qu...
Determining "Owner" of Text Edited by Multiple Users <p>You may have noticed that we now show an edit summary on Community Wiki posts:</p> <blockquote> <p>community wiki<br /> 220 revisions, 48 users</p> </blockquote> <p>I'd like to also show the user who "most owns" the final content displayed on the page, as a ...
<p>I think the idea is fundamentally flawed.</p> <p>If someone writes a brilliant analysis with awful spelling and unclear examples, and I copy edit it extensively, have I created 60 % of the work? Clearly not; the result is a derivative where most of the value comes from the initial poster. A useful measure is not po...
Is there a way to get rid of aspx placeholder files in a ASP.NET web deployment project? <p>I'm using a <strong>web deployment project</strong> in order to precompile my <strong>ASP.NET 3.5 web project</strong>. It creates a single extra DLL for the code in aspx and ascx files. And, for every aspx file there is a place...
<p>I discovered it by myself. It is much easier than I thought (IIS 6.0):</p> <p>In Internet Information Manager go to the property page of the site, then chose the tab "Home Directory" and click on the button "Configuration...".</p> <p>Click "Edit..." for the .aspx ISAPI extension and <strong>uncheck "Verify that fi...
Where can I find information on code blocks? <p>Does anyone know a good website that summarises what you can do with code blocks (i.e. &lt;% &lt;%= &lt;%# etc) in ASP.Net?</p> <p>Thanks.</p>
<p>Here is a MSDN page: <a href="http://msdn.microsoft.com/en-us/library/ms178135.aspx" rel="nofollow">MSDN Embedded Code Blocks</a></p> <pre><code>&lt;% - any code &lt;%= - shortcut for Response.Write() &lt;%# - is for binding &lt;%-- - is for comments </code></pre>
Converting letters to their greek equivalent in Javascript <p>I have some JSON data from a web service which gives me data like the following</p> <pre><code>blah blah &lt;greek&gt;a&lt;/greek&gt; </code></pre> <p>I need to be able to convert what is inside the greek tags into their symbol equivalent, using javascript...
<p>There's no obvious generic way to do this, as there is no obvious relation. On the other hand, there is a finite set of greek characters. By extension that means there's a finite set of mappings. It should be trivial to find the ASCII character your JSON provider sends for each greek character. pre/postfix the tags...
When foo and bar is not enough <p>When you are using placeholder names when programming (not necessary variable names, but labels, mockup names, etc) and foo and bar is not enough, what do you use?</p> <p>I guess <em>baz</em> is rather common as third name, and the <em>lorem ipsum</em> for longer texts. But then what?...
<p>If an example is that complex, it would probably be easier to understand if you just used real variable names.</p>
Trying to find a simple way to do upload only modified files through FTP <p>Need to find a way to upload files to my server through FTP. But only the ones that have been modified. Is there a simple way of doing that? Command line ftp client or script is preferred. Thanks, Jonas. </p>
<p>The most reliable way would be to make md5 hashes of all the local files you care about and store it in a file. So the file will contain a list of filenames and their md5 hashes. Store that file on your ftp server. When you want to update the files on your ftp server, download the file containing the list, compar...
What will be the lifespan of the .Net Framework? <p>Will it ever become obsolete?</p>
<p>Yes, I'm sure it will become obsolete at some point. I think it's safe to assume our descendants won't be using it in 1000 years. Now, the more interesting question is <em>when</em> it becomes obsolete.</p> <ul> <li>5 years? Unlikely IMO.</li> <li>10 years? Almost certainly still in use, but <em>possibly</em> not f...
Display a map in a Windows Form app <p>I built a Winform app several months ago that schedules appointments for repair techs. I'd like to update the app by adding a map for the customer's address on the customer form, and then print that map on the report the techs take when they leave the office.</p> <p>I've been loo...
<p>There is <a href="http://www.koushikdutta.com/2008/07/virtual-earth-and-google-maps-tiled-map.html" rel="nofollow">some example code</a> for developing a map viewer control (NB: I doubt this is strictly within their licence)</p> <p>Otherwise, depending on your budget, you could use the <a href="http://msdn.microsof...
What is the best way to get the minimum or maximum value from an Array of numbers? <p>Let's say I have an Array of numbers: <code>[2,3,3,4,2,2,5,6,7,2]</code></p> <p>What is the best way to find the minimum or maximum value in that Array?</p> <p>Right now, to get the maximum, I am looping through the Array, and reset...
<p>The theoretical answers from everyone else are all neat, but let's be pragmatic. ActionScript provides the tools you need so that you don't even have to write a loop in this case!</p> <p>First, note that <code>Math.min()</code> and <code>Math.max()</code> can take any number of arguments. Also, it's important to un...
Detecting whether a file is locked by another process (or indeed the same process) <p>This is how I do it at the moment. I try to open the file with the FileShare set to none. So I want exclusive accesss to the file. If I can't get that then its a good bet somebody else has the file locked.</p> <p>There's got to be a ...
<p>There is no need first to check if the file is locked and then access it, as between the check and the access some other process may still get a lock on the file. So, what you do is correct, if you succeed, do your work with the file.</p>
Is it possible for native class to consume .NET event? <p>Any idea how to initialize .NET delegate that points to method from 'mixed' class instance?</p> <p>I have 'mixed' C++ class like this:</p> <pre><code>class CppMixClass { public: CppMixClass(void){ dotNETclass-&gt;StateChanged += gcnew DotNetClass::...
<p>I just found answer to this(of course by Nishant Sivakumar, man seems to have answers to all my C++/CLI interop related problems):</p> <p><a href="http://www.codeproject.com/KB/mcpp/CppCliSupportLib.aspx?display=Print" rel="nofollow">http://www.codeproject.com/KB/mcpp/CppCliSupportLib.aspx?display=Print</a></p> <p...
Is there a way to make "destructive" string methods a-la Ruby? <p>In Ruby, methods which change the object have a bang on the end: <code>string.downcase!</code></p> <p>In c# you have to do: <code>foo = foo.ToLower()</code></p> <p>Is there a way to make an extension method like:</p> <p><code>foo.ConvertToLower()</cod...
<p>There are two ways of mutating a string instance:</p> <ul> <li>Reflection</li> <li>Unsafe code</li> </ul> <p>I wouldn't recommend using either of them. Your fellow developers will hate you forever - particularly if the method is ever used to change a string which happens to be a literal...</p>
SQL Distinct by ID and Latest By Date <p>I have the following SQL Statement. I need to select the latest record for each System.Id using the System.RevisedDate</p> <pre><code>SELECT [System.Id],[System.RevisedDate], [System.Title], [System.State], [System.Reason], [System.CreatedDate], [System.WorkItemType], [Syst...
<p>Try this:</p> <pre><code>SELECT * FROM WorkItems w JOIN ( SELECT [System.Id],MAX([System.RevisedDate]) FROM WorkItems WHERE ([System.WorkItemType] = 'Change Request') AND ([System.CreatedDate] &gt;= '09/30/2008') AND ([System.TeamProject] NOT LIKE '%Deleted%') AND ([System.TeamProject] NOT LIKE '%Sandbox%') ...
Losing ODBC connection with SQL Server 2005 Database <p>One of our clients has an application (FoxPro 9) running on top of a SQL Server 2005 backend. Intermittently, they are losing their ODBC connection with the SQL Server database. Below is the initial error information:</p> <blockquote> <p>Err Msg: Connectivity e...
<p>Just a shot in the dark, but have you tried running a trace and trying to capture error events as well as any tsql. This might provide some clues or help you to see a pattern.</p>
Abstracted References Between Entities <p>An upcoming project of mine is considering a design that involves (what I'm calling) "abstract entity references". It's quite a departure from a more common data model design, but it may be necessary to achieve the flexibility we want. I'm wondering if other architects have exp...
<p>I have a weird experience with this; which is as follows:</p> <p>Architect/programmer designs extermely symmetrical, generic model that looks really really neat and is very tree-ish and recursive.</p> <p>When it comes to user interface design the <em>customer</em> or <em>user</em> insists that real usage is much s...
C++ DLL: Not exposing the entire class <p>How can I "hide" parts of a class so that whoever is using the libary does not have to include headers for all the types used in my class. Ie take the MainWindow class below, ho can I have it so when compiled in a static/dynamic libary, whoever is useing the libary does NOT hav...
<p>You can hide parts of a class using the so-called "cheshire cat", "letter/envelope", or "pimpl" technique (which are, all, different names for the same technique):</p> <pre><code>class MainWindow { private: //opaque data class ImplementationDetails; ImplementationDetails* m_data; public: ... declare...
How do you return a vector iterator from a variable in a templated class? <p>I'm trying to return an iterator for a vector in a templated class (I'm not sure if that makes a difference, but I've read that may, so I thought I'd mention it). The problem is that I get an error about C++ not supporting default-int when I ...
<p>Also remember to use typename when declaring the template-dependent return type:</p> <pre><code>typename vector&lt; shared_ptr&lt; vector&lt; T &gt; &gt; &gt;::iterator GetRowIterator(); </code></pre> <p>and the method definition</p> <pre><code>typename vector&lt; shared_ptr&lt; vector&lt; T &gt; &gt; &gt;::const...
How do I paint Swing Components to a PDF file with iText? <p>I would like to print my Swing JComponent via iText to pdf. </p> <pre><code>JComponent com = new JPanel(); com.add( new JLabel("hello") ); PdfWriter writer = PdfWriter.getInstance( document, new FileOutputStream( dFile ) ); document.open( ); PdfContentByte...
<p>I have figured it out adding addNotify and validate helps.</p> <pre> com.addNotify( ); com.validate( ); </pre>
PageMethod Not Updating - Requires Project Rebuild to be Updated <p>I am using the AJAX Toolkit:</p> <pre><code> &lt;ajaxToolkit:CascadingDropDown ID="CategoryDDL_C" runat="server" TargetControlID="CategoryDDL" Category="Main" PromptText="Please select a category" LoadingText="[Loading...]" Se...
<p>Web <em>application</em> projects need to be recompiled when codebehind files change, web <em>site</em> projects do not. Which is yours?</p>
Is there a MVC pattern for C# in WPF <p>Is there a pattern where in WPF, I can build a simple UI form from an XML like definition file pulled from a database? </p> <p>It would allow the user to enter data into this form, and submit it back. The data would be sent back in an XML structure that would closely/exactly ...
<p>Model View Presenter seems to suit WPF quite well, if you've not heard of it before check out the <a href="http://martinfowler.com/eaaDev/SupervisingPresenter.html" rel="nofollow">Supervisor Controller</a> pattern, which is a subset of MVP (the author has renamed it to <a href="http://martinfowler.com/eaaDev/Supervi...
Is there a DesignMode property in WPF? <p>In Winforms you can say </p> <pre><code>if ( DesignMode ) { // Do something that only happens on Design mode } </code></pre> <p>is there something like this in WPF?</p>
<p><strong>Indeed there is</strong>:</p> <p><strong><a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.designerproperties.getisindesignmode.aspx">System.ComponentModel.DesignerProperties.GetIsInDesignMode</a></strong></p> <p>Example:</p> <pre><code>using System.ComponentModel; using System.Window...
Using DateTime in a SqlParameter for Stored Procedure, format error <p>I'm trying to call a stored procedure (on a SQL 2005 server) from C#, .NET 2.0 using <code>DateTime</code> as a value to a <code>SqlParameter</code>. The SQL type in the stored procedure is 'datetime'.</p> <p>Executing the sproc from SQL Managemen...
<p>How are you setting up the <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.aspx"><code>SqlParameter</code></a>? You should set the <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.sqldbtype.aspx"><code>SqlDbType</code> property</a> to <a href="h...
Numbers of ways of Rendering in Qt <p>Can anyone please tell me how many ways are there to render a screen in Qt.Like Show() , QDirectPainter etc...</p>
<p>Qt is double buffered. So, you would use update() to request a screen redraw. Another perspective would be to enumerate the backends in Qt - and this varies on different platforms. E.g. for Windows you can use raster, OpenGL or Direct3D. In Qt 4.5 a new graphics system is introduced, where you can specify that <em>a...
Django on IronPython <p>I am interested in getting an install of Django running on IronPython, has anyone had any success getting this running with some level of success? </p> <p>If so can you please tell of your experiences, performance, suggest some tips, resources and gotchas?</p>
<p>Besides the Jeff Hardy blog post on <a href="http://jdhardy.blogspot.com/2008/12/django-ironpython.html">Django + IronPython</a> mentioned by Tony Meyer, it might be useful to also read Jeff's two other posts in the same series on his struggles with IronPython, easy_install and zlib. The first is <a href="http://jdh...
ASP.NET Controller Base Class User.Identity.Name <p>As described in <a href="http://www.asp.net/Learn/mvc/tutorial-13-cs.aspx" rel="nofollow">this post</a>, I created an abstract base controller class in order to be able to pass data from a controller to master.page. In this case, I want to lookup a user in my db, quer...
<p>As Paco suggested, the viewdata isn't initialized till after you are trying to use it.</p> <p>Try overriding Controller.Initialize() instead:</p> <pre><code>public abstract class ApplicationController : Controller { private IUserRepository _repUser; public ApplicationController() { } protecte...
Is it advantageous to use threads in windows? <p>Some of the fellows in the office think that when they've added threads to their code that windows will assign these threads to run on different processors of a multi-core or multi-processor machine. Then when this doesn't happen everything gets blamed on the existence...
<p>When an application spawns multiple threads, it is indeed possible for them to get assigned to different processors. In fact, it is not uncommon for incorrect multi-threaded code to run ok on a single-processor machine but then display problems on a multi-processor machine. (This happens if the code is safe in t...
IIS6 is not finding .asp files <p>Hoping someone can provide an answer with this, although it's not 100% programming related. All of a sudden my IIS6 install on Server 2003 will give me a "404 Not Found" error when I try to load any file ending in .asp. </p> <p>I can see the file there if I turn on directory browsin...
<p>In the Web Service Extensions area, make sure Active Server Pages is enabled</p>
Visual Studio Shortcut for Automatically Creating Constructors from an Inherited Class <p>Say I am inheriting from a class with several "overloaded" constructors.</p> <p>By any chance is there a short cut in Visual Studio which writes the constructors in the derived class with the same signatures as in the default cla...
<p>I don't know about a shortcut in a standard Visual Studio installation, but if you install the excellent Resharper plugin from jetBrains, it is Alt-Insert, C. I don't develop without it.</p>
What is the LD_PRELOAD trick? <p>I came across a reference to it recently on <a href="http://www.reddit.com/r/programming/comments/7o8d9/tcmalloca_faster_malloc_than_glibcs_open_sourced/c06wjka">proggit</a> and (as of now) it is not explained.</p> <p>I suspect <a href="http://stackoverflow.com/questions/335108/hide-sy...
<p>If you set <code>LD_PRELOAD</code> to the path of a shared object, that file will be loaded <strong>before</strong> any other library (including the C runtime, <code>libc.so</code>). So to run <code>ls</code> with your special <code>malloc()</code> implementation, do this:</p> <pre><code>$ LD_PRELOAD=/path/to/my/ma...
How do you post data with a link <p>I have a database which holds the residents of each house in a certain street. I have a 'house view' php web page which can display an individual house and residents when given the house number using 'post'. I also have a 'street view' web page which gives a list of houses. What I wa...
<p>If you want to pass the data using POST instead of GET, you can do it using a combination of PHP and JavaScript, like this:</p> <pre><code>function formSubmit(house_number) { document.forms[0].house_number.value = house_number; document.forms[0].submit(); } </code></pre> <p>Then in PHP you loop through the hou...
Seeding java.util.Random with consecutive numbers <p>I've simplified a bug I'm experiencing down to the following lines of code:</p> <pre><code> int[] vals = new int[8]; for (int i = 0; i &lt; 1500; i++) vals[new Random(i).nextInt(8)]++; System.out.println(Arrays.toString(vals)); </code></pre> <p>T...
<p>As much as possible, the seed for an RNG should itself be random. The seeds that you are using are only going to differ in one or two bits.</p> <p>There's very rarely a good reason to create two separate RNGs in the one program. Your code is not one of those situations where it makes sense.</p> <p>Just create on...
What is the best way to call a .net webservice using jquery? <p>I'd like to call a .net webservice from another domain using only jquery.</p> <p>What is the best way to do this? and are there any configuration changes I need to be aware of on the web site hosting the web page?</p> <p>The reason I ask this, is that I ...
<p>The browser does not allow XMLHTTPRequest calls across domains in its default configuration. You can change browser settings to make certain calls succeed, but this is considered bad practice.</p> <p>In order to perform cross-domain requests, you can </p> <ul> <li><p><a href="http://dotnetslackers.com/columns/ajax...
How do I mock the Python method OptionParser.error(), which does a sys.exit()? <p>I'm trying to unit test some code that looks like this:</p> <pre><code>def main(): parser = optparse.OptionParser(description='This tool is cool', prog='cool-tool') parser.add_option('--foo', action='store', help='The foo option ...
<p>Will this work instead of <code>assertEquals</code>?</p> <pre><code>self.assertRaises(SystemExit, sut.main, 2) </code></pre> <p>This should catch the <code>SystemExit</code> exception and prevent the script from terminating.</p>
How to create custom MouseEvent.CLICK event in AS3 (pass parameters to function)? <p>This question doesn't relate only to MouseEvent.CLICK event type but to all event types that already exist in AS3. I read a lot about custom events but until now I couldn't figure it out how to do what I want to do. I'm going to try to...
<p>You really need to extend the event class to create your own event with extra parameters. Placing functions inside the addEventListener (anonymous functions) is a recipe for memory leaks, which is not good. Take a look at the following.</p> <pre><code>import flash.events.Event; //custom event class to enable the ...
Curing the "Back Button Blues" <p>Ever stumbled on a tutorial that you feel is of great value but not quite explained properly? That's my dilemma. I know <a href="http://www.tonymarston.net/php-mysql/backbuttonblues.html" rel="nofollow">THIS TUTORIAL</a> has some value but I just can't get it. </p> <ol> <li>Where do y...
<p>That is a good discussion but more to the point you should be looking into Post Redirect Get (PRG) also known as "Get after Post."</p> <p><a href="http://www.theserverside.com/patterns/thread.tss?thread_id=20936" rel="nofollow">http://www.theserverside.com/patterns/thread.tss?thread_id=20936</a></p>
Where do you edit the constructor template on resharper 4.1? <p>When I create a constructor with parameters using Resharper's 'Generate code' feature, I get something like this:</p> <pre><code>public class Example{ private int _x; private int _y; public Example(int _x, int _y){ this._x = _x; ...
<p>Options / Languages / Common / Naming Style You should set your field prefix to underscore.</p>
How do I start a Storyboard in a Data Template in a Content Control in a User Control from codebehind? <p>PHEW.</p> <p>I'm serious. I'll spell it out as follows...</p> <p>The Storyboard has a Key "myStoryboard". It's held in a DataTemplate with a key "myDataTemplate".</p> <p>This data template is used in a ContentCo...
<p>AH HAH!</p> <p>So I found a roundabout way to solving this. My third update where I entertained the thought of just firing an event seemed more fruitful. All can be found here.</p> <p><a href="http://www.codeproject.com/script/Forums/View.aspx?fid=1004114&amp;msg=2827455" rel="nofollow">http://www.codeproject.com...
Data structure or algorithm for second degree lookups in sub-linear time? <p>Is there any way to select a subset from a large set based on a property or predicate in less than <code>O(n)</code> time?</p> <p>For a simple example, say I have a large set of authors. Each author has a one-to-many relationship with a set o...
<p>For joins like this on large data sets, a modern RDBMS will often use an algorithm called a <strong>list merge</strong>. Using your example:</p> <ol> <li>Prepare a list, A, of all authors who live in Chicago and sort them by author in O(Nlog(N)) time.*</li> <li>Prepare a list, B, of all (author, book name) pairs a...
What is the easiest way to export data from a live google app engine application? <p>I'm especially interested in solutions with source code available (django independency is a plus, but I'm willing to hack my way through)</p>
<p>You can, of course, write your own handler. Other than that, your options currently are limited to:</p> <ul> <li><a href="http://github.com/fczuardi/gae-rest/tree/master">gae-rest</a>, which provides a RESTful interface to the datastore.</li> <li><a href="http://code.google.com/p/approcket/">approcket</a>, a tool f...
Is Drupal ready for the enterprise? <p>Is anyone out there using Drupal for large scale, business critical enterprise applications?</p> <p>Does Drupal's lack of database transaction support dissuade potential users?</p> <p>Are there any other lightweight web-frameworks based on dynamic languages that people are using...
<p><strong>Answer One: Yes</strong></p> <ul> <li>internet_search://"drupal in the enterprise" &lt;- use this exact phrase</li> <li><a href="http://drupal.org/success-stories">Drupal "Success Stories"</a></li> <li><a href="http://drupal.org/node/314624">Student Activities Supports 170 Drupal 6 Sites at Texas A&amp;M</a...
Viewing include dependencies <p>Does anyone know of a tool that will analyse a C++ codebase and display a graphical representation of which files include which header files and highlight redundant includes? I've used Understand C++ but it's expensive and became very unwieldy very quickly on a large (and poorly encapsul...
<p>There's always the <em>"-H"</em> option to gcc/g++...</p> <p>Eg.: % <strong>g++ -H foo.C</strong></p> <pre><code>'-H' Print the name of each header file used, in addition to other normal activities. Each name is indented to show how deep in the '#include' stack it is. Precompiled header files are...
Any reason I couldn't create a language supporting infix, postfix, and prefix functions, and more? <p>I've been mulling over creating a language that would be extremely well suited to creation of DSLs, by allowing definitions of functions that are infix, postfix, prefix, or even consist of multiple words. For example,...
<p>This is not too hard to do. You'll want to assign each operator a <em>fixity</em> (infix, prefix, or postfix) and a <em>precedence</em>. Make the precedence a real number; you'll thank me later. Operators of higher precedence bind more tightly than operators of lower precedence; at equal levels of precedence, you...
How to format a string of HTML programatically <p>I've got unformatted html in a string.</p> <p>I am trying to format it nicely and output the formatted html back into a string. I've been trying to use The System.Web.UI.HtmlTextWriter to no avail:</p> <pre><code>System.IO.StringWriter wString = new System.IO.StringWr...
<p>You can pass it to <a href="http://tidy.sourceforge.net/" rel="nofollow">tidy</a> externally or use <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmltextwriter.aspx" rel="nofollow">XmlTextWriter</a> if you are willing to use XHTML instead of HTML.</p>
Does each row in a silverlight dataGrid have to have the same "RowDetailsTemplate"? <p>I'm defining a datagrid's RowDetailsTemplate in the following way:</p> <p>RowDetailsTemplate="{StaticResource defaultTemplate}"</p> <p>where</p> <pre><code>&lt;UserControl.Resources&gt; &lt;DataTemplate x:Key="defaultTemplate"...
<p>You can add the following code in your LoadingRowDetails event, obviously replacing my useless If condition with your own:</p> <pre><code> If 1 = 1 Then e.Row.DetailsTemplate = CType(Resources("defaultTemplate"), DataTemplate) Else e.Row.DetailsTemplate = CType(Resources("otherTemplate"), Dat...
How to create a GUID/UUID using the iPhone SDK <p>I want to be able to create a GUID/UUID on the iPhone and iPad. </p> <p>The intention is to be able to create keys for distributed data that are all unique. Is there a way to do this with the iOS SDK?</p>
<pre><code>[[UIDevice currentDevice] uniqueIdentifier] </code></pre> <p>Returns the Unique ID of your iPhone.</p> <blockquote> <p>EDIT: <code>-[UIDevice uniqueIdentifier]</code> is now deprecated and apps are being rejected from the App Store for using it. The method below is now the preferred approach.</p> </block...
Is there a good reference for Joomla 1.5 development? <p>I've been hacking together some basic Joomla 1.5 components and modules recently and always every time I get into it, I end up tearing my hair out because I simply do not understand how the MVC pattern works. Some examples of the problems I run into:</p> <ul> <l...
<p>Although there are some articles about the core team mixed in, here is a link to the development category where you can get the most out of the docs site: <a href="http://docs.joomla.org/Category:Development" rel="nofollow">http://docs.joomla.org/Category:Development</a> And yes, the Joomla! Framework could use a LO...
NSNumberFormatter for rounding up float values <p>I have a CGFloat value which I want to round to 3 digits after the decimal point. How should I do this?</p> <p>Thanks.</p>
<pre><code>NSString *value = [NSString stringWithFormat:@"%.3f", theFloat]; </code></pre>
Can you nest C preprocessor directives? <p>For instance, is the following possible:</p> <pre><code>#define definer(x) #define #x? </code></pre>
<p>No, you can't do that.<br /> The pound (<code>#</code>) symbol has a different meaning while in a definition. it means - if this is an argument, make it a string by quoting it.</p>
Javascript Drag and Drop Grid <p>I'm looking for a script that would allow me to have a grid of draggable divs (used to organize <a href="http://imgfave.com/?view=thumb">image thumbnails</a>). So when one div is dragged over another, the divs would shift to create an empty spot to drop the div.</p> <p>I know jQuery ha...
<p>Have a look at the <a href="http://www.jquery.com">JQuery</a> and more specifically, <a href="http://ui.jquery.com/">JQuery UI</a> since it has "draggable", "droppable", "sortable", and a variety of other complex components.</p> <p>Here is the specific example of a <a href="http://ui.jquery.com/demos/sortable#float...
How Do I Get External LIbrary Like Html Agility To Work In My C# Project? <p>How do I use a free library, such as Html Agility in my Visual Studio Express C# programs? Obviously I have downloaded it. What I need to know is how do I set it up so I can simply use a "using" statement to link up with the classes. Html A...
<p>Since you don't have any binaries with the downloaded thing, this means that what you have got is the source code. So, you should know that which type of code is this. Is this a .NET code? (if it is so, it should have a .csproj or a .vbproj etc file with it.) Then again it depends that with which development enviro...
Unit testing and mocking email sender in Python with Google AppEngine <p>I'm a newbie to python and the app engine.</p> <p>I have this code that sends an email based on request params after some auth logic. in my Unit tests (i'm using <a href="http://code.google.com/p/gaeunit/" rel="nofollow">GAEUnit</a>), how do I co...
<p>You could also override the <code>_GenerateLog</code> method in the <code>mail_stub</code> inside AppEngine.</p> <p>Here is a parent TestCase class that I use as a mixin when testing that e-mails are sent:</p> <pre><code>from google.appengine.api import apiproxy_stub_map, mail_stub __all__ = ['MailTestCase'] cla...
Can Window application continue to run despite computer going to standby mode? <p>I am developing a Windows application using C#.net. This will accept the login details, validate the login and then keep running unattended till the time the computer is on.</p> <p>This computer won't do anything else and go to standby m...
<p>I'm not sure I understand completely - you want your app to carry on running WHILE the computer is asleep? If so then there's no way you can do that, it's asleep :) Services don't carry on running when the machine is sleeping either.</p> <p>It should still be running when the machine wakes back up again though.</p>...
Regarding Home page <p>I hava a web application. In that i have a link called "Home". When the user clicks the starting page of the web application that is index.jsp should be displayed in the same page. How can i do that. It should work in internet explorer. </p> <p>I have the following html page.</p> <pre><code>&lt...
<p>&lt; a href="url">home&lt; /a > </p>
Overwrite executable in C:\Program\MyProg on Windows Vista <p>I would like my program to update itself (downloading a new exe and/or some other files from ftp) and I used the recipe in the accepted answer to <a href="http://stackoverflow.com/questions/264788/can-i-update-a-exe-that-is-running-closed">this question</a>....
<p>The simple option is to include a manifest that specifies that the application needs administrator rights. Then Vista will automatically prompt for the rights elevation. The manifest should look something like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;assembly xmlns="urn...
How to limit RDLC report for one page in a PDF ? <p>I have a RDLC report and I am displaying it on the Report Viewer Control in my front end application. I am able to view the report perfectly.</p> <p>But the problem arises when I try to export the report to a PDF (using the built-in option).</p> <p>I print the repor...
<p>The answer is pretty similar to what Dugan said, but it's not always just the margins. It is pretty simple though:</p> <p>When you are editing the rdlc file in design mode, firstly click on an empty part of the BODY area of your design. Hit F4 to see the properties tab. Here, you will see a "Size" property. This...