input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Dynamically invoking any function by passing function name as string <p>How do I automate the process of getting an instance created and its function executed dynamically?</p>
<p>Thanks</p>
<p>Edit: Need an option to pass parameters too. Thanks</p>
| <p>Do you just want to call a parameterless constructor to create the instance? Is the type specified as a string as well, or can you make it a generic method? For example:</p>
<pre><code>// All error checking omitted. In particular, check the results
// of Type.GetType, and make sure you call it with a fully qualifie... |
Looking for a PHP and/or Python RAD <p>I am looking for RAD like environment for PHP and/or Python free or not does not matter.</p>
<p>It should have a visual environment where one can use a point and click interface so that it is possible to select objects with mouse and move them around.</p>
<p>I have looked at Del... | <p>Python and PHP both have a binding for <a href="http://www.gtk.org/" rel="nofollow">GTK</a> :</p>
<ul>
<li><a href="http://www.pygtk.org/" rel="nofollow">PyGTK</a> for Python;</li>
<li><a href="http://gtk.php.net/" rel="nofollow">PHP GTK</a> for PHP;</li>
</ul>
<p>You can use <a href="http://glade.gnome.org/" rel=... |
Compression and Decompression in java doesnot work fine for different programming language <p>If i compress and decompress data using java then it works fine
My if friend uses C#.NET to compress data while i am using java SO inthis case I can not decompress the same data.</p>
<p>I am using inflatter and deflater in ja... | <p>Use GZIPInputStream and GZIPOutputStream which are compatible with gzip format.</p>
<p>Note: each compression format is different (though similar in approach) and they have to be the same to work.</p>
<p>Inflator and Deflator are a cut down version of the GZIP format and I wouldn't expect it to work with anything ... |
Multiline texbox validation <p>I want to validate maxlegnth of 5 characters in each row of the multiline textbox </p>
<p>Help me </p>
| <p>Here's an example: A <strong>TextArea</strong> and span to show the validation results.</p>
<pre><code><textarea cols="30" rows="10" onblur="validateRows(this)"></textarea><br/>
<span id="validationResults" style="color:red"></span>
</code></pre>
<p>Here's the JavaScript code to valid... |
Android - how do I place an image on top of my existing layout through code? <p>I have a <code>layout</code> in which I am displaying a <code>webview</code>. I want to add images on top of the <code>webview</code> at specific places through code.</p>
<p>Can some one please tell me how to do that?</p>
<p>The transluce... | <p>AbsoluteLayout is deprecated and if that bothers you, you may want to look for alternative.
I have put an example in my blog post here. It might not be exactly what you are after, but should give you an idea:</p>
<p><a href="http://anothermobiledeveloper.blogspot.com/2011/10/using-relativelayout-instead-of.html" re... |
What are valid characters in a Windows service (key) name? <p>Does anyone happen to know what the convention for Windows service key names is, which characters are legal?</p>
| <p>Based on the <a href="http://msdn.microsoft.com/en-us/library/ms682450%28VS.85%29.aspx">documentation</a> for the underlying C++ structure used to create a service:</p>
<blockquote>
<p>The maximum string length is 256 characters. The service control manager database preserves the case of the characters, but servi... |
mapping data in properties files <p>I have the following data:</p>
<pre><code>User System SubSystem
user1 System1 SubSystem1
user2 System1 SubSystem2
user3 N/A N/A
</code></pre>
<p>and i need to be able to determine the system/subsystem tuple from the user. I must be able to add users at any time wi... | <p>You could do this using a HashMap (as you do now) and store it using <a href="http://xstream.codehaus.org/" rel="nofollow">XStream</a>.</p>
<p>XStream allows you to serialise/deserialise Java objects to/from readable/editable XML. You can then write this to (say) a filesystem, and the result is editable by hand. </... |
Max number of rows per MySQL (Billions) NDBCLUSTER? <p>I have a database that needs to be able to scale up to billions of entries or rows. </p>
<ul>
<li>Can this many rows be supported per single table? Is it advisable? </li>
<li>Would a single table be split over several clusters if used in a NDBCLUSTER. </li>
<li>Ot... | <p>We have tables with 22 million rows, and there's no bottleneck in sight. At least none that enough RAM can't fix. Generally there is no easy yes or no. It depends on the nature of your data, table engine, etc..</p>
<p>If you disclosed more info what kind of data it is that you're saving, then a response could be mo... |
Team City and MSBuild: copy files to another computer why dosen't it work? <p>I'm using TeamCity 4 to do CI with MSBuild. My problem is that when I try to copy file to the QA server, the msbuild fails, but if I change the script to copy locally it work. I've tried mapping the remote share as a local drive and still it ... | <p>Is the build running on the system account? If so, network shares might be not available or not authenticated. You can either run the build agent on a local user account (not recommended) or make somehow sure that the shares are available to the system account. What is the output of the robocopy call?</p>
<p>You ca... |
NHibernate many-to-one relationship deleting parent only <p>I have a many-to-one relationship between objects <code>Product</code> and <code>Supplier</code>. I need to be able to delete <code>Supplier</code> without deleting the <code>Product</code>s that belong to it.</p>
<p>Here is a simplified version of classes:</... | <p>The mapping properties only take effect when the entity is actually loaded, and when you are not querying through HQL. As an example, if you specify <code>Cascade=ALL</code>, if you delete a supplier with the query <code>"delete from Supplier where id=:id"</code>, you will probably get the same FK constraint failure... |
C How to "draw" a Binary Tree to the console <p>What algorithms can be used to draw a binary tree in the console? The tree is implemented in C. For example, a BST with numbers: 2 3 4 5 8 would be shown in the console as:</p>
<p><img src="http://i.stack.imgur.com/8a1M8.jpg" alt="alt text"></p>
| <p>Code:</p>
<pre><code>int _print_t(tnode *tree, int is_left, int offset, int depth, char s[20][255])
{
char b[20];
int width = 5;
if (!tree) return 0;
sprintf(b, "(%03d)", tree->val);
int left = _print_t(tree->left, 1, offset, depth + 1, s);
int right = _print_t(tree... |
Not getting Mouse Out Event <p>I've this code in flex where I register a mouse out event listener - </p>
<pre><code>...
var b:Button = new Button();
b.addEventListener(MouseEvent.MOUSE_OUT, buttonOutHandler);
...
private function buttonOutHandler(evt:MouseEvent):void {
...
}
</code></pre>
<p>Problem that I am f... | <p>You could try the rollOut event insted of the MouseOut. Very similar, but yet different.
If whatever you've added the listener to has its own children then you should definatly use the rollOut event.</p>
|
.NET RegExp engine search performance optimization <p>I have List collection with around 35,000 strings</p>
<p>Typical string looks like this:</p>
<pre><code>"<i>füüs</i>ampri tähis;lüh ld-st<i>anno</i>, aastal;<i>maj</i> lüh pr-st<i>argent</i>, raha (kursisedelite... | <p>Itâs how regular expressions are processed that makes them perform so different. To explain that based on your examples:</p>
<ul>
<li><p><strong><code>/.*ab/</code></strong>Â Â Â This expression consists on two sub-expressions, the <code>.*</code> and the literal <code>ab</code>. This would be processed as follow... |
Started using git recently ... just noticed clones of my files with ' ~ ' appended in the end... why is this happening <p>I used git to commit changes in my repository,</p>
<p>followed these steps</p>
<pre><code>git add .
git commit -m "message"
</code></pre>
<p>but noticed a clone of the file where changes were mad... | <p>To complete <a href="http://stackoverflow.com/questions/801840/started-using-git-recently-just-noticed-clones-of-my-files-with-appende/801860#801860">bendin's answer</a>, add in your working directory a <code>.gitignore</code> file with for instance:</p>
<pre><code>*~
*.bak
*.old
</code></pre>
<p>That .gitignore f... |
Removing .htaccess Authentication Restrictions <p>I have a project that has .htaccess Authentication but i want to remove it for a certain assets folder.</p>
<p>i tried adding a htaccess in that folder with :</p>
<pre><code>AuthType none
Satisfy Any
Allow from All
Order Allow, Deny
</code></pre>
<p>but it doesnt se... | <p>Without seeing your full .htaccess I'm guessing, but what about something like this:</p>
<pre><code>RewriteEngine On
RewriteRule ^assets/ - [E=allow-assets:1]
Allow from env=allow-assets
</code></pre>
<p>That could go in the .htaccess of the parent directory, not assets.</p>
|
iPhone BitmapImageRep <p>I have a buffer which has JPEG image data. I need to display this image in UIImageView. I need to convert this image buffer into an object of UIImage and use it as follows </p>
<p>NSData *data = [NSData dataWithContentsOfFile:appFile];
UIImage *theImage = [[UIImage alloc] initWithData:data];</... | <p>If the UIImageView frame dimensions are different than the source image dimensions, you'll get a resized version of the image. The quality can be pretty rough depending on how much of a conversion is being performed.</p>
<p>I found this code on the net somewhere (sorry original author - I've lost the attribution) ... |
Deriving Class from Generic T <p>I have a parameterized hibernate dao that performs basic crud operations, and when parameterized is used as a delegate to fulfil basic crud operations for a given dao.</p>
<pre><code>public class HibernateDao <T, ID extends Serializable> implements GenericDao<T, ID>
</code>... | <p>You could have the Class passed as a constructor argument.</p>
<pre><code>public class HibernateDao <T, ID extends Serializable> implements GenericDao<T, ID> {
private final Class<? extends T> type;
public HibernateDao(Class<? extends T> type) {
this.type = type;
}
... |
Codeplex + SVN. How good is SVN bridge? <p>I avoided CodePlex because of it's lack of support for proper SVN and was dissuaded by complaints about short comings. Recently, I have been wanting to port my project from beanstalk over to codeplex because the latter is more social.</p>
<p>What problems have you encountered... | <p>The client side SvnBridge has been problematic for me when CodePlex had client side program. However, they have moved SvnBridge to their server farms, and it's working really well. I have 3 projects on CodePlex, with 2 of them using their source control. Two of those projects were migrated from SourceForge. SourceFo... |
What is opinionated software? <p>I often see people saying that certain software is "very opinionated" or that Microsoft tends to write "un-opinionated" frameworks. What does this actually mean?</p>
| <p>If a framework is opinionated, it lock or guides you into their way of doing things.</p>
<p>For example: some people believe that a template system shouldn't provide access to user defined methods and functions as it leaves the system open to returning raw HTML. So an opinionated framework developer only allows acc... |
How do I check if any file in an item list exist using msbuild? <p>I would like to run a task if any file in an item list is missing. How do I do that?</p>
<p>My current script has a list of "source" files @(MyComFiles) that I translate another list of "destination" files @(MyInteropLibs), using the following task:</p... | <p>If you only need to create the missing files, and not get a list of the files that were missing you can you the <a href="http://msdn.microsoft.com/en-us/library/37fwbyt5.aspx" rel="nofollow">touch task</a>, which will create if the files don't exist.</p>
<pre><code><Touch Files="@(MyInteropLibs)" AlwaysCreate="T... |
How to break on Insert in Visual Studio / SQL Server 2005 <p>II'd like to use Visual Studio to break whenever a record is inserted into a certain table, so I can see the values being inserted and the call stack from that moment. Is that possible, or am I stuck with stored procedure debugging only?</p>
| <p>Well, since you're using SqlServer, why not just use Profiler? Set a trace, and you can watch the values insert there.... You can set up the breakpoint in Visual Studio, or you can just set it as a transaction that rolls back, then go through the trace to find the values that would have gone in.</p>
<p>If you haven... |
Objective-C on iPhone release problem <p>I have a problem that I am getting EX_BAD_ACCESS when calling release on an NSStream object in my dealloc on the iPhone.</p>
<p>The following code </p>
<pre><code>- (void)dealloc {
DLog(@"dealloc started for: %@",self);
@synchronized(self) {
lookupCount--;
if (lo... | <p>In a comment you said this about <code>outstream</code></p>
<blockquote>
<p>It's created by a call to
getStreamsToHostNamed:port:inputStream:outputStream:
which shouldn't return autoreleased
objects I don't think.</p>
</blockquote>
<p>It is in fact, auto-released. Unless you are retaining that object some... |
How to use WMI to add an IP route? <p>I need to add a route into the IP4 routing table on windows xp.</p>
<p>However, the Win32_IP4RouteTable class seems to only be able to query existing routes.</p>
<p>Basically I need the same functionality as:</p>
<pre><code>route ADD 192.168.127.254 MASK 255.255.255.255 192.168.... | <p>Do you need solution on WMI only? I usually use <a href="http://msdn.microsoft.com/en-us/library/aa366073%28VS.85%29.aspx" rel="nofollow">IPHelper</a>. Specifically, you need <a href="http://msdn.microsoft.com/en-us/library/aa365860%28VS.85%29.aspx" rel="nofollow">CreateIpForwardEntry function</a>.</p>
|
Localization in ASP.NET MVC <p>Visual Studio 2008</p>
<p>I want to bring some localisation into my ASP.NET MVC site.</p>
<p>Someone suggested creating a resource file "Strings.resx" as a publically strongly typed resource, which works nicely and allows me to write</p>
<pre><code><title><%= Strings.MyView_Ti... | <p>In your views, do you have a page directive?
If so, do you have UICulture="Auto" and Culture="Auto"?</p>
<p>For example...</p>
<pre><code><%@ Page Language="C#" Inherits="..."
culture="auto" uiculture="auto" %>
</code></pre>
<p>This will ensure that the Accept-Language header, passed by the browser in ... |
How can I print out the Memory Adress of an variable? <p>I'd like to print what's behind an &myVariable. I tried NSLog(&myIntVar); but it won't work.</p>
| <p>The argument to NSLog needs to be an NSString, so you want</p>
<pre><code>NSLog(@"%p", &myIntVar);
</code></pre>
|
Is it commonplace/appropriate for third party components to make undocumented use of the filesystem? <p>I have been utilizing two third party components for PDF document generation (in .NET, but i think this is a platform independent topic). I will leave the company's names out of it for now, but I will say, they are ... | <p>First, I'd ask whether these PDF generation tools are designed to be run within ASP.NET apps. Do they make claims that this is something they support? If so, then they should provide documentation on how they use the file system and what permissions they need.</p>
<p>If not, then you're probably using an inappropri... |
How to write a custom pretty printer <p>A problem that has frequently come up in my career is I have some kind of data structure (perhaps an s-expression) and I want to print it in a human readable form complete with reasonable indentation choices.</p>
<p>Is there a book or blog entry that describes how to do this ele... | <p>S-Exps are equivalent to tree structures, if you can pretty-print a tree you can pretty-print an s-exp.</p>
<p>For instance, compare:</p>
<pre><code>(tree
(value 89)
(tree
(value 9)
nil
nil)
(tree
(value 456)
nil
nil))
</code></pre>
<p>to:</p>
<pre><cod... |
Is anyone using SpringSource tc server as a Tomcat replacement? <p>It looks like SpringSource <a href="http://www.springsource.org/node/1385">has just released a GA version</a> of their <a href="http://www.springsource.com/products/tcserver">tc Server</a> application server.</p>
<p>It sounds from their description lik... | <p>As I see it, the primary advantage of tcServer is in managing large clusters of load-balanced tomcats. Aside from the management/monitoring layer (which is very cool, by the way), it also has a faster database connection pooling mechanism, and a generally tweaked configuration optimised for high volume. Other than ... |
Why does Eclipse CDT say: 'syntax error', but compilation no problem <p>I am working in existing C code which has a couple of lines with statements similar to this one:</p>
<pre><code>struct collect_conn *tc = (struct collect_conn *)
((char *)c - offsetof(struct collect_conn, runicast_conn));
</code></pre>
<p>T... | <p>Eclipse CDT contains its own preprocessor/parser for analyzing your code and building an index. However, when you invoke a build CDT calls out to your system compiler, like gcc for example. There may be minor differences between the syntax accepted by the CDT parser and the syntax accepted by your compiler. When thi... |
MySQL: keep column together in results? <p>OK when I make a request I want all the items with the same group_id to be "together" for example 117,117,134,111 is fine but 117,134,117,111 is not fine because the group_id 117 are not all "together". I hope that makes sense. The only way I know how to do achieve this is by ... | <p>Yes, you just order by both, so your <code>ORDER BY</code> should look like this:</p>
<pre><code>ORDER BY group_id, price
</code></pre>
<p>That will first order by group_id, then by price. So all the same group_ids will be together, but whenever there are multiple with the same group_id, they will be ordered by pr... |
TSQL equivalent of an MS Access Crosstab query <p>What's the equivalent of an MS-Access crosstab query in TSQL? And Is there a better way?</p>
<p>I have a data organised like this:</p>
<pre><code>Fish
ID Name
---- ---------
1 Jack
2 Trout
3 Bass
4 Cat
FishProperty
ID FishID Property Value
---- ------... | <p>Are you looking for <a href="http://www.databasejournal.com/features/mssql/article.php/3516331/SQL-Pivot-and-Cross-Tab.htm">PIVOT</a>?</p>
<p><strong>Edit</strong>: You may have to get to the second page before you see the usage of the PIVOT syntax.</p>
<p><strong>Edit 2</strong>: Another <a href="http://www.mssql... |
C#: Crash on ManualResetEvent <p>I wrote my code using <a href="http://msdn.microsoft.com/en-us/library/fx6588te.aspx" rel="nofollow">this article at msdn</a> as a primary helper</p>
<p>My code:</p>
<pre><code> private ManualResetEvent _AllDone = new ManualResetEvent(false);
internal void Initialize(int port,... | <p>So if I get it right, you want to re-start <code>Accept</code> as soon as a socket connection is received, and not wait until <code>Accept</code> is done, and that's why you don't use the sync version of <code>Accept</code>. </p>
<p>So you are saying that it does not fire your Accept method when you connect a socke... |
Dynamic database record icons in the list module? <p>In typo3, is there is a way to render a thumbnail of an image
contained inside an extension table as the icon for the record in the
<strong>list</strong> module?The TCA documentation doesn't seem to say you can!</p>
| <p>It is possible to import several different skins for the Typo3 backend, skins that changes the icons in used in the "List Module". For example t3skin and <a href="http://typo3.org/documentation/document-library/extension-manuals/t3skin%5Fimproved/current/" rel="nofollow">t3skin_improved</a>.</p>
<p>I can't say what... |
SubSonic 2.1 SqlQuery multiple Where()s? <p>I'm building a SqlQuery to support an ad-hoc query screen.</p>
<p>I want something like this:</p>
<pre><code>SqlQuery q = new Select().From<VwInstitutes>();
if (!string.IsNullOrEmpty(username))
{
q.Where(VwInstitutes.Columns.AssignedUser).IsEqualTo(username);
}
... | <p>Start your query with a where that always evaluates to true.</p>
<pre><code>new Select().From().Where("1").IsEqualTo("1");
</code></pre>
<p>then build the rest of the query with q.And. See <a href="http://forums.subsonicproject.com/forums/t/4020.aspx" rel="nofollow">this thread</a> as well.</p>
|
.NET 3.5 missing from the ASP.NET drop down in IIS after new install <p>I have just installed the .NET 3.5 Framework to my Windows 2003 server and when I try to create a new website I can't select 3.5 from the web site properties ASP.NET tab in IIS.</p>
<p>This works fine with 1.0, 1.1, and 2.0.</p>
<p>I know the fra... | <p>That's because ASP.NET 3.5 still uses the CLR from 2.0. The CLR hasn't changed in 3.5, it's more an extension to 2.0. (I hope I say this correct)</p>
<p>So while you cannot choose 3.5, you <strong>can</strong> run webapplications written in 3.5. </p>
|
Why can't I set ReadOnly on a Fluent NHibernate References() mapping? <p>In Fluent NHibernate, References() returns an object which doesn't support the 'ReadOnly()' method.</p>
<p>I'm trying to create this sort of mapping (i.e. one where an update is not propagated to the referred item):</p>
<pre><code><many-to-on... | <p>It's simply not implemented yet. Over time we will come to support all the features of NHibernate, but until then the <code>SetAttribute</code> method is there to allow you to continue.</p>
<p>As an aside, we accept patches!</p>
|
How to build a Visual C++ Project for Linux? <p>What's the best and easiest way to build (for Linux) a C++ application which was written in Visual Studio? The code itself is ready - I used only cross-platform libs.</p>
<p>Is it possible to prepare everything under Windows in Visual Studio and then build it with a CLI ... | <p>We're using CMake for Linux projects. CMake can generate KDevelop and Visual Studio project files, so you can just create your CMake file as the origin of platform-specific IDE files. The KDevelop generator is fine, so you can edit and compile in KDevelop (which will in turn call Make).</p>
<p>On the other hand, if... |
redefining a single ruby method on a single instance with a lambda <p>In Ruby, is there a way to redefine a method of a particular instance of a class using a proc? For example:</p>
<pre><code>class Foo
def bar()
return "hello"
end
end
x = Foo.new
y = Foo.new
</code></pre>
<p>(Something like):</p>
<pre><co... | <pre><code>def define_singleton_method_by_proc(obj, name, block)
metaclass = class << obj; self; end
metaclass.send(:define_method, name, block)
end
p = proc { "foobar!" }
define_singleton_method_by_proc(y, :bar, p)
</code></pre>
<p>or, if you want to monkey-patch Object to make it easy</p>
<pre><code>class... |
Unable to enable jquery UI module in drupal? <p>I have been trying to enable jquery UI module and have been unable to to do. I realised that the documentation is crappy but even following the community from
<a href="http://drupal.org/node/434424" rel="nofollow">http://drupal.org/node/434424</a>
doesnot seem to work. A... | <p>I had tried to enable the dependencies first..This was the error..Now got it working :)</p>
|
Changing language of tab bar elements <p>we're developing an iphone application to be distributed in Spain. It contains a Tab bar, but we're not quite sure how to change More and Edit into Spanish. I'm sure there's a simple solution... anybody know a way to do it?</p>
<p>Thanks,</p>
<p>Antonio</p>
<p>==== Edit 1 ===... | <p>If you are using the built in defined types it should automagically work. If they are your own text, you'll need to be using NSLocalizedString from the code, run genstrings from Terminal, and then provide a Spanish lproj inside your bundle.</p>
|
Finding in a predefined set of text options <p>Say, I want to see if a DOM element is a block. I can write it in three ways, depending on my mood:</p>
<pre><code>// first way
if (el.currentStyle.display == "block" || el.currentStyle.display == "inline-block" || el.currentStyle.display == "table-cell")
// secon... | <p>I like the third way; I don't think it looks like overkill at all. If you need an even shorter way then this works too:</p>
<pre><code>el.currentStyle.display.match(/(e-)?(block|cell)/)
</code></pre>
<p>But that's not very readable...</p>
<p>It might be worth abstracting it all away by extending the String protot... |
Can someone verify that this is an IE8 memory leak? <p>The leak is pretty easy to create. Place the HTML below alongside a list of large images named "TestImage0.jpg", "TestImage1.jpg",..."TestImage9.jpg". The page will leak memory (I used sIEve for testing) on every click of the page. If the resize css is removed, the... | <p>The question is "Can someone verify that this is an IE8 memory leak?" To which the answer can only be, yes some one could verify this.</p>
<p>If you really think it is a valid memory leak in IE, first make sure that it is just IE. Then carry on working out specifics. Once you can describe exactly how to recreate th... |
How to ensure that a winform closes in exactly X seconds <p>In my WinForms application, I need to pop up a little custom dialog that stays on the screen for X amount of seconds and then disappears. So I use a System.Threading.Timer to invoke the _dialog.Close() method once the appropriate amount of time has elapsed. ... | <p>If your UI thread is busy for many seconds at a time, then:</p>
<ul>
<li>You won't be able to close a window associated with that UI thread, without peppering your code with <code>Application.DoEvents</code> calls (a bad idea)</li>
<li>Your whole UI will be unresponsive during this time. The user won't be able to m... |
Question on table design <p>I'm offering a search option for my users. They can search on city name. The problem is that my city names I have stored are things like "Saint Louis". But I want to find Saint Louis even if the user types in "St. Louis" or "St Louis". Any suggestions on how I could create a lookup table... | <p>Create <em>two</em> tables.</p>
<p>One contains everything about a city. </p>
<p>One contains a bunch of names for cities, and a foreign key association those naes with the id of the the first table. So you have a one to many relationship between city and city_names.</p>
<p>Now the only problem is distinguishing ... |
Using special characters in XML documents <p>I would like to know how to use the character <code>"&#xA;"</code> (LINE FEED) to separate some information in an attribute. Look the example below:</p>
<pre><code><element attrinfo="info1=109&#xA;info2=108&#xA;info3=107" />
</code></pre>
<p>I use <code>S... | <p>You should save the actual line feed character to the attribute. The escaping is taken care of by the API.</p>
<p>In other words: If you save the string <code>"&#xA;"</code>, the API correctly escapes it as <code>"&amp;#xA;"</code>, so that you get back the string <code>"&#xA;"</code> when you read the ... |
Can you change the order in which IIS6 virtual directories appear? <p>I have a shared development server with many virtual directories running off one of the websites. Is it possible to reorder how these virtual directories are displayed in IIS?</p>
<p>I tried looking at the metadata, using the Metabase Explorer, but ... | <p>The IIS Manager shows the sites in the order they were entered... </p>
<p>The only way I have found is to click on the websites folder then reorder by description / host header in the main window to get them in alphabetical order. </p>
|
Customizing a TabControl for the Closing of Individual Tabs <h2>My scenario is the following:</h2>
<p>I am working on a winforms application in C# that has a button inside the main page of a tabcontrol that will generate another tabpage each time that it is clicked. Each new tabpage will contain a layout defined by a ... | <p>I found this code and was very helpful to me:</p>
<pre><code>private void tabControl_MouseUp(object sender, MouseEventArgs e)
{
// check if the right mouse button was pressed
if(e.Button == MouseButtons.Right)
{
// iterate through all the tab pages
for(int i = 0; i < tabControl1.TabCo... |
How to serialize on to existing file? <p>Let say I have a file that contains a serialized object by BinaryFomatter. Now I want to be able to serialize another object and APPEND this on that existing file.</p>
<p>How can I do it?</p>
| <p>This is indeed possible. The code below appends the object.</p>
<pre><code>using (var fileStream = new FileStream("C:\file.dat", FileMode.Append))
{
var bFormatter = new BinaryFormatter();
bFormatter.Serialize(fileStream, objectToSerialize);
}
</code></pre>
<p>The following code de-serializes the objects.... |
<li> without parent tags? <p>Is it ok to use <code><li></code> tags without parent tags?</p>
<p>i.e.</p>
<pre><code><li> some copy
</code></pre>
<p>or must it be.. </p>
<pre><code><ul> (substitute your favorite list type)
<li> some copy
</ul>
</code></pre>
<p>Links on the subject:... | <p>If by OK you mean "correct, follows standards and will validate" then <strong>no</strong>. <a href="http://www.w3.org/TR/html401/struct/lists.html#h-10.2">Per the spec</a>, only OL and UL can contain LI. (MENU and DIR are deprecated)</p>
<p>If by OK you mean "will render" then yes.</p>
<p>Also, to be "OK" by the f... |
Cron to Log the ip of a repository with a dynamic ip <p>I am using a mac mini with a dynamic ip to store an SVN repository. As an unexpected change of the ip makes it difficult to consistently use the repository, I am interested in creating a cron to log the ip on another server every time it changes. What would be th... | <p>For Subversion usage your approach does not make sense and will not work:
Each Workingcopy stores its repository URL inside .svn folder, so if your IP changes you have to relocate your workingcopy via </p>
<pre><code> `svn switch --relocate`
</code></pre>
<p>so it will not safe you any work. YOu really should use ... |
Google Maps - Thousands of markers - JSON <p>In the following example the markers are loaded from a JSON.</p>
<p>If there are 20,000 markers the JSON is going to be quite big. </p>
<p>Is there any way to send different JSON files according to zoom level instead of sending one huge array?</p>
<p><a href="http://gmaps... | <p>There's the notion of a "bounding rectangle" for a map view. The map api supplies this to you as two lat/long coordinate pairs - one for the SW corner, and one for the NE corner.</p>
<p>So if you have a custom data service that returns JSON points, you'll need to accept these coordinates as input, and adjust the r... |
When I have required model relationships, how do I guard against errors? <p>I have an application with a lot of database relationships that depend on each other to successfully operate the application. The hinge in the application is a model called the Schedule, but the schedule will pull Blocks, an Employee, a JobTitl... | <p>I would recommend adding <a href="http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html">database-enforced foreign key constraints</a> and <a href="http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html">wrapping important groups of operations into transactions</a>. </p>
... |
Selenium typeKeys strips out dot from the String being typed <p>The following instruction</p>
<pre><code>Selenium.typeKeys("location", "gmail.com");
</code></pre>
<p>types the string <code>gmailcom</code> instead of <code>gmail.com</code>.</p>
<p>What's happening there?</p>
<p>From the comments:<br />
I am trying t... | <p>Have you tried using the Native key functions and <a href="http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javascript-Char-Codes-Key-Codes.aspx" rel="nofollow">javascript char codes</a>?
I couldn't get a 'period' character to work using them (char 190), but I got the decimal (char 110) to work ... |
Beginner Qt signals and slots question <p>I've just started learning Qt, which is my first experience with GUIs. So far it's just been console apps, and a bit of SDL.</p>
<p>I'm getting very confused with this whole signals and slots thing. I've just finished <a href="http://doc.trolltech.com/4.3/tutorial-t11.html" re... | <p>This is a problem with message loop based frameworks where everything is done in a single main thread. Please see my answer to a similar question <a href="http://stackoverflow.com/questions/715920/qt-qgraphicsscene-not-updating-when-i-would-expect-it-to/716119#716119">here</a>.</p>
|
Using NMock with ByRef parameters <p>I have to work with an API that uses a lot of by-reference parameters. I'm just beginning to use NMock, and I'm having trouble seeing how to make NMock actually modify one of those by-ref parameters to a specific value. Am I missing something, or does it just not do that? Is there a... | <p><a href="http://blog.somecreativity.com/2008/11/17/nmock-expectations-for-functions-accepting-ref-and-out-arguments/" rel="nofollow">This blog entry</a> appears to cover things, admittedly from a C# perspective.</p>
<p>Basically you want to call <code>Will()</code> with a <code>SetNamedParameterAction</code>.</p>
|
How do I run test scripts from TestTrack Test Case Manager in Linux? <p>I use Seapine's TestTrack Test Case Manager (TCM) under Linux and thus far have been unable to figure out how to use its ability to kick off our Perl test scripts and save the resulting data into a test run. Could someone provide me with a config,... | <p>Sean,</p>
<p>Take a look at the Script Agent mechanism on our <a href="http://labs.seapine.com/TCMScriptAgent.php" rel="nofollow">Labs site</a>. That will allow you to kick-off the Perl scripts.</p>
<p>If you have any questions about that, or want some help shoot me an email (mharp@) and we can talk.</p>
|
Hiding Extra Items in a list using jQuery in a tricky situation (markup is not ideal) <p>I want to make a long list short by hiding some elements in long sub-lists without adding extra processing on the server side. The problem is that the markup that comes from the server is not controlled by me and is not designed in... | <p>Might be possible to do better, but this should work:</p>
<pre><code>var i = 0;
$("#long-list li.header:first").nextAll("li").each(function(){
i = $(this).hasClass("header") ? 0 : i+1;
$(this).toggle(i<=3);
});
</code></pre>
<p>(Updated to not hide items before the first header.)</p>
|
Entity Framework, WCF & updates <p>I have created an n-tier solution where I am retrieving related data from a WCF service, updating it within a Windows Forms application, and then returning the updated data via WCF to be persisted to the database. The Application, WCF Service and Database are all on different machines... | <p>I don't have a ready-made answer for your particular scenario - but just a question: have you checked out ADO.NET Data Services (f.k.a. "Astoria") ?</p>
<p>They're built on top of Entity Framework, WCF's RESTful interface, and they offer a client-side experience, plus they also seem to have a decent story for not j... |
PLSQL order by issue <h3>Rolled back to revision one, then edited somewhat. See revised <a href="http://stackoverflow.com/questions/805568/sql-order-by-issue-continued-please-help">question</a>.</h3>
<p>I have an interesting issue with the below SELECT. </p>
<p>Its about ORDER BY clause; I am trying to sort using a ... | <p>Try to select the ORDER BY clause as a separate column using the DECODE() function:</p>
<pre><code>SELECT DECODE(p_sortby, 'ID', gl.group_id, 'NAME', group_name) AS sort, ...
...
ORDER BY 1
</code></pre>
<p>Edit:</p>
<p>I'm not sure what you mean by "doesn't work". If you mean that member_count is not sorted as y... |
Unable to read the timestamp of Zsh history <p><strong>Problem:</strong> to understand the following timestamp</p>
<pre><code>1241036430
</code></pre>
<p>at ~/.history</p>
<pre><code>: 1241036336:0;vim ~/.zshrc
: 1241036379:0;vim ~/bin/HideTopBar
: 1241036421:0;ls
: 1241036430:0;cat ~/.history
</code></pre>
<p>when... | <p>Try <code>history -d</code>. Or just type <code>history -</code> and press control-D to get all the various options:</p>
<pre><code>% history -
-D -- print elapsed times
-E -- dd.mm.yyyy format time-stamps
-d -- print time-stamps
-f -- mm/dd/yyyy format time-stamps
-i -- yyyy-mm-dd format time-stamps
-m -- t... |
How long does SSL connection between a client and a server persist? <p><br></p>
<p>I've just started learning SSL and boy is it confusing</p>
<p><br></p>
<p>Q1 - How long does SSL connection between a client and server persist? Until client surfs to some other URL or�</p>
<p><br></p>
<p>Q2</p>
<p>A) Assume a c... | <p>Q1. The SSL connection is only good for a single TCP connection between the client and the server. Current browsers (anything with HTTP/1.1 support) can reuse a single connection for downloading multiple resources. Current browsers also make multiple TCP connections to a server in order to download multiple resour... |
Ant compile doesn't copy the resources <p>I created my own build.xml which has:</p>
<pre><code><target name="compile">
<mkdir dir="build"/>
<javac destdir="build">
<src path="src"/>
</javac>
</target>
<target name="build" depends="compile">
<mkdi... | <p>There is no such parameter. You can copy all sorts of files between your directories with:</p>
<pre><code><copy todir="build">
<fileset dir="src"
includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico" />
</copy>
</code></pre>
|
Can I append an Ajax requestXML object to my document tree all in one go? <p>Greetings.
Here is an XML object returned by my server in the responseXML object:</p>
<pre><code><tableRoot>
<table>
<caption>howdy!</caption>
<tr>
<td>hello</td>
<... | <p>You get the text instead of a table, because you use pure DOM for manipulations and your response XML doesn't have the namespaces declarations. So when appending an XML element browser doesn't know whether your "table" tag is from HTML, XUL, SVG or else from.</p>
<p>1) Add namespace declaration:</p>
<pre><code><... |
Telerik RadDock - ajax update returns a JSON error <p>Trying to update RadDock (open/close it) by putting it in UpdatePanel however no luck....I'm getting the following response. </p>
<pre><code>189|error|500|Invalid JSON primitive: {"Top":179,"Left":583,"DockZoneID":"","Collapsed":false,"Pinned"
</code></pre>
<p>:fa... | <p><strong>UPDATE:</strong> You are not doing anything wrong in your code. I was able to duplicate this problem using both UpdatePanel and RadAjaxManager. According to Telerik support, this is a "limitation" in the RadDock control. More like a bug in my opinion.</p>
<p>Here's what it says in their Support Page Forum: ... |
Best practices and/or advice for diamond relationing tables (Linq to SQL) <p>I have to import the content of 4 tables from an old database into SQL 2005 for easier reporting.</p>
<p><strong>Products</strong> contains the id and product name, <strong>ProductProperties</strong> contains a variable number of properties f... | <p>Your red arrows imply that a product could not have any rows in <em>IngredientProperties</em> unless the product had at least one matching row in <em>ProductProperties</em>. Does it make sense that a product's ingredients can't have a density until the product has a density? This restriction does not exist with on... |
How do I debug a Pocket PC app running over a wireless network? <p>How do I debug an app running on a remote device, Pocket PC 4.2 (2003), over a wireless network (802.11)? I can remote debug with ActiveSync when the device is cradled (57K baud). I'm using Visual Studio 2008.</p>
<p>I am familiar with wireless debuggi... | <p>To debug Pocket PC 2003 over the network from Visual Studio 2008: </p>
<ul>
<li>go to Tools/Options to bring up the Options Dialog. </li>
<li>In the tree select Device Tools/Devices select Pocket PC 2003 in both the Drop Down at the top and the list box in the middle, </li>
<li>press the Properties button</li>
<li... |
Simple code for enumerating attributes and their values for each element [XML] <p>I am a total beginner in JS/XML.</p>
<p>I have this simple code that needs to be extended to list on the screen attributes and their values for each element of a XML file.</p>
<pre><code> function printElement(indent, node)
... | <p>Try this:</p>
<pre><code>for (var i = 0; i < element.attributes.length; i++)
{
var att = element.attributes[i];
document.write(att.nodeName) + "=" + att.nodeValue + "<br/>");
}
</code></pre>
|
Is it possible to communicate with an external system over TCP/IP using WCF? <p>We are building a system that interacts with an external system over TCP/IP using the <a href="http://en.wikipedia.org/wiki/FIX%5Fprotocol" rel="nofollow">FIX Protocol</a>. I've used WCF to communicate from client to server, where I had co... | <p>Possible? Possibly yes, but it's going to take some work. </p>
<p>For starters, you will need to write a custom WCF Transport Channel that handles the specifics of your TCP/IP based protocols (i.e. you'll need to write all the socket handling code and hook that into the WCF channel model). This is because the TCP c... |
How to resolve Undefined Symbols error? <p>I'm getting this error</p>
<pre><code>Undefined symbols:
".objc_class_name_MyClass", referenced from:
literal-pointer@__OBJC@__cls_refs@MyClass in infoViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
</code></pre>
<p>When referencing the static ... | <p>That means that the header files are found during compilation, but the linker is not aware of the static library. Make sure your static library is listed under "Targets -> YourMainTarget > Link Binary with Libraries" in the project view.</p>
<p>See <a href="http://developer.apple.com/tools/XCode/XCodeprojects.html"... |
Why do two consecutive calls to the same method yield different times for execution? <p>Here is a sample code:</p>
<pre><code>public class TestIO{
public static void main(String[] str){
TestIO t = new TestIO();
t.fOne();
t.fTwo();
t.fOne();
t.fTwo();
}
public void fOne(){
long t1, t2;
t1 ... | <p>There are several reasons. The JIT (Just In Time) compiler may not have run. The JVM can do optimizations that differ between invocations. You're measuring elapsed time, so maybe something other than Java is running on your machine. The processor and RAM caches are probably "warm" on subsequent invocations.</p>
<p>... |
How to assign a keyboard shortcut to a run configuration in IntelliJ? <p>It seems you can assign a keyboard shortcut to almost everything else, but I can't see an option to do this for run/debug configurations?</p>
<p>The "run configurations" are listed in the drop-down on the IntelliJ toolbar. I'd like to setup a run... | <p>Finally! JetBrains has <a href="http://blogs.jetbrains.com/idea/2009/10/invoking-rundebug-actions-in-intellij-idea-9/" rel="nofollow">implemented this feature</a> in IntelliJ IDEA v9.</p>
|
Example code for embedding SVG canvas in SWT project? <p>Is there a good example of how to include an SVG canvas into a Java SWT project (particularly <a href="http://www.holongate.org/contents.html">Holongate</a>, though I would be interested in any other options)? Additionally, I would need to support this SVG canvas... | <p>Use batik (<a href="http://xmlgraphics.apache.org/batik/">http://xmlgraphics.apache.org/batik/</a>).
Render SVG into the image.
Display it in SWT container.
Portable.</p>
|
How to find FQDN of local machine in C#/.NET ? <p>How can you get the FQDN of a local machine in C#?</p>
| <p><em>NOTE: This solution only works when targeting the .NET 2.0 (and newer) frameworks.</em></p>
<pre><code>using System;
using System.Net;
using System.Net.NetworkInformation;
//...
public static string GetFQDN()
{
string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
string hostName =... |
Testing for concurrency and/or transactional integrity in a web application with JMeter <p>I'm rather new to working with multiple threads in a database (most of my career has been spent on the frontend). </p>
<p>Today I tried testing out a simple php app I wrote to store values in a mysql db using ISAM tables emulat... | <p>Why not use InnoDB and get the same effect without manual table locks?</p>
<p>Also, what are you protecting against? Consider two users (Bill and Steve):</p>
<ol>
<li>Bill loads record 1234</li>
<li>Steve loads record 1234</li>
<li>Steve changes record 1234 and submits</li>
<li>Bill waits a bit, then updates the s... |
Is feasible to develop in Ruby on Rails with limited resources? <p>I don't know Ruby on Rails and I want to learn it doing something. A very small project was proposed to me, and I was wondering if I could implement it in Ruby on Rails, since I have limited resources.</p>
<p>The office where I should programm doesn't ... | <p>You should be okay. </p>
<p>Worst case is that you run out of memory, and to fix that you could possibly load Linux on that machine.</p>
<p>If you are working on something that involves a lot of web work and database work, You made a good choice with rails.</p>
|
Why does Perl's Inline::C sort 4.0e-5 after 4.4e-5? <p>I built a Perl <a href="http://search.cpan.org/dist/Inline-C" rel="nofollow">Inline::C</a> module, but there is some oddity with the sorting. Does anyone know why it would sort like this? Why is the 4.0e-5 is not first?</p>
<pre><code>my $ref = [ 5.0e-5,4.2e-5,4... | <p>Because you are sorting lexically, Try this code:</p>
<pre><code>#!/usr/bin/perl
use strict;
use warnings;
my $ref = [ 5.0e-5,4.2e-5,4.3e-5,4.4e-5,4.4e-5,4.2e-5,4.2e-5,4.0e-5];
print "Perl with cmp\n";
for my $val (sort @$ref) {
printf "%f \n", $val;
}
print "Perl with <=>\n";
for my $val (sort { $a ... |
Get PHP class property by string <p>How do I get a property in a PHP based on a string? I'll call it <code>magic</code>. So what is <code>magic</code>?</p>
<pre><code>$obj->Name = 'something';
$get = $obj->Name;
</code></pre>
<p>would be like...</p>
<pre><code>magic($obj, 'Name', 'something');
$get = magic($ob... | <p>Like this</p>
<pre><code><?php
$prop = 'Name';
echo $obj->$prop;
</code></pre>
<p>Or, if you have control over the class, implement the <a href="http://us3.php.net/manual/en/class.arrayaccess.php">ArrayAccess</a> interface and just do this</p>
<pre><code>echo $obj['Name'];
</code></pre>
|
Resize image and add an overlay image without using tables and without losing style in xml <p>I am building a system to create a "fake video embed" with thumbnails and play buttons over them. The images are coming from a service at a standard size, so have no choice but to resize them in HTML. Another restriction is, t... | <p>Could you send a link to an example?</p>
<p>From what I understand you are dynamically altering the background tag, but you can not resize a background image without using CSS 3, so compatibility is compromised.</p>
<p>CSS Background property can contain a color, url, positions x, y and repetition.</p>
<p>ie.</p>... |
Is there a Subversion Checkout Hook or something similar? <p>I'm using a subversion repository and I want to know whenever somebody asks my repository for a checkout; like a 'svn co' or an 'svn up'. Is there a hook or some other method that I can use so that a script is run, or email sent, whenever somebody requests in... | <p>The following are all the supported hooks in Subversion 1.5, from the <a href="http://svnbook.red-bean.com/en/1.5/index.html">Version Control with Subversion</a> book:</p>
<ul>
<li>start-commit</li>
<li>pre-commit</li>
<li>post-commit</li>
<li>pre-revprop-change</li>
<li>post-revprop-change</li>
<li>pre-lock</li>
<... |
Eclipse indentation on Emacs <p>I'm an emacs user who just started working for a new company where eclipse is the standard. I've tried eclipse, but I want to also experiment with JDEE (I'm coming back to Java after a long hiatus). The major stumbling block so far is getting the indentation to match. Is there an easy... | <p>The main difference I found between Eclipse (and IntelliJ) and Emacs default java formatting is that Emacs lines up function arguments continued onto a new line with the previous arguments e.g. emacs does:</p>
<pre><code>BigLongJavaStuff.doFoobarToQuux("argument 1",
"argument 2");
</... |
Inter-Thread Communication (and libraries?) <p>If have I have a game engine that has multiple threads that all work with one scene graph, what are techniques to ensure everything is synchronized whenever that scene graph changes?</p>
<p>What kind of libraries are out there to help with that?</p>
<p>Thanks!</p>
| <p>See this <a href="http://stackoverflow.com/questions/800383/what-is-the-difference-between-mutex-and-critical-section">question</a> for a list of availiable synchronization primitives. What you need to use depends on what your threads do. How many threads read the graph? How many modify the graph? Do they operate on... |
Python "Task Server" <p>My question is: which python framework should I use to build my server?</p>
<p>Notes:</p>
<ul>
<li>This server talks HTTP with it's clients: GET and POST (via pyAMF)</li>
<li>Clients "submit" "tasks" for processing and, then, sometime later, retrieve the associated "task_result" </li>
<li>sub... | <p>I'd recommend using an existing message queue. There are many to choose from (see below), and they vary in complexity and robustness. </p>
<p>Also, avoid threads: let your processing tasks run in a different process (why do they have to run in the webserver?)</p>
<p>By using an existing message queue, you only nee... |
How can I get the results of a Perl script in Python script? <p>I have one script in Perl and the other in Python. I need to get the results of Perl in Python and then give the final report. The results from Perl can be scalar variable, hash variable, or an array.</p>
<p>Please let me know as soon as possible regardin... | <p>Use the <a href="http://docs.python.org/library/subprocess.html" rel="nofollow">subprocess</a> module to run your Perl script to capture its output:</p>
<p>You can format the output however you choose in either script, and use Python to print the final report. For example: your Perl script can output XML which can... |
Loading up a web.xml for integration tests with jetty <p>OK this is kind of related to : <a href="http://stackoverflow.com/questions/728805/using-jetty-to-install-and-run-servlet-tests-programmatically">http://stackoverflow.com/questions/728805/using-jetty-to-install-and-run-servlet-tests-programmatically</a></p>
<p>g... | <p>It sounds like what you want to do is load a proper web application programatically, as opposed to loading individual servlets (and I think you want to do it without having a full WAR file to work from).</p>
<pre><code>Server server = new Server( port );
WebAppContext root = new WebAppContext();
root.setWar("/path... |
Deep zoom on dynamically generated 3D image cube <p>I am making a 3D cube using kit3D.this cube is generated at run time.I wanted to know whether i will be able to add deep zoom o this dynamically generated 3D cube.The entire cube is ultimately an image and this is loaded altogather at a time.or is there any other way ... | <p>In Silverlight 2 this can't be done as we've not made allowances for a lot of perspective 3D transforms as we have in Silverlight 3.</p>
<p>In Silverlight 3 you should be able to perform this, but do remember that Deep Zoom is somewhat an adjustment to the end users UX, so zooming in and out on image sets whilst in... |
How do I use JavaScript for number formatting? <p>I want to use JavaScript to restrict input on a text box to currency number formatting. For example:</p>
<pre><code><input type="text" value="2,500.00" name="rate" />
</code></pre>
<p>As given above, the text box should accept only numbers, commas and a period. ... | <p><a href="https://developer.mozilla.org/En/Core%5FJavaScript%5F1.5%5FReference/Global%5FFunctions/ParseFloat" rel="nofollow">parseFloat</a> can convert a string to a float and <a href="https://developer.mozilla.org/en/Core%5FJavaScript%5F1.5%5FReference/Global%5FObjects/Number/toFixed" rel="nofollow">toFixed</a> can ... |
Unable to get a system variable work for manuals <p>I have the following system variable in .zshrc</p>
<pre><code>manuals='/usr/share/man/man<1-9>'
</code></pre>
<p>I run unsuccessfully</p>
<pre><code>zgrep -c compinit $manuals/zsh*
</code></pre>
<p>I get</p>
<pre><code>zsh: no matches found: /usr/share/man/... | <p>Try:</p>
<pre><code>$> manuals=/usr/share/man/man<0-9>
$> zgrep -c compinit ${~manuals}/zsh*
</code></pre>
<p>The '~' tells zsh to perform expansion of the <code><0-9></code> when using the variable. The zsh reference card tells you how to do this and more.</p>
|
How do I update the UI in the middle of this thread? <p>Below is a block of code that runs in a separate thread from my app's main thread. How do I get the UI to update after each button gets its thumbnail? Right now it doesn't update until the whole method finishes. The buttons are already added to a UIScrollView.</p>... | <p>In place of <code>setImage:forState:</code>, take a look at the <code>performSelectorOnMainThread:</code> method, e.g.:</p>
<pre><code>[myButton performSelectorOnMainThread:@selector(setThumbnail:) withObject:[server imageWithPath:myButton.lot.thumbnailURL] waitUntilDone:NO];
</code></pre>
|
Can I set an infinite AutoPopDelay for a tooltip in a .NET Windows Forms window? <p>I have a requirement to not have the standard .NET <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="nofollow">Windows Forms</a> tooltip automatcially hide - that is, I need them to remain visible until the mouse moves off the c... | <p>I was searching for a solution to the problem </p>
<blockquote>
<ol>
<li>The popup baloon disappears too fast, not allowing me to read its content </li>
<li>The popup baloon does not appear again when hovering into that region.</li>
</ol>
</blockquote>
<p>I found in the forums the following answer, which ... |
Strategies to mock a webservice <p>I'm implementing a client consuming a webservice. I want to reduce dependencies and decided to mock the webservice.<br />
I use <a href="http://code.google.com/p/mockito/" rel="nofollow">mockito</a>, it has the advantage vs. EasyMock to be able to mock classes, not just interfaces. Bu... | <p>I think the real problem here is that you have a singleton that calls and creates the web service so it is difficult to insert a mock one.</p>
<p>You may have to add (possibly package level) access to the singleton class. For example if the constructor looks something like</p>
<pre><code>private GeoLocationFactor... |
creating video file <p>How would I create an class that records the users interactions with the desktop. and it should convert it to a video format such as wmv file?</p>
| <p>Cam Studio is open source and written in VC++. The source is not too bad either.</p>
<p><a href="http://camstudio.org/" rel="nofollow">http://camstudio.org/</a></p>
|
Controls "out of window/chrome" in WPF <p>Is there a way to have controls/images/etc "out of" the Window/Chrome (ie, Aero's glass) in WPF? </p>
<p>An example of what I mean is the <a href="http://www.ymessengerblog.com/blog/2007/12/05/yahoo-messenger-for-vista-preview-release-available/" rel="nofollow">WPF Yahoo Messe... | <p>Yes, I believe you will have to replace window's interface with your own. You can start with transparent window and a grid within leaving some margin around the grid. Then put thumbs, titlebar etc on the grid to simulate window behavior. Margin around the grid will allow you to draw controls outside your "window".</... |
How to get field names when running plain sql query in django <p>In one of my django views I query database using plain sql (not orm) and return results. </p>
<pre><code>sql = "select * from foo_bar"
cursor = connection.cursor()
cursor.execute(sql)
rows = cursor.fetchall()
</code></pre>
<p>I am getting the data fine,... | <p>According to <a href="http://www.python.org/dev/peps/pep-0249/" rel="nofollow">PEP 249</a>, you can try using <code>cursor.description</code>, but this is not entirely reliable.</p>
|
Windows Function <p>In my project i have 2 radio button "File" and "not File" and i also hav a textbox called "width"..</p>
<p>I need to disable the text box when i click on "not file" radio button and once i click "file" radio button it should enable the textbox..</p>
<p>Can u tell me the function in Windows program... | <p>Attach a CTextBox member variable to your text box. Say m_tbWidth. You can do this by right clicking on the textbox in the dialog designer and selecting "Add variable..."</p>
<p>In the handler for File, enter the line m_tbWidth.EnableWindow( TRUE );</p>
<p>And in the handler for NotFile, enter the line m_tbWidth... |
Newbie teaching self python, what else should I be learning? <p>I'm a newbie to programming. I had 1 semester of computer science (we used java). I got an A in the course and was able to do everything assigned, however I'm not sure I really understood it. I ignored the text and learned by looking at sample programs an... | <p>My recommendation is always to start at the high level of abstraction. You don't need to know how logic gates work and how you can use them to build a CPU -- it's cool stuff, but it's cool stuff that makes a <em>lot</em> more sense once you've messed around at the higher levels. Python is therefore an excellent ch... |
Computing MD5SUM of large files in C# <p>I am using following code to compute MD5SUM of a file - </p>
<pre><code>byte[] b = System.IO.File.ReadAllBytes(file);
string sum = BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(b));
</code></pre>
<p>This works fine normally, but if I encounter a large file (... | <p>I suggest using the alternate method:</p>
<pre><code>MD5CryptoServiceProvider.ComputeHash(Stream)
</code></pre>
<p>and just pass in an input stream opened on your file. This method will almost certainly <em>not</em> read in the whole file in memory in one go.</p>
<p>I would also note that in most implementations... |
SqlDateTime.MinValue != DateTime.MinValue, why? <p>I wonder, why SqlDateTime.MinValue is not the same as DateTime.MinValue?</p>
| <p>I think the difference between SQL's and .NET's <em>Date</em> data types stems from the fact that SQL Server's <em>datetime</em> data type, it's minimum and maximum values, and it's precision are much older than .NET's DateTime datatype.</p>
<p>With the advent of .NET, the team decided that the Datetime data type s... |
CSS/Jscript caching issue <p>I'm pretty new to web design and have recently been working on an <a href="http://www.lesleywilliamson.com" rel="nofollow">amatuer photography</a> website. I updated it on Sunday night, cleared cache etc on my home computer and it was all looking fine.</p>
<p>The problem is when I checked... | <p>Parts of the site could be being cached by your corporate server infrastructure, notably, a Proxy Server. You can check this in your headers that come from your site. A tool like FireBug or Fiddler2 should identify if a Proxy has been involved. Sorry, I don't know the exact header to look for as I don't operate behi... |
Automated Web UI Testing <p>What are the good automated web UI testing tools?</p>
<p>I want to be able to use it in the .Net world - but it doesn't have to written in .net.</p>
<p>Features such as a record mode, integration into build process\ continuous integration would be nice.</p>
<p>Im going to look at:</p>
<u... | <p>I definitively recommend Selenium, you can use it from .NET, supports different browsers, works in automatic builds and CI processes (we use it from CCNet). The code is stable. It has a few quirks, but after all they all do.</p>
<p>Whichever tool you choose, I recommend making your own test facade class(es) around ... |
iPhone + Sharepoint <p>is there a way to connect the iPhone with Sharepoint?
I wonder, if it is possible to implement the HTTP or WEBDAV
protocol of Sharepoint in Cocoa/Objective-C.</p>
<p>Regards </p>
| <p>A generic WebDAV client for the iPhone should work fine (unless Sharepoint has got WebDAV issues I'm not aware of). You may want to try <a href="http://greenbytes.de/dav-e.html" rel="nofollow">DAV-E</a>.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.