input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Run Qt application on startup as Linux daemon <p>I've developed a Qt application which contains a TCP server and such. I'm now trying to make Ubuntu packages and let the application automatically start on startup.</p>
<p>The application needs to be running even if nobody is logged in, which means a daemon started via ... | <p>The best way is probably to use <a href="http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Utilities/qtservice/" rel="nofollow">QtService</a> where the work of forking is taken care of for you.</p>
<p>However, if you want to continue to build your own, you should either background the application or run... |
Delphi - XML - childnodes - getting attributes <p>I am trying to get the correct data from a twitter atom/xml feed. I have the twitter data in a txmldocument and am trying to get some specific information from it.</p>
<p>Here is a truncated example of the data:</p>
<pre><code><entry>
<link type="text/html"... | <p>You could do this:</p>
<pre><code>i := xmldocument1.DocumentElement.ChildNodes['entry'];
text := (i.ChildNodes[2].GetAttributeNS('href','')); // notice the [2] index
</code></pre>
<p>because <code>ChildNodes</code> is an <code>IXMLNodeList</code> object. Make sure that you check if node '2' exists and if it has th... |
Why are my transparent images used in a Delphi 2009 Ribbon not transparent on runtime? <p>I just played around with the new Delphi 2009 ribbon, added a few pages, groups and actionclients (large buttons) to it. I created some transparent 32x32px PNGs in Photoshop and put them into a TImageList (set to cd32bit). I added... | <ol>
<li><p>Ensure that Application theme is enabled by: Project > Options > Application > Enable runtime theme.</p></li>
<li><p>Have you tried to set the DrawingStyle property of Imagelist to dsTransparent?</p></li>
</ol>
|
Problem parsing a XML response from a Last.fm REST service in Silverlight 3 using LINQ to XML <p>I've got some problems parsing the response of a Last.fm API call from a Silverlight 3 application. I pass the response string of the REST service call, which was made via the WebClient class, to the XDocument.Parse() metho... | <p>How did you determine that everything was in one element? Is doc.FirstNode == doc.LastNode? What is doc.NodeType?</p>
<p>If you are only looking at doc.Root.Value, that won't help, as it contains the concatenation of all the descendent text nodes.</p>
<p>Also, you should post at least a little of the XML document ... |
NHibernate inheritance question <p>Currently I have the following classes:</p>
<p>class Article with properties id, title and body
class Question : Article with an extra PostedBy property</p>
<p>Then I have a table called Article with the above properties and a table called questions with an ID a foreign key articleI... | <p>NHibernate supports three basic inheritance strategies.</p>
<ol>
<li>table per class hierarchy</li>
<li>table per subclass</li>
<li>table per concrete class</li>
</ol>
<p>It sounds like you are looking for the table per subclass strategy as you have a table for your Article class and another table for the extra pr... |
Want to make use of a DB without installing a DB engine in .NET <p>There is a small enhancement I'm adding to an application. It would be nice to provide the user with the ability to filter and sort without having to write a lot of code that's already implemented in a database engine. However, I cannot justify install... | <p>Have you looked at <a href="http://www.sqlite.org/about.html" rel="nofollow">SQLite</a>?</p>
<blockquote>
<p>SQLite is a in-process library that
implements a self-contained,
serverless, zero-configuration,
transactional SQL database engine. The
code for SQLite is in the public
domain and is thus free fo... |
What Order to Deploy .NET Application with SQL Server 2008? <p>I have created an Windows application.</p>
<p>I used</p>
<p>FRONT END : C# (VISUAL STUDIO 2008)
BACK END : MICROSOFT SQL SERVER 2008
.NET FRAMEWORK : 3.5</p>
<p>Now after deployment when I am installing the application in my Clients machine is it necess... | <p>You customer will not use Visual Studio, so you don't need to install it.</p>
<p>You will need to install SQL Server manually. You cannot have your setup project install it automatically. Just install SQL Server 2008 (SP1 or higher). I believe this will install all or most of .NET 3.5 for you. If not, then when you... |
How to find the previous and next record using a single query in MySQL? <p>I have a database, and I want to find out the previous and next record ordered by ID, using a single query. I tried to do a union but that does not work. :( </p>
<pre><code>SELECT * FROM table WHERE `id` > 1556 LIMIT 1
UNION
SELECT * FROM t... | <p>You need to change up your <code>ORDER BY</code>:</p>
<pre><code>SELECT * FROM table WHERE `id` > 1556 ORDER BY `id` ASC LIMIT 1
UNION
SELECT * FROM table WHERE `id` < 1556 ORDER BY `id` DESC LIMIT 1
</code></pre>
<p>This ensures that the <code>id</code> field is in the correct order before taking the top r... |
Flash cs4 local security sandbox <p>I'm testing a flash script that calls a JavaScript function (both, the swf and the HTML file are local). The flash movie is not allowed to access the HTML file that contains the js-function.</p>
<p>I've learned that I have to put both files into a security sandbox, so I added the pa... | <p>The requirement for calling from Flash to JS is that you have the allowScriptAccess parmeter set in your embedding code of your HTML document. Iirc, you can specify always or sameDomain and it will work. The second option obviously require the swf to be coming from the same domain.</p>
|
Working with html, css code in a JSP page <p>I am a web designer. As a team member of a web application project, I some times need to work on the jsp pages to modify html, css. I feel uncomfortable seeing the jsp tags which I don't understand. Did any member of this site gone through this kind of experience? If so how ... | <ol>
<li>The base template must <strong>always</strong>
come from you first. This includes
the HTML layout, CSS and JS, even if
they're just empty files 'cos you're
not done with 'em. With some
experience, you should know how to
layout the basic elements which
should not change significantly over
the period of the proj... |
Generally Preferred Method for a 'Wait' Screen using MVVM and Silverlight <p>I'm moving along on a small proof of concept application. This is mostly to beef up my MVVM skills within Silverlight. I came across an interesting problem today that I could not figure how to solve the MVVM way. I wasn't successful finding ... | <p>I think others might be "overthinking" this one...</p>
<p>I would recommend using the BusyIndicator in the Silverlight toolkit.</p>
<p>Simple XAML:</p>
<pre><code><toolkit:BusyIndicator Name="busyBoy" IsBusy="true" BusyContent="Fetching Data..." Margin="6,248,0,0" />
</code></pre>
|
How check file size on upload <p>Whats the best way to check the size of a file during upload using asp.net and C#? I can upload large files by altering my web.config without any problems. My issues arises when a file is uploaded which is more than my allowed max file size.</p>
<p>I have looked into using activex obje... | <p>If you are using <code>System.Web.UI.WebControls.FileUpload</code> control:</p>
<pre><code>MyFileUploadControl.PostedFile.ContentLength;
</code></pre>
<p>Returns the size of the posted file, in bytes.</p>
|
Getting only new mail from an IMAP server <p>I am writing a client application that fetches emails from an IMAP server and then stores them in a database. The problem is that once I have checked the mail, the next time I only want to download the mail that has arrived since. So if I had checked the server for mail two ... | <p>You want to use the UniqueId (UID) for the messages. This is specifically why it was created.</p>
<p>You will want to keep track of the last UID requested, and then, to request all new messages you use the message set "[UID]:*", where [UID] is the actual UID value.</p>
<p>For example, lets say the last message fet... |
Mono and window.external <p>This will be a Windows Forms application deployed through ClickOnce.
The plan is to use the WebBrowser control to expose a web application that makes use of Active-X controls. Using window.external and InvokeScript, the objects will be replaced with references to Reg-Free COM objects (SXS). ... | <p>Here's a hack to simulate windows.external in a .NET WebBrowser control:</p>
<p>In your javascript code you've put in the webbrowser control, encapsulate your calls to window.external (for example):</p>
<blockquote>
<p>function wex() { window.external.WBEvent(arguments[0], arguments[1]); return false; }</p>
</bl... |
Is it possible to treat macro's arguments as regular expressions? <p>Suppose I have a C++ macro CATCH to replace the catch statement and that macro receive as parameter a variable-declaration regular expression, like <code><type_name> [*] <var_name></code> or something like that. Is there a way to recognize... | <p>You can't do it with just macros, but you can be clever with some helper code.</p>
<pre><code>template<typename ExceptionObjectType>
struct ExceptionObjectWrapper {
ExceptionObjectType& m_unwrapped;
ExceptionObjectWrapper(ExceptionObjectType& unwrapped)
: m_unwrapped(unwrapped) {}
template<... |
How do I use TLS with asyncore? <p>An asyncore-based XMPP client opens a normal TCP connection to an XMPP server. The server indicates it requires an encrypted connection. The client is now expected to start a TLS handshake so that subsequent requests can be encrypted.</p>
<p><a href="http://trevp.net/tlslite/readme.t... | <p>Definitely check out twisted and wokkel. I've been building tons of xmpp bots and components with it and it's a dream.</p>
|
Sharepoint Web Services Error GetListItems in Lists.asmx <p>Arrggh. I've seen like 15 examples that say do it like this: <a href="http://stackoverflow.com/questions/583606/sharepoint-web-services-test-if-file-exists">http://stackoverflow.com/questions/583606/sharepoint-web-services-test-if-file-exists</a></p>
<p>I'm... | <p>You need to pass string.empty as the second paramter (view name) rather than a null value.</p>
|
How do I "fake" C# style attributes in Ruby? <p><strong>EDIT</strong>: I slightly changed the spec, to better match what I imagined this to do. </p>
<p>Well, I don't really want to fake C# attributes, I want to one-up-them and support AOP as well. </p>
<p>Given the program: </p>
<pre><code>class Object
def Object.... | <p>I have a somewhat different approach:</p>
<pre><code>class Object
def self.profile(method_name)
return_value = nil
time = Benchmark.measure do
return_value = yield
end
puts "#{method_name} finished in #{time.real}"
return_value
end
end
require "benchmark"
module Profiler
def metho... |
Switch Between Views in Cocoa (not Cocoa Touch) <p>It seems like there is a lot of online information regarding switching between views in Cocoa Touch, but not that many in "desktop" Cocoa. For an app I am creating, I am wondering the pros/cons of the methods (and please list the methods if you could), and which one p... | <p>Cathy Shive has created a framework called <a href="http://katidev.com/blog/ktuikit/" rel="nofollow">KTUIKit</a> which was designed with single window applications modeled after iPhoto/iTunes/etc. The KTTabViewController class in particular may be of interest, as it provides a way of switching between an arbitrary ... |
How do I save/display line breaks properly in a UIWebView for the iPhone? <p>I have a UIWebView-based iPhone application that reads in HTML from a SQLite database. The user can save new information, entered via a UITextView that accepts carriage returns. How do I display these carriage returns (line breaks) properly in... | <p>I can see two back slashes in your search string: You have to replace <code>"\n"</code>, not <code>"\\n"</code> to make it work.</p>
<p>But you <a href="http://imgs.xkcd.com/comics/exploits%5Fof%5Fa%5Fmom.png" rel="nofollow">really want to sanitize your input</a> before loading it into the UIWebView. At least you h... |
How to achieve code folding effects in Emacs? <p>Whats the best way to achieve something like code folding, or the type of cycling that org-mode uses. What would be the best solution in elisp to create this type of behavior?</p>
<p>EDIT:
I'm sorry I was not clear. I want to program something in elisp that does thing... | <p>Folding is generally unnecessary with emacs, as it has tools that explicitly implement the actions people do manually when folding code.</p>
<p>Most people have good success with simple incremental searches. See "foo" mentioned somewhere? Type <kbd>C-s</kbd><code>foo</code>, find the definition, press enter, read ... |
Pinging WCF Services <p>What is the most efficient way to check if WCF Service is available. (Pinging) It suppose to be binding configuration independent.</p>
<p>I prefer not to modify the Service Contracts with IsAlive() method. Ideally, I would expect that the WCF framework supports it. Otherwise, our solution is do... | <p>The two things I do are a telnet check to make sure the WCF process has the socket open.</p>
<pre><code>telnet host 8080
</code></pre>
<p>The second thing I do is always add an IsAlive method to my WCF contract so that there is a simple method to call to check that the service host is operating correctly.</p>
<pr... |
How do I ensure assignability within this tree? <p>There is tree of classes rooted at CBase (single-inheritance).
CSub is derived from CBase, and other classes derived from CBase or CSub,
and CBase having virtual member functions. </p>
<p>All classes must be assignable. Some classes have members (pointers) that
nee... | <p>It's a simple question i believe. You'll need to implement "virtual assignment operator" which will require upcast imho:</p>
<pre><code>class CBase {
...
virtual assign(const CBase & from) = 0;
...
};
class CSub {
...
void operator=(const CSub & from) { assign(from); }
virtual assign(const CBase... |
scripting a Grails app <p>I need to write a script for a Grails application that modifies persistent data, send e-mails to users, etc.</p>
<p>While there's nothing Grails-specific about this - I could accomplish these tasks using JDBC, JavaMail - I'm hoping there's a better way. Specifically, if I could write a Groovy... | <p>Based on your question I'm assuming this a one time script you need to run, rather than some functionality that belongs in the grails app. For this, you could write a groovy script and run it in the grails console:</p>
<pre><code>grails prod console
</code></pre>
<p>In the console you would have access to the Dom... |
Typecasting a custom column in rails ActiveRecord? <p>Let's say we do:</p>
<pre><code>default_scope :select => '*, 1+1 AS woah'
</code></pre>
<p>in a model, we can then access woah as a method on the model, but it's a string. How do we typecast this so that it's an integer?</p>
<p>In my real-world example I'm act... | <p>How about using a read-only virtual attribute in your model:</p>
<pre><code>default_scope :select => '*. 1+1 AS raw_woah'
def woah
raw_woah.to_i
end
</code></pre>
|
Java's socket.localPort() always reports -1 <p>I have some code which needs to know the local port it uses to connect to a server. </p>
<p>The Socket.localPort() call always seems to return -1. Also, do a Socket.toString() returns something like "port=33031,localport=-1" - again, with a -1.</p>
<p>Does anyone know wh... | <p>If you're looking at the Socket class from java.net package, it returns a -1 if the socket is not bound yet. The method is not a static method and is goes by the name, getLocalPort not just localPort. In GNU Classpath, -1 most probably means the same thing.</p>
|
Using Linq Expressions to decouple client side from DAL (which is server side) <p>I could not find the answer amongst the many posts on Linq, so here I am.
We have a client-server application, where the client side has absolutely no knowledge of the actual DAL on the server side, which is incidentally implemented using... | <p>Take a look at this post. You could use this concept to pass in query parameters and then dynamically build your query.</p>
<p><a href="http://stackoverflow.com/questions/295593/linq-query-built-in-foreach-loop-always-takes-parameter-value-from-last-iteration">http://stackoverflow.com/questions/295593/linq-query-b... |
How to access the database from the other system or server? <p>Using VB 6 </p>
<p>How to access the database from the other system or server?</p>
<p>Code</p>
<pre><code>Cn.ConnectionString = "Provider=Microsoft.jet.oledb.4.0; Data Source=" & _
App.Path & "\DC-CS.MDB"
Cn.Open
</code></... | <p>RBarry is referring to the fact that you can "share" a particular folder on one computer, so that it is accessible to another computer.</p>
<p>If two computers are named computer1 and computer2, then computer2 can share a folder on it's C: drive giving it some name like "sharedfolder". Then computer1 can access th... |
Sending data through a serial port <p>am doing some surveillance project... i need to make some serialport data communication between two systems ... here i could find available com ports in my system through which i need to send and receive some data...is it possible in .net framework 1.1 ? is there is any option?</p... | <p>When I needed to do some serial port work back in 1.1, I found an article written by Noah Coad that uses the MSComm OCX control and that ended up working for me. You can find his article at <a href="http://www.devhood.com/tutorials/tutorial%5Fdetails.aspx?tutorial%5Fid=320" rel="nofollow">http://www.devhood.com/tut... |
Good study material for C#,JavaScript,PHP? <p>I am a proficient C++/Qt coder, having worked only on desktop projects till now. I wanted to extend my knowledge base into the web realm. In this regard, can some of you suggest good reading material for C#,JavaScript and php? And are there any standards for these languages... | <p>For PHP, I would recommend these three books whose approach to PHP Web development
is quite disciplined and could actually be used to build small- medium (perhaps large)
scale projects. They are not really meant for beginners but with your good
background in C++ / O-O programming, it should be relatively easy to ... |
How do C/C++ compilers work? <p>After over a decade of C/C++ coding, I've noticed the following pattern - very good programmers tend to have detailed knowledge of the innards of the compiler. </p>
<p>I'm a reasonably good programmer, and I have an ad-hoc collection of compiler "superstitions", so I'd like to reboot my... | <p>Start with the dragon book....(stress more on code optimization and code generation)</p>
<p>Go onto write a toy compiler for an educational programming language like Decaf or Cool.., you may use parser generators (lex and yacc) for your front end(to make life easier and focus on more imp stuff)....</p>
<p>Then rea... |
How to retrieve a response from server for the request sent <p>I am developing an application that connects to a remote web server and exchanges data with the web server frequently. First screen of my application provides login screen that authenticates user. </p>
<p>I am able to authenticate user on the web server by... | <pre><code>- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
[responseData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responseData appendData:data];
}
- (void)connection:(NSURLConnection *)connection didFailWi... |
How do I suppress Eclipse 3.5's warnings of dead code <p>I use a <a href="http://www.leshazlewood.com/?p=5">class for detecting email addresses</a> which uses static final booleans to configure the matching behavior. Since I upgraded to Eclipse 3.5 I get warnings about dead code, since Eclipse notices that one branch i... | <p><strong>UPDATE</strong>: from Adam's comment:</p>
<p>In Eclipse 3.6 and newer Eclipse versions <code>@SuppressWarnings("unused")</code> can now be used to suppress 'dead code' warnings. See <a href="http://stackoverflow.com/a/17998010/122442">Christopher Stock's answer</a>.</p>
<p>See also <a href="http://help.ecl... |
re-use same session for each httpclient request <p>My java servlet call httpclient to get page content. may I know what is the best practice to re-use same session for same user when doing multiple sub sequence request from servlet</p>
| <p>Assuming your are using Apache's <a href="http://hc.apache.org/httpclient-3.x/" rel="nofollow">HttpClient</a></p>
<p><a href="http://wiki.apache.org/jakarta-httpclient/ForAbsoluteBeginners#head-1cf332662ef015b4aa19e06dc24c24e391ecda69" rel="nofollow">Here's the information</a> you're probably looking for</p>
|
How Do I serialize a COM object in .Net? <p>I need serialize a Com Object using .net using c# or Delphi .Net
is this possible?</p>
| <p>Check to see if you COM object implements <a href="http://msdn.microsoft.com/en-us/library/ms690091%28VS.85%29.aspx" rel="nofollow">IPersistStream</a>, <a href="http://msdn.microsoft.com/en-us/library/aa768210%28VS.85%29.aspx" rel="nofollow">IPersistMemory</a> or any other of the <a href="http://msdn.microsoft.com/e... |
Disable visual studio's cache <p>Can we turn off the process of making <strong>Asp.net temporary files</strong> and <strong>project assemblies cache</strong> to
be sure that the results we get are really fresh and they got all the latest changes?</p>
| <p>Are you using a web site (File->New Web Site), or a Web Application Project (File->New Project)?</p>
<p>If it's a web application project, then rebuilding it should be enough. I don't know whether web sited have a concept of a rebuild.</p>
<p>Also, you can just check the dates of the temporary files to see if they... |
Difference between TargetType="controlType" and TargetType="{x:Type controlType}" <p>In WPF you can set the <code>TargetType</code> to either the name of the type or you can set it to <code>{x:Type nameOfType}</code>.</p>
<p>Does anyone know what the difference is?</p>
| <p>Nothing. Since the property type is <code>Type</code>, the XAML parser knows to try and convert whatever you supply to a <code>Type</code>. In other scenarios, the property type might be less specific (eg. <code>Object</code>), and that's where you need the markup extension, otherwise the XAML parser will just inter... |
Request for the permission of type 'System.Security.Permissions.FileIOPermission.. failed <p>I am getting this error when calling a web service method which writes to a file on the local drive on Windows 2003.</p>
<p>"System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.Fi... | <p>After a lot of troubleshooting, it boiled down to a mistake I made in web.config where the location tag had a path of www.exampledomain.com but in IIS it was exampledomain.com!</p>
|
How can I replace all £ in a file with £ with Perl? <p>I am trying to replace all <code>£</code> symbols in a HTML file with <code>&pound;</code>. My regular expression does not seem to work.</p>
<p>Could you please help?</p>
| <p>You most probably forgot to:</p>
<pre><code>use utf8;
</code></pre>
<p>Try the following program:</p>
<pre><code>#!/usr/bin/perl
use strict;
use warnings;
use utf8;
while (<DATA>) {
s/£/&pound;/g;
print
}
__END__
This is sample text with lots of £££!
50£ is better than 0£.
</code></pre>... |
Inline Elements With Width <p>This question seems to be asked freqeuently over the internet but I still can't find a solution.</p>
<p>I have this navigation bar (It switches between tabs using jQuery) which displays inline. I'm showing a background image on these and to make them more definitive I need to make them wi... | <p>Luckily you live in the year 2009, where inline-block is widely adopted through browsers: <a href="http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/" rel="nofollow">Cross browser inline-block</a>.</p>
<p>If it's just for the height (and all the content of the <code>li</code>s fits each on one li... |
Pointer to pointer confusion <p>Edit: The reason queue is 2d is because I need a pointer of Command so that cmd can equal NULL. NULL == (void *). This is where I get confused though, and why I've come here. :)</p>
<p>To help try and figure out another problem I have in Python, I'm implementing a small test program in ... | <p>I think you have a bug you need to fix before anything else. You have a 2D array of commands and have set one of those dimensions to zero! </p>
<pre><code>struct Command queue[1024][0];
</code></pre>
<p>When you access queue you seem to treat it as a 1D structure. Should you declare it as :</p>
<pre><code>struct ... |
How to manipulate form field values in jQuery <p>I'm trying to get the value of a few checkboxes and enter them in a hidden form field, is there a way to do that in jQuery,</p>
<p>my checkboxes look like this</p>
<pre><code><form>
<input type="checkbox" name="chicken" id="chicken" />Chicken
<i... | <p>I think this is a cleaner approach to what has been offered so far...</p>
<pre><code>var values = [];
$('#chicken, #meat').filter(':checked').each(function() {
values.push($(this).attr('id'));
});
$('#hidden_field').val(values.join(','));
</code></pre>
<p>Instead of updating the hidden field when a user checks... |
displaying images from different sources <p>I am trying to generate an image report for a particular items. Every item has a unique item number, which is stored in the variable $pk.</p>
<p>In this, calling up images/$pk.jpg and/or screenshots/$pk.jpg will show the relevant image or screenshot for the current item page... | <p>You cannot mix HTML and PNG output (that is: embed a PNG inside the HTML) as you are trying to do. You need to split this script in two parts.</p>
<p>The first part (e.g. report.php) outputs a list of all the images along with <code>img</code> tags. E.g:</p>
<pre><code><img src="/thumbnail.php?pk=1234567" />... |
String.Format against string.Format. Any issues? <p>Is there any performance differences between string.Format and String.Format ?
As far as i understand string is a shortcut for System.String and there's no difference between them. Am i right?</p>
<p>Thanks!</p>
| <p>Those are exactly the same. "string" is just an alias for "System.String" in C#</p>
|
RedDot: Linking, referencing, lists and 'partial pages' <p><strong>UPDATED</strong></p>
<p>Using RedDot CMS, linking to a 'sub-page' (page within a page) directly will display JUST that sub-page, not within the context of its main parent. Referencing that sub-page WILL display it as I require.</p>
<p>I have a List li... | <p>I've just replicated the same thing on Reddot and have had a bit of a think about this, Is what you're after actually possible. As I understand it you're linking to the sub-page because that is where the keywords are assigned, but that sub-page could be contained in one ore more parent page.</p>
<p>If on your site ... |
How can I update files on Amazon's CDN (CloudFront)? <p>Is there any way to update files stored on Amazon CloudFront (Amazon's CDN service)?
Seems like it won't take any update of a file we make (e.g. removing the file and storing the new one with the same file name as before).
Do I have to explicitly trigger an update... | <p>Amazon added an Invalidation Feature. <a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/index.html?Actions_Invalidations.html">This is API Reference</a>.</p>
<p>Sample Request from the API Reference:</p>
<pre><code>POST /2010-08-01/distribution/[distribution ID]/invalidation HTTP/1.0
... |
I've got a trouble in css and jcarousel lite <p>I had this HTML code like that:</p>
<pre><code><ul>
<li>
<div class="Items">
<div class="WrapImage">
<div class="caption-right">
<span class="icon1"></span>
... | <p>Make sure your relative container (maybe Items or WrapImage) has a width, atleast at first to check if that is the problem. Most IE problems i run into is usually because something is missing a width.</p>
<p>hasLayout is good to know about when trying to solve IE issues <a href="http://www.satzansatz.de/cssd/onhavi... |
Export C# reportviewer control programmatically <p>Does anyone know if you can programmatically save a report shown in a reportviewer control in C#?</p>
<p>When a report is shown there are "Export to..." buttons and I would like to automate the saving to PDF function.</p>
| <p>You can do this with <a href="http://msdn.microsoft.com/en-us/library/ms251771%28VS.80%29.aspx">ReportViewer Control</a>(with <a href="http://msdn.microsoft.com/en-us/library/ms251839%28VS.80%29.aspx">LocalReport.Render Method</a>), check "Email a report" example at the <a href="http://www.gotreportviewer.com/">http... |
Best way to store lots of boolean columns in table <p>I'm not sure if this kind of question has been asked before but I searched and could find anything. </p>
<p>I am working on a database at the moment that has records that have lots of boolean based values stored with them, so the table structure looks something li... | <p>Leave it as it is!</p>
<p>The database will pack multiple bit fields very efficiently. I have seen people doing things like having a 32-bit int field, thus allowing them to store their 17 boolean values using bitmasking and 'leaving some room for additional fields'. This is just dumb, it is a maintenance nightmare ... |
How do I wrap link_to around some html ruby code? <p>How do I wrap a link around view code? I can't figure out how to pass multiple lines with ruby code to a single <code>link_to</code> method. The result I am looking for is that you click the column and get the show page:</p>
<pre><code><div class="subcolumns">... | <p><code>link_to</code> <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M001882">takes a block of code</a> ( >= Rails 2.2) which it will use as the body of the tag.</p>
<p>So, you do</p>
<pre><code><%= link_to(@album) do %>
html-code-here
<% end %>
</code></pre>
<p><strong... |
How to Deploy VB6 Applications? <p>How to run the exe file to other system?</p>
<p>Using VB 6 </p>
<p>I copied the exe file to other system, then run that exe file, it not working it showing error
âcomponent comdlg32.ocx or one its dependencies not correctly registered a file is missing or invalidâ`</p>
<p>Can ... | <p>When deploying VB6 applications, you should create a Setup, this will manage the DLL's that the VB6 application depends on. Since it is not enough to just copy the .Exe and .Dll's. You also need to register them.</p>
<p>The creation of the setup is included in the VB6 environment.</p>
|
How does facebook, gmail send the real time notification? <p>I have read some posts about this topic and the answers are comet, reverse ajax, http streaming, server push, etc.</p>
<p><a href="http://stackoverflow.com/questions/988082/how-does-incoming-mail-notification-on-gmail-works">How does incoming mail notificati... | <p>The way Facebook does this is pretty interesting. </p>
<p>A common method of doing such notifications is to poll a script on the server (using AJAX) on a given interval (perhaps every few seconds), to check if something has happened. However, this can be pretty network intensive, and you often make pointless reques... |
Bug in ASp.NET Ajax Rating Control <p>Im using ASP.NET Ajax Rating control in my current project and i get this strange behaviour:</p>
<p>When somoene clicks on the control to rate some content, rating is properly executed but browser sroll position jumps to the top of the browser window!</p>
<p>This is very user un-... | <p>This article should help:</p>
<p><a href="http://aspdotnetfaq.com/Faq/How-to-fix-Bug-in-ASP-NET-Ajax-Rating-control-that-causes-jumping-to-the-top-of-the-page.aspx" rel="nofollow">How to fix Bug in ASP.NET Ajax Rating control that causes jumping to the top of the Page?</a></p>
|
Action Failed on OpenStoredProcedure action in Access Project (ADP) macro <p>In an Access Project (ADP), there is a macro set up the calls a stored procedure on a SQL Server 2005 database (which updates a table, but does not return any results). This macro is called when a user clicks on a button in a form.</p>
<p>It ... | <p>Sounds like the user does not have privileges on the underlying tables. </p>
<p>Try logging in as the user from SQL Server Managerment Studio and run the Stored Procedure directly.</p>
|
What are the concepts a vc++ developer should be familiar with? <p>I am a vc++ developer but I spend most of my time learning c++.What are all the things I should know as a vc developer.</p>
| <p>Most importantly, the Debugger.</p>
<p>And if you are into MFC/ATL Development, than those libraries off course.</p>
<p>Other things such as how to enable exceptions while debugging, how to load debugging symbols from disk paths etc are always of great help.</p>
<p>Actually, it really depends on what kind of proj... |
why does my usercontrol keep resetting it's visible property to false? <p>Ok, I have a usercontrol on my page.</p>
<p>On the page, the visible property is set to false.</p>
<p>On the OnPreRender event, I set the visible property to true.</p>
<p>It runs the line of code, but does not actually change anything. (so vis... | <p>Check for the visible property on any controls containing this control.</p>
<p>Setting Visible=True does not mean that Visible==True, it will still return False if a parent control is False.</p>
<p>Other than that though, you may need to post some examples of your code in order for anyone to help track down what t... |
name forgeign key in JPA? <p>I am using the Hibernate Tools ant task to generate DDL from JPA annotated entities. With hibernate annotations you can name the foreign key using</p>
<pre><code>@JoinColumn(name = "foo")
@org.hibernate.annotations.ForeignKey(name = "fk_foo")
</code></pre>
<p>Is there a pure JPA way of ac... | <p>Not in annotation. You can however set the <a href="http://java.sun.com/javaee/5/docs/api/javax/persistence/JoinColumn.html#columnDefinition%28%29" rel="nofollow">columnDefinition</a> and write the foreign key in there.</p>
|
How do you output html as code on asp.net page? <p>I want to dump out some HTML I am rendering in a C# class on an ASPX page. But not as the rendered HTML but the actual HTML before the browser renders it.</p>
<p>Is this possible?</p>
| <p>Server.HtmlEncode should do the trick...</p>
|
ActionScript 3 Array Casting problem in Flash CS4 <p>I have these Arrays</p>
<pre><code> //Array elements are Sprites (Class) in Flash Library
var elements:Array = new Array (el1_spr, el2_spr, el3_spr);
var container:Array = new Array();
for var (i:uint; allElements.length; i++){
container.push... | <p><code>el1_spr</code> is a <code>Class</code> object not a <code>Sprite</code></p>
<p>You should do:</p>
<pre><code>var s:Sprite = new el1_spr() as Sprite;
</code></pre>
<p>in order to get your <code>Sprite</code> object.</p>
|
cannot get post values send with ajaxcall <p>My problem is the folowing:
I am trying to retrieve the postvalue, but whenever I put that statement in the php code the ajaxcall will fail.</p>
<p>I cannot see what I am missing here??</p>
<pre><code>$.ajax({
url: "includes/livetabs.php?actie=sessiegebruikersnaam"... | <p>EDIT: The stuff you are passing to the server should be wrapped in parenthesis, also, I would specify the type of request for clarity:</p>
<pre><code>data: ({gebruikersnaam : tbgebruikersnaam}),
type: "POST", //just in case
</code></pre>
<p>Badly formed json will not work with $.ajax. Try using <a href="http://www... |
How to read EMF - Enhanced metafiles? <p>Does anybody know of a library or a piece of code that can read EMF (Enhanced Metafiles). Ideally it would convert an EMF to a list of drawing commands and objects?</p>
| <p>The <a href="http://xmlgraphics.apache.org/commons/image-loader.html" rel="nofollow">Apache Image Loader Framework</a> (Java) can read EMF file and convert then to SVG, it can also read WMF using 3rd party plugin.</p>
|
Is there any C++ api available to know the OS description? <p>I am working tools that will be used on the multiple OS and platform. This tools will provide the details of the OS on which it is running, like 32 bit or 64 bit OS, exact version of Linux,Solaris,or other OS.</p>
<p>One way I am thinking of using the "unam... | <p>Why don't you simply wrap the OS detection with #define and each time call the ideal function so as to return a meaningful string in every case?</p>
<p>Some examples of system function to get information about the current OS (such as the running version):</p>
<ul>
<li>In Windows the function is:
<a href="http://ms... |
Types of Peer-to-peer connection <p>I am developing an application and trying to use an peer-to-peer communication. i have idea about bluetooth and WIFI.</p>
<p>Is their any other options for peer-to-peer communication. Is it possible using Internet option.</p>
<p>Please help me with a source code or any documentatio... | <p>WIFI is internet. I'm not quite sure what you mean.</p>
|
What is the best way to make TCP and UDP packet spoofing and injection? <p>Hy folks,</p>
<p>I'm kinda new to low level networking. I need to intercepts all TCP/UDP packets and potentially filter or substitute them with new ones.</p>
<p>What would be the best way to intercept these packets and inject new one? I'm only... | <p>You want <a href="http://www.winpcap.org/" rel="nofollow">WinPcap</a> if you're on Windows. What you're going to need to do is intercept (and filter) packets with WinPcap and then write a program that does packet creation when/if you want it.</p>
|
How to call actions between classes? <p>yeah it's me again :)</p>
<p>I've got a little problem.</p>
<p>I've got a custom cell with a TextField. I want the keyboard to hide when i tap "done"</p>
<p>so normally i do this jus with <code>[sender resignFirstResponder]</code>.</p>
<p>In this case that doesn't work becaus... | <p>Set your UITextField's delegate to the UIViewController. You can do this in Interface Builder (if you created your UITableViewCell like that), or through code (in your UIViewController).</p>
<pre><code>tableViewCell.textView.delegate = self
</code></pre>
<p>Now, in your UIViewController, add this function:</p>
<p... |
How do I reach the middle tier using the memship class? <p>I have a 3-tier ASP.NET 2.0 app. I want to use the Membership.ValidateUser method of the membership class using the credentialls added with the login control. As stupid as it seems, I can't figure out how to have the ValidateUser control call anything but the d... | <p>You just need to create a <a href="http://msdn.microsoft.com/en-us/library/f1kyba5e%28VS.80%29.aspx" rel="nofollow">custom membership provider</a>, inherit from MembershipProvider then wire it up in the web.config. The provider could go in your App_Code folder then call your middle tier</p>
<pre><code><membershi... |
moving image on webpage <p>is this solution possible in asp.net <a href="http://stackoverflow.com/questions/1086989/dragging-picturebox-inside-winform-on-runtime">http://stackoverflow.com/questions/1086989/dragging-picturebox-inside-winform-on-runtime</a></p>
<p>i just want to be able to move an image around on a webf... | <p>The question you referenced is written in windows forms. You can not drag'n drop elements in your web form as in windows forms. </p>
<p>If you want to drag and drop elements in a web application, you should use client side code. </p>
<p>The best option in client side is to use a library, and the best one is <a hre... |
Adding custom HTTP headers in java <p>I'm trying to create a simulation for our web Portal and need to add custom HTTP headers. I am to assume the user has already been authenticated and these headers are just for storing user information (ie, "test-header: role=user; oem=blahblah; id=123;"). </p>
<p>I've setup a fi... | <p>Maybe you can store that information in the session:</p>
<pre><code>
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import... |
Calling stored procedure via query and getting return value in C# without output parameters <p>Is there anyway I can execute stored procedure via EXEC (so not specifying <code>CommandType.StoredProcedure</code> in C#) and get result?</p>
<p>I tried to execute query</p>
<pre><code>DECLARE @R int
EXEC @R = proc p1, p2... | <p>try this running this query in C#:</p>
<p>exec ('declare @r int;EXEC @r=testing 1,2;select @r')</p>
|
Oracle NUMBER Comparisons <p>Generally in programming, the floating point data types should not be compared for equality since the values stored are very often an approximation.</p>
<p>Can two non-integer Oracle NUMBER values be compared reliably for equality since they are stored differently (base-10)?</p>
| <p>Yes, Oracle NUMBER types are precise. They're more like integers with a scale than float/double types. So a NUMBER(10,3) has 10 digits, 3 after the decimal point, which is really a 10 digit integer with a scale of 3. In fact, that's precise how Java BigDecimals work (being a BigInteger plus a scale internally).</p>
|
How to get rid of empty blocks in vim <p>I used textmate to work with ruby code for over one year. Recently I switched to using mvim. When I open some of the files in mvim I get empty blocks. <a href="http://twitpic.com/9hsl8/full" rel="nofollow">Look at this picture</a> to get a feel for it.</p>
<p>Any idea on how to... | <p>Others have explained that this could either be a search highlighting spaces or tabs or (more likely) it could be highlight designed to show up mixed indentation (particularly useful in python for what it's worth). I find this very useful personally.</p>
<p>Anyway, there are a number of options to sort out your hi... |
Ruby on Rails: Editor for backend of the web application <p>What editor can you suggest to integrate with the backend of the web app I'm currently developing? I want to allow my <em>trusted</em> users to add articles that would be visible on the
frontend. It should have some kind of markup language (to make basic custo... | <p>look into restful_authentication (authentication), RedCloth (textile markup language), Hobo (admin interface), and paperclip (file uploads/attachments). You can piece together something with those.</p>
|
How do I get an edit token for Mediawiki? <p>I want to get an edit token via a HTTP POST command. The API documentation says only</p>
<blockquote>
<p>Edit token. You can get one of these through prop=info</p>
</blockquote>
<p>Using <strong><em>action=query&prop=info&titles=Main Page&intoken=edit</em></s... | <p>The following works for me (as described at <a href="http://www.mediawiki.org/wiki/API:Edit_-_Create%26Edit_pages#Token" rel="nofollow">http://www.mediawiki.org/wiki/API:Edit_-_Create%26Edit_pages#Token</a>):</p>
<p><a href="http://en.wikipedia.org/w/api.php?action=query&prop=info&intoken=edit&titles=Sa... |
Transforming Results of PostgreSQL Query to XML, using PHP DOM <p>Given SQL as an input, I have to query a PostgreSQL database and return the results as XML. I have done this with the following code:</p>
<pre><code><?php
$link = "host=localhost dbname=company user=pgsql password=password";
$connect = pg_connect($l... | <p>First, you may consider performing your xml mapping within Postgres itself using the available built-in <a href="http://www.postgresql.org/docs/8.3/static/functions-xml.html#FUNCTIONS-XML-MAPPING" rel="nofollow">functions</a>. Two benefits of this are that your data abstraction functionality stays together and that ... |
Emulate the .NET [Obsolete] Attribute <blockquote>
<p><strong>Possible Duplicate:</strong><br />
<a href="http://stackoverflow.com/questions/154109/custom-compiler-warnings">Custom Compiler Warnings</a> </p>
<p>Duplicate: <a href="http://stackoverflow.com/questions/154109/custom-compiler-warnings/154254">http... | <p>No, <code>ObsoleteAttribute</code> are treated in a very special way by the CLI-compliant compilers, so there's no way to mimic its behavior. <code>#warning</code> or <code>#error</code> (see <a href="http://msdn.microsoft.com/en-us/library/ed8yd1ha%28VS.71%29.aspx" rel="nofollow">this</a>) might do the job.</p>
|
Where do you put non-controller, non-model code in a ASP.Net MVC project? <p>Where do you put non-controller, non-model code, like util classes, extension methods and so on in a ASP.Net MVC project? Maybe there's not a specific place to put it, you just put it anywhere, if so, any recommendation? Any best practices?</p... | <p>if it's a single class i put them in a "Library" folder on the project root. If it's a bit bigger I use a specific folder and if it's something more complex i create a new project in the same solution.</p>
|
Resource temporarily unavailable in Boost ASIO <p>I get the error message "Resource temporarily unavailable" when I use the method receive_from(), it's a member of ip::udp::socket <a href="http://www.boost.org/doc/libs/1%5F39%5F0/doc/html/boost%5Fasio/reference/basic%5Fdatagram%5Fsocket/receive%5Ffrom.html" rel="nofoll... | <p>"Resource temporarily unavailable" is normally the text description for <code>EAGAIN</code>, indicating that the operation should be retried. In the case of UDP, it indicates that there isn't any data available at present, and you should try later.</p>
<p>It's generally worth looking at the man page for the underly... |
Pointers to virtual member functions. How does it work? <p>Consider the following C++ code:</p>
<pre><code>class A
{
public:
virtual void f()=0;
};
int main()
{
void (A::*f)()=&A::f;
}
</code></pre>
<p>If I'd have to guess, I'd say that &A::f in this context would mean "the address of A's impleme... | <p>It works because the Standard says that's how it should happen. I did some tests with GCC, and it turns out for virtual functions, GCC stores the virtual table offset of the function in question, in bytes.</p>
<pre><code>struct A { virtual void f() { } virtual void g() { } };
int main() {
union insp {
void... |
Working with imperial units <p>I'm toying with an application that is, roughly speaking, a sort of modeler application for the building industry. In the future I'd like it to be possible for the user to use both SI units and imperial. From what I understand, it's customary in the US building industry to use fractions o... | <p>I would definitely consider adding a Units property to the distance class. You could then overload the +, -, *, / (and related) operators so that arithmetic operations on distances is only possible when the units are the same type.</p>
<p>Personally, I would normalize all measurements into the lowest unit of measur... |
vim keystroke for \ type hotkeys? <p>What do I type in i, n, and v mode to do say the following hotkey?</p>
<p>\sd
\sf </p>
<p>Also I am using this plugin in cygwin?</p>
<p>This is the <a href="http://www.vim.org/scripts/script.php?script%5Fid=556" rel="nofollow">plugin</a> and the hotkeys <a href="http://lug.fh-swf... | <p>For \sd to get a <code>do {} while</code> with the cursor between the braces:</p>
<pre><code>:imap \sd do {} while<ESC>hhhhhhi
:nmap \sd ado {} while<ESC>hhhhhhi
:vmap \sd ado {} while<ESC>hhhhhhi
</code></pre>
<p>With this, I guess you should be able to fill in the rest as well.</p>
|
PHP RegEx Grouping Multiple Matches <p>I'm just trying my hand at crafting my very first regex. I want to be able to match a pseudo HTML element and extract useful information such as tag name, attributes etc.:</p>
<pre><code>$string = '<testtag alpha="value" beta="xyz" gamma="abc" >';
if (preg_match('/<(\... | <p>Try this regular expression:</p>
<pre><code>/<(\w+)((?:\s+\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s]*))*)\s*>/
</code></pre>
<p>But you really shouldnât use regular expressions for a context free language like HTML. Use a real parser instead.</p>
|
Is there a way to list Django signals? <p>Is there a way to see which signals have been set in Django?</p>
| <p>It's not really exposed in docs but Signal is just a class that contains a list of receivers which are called on event. You can manually check this list:</p>
<pre><code>from django.db.models.signals import *
for signal in [pre_save, pre_init, pre_delete, post_save, post_delete, post_init, post_syncdb]:
# print... |
Does anyone know of any open source versions of Twitter? <p>I built a GIS application around Twitter and now its getting some interest.
But one of the requirements is that they don't want any outside dependencies.
So I'll need to mimic Twitters functions.</p>
<p>Anyone know of any open source Twitter projects?</p>
| <p>Laconica?</p>
<p><a href="http://laconi.ca/trac/" rel="nofollow">http://laconi.ca/trac/</a></p>
<p>Identica demos it nicely:</p>
<p><a href="http://identi.ca/" rel="nofollow">http://identi.ca/</a></p>
|
ASP: convert milliseconds to date <p>I need to convert a field with milliseconds created by PHP app to a date value. Is there a way to do this using VBScript? or convert to datetime in SQL 2005?</p>
<p>Example: <code>1113192000</code> to <code>mm/dd/yyyy hh:mm:ss</code></p>
| <p>Something like the following should work:</p>
<pre><code>Function ConvertPhpToDate(numSeconds)
Dim dEpoch
dEpoch = DateSerial(1970,1,1)
ConvertPhpToDate = DateAdd("s",numSeconds,dEpoch)
End Function
</code></pre>
<p>Note, the php <code>time()</code> function returns the number of 'seconds', not millisecon... |
Drawing a full screen Quad? <p>What's wrong with this:</p>
<pre><code>pVertexBuffer[0].Position = D3DXVECTOR3(0.0f,0.0f,0.0f);
pVertexBuffer[0].TexCoord = D3DXVECTOR2(0.0f,0.0f);
pVertexBuffer[1].Position = D3DXVECTOR3(m_ScreenResolutionX,0.0f,0.0f);
pVertexBuffer[1].TexCoord = D3DXVECTOR2(1.0f,0.0f);
pVertexBuffer[... | <p>Vertex shaders output vertices in homogenous screenspace coordinates; they are usually screen resolution independent. In other words, you should output coordinates from (-1,-1,0) to (1, 1, 0).</p>
|
Total height of the page <p>I'm trying to get the total height of a page using JavaScript and jQuery so I can check if the page is long enough to display something, however in my testing I am unable to get the total height of a page.</p>
<p>I've looked around on the Internet but things like this don't seem to be well ... | <p>Without a framework:</p>
<pre><code>var _docHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;
var _docWidth = (document.width !== undefined) ? document.width : document.body.offsetWidth;
</code></pre>
|
Is it possible to hash a password and authenticate a user client-side? <p>I often make small websites and use the built in ASP.NET membership functionality in a SQL Server database, using the default "hashing" password storage method.</p>
<p>I'm wondering if there's a way to authenticate a user by hashing his password... | <p>This is a bad idea, security wise. If you send a non-ssl form that contains the hashed password, then anyone capturing traffic has all they need to login. Your javascript has to result in something that indicates success (a redirect, token passed to the server, etc). Whatever it is, the listener now can recreat... |
How to access HTML files from ASP.NET MVC VIEWS Folder <p>I will like add conventional HTML page under VIEWS folder (in ASp.NET MVC) page.
I have added the route exceptions as mentioned below. </p>
<pre><code> routes.IgnoreRoute("{resource}.htm/{*pathInfo}")
routes.IgnoreRoute("{resource}.html/{*pathInfo}")
</... | <p>I think that it's a mistake to mix your HTML content with your views. I'd suggest that you create a separate <code>static</code> folder under Content and put your HTML there. You can create an analogous directory structure to your view structure if necessary for management. Then you don't need to do anything spec... |
Why does a tcp remoting client needs to listen? <p>When a remoting client creates a TcpClientChannel object, it listens on an (unspecified) port. What for?</p>
<p>A single tcp connection to the server is already a full duplex, so why listen?</p>
| <p>The client of the TCP connection has to listen on the source port of the connection, to receive packets transmitted from the server to the client. There are two ports involved in a TCP connection, a source and a destination port. Usually only the destination port is specified, and the source port is just assigned by... |
Cruiscontrol Force Build After Build Fails <p>buildafterfailed="true" does'nt work in .net, How can I do the same thing? I'm trying to have cruisecontrol triggers force builds until the build is successful.</p>
| <p>You can use <a href="http://confluence.public.thoughtworks.org/display/CCNET/Project+Trigger" rel="nofollow">Project Trigger</a> with <code>triggerStatus</code> set to <code>Failure</code> and have a project monitor itself. buildafterfailed is specific to CruiseControl, from which CruiseControl.Net has diverged quit... |
how to keep a nativewindow on top <p>I need to keep a NativeWindow I am creating on top of the main window of the application.</p>
<p>Currently I am using alwaysInFront = true, which is not limited to the windows in the application. I can successfully synchronize the minimize/restore/move/resize actions, so the top wi... | <p>Listening for <code>Event.DEACTIVATE</code> and calling <code>event.preventDefault()</code> should work. Not sure if that is what you have tried, but I have an app where that does the trick.</p>
|
Isolate a specific thread to run in medium trust <p>I'm writing a .net win app that loads foreign assemblies and executes third party scripts. I am looking for a way to sanitize the code executed by the foreign script, and only allow the third party scripts access to a defined set of websites. Creating a PermissionSet ... | <p>You can't do this on a thread level.</p>
<p>The appropriate way to have different trusts in a single application is by creating a separate <a href="http://msdn.microsoft.com/en-us/library/system.appdomain.aspx" rel="nofollow">AppDomain</a> for the third party scripts to run under.</p>
<p>Chris Brumme wrote a <a hr... |
How to test a CSS parser? <p>I'm writing a parser to parse CSS.</p>
<p>I started by modifying the <a href="http://www.w3.org/TR/CSS2/grammar.html">CSS reference grammar</a>, to use whichever grammar and lexer syntax are supported by the <a href="http://www.devincook.com/goldparser/">3rd-party parser generator tool</a>... | <p>Microsoft made a set of many thousands of CSS tests for IE8 compliance with the CSS spec.
<a href="http://samples.msdn.microsoft.com/ietestcenter/css.htm" rel="nofollow">http://samples.msdn.microsoft.com/ietestcenter/css.htm</a></p>
<p>While they are focused on testing browser compliance, possibly you could adapt t... |
#define statements within a namespace <p>If I have a #define statement within a namespace as such:</p>
<pre><code>namespace MyNamespace
{
#define SOME_VALUE 0xDEADBABE
}
</code></pre>
<p>Am I correct in saying that the #define statement is not restricted to the namespace? </p>
<p>Is the following the "correct" thi... | <p>Correct,<code>#define</code>'s aren't bound by namespaces. <code>#define</code> is a <a href="http://en.wikipedia.org/wiki/C_preprocessor">preprocessor</a> directive - it results in manipulation of the source file prior to being compiled via the compiler. Namespaces are used during the compilation step and the com... |
How do you use the IS operator with a Type on the left side? <p>I have a method I'm writing that uses reflection to list a class's static properties, but I'm only interested in those that are of a particular type (in my case, the property must be of a type derived from DataTable). What I would like is something like th... | <p>You need to use <a href="http://msdn.microsoft.com/en-us/library/system.type.isassignablefrom.aspx" rel="nofollow">Type.IsAssignableFrom</a> instead of the "is" operator.</p>
<p>This would be:</p>
<pre><code>if( !( DataTable.IsAssignableFrom(propertyInfo.PropertyType) )
</code></pre>
<p><code>DataTable.IsAssignab... |
Colours to PieChart in JFreeChart <p>I want to generate random colours which can be attractive in pie charts.I have a very poor sense when it comes to GUI.Can anyone help in writing a piece of function which generates 6 good colors that may look good in a pie chart in a random order.Right now I have hardcoded.But I don... | <p>Rather than trying generate <em>random</em> colors, I would suggest using a set of colors from some <strong><a href="http://websitetips.com/color/tools/" rel="nofollow">color charts</a></strong>.</p>
<p>You have some table colors made for <a href="http://www.sapdesignguild.org/goodies/diagram_guidelines/color_palet... |
Could someone explain to a noob how this jquery works to create an image gallery? <p>I don't understand what's happening here. If someone could explain, I would appreciate it. I need to create a photo gallery and have been recommended to look at this code but I don't understand how it works.</p>
<pre><code>$(document)... | <p>Like this:</p>
<pre><code>// When the document is ready
$(document).ready(function(){
// Call this function with this string (a CSS selector)
imageSwapper(".thumbnails a");
});
function imageSwapper(link) {
// With all the elements matching link (all the <a>'s under <tag class="thumbnails">... |
Is folder uploading possible in PHP? <p>Is there any way to upload an entire folder using PHP?</p>
| <p>No. Its not a limitation of PHP, but a limitation of the browser itself. There is no way to select a folder for upload (and pass the data through).</p>
<p>You could however upload an archive, and then use php to unzip it.</p>
|
django manage.py test auth fails <p>When I run the test suite of django I get errors on the auth application. I have (obviously) not written any of auth code and I have not written tests for auth. yet the auth tests fail. Here are some of the errors I get, the whole stacktrace is too big to put here:
Does someone has ... | <p>I figured it out. Failed tests in auth tests happen if the auth app uses complicated templates to render the default auth template-views. The auth app tests itself with the templates which are used by your application. I have changed the defaults to templates which look the same as the rest of my website.</p>
<p>Th... |
Handling Different Resolutions in Visual Studio 2008 for .NET CF <p>I have a follow-up question to <a href="http://stackoverflow.com/questions/297955/handling-different-resolutions-in-visual-studio-2008-for-net-cf">this one</a>.</p>
<p>I created a new form, inherited from an existing form, and in the designer I only s... | <p>After a few failed attempts and several discussions with Forms experts, I have determined the Forms inheritance is not a good approach, not for this problem and most others. I think that MusiGenesis's answer to the original question was not good advice.
The primary reason is that there is a long string of issues wit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.