input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Tools for programming tutorials? <p>I engage in lot of training sessions and I would like to create video tutorials of all my sessions so that I can distribute it. What are the best Windows-based tools to add my PowerPoint slides, notes, voice and video (tutorials of code I write) and compile them into one video?</p>
| <p><a href="http://www.techsmith.com/camtasia.asp" rel="nofollow">Camtasia</A>, if you're on Windows.</p>
|
Creating a class to use for populating drop-down lists, grids, etc., in C# <p>Please keep in mind that I'm new to C# and OOP so I apologize in advance if this seems like an easy question to some. I'm going back through my code and looking for ways to objectify repetitive code and create a class for it so that I can si... | <p>This is a down and dirty method of reducing your code duplication. It's not really the right way to go about setting up a Data Access Layer (DAL) and a Business Logic Layer (BLL), which I'd suggest learning about instead.</p>
<pre><code>protected void FillFromDatabase( string sql, BaseDataBoundControl dataControl)... |
Is there a way to avoid errors when releasing an object while code is still running? <p>I have a UIView subclass that draws itself when <code>-drawRect:</code> is called. It only takes a moment, but under extreme circumstances, such as low memory and deletion of the instance when going to another view controller, the ... | <p>Start by reading Apple's Memory Management Rules:</p>
<p><a href="http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html" rel="nofollow">Cocoa Memory Management Rules</a></p>
<p>The bottom line: the way to "deal" with the issue is to make sure you manage your objects ... |
Next and Previous to navigate text fields <p>I have a sign-up form in my application with several UITextFields. In order to speed up the process I would like to add a next and previous button to a toolbar pinned above the keyboard and allow the user to "tab" between the fields using these buttons.</p>
<p>I know I can... | <p>If you want to add this type of functionality to your app, you need to create a custom view with the next/previous buttons and position it properly when the keyboard appears. Then handle any touches to those buttons.</p>
|
How to build Apple's GCC on Linux/Windows? <p>I don't have a Mac, but I have an iPhone. I want to develop applications for iPhone.
After some research I think I need just the headers and library from the free SDK, and a GCC build that supports ARM/Mach-O.
Apple released the code for GCC used in the iPhone SDK (they had... | <p>Look into winchain - this tool builds the iphone chain on windows allowing you to compile iphone apps on windows:</p>
<p><a href="http://code.google.com/p/winchain/wiki/HowToUse" rel="nofollow">http://code.google.com/p/winchain/wiki/HowToUse</a></p>
|
Real time scripting language + MS DLR? <p>For starters I should let you guys know what I'm trying to do. The project I'm working on has a requirement that requires a custom scripting system to be built. This will be used by non-programmers who are using the application and should be as close to natural language as po... | <p><a href="http://www.lua.org" rel="nofollow">Lua</a></p>
<p>it's small, fast, easy to embed, portable, extensible, and fun!</p>
|
Retrieving original values of modified references <p>I've figured out how to use the <code>ObjectStateManager</code> and <code>ObjectStateEntries</code> to determine original values of scalar properties for a given entity. </p>
<p>What I need to know now is how to do the same for navigation properties. The <code>GetMo... | <p>Just get all added or deleted ObjectStateEntries and then use LINQ to only get those that represent relationships:</p>
<pre><code>private IEnumerable<ObjectStateEntry> GetModifiedRelationshipEntries()
{
return ObjectStateManager.GetObjectStateEntries(
EntityState.Added | EntityState.Deleted)
... |
How Do I Run Sutton and Barton's "Reinforcement Learning" Lisp Code? <p>I have been reading a lot about <a href="http://en.wikipedia.org/wiki/Reinforcement%5FLearning" rel="nofollow">Reinforcement Learning</a> lately, and I have found <a href="http://www.cs.ualberta.ca/~sutton/book/the-book.html" rel="nofollow">"Reinfo... | <p>My guess is that the code is CCL-dependent, so use <a href="http://www.cliki.net/CCL" rel="nofollow">CCL</a> instead of CLISP or SBCL. You can download it from here: <a href="http://trac.clozure.com/openmcl" rel="nofollow">http://trac.clozure.com/openmcl</a></p>
|
Reloading/Refreshing Spring configuration file without restarting the servlet container <p>How can I refresh Spring configuration file without restarting my servlet container?</p>
<p>I am looking for a solution other than JRebel.</p>
| <p>Well, it can be useful to perform such a context reload while testing your app.</p>
<p>You can try the <code>refresh</code> method of one of the <code>AbstractRefreshableApplicationContext</code> class: it won't refresh your previously instanciated beans, but next call on the context will return refreshed beans.</p... |
Deferred EL in JSP 2.0 <p>Is there a way to use something like deferred EL in JSP 2.0 / J2EE 1.4? The idea is to pass a test to a tag file and have it display an item in a list (or not) based on the value of the expression. Basically, I'd like to do something like this:</p>
<p>JSP:</p>
<pre><code><x:myTag items=... | <p>You should be able to do this with <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/bnaln.html#bnalq" rel="nofollow">jsp fragments</a>. I believe it will not be the extremely elegant solution you would appreciate, but it does allow the execution of the expression to be deferred until inside the tag. </p>
<p>... |
MSSQL Select statement with incremental integer column... not from a table <p>I need, if possible, a t-sql query that, returning the values from an arbitrary table, also returns a incremental integer column with value = 1 for the first row, 2 for the second, and so on.</p>
<p>This column does not actually resides in a... | <p>For SQL 2005 and up</p>
<pre><code>SELECT ROW_NUMBER() OVER( ORDER BY SomeColumn ) AS 'rownumber',*
FROM YourTable
</code></pre>
<p>for 2000 you need to do something like this</p>
<pre><code>SELECT IDENTITY(INT, 1,1) AS Rank ,VALUE
INTO #Ranks FROM YourTable WHERE 1=0
INSERT INTO #Ranks
SELECT SomeColumn FR... |
Updating all ListView items together instead of one-by-one? <p>I have a invoice entry form in ASP.Net 3.5. I have a FormView for the main invoice form and a ListView for the invoice line items. I don't want to commit each line item to the database individually when the user edits them. I want to commit them all as a gr... | <p>If you are using LinqDataSource if the use action has made changes to the entity just invoke the SubmitChanges method will commit the data changes back to the Database in a single transaction.</p>
|
.getJSON produce a Download of a File ASP.NET MVC <p>I code a .getJSon, It does the job but I get IE to asked to download the file. Here is the code</p>
<pre><code><script type="text/javascript">
$(function() {
$('#id').click(function() {
var dateReport = "01/01/2009";
$.getJSON('/Report/Sen... | <p>Try adding the <code>event.preventDefault();</code> on the click event:</p>
<pre><code>$(function() {
$('#id').click(function(event) {
var dateReport = "01/01/2009";
event.preventDefault(); // added this
$.getJSON('/Report/SendReport', { date: dateReport},
function(resp... |
Reading the g:datePicker-value in Grails without using the "new Object(params)"-method <p>Let's say I have a datePicker called "foobar":</p>
<pre><code><g:datePicker name="foobar" value="${new Date()}" precision="day" />
</code></pre>
<p>How do I read the submitted value of this date-picker?</p>
<p>One way whi... | <p>Use the <a href="http://grails.org/Command+objects+and+Form+Validation" rel="nofollow">command object</a> idiom. In the case of your example, I will assume that your form calls the action <code>handleDate</code>. Inside the controller:</p>
<pre><code>
def handleDate = { FoobarDateCommand dateCommand ->
def the... |
Multiple Parameter Search in SQL Server 2000 <p>I have a search screen in a Visual Basic .Net App that has text boxes for:</p>
<ol>
<li>First Name Varchar(50)</li>
<li>Last Name Varchar(50)</li>
<li>Middle Name Varchar(50)</li>
<li>DOB DateTime</li>
<li>Home Phone Varchar(10)</li>
<li>Work Phone Varchar(10)</li>
</ol... | <p>I use this pattern a lot:</p>
<p><code></p>
<pre><code>Select Last_Name, First_Name, Mid_Name, DOB, Home_Phone, Work_Phone from dbo.tblClient
Where (@LastName is null or Last_Name Like '%'+ @LastName)
and (@FirstName is null or First_Name Like '%'+ @FirstName)
and (@HomePhone is null or Home_Phone Like '%'+ @HomeP... |
Bulk upgrade VS2005 solutions to VS2008 <p>Is it possible to bulk upgrade (many at the same time) VS 2005 projects to VS 2008.</p>
<p>I know that I can open one at a time, however, I would like to select say 10 at a time to upgrade and add to a new solution.</p>
| <p>I recently came across the same problem and used a Windows Powershell script to get Visual Studio to do the upgrading for me using the <a href="http://msdn.microsoft.com/en-us/library/w15a82ay.aspx" rel="nofollow">/upgrade</a> command line switch</p>
<pre><code>$slnFiles = ls C:\source -Filter *.sln -Recurse
$deve... |
Yahoo Finance API like chart <p>I want to create a chart very similar to <a href="http://finance.yahoo.com/echarts?s=%5EDJI#chart1%3asymbol=%5Edji;range=6m;indicator=volume;charttype=line;crosshair=on;ohlcvalues=0;logscale=on;source=undefined" rel="nofollow">yahoo Finance interactive chart</a> in a .NET application. Th... | <p>If your looking at a web based chart, the <i>flot</i> graphs for jQuery are a good option IMHO. They look pretty schnazzy, are interactive and are very simple to get working.</p>
<p><a href="http://plugins.jquery.com/project/flot" rel="nofollow">http://plugins.jquery.com/project/flot</a></p>
|
Limiting the data returned by a controller <p>I need advice on how to return a limited set of data from an MVC controller.</p>
<p>Lets say I have a class that is constructed like so:</p>
<pre><code>public interface ICustomerExpose
{
string Name {get; set;}
string State {get; set;}
}
public interface ICustomer:... | <p>You can try this, however I am not sure if it works with xml serializers:</p>
<pre><code>return new XmlResult(new { customer.Name, customer.State });
</code></pre>
|
Return anonymous type results? <p>Using the simple example below, what is the best way to return results from multiple tables using Linq to SQL?</p>
<p>Say I have two tables:</p>
<pre><code>Dogs: Name, Age, BreedId
Breeds: BreedId, BreedName
</code></pre>
<p>I want to return all dogs with their <code>BreedName</co... | <p>I tend to go for this pattern:</p>
<pre><code>public class DogWithBreed
{
public Dog Dog { get; set; }
public string BreedName { get; set; }
}
public IQueryable<DogWithBreed> GetDogsWithBreedNames()
{
var db = new DogDataContext(ConnectString);
var result = from d in db.Dogs
... |
Can I have a Django model that has a foreign key reference to itself? <p>Okay, how would I do this?</p>
<pre><code>class Example(models.Model):
parent_example = models.ForeignKey(Example)
</code></pre>
<p>I want to have a model have a foreign key reference to itself. When I try to create this I get a django valida... | <p>You should use</p>
<pre><code>models.ForeignKey('self')
</code></pre>
<p>as mentioned <a href="http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey">here</a>.</p>
|
How to refer to current node value in XSL for-each test? <p>Let's say I have an XML doc like this:</p>
<pre><code><books>
<book>1110</book>
<book>1111</book>
<book>1112</book>
<book>1113</book>
</books>
</code></pre>
<p>I'm trying to setup a ... | <p>Using <code>.</code> can, indeed, refer to the current (or "context") node, but not the way you're using it here. In XPath, <code>.[foo]</code> is not valid syntax â you need to use <code>self::node()[foo]</code> instead. Also, the <code>=</code> operator needs something to match against, in this case the <code>... |
Zend Form: How do I make it bend to my will? <p>I've read the manual many times, I've scoured the posts offered by Google on the subject, I have even bought a couple of books that deal with ZF. Now, why am I still confused?</p>
<p>I can, using Zend_Form, make a form that validates and functions fine. What I cannot do ... | <p>Barrett Conrad's advice is what I would have suggested. Also, keep in mind that you don't need to use a form object to render your form.</p>
<p>One thing you could do is create a form in your view script that has elements with the same name as a form class.</p>
<p>Your HTML form:</p>
<pre><code><form action="/... |
Best way to learn about .net MVC for a php programmer <p>Ok i know theres a ton of questions around books and tutorials to learn MVC in dot net, BUT after I started reading some of that stuff i realized they are not oriented to people like me. </p>
<p>I have been working with php on Zend in a MVC configuration and don... | <p>Screencasts help me more than anything. Seeing someone actually do something is many times more instructive than reading. Watch the screencasts on <a href="http://www.asp.net/learn/mvc-videos/#howdoi" rel="nofollow">http://asp.net/mvc</a>. Scott Hanselman's preview 3 videos are still relevant, as there haven't be... |
Where can I find a map control for Delphi? <p>I am trying to build an option in a application that let user see a map. This map must be editable, and tag enabled. It should also be possible to see sub regions in different colors, and highlight the one under the mouse.</p>
| <p>TGlobe is good one, but hasn't updated since 2004, If you need more than showing a map, and build a GIS like application I suggest use one of these:</p>
<ol>
<li><a href="http://www.tatukgis.com/Home/home.aspx" rel="nofollow">TatukGIS</a> (very powerful GIS Components and writing as Native VCL).</li>
<li><a href="h... |
Where can I find an image watermark control for Delphi? <p>Is there a good image watermark control for Delphi? It would be nice if it could receive both text and images to insert in a base photo.</p>
<p>I would also prefer it was free.</p>
| <p>I couldn't find any pre-packaged controls. But watermarking is not very hard at all. All you simply need to do is draw an image on top of another image with the use of alpha blending. <a href="http://www.efg2.com/Lab/Library/Delphi/Graphics/Algorithms.htm" rel="nofollow">This</a> site has a whole section on alpha... |
Tracking the script execution time in PHP <p>PHP must track the amount of CPU time a particular script has used in order to enforce the max_execution_time limit. </p>
<p>Is there a way to get access to this inside of the script? I'd like to include some logging with my tests about how much CPU was burnt in the actua... | <p>If all you need is the wall-clock time, rather than the CPU execution time, then it is simple to calculate: </p>
<pre><code>//place this before any script you want to calculate time
$time_start = microtime(true);
//sample script
for($i=0; $i<1000; $i++){
//do anything
}
$time_end = microtime(true);
//dividi... |
How to add NSDebug.h and use NSZombie in iPhone SDK <p>I want to enable NSZombies for my iPhone app.</p>
<p>I have read several articles online and I am still unsure of the exact procedure.</p>
<p>I know I have to set the Environment Variables, which I have done:</p>
<pre><code>NSZombieEnabled = YES
NSDebugEnabled =... | <p>Are you setting the environment variable correctly? The step by step guide is</p>
<ol>
<li>Double-click an executable in the Executables group of your Xcode project.</li>
<li>Click the Arguments tab.</li>
<li>In the "Variables to be set in the environment:" section, make a variable called "NSZombieEnabled" and set ... |
Alternative to Lattice's GAL and ispGAL chips <p>I took a class last semester about programming with embedded hardware, mainly using GAl chips from Lattice and ABEL to program them. I'd like to continue this for fun outside of the class, but I find things to be cost prohibitive due to the high costs of buying a program... | <p>Try a Xilinx evaluation board, the education priced ones are pretty cheap. And you're a student!</p>
<p>I'd guess based on the AUD price, of $150 about USD$100 with all the tools.</p>
<p>This is a bit pricey, but the chip is big enough to do a whole computer in gates.
The eval board has ethernet, PS/2, serial, usb... |
Is if (variable) the same as if (variable != nil) in Objective-C <p>I am getting a EXC_BAD_ACCESS (SIGBUS) on this line in my iPhone project:</p>
<pre><code>if (timeoutTimer) [timeoutTimer invalidate];
</code></pre>
<p>The thing that has me stumped is that I don't understand how that line could crash, since the if st... | <p>Just because a variable is set to a value other than <code>nil</code> doesn't mean it's pointing to a valid object. For example:</p>
<pre><code>id object = [[NSObject alloc] init];
[object release];
NSLog(@"%@", object); // Not nil, but a deallocated object,
// meaning a likely crash
</code></... |
JQuery , set attribute for <a> tag <p>i am use $(expr).attr("hash",value) to set a "hash" attribute for HTML anchor element "a"
but the Jquery would not do that. but if i change expr to "div", then i can set
"hash" attribute to "div" tag.</p>
<p>is this behavior a xhtml specification? i can set "id" of "a" tag attrib... | <blockquote>
<p>to set a "hash" attribute for HTML anchor element "a"</p>
</blockquote>
<p>The <a> element (HTMLLinkElement) already has a DOM Level 0 <code>hash</code> property. It is used like window.location.hash to read or set the â...#anchorâ part at the end of the URL being referred to by the element's ... |
Adding new methods to LINQ to SQL generated classes <p>I am new to LINQ. I just dragged all my database tables onto the designer in a LINQ to SQL dbml. All my relationships are correct and look nice in the designer. I am able to pull data using simple LINQ code. I want to add my own methods now but don't want to bl... | <p>The LINQ-generated classes are partial classes, meaning you can extend them by creating your own <a href="http://msdn.microsoft.com/en-us/library/bb882671.aspx">partial classes</a> or <a href="http://msdn.microsoft.com/en-us/library/bb546176.aspx">partial methods</a>.</p>
<p>In your case, you can create a partial c... |
Techniques for steming a possible flood of automatically generated e-mail when a website encounters errors <p>For my current web development project I'm implementing a back end system that will flag errors and send an email to the administrator automatically with details about what occurred. Trapping the error and gene... | <p>Why not simply allow them all to be sent out and then collect and store them in a database on the recipient end. That way you bypass the possibility of the database being the problem in the server.</p>
<p>Also, a greater advantage in my opinion, is that you don't arbitrarily throw out valuable forensic data. Post ... |
How do you ActiveRecord query caching at the application level? <p>ActiveRecord query caching is enabled when a controller's action is invoked. I also know that you can do something like this to temporarily enable caching for a given Model for a given code block:</p>
<pre><code>User.cache do
....
end
</code></p... | <p>An ActiveRecord query cache lives only for the duration of a particular action (i.e. request). If you want a cached object to survive longer or be used between processes you need to look at something like memcached. </p>
|
Is there a .NET Culture-dependent 'Today' string? <p>I am writing a month calendar-style control, and need to display a string that indicates today's date. So on an English-culture machine it would show <code>'Today : 11/02/2009'</code>. </p>
<p>If a different culture happens to be used, such as French, then I would l... | <p>Old.. but still useful (how old? VB6 old).</p>
<p>Basically Windows keeps a localized version of "Today" in Comctl32.dll. You can fish it out with a a loadstringex call:</p>
<pre><code>Private Const IDM_TODAY As Long = 4163
Private Const IDM_GOTODAY As Long = 4164
Public Function GetTodayLocalized(ByVal LocaleId ... |
What does it mean to do/determine something "programmatically"? <p>Programmatically. (alt. programmically)</p>
<p>I've never used it, but I see it in questions a lot, i.e. "How to programmatically determine [insert task here]". Firefox immediately tells me that neither of these two words are real (at least, it doesn't... | <p>Doing something programatically generally means that you can do it using source code, rather than via direct user interaction or a macro.</p>
<p>For example, consider the problem of resizing columns to fit in Excel.</p>
<p>You could do it manually by double clicking between the columns, but that requires user inte... |
Type initializer exception - C# <pre><code>namespace X{ public static class URLs
{
public static TabController tabIdLookUp = new TabController();
public static string DASHBOARD_AUDIT_PAGE = tabIdLookUp.GetTabByName("View My Safety", 2).TabID.ToString();
public static string URL_GENERATE_WITH_MID(String Tab... | <p>Rather than having your initializer for "DASHBOARD AUDIT PAGE" refer to tabIdLookUp directly, why not instead initialize both of those variables in a static constructor and see if that fixes the error?</p>
<pre><code>namespace X{ public static class URLs
{
public static TabController tabIdLookUp;
public st... |
Ruby email check (RFC 2822) <p>Does anyone know what the regular expression in Ruby is to verify an email address is in proper RFC 2822 email format?</p>
<p>What I want to do is:</p>
<pre><code>string.match(RFC_2822_REGEX)
</code></pre>
<p>where "RFC_2822_REGEX" is the regular expression to verify if my string is in... | <p>You can use the <a href="http://rubygems.org/gems/mail">mail</a> gem to parse any string according to RFC2822 like so:</p>
<pre><code>def valid_email( value )
begin
return false if value == ''
parsed = Mail::Address.new( value )
return parsed.address == value && parsed.local != parsed.address
r... |
Pattern for Accessing Web Services <p>I need to access a Web-svc, run a bunch of queries and save the data to a store as part of an analysis. On top of this, there is a web-site that will query the datastore and show this data.</p>
<p>We have features like this getiing added every month. How can I reduce the amount of... | <p>I have found two things useful for lowering the tedious coding of the scenario<br />
- <a href="http://www.microsoft.com/biztalk/technologies/wcflobadaptersdk.mspx" rel="nofollow">WCF Line of Business Adapter SDK</a>: This provides a very powerful base for building an WCF adapter (basically like a BizTalk adapter). ... |
jQuery dialog not working after server-side redirect <p>I have an ASP.NET website which uses the jQuery dialog to present the user with a downloads terms dialog. Once the user has agreed to the terms in the dialog, the I perform a server-side postback which issues a Response.Redirect call to a page on another website w... | <p>The problem seemed to be caused by an extension function my dialog was using which was positioning the jQuery dialog into the form section of the page, to ensure server-side postbacks would work correctly. I changed the behaviour of this code to instead simply close the dialog and then invoke the serverside callback... |
C# Equivalent of Java anonymous inner classes with init blocks <p>In Java, i like to use constructs such as</p>
<pre><code>List<String> list = new ArrayList<String>() {{add("foo");}};
</code></pre>
<p>Is there a way to do this in 1 line in C#, too?</p>
| <p>This is called a <em>collection initializer</em> and it's part of C# 3.0.</p>
<p>As well as lists, you can initialize collections of more complicated types, so long as they implement IEnumerable and have approprate Add methods for each element in the collection initializer. For example, you can use the <code>Add(ke... |
Java sockets with out of band data <p>Does anybody know how to receive (how to know that you received) out-of-band data with Java sockets? In particular I've read the documentation for <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html#sendUrgentData(int)" rel="nofollow">sendUrgentData</a> and <a hre... | <p>It looks like Java, up to Java 6 (I didn't investigate Java 7 since I don't know if they've decided for sure what will go in or not) and it looks like Java does not provide any support at all for reading urgent TCP information in an out-of-band manner. And it looks like this is a deliberate choice, thus far.</p>
<... |
How do you call those little annoying cases you have to check all the time? <p>How do you call those little annoying cases that has to be checked , like "it's the first time someone entered a record / delete the last record in a linked list (in c implementation) / ... " ? </p>
<p>The only term I know translates not-ve... | <p>Edge cases.</p>
|
Automated test with Ruby: select an option from drop-down list <p>I write automated test with Ruby(Selenium framework) and I need to know how can I select an option from drop-down list.</p>
<p>Thanks in advance!</p>
| <p>building on <a href="http://stackoverflow.com/questions/535880/automated-test-with-ruby-select-an-option-from-drop-down-list/538254#538254">floehopper's answer</a>:</p>
<pre><code>selenium.addSelection(locator, value)
or
selenium.select(locator, value)
</code></pre>
<p>You almost certainly want "id=my_select_box_i... |
Check browser's cache for a js file <p>How can I check for a javascript file in user's cache. If he refreshed the page or visits the site after sometime. I need not download that js file again. Does the js files get cleaned up after a site is closed. </p>
| <p>Whether a javascript file is cached depends on how your web server is setup, how the users browser is setup and also how any HTTP proxy servers between your server and the user are setup. The only bit you can control is how your server is setup.</p>
<p>If you want the best chance of your javascript being cached the... |
UI design and cultural sensitivity/awareness <p>When designing a user interface for an application that is going to be used internationally it is possible to accidentally design an aspect of the UI that is offensive to or inappropriate in another culture.</p>
<p>Have you ever encountered such an issue and if so, how d... | <p>You should try to follow the i18n and l10n pointers provided by the look and feel guidelines for the UI library you're using, or platform you're delivering to. They often contain hints on how to avoid cultural issues, and may even contain icon libraries that have had extensive testing for such potential banana skin... |
How does Excel VSTO Work? <p>How does Excel VSTO Work? If I create an Excel Workbook solution in Visual Studio 2005 I can then happily code away with full access to the Excel object model and even treat the Excel sheet as a design surface. When I build the solution I get a <code>.XLS</code> file and a <code>.DLL</cod... | <p>According to <a href="http://msdn.microsoft.com/en-us/library/zcfbd2sk.aspx">this</a> (thanks PintSizedCat) for Excel 2003 the following happens:</p>
<blockquote>
<p>The Microsoft Office application
checks the custom document properties
to see whether there are managed code
extensions associated with the
... |
How can I find the free space available on mounted volumes using Perl? <p>I'm trying to untar a file. Before untarring I would like to know free space available on the mounted volume. The plan is if there is not enough space I will not untar it! So how can I find the free space available on a mounted volume using Perl?... | <p>You likely want the CPAN module <a href="http://search.cpan.org/dist/Filesys-DiskFree">Filesys::DiskFree</a>.</p>
|
resource for learning about predicates <p>are there any good tutorials online for learning about the c# 2.0 language feature "predicates"?</p>
<p>i'm trying to learn how to use predicates along with linq to sql to modify my queries</p>
<p>what i am trying to do is query a table of customers and filter it based on cha... | <p>A predicate is simply a method with the following signature :</p>
<pre><code>bool Predicate<T>(T item)
</code></pre>
<p>It represents a condition that can be verified or not by objects of type T.</p>
<p>It is use in link to filter enumerables in the <code>.Where</code> clause.</p>
<p>You can also use lambd... |
Search file content on iphone <p>Is there an Iphone SDK API to search resource files?</p>
<p>I have a set of html file resources that I'd like the user to be able to search in, but I want to avoid reading the files into memory and searching them one by one.</p>
<p>Is there any API that can help me do this?</p>
| <p>No, you'll have to read the files in to search them. There's nothing like "Spotlight" on the phone.</p>
|
What is the shortest perceivable application response delay? <p>A delay will always occur between a user action and an application response.</p>
<p>It is well known that the lower the response delay, the greater the feeling of the application responding instantaneously. It is also commonly known that a delay of up to ... | <p>The 100 ms threshold was established over 30 yrs ago. See:</p>
<p>Card, S. K., Robertson, G. G., and Mackinlay, J. D. (1991). The information visualizer: An information workspace. Proc. ACM CHI'91 Conf. (New Orleans, LA, 28 April-2 May), 181-188.</p>
<p>Miller, R. B. (1968). Response time in man-computer conversat... |
Simple WPF UI databinding <p>I'm trying to write a simple WPF app that has two ellipses, joined by a line, like you might see in a network graph. When the ellipses are animated, I just want the joining line to automagically 'stick' to the canvas locations of the two ellipses that the line joins. The XAML is just a ca... | <p>I don't know if it's a cut and paste error but youre assigning each binding to the same DependencyProperty "Line.X1Property", you should use all four X and Y properties to define a starting point and an ending one for a line.</p>
<pre><code>line.SetBinding(Line.X1Property, new Binding("(Canvas.Left)") { Source = el... |
Drop all the tables, stored procedures, triggers, constraints and all the dependencies in one sql statement <p>Is there any way in which I can clean a database in SQl Server 2005 by dropping all the tables and deleting stored procedures, triggers, constraints and all the dependencies in one SQL statement?</p>
<p><stro... | <p>this script cleans all views, SPS, functions PKs, FKs and tables.</p>
<pre><code>/* Drop all non-system stored procs */
DECLARE @name VARCHAR(128)
DECLARE @SQL VARCHAR(254)
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name])
WHILE @name is not null
BEGIN
SE... |
Execute arbitrary python code remotely - can it be done? <p>I'm working on a grid system which has a number of very powerful computers. These can be used to execute python functions very quickly. My users have a number of python functions which take a long time to calculate on workstations, ideally they would like to b... | <p>Take a look at <a href="http://pyro.sourceforge.net/">PyRO</a> (Python Remote objects) It has the ability to set up services on all the computers in your cluster, and invoke them directly, or indirectly through a name server and a publish-subscribe mechanism. </p>
|
Entity attachment issues in LINQ <p>I am trying to attach a LINQ entity to the data context after I receive it from a form POST. However, all I get is the following exception:</p>
<pre><code>An entity can only be attached as modified without original state if it declares a version member or does not have an update che... | <p>Try following:</p>
<pre><code>dataContext.People.Attach(person);
dataContext.Refresh(RefreshMode.KeepCurrentValues, person);
dataContext.SubmitChanges();
</code></pre>
|
Simple way to change 180 to 03:00 <p>Hey! I am trying to change a number of seconds in to a proper time stamp format.
Like I do this to change 180 to 03:00</p>
<pre><code>private void writeTime(int tempo)
{
TimeSpan otempo = new TimeSpan(0, 0, tempo);
string minutos = ((otempo... | <pre><code> int tempo = 180;
TimeSpan time = TimeSpan.FromSeconds(tempo);
string txt = string.Format(
"{0:00}:{1:00}", time.Minutes, time.Seconds);
</code></pre>
<p>(edit) As has already been observed - there are no immediate memory concerns with <code>TimeSpan</code>, since it is a <code>struct</co... |
What is the XAML syntax for setting a Trigger on a Label? <p>I have a DataTemplate that is displaying objects with three fields, e.g.:</p>
<pre><code>Name = "Font Color"
Value = "Orange"
Editable = "True"
</code></pre>
<p>but I want to display them as e.g.:</p>
<p><strong><em>Font Color: Orange Editable</em></strong... | <p>Would it work to use a <code>TextBlock</code> instead of a <code>Label</code>? <code>TextBlock</code> does have a <code>Text</code> property that you should be able to bind to in this case.</p>
<p>If you really want to use a <code>Label</code>, another approach would be to create two <code>DataTemplate</code>'s - o... |
QThread to send large queries to the database <p>I have created this class that inherits from QThread for send data to the database server, what do you think about it? Could be impreved?</p>
<p>Thanks</p>
<pre>#ifndef QUERYTHREAD_H
#define QUERYTHREAD_H
#include
class QSqlQuery;
class QueryThread : public QThread... | <p>A couple of opinions:</p>
<p>That <code>while</code> loop in <code>exec</code> elimiates the advantages of having a separate thread. You should pass the query in at the constructor, have one thread per query, <strong>don't</strong> override <code>exec</code>, prefer to just use <a href="http://doc.qt.nokia.com/late... |
ruby on rails : adding child records to an existing parent without visiting the parent <p>How would you handle allowing users to add child objects to parents without requiring them to navigate to the parent?</p>
<p>For example adding a journal article without having to navigate to the journal and issue first? The par... | <p>I'm assuming you have a journal model that has many articles and an article model that belongs to a journal. First, you should create routes to the articles controller that go through journals and not through journals:</p>
<pre><code>ActionController::Routing::Routes.draw do |map|
map.resources :journals, :has_m... |
Block commenting in Ruby <p>Does Ruby have block comments?</p>
<p>If not, is there an efficient way of inserting <code>#</code> in front of a block of highlighted code in TextMate?</p>
| <p>You can do</p>
<pre><code>=begin
[Multi line comment]
=end
</code></pre>
<p><code>=begin</code> and <code>=end</code> must be at the beginning of the line (not indented at all).</p>
<p><a href="http://www.ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/syntax.html#embed_doc">Source</a></p>
<p>Also, in TextMat... |
WPF databinding IsEnabled Property <p>So I am learning WPF right now, and want to do a simple databind between a bool value, and whether or not a <code>MenuItem</code> is enabled or not. </p>
<p>I have coded it like this:</p>
<pre><code><MenuItem Name="miSaveFile" Header="Save" Click="miSaveFile_Click"
IsEnabled=... | <p>You are better off binding to an object than to a primitive type. This object is often referred to as the "model" for your view. </p>
<p>WPF uses the INotifyPropertyChanged interface for the model (or often view-model) to notify the view that the model has changed states.</p>
<p>So you will first want to define a ... |
Is there a tool to automate/stress POST calls to my site for testing? <p>I would like to stress (not sure this is the right word, but keep reading) the [POST] actions of my controllers. Does a tool exist that would generate many scenarios, like omitting fields, adding some, generating valid and invalid values, injectin... | <p>WebInspect from Spidynamics (HP bought them).</p>
<p>I've used this one in my previous job (I recommended it to my employer at the time) and I was overwhelmed with the amount of info and testing I could do with it.</p>
<p>https://download.spidynamics.com/webinspect/default.htm</p>
|
How to connect to a secure website using SSL in Java with a pkcs12 file? <p>I have a pkcs12 file. I need to use this to connect to a webpage using https protocol. I came across some code where in order to connect to a secure web page i need to set the following system properties:</p>
<pre><code>System.setProperty("jav... | <p>For anyone encountering a similar situation I was able to solve the issue above as follows:</p>
<ol>
<li><p>Regenerate your pkcs12 file as follows:</p>
<pre><code>openssl pkcs12 -in oldpkcs.p12 -out keys -passout pass:tmp
openssl pkcs12 -in keys -export -out new.p12 -passin pass:tmp -passout pass:newpasswd
</code>... |
jQuery: CSS Selectors <p>How would I use jQuery CSS Selectors to find for instance:</p>
<p>css class name: "Text" which is a div inside of dom object "wrapper"?</p>
| <p>$('#wrapper div.Text') or $('#wrapper .Text'), depending on how specific you want to be.</p>
|
Default Windows Languages? <p>Is there some default Windows scripting language that comes pre-installed on XP and Vista (Similar to how OS X comes with Python and/or Linux comes with Perl)? </p>
<p>I am aware of Batch scripting but I am hoping for something a little more robust. Thanks</p>
<p><strong>note -</stron... | <p>Windows XP and Vista have VBScript and jscript engines installed by default. Windows 7 will also have Powershell installed.</p>
<p>As for my 2 cents, VBScript and jscript are both very mature technologies that have plenty of resources available. Neither of them give you a console if you are looking for that.</p>
<... |
What does a Flash object know about the page it's in? <p>The organization I work for has created a small flash widget that we're encouraging supporters to place on their website. I'm trying to determine if there are ways to improve the statistics we get from those embedded widgets.</p>
<p>Mostly I would like to get t... | <pre><code>Steps:
1. Import external interface into your file: import flash.external.ExternalInterface;
2. Initialize a variable to store the url path: var urlPath;
3. Create a function to call external interface and assign the html page path to your variable: urlPath = ExternalInterface.call(âwindow.locatio... |
Extracting text from an IEnumerable<T> <p>I have a <code>IEnumerable<T></code> collection with Name, FullName and Address.</p>
<p>The Address looks like this:</p>
<pre><code>Street1=54, Street2=redfer street, Pin=324234
Street1=54, Street2=fdgdgdfg street, Pin=45654
Street1=55, Street2=tryry street, Pin=65464
<... | <p>Based on your update, you can adapt Jared Par's code this way:</p>
<pre><code>var result = collection.Where(x => x.Address.Contains("Street1=54"));
foreach ( var cur in result ) {
Console.WriteLine(string.Format("{0}, {1}", cur.Name, cur.FullName));
}
</code></pre>
<p>If you want to be able to plug in your St... |
Multiple project management <p>Given a situation where you have 2 projects that in total will provide enough work for a month for 6 developers in a ratio of 2:1. </p>
<p>Is it better to assign developers to each project and then they work on that project for the whole month or is it preferable for the whole team to wo... | <p>It depends a lot on how related the two projects are. If they have a lot of similarities, I would say tackle them as two projects within one large group.</p>
<p>If they mostly unrelated from a code and architecture standpoint, it would make more sense to split into two teams for the duration of the two projects, p... |
How can a convex polygon be broken down into right triangles aligned on the X- and Y- axes? <p>Given a convex polygon represented by a set of vertices (we can assume they're in counter-clockwise order), how can this polygon be broken down into a set of right triangles whose legs are aligned with the X- and Y-axes?</p>
... | <p>I'm not sure about writing an algorithm to do this but it seems entirely possible to do this for any convex polygon on a piece of paper. For each vertex project a line vertically or horizontally from that vertex until it meets another of these vertical or horizontal lines. For vertices with small changes in angle, w... |
Multiple action for Loadrunner script? <p>there is init, action and end functions. is it possible to have multiple action method? i want it to run on a separate execution thread.</p>
| <p>Adding actions in VuGen is easy, but it does not allow you to execute them in parallel within the same vuser. If you want to execute things in parallel you need to run more than one vuser on the controller for the script. </p>
<p>Instantiating a new thread within a vuser is very difficult and requires you to use th... |
How to download multiple files in VB6 with progress bar? <p>I want to download multiple files (mostly images) from VB6 application. presently i m using URLDownloadToFile but it allows only one file at a time and there is no progress bar. I want to download multiple files and with progress bar. please help. thanks in ad... | <p>You want to download the file asynchronously, so that your VB code continues executing while the download happens. There <strong>is</strong> a little-known way to do this with native VB6, using the <a href="http://msdn2.microsoft.com/en-us/library/aa277589.aspx" rel="nofollow">AsyncRead</a> method of UserControl and... |
Eclipse: How can I attach JavaDoc to multiple JAR files? <p>I am using Eclipse 3.4.1.</p>
<p>I have an external library that consists of a bunch of JAR files, and some HTML JavaDoc. I know that I can attach the HTML JavaDoc to individual JARs by going to their Properties page, JavaDoc location, and setting it there.<... | <p>Not really a recommended solution, but you could set it for one of them and then manually edit your project's <code>.classpath</code> file, copy the relevant part and paste it into the other elements. Not that much easier than setting it for each one separately, though.</p>
<p>Also, if you have access to the source... |
Tools to manage semantic webs <p>I've seen a lot frameworks to create a semantic web (or rather the model below it). What tools are there to create a small semantic web or repository on the desktop, for example for personal information management.</p>
<p>Please include information how easy these are to use for a casua... | <p>For personal semantic information management on the desktop there is NEPOMUK. There are two versions, one embedded in kde4, this lets you tag, rate and comment things such as files, folders, pictures, mp3s, etc. on the desktop across all applications.
Another version is written in Java and is OS independent, this i... |
Differences between WPF Frame and WebBrowser controls <p>I'm working on a web-enabled media center which will be able to load video feeds into a gallery style view. (like Cooliris)</p>
<p>Rather than loading thumbnail images of each video, I plan to load the actual video so it can be played in-place and/or popped out ... | <p>The big difference is that Frame can host WPF or HTML content. How it does this is by piping the content to either WPF or IE, so it's not doing any rendering itself and WPF never renders the HTML natively. So if you have (or may have in the future) a need to seamlessly host WPF or HTML content in the same control th... |
Direct3D9ex and Direct3D10 resource sharing <p>It is possible, with the Direct3D9ex, to share resources between devices. Is it also possible to use those shared resources with Direct3D10 devices?</p>
| <p>Yes, you can share resources between D3D9Ex and D3D10 devices using the technique described here:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb219800%28VS.85%29.aspx#Sharing%5FResources" rel="nofollow">Feature Summary (Direct3D 9 for Windows Vista) - Sharing Resources</a></p>
<p>Note that GPU access t... |
getting the value of a form field after keypress event <p>myInput.value is one keystroke behind when I examine it in a keyPress event handler. So if the users types "a", myInput.value gives me "". Then when the user types "b", myInput.value gives me "a", and so it. The value doesn't seem to get updated with the charact... | <p>Use the keyUp event, it should definitely give you the value you are looking for.</p>
|
How can I determine the content type of a file in .NET? <p>I'm given a filename and I have to be able to read it from disk and send its contents over a network. I need to be able to determine whether the file is text or binary so I know whether to use a StreamReader or BinaryReader. Another reason why I need to know ... | <p>The <a href="http://en.wikipedia.org/wiki/Filename_extension" rel="nofollow">filename extension</a> provides your best hint at the content type of a file.</p>
<p>It's not perfect, but I've used the following with some success:</p>
<pre><code>private static string GetContentTypeFromRegistry(string file)
{
Regis... |
What's the best way to manage a dependency tree in .NET? <p>In my last project we used MSBuild as a scripting language. (yeah, really!) We also wrote hundreds of custom MSBuild tasks, for the parts that made more sense in C#. (I even wrote an MSBuild task to generate the boilerplate code for an MSBuild task. Yes, it c... | <p>I think you could use an IOC container like Spring to get this kind of behavior.</p>
<p>Instantiate any task that must only run once as a singleton and have the constructor of the task object run the task. Then any object that comes along later with a dependency on that task will get a reference to the task that al... |
What's a good HTML template engine for C++? <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/355650/c-html-template-framework-templatizing-library-html-generator-library">C++ HTML template framework, templatizing library, HTML generator library</a> </p>
</blockqu... | <p><a href="http://www.webtoolkit.eu/wt">Wt</a> (pronounced 'witty') is a C++ library and application server for developing and deploying web applications. It is not a 'framework', which enforces a way of programming, but a library.</p>
|
JQuery event.target error <p>I've a box from divs (price_item) with several child divs (date, price etc.). I'm using it as a caroussel for showing prices. If one clicks on any child, the parent's background color must be changed to red. I wrote it like:</p>
<pre><code>$(...selectquery...).click(function() {
var $t... | <p>The <code>event</code> object gets passed into your click handler by jQuery, so you need to specify it as a parameter.</p>
<p>You also may be able to add the click handler to the parent object and use "$(this)" instead of event.target:</p>
<pre><code>$(...select the parent...).click(function() {
$(this).css("b... |
Best practice of writing a program which has too many data collection processes C# <p>I have to login in to various elements to retrieve some data, problem is each element has its own login credentials, I want to write all such data collection processes into one single program so that I dont have 10 different scheduled... | <p>if the process of collecting data of the different sources is taking longer you could get faster results if you do it with multithreading and callbacks, but if in normal case it takes not really long, why not make it as simple as possible.</p>
|
App_Data - Web application's data directory. How secure is it? <p>In many places in msdn documentation you can find references to App_Data directory. For example <a href="http://msdn.microsoft.com/en-us/library/system.web.security.authorizationstoreroleprovider.aspx">here</a> we can read:</p>
<blockquote>
<p>To imp... | <p>The files are protected by a forbidden file handler. That is safe so long as everything is running. There are possibilities that the ASP.NET handlers can go down leaving only IIS running. In those cases your web.config files and aspx files will be served as straight text files. </p>
<p>If you data isn't really sens... |
Why does use of pens with dash patterns cause huge (!) performance degredation in WPF custom 2D drawing? <p>Hope anyone can shed light on this so I can use pens with dash patterns? </p>
<p>I am writing a scrollable chart (a <code>Panel</code> inside <code>ScrollViewer</code> that implements <code>IScrollInfo</code>) i... | <p>Here's a possible workaround - if you're only drawing horizontal and/or vertical lines you could try creating your <code>Pen</code> with a checker pattern <code>DrawingBrush</code> such as:</p>
<pre><code> <Pen x:Key="PenUsingDashPatterns" Thickness="1">
<Pen.Brush>
<DrawingBrush... |
My app edits a file in SharePoint via Web Client/WebDAV(WebDAV redirector). How can I check out/check in? <p>I'm integrating my application so that it can edit files stored in SharePoint. I'm using the Web Client service AKA WebDAV Redirector(webclnt.dll) which does a wonderful job of letting the normal CreateFile/rea... | <p>Well to perform check-in/check-out a file you need to use the following code:</p>
<pre><code>SPSite oSite = new SPSite ("http://<sitename>/");
SPWeb oWeb = oSite.OpenWeb();
SPList oList = oWeb.Lists["Shared Documents"];
SPListItem oListItem = oList.Items[0]; //taking the first list item
oListItem.File.CheckO... |
Use aspectj to profile selected methods <p>I'd like to use aspectj to profile a library. My plan was to mark methods that require profiling with an annotation:</p>
<p><code>@Profiled("logicalUnitOfWork")</code></p>
<p>And then have an aspect that would fire before and after methods that would use the <code>logicalUn... | <p>I am not sure if this is the best way to do it, but you could try something like:</p>
<pre>
<code>
pointcut profiledOperation(Profiled p) :
execution(@Profiled * *()) && @annotation(p);
before(Profiled p): profiledOperation(p)
{
System.out.println("Before " + p.value());
}
after(Profil... |
Yellow Dog Linux 6.1 and PS3 GameOS Versions? <p>I'm working on installing linux on a PS3 to do some development work and I've run across a bit of a snag. The current version of the firmware on my PS3 is 2.50. The Yellow Dog website <a href="http://us.fixstars.com/support/advisories.shtml" rel="nofollow">specifically m... | <p>Ok, so I updated the firmware to 2.60 and everything seems to work (other than some network stuff, but I think that is specific to my environment, not this configuration of distro/ps3).</p>
|
Proper use of the IDisposable interface <p>I know from reading <a href="http://msdn.microsoft.com/en-us/library/system.idisposable.aspx">the MSDN documentation</a> that the "primary" use of the IDisposable interface is to clean up unmanaged resources.</p>
<p>To me, "unmanaged" means things like database connections, s... | <p>The point of Dispose <strong>is</strong> to free unmanaged resources. It needs to be done at some point, otherwise they will never be cleaned up. The garbage collector doesn't know <strong>how</strong> to call <code>DeleteHandle()</code> on a variable of type <code>IntPtr</code>, it doesn't know <strong>whether</str... |
Maven package .bat script: how to add a delay? <p>I have this .bat script which I use to maven package my application. Problem is, just after it ends execution, it closes the console window. The last 2 lines somehow are completely ignored.</p>
<p>Does anyone know the trick to make this work?
I just want to have a quic... | <p>You could try to write</p>
<pre><code>call mvn package -o -P local
</code></pre>
|
Factory Model in C# and not using default constructor <p>I've been using the factory model to create child forms to add to a MDI form. This is the code I've been using:</p>
<pre><code> /// <summary>
/// This uses the Factory Model to create the child node and then add it to the MDI Parent (this)
/// &... | <p>You could add a <code>Object[]</code> parameter to the method that would represent the parameters to the constructor of the object you wish to instantiate. Then when you call <code>Activator.CreateInstance</code> you could pass that array in and <code>Activator</code> would do its best to find a constructor on the ... |
Java GUI Problems <p>I'm designing a really simple GUI but without any luck. Basically the outer layout has two columns which is a splitter pane (this is for an IRC client I'm writing). On the left-hand side is the server/channel/user tree and on the right is the chat pane. Now I break this down so on the right-hand... | <p>If I remember correctly, <code>JSplitPanes</code> always respect the minimum size of their components. Try explicitly setting the minimum size of the <code>ChatView</code> to <code>(0,0)</code> and see if that helps. If so, you can then look at each of the components inside it to see which is causing the problem.</p... |
Adding text (actually, barcodes) to a Postscript file <p>I would like to be able to add barcodes to generated postscript files. The postscript files are generated by another program and I am unable to change how that program works.</p>
<p>I've found several threads that suggest this might be done this by converting t... | <p>If the generated Postscript is sufficiently nice, you could write something to dig through it, find the showpage command, and just insert some additional drawing commands before it.
After all, you don't need to handle the general case, just output from this one program, which should always spit Postscript out the sa... |
check what number a string ends with in C++ <p>In a C++ MD2 file loader, I have a lot of frames, each with a name that ends with a number, such as</p>
<ul>
<li>stand0</li>
<li>stand1</li>
<li>stand2</li>
<li>stand3</li>
<li>stand4</li>
<li>...</li>
<li>stand10</li>
<li>stand11</li>
<li>run0</li>
<li>run1</li>
<li>run2... | <p>Just to show another way, reverse iterators:</p>
<pre><code>string::reverse_iterator rit = str.rbegin();
while(isdigit(*rit)) ++rit;
std::string new_str(str.begin(), rit.base());
</code></pre>
<p>If you have boost::bind, you can make your life easier</p>
<pre><code>std::string new_str(str.begin(),
std::find_i... |
Ruby addict looking for PHP subexpressions in strings <h2>Context</h2>
<ul>
<li>PHP 5.3.x</li>
</ul>
<h2>Overview</h2>
<p>After doing a code-review with an associate who uses both php and ruby routinely, a fun challenge came up on string interpolation in php compared to ruby.</p>
<h2>Question</h2>
<p>Assume color ... | <p>You're close, you can embed variables in strings, but not function calls. </p>
<p>I use <code>printf()</code> (and <code>sprintf()</code>) for that, which is a thin wrapper around the C function of the same name: </p>
<pre><code>printf('My favorite color is %sish -- at least for now.', strtolower( $color ));
</cod... |
How to implement an offline reader writer lock <p>Some context for the question</p>
<ul>
<li>All objects in this question are persistent.</li>
<li>All requests will be from a Silverlight client talking to an app server via a binary protocol (Hessian) and not WCF.</li>
<li>Each user will have a session key (not an ASP.... | <p>Have you considered an <a href="http://en.wikipedia.org/wiki/Multiversion_concurrency_control" rel="nofollow">mvcc</a> implementation:</p>
<p>Granted, it would be harder to implement but seems much more concurrent than what you have explained. Just throwing the idea out there.</p>
|
Pros and Cons of Various Java Web Presentation Layer Technologies <p>I'm currently working on a web app that makes heavy use of JSF and IceFaces. We've had some discussions of moving to another presentation layer, and I thought I'd take the discussion out into SO and see what the experts think. </p>
<p>I'm curious if ... | <p>My opinions are quite heavily biased towards Wicket because I've been using it for a while after tripping over JSP mines far too many times.</p>
<p><strong>Wicket PROs:</strong></p>
<ul>
<li>True separation of layout and code.</li>
<li>Component based which means high reusability of site elements; For example you ... |
Getting first byte in a char* buffer <p>I have a char* buffer and I am interested in looking at the first byte in the char* buffer, what is the most optimal way to go about this. </p>
<p>EDIT: Based on the negative votes I might want to explain why this question, I am aware of methods but in the code base that I have ... | <p>Just use</p>
<pre><code>char firstByte = buffer[0];
</code></pre>
|
Sorting Columns in a gridview whose data source is an oracle db <p>Can anyone tell the function to sort the columns of a gridview in c# asp.net.</p>
<p>The gridview is databound to an oracle database. I wanted to click the header of the column to sort the data.
i dont know how to refer to the header itself
is it using... | <p>In the gridview control set the AllowSorting property to true</p>
<pre><code><asp:GridView runat="server" ID="gvItems" AllowSorting="true" ...>
</code></pre>
<p>In the HeaderTemplate of the column you wish to sort set the SortExpression property to the field the tempate is bound to, if your not using a Heade... |
What rails plugins are good, stable and *really* enhance your code? <p>Anyone have a list of rails plugins that are both <em>stable</em> and give you enough functionality to be worth the extra effort of supporting? </p>
<h2>Edit:</h2>
<p>I am mostly interested in the best, most complete list of plugins so I can use i... | <p>You can use <a href="http://github.com/fudgestudios/bort/tree/master" rel="nofollow">bort</a> as reference</p>
<blockquote>
<p><strong>Plugins Installed</strong></p>
<p>Bort comes with a few commonly used
plugins installed and already setup.</p>
<p><strong>RESTful Authentication</strong></p>
<p>R... |
How bad is the following snippet? <p>My question is simple: how bad is the following snippet of code? How would <em>you</em> do it?</p>
<pre><code>CancelEventHandler _windowClosing;
private CancelEventHandler WindowClosing
{
set
{
clearEventHandlerList();
this.Closing += value;
_windowClosing = value;... | <p>I think it might be theoretically possible to make that code more delightfully diverting, perilously puckish, jovially jeopardous, cheerily chancy and unwarily whimsical but it would require some serious thought.</p>
|
How to include metadata in a template file? <p>I have a system that filters template files through erb. Using convention over configuration, the output files get created in a file hierarchy that mirrors the input files. Many of the files have the same names, and I was able to use the directories to differentiate them... | <p>How about if you dump your content as YAML too. Presumably the metadata is simply a Hash dumped to YAML. You could just append the content as string in a second YAML document in the same file :-</p>
<pre><code>---
title: Baxter the Dog
filter: textile
--- |
Content line 1
Content line 2
Content line 3
</code></pre>... |
Why should I NOT use the GAC? <p>There have been a few questions asked along this line stackoverflow such as
<a href="http://stackoverflow.com/questions/23578/what-are-the-advantages-and-disadvantages-of-using-the-gac">What are the advantages and disadvantages of using the GAC</a>
and <a href="http://stackoverflow.com... | <p>Chris Sells gives probably <a href="http://www.sellsbrothers.com/Posts/Details/12503">the best reason for avoiding the GAC</a> where you can:</p>
<blockquote>
<blockquote>
<p>What this boils down to is that any of the shared spots for updates, whether it's a COM CLSID, windows\system32 or the GAC, are dang... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.