input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
how to save the generated xml file using jsp? <p>i have generated xml file using jsp,but i want the generated xml file should be saved as a file.
my code is</p>
<pre><code> <?xml version="1.0" encoding="UTF-8"?>
<%@ page contentType="text/xml;charset=ISO-8859-1" %>
<playlist version="1" xmlns = ... | <p>Yes, you can. The way to do it is basically to set an extra header - which you can do on the response object.</p>
<p>The header to set is called Content-Disposition and the value should be something like "attachment; filename=\"foo.xml\"".</p>
|
What is the format accepted by System.Net.Mail.MailAddress' parser? <p>I'm working on an app that's using <a href="http://msdn.microsoft.com/en-us/library/system.net.mail.mailaddress.aspx" rel="nofollow">System.Net.Mail.MailAddress</a> and friends for sending emails. Does that parser implement the full <a href="http://... | <p>I've wrote a little snippet to test the function:</p>
<pre><code>foreach (int i in Enumerable.Range(32,128-32))
{
char c = (char)i;
string addr = String.Format("par.t1{0}pa.r{0}t2@example.com", c);
try
{
var mailAddr = new MailAddress(addr);
}
catch
{
Console.WriteLine("M... |
How to format string in XAML Setter Value? <p>I have learned how to format strings in the content attribute of a label like this:</p>
<pre><code><Label Content="{Binding ElementName=theSlider, Path=Value}"
ContentStringFormat="The font size is {0}."/>
</code></pre>
<p>I want to do the same thing in a Setter... | <p>Can you simply use the StringFormat property of the Binding itself?</p>
<pre><code><DataTrigger Binding="{Binding Path=Kind}" Value="Task">
<Setter TargetName="TheTitle" Property="Text"
Value="{Binding Title,StringFormat='Your title was: {}{0}'}"
/>
</DataTrigger>
</code></pr... |
ASP.NET: Session state not updated when redirecting in explorer <p>I have an aspx page (page1.aspx) where I set a Session variable and then redirect to another page:</p>
<pre><code>HttpContext.Current.Response.Redirect("page2.aspx");
</code></pre>
<p>On page2.aspx I want to read the session variable, but it doesn't e... | <p>Try switching your Response Redirect to:</p>
<pre><code>Response.Redirect("page2.aspx",false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
</code></pre>
<p>The nominal <code>Redirect(url)</code> implicitly calls <code>Redirect("url", true)</code> which throws a <code>ThreadAbortException</code>. The... |
Subclassing a private (support) class in AVM2 <p>I am developing a dynamic mocking framework for Flex/AS3 and am having trouble with private/support types (ie. those declared outside the package {} in a class file).</p>
<p>In my ABC "file", I am declaring the instance with the PROTECTED_NAMESPACE class flag and with a... | <p>I'm no expert with ABC files but I just don't think this is possible in the AVM2. I did several tests a while ago with the <a href="http://eval.hurlant.com/" rel="nofollow">AS3 Eval lib</a> and they all failed.</p>
<p>Related to dynamic mocking, I have filed an issue in Adobe bugbase, asking for a dynamic proxy mec... |
Lambda "cannot be inferred from the usage" <p>I have the following dictionary declared:</p>
<pre><code>private readonly Dictionary<int, Image> dictionary;
</code></pre>
<p>And I have a method, which is causing a compiler error:</p>
<pre><code> public IQueryable<Image> Find(Func<Image, bool> exp)... | <p>What is it you are trying to do? For example, <code>Single</code> will return an instance of <code>T</code>, not an <code>IQueryable<T></code> (and for objects, you should probably be using <code>IEnumerable<T></code> anyway)...</p>
<p>It feels like you want:</p>
<pre><code>public Image Find(Func<Im... |
.NET best practices? <p>I know it is a broad topic but I'm interested in any of .NET's so-called best practices, though I'm looking for less obvious ones, unlike "use as instead of casting".<br />
Let's see what interesting things I can learn from Stack Overflow users.</p>
| <p>First, check out <a href="http://msdn.microsoft.com/en-us/practices/default.aspx" rel="nofollow">patterns & practices</a> - "Use Microsoft's proven practices for software engineering.".</p>
<p>Next check out IDesign: .NET Design and Process Solutions.</p>
<p>After you dig through those to get some ideas make s... |
Dynamic Query in SQL Server <p>I have a table with 10 columns as col_1,col_2,.... col_10. I want to write a select statement that will select a value of one of the row and from one of these 10 columns. I have a variable that will decide which column to select from. Can such query be written where the column name is dyn... | <p>Yes, using a CASE statement:</p>
<pre><code>SELECT CASE @MyVariable
WHEN 1 THEN [Col_1]
WHEN 2 THEN [Col_2]
...
WHEN 10 THEN [Col_10]
END
</code></pre>
<p>Whether this is a good idea is another question entirely. You should use better names than Col_1, Col_2, etc.</p>
<p>You co... |
What does the "New ... With" syntax do in VB Linq? <p>What (if any) is the difference between the results of the following two versions of this VB Linq query?</p>
<p>' assume we have an XElement containing employee details defined somewhere else</p>
<pre><code>Dim ee = From e In someXML.<Employee> _
Select New ... | <p>The difference is that the 1st explicitly creates an anonymous type. The 2nd is a query expression, and may use an existing type rather than creating an anonymous type. From the documentation linked by Cameron MacFarland:</p>
<blockquote>
<p>Query expressions do not always require the creation of anonymous type... |
why windows allowed us to create a folder as "con"? <p>i tried a lot to create a folder names as "con" , but it says the desired device name is not known.. can you tell me why this is happening?? thanks in advance</p>
<p><strong>Duplicate of <a href="http://stackoverflow.com/questions/448438/windows-and-renaming-folde... | <p><strong>con</strong> is a reserved word, from the old DOS days when con was a device name for console. Because of the potential ambiguity from having both a device and folder name the same, Windows does not allow a folder named con.</p>
|
Google App Engine Query (not filter) for children of an entity <p>Are the children of an entity available in a Query?</p>
<p>Given:</p>
<pre><code>class Factory(db.Model):
""" Parent-kind """
name = db.StringProperty()
class Product(db.Model):
""" Child kind, use Product(parent=factory) to make """
@... | <p>Although ancestor is described as a "filter", it actually just updates the query to add the ancestor condition. You don't send a request to the datastore until you iterate over the query, so what you have will work fine.</p>
<p>One minor point though: 500 entities with the same parent can hurt scalability, since wr... |
Do Strongly Typed Datasets improve performance? <p>Where I work we're <em>finally</em> coming around to the idea of using strongly typed datasets to encapsulate some of our queries to sqlserver. One of the idea's I've been touting is the strength of the strongly typed column's, mainly for not needing to cast any data.... | <p>I'm not sure if there will be any performance improvements using the strongly typed datasets, however you get the added type safety, and with it compiler errors when you mistype a field name, for example.</p>
<p>There's an article in <a href="http://msdn.microsoft.com/en-us/magazine/cc163877.aspx">MSDN magazine</a>... |
Visual Studio detaches from application as soon as debugging starts <p>I have a web application that I've always been able to run in Visual Studio and it debugs just fine (breakpoints work, I can pause execution, etc). Recently, the behavior changed suddenly, and a few things happen:</p>
<ul>
<li>I start debugging, it... | <p>It turns out that this was actually a result of an upgrade to Windows Vista. VS wasn't being "Run as an Administrator", which caused it to lack the rights to attach to other processes for debugging. As a result, debugging would stop right after it started. Changing the VS shortcut to run as an administrator resolved... |
What CSS properties can be applied to which HTML elements <p>I'm looking for a source/spec that can tell me what CSS properties can applied to which HTML elements. For instance, the css property; "overflow". I know I can apply this to div, p, textarea but what other elements can I apply this too? Is there a spec som... | <p>See <a href="http://www.w3.org/TR/CSS2/" rel="nofollow">http://www.w3.org/TR/CSS2/</a> and <a href="http://www.w3.org/TR/CSS/" rel="nofollow">http://www.w3.org/TR/CSS/</a>.</p>
<p>For example, regarding your question about the <code>overflow</code> property, see:</p>
<p><a href="http://www.w3.org/TR/CSS2/visufx.ht... |
SQL sort by version "number", a string of varying length <p>I'm trying to create an SQL query that will order the results by a version number (e.g. 1.1, 4.5.10, etc.)</p>
<p>Here's what I tried:</p>
<pre><code>SELECT * FROM Requirements
WHERE Requirements.Release NOT LIKE '%Obsolete%'
ORDER BY Requirements.... | <p>For best results, refactor version number storage so that each section has it's own column: MajorVersion, MinorVersion, Revision, Build. Then the ordering problem suddenly becomes trivial. You can also build a computed column for easy retrieval of the full string.</p>
|
How do you set a directory to have persistent group permissions? <p>We have two users:</p>
<ul>
<li>user1</li>
<li>user2</li>
</ul>
<p>They both belong to the group 'admin'.</p>
<p>We have a directory that has been set to 775. The directory's group has been changed to 'admin'. Each user has full access to write in... | <p>You can propagate group permissions by setting the directory's setgid bit (<code>chmod g+s</code>). <strike>This may not be portable across all *nixes and all file systems.</strike></p>
<p><a href="http://en.wikipedia.org/wiki/Setuid#setgid_on_directories">http://en.wikipedia.org/wiki/Setuid#setgid_on_directories</... |
What is the best way to embed Firebird Installation in the Installer for my app? <p>My app has its own installer but I have to guide my users to install Firebird on their own.</p>
<p>I'd like to install it automatically.</p>
<p>Thanks.</p>
| <p>You can download Firebird source code. It contains <a href="http://www.jrsoftware.org/isinfo.php" rel="nofollow">InnoSetup</a> script that actually installs firebird on windows targets. You can then modify it to suit your needs. </p>
<p>As a side advice, maybe you should consider Inno Setup yourself. </p>
|
Parameter Problem with Crystal Reports Export <p>I'm trying to export a crystal report to pdf and then email it, but every time I get to the export command, I get a ParameterFieldCurrentValue exception.</p>
<p>I've traced the values of the Parameter collection in the ReportDocument and the values are being set there. ... | <p>I ended up using SetParameter instead of the current values method and using a values collection for the multi-valued parameter.</p>
<p>Also instead of using the typed report, I used an untyped report document. </p>
<p>I also copied over the sql from Crystal Reports and used it to make a dataset. I think the datas... |
Change Properties.settings for a .net deployed application <p><strong>Hi All,</strong></p>
<p>I have two .net applications, these applications want to talk to each other, I made a setting in the first project as follows</p>
<pre><code>[CompilerGeneratedAttribute()]
[GeneratedCodeAttribute("SettingsSingleFileGenerato... | <p>User level app settings are isolated in a subdirectory of AppData. One app cannot find the settings of another app. Just use a plain file.</p>
|
What happened to types.ClassType in python 3? <p>I have a script where I do some magic stuff to dynamically load a module, and instantiate the first class found in the module. But I can't use <code>types.ClassType</code> anymore in Python 3. What is the correct way to do this now?</p>
| <p>I figured it out. It seems that classes are of type "type". Here is an example of how to distinguish between classes and other objects at runtime.</p>
<pre><code>>>> class C: pass
...
>>> type(C)
<class 'type'>
>>> isinstance(C, type)
True
>>> isinstance('string', type)
Fa... |
How would you force the System.Net.Socket.Connect() method to use a socks proxy (code injection vs external custom proxy) <p>I'm using WCF's netTcpBinding, which connects directly to an endpoint and doesn't seems to know anything about socks proxies.</p>
<p>I need to use a proxy because most of my clients won't allow ... | <p>Use SocksCap, WideCap, or something, if you can install it to client machines</p>
<p>Or implement/find some Socks->HTTP proxy and use that.</p>
|
Crystal Reports Subreport Using DataSets <p>I use Crystal Reports XI with C# Visual Studio 2005.
I am trying to create a subreport from a summary dataset.
A simple example would be Company listing with Employees.
I load the Company dataset (with CompanyId).
I want to create a subreport which is linked by CompanyId wher... | <p>This is simply possible. Create 2 data tables in the xsd dataset you have. Get values for these 2 datatables based on a common ID/key value. Copy one dataset table to the other like </p>
<pre><code>ds2.Tables.Add(ds1.Tables[0].Copy());
</code></pre>
<p>then,</p>
<pre><code>rpt.Load(path + @"Report\Report1.rpt")... |
In NAnt, can I create a fileset of the files listed in a VS project? <p>I'm rewriting our <a href="http://nant.sourceforge.net/" rel="nofollow">NAnt</a> build scripts to make them cleaner and simpler, as well as more general purpose. </p>
<p>One of the steps in our build process is to package certain files into a zip... | <p>See <a href="http://stackoverflow.com/questions/441614/how-to-query-msbuild-file-for-list-of-supported-targets">this related question</a>. The microsoft.build.buildengine interface should let you get much better access to the information you need, but unfortunately I think you would have to build a custom task. </... |
How to get ctags to pick up functions in a .h file? <p>I am using Exuberant Ctags 5.7. I am trying to build a tag database for CGContext.h with:</p>
<pre>
tags /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGContext.h
</pre>
<p>The resulting tags file has no funct... | <p>You need to add --c-types=+p (now --c-kinds).</p>
|
Including a service reference from a class library <p>I have a C# class library and a startup project (a console app). The class library includes a service reference to a web service. When I try to run the project, I get an InvalidOperationException because the startup project isn't reading the class library's app.conf... | <p>Think about what you are trying to do - you have two assemblies that you are building:</p>
<pre><code>Library
ConsoleApp
</code></pre>
<p>Both of these assemblies have configuration files - I would imagine they look something like this:</p>
<pre><code>Library
app.config
ConsoleApp
ConsoleApp.exe.config
</... |
Dead Center for JavaScript Output <p>I'm going to apologize in advance for how basic this question is, but this is my first time using javascript in html.. </p>
<p>Basically, I have a javascript that produces a different bit of random text every time a user loads the page. I'd like to format that text in helvetica an... | <p>Well for starters, your missing your HTML tags.
You need to wrap your HTML code between HTML Tags.</p>
<p>Second, you will need to set your text to a different color as the background color. In your CSS, you will need to change the #horizon color to black, or something else.</p>
<p>Other than that, your code work... |
Parameter vs. Member variables <p>I've recently been working with someone else's code and I realized that this individual has a very different philosophy regarding private variables and method parameters than I do. I generally feel that private variables should only be used in a case when:</p>
<ol>
<li>The variable n... | <p>In general, class members should represent <em>state</em> of the class object.</p>
<p>They are not temporary locations for method parameters (that's what method parameters are for).</p>
|
Do Python regexes support something like Perl's \G? <p>I have a Perl regular expression (shown <a href="http://stackoverflow.com/questions/529657/how-do-i-write-a-regex-that-performs-multiple-substitutions-on-each-line-except/529735#529735">here</a>, though understanding the whole thing isn't hopefully necessary to ans... | <p>Try these:</p>
<pre><code>import re
re.sub()
re.findall()
re.finditer()
</code></pre>
<p>for example:</p>
<pre><code># Finds all words of length 3 or 4
s = "the quick brown fox jumped over the lazy dogs."
print re.findall(r'\b\w{3,4}\b', s)
# prints ['the','fox','over','the','lazy','dogs']
</code></pre>
|
MDX Calculating Time Between Events <p>I have a Cube which draws its data from 4 fact/dim tables. </p>
<ol>
<li><code>FactCaseEvents (EventID,CaseID,TimeID)</code> </li>
<li><code>DimEvents (EventID, EventName)</code> </li>
<li><code>DimCases (CaseID,StateID,ClientID)</code> </li>
<li><code>DimTime (TimeID,FullDate... | <p>This looks like a good place to use an accumulating snapshot type fact table and calculate the time it takes to move from one stage of the pipeline to the next in the ETL process.</p>
|
SQL Images -> byte arrays <p>So I am importing some images stored in SQL image columns, and I need to change them to Byte arrays since I store my images as varbinary(max) and recreate them. I would LOVE it if there was a program to do this, or a really easy way since I don't have a ton of time. </p>
<p>Any ideas out t... | <p>The image data type in Sql Server is a varbinary field that is being discontinued in future versions.</p>
<p>I would bet that a tool like <a href="http://msdn.microsoft.com/en-us/library/ms162802.aspx" rel="nofollow">bcp</a> handles the "conversion" automatically. I use quotes because its a type conversion and not ... |
Django - How to prepopulate admin form fields <p>I know that you can prepopulate admin form fields based on other fields. For example, I have a slug field that is automatically populated based on the title field.</p>
<p>However, I would also like to make other automatic prepopulations based on the date. For example, I... | <p>I know that you can prepopulate some values via GET, it will be something like this</p>
<pre><code>http://localhost:8000/admin/app/model/add/?model_field=hello
</code></pre>
<p>I got some problems with date fields but, maybe this could help you.</p>
|
ActionMailer problem- what is the correct syntax for sending PDF attachments <p>What is the correct syntax for sending an email with actionmailer that includes some PDF file attachments? I am using Gmail for SMTP, with the TLS plugin. Here is what I have so far (and have tried variations on this too):</p>
<pre><code>*... | <p>Okay I stepped away for a moment and came back and googled a little more and got the answer!</p>
<p>From the API:</p>
<p>Implicit template rendering is not performed if any attachments or parts have been added to the email. This means that youâll have to manually add each part to the email and set the content ty... |
Best Way to Transfer Large Files in Windows <p>I often have to transfer large files >50GBs sometimes >100GBs between drives both internal and external during backups of our networks email servers. What is the best method of transferring these files? Command Line such as XCOPY? Possibly something robust enough to con... | <p>Check out <a href="http://en.wikipedia.org/wiki/Robocopy">robocopy</a>. From Wikipedia:</p>
<blockquote>
<p>robocopy, or "Robust File Copy", is a
command-line directory replication
command. It was available as part of
the Windows Resource Kit, and
introduced as a standard feature of
Windows Vista and Wi... |
How to get rid of the "default" form-element from a .aspx-page? <p>As that web-standards geek I am, I dislike the default <code><form runat="server"></code> that surrounds my entire webpages. I've seen many ASP.NET based webpages that don't have these, so it seems like it can be removed without taking away any fu... | <p>There will have to be a <code><form runat="server"></code> if you wish to use controls 'n stuff. Otherwise postbacks are impossible, as is viewstate and the rest of the stuff that .NET depends upon.</p>
<p>Are you sure you've seen what you've thought you've seen? Perhaps these pages only contained static cont... |
Is it possible to display a message in an empty datagrid <p>I have a datagrid which is populated with CSV data when the user drag/drops a file onto it. Is it possible to display a message in the blank grid for example "Please drag a file here" or "This grid is currently empty". The grid currently displays as a dark gre... | <p>We subclassed the DataGridView control and added this. We didnt need the drag/drop functionality - we just needed to tell the user when there was no data returned from their query.</p>
<p>We have an emptyText property declared like this:</p>
<pre><code> private string cvstrEmptyText = "";
[Category("Custom"... |
JDBC and Connection Pools in Glassfish App Server <p>I want to set up a connection pool and JDBC connection on EAR deployment so I do not have to set it up on each App Server I deploy to manually. What do I need to do? Is there an .xml file I can put this information into?</p>
| <p>If you are using a single GlassFish administration console to manage multiple application servers throughout your environment, those application servers can share a common configuration. If each deployed application server has its own administration console, you can write a script to call the CLI (asadmin) to create... |
What happened to clockless computer chips? <p>Several years ago, the 'next big thing' was clockless computers. The idea behind it was that without a clock, the processors would run significantly faster.</p>
<p>That was then, this is now and I can't find any info on how it's been coming along or if the idea was a bust... | <p>Here's <a href="http://www1.cs.columbia.edu/async/misc/technologyreview_oct_01_2001.html">an article from a few years ago</a> that's gung-ho on the technology, but I think the answer can be found in this quote:</p>
<blockquote>
<p>Why, for example, did Intel scrap its asynchronous chip? The answer is that althoug... |
Best Way to Modify/Format Database Data in the Controller? <p>Let's say that in the controller I get an array of objects from the database this way:</p>
<pre><code>@statuses = TwitterStatus.find(:all, :order => "tweet_id DESC", :include => :twitter_user)
</code></pre>
<p>Also I have the following loop in the v... | <p>I want to agree with Aram. My Views were littered with formatting code until I started adding model methods that cleaned them up considerably. In my last app it was Names and Times (an employee scheduling application). </p>
<pre><code>class Employee
def full_name
self.first_name + " " + self.last_name
end
end... |
Going from VisualStudio generated Database stuff to Programmer Generated <p>I'd like to be able to better access the database so I can execute queries (primarily because I don't understand/know the API for it, but I do know SQL). I don't want to remove everything Visual Studio has done because a lot is already built up... | <p>Try something like <a href="http://blog.biztalk-info.com/archive/2008/06/19/Execute_SQL_Query_from_within_a_C_function.aspx" rel="nofollow">this</a>:</p>
<pre><code>using (SqlConnection conn = new SqlConnection("Connection String Goes Here"))
{
conn.Open();
using (SqlCommand comm = new SqlCommand("SELECT * ... |
iPhone UIWebview -- Saving an image already downloaded <p>I have an iPhone app with an embedded UIWebview (Safari) control. I'd like to be able to store the images from certain webpages locally. </p>
<p>Can I programmatically access the path where UIWebview downloads images? Or do I need to parse the HTML and then ... | <p>I do not know if you can access the preloaded images from Safari's cache...</p>
<p>However you can easily find the image URLs without parsing HTML, by running a bit of javascript instead:</p>
<pre><code>NSString *script = @"var n = document.images.length; var names = [];"
"for (var i = 0; i <... |
Taking code and design from other Websites. Ripoff or Standard? <p>While designing my site I am constantly faced with the issue of whether its ok to TAKE ideas and designs from other sites. In some cases there is no distinction in certain aspects. Is there anything ethically wrong with this? Is this expected in the des... | <p><strong>Depends on how much you 'steal'.</strong></p>
<p><em>Code</em></p>
<p>If you're ripping off the whole design, then its a bit dodgy. If you like (for example) the Stack Overflow concept of voting up stuff, then steal the concept and use it in a different manner. If you want to know how say the orange highli... |
How to execute sp_send_dbmail while limiting permissions <p>Is there a way to provide access to users in my database to execute <strong><code>msdb.dbo.sp_send_dbmail</code></strong> without needing to add them to the MSDB database and the DatabaseMailUserRole?</p>
<p>I've tried this:</p>
<pre><code>ALTER PROCEDURE [... | <p>Your approach is OK, but your wrapper proc must be in the msdb database.
Then, you execute "EXEC msdb.dbo._TestSendMail"</p>
<p>This still leave the issue of permissions on dbo._TestSendMail in msdb.
But public/EXECUTE will be enough: it only exposes the 3 parameters you need.</p>
<p>If in doubt, add WITH ENCRYPTI... |
SFTP Libraries for .NET <p>Can anyone recommend a good SFTP library to use? Right now I'm looking at products such as SecureBlackbox, IPWorks SSH, WodSFTP, and Rebex SFTP. However, I have never used any SFTP library before so I'm not sure what I'm looking for.</p>
<p>If anyone has used these before, is there any rea... | <p>I've searched around and found that <a href="https://bitbucket.org/mattgwagner/sharpssh" rel="nofollow">this fork of SharpSSH</a> and <a href="https://github.com/sshnet/SSH.NET" rel="nofollow">SSH.NET</a> are the most up to date and best maintained libraries for <a href="http://en.wikipedia.org/wiki/SSH_File_Transfe... |
Linking to a static lib that links to a static lib <p>I have a (managed/unmanaged C++) winforms app that links to a static library. That library links to another static library. When I do a Rebuild on the Winforms project, Visual Studio 2005 attempts to rebuild the references static library, but does not rebuild deeper... | <p>Should I just add all static libs as dependancies to the Winform app?</p>
|
RTF editor <p>I have a templates written in RTF(with some tags which are replaced by data from DB in app), but when I edit them in MS Word, Word put some invisible tags to the templates, which destruct my tags(I must open template in Notepad and edit code).
Do you know some editor for RTF, which strict follows RTF spec... | <p>On Windows, the included app Wordpad is pretty decent in my opinion.</p>
|
Why does a WPF BitmapImage object not download an image from a Uri Source in ASP.Net Web Forms? <p>I'm trying to accomplish the following in ASP.Net:</p>
<ol>
<li>Create a WPF Canvas control</li>
<li>Spin up a WPF Image control and a BitmapImage object</li>
<li>Set the BitmapImage source to a Uri for an image</li>
<li... | <p>Did you verify that adding the STAThread attribute to the DownloadAndSave method actually makes it run in a STA thread? </p>
<p>According to the documentation of the STAThreadAttribute (<a href="http://msdn.microsoft.com/en-us/library/system.stathreadattribute.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/li... |
Deploying bluechannel with fastcgi <p>I am trying to get a basic blue-channel website running through fcgi, I have a django.fcgi file. How do I do this.
Thank you</p>
| <p><a href="http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#apache-setup" rel="nofollow">Read The Fabulous Manual</a></p>
|
Webserver Location - How important is it for SEO? <p>I am based in the UK and have two webservers, one German based (1&1) and the other is UK based (Easyspace).</p>
<p>I recently signed up to the UK easyspace server because it was about the same price I paid for my 1&1 server but also I wanted to see if my sit... | <p>I have never heard of common search engines ranking sites by their response time as it is highly variable due to the nature of the internet.
If a search engine would penalize you for the subnet you are on then you likely have bigger problems.</p>
|
Python 2.x gotcha's and landmines <p>The purpose of my question is to strengthen my knowledge base with Python and get a better picture of it, which includes knowing its faults and surprises. To keep things specific, I'm only interested in the CPython interpreter.</p>
<p>I'm looking for something similar to what lear... | <p><strong>Expressions in default arguments are calculated when the function is defined, <em>not</em> when itâs called.</strong> </p>
<p><strong>Example:</strong> consider defaulting an argument to the current time:</p>
<pre><code>>>>import time
>>> def report(when=time.time()):
... print when... |
Dojo - XHTML validation? <p>Is it possible to make Dojo (javascript) widgets validate for XHTML?</p>
<p>If so, how?</p>
<p>Can it be something as simple as using CDATA?</p>
| <p>Yes, instead of using the dojoType="dojo.foo.bar" non-standard attribute, you instead need to have a document onload event that "takes over" standard HTML tags in your document and rewrites them into Dojo ones.</p>
|
-[NSURLRequest sendSynchronousRequest:returningResponse:error:] getting back HTTP headers <p>I'm trying to pull out HTTP Headers and an HTTP Response Code from a synchronous HTTP request on the iPhone. I generally don't have any issues doing this with asynchronous requests, although a bit of trouble here. The HTTP Resp... | <p>The error code you got is NSURLErrorUserCancelledAuthentication and is documented in <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/Reference/reference.html#//apple_ref/doc/c_ref/NSURLErrorUserCancelledAuthentication" rel="nofollow">Foundation Constant... |
Best way to preserve user-generated HTML across a post request? <p>I am building a site that is an interface used to create XML files that are read as input by a server side program.</p>
<p>The website allows users to dynamically create blocks of HTML. Each block can be thought of as an object and contains several inp... | <p>You're probably looking for XML's <a href="http://www.w3schools.com/XML/xml_cdata.asp" rel="nofollow">CDATA</a>.</p>
<pre><code><post>
<![CDATA[
<p>Hello, world!
<span style="color: green;">Green text</span>
<!-- oops, didn't close the p! -->
<ul>
<li>list
<... |
A serious issue with jQuery and ActiveX security? <p>Has anyone not noticed that JQuery uses ActiveX controls?</p>
<p>When a user has limited their activex security they will get script prompt popups and a yellow bar accross the top of their browser window.
-This setting is by default on Windows Servers.
-Internet C... | <p>Only spot where <code>ActiveX</code> is mentioned in the jQuery code is for the <code>ActiveXObject</code> which is used for XMLHttpRequests: </p>
<pre><code>// Create the request object; Microsoft failed to properly
// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
var xhr =... |
.NET Optimized Int32 <p>While reading through the 70-536 training kit, it states: </p>
<blockquote>
<p>The runtime optimizes the performance
of 32-bit integer types (Int32), so
use those types for counters and other
frequently accessed integral
variables.</p>
</blockquote>
<p>Does this only apply in a 32 bi... | <p>That's a funny way to put it. The runtime doesn't have much to do with it.
The CPU is designed for processing 32-bit integers, which is why they're the most efficient to use.</p>
<p>In a 64-bit environment, it again depends on the CPU. However, on x86 CPU's at least (which, to the best of my knowledge, is the only ... |
Seemingly random crashes with VB.NET and COM Interop <p>I'm thinking of rewriting a brand new VB.NET application in VB 6.</p>
<p>The application runs under terminal services and makes heavy use of COM.</p>
<p>For some reason, there is random weirdness with the application -</p>
<ul>
<li>Random Access Violation error... | <p>Install PDB files and use <a href="http://www.microsoft.com/downloadS/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang=en" rel="nofollow">"Debug Diagnostics Tool 1.1"</a> for monitoring you app, for identify were leak occurs. <br></p>
<p>View this too <a href="http://stackoverflow.com/ques... |
How to match a set using Linq-2-Sql <p>I'm trying to figure out how to do this, and I"m stumped. I'm sure it's something simple that I'm just missing.</p>
<p>Say I have a table that is a collection of names, and I want to check if a subset of those names exist like this:</p>
<pre><code>var names = new List{ "John", "... | <pre><code>where names.Contains(n.FirstName)
</code></pre>
<p>Although you have to watch the types you call this on -- some of the Contains methods won't get translated to LINQ-to-SQL. You might need to cast it to IEnumerable or IQueryable first, or something.</p>
|
Delphi TeeChart only showing one record from dataset <p>Using Delphi Steema TeeChart component, if I link a BarSeries to a dataset using the user interface, it shows up fine, but if I do it using code (which I need to), it's only showing one bar, even when I have several records in the database. What am I doing wrong?<... | <p>This code works for me (using an Access database with fields ID and Height, I dropped a TDBChart, TADODataSet, and a TButton on a form):</p>
<pre><code>procedure TForm1.Button1Click(Sender: TObject);
var
Bar : TBarSeries;
begin
ADODataSet1.Close;
ADODataSet1.ConnectionString := 'Provider=Micr... |
Changing namespace of the WPF Project Template <p>When I modify the xaml's cs's I will have to go in and manually modify the corresponding *.g.cs file. And it seems to get overwritten every time I rebuild.</p>
<p>So my question is, what is the proper way to change the namespace on a WPF application that has been gene... | <p>Since the .g.cs files are generated from the .xaml files, besides changing the namespace in the .xaml.cs files, you also have to change the namespace in the .xaml files.</p>
<p>For example, the main window in one of my projects is declared like this in mainwindow.xaml:</p>
<pre><code><Window x:Class="Penov.Play... |
Design order: Firefox, IE, or both? <p>When coding new javascript heavy websites, which order or web browser do you code for?</p>
<p>I can see these possible orders, but I am not sure which I like best:</p>
<ol>
<li>Code for one first and get it working well, then start testing with other and fix errors as I go.
<ul>... | <p>This is sort of a trick question. In my opinion you need to work in this order:</p>
<p><strong>1: Conform to Standards</strong></p>
<p>This gets you closest to working in every browser without having to test against every browser. Additionally, you gain the huge benefit that your site should work with any new brow... |
Unregistering RemotingConfiguration unregister well known type <p>How to Unregister RemotingConfiguration unregister well known type</p>
| <p>This might help you?</p>
<p><a href="http://www.codeproject.com/KB/dotnet/Advanced%5FRemoting.aspx" rel="nofollow">http://www.codeproject.com/KB/dotnet/Advanced_Remoting.aspx</a></p>
|
Is the SMPP (binary SMS) protocol dead? <p>Has anyone dealt with the SMPP binary SMS protocol? I know this technology is still fairly widely used by the messaging aggregators and carriers, but it seems like the SMPP spec is not being updated, and support for SMPP libraries is slowly fading away. The "SMS Forum" (<a h... | <p>Since SMPP is used mainly by wireless operators, the answer to your question will depend a lot on what market/region/country you are dealing with. </p>
<p>I have experience with Latin American wireless companies, and can tell you that although more and more companies are hiding their SMPP servers behing HTTP webser... |
Initialising an instance variable with a method from the class <p>Can I initialize an instance variable in Java, when I initialise it when I declare it, and initialise it with the return value of a method, which I define later in the class. </p>
<p>Something like this:</p>
<pre><code>public class MyClass {
inte... | <p>Seems to work fine for me, with the method static or not static:</p>
<pre><code>public class test
{
public int[] myarray = new int[this.length()];
public int length() {
return 5;
}
public static void main(String[] args)
{
test foo = new test();
for (int element : foo.my... |
Any Static Code Analysis Tools for Stored Procedures? <p>Are there any <a href="http://en.wikipedia.org/wiki/Static_code_analysis">static code analysis</a> tools for <a href="http://en.wikipedia.org/wiki/Stored_procedure">stored procedures</a> written particularly in <a href="http://en.wikipedia.org/wiki/PL_SQL">PL/SQL... | <p>For T-SQL, Microsoft has the database edition of VS Team Suite (although, I believe its now in the dev SKU). This link talks about writing your own static code analysis rule for T-SQL: <a href="http://blogs.msdn.com/gertd/archive/2009/01/01/creating-t-sql-static-code-analysis-rules.aspx">http://blogs.msdn.com/gertd... |
When do structs not live on the stack? <p>I'm reading through Jon Skeet's book reviews and he is going over the <a href="http://msmvps.com/blogs/jon_skeet/archive/2008/03/21/book-review-head-first-c.aspx" rel="nofollow">numerous inaccuracies</a> of <a href="http://rads.stackoverflow.com/amzn/click/0596514824" rel="nofo... | <p>One common example is where the struct is a member of an object that is allocated in the heap. There is lots of additional detail in this question here. <a href="http://stackoverflow.com/questions/13049/whats-the-difference-between-struct-and-class-in-net">Whatâs the difference between struct and class in .Net?</a... |
LINQ-to-SQL select filter <p>Is there a way to ensure a particular conditional clause is added to the expression tree on each select from a particular table? </p>
<p>For example, a table with a field with the date a record was deleted should never come back or be included in any kind of statement. </p>
<p>Rather than... | <p>You should be able to do this my putting the items into a list and then use lambda expressions to filter the list?</p>
<pre><code>MyListObject.Where(x => x == x.Date);
</code></pre>
|
String manipulation without memory leaks? <p>I'd like to do a series of string substitutions to removed xml-escaped chars such as <code>'&amp;'</code>. </p>
<p>1) Is there an existing UIKit function that can do this?</p>
<p>2) If not, what's the best way to do it without leaking memory? Here's the idea:</p>
<pre... | <p>Any cocoa method which returns a new object via a method that does not start with <code>init</code> or contain the word <code>copy</code> will return an autoreleased object. So the above code should have noleaks.</p>
<p>Although it may be easier to use a NSMutableString here. Then you just modify the string in pl... |
Post a KeyEvent to the focused component <p>What is the best way to post a Button Press to a component? I tried using the Robot class and it works, normally. However, this class has some problems under some Linux platforms, so I wonder what is the best Java-only way to post an event to a component.</p>
<p>In this pa... | <p>You can find example of such key post event, like in <a href="http://www.koders.com/java/fid0A047C32296B5D1311C4B7D28D7A663F37068D02.aspx?s=backspace+dispatchEvent#L52" rel="nofollow">this class</a></p>
<p>Those posts are using the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Component.html#dispatchEve... |
CSS Specificity and normalising your stylesheets after a tight deadline <p>I have just finished building a heavyweight long sales page, with a lot of elements and varying styles on the page.The CSS has ended up being over specific with its selectors, and there are numerous rounded boxes, background images etc. In short... | <ol>
<li>Combine CSS to their shorthand properties if possible.</li>
<li>Take advantage of unique dom ids to apply styles to the children of that element.</li>
<li>You can use multiple CSS classes on the same element, for example class="somestyle some-other-style". Using this you can take duplicated CSS styles and defi... |
WCF Memory Performance InstanceContextMode <p>I've been learning my way around WCF and I've got a question regarding the InstanceContextMode.</p>
<p>Correct me if I'm wrong, but the WCF will instantiate your object, then call the service method on it per call by default.</p>
<p>You can then set it to be PerSession or... | <p>The samples here</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa967565.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa967565.aspx</a></p>
<p>show how to use extensibility to exercise more fine-grained control over how instances are created and destroyed (e.g. pooling).</p>
|
A problem with batch file <p>I created a batch file, to uninstall my application. My problem is that as result, this uninstallation deleted some files but kept others. </p>
<p>For example one, I created a folder in <code>C:\\Documents and settings\User-Name\myCompanyName\My Application name\</code>
This folder contain... | <p>Remove the C:\Documents and Settings - this is already in the %userprofile% tag.</p>
<p><code>RD /s "%userprofile%\start menu\programs\ASGATech"</code></p>
|
What are the best practices to speed up site development with CMS? <p>How can I speed up site development with a particular CMS if I need to build a lot of sites?
Should I prepare a few different solutions based on barebone CMS but with pre-built components and deploy them if similar site is being requested for product... | <p>Version control helps with collaboration. I use git. A good bug tracker keeps everyone in the picture. </p>
<p>For tasks I perform over and over (like install and upgrade) I capture these tasks in a build file and run it with Apache Ant. </p>
<p>Drupal has install profiles which don't have much documentation but a... |
JYaml: dump object without including class name <p>I have an <code>ArrayList</code> of objects being dumped to a YAML string and have been comparing the performance of JYaml and SnakeYaml in handling this.</p>
<pre><code> ArrayList<HashMap> testList = new ArrayList<HashMap>();
HashMap<String, Str... | <p>How do you measure the speed ? What do you mean 'amount of data' ? Is it a size of a YAML document or an amount of documents ?</p>
<p>JYaml output is <strong>incorrect</strong>. According to the specification underscores in numbers are ignored and 1_1 = 11 (at least for YAML 1.1). Because it is in fact a String and... |
Finding patterns in source code <p>If I wanted to learn about pattern recognition in general what would be a good place to start (recommend a book)?</p>
<p>Also, does anybody have any experience/knowledge on how to go about applying these algorithms to find abstraction patterns in programs? (repeated code, chunks of c... | <p>If you are reasonably mathematically confident then either of Chris Bishop's books "Pattern Recognition and Machine Learning" or "Neural Networks for Pattern Recognition" are very good for learning about pattern recognition.</p>
|
Debug code security .net framework to use caspol.exe <p>We have an application that is distribute to a varity of customers. Sometime it is installed on a network share. Usually we can give that application access with caspol.exe and grant the LocalIntranet Zone FullTrust. Sometimes the customers admins do not manage to... | <p>Can I recommend - perhaps look at ClickOnce - a click-once application can be hosted on a network share, but has much better security deployment factors. You just run the <code>.application</code> rather than the <code>.exe</code> (VS2005 and VS2008 have all the tools you need to publish a ClickOnce application triv... |
Retrieving Client Information from web service request <p>If i have an applicataion requesting a service, is it possible for the web service to determine the name of the application or does this have to be sent within the request?</p>
| <p>You can use the UserAgent header of the HTTP request if the application sets it.</p>
|
Is there a built in URL class in .Net? <p>I'm spending time breaking up URLs into <code>protocol://domain:port/path/filename</code> but there must be a built in class, all I can find is <code>System.Security.Policy.Url</code></p>
| <p>I bet <a href="http://msdn.microsoft.com/en-us/library/system.uri.aspx" rel="nofollow">System.Uri</a> is what you're looking for</p>
|
How can I make a Google Maps custom Overlay object behave like an InfoWindow? <p>My only problem with the InfoWindow is that I don't have a way to customize it's appearance (ie, the bubble, not it's contents). It seems that the only way to do that is to make my own Overlay and style that instead. But that gives me prob... | <p>Great news. It looks like the problem I was experiencing in Firefox was due to my overlay being larger in height than the map container and assuming that Google Maps was setting <pre>overflow: hidden</pre> somewhere (I guess not). Setting it myself fixed that. The next step is to have your overlay container catch th... |
Threading in an Application Server <p>I have a Java program/thread that I want to deploy into an Application Server (GlassFish). The thread should run as a "service" that starts when the Application Server starts and stops when the Application Server closes. </p>
<p>How would I go about doing this? It's not really a... | <p>I've only done this with Tomcat, but it should work in Glassfish.</p>
<p>Create a Listener class that implements <a href="http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContextListener.html" rel="nofollow"><code>javax.servlet.ServletContextListener</code></a>, then put it in web.xml. It will be notified w... |
How to add "help"-text to a mex-function? <p>I am writing a Matlab mex-file. However, mex-files seem to have a serious limitation: <code>help mexfilename</code> won't cause a help text to appear.</p>
<p>I could circumvent this by writing a m-file, that ultimately calls the mex-file, but includes help, but there has to... | <p>I believe PierreBdR is right; you would create an m-file version of your function with just the header call and comment block, but no body.</p>
<p>It might not be a bad idea to put the error checking for the inputs in the m-file, then have the m-file invoke the mex-file (you may have to give them different names, t... |
Enhanced Flex textarea / text viewer components? <p>Is there any advanced textarea() component (AS3) for Flex available that could be used for both viewing/exiting text nicely? </p>
<p>It would be good to have a text select feature, too. </p>
| <p>Grant Skinner's <a href="http://www.gskinner.com/blog/archives/2009/01/editable_multif.html" rel="nofollow">TextFlowPro</a> seems very cool. Not sure what you mean by this question exactly, though.</p>
|
Problem with php function to catch error on saving image <p>I have a method to save an image, which is meant to deal gracefully with an error, setting $imageSrc to a particular image in the event of failure. My method works fine if the image is present, but no error conditions seems to be handled correctly.</p>
<pre><... | <p>Are you sure you're writing to the root folder? Because I can't see any problem with your code. <code>file_get_contents</code> and <code>file_put_contents</code> don't seem to be failing, so your image is being written somewhere.</p>
|
Tabs in HTML mode in Emacs <p>So I've started using emacs and I love it. However, I'm a tab person. Unless I'm working on a project that is already using spaces, I use tabs. I mostly do php and html work. I've got tabs in php working well. But I can't figure out how to have html mode use tabs instead of two spaces.</p... | <pre><code>(add-hook 'html-mode-hook
(lambda()
(setq sgml-basic-offset 4)
(setq indent-tabs-mode t)))
</code></pre>
|
Signing in Visual Studio 2005 - error using existing .pfx <ol>
<li><p>Built my project.</p></li>
<li><p>Created my .pfx using sn.exe -k (to create ShellTradingCCMPROD.pfx).</p></li>
<li><p>Copied the file to the application folder.</p></li>
<li><p>In VS 2005, I go to the Signing tab, 'Select From File' and browse to th... | <p><code>sn.exe -k</code> does not create a file in the .pfx format. I don't have VS2005 around anymore, but it works in VS2010 when I name the file <code>ShellTradingCCMPROD.snk</code>. The key in this file is not password protected.</p>
<p>As far as I know, you cannot use sn.exe to create password protected keys.</p... |
How can I make a link in HTML turn a color when hovering and remove the underline using CSS? <p>How can I make a link in HTML turn a color when hovering and remove the underline using CSS?</p>
| <p>You want to look at the <a href="http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes" rel="nofollow">:hover pseudoselector</a>, the <a href="http://www.w3.org/TR/CSS2/colors.html#colors" rel="nofollow">color property</a>, and the <a href="http://www.w3.org/TR/CSS2/text.html#lining-striking-props" rel="nof... |
WPF: How to handle errors with a BackgroundWorker <p>I am a bit of a newbie when it comes to windows client programming. I have a background worker that has a DoWork event and a RunCompleted event wired up. If an exception gets thrown in DoWork, I want to make changes to my UI, however, I cant because it is in a differ... | <p>call Dispatcher.BeginInvoke. Basically, you want code like this:</p>
<pre><code>void UpdateState(WhatEverType someObject)
{
if (! Dispatcher.CheckAccess())
{
Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(()=>UpdateState(someObject));
}
else
{
//make the UI chang... |
CATIA-CAA CATKeyboardEvent <p>I know there are only a few CAA Programmers in the world but I try it anyway...</p>
<p>I can't get keyboard events to work. I found this code which looks reasonable but the Notification doesn't fire.</p>
<pre><code>AddAnalyseNotificationCB(CATFrmLayout::GetCurrentLayout()->GetCurrentW... | <p>There is a much denser group of developers for CAA at:</p>
<p><a href="http://www.3ds.com/alliances/c-java-developers/forum/" rel="nofollow">http://www.3ds.com/alliances/c-java-developers/forum/</a></p>
<p>The same question came up, with several people mentioning that this API was unauthorized, and therefore you c... |
Dependency graph for Rails partials <p>In my current Ruby on Rails view we have many views and partials. So many in fact that it's not clear which view uses which partial (which itself may use other partials as well).</p>
<p>The question is if there's a tool out there that generates a dependency graph of all views and... | <p>I've created a plugin (basically just a rake task) that generates a graph containing all the dependencies of the views and partials for you.</p>
<p>Get it at <a href="http://github.com/msales/partial_dependencies/tree/master">http://github.com/msales/partial_dependencies/tree/master</a></p>
|
PHP Regex Question <p>Would it be possible to make a regex that reads {variable} like <code><?php echo $variable ?></code> in PHP files?</p>
<p>Thanks</p>
<p>Remy</p>
| <p>The PHP manual already provides a <a href="http://docs.php.net/manual/en/language.variables.basics.php" rel="nofollow">regular expression for variable names</a>:</p>
<pre><code>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
</code></pre>
<p>You just have to alter it to this:</p>
<pre><code>\{[a-zA-Z_\x7f-\xff][a-zA-Z0-... |
Change Local path, team explorer <p>Does any one know how to change the local path of the downloaded project in team explorer 2008. I downloaded a project to a wrong directory, now i deleted it and did get latest but i get a message
"All files are up to date"</p>
<p>Thanks
-Mithil</p>
| <p>In the source-control explorer click in the "workspaces..." option in the "Workspace:" Dropdown.
And then edit your workspace or set a new one.</p>
<p>When you recive the message that you mention, you can Get a specific->latest version
with all the checkboxes checked.</p>
|
STOMP Protocol - Connect frame are login / passcode mandatory? <p>I have been using the STOMP protocol in various guises. I have experienced this phenomenon in the PHP, Python and Objective-C libraries for STOMP. The STOMP specification on <a href="http://stomp.codehaus.org/" rel="nofollow">the STOMP website</a> is not... | <p>ActiveMQ does not require these headers to be sent. Take a look at this telnet session for example</p>
<pre><code>$ telnet localhost 61613
Trying ::1...
Connected to localhost.
Escape character is '^]'.
CONNECT
^@
CONNECTED
session:ID:nc-example.com-51165-1234432649359-2:0
</code></pre>
<p>It connects successfull... |
Recompiling a simple Win32 C++ app for x64 <p>I have a small C++ program for Win32, which has the following WinMain:</p>
<pre><code>int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
</code></pre>
<... | <p>Your linker is set to link the executable under the <code>CONSOLE</code> subsystem, thus it's looking for <code>main</code>, you'll need to set the subsystem to <code>WINDOWS</code>.</p>
|
What is the relationship between "late binding" and "inversion of control"? <p>In <a href="http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en" rel="nofollow">his definition</a> of OOP, Alan Kay points out he supports "the extreme late-binding of all things". Does his interest in late-binding share the ... | <p>It depends what you mean by inversion of control - the term has been overloaded to include dependency injection, but they are really different concepts. IoC originally described a method of controlling program flow, whereas DI is specifically concerned with reducing coupling between types. </p>
<p>That said, it c... |
Make QA Drops of Only Selected Builds In CruiseControl.Net <p>CC.Net is creating many builds for us each day. Occasionally we do a bit of manual smoke testing and then a build becomes a QA drop (or release candidate if you prefer). QA drops are just copied to a remove server.</p>
<p>I'd like to automate the executio... | <p>This is exactly how we have things set up within AnthillPro. On a build record, you have an extra button called "Run secondary process" that can be wired to things like deployments and functional test suites. Click that, select your process, your target environment and off you go.</p>
<p>How I've simulated this in ... |
Font Color not setting in Container on DOTNETNUKE <p>The header and body have the correct background color but the fonts look gray. I am running on DOTNETNUKE version 4.9.0 and 4.9.1 and Windows 2003. </p>
<p>Thanks</p>
<p>test.htm</p>
<pre><code><body class="border">
<div class="PhilosophyHeader" runa... | <p>This could be caused by a variety of problems. Without having a website to view it's going to be difficult for anyone here to answer your question.</p>
<p>One of the easiest ways to diagnose CSS problems like this is to use the Firefox extension <a href="http://getfirebug.com/" rel="nofollow">Firebug</a>. Inspect... |
Joining fact tables in an MDX query <p>I am building and Anaysis Services project using VS 2005. The goal is to analyse advertising campaigns.</p>
<p>I have a single cube with 2 fact tables</p>
<p>factCampaign: which contains details of what people interviewed thought of an advertising campaign
factDemographics: whi... | <p>What you probably need is a many-to-many relationship. There is a whitepaper <a href="http://www.sqlbi.eu/Projects/Manytomanydimensionalmodeling/tabid/80/language/en-US/Default.aspx" rel="nofollow">here</a> which goes through a number of scenarios for m2m relationships including one specifically around surveys and q... |
allow .NET 2.0 runtime to run executables from network with full trust <p>Guys, this can't be for real</p>
<p>I'm trying to make a .NET 2.0 executable run from a network drive and it turns out that since Microsoft .net 2.0 has no mscorcfg.msc installed on server 2003, in order to get one I have to install the full SDK... | <p>You can try running the following command from the .NET command prompt -</p>
<p><strong>caspol -cg All_Code FullTrust</strong></p>
<p>This gives the code group 'All_Code' the full set of permissions.</p>
|
Ninject : Resolving an object by type _and_ registration name/identifier <p>I am looking for a way to do something like this with Ninject :</p>
<pre><code>// Sample from the Unity application block
IMyService result = myContainer.Resolve<IMyService>("Data");
</code></pre>
<p>( from <a href="http://msdn.microsof... | <p>Ninject 2.0 has this capability:</p>
<pre><code>Bind<IMyService>().To<MyServiceA>().Named("Data");
Bind<IMyService>().To<MyServiceB>().Named("SomethingElse");
kernel.Get<IMyService>("Data"); // will return MyServiceA
</code></pre>
|
What does 'self' refer to in a @classmethod? <p>I thought I was starting to get a grip on "the Python way" of programming. Methods of a class accept self as the first parameter to refer to the instance of the class whose context the method is being called in. The @classmethod decorator refers to a method whose function... | <p><a href="http://docs.python.org/library/functions.html#classmethod">class itself</a>:</p>
<blockquote>
<p>A class method receives the class as implicit first argument, just like an instance method receives the instance.</p>
</blockquote>
<pre><code>class C:
@classmethod
def f(cls):
print(cls.__na... |
Viewing Rails model page works on first view but not subsequent views <p>This is using Rails 2.2.2</p>
<p>I have a model that uses the acts_as_flaggable plugin, and on the page I use to display an instance of the model, I list any flags that the model has.</p>
<p>When I start my Rails dev server(mongrel) using the st... | <p>Having experience a similar problem, I'd check your <code>/config/initializers</code> directory. Does it declare some methods or include some modules into the models? If so, it will happen on first load, but the models will get reloaded on subsequent requests without the initializers running again.</p>
|
Dynamic dispatch and binding <p>Are dynamic dispatch and dynamic binding the same thing?</p>
<p>Thanks</p>
<p>Maciej</p>
| <p>No. </p>
<p>Dynamic Dispatch - The actual method group/signature/override chain is bound at compile time. The method called is dependent upon the actual runtime type of the object but no actual interpretation occurs. It will still be a version of the statically bound method. </p>
<p>Here is an example in C#. <... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.