input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Is it possible to change the natural order of columns in Postgres? <p>Is it possible to change the natural order of columns in Postgres 8.1?</p>
<p>I know that you shouldn't rely on column order - it's not <em>essential</em> to what I am doing - I only need it to make some auto-generated stuff come out in a way that i... | <p>You can actually just straight up change the column order, but I'd hardly recommend it, and you should be very careful if you decide to do it.</p>
<p>eg.</p>
<pre>
# CREATE TABLE test (a int, b int, c int);
# INSERT INTO test VALUES (1,2,3);
# SELECT * FROM test;
a | b | c
---+---+---
1 | 2 | 3
(1 row)
</pre>
... |
Call Stack at Runtime <p>I want to access the call stack at runtime in a Native C++ application. I am not using the IDE. How do I display the call stack?</p>
<p>Update: I have a function which is called from many points all over the application. It crashes on rare occasions. I was looking for a way to get name of the ... | <p>Have a look at <a href="http://msdn.microsoft.com/en-us/library/ms680650%28VS.85%29.aspx" rel="nofollow">StackWalk64</a>.</p>
<p>If you're used to doing this on .NET, then you're in for a nasty surprise.</p>
|
SWD files in Flash Player 9 <p>Does anybody have any pointers to what SWD files are in Flash 9, why Flash Player wants to download them sometimes, how to make ones, how to make use of them? Didn't manage to dig anything useful myself yet.</p>
<p><em>Update</em></p>
<p>I know roughly what are swd files used in Flash8,... | <p>SWD files are needed to debug content with Adobe's debugging tools. You can see this in action by publishing from Flash authoring with shift-control-enter. </p>
<p>The SWD itself is only needed for the debugging tool to see inside the SWF. You can throw it away once you're done debugging, and you never need to uplo... |
GIS/Mapping solutions that provide easy access to routing data <p>I'm look for a GIS/Mapping tool that will give me easy SERVER-SIDE access to route information (specifically, trip time and distance) in an ASP.NET web application.</p>
<p>From what I can tell, Google and Yahoo maps do everything client-side in javascri... | <p>ESRI's ArcGIS Server and ArcWeb services provide point-to-point routing. You have full control over creating the data (if you want), changing the data, customizing parameters, and even adding dynamic cost analysis. Server might be a bit heavy-weight for JUST routing as its a full mapping and analysis server system. ... |
Algorithm for counting the number of unique colors in an image <p>Looking for one that is fast enough and still graceful with memory. The image is a 24bpp System.Drawing.Bitmap.</p>
| <p>If you need an exact number, then you are going to have to loop over all of the pixels. Probably storing the color and a count in a hash is the best way to go because of the sparseness of the colors. </p>
<p>Using the Color.ToArgb() in the hash instead of the color object would probably be a good idea too.</p>
<... |
How does SOA service discovery (UDDI) work in practice? <p>I'm just reading up on SOA and the service registry / UDDI get mentioned regularly. It sounds nice but how is used in reality?</p>
<ul>
<li>Is the registry meant to decouple a logical service from its' physical implementation (port, url etc)? </li>
<li>Is the ... | <p>I find it to be more theoretically useful than practically useful. It is infrequently implemented and infrequently used. In reality, DNS provides a sufficient abstraction tool for the location of resources on the network. </p>
|
How accurate can I expect the time to be from a stratum 0 NTP server on the same subnet on ethernet? <p>I have an application that depends on gpsd and ntpd to accurately set the system time on a linux machine.</p>
<p>gpsd is fed NMEA + PPS</p>
<p>The application is punping ~25MB per second over the network and I thin... | <p>Best info I could find on <a href="https://web.archive.org/web/20100414014404/http://www.netcordia.com/community/blogs/terrys_blog/archive/2008/01/07/ntp-accuracy.aspx" rel="nofollow">NTP accuracy</a>, seems to point at 1-2 ms in a LAN setting:</p>
<blockquote>
<p>NTP v4 with kernel mods to support it, is capable... |
How to avoid storing credentials to connect to Oracle with JDBC? <p>Is it possible to setup a JDBC connection to Oracle without providing username/password information in a configuration file (or in any other standard readable location)?</p>
<p>Typically applications have a configuration file that contains setup param... | <p>You may want to try Kerberos which can use the OS user's credentials and adding the OS user to the database as identified externally. Make sure that you use Kerberos and not the old way of doing this, which had serious security issues.</p>
<p>For Kerberos support you would need the advanced security option and a re... |
If you already know LISP, why would you also want to learn F#? <p>What is the added value for learning F# when you are already familiar with LISP?</p>
| <ul>
<li><a href="http://research.microsoft.com/fsharp/manual/quicktour.aspx#QuickTourTypes">Static typing</a> (with type inference)</li>
<li><a href="http://research.microsoft.com/fsharp/manual/quicktour.aspx#QuickTourDiscriminatedUnions">Algebraic data types</a></li>
<li><a href="http://research.microsoft.com/fsharp/... |
Is there a way to determine if an exception is occurring? <p>In a destructor, is there a way to determine if an exception is currently being processed?</p>
| <p>You can use std::uncaught_exception(), but it might not do what you think it does: see <a href="http://www.gotw.ca/gotw/047.htm" rel="nofollow" title="GoTW#47">GoTW#47</a> for more information.</p>
|
Best design for lookup-and-possibly-change method <p>I am designing a class that stores (caches) a set of data. I want to lookup a value, if the class contains the value then use it and modify a property of the class. I am concerned about the design of the public interface.<br />
Here is how the class is going to be ... | <p>Actually <code>std::set<>::insert()</code> does precisely this. If the value exists, it returns the iterator pointing to the existing item. Otherwise, the iterator where the insertion was made is returned.</p>
<p>It is likely that you are using a similar data structure for fast lookups anyway, so a clean publ... |
Keyboard shortcuts in an XBAP <p>I would like to support keyboard shortcuts in my WPF XBAP application, such as <kbd>Ctrl</kbd>+<kbd>O</kbd> for 'Open' etc. How do I disable the browsers built-in keyboard shortcuts and replace them with my own?</p>
| <p>You can't disable the browser's built-in handling of keys. It's not your place as browser content to override the browser's own shortcut keys.</p>
|
Copy / Put text on the clipboard with FireFox, Safari and Chrome <p>In Internet Explorer I can use the clipboardData object to access the clipboard. How can I do that in FireFox, Safari and/or Chrome?</p>
| <p>For security reasons, Firefox doesn't allow you to place text on the clipboard. However, there is a work-around available using Flash.</p>
<pre><code>function copyIntoClipboard(text) {
var flashId = 'flashId-HKxmj5';
/* Replace this with your clipboard.swf location */
var clipboardSWF = 'http://appeng... |
QTP_errObject CaptureBitmap <p>May I request you to clarify the issue I have with QTP err object.</p>
<p>I am trying to capture the screen shot of an object on which error occured.
I use the code <code>object.captureBitmap(filename)</code> to achieve this.</p>
<p>I would like to know if it is possible to get the scre... | <p>You can get this in your results file. go to tools->options and select the run tab. Check the box "Save still image captures to results" and select either always or for errors. When you run your test it will show the full screen and highlight the object it has a problem with, if it could find it.</p>
|
Good Haskell coding style of if/else control block? <p>I'm learning Haskell hope it could let me getting closer to functional programming, before learing it, I mostly use C-sytanx like languages, like C, Java or D Programming Language.</p>
<p>I followed the <a href="http://en.wikibooks.org/wiki/Haskell/Simple_input_an... | <p>Haskell style is functional, not imperative! Rather than "do this then that," think about combining functions and describing <em>what</em> your program will do, not how.</p>
<p>In the game, your program asks the user for a guess. A correct guess is a winner. Otherwise, the user tries again. The game continues until... |
Is it possible to subclass a C struct in C++ and use pointers to the struct in C code? <p>Is there a side effect in doing this:</p>
<p>C code:</p>
<pre><code>struct foo {
int k;
};
int ret_foo(const struct foo* f){
return f.k;
}
</code></pre>
<p>C++ code:</p>
<pre><code>class bar : public foo {
int... | <p>This is entirely legal. In C++, classes and structs are identical concepts, with the exception that all struct members are public by default. That's the only difference. So asking whether you can extend a struct is no different than asking if you can extend a class.</p>
<p>There is one caveat here. There is <em... |
Is there a rating system for the maintainability of source code? <p>I'm interested in finding some software that can analyze some C# files or an entire C# project/solution and give it a score which rates its ease or difficulty to maintain. Are there products or methods out there that do this?</p>
| <p>There is a Tool called SourceMonitor. It scans and analyzes your source code and rates it.
You can find it here <a href="http://www.campwoodsw.com/" rel="nofollow">http://www.campwoodsw.com/</a></p>
|
How to write a class library for OLE Automation? <p>I have Excel add-in which I add so many class modules that it is now very bulky. I want to convert it into a type library or a COM package so that I can re-use it for the other apps in the MS Office suite.</p>
<p>I ported the add-in to Visual Studio as a class librar... | <p>I am assuming since you used the phrase manifest, you are assembling this DLL using a .net development platform VS2003, VS2005 or VS2008 as compared to a VS 6.0 </p>
<p>This <a href="http://dn.codegear.com/article/32754" rel="nofollow">link</a> provides a detailed set of steps required to register a .NET assembly f... |
How do I reorder the fields/columns in a SharePoint view? <p>I'm adding a new field to a list and view. To add the field to the view, I'm using this code:</p>
<pre><code>view.ViewFields.Add("My New Field");
</code></pre>
<p>However this just tacks it on to the end of the view. How do I add the field to a particular c... | <p>I've found removing all items from the list and readding them in the order that I'd like works well (although a little drastic). Here is the code I'm using:</p>
<pre><code>string[] fieldNames = new string[] { "Title", "My New Field", "Modified", "Created" };
SPViewFieldCollection viewFields = view.ViewFields;
viewF... |
How to programmatically change the work flow between SSIS control flow tasks? <p>I have an SSIS package, which depending on a boolean variable, should either go to a Script Task or an Email task.(Note: the paths are coming <em>from</em> a Script Task)</p>
<p>I recall in the old dts designer there was a way to do this ... | <blockquote>
<p>Isn't a Conditional Split a data flow
task, which takes a row of data and
pushes it in one of two directions
according to some property of the
data???</p>
</blockquote>
<p>Oops, that is correct. I found <a href="http://dichotic.wordpress.com/2006/11/01/ssis-test-for-data-files-existence/" rel... |
Is there a good tool for MySQL that will help me optimise my queries and index settings? <p>I use MySQL in a fairly complex web site (PHP driven).</p>
<p>Ideally, there would be a tool I could use that would help me test the SQL queries I am using and suggest better table indexes that will improve performance and avoi... | <p>OK, before my answer, subscribe to the <a href="http://www.mysqlperformanceblog.com/">MySQL Performance Blog</a>, I've learned a lot (and I thought I already knew a lot about MySQL). Also, he's got a bitchin' tools page <a href="http://www.mysqlperformanceblog.com/tools/">here</a>.</p>
<p>Second off, here's some in... |
Is every DDL SQL command reversible? [database version control] <p>I want to setup a mechanism for tracking DB schema changes, such the one described in <a href="http://stackoverflow.com/questions/1607/mechanisms-for-tracking-db-schema-changes#1666">this answer</a>:</p>
<blockquote>
<p>For every change you make to t... | <p>in sql server every DDL command that i know of is an up/down pair.</p>
|
Which design patterns are underutilized? <p>Is there a specfic <a href="http://en.wikipedia.org/wiki/Design_Patterns" rel="nofollow">Gang Of Four Design Pattern</a> that you frequently use, yet hardly see used in other peoples designs? If possible, please describe a simple example where this pattern can be useful. It... | <p>Steve Yegge wrote a (typically) long <a href="http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html" rel="nofollow">blog entry about the Interpreter Pattern</a>, making the claim that this pattern is the only GoF pattern that can make code "smaller", and is criminally underutilized by programmers who otherw... |
Assembler file as input for a driver build with the WDK tools <p>How to get an assembler file to be compiled and linked into a driver build.</p>
<p>To clarify a bit</p>
<p>The SOURCES file :</p>
<pre><code>TARGETTYPE=DRIVER
DRIVERTYPE=WDM
TARGETPATH=obj
TARGETNAME=bla
INCLUDES=$(DDK_INC_PATH)
TARGETLIBS=$(DDK_LIB_... | <p>Have you tried the I386_SOURCES?</p>
<p>E.g</p>
<pre><code>SOURCES=x.cpp y.cpp
I386_SOURCES=i386\z.asm
</code></pre>
<p>And putting the file in the i386 directory.<br>
Also see <a href="http://msdn.microsoft.com/en-us/library/ms792148.aspx">MSDN</a> regarding the SOURCES macro</p>
|
Retrieve Error text from SQL Server 2000 error <p>I need help logging errors from T-SQL in SQL Server 2000. We need to log errors that we trap, but are having trouble getting the same information we would have had sitting in front of SQL Server Management Studio.</p>
<p>I can get a message without any argument substi... | <p>In .Net, retrieving error messages (and anything output from <em>print</em> or <em>raiserror</em>) from sql server is as simple as setting one property on your SqlConnection ( <em>.FireInfoMessageEventOnUserErrors = True</em>) and handling the connection's InfoMessage event. The data received by .Net matches what y... |
PHP: using preg_replace with htmlentities <p>I'm writing an <code>RSS</code> to <code>JSON parser</code> and as a part of that, I need to use <code>htmlentities()</code> on any tag found inside the description tag. Currently, I'm trying to use <code>preg_replace()</code>, but I'm struggling a little with it. My current... | <p>Simple. Use <code>preg_replace_callback</code>:</p>
<pre><code>function _handle_match($match)
{
return '<description>' . htmlentities($match[1]) . '</description>';
}
$pattern = "/\<description\>(.*?)\<\/description\>/is";
$rawFeed = preg_replace_callback($pattern, '_handle_match', $ra... |
Reverse-projection 2D points into 3D <p>Suppose we have a 3d Space with a plane on it with an arbitary equation : ax+by+cz+d=0
now suppose that we pick 3 random points on that plane: (x0,y0,z0) (x1,y1,z1) (x1,y1,z1)</p>
<p>now i have a different point of view(camera) for this plane. i mean i have a different camera th... | <p>It is not possible to give an unambiguous solution to this problem. However, here's how I would extract the different solutions:</p>
<p>1) Solve for the camera position and direction using the P3P (Perspective-3-Point) algorithm from the original <a href="http://www.ai.sri.com/pubs/files/836.pdf" rel="nofollow">RAN... |
Best Practices for reusing code between controllers in Ruby on Rails <p>I have some controller methods I'd like to share. What is the best practice for doing this in ruby on rails? Should I create an abstract class that my controllers extend, or should I create module and add it in to each controller? Below are the con... | <p>In my opinion, normal OO design principles apply:</p>
<ul>
<li>If the code is really a set of utilities that doesn't need access to object state, I would consider putting it in a module to be called separately. For instance, if the code is all mapping utilities, create a module <code>Maps</code>, and access the me... |
How do I write a working IThumbnailProvider for Windows Vista <p>I have written a thumbnail provider following the interfaces specified on MSDN. However, I have been unable to figure out how to register it in a way that Vista actually calls into it. Has anyone gotten a thumbnail provider working for Vista? Sample co... | <p>The <a href="http://msdn.microsoft.com/en-us/library/cc144118(VS.85).aspx#reg" rel="nofollow">documented</a> way to register your IThumbnailProvider is to create a registry entry at HKCR\.ext\ShellEx\{E357FCCD-A995-4576-B01F-234630154E96} and set the (Default) string value to the GUID of your IThumbnailProvider.</p>... |
Recovering browser textareas <p>Is there a way to recover the contents of a browser textarea? Say, you've typed a long post and then accidentally clicked on a link. Then when you come back, the textfields tantalizingly retain the text you typed in, but the textarea is blank. Where does IE and Firefox store the stuff th... | <p>Whenever I type something really long, I always copy it to my clipboard before submitting the form in case something happens. Or, sometimes I type it in Notepad and copy it over when I'm done. That may not be the answer you're looking for, but it might help.</p>
|
When do I use the PHP constant "PHP_EOL"? <p>When is it a good idea to use <a href="http://us3.php.net/manual/en/reserved.constants.php"><code>PHP_EOL</code></a>?</p>
<p>I sometimes see this in code samples of PHP. Does this handle DOS/Mac/Unix endline issues?</p>
| <p>Yes, PHP_EOL is ostensibly used to find the newline character in a cross-platform-compatible way, so it handles DOS/Mac/Unix issues.</p>
|
Problem POSTing to webservice in .net 3.5 solution <p>I'm at my wit's end here. I'm trying to use an auto-complete extender from the asp.net ajax extensions toolkit, which is filled from a bog-standard webservice. The application is a .net 3.5 web site, hosting the webservice in a subdirectory (real, not virtual).</p>
... | <p>Ok, found the issue with the help of a colleague. Seems the Ektron CMS added a mapping in IIS -- it mapped * to aspnet_isapi.dll. That overrode all the other mappings. I deleted that, and now things work.</p>
|
Parsing XML with namespaces using jQuery $().find <p>I'm trying to get the contents of a XML document element, but the element has a colon in it's name.</p>
<p>This line works for every element but the ones with a colon in the name:</p>
<pre><code>$(this).find("geo:lat").text();
</code></pre>
<p>I assume that the co... | <p>Use a backslash, which itself should be escaped so JavaScript doesn't eat it:</p>
<pre><code>$(this).find("geo\\:lat").text();
</code></pre>
|
How can I make Ruby's SOAP::RPC::Driver work with self signed certificates? <p>How can I prevent this exception when making a soap call to a server that is using a self signed certificate?</p>
<pre><code>require "rubygems"
gem "httpclient", "2.1.2"
require 'http-access2'
require 'soap/rpc/driver'
client = SOAP::RPC::D... | <p>Try:</p>
<pre><code>client.options["protocol.http.ssl_config.verify_mode"] = nil
</code></pre>
|
Best tool for Software System Diagramming <p>Over the years, I have tried many times to find a good, easy to use, cross platform tool for some basic software system diagramming. The UML tools I have tried seemed to get in my way more than help. So far, the solution I keep returning to is Visio, which is both Windows-... | <p>You could try DIA, though it is a bit basic it will keep out of your way when doing pure diagrams.</p>
<p><a href="http://www.gnome.org/projects/dia/" rel="nofollow">http://www.gnome.org/projects/dia/</a></p>
|
SQL sp_help_operator <p>Anyone know what group I need to belong to show up in the sp_help_operator list?</p>
| <p>Judging from the docs for <code>sp_help_operator</code>, it looks like you need to explicitly add/remove operators using <code>sp_add_operator</code> and <code>sp_delete_operator</code>.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa238703(SQL.80).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/lib... |
Who uses a digital notepad for saving UML and other diagrams? <p>I often find that for an initial design document, I just want to lob in a couple of rough UML / other diagrams. </p>
<p>Most diagramming tools, even Visio, slow me down considerably. I admit that this is probably <a href="http://en.wikipedia.org/wiki/PEB... | <p>I am also more the pen and paper guy, but I recently found <a href="http://abstratt.com/textuml/" rel="nofollow">textuml</a> and want to give a try as it seems more natural for a developer to do things in text and let the tool do the graphics magic.</p>
|
Absolute URL from base + relative URL in C# <p>I have a base URL :</p>
<pre><code>http://my.server.com/folder/directory/sample
</code></pre>
<p>And a relative one :</p>
<pre><code>../../other/path
</code></pre>
<p>How to get the absolute URL from this ? It's pretty straighforward using string manipulation, but I wo... | <pre><code>var baseUri = new Uri("http://my.server.com/folder/directory/sample");
var absoluteUri = new Uri(baseUri,"../../other/path");
</code></pre>
<p>OR</p>
<pre><code>Uri uri;
if ( Uri.TryCreate("http://base/","../relative", out uri) ) doSomething(uri);
</code></pre>
|
When should I use Debug.Assert()? <p>I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about assertions for a while in C++ and C, but had no idea they existed in C# and .NET at all until recently.</p>
<p>Our production code contains no asserts whatsoever and... | <p>In <a href="http://rads.stackoverflow.com/amzn/click/0735622027">Debugging Microsoft .NET 2.0 Applications</a> John Robbins has a big section on assertions. His main points are:</p>
<ol>
<li>Assert liberally. You can never have too many assertions.</li>
<li>Assertions don't replace exceptions. Exceptions cover the ... |
How to avoid storing passwords in the clear for tomcat's server.xml Resource definition of a DataSource? <p>The resource definition in tomcat's <code>server.xml</code> looks something like this...</p>
<pre class="lang-xml prettyprint-override"><code><Resource
name="jdbc/tox"
scope="Shareable"
type="java... | <p>As said before encrypting passwords is just moving the problem somewhere else.</p>
<p>Anyway, it's quite simple.
Just write a class with static fields for your secret key and so on, and static methods to encrypt, decrypt your passwords.
Encrypt your password in Tomcat's configuration file (<code>server.xml</code> o... |
What browser features/plugins for opera, IE, firefox, chrome, safari, etc. do you use for browser compatibility testing? <p>I use the <a href="https://addons.mozilla.org/en-US/firefox/addon/6543" rel="nofollow">Nightly Tester Tools</a> for Firefox and <a href="http://fiddlertool.com/fiddler/" rel="nofollow">Fiddler</a>... | <p>Web Developer toolbar for Firefox, Visual Studio JIT debugger for IE, and Chrome's Resource Inspector. We don't use Opera for debugging due to the aforementioned tools, but we do take a look at our stuff to make sure it looks correct in Opera to be on the safe side.</p>
|
How do I make a custom Flex component for a gap-fill exercise? <p>The purpose of this component is to test knowledge of a student on a given subject - in the example below it would be geography. The student is given a piece of text with missing words in it. He/she has to fill in (type in this case) the missing words - ... | <p>You need a container that supports flow layout. It's not part of the standard Flex framework but you can find some working implementation <a href="http://flexlib.googlecode.com/svn/trunk/docs/flexlib/containers/FlowBox.html" rel="nofollow">here</a> (part of the excellent FlexLib) and <a href="http://www.munkiihouse.... |
Passing in parameter from html element with jQuery <p>I'm working with jQuery for the first time and need some help. I have html that looks like the following:</p>
<pre><code><div id='comment-8' class='comment'>
<p>Blah blah</p>
<div class='tools'></div>
</div>
<div id='... | <p>Event callbacks are called with an event object as the first argument, you can't pass something else in that way. This event object has a <code>target</code> property that references the element it was called for, and the <code>this</code> variable is a reference to the element the event handler was attached to. S... |
Is it a bad idea to reload routes dynamically in Rails? <p>I have an application I'm writing where I'm allowing the administrators to add aliases for pages, categories, etc, and I would like to use a different controller/action depending on the alias (without redirecting, and I've found that render doesn't actually cal... | <p>Ben,</p>
<p>I find the method you're already using to be the best. Using Rails 3, you'd have to change the code a bit, to:</p>
<pre><code>MyNewApplication::Application.reload_routes!
</code></pre>
<p>That's all.</p>
|
Sql server real datatype, what is the C# equivalent? <p>What is the C# equivalent to the sql server 2005 real type?</p>
| <p>it is a Single</p>
<p>see <a href="http://msdn.microsoft.com/en-us/library/ms131092.aspx">here</a> for more info on SQL Server to .Net DataTypes</p>
|
C# + Castle ActiveRecord: HasAndBelongsToMany and collections <p>Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like <pre>FindAllPostByTags(IList<Tag> tags)</pre> ... | <p>You could also just use an <code>IN</code> statement</p>
<pre><code>DetachedCriteria query = DetachedCriteria.For<Post>();
query.CreateCriteria("Post").Add(Expression.In("TagName", string.Join(",",tags.ToArray()) );
</code></pre>
<p>I haven't compiled that so it could have errors</p>
|
Any good collection module in perl? <p>Can someone suggest a good module in perl which can be used to store collection of objects?</p>
<p>Or is ARRAY a good enough substitute for most of the needs?</p>
<p><strong>Update:</strong>
I am looking for a collections class because I want to be able to do an operation like c... | <p>There are collection modules for more complex structures, but it is common style in Perl to use Arrays for arrays, stacks and lists. Perl has built in functions for using the array as a stack or list : push/pop, shift/unshift, splice (inserting or removing in the middle) and the foreach form for iteration.</p>
<p>... |
How can I find out what category a product belongs to? <p>Basically, when a user inputs a product name (such as "iPhone 3g"), I would like to know the parent categories of that item (such as Electronics / Mobile phones). Is there a web api (ie. for ebay, amazon etc.) or any other way to figure out that information?</p>... | <p>Yahoo Product API has a ton of information. Now, there is no authoritative source, just Yahoo's hierarchy or individual store results, so you could just pick the first one (look under "Categories" to get the category info).
<a href="http://developer.yahoo.com/shopping/V3/productSearch.html" rel="nofollow">http://dev... |
Pass NSMutableArray object <p>I'm getting lost in pointer land, I believe. I've got this (code syntax might be a little off, I am not looking at the machine with this code on it...but all the pertinent details are correct):</p>
<pre><code>NSMutableArray *tmp = [[NSMutableArray alloc] init];
</code></pre>
<p>I them p... | <p>You don't need to call retain in this case. [[NSMutableArray alloc] init] creates the object with a retain count of 1, so it won't get released until you specifically release it.</p>
<p>It would be good to see more of the code. I don't think the error is in the very small amount you've posted so far..</p>
|
How do you sign your Firefox extensions? <p>I have developed a couple of extensions for Firefox, and am annoyed that it is so hard to get the extension signed. When an extension isn't signed, it says "Author not verified" when it is installed, and to me that just looks wrong.</p>
<p>I have a simple build script that ... | <p>Avoid the GoDaddy codesigning certs as the necessary intermediate CA certificate isn't in Firefox by default.
C=US,ST=Arizona,L=Scottsdale,O=GoDaddy.com\,Inc.,OU=<a href="http://certificates.godaddy.com/repository,CN=Go" rel="nofollow">http://certificates.godaddy.com/repository,CN=Go</a> Daddy Secure Certificati... |
Dropdownlist control with <optgroup>s for asp.net (webforms)? <p>Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks</p>
| <p>I've used the standard control in the past, and just added a simple <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.adapters.controladapter.aspx" rel="nofollow">ControlAdapter</a> for it that would override the default behavior so it could render <optgroup>s in certain places. This works great even... |
Starteam 2005 COM API <p>Has anyone worked with the StarTeam COM API (Specifically, intergrating with C#).</p>
<p>I need to write a helper function that returns a directory structure out of Starteam, but all I've been able to retrieve using this API has been a list of views.</p>
<p>Has anyone else tried this?</p>
| <p>Oh, in the interests of completeness, if you don't want to write the recursive code to navigate the heirachy of folders yourself, there is a helper class you can use to do the hard work for you called FolderListManager</p>
<pre><code>void BtnFindClick(object sender, EventArgs e)
{
Borland.StarTeam.View v = StarTea... |
Is there a free/pay web service that I can query to get MLS data? <p>Given an <a href="http://en.wikipedia.org/wiki/Multiple_Listing_Service">MLS</a>#, I'd like to get an XML document with details about the listing, like address, price and such. Not a NAR or CREA member. Mostly interested in North American rental prope... | <p>If you're an NAR member, you can utilize their Internet Data Exchange (IDX) system, but it isn't available to non-members.</p>
|
Can I use a generated variable name in PHP? <p>I have a bunch a values I would like to add together which are entered into a form. Right now, the form has 11 lines but it could get larger in the future. I can easily add all the values together with something like:</p>
<pre><code>$total = $value1 + $value2 + ... + $val... | <p>I would use @unexist's solution.. give the input fields names like:</p>
<pre><code><input name="myInput[]" />
<input name="myInput[]" />
<input name="myInput[]" />
...
</code></pre>
<p>Then in your PHP get the sum like this:</p>
<pre><code>$total = array_sum($_REQUEST['myInput']);
</code></pre>
... |
Oracle load spikes couple hours after startup <p>We use oracle as the back-end database for our product. I have been running series of stress tests on our system and I have started noticing that oracle is much faster right after the database was restarted. Over time (a couple hours or so) the database seems to get slow... | <p>What version of oracle are you running? Do you have statspack or AWR setup? if you do, check those to show you what the database is doing over time.</p>
|
In Installshield, what is the best event to use to launch applications only on install, not on uninstall or repair? <p>We have recently moved back to InstallShield 2008 from rolling our own install. So, I am still trying to get up the learning curve on it. </p>
<p>We are using Firebird and a usb driver, that we couldn... | <p>Chris, I had trouble getting the MsiGetProperty to work at all. Just adding the code that you have </p>
<pre><code>string sRemove;
number nBuffer;
nBuffer = 256;
if (MsiGetProperty(ISMSI_HANDLE, "REMOVE", sRemove, nBuffer) = ERROR_SUCCESS) then
//do something
endif;
</code></pre>
<p>I get "undefined identifi... |
Is there a reasonable way to implement a cd command on VMS? <p>I would like to be able to say things like</p>
<p><strong>cd [.fred]</strong> and have my default directory go there,
and my prompt change to indicate the full path to my current location.</p>
| <p>Just type</p>
<p><code>cd:==set default</code> </p>
<p>at the command prompt. You can also put this in your LOGIN.COM file, but be sure to put a $ in front, i.e.</p>
<p><code>$ cd:==set default</code></p>
<p>To change your prompt to show your default, something like this may work up to a point</p>
<p><code>$ se... |
Flex: Why can't I handle certain events? <p>In certain cases, I can't seem to get components to receive events.</p>
<p>[edit] </p>
<p>To clarify, the example code is just for demonstration sake, what I was really asking was if there was a central location that a listener could be added, to which one can reliably disp... | <p>Above is correct.
You are dispatching the event from btnMenu, but you are not listening for events on btnMenu - you are listening for events on the Application.</p>
<p>Either dispatch from Application:</p>
<pre><code>dispatchEvent(new Event("stepchild", true));
</code></pre>
<p>or listen on the btnMenu</p>
<pre>... |
How to unit test immutable class constructors? <p>I have an immutable class with some private fields that are set during the constructor execution. I want to unit test this constructor but I'm not sure the "best practice" in this case.</p>
<p><strong>Simple Example</strong></p>
<p>This class is defined in Assembly1:... | <p>Nothing, unless you are using that field. You don't want over-specification via tests. In other words, there is no need to test that the assignment operator works.</p>
<p>If you are using that field in a method or something, call that method and assert on that.</p>
<p>Edit: </p>
<blockquote>
<p>assume the con... |
Link error when compiling gcc atomic operation in 32-bit mode <p>I have the following program:</p>
<pre><code>~/test> cat test.cc
int main()
{
int i = 3;
int j = __sync_add_and_fetch(&i, 1);
return 0;
}
</code></pre>
<p>I'm compiling this program using GCC 4.2.2 on Linux running on a multi-cpu 64-bit Int... | <p>The answer from Dan Udey was close, close enough in fact to allow me to find the real solution.</p>
<p>According to the man page "-mcpu" is a deprecated synonym for "-mtune" and just means "optimize for a particular CPU (but still run on older CPUs, albeit less optimal)". I tried this, and it did not solve the issu... |
GDI+ System.Drawing.Bitmap gives error Parameter is not valid intermittently <p>I have some C# code in an ASP.Net application that does this:</p>
<p>Bitmap bmp = new Bitmap(1184, 1900);</p>
<p>And occasionally it throws an exception "Parameter is not valid". Now i've been googling around and apparently GDI+ is infamo... | <p>Stop using GDI+ and start using the WPF Imaging classes (.NET 3.0). These are a major cleanup of the GDI+ classes and tuned for performance. Additionally, it sets up a "bitmap chain" that allows you to easily perform multiple actions on the bitmap in an efficient manner.</p>
<p>Find more by reading about <a href="h... |
Data visualization in desktop applications <p>I would like to create data visualizations in desktop apps, using frameworks, languages and libraries that help with this kind of task. Visualizations should be interactive: clickable, draggable, customizable, animated...</p>
<p>What I would like to create is something sim... | <p>Your post has far too many questions in it to be answered easily in one response, so you might try re-posting with specific questions. Data visualization is a HUGE area of study and it's not significantly different for web applications versus desktop applications. </p>
<p>Put simply, it's the display of data in a w... |
How can I provide custom error messages using JAXP DocumentBuilder? <p>I want to provide my own message from the validation done in <code>DocumentBuilder</code>, rather than the one from <code>XMLMessages.properties</code>.</p>
<p>Now I see that a property <a href="http://apache.org/xml/properties/internal/error-repor... | <p>have you already looked at <a href="http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilder.html#setErrorHandler(org.xml.sax.ErrorHandler)" rel="nofollow">DocumentBuilder#setErrorHandler</a>?</p>
<p>if yes, could you explain why this approach doesn't work for you?</p>
|
Migrations for Java <p>I use both ruby on rails and Java. I really enjoy using migrations when I am working on a rails project. so I am wondering is there a migrations like tool for Java? If there is no such tool is it a good idea to use migrations as a tool to control a database used by a Java project? </p>
| <p>For a <strong>feature comparison</strong> between </p>
<ul>
<li>Flyway</li>
<li>Liquibase</li>
<li>c5-db-migration</li>
<li>dbdeploy</li>
<li>mybatis</li>
<li>MIGRATEdb</li>
<li>migrate4j</li>
<li>dbmaintain</li>
<li>AutoPatch</li>
</ul>
<p>have a look at <a href="http://flywaydb.org">http://flywaydb.org</a></p>
... |
Converting string to uint in actionscript / Flex <p>I am creating a component and want to expose a color property as many flex controls do, lets say I have simple component like this, lets call it foo_label:</p>
<pre>
<code>
<mx:Canvas>
<mx:Script>
[Bindable] public var color:uint;
</mx:Script... | <p>Color is not a property, it is a style. You need to define the style like this:</p>
<pre><code>[Style(name="labelColor", type="uint", format="Color" )]
</code></pre>
<p>(enclose it in tag if you define it directly in MXML). You then need to add some ActionScript to handle this style and apply it to whichever cont... |
What is the best way to implement a singleton pattern class in Actionscript 3? <p>Since AS3 does not allow private constructors, it seems the only way to construct a singleton and guarantee the constructor isn't explicitly created via "new" is to pass a single parameter and check it.</p>
<p>I've heard two recommendati... | <p>A slight adaptation of enobrev's answer is to have instance as a getter. Some would say this is more elegant. Also, enobrev's answer won't enforce a Singleton if you call the constructor before calling getInstance. This may not be perfect, but I have tested this and it works. (There is definitely another good way to... |
Writing a cookie from an ASP.Net HTTPHandler - Page.Response object? <p>I am creating an HTTP handler that listens for calls to a specific file type, and handles it accordingly. My HTTP Handler listens for .bcn files, then writes a cookie to the user's computer and sends back an image... this will be used in advertisi... | <p>You can access the Response object from the HttpContext object passed to the ProcessRequest method from IHttpHandler. This is the same object exposed by Page.Response.</p>
|
Is it expected that all the units of a Project Group in Delphi 7 to be in one folder? <p>Maybe this applied to other Delphi's (I've only used 7). We've got our code broken up so that nearly every DLL in our fairly massive app is in a different folder. <p>
99% of the open source stuff I've downloaded to plug into Delph... | <p>I don't think so. In fact, In more recent versions they've added features to the project manager to make it easier to deal with the fact that code is spread around different directories (such as the flatten directories option), so I think it is accepted that this is how many people organize their code.</p>
<p>I sus... |
How do I create an installer for a .Net website, Windows Service, and more? <p>I need to create an installer program that will do install the following:</p>
<ol>
<li>ASP.Net Website </li>
<li>Windows Service</li>
<li>SQL Express if it isn't installed
and the user doesn't have a SQL
Server</li>
<li>Dundas Charts</li>
<... | <p>You can use <a href="http://wix.sourceforge.net/" rel="nofollow">WiX</a></p>
|
How can I programmatically manipulate Windows desktop icon locations? <p>Several years back, I innocently tried to write a little app to save my tactically placed desktop icons because I was sick of dragging them back to their locations when some event reset them. I gave up after buring WAY too much time having failed... | <p>If I'm not mistaken the desktop is just a ListView, and you'll have to send the <a href="http://msdn.microsoft.com/en-us/library/bb761192(VS.85).aspx">LVM_SETITEMPOSITION</a> message to the handle of the desktop.</p>
<p>I googled a bit for some c# code and couldn't find a example, but I did found the following arti... |
JSP pagination without retrieving the whole result set? <p>I need to display the log entries from a database.
Of course the log data is huge, so I have to show the results on several pages, and that **without** getting **all** the log data at once, but as the user navigates through the pages.</p>
<p>I know about <a hr... | <p>About DisplayTag: it does support <a href="http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html" rel="nofollow">Value List</a> design pattern.</p>
|
Recommendations for a good C#/ .NET based lexical analyser <p>Can anyone recommend a good .NET based lexical analyser, preferably written in C#?</p>
| <p>Download the Visual Studio SDK; it includes a managed parser/lexer generator.</p>
<p>(Edit: It was written on my university campus, apparantly :D)</p>
|
Deployment of custom content type, forms, cqwp, and xsl <p>Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this. </p>
<p>Now, I would like to do 2 things. </p>
<p>Fi... | <p>Use <a href="http://www.codeplex.com/stsdev" rel="nofollow">STSDev</a> to create the solution package.
That should help with creating the WSP. The custom form, CQWP webpart and the .xls file should also be deployable within the project.</p>
<p>To deploy the xslt, your feature will have an</p>
<p><code><Element... |
image archive VS image strip <p>i've noticed that plenty of games / applications (very common on mobile builds) pack numerous images into an image strip.
I figured that the advantages in this are making the program more tidy (file system - wise) and reducing (un)installation time. During the runtime of the application... | <p>Caching will not be as much of an issue as you think, if the images in the strip are likely to appear at the same time - i.e. are all part of an animation.
As far as packing algorithms are concerned, most generic algorithms produce similar levels of efficiency - to get huge increases in packing efficiency you normal... |
How do I check that I removed required data only? <p>I have a really big database (running on PostgreSQL) containing a lot of tables with sophisticated relations between them (foreign keys, on delete cascade and so on).
I need remove some data from a number of tables, but I'm not sure what amount of data will be really... | <p>You can query the information_schema to draw yourself a picture on how the constraints are defined in the database. Then you'll know what is going to happen when you delete. This will be useful not only for this case, but always. </p>
<p>Something like (for constraints)</p>
<pre><code>select table_catalog,table_sc... |
Distributed Processing: C++ equivalent of JTA <p>I'm developing a mission-critical solution where data integrity is paramount and performance a close second. If data gets stuffed up, it's gonna be cata$trophic.</p>
<p>So, I'm looking for the C/C++ version of JTA (Java Transaction API). Does anyone know of any C or C++... | <p>Encina, DCE-RPC, TUXEDO, possibly CORBA (though I hesitate to suggest using CORBA), MTS (again, hmm).</p>
<p>These are the kind of things you want for distributed transaction processing.</p>
<p><a href="http://www.zois.co.uk/tpm/encina.html" rel="nofollow">Encina</a> used to have a lot of good documentation for it... |
fatal error C1900: Il mismatch between 'P1' version '20060201' and 'P2' version '20050411' <p>I compile my project with VIsual Studio 2005 Express Edition, and get this linking error. Can anyone suggest how to solve that?</p>
| <p>I downloaded VS2005 Service Pack 1 from Microsoft, installed it and it fixed the problem.</p>
|
Are there any tips/tricks about using Subsonic with Asp.Net MVC Framework? <p>Is there anyone using Subsonic with asp.net mvc framework? If so, can you tell us something about your experience. Are there tips and tricks that can be shared?</p>
| <p>If you're planning on doing database first design, and you don't need any mapping (i.e. you're in control of your db naming) then SubSonic is a decent option.</p>
<p>It's straight-forward, doesn't hide a lot from you. On the same token, for advanced scenarios I have to side-step it a lot and execute raw sql (or a ... |
maximum size for xml files <p>whats your rule of thumb for maximum size for xml files.</p>
<p>What if I ask maximum no of records, and one record have 10 values for instance? Another condition is we are loading it from web.</p>
| <p>My rule is that <strong>if it's too slow to do what I want, then it's too big</strong>, and your data probably needs to be moved to some other format... database or such.</p>
<p>Traversing XML nodes or using XPath can be a dog.</p>
|
Passing timestamp parameters in SQLAnalyzer to debug stored procedures <p>Hi I'm trying to debug a stored procedure through SQL Analyzer and one of the parameters is a timestamp datatype. If I wanted to pass 0x00000001410039E2 through as a parameter how would i do this? When I pass 0x00000001410039E2 I get a string tru... | <p>The debug input screen expects you to enter a hexadecimal value. You don't have to enter the 0x in front of this value. </p>
<p>Just enter 00000001410039E2 and it will work.</p>
|
Is Java the best language for Mobile App Devlopment? <p>I was wondering what are the benefits of using anything else but Java for Mobile Application Development.</p>
| <p>I do think that yes, Java is the most common language for devices, with two exceptions:</p>
<ul>
<li><p>Windows mobile applications, that are frequently built in C++ but that will be built more on the .NET framework in the future.</p></li>
<li><p>iPhone applications, that use Cocoa and Objective-C. </p></li>
</ul>
|
Can a web service return a stream? <p>I've been writing a little application that will let people upload & download files to me. I've added a web service to this applciation to provide the upload/download functionality that way but I'm not too sure on how well my implementation is going to cope with large files.</... | <p>Yes, it is possible with Metro. See the <a href="https://metro.java.net/guide/ch06.html#large-attachments" rel="nofollow">Large Attachments</a> example, which looks like it does what you want.</p>
<blockquote>
<p>JAX-WS RI provides support for sending and receiving large attachments in a streaming fashion.</p>
... |
How do you retrieve a list of logged-in/connected users in .NET? <p>Here's the scenario:</p>
<p>You have a Windows server that users remotely connect to via RDP. You want your program (which runs as a service) to know who is currently connected. This may or may not include an interactive console session.</p>
<p>Pleas... | <p>Here's my take on the issue:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace EnumerateRDUsers
{
class Program
{
[DllImport("wtsapi32.dll")]
static extern IntPtr WTSOpenServer([MarshalAs(UnmanagedType.LPStr)] String pServe... |
Method 'XYZ' cannot be reflected <p>We have consumed a third party web service and are trying to invoke it from an ASP.NET web application.
However when I instantiate the web service the following System.InvalidOperationException exception is thrown:</p>
<blockquote>
<p>Method 'ABC.XYZ' can not be reflected.
Syst... | <p>I ran into the same problem earlier today.
The reason was - the class generated by Visual Studio and passed as a parameter into one of the methods did not have a default parameterless constructor. Once I have added it, the error had gone.</p>
|
jQuery - running a function on a new image <p>I'm a jQuery novice, so the answer to this may be quite simple:</p>
<p>I have an image, and I would like to do several things with it.
When a user clicks on a 'Zoom' icon, I'm running the 'imagetool' plugin (<a href="http://code.google.com/p/jquery-imagetool/" rel="nofollo... | <p>Wehey! I've sorted it out myself...</p>
<p>Turns out if I remove the containing div completely, and then rewrite it with .html, the imagetool plugin recognises it again.</p>
<p>Amended code for anyone who's interested:</p>
<pre><code>$(document).ready(function(){
// Product Zoom (jQuery)
$("#productZoom").cl... |
Deterministic dispose of ThreadStatic objects <p>The <a href="http://stackoverflow.com/questions/9033?#13932">ThreadStatic attribute</a> declares a static variable as unique-per-thread.
Do you know an easy pattern to correctly dispose such variables?</p>
<p>What we used before ThreadStatic is a ThreadContextManager. E... | <p>You can still use the equivalent of your ThreadContextManager class to handle the dispose. The spawned threads dispose of this 'manager' object which in turn takes out all the other thread static objects it knows about.</p>
<p>I prefer to have relatively few thread static objects and use a context object instead. ... |
How do I add an action to visio (2003) <p>In a visio shapesheet one can add actions. I want to create an action that updates the value of another cell (the position of a control). How can one do that. Does it need a separate macro, or can it be specified directly? And how?</p>
| <p>You don't need an addon or macro, you can do this in the Shapesheet. </p>
<p>In the Shapesheet look for the Action section. If you don't find it right click and add it. In the Action section add a row. Set the cells to something like:</p>
<pre><code>Action = SETF(GetRef(Controls.Row_1),"2 in.")+SETF(GetRef(Control... |
Why does Castle Windsor hold onto transient objects? <p>Recently I noticed my application appears to be eating memory that never gets released. After profiling with CLRProfiler I've found that the Castle Windsor container I'm using is holding onto objects. These objects are declared with the lifestyle="transient" attri... | <p>I think the answers here are missing a vital point - that this behavior is configurable out of the box via release policies - check out the documentation on the castle project site <a href="http://www.castleproject.org/container/documentation/trunk/advanced/releasepolicy.html" rel="nofollow">here</a>.</p>
<p>In man... |
Illustrating usage of the volatile keyword in C# <p>I would like to code a little program which visually illustrates the behavior of the <code>volatile</code> keyword. Ideally, it should be a program which performs concurrent access to a non volatile static field and which gets incorrect behavior because of that. </p>
... | <p>I've achieved a working example!</p>
<p>The main idea received from wiki, but with some changes for C#. The wiki article demonstrates this for static field of C++, it is looks like C# always carefully compile requests to static fields... and i make example with non static one:</p>
<p>If you run this example in <st... |
How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request? <p>I have a JavaScript widget which provides standard extension points. One of them is the <code>beforecreate</code> function. It should return <code>false</code> to prevent an item from being created. </p>
<p>I've added an Ajax cal... | <p>From the <a href="http://docs.jquery.com/Ajax/jQuery.ajax">jQuery documentation</a>: you specify the <strong>asynchronous</strong> option to be <strong>false</strong> to get a synchronous Ajax request. Then your callback can set some data before your mother function proceeds.</p>
<p>Here's what your code would look... |
In Perforce, can you rename a folder to the same name but cased differently? <p>Can I rename a folder in Perforce from <em>//depot/FooBar/</em> to <em>//depot/Foobar/</em>?</p>
<p>I've tried this by renaming from <em>//depot/FooBar/</em> to <em>//depot/Temp/</em> to <em>//Depot/Foobar/</em> but the end result ends up ... | <p>Once it is in Perforce, the case remains set. As mentioned by Johan you can obliterate, set the name up correctly, and add it in again. However, there is a slight gotcha....</p>
<p>If anyone else (running Windows) has already synced the wrong-cased version, then when they sync again the right one, it will not chang... |
Programatically delete emails and SMSs on a Window Mobile device <p>I'm looking for a code snippet that can delete all emails and text messages on a Windows Mobile device. Preferably the code would delete items in the Sent and Drafts folders as well as the Inbox. </p>
<p>My platform is Windows Mobile (5.0 SDK) and .ne... | <p>Unfortunately Microsoft has <strong>not</strong> made this easy for managed developers. Why the WindowsMobile.PocketOutlook class wrappers don't provide this functionality one can only guess. What you have to do is write your own COM interop object to MAPI. Sorry, I don't have one to give you as a sample, but I ca... |
What's the difference between a "Data Service Layer" and a "Data Access Layer"? <p>I remember reading that one abstracts the low level calls into a data agnostic framework (eg. ExecuteCommand methods etc), and the other usually contains business specific methods (eg. UpdateCustomer).</p>
<p>Is this correct? Which is ... | <p>To me this is a personal design decision on how you want to handle your project design. At times data access and data service are one and the same. For .NET and LINQ that is the case.</p>
<p>To me the data service layer is what actually does the call to the database. The data access layer receives the objects an... |
Configure db used for ASP.Net Authentication <p>I want to use forms authentication in my asp.net mvc site.</p>
<p>Can I use an already existing sql db (on a remote server) for it? How do I configure the site to use this db for authentication? Which tables do I need/are used for authentication?</p>
| <p>You can. Check <code>aspnet_regsql.exe</code> program parameters in your Windows\Microsoft.NET\Framework\v2.xxx folder, specially <code>sqlexportonly</code>.</p>
<p>After creating the needed tables, you can configure: create a connection string in the web.config file and then set up the MemberShipProvider to use th... |
How do you handle small sets of data? <p>With really small sets of data, the policy where I work is generally to stick them into text files, but in my experience this can be a development headache. Data generally comes from the database and when it doesn't, the process involved in setting it/storing it is generally hid... | <p>Put it in the database. If it changes infrequently, cache it in your middle tier.</p>
|
propertyNameFieldSpecified when generating a 2.0 web service proxy from a WCF Service <p>I have created a web reference (Add Web Reference) from Visual Studio 2008 and strangely, I need to set the <em>propertyNameField</em>Specified to true for all the fields I want to submit. Failure to do that and values are not pass... | <p>Here is a complete answer: <a href="http://blogs.msdn.com/eugeneos/archive/2007/02/05/solving-the-disappearing-data-issue-when-using-add-web-reference-or-wsdl-exe-with-wcf-services.aspx" rel="nofollow">http://blogs.msdn.com/eugeneos/archive/2007/02/05/solving-the-disappearing-data-issue-when-using-add-web-reference-... |
Balancing a Binary Tree (AVL) <p>Ok, this is another one in the theory realm for the CS guys around.</p>
<p>In the 90's I did fairly well in implementing BST's. The only thing I could never get my head around was the intricacy of the algorithm to balance a Binary Tree (AVL).</p>
<p>Can you guys help me on this?</p>
| <p>I don't think it's good to post complete codes for node balancing algorithms here since they get quite big. However, the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Red-black_tree">red-black trees</a> contains a complete C implementation of the algorithm and the article on <a href="http://en.wikipedia... |
How can I access a mapped network drive with System.IO.DirectoryInfo? <p>I need to create a directory on a mapped network drive. I am using a code:</p>
<pre><code>DirectoryInfo targetDirectory = new DirectoryInfo(path);
if (targetDirectory != null)
{
targetDirectory.Create();
}
</code></pre>
<p>If I specify the p... | <p>Mapped network drives are user specific, so if the app is running under a different identity than the user that created the mapped drive letter (z:) it won't work.</p>
|
spawn a new xterm window <p>When I am using Bitvise Tunnelier and I spawn a new xterm window connecting to our sun station everything works nicely. We have visual slick edit installed on the sun station and I have been instructed to open it using the command vs&. When I do this I get the following:</p>
<pre><code>... | <p>You're going to need an Xwindows server on your Windows box in order to run graphical Unix apps remotely on the Sun server and have it display on your Windows box. I don't think Tunnelier supports Xwindows tunneling. Take a look at Xming, an Xwindows server for Windows that comes with Putty, an ssh client:</p>
<p... |
.NET - How to hide invalid choices in a DateTimePicker <p>I've set the MaxDate and MinDate properties of a DateTimePicker. However, when I test the control at runtime, there is no way to tell the invalid dates from the valid ones. The only difference is that clicking on an invalid date does nothing.</p>
<p>This is not... | <p>I have a similar issue. I've extended the DateTimePicker control to run a validate process whenever the value changes and to either revert to the previous value or to the nearest legal value in the event of an illegal choice. </p>
<p>The logical extension to this is to flash up a warning dialog or label to inform t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.