qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
list
input
stringlengths
12
45k
output
stringlengths
2
31.8k
304,130
<p>Based on the advice provided at <a href="http://www.tweakguides.com/VA_4.html" rel="nofollow noreferrer">http://www.tweakguides.com/VA_4.html</a> to prevent Windows Vista from "intelligently" rearranging column formats in Windows Explorer, I have written a script to automate the process a little.</p> <pre><code>Dim...
[ { "answer_id": 565600, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "<p>Disable UAC in Windows Vista, then this script will just work fine.</p>\n" }, { "answer_id": 1434972, "author":...
2008/11/20
[ "https://Stackoverflow.com/questions/304130", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2663/" ]
Based on the advice provided at <http://www.tweakguides.com/VA_4.html> to prevent Windows Vista from "intelligently" rearranging column formats in Windows Explorer, I have written a script to automate the process a little. ``` Dim WshShell Set WshShell = WScript.CreateObject("WScript.Shell") 'Remove the "filthy" reg ...
Does your registry setting have subkeys? I think you have to delete those before you can delete the key.
304,152
<p>I am using Python and the <a href="http://twistedmatrix.com/trac/" rel="nofollow noreferrer">Twisted</a> framework to connect to an FTP site to perform various automated tasks. Our FTP server happens to be Pure-FTPd, if that's relevant.</p> <p>When connecting and calling the <strong>list</strong> method on an <str...
[ { "answer_id": 311236, "author": "Martin Carpenter", "author_id": 39443, "author_profile": "https://Stackoverflow.com/users/39443", "pm_score": 3, "selected": true, "text": "<p>Firstly, if you're performing automated tasks on a retrieived FTP listing then you should probably be looking a...
2008/11/20
[ "https://Stackoverflow.com/questions/304152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2696/" ]
I am using Python and the [Twisted](http://twistedmatrix.com/trac/) framework to connect to an FTP site to perform various automated tasks. Our FTP server happens to be Pure-FTPd, if that's relevant. When connecting and calling the **list** method on an **FTPClient**, the resulting **FTPFileListProtocol**'s **files** ...
Firstly, if you're performing automated tasks on a retrieived FTP listing then you should probably be looking at `NLST` rather than `LIST` as noted in [RFC 959 section 4.1.3](https://www.rfc-editor.org/rfc/rfc959#page-33): ``` NAME LIST (NLST) ... This command is intended to return information that ...
304,213
<p>I am using the ASP.NET <strong>Client-Side</strong> ajax control toolkit in my asp.net MVC application. I see that there is a .js file named "AjaxControlToolkit.ModalPopup.ModalPopupBehavior.js" in the AjaxControlToolkit folder. However, I cannot find any examples on how to use it.<br /><br /> [Edit] - As mentioned,...
[ { "answer_id": 304217, "author": "Robert Wagner", "author_id": 10784, "author_profile": "https://Stackoverflow.com/users/10784", "pm_score": -1, "selected": false, "text": "<p>Check out the <a href=\"http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx\" rel=\"no...
2008/11/20
[ "https://Stackoverflow.com/questions/304213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37786/" ]
I am using the ASP.NET **Client-Side** ajax control toolkit in my asp.net MVC application. I see that there is a .js file named "AjaxControlToolkit.ModalPopup.ModalPopupBehavior.js" in the AjaxControlToolkit folder. However, I cannot find any examples on how to use it. [Edit] - As mentioned, I am using the Client-si...
Yestarday I had the same need to use the popup extender and here are the js files which you should include first. ``` <script src="javascripts/MicrosoftAjax.js" type="text/javascript" ></script> <script src="javascripts/AjaxControlToolkit/AjaxControlToolkit.Compat.Timer.Timer.js" type="text/javascript"></script> <scri...
304,216
<p>Is there a way to find all nodes in a xml tree using cElementTree? The findall method works only for specified tags.</p>
[ { "answer_id": 304220, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 3, "selected": true, "text": "<p>You can use <a href=\"http://effbot.org/zone/element-xpath.htm\" rel=\"nofollow noreferrer\">XPath paths</a> on th...
2008/11/20
[ "https://Stackoverflow.com/questions/304216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2220518/" ]
Is there a way to find all nodes in a xml tree using cElementTree? The findall method works only for specified tags.
You can use [XPath paths](http://effbot.org/zone/element-xpath.htm) on the findall method: > > The 1.2 release supports simple > element location paths. In its > simplest form, a location path is one > or more tag names, separated by > slashes (/). > > > You can also use an asterisk (\*) > instead of a tag nam...
304,233
<p>I'm trying to use the ASP.NET MVC Ajax.BeginForm helper but don't want to use the existing content insertion options when the call completes. Instead, I want to use a custom JavaScript function as the callback.</p> <p>This works, but the result I want should be returned as JSON. Unfortunately, the framework just tr...
[ { "answer_id": 304517, "author": "Kobi", "author_id": 39215, "author_profile": "https://Stackoverflow.com/users/39215", "pm_score": 5, "selected": true, "text": "<p>Try this: </p>\n\n<pre><code>var json_data = content.get_response().get_object();\n</code></pre>\n\n<p>this will give you r...
2008/11/20
[ "https://Stackoverflow.com/questions/304233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2656/" ]
I'm trying to use the ASP.NET MVC Ajax.BeginForm helper but don't want to use the existing content insertion options when the call completes. Instead, I want to use a custom JavaScript function as the callback. This works, but the result I want should be returned as JSON. Unfortunately, the framework just treats the d...
Try this: ``` var json_data = content.get_response().get_object(); ``` this will give you result in JSON format and you can use `json_data[0]` to get the first record
304,240
<pre><code>&lt;?php class foo { //this class is always etended, and has some other methods that do utility work //and are never overrided public function init() { //what do to here to call bar-&gt;doSomething or baz-&gt;doSomething //depending on what class is actually instantiated? ...
[ { "answer_id": 304245, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 1, "selected": false, "text": "<pre><code>public function init() {\n $this-&gt;doSomething();\n}\n\n$obj = new bar();\n$obj-&gt;doSomething(); // prints \"...
2008/11/20
[ "https://Stackoverflow.com/questions/304240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39183/" ]
``` <?php class foo { //this class is always etended, and has some other methods that do utility work //and are never overrided public function init() { //what do to here to call bar->doSomething or baz->doSomething //depending on what class is actually instantiated? } functio...
You just have to call $this->doSomething(); in your init() method. Due to polymorphism, the correct method of the child object will be called at runtime depending on the class of the child.
304,256
<p>The Python <a href="http://www.python.org/doc/2.5.2/lib/datetime-datetime.html" rel="noreferrer"><code>datetime.isocalendar()</code></a> method returns a tuple <code>(ISO_year, ISO_week_number, ISO_weekday)</code> for the given <code>datetime</code> object. Is there a corresponding inverse function? If not, is the...
[ { "answer_id": 304288, "author": "Tom", "author_id": 3715, "author_profile": "https://Stackoverflow.com/users/3715", "pm_score": -1, "selected": false, "text": "<p><em>EDIT: ignore this, the edge cases are a pain. Go with Ben's solution.</em></p>\n\n<p>Ok, on closer inspection I noticed ...
2008/11/20
[ "https://Stackoverflow.com/questions/304256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715/" ]
The Python [`datetime.isocalendar()`](http://www.python.org/doc/2.5.2/lib/datetime-datetime.html) method returns a tuple `(ISO_year, ISO_week_number, ISO_weekday)` for the given `datetime` object. Is there a corresponding inverse function? If not, is there an easy way to compute a date given a year, week number and day...
Python 3.8 added the [fromisocalendar()](https://docs.python.org/3/library/datetime.html#datetime.date.fromisocalendar) method: ``` >>> datetime.fromisocalendar(2011, 22, 1) datetime.datetime(2011, 5, 30, 0, 0) ``` Python 3.6 added the [`%G`, `%V` and `%u` directives](https://docs.python.org/3.6/whatsnew/3.6.html#da...
304,268
<p>I am looking to use Java to get the MD5 checksum of a file. I was really surprised but I haven't been able to find anything that shows how to get the MD5 checksum of a file.</p> <p>How is it done?</p>
[ { "answer_id": 304275, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 7, "selected": false, "text": "<p>There's an example at <a href=\"http://www.rgagnon.com/javadetails/java-0416.html\" rel=\"noreferrer\">Real's Jav...
2008/11/20
[ "https://Stackoverflow.com/questions/304268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24998/" ]
I am looking to use Java to get the MD5 checksum of a file. I was really surprised but I haven't been able to find anything that shows how to get the MD5 checksum of a file. How is it done?
There's an input stream decorator, `java.security.DigestInputStream`, so that you can compute the digest while using the input stream as you normally would, instead of having to make an extra pass over the data. ``` MessageDigest md = MessageDigest.getInstance("MD5"); try (InputStream is = Files.newInputStream(Paths.g...
304,270
<p>Ok, I have one JavaScript that creates rows in a table like this:</p> <pre><code> function AddRow(text,rowID) { var tbl = document.getElementById('tblNotePanel'); var row = tbl.insertRow(tbl.rows.length); var cell = row.insertCell(); var textNode = document.createTextNode(text); cell.id = rowID...
[ { "answer_id": 304282, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 2, "selected": false, "text": "<p>In the clickTest function you should have access to a the <code>this</code> variable. Try this inside of <code>c...
2008/11/20
[ "https://Stackoverflow.com/questions/304270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12172/" ]
Ok, I have one JavaScript that creates rows in a table like this: ``` function AddRow(text,rowID) { var tbl = document.getElementById('tblNotePanel'); var row = tbl.insertRow(tbl.rows.length); var cell = row.insertCell(); var textNode = document.createTextNode(text); cell.id = rowID; cell.st...
Try this: ``` cell.onclick = function() { clickTest(rowID); }; ``` The idea is that you are binding the onclick handler to the anonymous function. The anonymous function calls clickTest with rowID as the parameter.
304,281
<p>I can't figure out how to get the SCOPE_IDENTITY() back to my variables from an SQL2005 Store Procedure.</p> <p>My sSQL String:</p> <pre><code>sSQL = "EXEC [sp_NewClaim] " &amp; Chr(34) &amp; ClaimNumber &amp; Chr(34) &amp; ", " &amp; Request.Cookies("UserID") &amp; ", " &amp; Request.Cookies("MasterID") &amp; ", ...
[ { "answer_id": 304294, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 4, "selected": true, "text": "<p>For your stored procedure, do this:</p>\n\n<pre><code>CREATE PROCEDURE sp_NewClaim\n (\n @ClaimNumber nvarchar(50...
2008/11/20
[ "https://Stackoverflow.com/questions/304281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38678/" ]
I can't figure out how to get the SCOPE\_IDENTITY() back to my variables from an SQL2005 Store Procedure. My sSQL String: ``` sSQL = "EXEC [sp_NewClaim] " & Chr(34) & ClaimNumber & Chr(34) & ", " & Request.Cookies("UserID") & ", " & Request.Cookies("MasterID") & ", " & Chr(34) & strRestaurante & Chr(34) & ", " & Chr(...
For your stored procedure, do this: ``` CREATE PROCEDURE sp_NewClaim ( @ClaimNumber nvarchar(50), @blah............ ................. ) AS BEGIN SET NOCOUNT ON; INSERT INTO Accidente (ClaimNumber,........., RecordNumber) VALUES (@ClaimNumber,....., @RecordNumber) SELECT SCOPE_IDENTIT...
304,319
<p>As I sometimes have path problems, where one of my own cmd scripts is hidden (shadowed) by another program (earlier on the path), I would like to be able to find the full path to a program on the Windows command line, given just its name.</p> <p>Is there an equivalent to the UNIX command 'which'?</p> <p>On UNIX, <...
[ { "answer_id": 304333, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 3, "selected": false, "text": "<p>Not in stock Windows but it is provided by <a href=\"http://technet.microsoft.com/en-us/interopmigration/bb380242...
2008/11/20
[ "https://Stackoverflow.com/questions/304319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34596/" ]
As I sometimes have path problems, where one of my own cmd scripts is hidden (shadowed) by another program (earlier on the path), I would like to be able to find the full path to a program on the Windows command line, given just its name. Is there an equivalent to the UNIX command 'which'? On UNIX, `which command` pr...
Windows Server 2003 and later (i.e. anything after Windows XP 32 bit) provide the `where.exe` program which does some of what `which` does, though it matches all types of files, not just executable commands. (It does not match built-in shell commands like `cd`.) It will even accept wildcards, so `where nt*` finds all f...
304,322
<p>Is there a way I can export my Silverlight DataGrid data to excel or csv?</p> <p>I searched the web but can't find any examples!</p> <p>Thanks a lot </p>
[ { "answer_id": 304332, "author": "Dave Swersky", "author_id": 34796, "author_profile": "https://Stackoverflow.com/users/34796", "pm_score": 2, "selected": false, "text": "<p>I don't think Silverlight offers a way to download files. You can add a button to your app that calls a URL- i.e....
2008/11/20
[ "https://Stackoverflow.com/questions/304322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Is there a way I can export my Silverlight DataGrid data to excel or csv? I searched the web but can't find any examples! Thanks a lot
Silverlight 3 changes the answer to this question because it gives the ability of the user to create a file on the user's desktop in a location that they specify. I adapted the code submitted by DaniCE, split things into a few methods for readability and am using a loosely defined CSV format that Excel should recognize...
304,323
<p>What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database.</p> <p>I am using Zend Framework for ...
[ { "answer_id": 304340, "author": "rg88", "author_id": 11252, "author_profile": "https://Stackoverflow.com/users/11252", "pm_score": 1, "selected": false, "text": "<p>I just came across something that may be germane to this question. <a href=\"http://www.ibm.com/developerworks/opensource/...
2008/11/20
[ "https://Stackoverflow.com/questions/304323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11252/" ]
What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database. I am using Zend Framework for the site w...
In your library directory you should have your own library next to the Zend library folder. Whatever you call it (Mylib, Project, ...) you should include it into the Zend Autoloader and that's done as follows: ``` require_once 'Zend/Loader/Autoloader.php'; $loader = Zend_Loader_Autoloader::getInstance(); $loader->regi...
304,356
<p>I've written a script which takes the summary of an order and stores in into an XML file, except the problem is that I don't want people to be able to open the XML file in their browser, obviously.</p> <p>I'm hosted on a very dodgy shared server with limited abilities: no SSH, for starters.</p> <p><strong>Is there...
[ { "answer_id": 304380, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 2, "selected": true, "text": "<p>I worked around it by putting the XML file in my httpdocs folder, but added a .htaccess file with this in it:</p>\n\n<pre><c...
2008/11/20
[ "https://Stackoverflow.com/questions/304356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
I've written a script which takes the summary of an order and stores in into an XML file, except the problem is that I don't want people to be able to open the XML file in their browser, obviously. I'm hosted on a very dodgy shared server with limited abilities: no SSH, for starters. **Is there a place I can put this...
I worked around it by putting the XML file in my httpdocs folder, but added a .htaccess file with this in it: ``` <Files ~ "myfile.xml"> Order allow,deny Deny from all </Files> ```
304,366
<p>I have sproc 'up&#95;selfassessform&#95;view' which has the following parameters:</p> <pre><code>in ai_eqidentkey SYSKEY in ai_acidentkey SYSKEY out as_eqcomments TEXT_STRING out as_acexplanation TEXT_STRING </code></pre> <p>&nbsp;-&nbsp; which are domain objects - SYSKEY is 'integer' and TEXT_STRING is 'long varc...
[ { "answer_id": 304481, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 3, "selected": false, "text": "<p>Minix 3 is a new version; LINUX was prompted on the original Minix.</p>\n\n<p>Minix is really best suited to sma...
2008/11/20
[ "https://Stackoverflow.com/questions/304366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have sproc 'up\_selfassessform\_view' which has the following parameters: ``` in ai_eqidentkey SYSKEY in ai_acidentkey SYSKEY out as_eqcomments TEXT_STRING out as_acexplanation TEXT_STRING ```  -  which are domain objects - SYSKEY is 'integer' and TEXT\_STRING is 'long varchar'. I can call the sproc fine from iSQ...
Minix 3 is a new version; LINUX was prompted on the original Minix. Minix is really best suited to small systems of embedded systems. If you have an old x86 PC around it should run minix handily, giving you an environment very much like what we called "an amazing workstation" in the mid-80's. I loved programming in ...
304,371
<p>I'm looking to get some help on using the <a href="http://malsup.com/jquery/cycle/" rel="nofollow noreferrer">cycle</a> library for jQuery. I'm in the <a href="http://malsup.com/jquery/cycle/begin.html" rel="nofollow noreferrer">beginner</a> demos, and I got the absolute first one completed. This is the second one o...
[ { "answer_id": 304475, "author": "seanb", "author_id": 3354, "author_profile": "https://Stackoverflow.com/users/3354", "pm_score": 2, "selected": false, "text": "<p>I will take a guess that this is just not working for you.<br>\nYou need to balance your braces and parentheses.<br>\n<stro...
2008/11/20
[ "https://Stackoverflow.com/questions/304371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm looking to get some help on using the [cycle](http://malsup.com/jquery/cycle/) library for jQuery. I'm in the [beginner](http://malsup.com/jquery/cycle/begin.html) demos, and I got the absolute first one completed. This is the second one on the page. ``` <script src="jquery-1.2.6.min.js" type="text/javascript"></s...
I will take a guess that this is just not working for you. You need to balance your braces and parentheses. **Please** help others to help you by saying what the actual problem is next time. Try this: ``` $(document).ready(function() { $('.pics').cycle({ fx: 'scrollDown', speed: 300...
304,373
<p>I have the following .aspx page, and I want to view it in web browsers such as IE or Google Chrome by opening it directly in those browsers:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD X...
[ { "answer_id": 304379, "author": "Brettski", "author_id": 5836, "author_profile": "https://Stackoverflow.com/users/5836", "pm_score": 3, "selected": true, "text": "<p>Remove or comment out the</p>\n\n<p>&lt;<code>%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"Default.aspx....
2008/11/20
[ "https://Stackoverflow.com/questions/304373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
I have the following .aspx page, and I want to view it in web browsers such as IE or Google Chrome by opening it directly in those browsers: ``` <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//...
Remove or comment out the <`%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>` line as a browser doesn't know what to do with it. This is normally interpreted by iis and not sent to the browser.
304,383
<p>Is there a way to edit the log message of a certain revision in Subversion? I accidentally wrote the wrong filename in my commit message which could be confusing later.</p> <p>I've seen <em><a href="https://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git">How do I edit an incorre...
[ { "answer_id": 304390, "author": "Kamil Kisiel", "author_id": 15061, "author_profile": "https://Stackoverflow.com/users/15061", "pm_score": 10, "selected": true, "text": "<p>Essentially you have to have admin rights (directly or indirectly) to the repository to do this. You can either c...
2008/11/20
[ "https://Stackoverflow.com/questions/304383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/813/" ]
Is there a way to edit the log message of a certain revision in Subversion? I accidentally wrote the wrong filename in my commit message which could be confusing later. I've seen *[How do I edit an incorrect commit message in Git?](https://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in...
Essentially you have to have admin rights (directly or indirectly) to the repository to do this. You can either configure the repository to allow all users to do this, or you can modify the log message directly on the server. See [this part](http://subversion.apache.org/faq.html#change-log-msg) of the [Subversion FAQ...
304,386
<p>I am trying to develop a plug-in for <a href="http://trac.webkit.org/wiki/QtWebKit" rel="nofollow noreferrer">QtWebkit</a>. But I am not able to find how to develop a plugin for QtWebKit, hopefully one that can be invoked by JavaScript. Does anyone know of any tutorials or documents that explain how to do this?</p>...
[ { "answer_id": 327149, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 0, "selected": false, "text": "<p><a href=\"http://developer.apple.com/documentation/InternetWeb/Conceptual/WebKit_PluginProgTopic/WebKitPluginTopics...
2008/11/20
[ "https://Stackoverflow.com/questions/304386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am trying to develop a plug-in for [QtWebkit](http://trac.webkit.org/wiki/QtWebKit). But I am not able to find how to develop a plugin for QtWebKit, hopefully one that can be invoked by JavaScript. Does anyone know of any tutorials or documents that explain how to do this? Webkit has been intregated into Qt and this...
The simple answer is to write a subclass of `QWebPage` and set this on your `webview`. Then you can show your own HTML page and react to the appropriate object tag in the [`createPlugin`](http://doc.qt.io/archives/4.6/qwebpage.html#createPlugin) method; ``` protected: QObject* createPlugin(const QString &classid, c...
304,389
<p>In VB.NET, which is better to use: function overloading or default parameters?</p>
[ { "answer_id": 304421, "author": "Hamish Smith", "author_id": 15572, "author_profile": "https://Stackoverflow.com/users/15572", "pm_score": 3, "selected": false, "text": "<p>if the parameters are optional (i.e. the overloads are a subset of the parameters that the full procedure signatur...
2008/11/20
[ "https://Stackoverflow.com/questions/304389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34588/" ]
In VB.NET, which is better to use: function overloading or default parameters?
Is the code going to be used by other languages? If so, that swings the balance towards overloads while still bearing Hamish's answer in mind. In particular, C# doesn't support optional parameters - yet... Admittedly this wouldn't actually prevent someone using your code from C#, it just might be a pain for them. If ...
304,391
<p>Say I have a string of 16 numeric characters (i.e. 0123456789012345) what is the most efficient way to delimit it into sets like : 0123-4567-8901-2345, in PHP?</p> <p>Note: I am rewriting an existing system that is painfully slow.</p>
[ { "answer_id": 304411, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 4, "selected": true, "text": "<p>Use <a href=\"http://php.net/str_split\" rel=\"nofollow noreferrer\">str_split()</a>:</p>\n\n<pre><code>$string = '01234...
2008/11/20
[ "https://Stackoverflow.com/questions/304391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
Say I have a string of 16 numeric characters (i.e. 0123456789012345) what is the most efficient way to delimit it into sets like : 0123-4567-8901-2345, in PHP? Note: I am rewriting an existing system that is painfully slow.
Use [str\_split()](http://php.net/str_split): ``` $string = '0123456789012345'; $sets = str_split($string, 4); print_r($sets); ``` The output: ``` Array ( [0] => 0123 [1] => 4567 [2] => 8901 [3] => 2345 ) ``` Then of course to insert hyphens between the sets you just [implode()](http://php.net/imp...
304,396
<p>I'm looking for some sample code that will sort the list items in an HTML list by alphabetical order. Can anyone help?</p> <p>Here is a sample list for people to work with:</p> <pre><code>&lt;ul class="alphaList"&gt; &lt;li&gt;apples&lt;/li&gt; &lt;li&gt;cats&lt;/li&gt; &lt;li&gt;bears&lt;/li&gt; &lt;...
[ { "answer_id": 304428, "author": "Chatu", "author_id": 39203, "author_profile": "https://Stackoverflow.com/users/39203", "pm_score": 8, "selected": true, "text": "<pre><code>var items = $('.alphaList &gt; li').get();\nitems.sort(function(a,b){\n var keyA = $(a).text();\n var keyB = $(b...
2008/11/20
[ "https://Stackoverflow.com/questions/304396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3957/" ]
I'm looking for some sample code that will sort the list items in an HTML list by alphabetical order. Can anyone help? Here is a sample list for people to work with: ``` <ul class="alphaList"> <li>apples</li> <li>cats</li> <li>bears</li> </ul> ```
``` var items = $('.alphaList > li').get(); items.sort(function(a,b){ var keyA = $(a).text(); var keyB = $(b).text(); if (keyA < keyB) return -1; if (keyA > keyB) return 1; return 0; }); var ul = $('.alphaList'); $.each(items, function(i, li){ ul.append(li); /* This removes li from the old spot and moves i...
304,430
<p>When running the following code it leaves out one row. When I do a files.Count it says there are 4 rows but there is no data stored for the 4th row. When I run the stored procedure from within SQL Manager it returns all 4 rows and all the data. Any help?</p> <pre><code> List&lt;File&gt; files = new List&...
[ { "answer_id": 304465, "author": "seanb", "author_id": 3354, "author_profile": "https://Stackoverflow.com/users/3354", "pm_score": 1, "selected": false, "text": "<p>Have you tried stepping through this in a debugger, and checking your command params before you exec the reader? Do you get...
2008/11/20
[ "https://Stackoverflow.com/questions/304430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36798/" ]
When running the following code it leaves out one row. When I do a files.Count it says there are 4 rows but there is no data stored for the 4th row. When I run the stored procedure from within SQL Manager it returns all 4 rows and all the data. Any help? ``` List<File> files = new List<File>(); ...
If you are saying your files collection has 4 items, but the 4 item contains no value, what do you mean by that? Is it null, does the object have no data, or does it throw an index out of range exception? Are you doing a files[4] or something like the following? ``` for(int x = 1; x < files.length; x++) { files[...
304,451
<p>I'm trying to avoid code like this when reusing the same ViewUserControl in ASP.NET MVC. Any suggestions?</p> <pre><code>&lt;% if (ViewContext.ViewData["editMode"].ToString() == "edit"){ %&gt; &lt;%= Html.SubmitButton("submit", "Update Brand")%&gt;&lt;span class="or"&gt;Or&lt;/span&gt;&lt;a href="#" class="canc...
[ { "answer_id": 304613, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 5, "selected": true, "text": "<p>I've always created separate views for New and Edit otherwise it feels like my application logic is starting to creep...
2008/11/20
[ "https://Stackoverflow.com/questions/304451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34133/" ]
I'm trying to avoid code like this when reusing the same ViewUserControl in ASP.NET MVC. Any suggestions? ``` <% if (ViewContext.ViewData["editMode"].ToString() == "edit"){ %> <%= Html.SubmitButton("submit", "Update Brand")%><span class="or">Or</span><a href="#" class="cancel">Cancel</a> <% } else { %> <%= Htm...
I've always created separate views for New and Edit otherwise it feels like my application logic is starting to creep into my view. Similarly, I have different controller actions for Create and Update. Perhaps a better way to approach this would be to take the bits that the two view share and move them to a user contro...
304,483
<p>I am writing a text editor which has an option to display a bullet in place of any invisible Unicode character. Unfortunately there appears to be no easy way to determine whether a Unicode character is invisible.</p> <p>I need to find a text file containing every Unicode character in order that I can look through ...
[ { "answer_id": 304490, "author": "Robert Gould", "author_id": 15124, "author_profile": "https://Stackoverflow.com/users/15124", "pm_score": -1, "selected": false, "text": "<p>Its an impossible task, Unicode supports even Klingon, so it's not going to work. However most text editors use t...
2008/11/20
[ "https://Stackoverflow.com/questions/304483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18091/" ]
I am writing a text editor which has an option to display a bullet in place of any invisible Unicode character. Unfortunately there appears to be no easy way to determine whether a Unicode character is invisible. I need to find a text file containing every Unicode character in order that I can look through for invisib...
Oh, I see... actual invisble characters ;) This FAQ will probably be useful: <http://www.unicode.org/faq/unsup_char.html> It lists the current invisible codepoints and has other information that you might find helpful. **EDIT: Added some Cocoa-specific information** Since you're using Cocoa, you can get the unicode...
304,487
<p>I can access my calendar entries as:</p> <pre><code>$folder = $namespace-&gt;Folders("Joe Cool")-&gt;Folders("Calendar"); </code></pre> <p>How do I open "Jane Cool" Calendar? Outlook shows that calendar as:</p> <pre><code>People's Calendar Jane Cool </code></pre>
[ { "answer_id": 304519, "author": "Zoredache", "author_id": 20267, "author_profile": "https://Stackoverflow.com/users/20267", "pm_score": 2, "selected": false, "text": "<p>I believe you are looking for the <a href=\"http://msdn.microsoft.com/en-us/library/aa220116(office.11).aspx\" rel=\"...
2008/11/20
[ "https://Stackoverflow.com/questions/304487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I can access my calendar entries as: ``` $folder = $namespace->Folders("Joe Cool")->Folders("Calendar"); ``` How do I open "Jane Cool" Calendar? Outlook shows that calendar as: ``` People's Calendar Jane Cool ```
I believe you are looking for the [GetSharedDefaultFolder](http://msdn.microsoft.com/en-us/library/aa220116(office.11).aspx)() method.
304,491
<p>How do I check if a field (textbox) is empty or filled only with white spaces (spaces/enters/tabs etc.), using javascript RegExp?</p>
[ { "answer_id": 304500, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 4, "selected": false, "text": "<pre><code>if (myField.value.match(/\\S/)) {\n // field is not empty\n}\n// or\nif (/\\S/.test(myField.value)) {\n // field ...
2008/11/20
[ "https://Stackoverflow.com/questions/304491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How do I check if a field (textbox) is empty or filled only with white spaces (spaces/enters/tabs etc.), using javascript RegExp?
``` if (myField.value.match(/\S/)) { // field is not empty } // or if (/\S/.test(myField.value)) { // field is not empty } ``` Explanation, since other people seem to have some crazy different ideas: `\s` will match a space, tab or new line. `\S` will match anything but a space, tab or new line. If your st...
304,509
<p>Is something like the following possible in PHP?</p> <pre><code>$blah = 'foo1'; class foo2 extends $blah { //... } class foo1 { //... } </code></pre> <p>This gives an error.</p> <p>I want to dynamically set $blah so I can extend whatever class I want.</p> <p><strong>Edit:</strong> The reason for wantin...
[ { "answer_id": 304544, "author": "Jeff Hubbard", "author_id": 8844, "author_profile": "https://Stackoverflow.com/users/8844", "pm_score": 2, "selected": false, "text": "<p>I don't see how this would be particularly useful, but to answer your question... no. There's no way to dynamically ...
2008/11/20
[ "https://Stackoverflow.com/questions/304509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
Is something like the following possible in PHP? ``` $blah = 'foo1'; class foo2 extends $blah { //... } class foo1 { //... } ``` This gives an error. I want to dynamically set $blah so I can extend whatever class I want. **Edit:** The reason for wanting to do this because I wanted to use a function out o...
You're assuming here php executes top to bottom, but it doesn't quite work like that: ``` <?php foo(); # works function foo(){ print "bar"; } ``` --- ``` <?php foo(); #dies if( $i == 1 ) { function foo(){ print "bar"; } } ``` --- ``` <?php $i = 1; if( $i == 1 ) { function foo(){ print "bar"...
304,513
<p>I have a project with 2 subfolders in the App_code folder, one for VB and one for F# (C# files are in the root). I can access the VB classes just fine (via the namespace) but not the F# code. Has anyone had a problem like this and if so how did you fix it?</p> <p>Addendum: F# code that is <em>not</em> in the App_Co...
[ { "answer_id": 304515, "author": "Ana Betts", "author_id": 5728, "author_profile": "https://Stackoverflow.com/users/5728", "pm_score": 0, "selected": false, "text": "<p>Open up the actual generated assemblies via Reflector - see what the actual namespacing is.</p>\n" }, { "answer...
2008/11/20
[ "https://Stackoverflow.com/questions/304513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3927/" ]
I have a project with 2 subfolders in the App\_code folder, one for VB and one for F# (C# files are in the root). I can access the VB classes just fine (via the namespace) but not the F# code. Has anyone had a problem like this and if so how did you fix it? Addendum: F# code that is *not* in the App\_Code folder runs ...
It's been a while since I asked this question but I think it ended up being a problem with the F# compiler not being in $PATH (I had it installed in a non standard location).
304,518
<p>I have this piece of code in my PHP code:</p> <pre><code>while ($row = mysqli_fetch_assoc($result)) { extract($row); echo "&lt;tr&gt;"; echo "&lt;td bgcolor='#FFFFFF'&gt;&lt;input id='bookArray[]' name='bookArray[]' type='checkbox' value='$book_id' /&gt;$book_id&lt;/td&gt;"; echo "&lt;td bgcolor='#F...
[ { "answer_id": 304546, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 0, "selected": false, "text": "<p>You may need to change your PHP as @Tomalak suggests, but you will also need to change your javascript. To referenc...
2008/11/20
[ "https://Stackoverflow.com/questions/304518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have this piece of code in my PHP code: ``` while ($row = mysqli_fetch_assoc($result)) { extract($row); echo "<tr>"; echo "<td bgcolor='#FFFFFF'><input id='bookArray[]' name='bookArray[]' type='checkbox' value='$book_id' />$book_id</td>"; echo "<td bgcolor='#FFFFFF'>$threat_name</td>"; echo "</tr...
easy: `serialize().replace(/%5B%5D/g, '[]')`
304,526
<p>I'm using the WorldPay payment gateway on a website I'm working on. It handles all the credit card authorisation, and then calls a PHP file on my server with information about the transaction. It grabs the output from my script and displays it in the WorldPay chrome.</p> <p>I don't know the inner workings, but I im...
[ { "answer_id": 304556, "author": "Grayside", "author_id": 38408, "author_profile": "https://Stackoverflow.com/users/38408", "pm_score": 0, "selected": false, "text": "<p>Are you sure the path to <code>info.xml</code> is correct? That gets me sometimes when I am including a file from a s...
2008/11/20
[ "https://Stackoverflow.com/questions/304526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
I'm using the WorldPay payment gateway on a website I'm working on. It handles all the credit card authorisation, and then calls a PHP file on my server with information about the transaction. It grabs the output from my script and displays it in the WorldPay chrome. I don't know the inner workings, but I imagine that...
This might be a stretch, but check one of php's number one confusions with relative path resolution. ``` './' ``` is relative to wherever Entrypoint is, not the script, which is why I use ``` dirname(__FILE__).'/' ``` everywhere instead.
304,530
<p>i have two servers a main site and a static server. i want to get a file's content from ajax in runtime, which is stored in static server. obviously cross domain problem will occur.</p> <p>so what i am trying to do is storing that ajax .js in the static server, so that calling the local file wont be a problem.</p>...
[ { "answer_id": 304556, "author": "Grayside", "author_id": 38408, "author_profile": "https://Stackoverflow.com/users/38408", "pm_score": 0, "selected": false, "text": "<p>Are you sure the path to <code>info.xml</code> is correct? That gets me sometimes when I am including a file from a s...
2008/11/20
[ "https://Stackoverflow.com/questions/304530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38578/" ]
i have two servers a main site and a static server. i want to get a file's content from ajax in runtime, which is stored in static server. obviously cross domain problem will occur. so what i am trying to do is storing that ajax .js in the static server, so that calling the local file wont be a problem. but after i ...
This might be a stretch, but check one of php's number one confusions with relative path resolution. ``` './' ``` is relative to wherever Entrypoint is, not the script, which is why I use ``` dirname(__FILE__).'/' ``` everywhere instead.
304,543
<p>I'm trying to perform a simple INSERT and return the identity (auto-incrementing primary key). I've tried</p> <pre><code>cmd.CommandText = "INSERT INTO Prototype ( ParentID ) VALUES ( NULL ); SELECT SCOPE_IDENTITY();"; </code></pre> <p>and I receive the following error</p> <pre>EnvironmentError: SQLite error no s...
[ { "answer_id": 304572, "author": "Robert Wagner", "author_id": 10784, "author_profile": "https://Stackoverflow.com/users/10784", "pm_score": 6, "selected": true, "text": "<p>Check out the <a href=\"http://www.sqlite.org/faq.html#q1\" rel=\"noreferrer\">FAQ</a>. The <a href=\"http://www.s...
2008/11/20
[ "https://Stackoverflow.com/questions/304543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12971/" ]
I'm trying to perform a simple INSERT and return the identity (auto-incrementing primary key). I've tried ``` cmd.CommandText = "INSERT INTO Prototype ( ParentID ) VALUES ( NULL ); SELECT SCOPE_IDENTITY();"; ``` and I receive the following error ``` EnvironmentError: SQLite error no such function: SCOPE_IDENTITY ``...
Check out the [FAQ](http://www.sqlite.org/faq.html#q1). The [sqlite3\_last\_insert\_rowid()](http://www.sqlite.org/c3ref/last_insert_rowid.html) function will do it. Careful of triggers though.
304,567
<p>Im trying to get Trac upp and running on my IIS/w2008 server using this FAQ: <a href="http://trac.edgewall.org/wiki/TracOnWindowsIisAjp" rel="nofollow noreferrer">TracOnWindowsIisAjp</a></p> <p>Everything upp until "3. Install Tomcat AJP Connector for IIS" works ok. I then define my directories as : C:\wwwroot\trac...
[ { "answer_id": 359477, "author": "Erik I", "author_id": 9987, "author_profile": "https://Stackoverflow.com/users/9987", "pm_score": 0, "selected": false, "text": "<p>This seems to be part of the solution:</p>\n\n<p><a href=\"http://www.mastertheboss.com/en/seam/63-jboss-seam-tutorial-1.h...
2008/11/20
[ "https://Stackoverflow.com/questions/304567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37083/" ]
Im trying to get Trac upp and running on my IIS/w2008 server using this FAQ: [TracOnWindowsIisAjp](http://trac.edgewall.org/wiki/TracOnWindowsIisAjp) Everything upp until "3. Install Tomcat AJP Connector for IIS" works ok. I then define my directories as : C:\wwwroot\trac.evju.biz\AJP\, in the bin catalog I place the ...
The best approach is probably to add the Seam library to your existing project, and then gradually refactor your code to take advantage of Seam's features. To do this, work through the [Seam manual](http://docs.jboss.com/seam/2.1.1.GA/reference/en-US/html/) and refactor your code for each Seam feature that simplifies t...
304,570
<p>I am using asp.net mvc for an application. I've taken some guidance from Rob Conery's series on the MVC storefront. I am using a very similar data access pattern to the one that he used in the storefront.</p> <p>However, I have added a small difference to the pattern. Each class I have created in my model has a ...
[ { "answer_id": 304592, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": true, "text": "<p>In your SaveOrder method you are always creating a new ORDER object. You need to change this so that if order.IsNew ...
2008/11/20
[ "https://Stackoverflow.com/questions/304570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29092/" ]
I am using asp.net mvc for an application. I've taken some guidance from Rob Conery's series on the MVC storefront. I am using a very similar data access pattern to the one that he used in the storefront. However, I have added a small difference to the pattern. Each class I have created in my model has a property call...
In your SaveOrder method you are always creating a new ORDER object. You need to change this so that if order.IsNew is false, it retrieves the existing one from the DB and updates it instead. ``` public void SaveOrder(Order order) { ORDER dbOrder; if (order.IsNew) { dbOrder = new ORDER(); d...
304,606
<p>When opening a window, I register a Deleted-event-handler on my business object. It is passed to the constructor as <code>business</code>:</p> <pre><code>business.Deleted += new EventHandler&lt;EventArgs&gt;(business_Deleted); </code></pre> <p>Now the user can click a button to delete it (removing the record, you ...
[ { "answer_id": 304619, "author": "Ed S.", "author_id": 1053, "author_profile": "https://Stackoverflow.com/users/1053", "pm_score": 0, "selected": false, "text": "<p>From the few lines that I see, this could be the problem:</p>\n\n<pre><code>Business business = (Business)businessBindingSo...
2008/11/20
[ "https://Stackoverflow.com/questions/304606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17713/" ]
When opening a window, I register a Deleted-event-handler on my business object. It is passed to the constructor as `business`: ``` business.Deleted += new EventHandler<EventArgs>(business_Deleted); ``` Now the user can click a button to delete it (removing the record, you know). The event handler is registered to c...
If you realy want this behaviour ( I don't think, this is good pattern, bud its not matter ), you can derive from EventArgs class and add property for author of deletion. Then you can do: ``` c.Delete( this ); //this = window // ... void business_Deleted(object sender, EventArgs e) { bool isDeletedFromMe = false; ...
304,607
<p>I am using CSS Tidy. Due to all of its compression measures, in some cases it's messing up my pages by combining or re-arranging selectors, etc. Even with the options shown below, pages with the compressed CSS do not render as they do with the uncompressed.</p> <p>My question is: How can I configure CSS Tidy to com...
[ { "answer_id": 304619, "author": "Ed S.", "author_id": 1053, "author_profile": "https://Stackoverflow.com/users/1053", "pm_score": 0, "selected": false, "text": "<p>From the few lines that I see, this could be the problem:</p>\n\n<pre><code>Business business = (Business)businessBindingSo...
2008/11/20
[ "https://Stackoverflow.com/questions/304607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74552/" ]
I am using CSS Tidy. Due to all of its compression measures, in some cases it's messing up my pages by combining or re-arranging selectors, etc. Even with the options shown below, pages with the compressed CSS do not render as they do with the uncompressed. My question is: How can I configure CSS Tidy to combine all o...
If you realy want this behaviour ( I don't think, this is good pattern, bud its not matter ), you can derive from EventArgs class and add property for author of deletion. Then you can do: ``` c.Delete( this ); //this = window // ... void business_Deleted(object sender, EventArgs e) { bool isDeletedFromMe = false; ...
304,609
<p>Simple question:</p> <p>Can a swing frame be completely modal ( block all others windows ) ?</p> <p>I tried the following, but I can still click on other apps windows ( like this browser ) </p> <pre><code>JDialog myDialog = .... myDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); </code></pre> <p>...
[ { "answer_id": 304702, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 1, "selected": false, "text": "<p>I don't know about global modal, but here's an idea. </p>\n\n<ol>\n<li>Take the screenshot of the desktop.</li>\n<l...
2008/11/20
[ "https://Stackoverflow.com/questions/304609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20654/" ]
Simple question: Can a swing frame be completely modal ( block all others windows ) ? I tried the following, but I can still click on other apps windows ( like this browser ) ``` JDialog myDialog = .... myDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); ``` Plase paste some code if this is possibl...
JFrame is not designed to be modal. Use JDialog for it, but you will loose some JFrame functionality doing so. If you can't live with the loss, you have to block the EventQueue and replace it with your own to only accept events from the blocking one. See [Creating Modal Internal Frames](http://java.sun.com/developer/J...
304,616
<p>Host: GoDaddy Shared Hosting</p> <p>Trust Level: Medium</p> <p>The following happens after I submit a valid user/pass. The database has read/write permissions and when I remove the login requirement on an admin page that updates the database work as expected.</p> <p>Has anyone else had this issue or know what the...
[ { "answer_id": 818870, "author": "JerSchneid", "author_id": 100288, "author_profile": "https://Stackoverflow.com/users/100288", "pm_score": 1, "selected": false, "text": "<p>Have you tried playing around with the permissions of the files and folders in your site? I've had an error on go...
2008/11/20
[ "https://Stackoverflow.com/questions/304616", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3747/" ]
Host: GoDaddy Shared Hosting Trust Level: Medium The following happens after I submit a valid user/pass. The database has read/write permissions and when I remove the login requirement on an admin page that updates the database work as expected. Has anyone else had this issue or know what the problem is? Anyone? `...
If you're using any third party components you might want to check to see if the components are performing some type of security action. A year or so ago I ran into an issue with GoDaddy and the SubSonic ORM, it had a problem with a particular line of code that was requesting a level of security. I cracked open the cod...
304,617
<p>Is there a <code>HTMLHelper</code> for file upload? Specifically, I am looking for a replace of</p> <pre><code>&lt;input type="file"/&gt; </code></pre> <p>using ASP.NET MVC HTMLHelper. </p> <p>Or, If I use </p> <pre><code>using (Html.BeginForm()) </code></pre> <p>What is the HTML control for the file upload? <...
[ { "answer_id": 304899, "author": "Dan Atkinson", "author_id": 31532, "author_profile": "https://Stackoverflow.com/users/31532", "pm_score": 3, "selected": false, "text": "<p>I had this same question a while back and came across one of Scott Hanselman's posts:</p>\n\n<p><a href=\"http://w...
2008/11/20
[ "https://Stackoverflow.com/questions/304617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
Is there a `HTMLHelper` for file upload? Specifically, I am looking for a replace of ``` <input type="file"/> ``` using ASP.NET MVC HTMLHelper. Or, If I use ``` using (Html.BeginForm()) ``` What is the HTML control for the file upload?
**HTML Upload File ASP MVC 3.** **Model**: (*Note that FileExtensionsAttribute is available in MvcFutures. It will validate file extensions client side and server side.*) ``` public class ViewModel { [Required, Microsoft.Web.Mvc.FileExtensions(Extensions = "csv", ErrorMessage = "Specify a CSV file. ...
304,640
<p>Assuming the following class stub:</p> <pre><code>public class Foo&lt;T&gt; { private Class&lt;T&gt; type; public Foo&lt;T&gt; () {} } </code></pre> <p>Can I store the generic type <code>T</code> into the field <code>type</code> in the constructor, without changing the constructor's signature to "<code>public...
[ { "answer_id": 304652, "author": "JTeagle", "author_id": 162171, "author_profile": "https://Stackoverflow.com/users/162171", "pm_score": -1, "selected": false, "text": "<p>Does</p>\n\n<pre><code>type = T.getClass();\n</code></pre>\n\n<p>work?</p>\n" }, { "answer_id": 304659, ...
2008/11/20
[ "https://Stackoverflow.com/questions/304640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238/" ]
Assuming the following class stub: ``` public class Foo<T> { private Class<T> type; public Foo<T> () {} } ``` Can I store the generic type `T` into the field `type` in the constructor, without changing the constructor's signature to "`public Foo<T> (Class<T> type)`"? If yes, how? If no, why? "`type = T`" doe...
No - type erasure means that you have to provide *something* at execution time. You could provide either an instance of `T` or `Class<T>` but the class itself will just have every occurrence of T replaced with `Object`. This kind of thing is one of the biggest disadvantages of Java's generics vs those in .NET. (On the...
304,649
<p>I am trying to create a custom subclass of NSScroller. I have created the class, and set it as the vertical scroller on an NSScrollView in IB. When I run my project, the <code>drawRect:</code> method is called for my subclass, so I know that it is properly connected.</p> <p>Now, How do I change the width of my fanc...
[ { "answer_id": 304743, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 2, "selected": false, "text": "<p>In your NSScroller subclass, you have to override scrollerWidth:</p>\n\n<pre><code>+(CGFloat)scrollerWidth\n{\n r...
2008/11/20
[ "https://Stackoverflow.com/questions/304649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33686/" ]
I am trying to create a custom subclass of NSScroller. I have created the class, and set it as the vertical scroller on an NSScrollView in IB. When I run my project, the `drawRect:` method is called for my subclass, so I know that it is properly connected. Now, How do I change the width of my fancy new NSScroller? No ...
In your NSScroller subclass, you have to override scrollerWidth: ``` +(CGFloat)scrollerWidth { return 30.0; } ``` This is the value that NSScrollView uses to define the frame for your component when it sets it up.
304,655
<p>Say I am declaring a class <code>C</code> and a few of the declarations are very similar. I'd like to use a function <code>f</code> to reduce code repetition for these declarations. It's possible to just declare and use <code>f</code> as usual:</p> <pre><code>&gt;&gt;&gt; class C(object): ... def f(num): ... ...
[ { "answer_id": 304679, "author": "Ali Afshar", "author_id": 28380, "author_profile": "https://Stackoverflow.com/users/28380", "pm_score": 5, "selected": true, "text": "<p>Quite simply, the solution is that f does not need to be a member of the class. I am assuming that your thought-proce...
2008/11/20
[ "https://Stackoverflow.com/questions/304655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39182/" ]
Say I am declaring a class `C` and a few of the declarations are very similar. I'd like to use a function `f` to reduce code repetition for these declarations. It's possible to just declare and use `f` as usual: ``` >>> class C(object): ... def f(num): ... return '<' + str(num) + '>' ... v = f(9) ....
Quite simply, the solution is that f does not need to be a member of the class. I am assuming that your thought-process has gone through a Javaish language filter causing the mental block. It goes a little something like this: ``` def f(n): return '<' + str(num) + '>' class C(object): v = f(9) w = f(42) ...
304,663
<p>I'm going to make an application (in Swing) that uses a tree to visualize a data structure (JTree). A tree will be on the left side of a window. The user will be able to browse a tree. The parameters of every tree node will be displayed on the right side of the window. The example windows will be looking like thi...
[ { "answer_id": 304677, "author": "Touko", "author_id": 28482, "author_profile": "https://Stackoverflow.com/users/28482", "pm_score": 0, "selected": false, "text": "<p>I'm not totally sure what you're after, but..</p>\n\n<p>You could maybe add this \"ok\" button (or \"commit changes\" or ...
2008/11/20
[ "https://Stackoverflow.com/questions/304663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24028/" ]
I'm going to make an application (in Swing) that uses a tree to visualize a data structure (JTree). A tree will be on the left side of a window. The user will be able to browse a tree. The parameters of every tree node will be displayed on the right side of the window. The example windows will be looking like this ``...
Dialogs are bad. Immediately discard any complete nonsense input immediately. For instance, typing a letter in the numerical field (use Document filters). Don't beep. Don't require any particular commit step. You may have retain partially entered data.
304,695
<p>When running the below code a type is never returned, despite there being a class with the correct attribute assigned. In fact the attr array always has a length of 0.</p> <pre><code>Assembly a = Assembly.LoadFile(file); foreach (Type t in a.GetTypes()) { object[] attr = t.GetCustomAttributes(typeof(SchemeNameA...
[ { "answer_id": 304739, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 0, "selected": false, "text": "<p>I suspect you have re-declared the attribute - i.e. the SchemeNameAttribute type is declared (separately) in two a...
2008/11/20
[ "https://Stackoverflow.com/questions/304695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39241/" ]
When running the below code a type is never returned, despite there being a class with the correct attribute assigned. In fact the attr array always has a length of 0. ``` Assembly a = Assembly.LoadFile(file); foreach (Type t in a.GetTypes()) { object[] attr = t.GetCustomAttributes(typeof(SchemeNameAttribute), fal...
You mixed two different contexts of loading assemblies: "Load Context" in which your application is running, and "No context" in which you load secondary assembly from using LoadFile. You want to read [this](http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx) and [that](http://blogs.msdn.com/suzcook/archive/20...
304,749
<p>Apologies in advance for the long-winded question.</p> <p>I'm really a database programmer, but have inherited support of a classic-ASP intranet application which has recently been migrated from IIS 5 to a new server running IIS 6. The user-base is about a dozen, all using IE 6.</p> <p>The UI displays hierarchies ...
[ { "answer_id": 310409, "author": "AnonJr", "author_id": 25163, "author_profile": "https://Stackoverflow.com/users/25163", "pm_score": 0, "selected": false, "text": "<p>You may want to focus your attention on tweaking the caching settings on the client end. If the images are being sent by...
2008/11/20
[ "https://Stackoverflow.com/questions/304749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27825/" ]
Apologies in advance for the long-winded question. I'm really a database programmer, but have inherited support of a classic-ASP intranet application which has recently been migrated from IIS 5 to a new server running IIS 6. The user-base is about a dozen, all using IE 6. The UI displays hierarchies of items returned...
This smacks of an IE6 bug where the browser makes multiple requests for the same resource. For example if the content calls for the display of a small icon repeated 20 times in a list, instead of just fetching that image once, it attempts to fetch it 20 times. OK 19 of the responses are 304 Not Modified but that's stil...
304,777
<p>I'm using Cruise Control .Net 1.4 for Continuous integration and have installed it on my Windows 2000 desktop. I have Nant 0.85 for the Build. My Source control is in Borland Starteam 2005. I have the .Net 2003 framework installed which I use for creating VB.Net windows applications. I have installed CCNet and I thi...
[ { "answer_id": 305087, "author": "balaweblog", "author_id": 22162, "author_profile": "https://Stackoverflow.com/users/22162", "pm_score": 1, "selected": false, "text": "<p>I had challenges in understanding the documentation for installing and configuring CruiseControl.Net with StarTeam a...
2008/11/20
[ "https://Stackoverflow.com/questions/304777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm using Cruise Control .Net 1.4 for Continuous integration and have installed it on my Windows 2000 desktop. I have Nant 0.85 for the Build. My Source control is in Borland Starteam 2005. I have the .Net 2003 framework installed which I use for creating VB.Net windows applications. I have installed CCNet and I think ...
I had challenges in understanding the documentation for installing and configuring CruiseControl.Net with StarTeam as the souce control in a Vista system running IIS 7. Finally I have successfully set up cruise control to work. I am listing the steps to get it working. Step 1:Grab a copy of CruiseControl.Net from here...
304,806
<p>What is the best way to encode URL strings such that they are rfc2396 compliant and to decode a rfc2396 compliant string such that for example %20 is replaced with a space character?</p> <p>edit: URLEncoder and URLDecoder classes do <strong>not</strong> encode/decode rfc2396 compliant URLs, they encode to a MIME ty...
[ { "answer_id": 304991, "author": "Peter Hilton", "author_id": 2670, "author_profile": "https://Stackoverflow.com/users/2670", "pm_score": -1, "selected": false, "text": "<p>Use <a href=\"http://java.sun.com/javase/6/docs/api/java/net/URLEncoder.html\" rel=\"nofollow noreferrer\">java.net...
2008/11/20
[ "https://Stackoverflow.com/questions/304806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18233/" ]
What is the best way to encode URL strings such that they are rfc2396 compliant and to decode a rfc2396 compliant string such that for example %20 is replaced with a space character? edit: URLEncoder and URLDecoder classes do **not** encode/decode rfc2396 compliant URLs, they encode to a MIME type of application/x-www...
Use the URI class as follows: ``` URI uri = new URI("http", "//www.someurl.com/has spaces in url", null); URL url = uri.toURL(); ``` or if you want a String: ``` String urlString = uri.toASCIIString(); ```
304,836
<p>Forgive me for probably using the wrong term for this "application mode".</p> <p>Our application has a problem during start in that it doesn't show a task bar icon until the main window is up, even though there are loading progress windows, logon-windows, etc. on screen before that.</p> <p>We change the code to fi...
[ { "answer_id": 304867, "author": "John Sibly", "author_id": 1078, "author_profile": "https://Stackoverflow.com/users/1078", "pm_score": 5, "selected": true, "text": "<p>Not sure exactly how to do this in delphi, but if you can call out to the user32.dll, and call the function:</p>\n\n<pr...
2008/11/20
[ "https://Stackoverflow.com/questions/304836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267/" ]
Forgive me for probably using the wrong term for this "application mode". Our application has a problem during start in that it doesn't show a task bar icon until the main window is up, even though there are loading progress windows, logon-windows, etc. on screen before that. We change the code to fix this, but unfor...
Not sure exactly how to do this in delphi, but if you can call out to the user32.dll, and call the function: ``` if (GetSystemMetrics(SM_REMOTESESSION) != 0) { // We are in a remote session } ``` This should tell you if you are running in a Citrix or Terminal Services environment. SM\_REMOTESESSION is defined as:...
304,837
<p>I'm trying to find a way with javascript to highlight the text the user selects when they click some odd highlight button (as in &lt;span style="background-color:yellow"&gt;highlighted text&lt;/span&gt;). It only has to work with either WebKit or Firefox, but it seems to be well nigh impossible because it has to wor...
[ { "answer_id": 307229, "author": "foobar", "author_id": 14278, "author_profile": "https://Stackoverflow.com/users/14278", "pm_score": 3, "selected": false, "text": "<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\r\n<div class=\"...
2008/11/20
[ "https://Stackoverflow.com/questions/304837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14278/" ]
I'm trying to find a way with javascript to highlight the text the user selects when they click some odd highlight button (as in <span style="background-color:yellow">highlighted text</span>). It only has to work with either WebKit or Firefox, but it seems to be well nigh impossible because it has to work in the follow...
This answer is probably a few years too late for you, but I faced a similar problem and wanted to document it here, since it is the first hit on google. To reiterate, the **problem** is that you would like to just capture the Range object from the User Selection and surround it with a styled div, like so: ``` functio...
304,844
<p>I'm writing this question in the spirit of answering your own questions, since I found a solution to the problem, but if anyone has a better solution I would gladly listen to it.</p> <p>In the application I am currently working on I am subclassing the ListView control to add some functionality of which some interac...
[ { "answer_id": 304854, "author": "Erik Öjebo", "author_id": 276, "author_profile": "https://Stackoverflow.com/users/276", "pm_score": 4, "selected": true, "text": "<p>The problem seems to be that the SelectedIndices and SelectedItems does not update properly if the ListView has not been ...
2008/11/20
[ "https://Stackoverflow.com/questions/304844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276/" ]
I'm writing this question in the spirit of answering your own questions, since I found a solution to the problem, but if anyone has a better solution I would gladly listen to it. In the application I am currently working on I am subclassing the ListView control to add some functionality of which some interacts with th...
The problem seems to be that the SelectedIndices and SelectedItems does not update properly if the ListView has not been drawn, as is stated in this comment from the MSDN documentation of the [ListViewItem.Selected property](http://msdn.microsoft.com/en-us/library/system.windows.forms.listviewitem.selected(VS.85).aspx)...
304,847
<p>I wish to set a usererror string before leaving a function, depending on the return code and variable in the function.</p> <p>I currently have:</p> <pre><code>Dim RetVal as RetType try ... if ... then RetVal = RetType.FailedParse end try endif ... finally select case RetVal case ... ...
[ { "answer_id": 304860, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": true, "text": "<p>The only real way of doing this in C# would be to declare a variable at the start of the method to hold the value -...
2008/11/20
[ "https://Stackoverflow.com/questions/304847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6684/" ]
I wish to set a usererror string before leaving a function, depending on the return code and variable in the function. I currently have: ``` Dim RetVal as RetType try ... if ... then RetVal = RetType.FailedParse end try endif ... finally select case RetVal case ... UserStr = ... ...
The only real way of doing this in C# would be to declare a variable at the start of the method to hold the value - i.e. ``` SomeType result = default(SomeType); // for "definite assignment" try { // ... return result; } finally { // inspect "result" } ``` In VB, you *might* be able to access the result di...
304,864
<p>I want to check if a variable has a valid year using a regular expression. Reading the <a href="http://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html" rel="noreferrer">bash manual</a> I understand I could use the operator =~</p> <p>Looking at the example below, I would expect to see "not OK"...
[ { "answer_id": 304922, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 8, "selected": true, "text": "<p>It was changed between 3.1 and 3.2:</p>\n<blockquote>\n<p>This is a terse description of the new features added to bas...
2008/11/20
[ "https://Stackoverflow.com/questions/304864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17876/" ]
I want to check if a variable has a valid year using a regular expression. Reading the [bash manual](http://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html) I understand I could use the operator =~ Looking at the example below, I would expect to see "not OK" but I see "OK". What am I doing wrong...
It was changed between 3.1 and 3.2: > > This is a terse description of the new features added to bash-3.2 since the release of bash-3.1. > > > Quoting the string argument to the [[ command's =~ operator now forces string matching, as with the other pattern-matching operators. > > > So use it without the quotes ...
304,883
<p>I just installed a linux system (Kubuntu) and was wondering if there is a program to make python programs executable for linux.</p>
[ { "answer_id": 304896, "author": "Vincent Van Den Berghe", "author_id": 39259, "author_profile": "https://Stackoverflow.com/users/39259", "pm_score": 9, "selected": true, "text": "<p>Just put this in the first line of your script :</p>\n\n<pre><code>#!/usr/bin/env python\n</code></pre>\n...
2008/11/20
[ "https://Stackoverflow.com/questions/304883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I just installed a linux system (Kubuntu) and was wondering if there is a program to make python programs executable for linux.
Just put this in the first line of your script : ``` #!/usr/bin/env python ``` Make the file executable with ``` chmod +x myfile.py ``` Execute with ``` ./myfile.py ```
304,885
<p>I am using MVC architecture for a GUI application. The model class has some C functions. One of the C functions calls some methods of Objective-C class. I call those methods using an object of that class. The strange thing happening is that methods previously to the an xyz method are called perfectly but when that x...
[ { "answer_id": 304959, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 1, "selected": false, "text": "<p>You can definitely run methods on Obj-C objects from a C function, so it's likely there's an error in your cod...
2008/11/20
[ "https://Stackoverflow.com/questions/304885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39270/" ]
I am using MVC architecture for a GUI application. The model class has some C functions. One of the C functions calls some methods of Objective-C class. I call those methods using an object of that class. The strange thing happening is that methods previously to the an xyz method are called perfectly but when that xyz ...
As Marc points out, you're probably using a reference to the OBJC object that is un-initialised outside the objective-c scope. Here's a working sample of C code calling an ObjC object's method: ``` #import <Cocoa/Cocoa.h> id refToSelf; @interface SomeClass: NSObject @end @implementation SomeClass - (void) doNothin...
304,907
<p>I recently discovered Powershell and through that <a href="http://code.google.com/p/psake/" rel="nofollow noreferrer">PSake</a>. If you are using it and you've extended it or created tasks for it, please share!</p>
[ { "answer_id": 304959, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 1, "selected": false, "text": "<p>You can definitely run methods on Obj-C objects from a C function, so it's likely there's an error in your cod...
2008/11/20
[ "https://Stackoverflow.com/questions/304907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6846/" ]
I recently discovered Powershell and through that [PSake](http://code.google.com/p/psake/). If you are using it and you've extended it or created tasks for it, please share!
As Marc points out, you're probably using a reference to the OBJC object that is un-initialised outside the objective-c scope. Here's a working sample of C code calling an ObjC object's method: ``` #import <Cocoa/Cocoa.h> id refToSelf; @interface SomeClass: NSObject @end @implementation SomeClass - (void) doNothin...
304,918
<p>I have a server process built in Delphi/C++Builder with RemObjects SDK which claims to support SOAP requests.</p> <p>What's the quickest and easiest way of testing out the SOAP support? I'd prefer not to have to learn a new language/install a new IDE/spend more than a day...</p> <p>To clarify this, I'm already con...
[ { "answer_id": 305025, "author": "mj2008", "author_id": 5544, "author_profile": "https://Stackoverflow.com/users/5544", "pm_score": 2, "selected": false, "text": "<p>Follow the tutorials on their web site. That worked for me.</p>\n" }, { "answer_id": 305042, "author": "Bruce ...
2008/11/20
[ "https://Stackoverflow.com/questions/304918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
I have a server process built in Delphi/C++Builder with RemObjects SDK which claims to support SOAP requests. What's the quickest and easiest way of testing out the SOAP support? I'd prefer not to have to learn a new language/install a new IDE/spend more than a day... To clarify this, I'm already connecting to the se...
I haven't tried it with RemObjects, but if the server already supports SOAP, I can't think of an easier way to test it than to simply consume the web service using Delphi and call each of the methods. It's surprisingly straight forward. * Create a new application. * In File|New|Other|WebServices choose WSDL Importer. ...
304,940
<p>MS SQL has a convenient workaround for concatenating a column value from multiple rows into one value:</p> <pre><code>SELECT col1 FROM table1 WHERE col2 = 'x' ORDER by col3 FOR XML path('') </code></pre> <p>and that returns a nice recordset:</p> <pre><code>XML_F52E2B61-18A1-11d1-B105-00805F49916B ...
[ { "answer_id": 304980, "author": "kristof", "author_id": 3241, "author_profile": "https://Stackoverflow.com/users/3241", "pm_score": 7, "selected": true, "text": "<p>That should do:</p>\n\n<pre><code>select(\nSELECT col1\n FROM table1\n WHERE col2 = 'x'\n ORDER by col3\n FOR XML path('')...
2008/11/20
[ "https://Stackoverflow.com/questions/304940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4505/" ]
MS SQL has a convenient workaround for concatenating a column value from multiple rows into one value: ``` SELECT col1 FROM table1 WHERE col2 = 'x' ORDER by col3 FOR XML path('') ``` and that returns a nice recordset: ``` XML_F52E2B61-18A1-11d1-B105-00805F49916B ------------...
That should do: ``` select( SELECT col1 FROM table1 WHERE col2 = 'x' ORDER by col3 FOR XML path('') ) as myName ``` Not pretty but should give the result that you need
304,967
<p>Are there any utilities that can examine a set of managed assemblies and tell you whether any of the types in one namespace depend on any in another? For example, say I have a <code>MyApp.BusinessRules</code> namespace and don't want it to access directly anything in <code>MyApp.GUI</code>, but both namespaces are ...
[ { "answer_id": 304972, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "<p>I suspect NDepend is going to be the simplest way to go, to be honest.</p>\n\n<p>However, if you really don't want bi...
2008/11/20
[ "https://Stackoverflow.com/questions/304967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7532/" ]
Are there any utilities that can examine a set of managed assemblies and tell you whether any of the types in one namespace depend on any in another? For example, say I have a `MyApp.BusinessRules` namespace and don't want it to access directly anything in `MyApp.GUI`, but both namespaces are in the same assembly. My g...
> > So far the only tool I have come across that looks like it might do this is NDepend, but I am wondering if there is a simpler solution. > > > I am one of the developer of the tool [NDepend](http://www.NDepend.com). Please could you let us know what do you find complicated in NDepend and how you imagine a simpl...
304,979
<p>Since there is no <code>finally</code> in C++ <a href="http://www.research.att.com/~bs/bs_faq2.html#finally" rel="noreferrer">you have to use the RAII</a> design pattern instead, if you want your code to be exception safe. One way to do this is by using the destructor of a local class like this:</p> <pre><code>void...
[ { "answer_id": 305019, "author": "Pieter", "author_id": 5822, "author_profile": "https://Stackoverflow.com/users/5822", "pm_score": 3, "selected": false, "text": "<p>I don't think there is a cleaner way to achieve what you're trying to do, but I think the main problem with the 'finally a...
2008/11/20
[ "https://Stackoverflow.com/questions/304979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36372/" ]
Since there is no `finally` in C++ [you have to use the RAII](http://www.research.att.com/~bs/bs_faq2.html#finally) design pattern instead, if you want your code to be exception safe. One way to do this is by using the destructor of a local class like this: ``` void foo() { struct Finally { ~Finally() { /*...
Instead of defining `struct Finally`, you could extract your cleanup code in a function of the class `Task` and use Loki's [ScopeGuard](http://loki-lib.sourceforge.net/index.php?n=Idioms.ScopeGuardPointer). ``` ScopeGuard guard = MakeGuard(&Task::cleanup, task); ``` See also this [DrDobb's article](http://www.ddj.co...
304,986
<p>I have a GSM modem connected via USB. The modem creates 2 serial ports. The first is automatically attached to the modem, the second shows in Device Manager as "HUAWEI Mobile Connect - 3G PC UI Interface (COM6)"</p> <p>The second port is used to get vital information from the modem, such as signal quality; to sen...
[ { "answer_id": 305013, "author": "Will Dean", "author_id": 987, "author_profile": "https://Stackoverflow.com/users/987", "pm_score": 3, "selected": false, "text": "<p>A long time ago I wrote a utility for a client to do just this, but for a GPS rather than a modem. </p>\n\n<p>I have jus...
2008/11/20
[ "https://Stackoverflow.com/questions/304986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6389/" ]
I have a GSM modem connected via USB. The modem creates 2 serial ports. The first is automatically attached to the modem, the second shows in Device Manager as "HUAWEI Mobile Connect - 3G PC UI Interface (COM6)" The second port is used to get vital information from the modem, such as signal quality; to send and receiv...
The information posted by [Will Dean](https://stackoverflow.com/users/987/will-dean) was most helpful. This is the code that eventually worked for me. Everything in the PInvoke class was taken verbatim from <http://www.pinvoke.net> . I did have to change a data type here or there to make it work (like when using an enu...
304,994
<p>The web service endpoint usually is defined in an early stage of a project. Since it follows the "contract first" principle, it shouldn't be changed after communicated to client systems.</p> <p>Therefore, it is vital to label the web service in a good way.</p> <p>How would you label web services?</p> <p>e.g.</p> ...
[ { "answer_id": 315549, "author": "Kaiser Advisor", "author_id": 32462, "author_profile": "https://Stackoverflow.com/users/32462", "pm_score": 3, "selected": true, "text": "<p>We decide on names by talking to the developers, business guys, and support guys. We formed a committee called th...
2008/11/20
[ "https://Stackoverflow.com/questions/304994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25842/" ]
The web service endpoint usually is defined in an early stage of a project. Since it follows the "contract first" principle, it shouldn't be changed after communicated to client systems. Therefore, it is vital to label the web service in a good way. How would you label web services? e.g. ``` http://my.domain.com/bu...
We decide on names by talking to the developers, business guys, and support guys. We formed a committee called the "interface control committee", and we approach it kind of like you described in the question. We want service names to be descriptive, reflect the processes they support, and fit the needs of the technical...
304,996
<p>I'm trying to read a Paradox 5 table into a dataset or simular data structure with the view to putting it into an SQL server 2005 table. I've trawled google and SO but with not much luck. I've tried ODBC:</p> <pre><code>public void ParadoxGet() { string ConnectionString = @"Driver={Microsoft Paradox Driver (*.d...
[ { "answer_id": 305041, "author": "MysticSlayer", "author_id": 28139, "author_profile": "https://Stackoverflow.com/users/28139", "pm_score": 1, "selected": false, "text": "<p>Maybe this will help you out,</p>\n\n<p><a href=\"http://support.microsoft.com/support/kb/articles/Q237/9/94.ASP?L...
2008/11/20
[ "https://Stackoverflow.com/questions/304996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm trying to read a Paradox 5 table into a dataset or simular data structure with the view to putting it into an SQL server 2005 table. I've trawled google and SO but with not much luck. I've tried ODBC: ``` public void ParadoxGet() { string ConnectionString = @"Driver={Microsoft Paradox Driver (*.db )};DriverID=...
I've had the same error. It appeared when I started my C# project on Win2008 64 (previos OS was Win2003 32). Also I found out that it worked fine in console apps and gave different errors in winforms. It seems that problem comes from the specifics of 32 ODBC driver working on 64-bit systems. My solution was: ``` // Pr...
304,997
<p>I have following situation: I have loged user, standard authentication with DB table </p> <pre><code>$authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); $authAdapter-&gt;setTableName('users'); $authAdapter-&gt;setIdentityColumn('user_name'); $authAdapter-&gt;setCredentialColumn('pas...
[ { "answer_id": 305048, "author": "Martin Rázus", "author_id": 39014, "author_profile": "https://Stackoverflow.com/users/39014", "pm_score": 2, "selected": false, "text": "<p>I have done it like this, it works, but I don't know if there is not some better way,how to do it </p>\n\n<pre><co...
2008/11/20
[ "https://Stackoverflow.com/questions/304997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39014/" ]
I have following situation: I have loged user, standard authentication with DB table ``` $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); $authAdapter->setTableName('users'); $authAdapter->setIdentityColumn('user_name'); $authAdapter->setCredentialColumn('password'); ``` When us...
Your best bet would be to not use Zend\_Auth's storage to hold information that's likely to change - by default it only holds the identity (for good reason). I'd probably make a User class that wrapped all the Auth, ACL (and probably profile) functionality that uses a static get\_current() method to load the user stash...
305,035
<p>I have to run a local shell script (windows/Linux) on a remote machine.</p> <p>I have SSH configured on both machine A and B. My script is on machine A which will run some of my code on a remote machine, machine B.</p> <p>The local and remote computers can be either Windows or Unix based system.</p> <p>Is there a wa...
[ { "answer_id": 305054, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 7, "selected": false, "text": "<pre><code>&lt;hostA_shell_prompt&gt;$ ssh user@hostB \"ls -la\"\n</code></pre>\n\n<p>That will prompt you for passw...
2008/11/20
[ "https://Stackoverflow.com/questions/305035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have to run a local shell script (windows/Linux) on a remote machine. I have SSH configured on both machine A and B. My script is on machine A which will run some of my code on a remote machine, machine B. The local and remote computers can be either Windows or Unix based system. Is there a way to run do this usin...
If Machine A is a Windows box, you can use Plink (part of [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/)) with the -m parameter, and it will execute the local script on the remote server. ``` plink root@MachineB -m local_script.sh ``` If Machine A is a Unix-based system, you can use: ``` ssh root@Machi...
305,037
<p>Last time I create WAS profile and WASService then I try to config and run many script for learn how to config WAS, Finally it crash so i use wasprofile delete this profile and forgot delete WASService.</p> <p>Now I found IBM Webphere Application Server service display in services.msc list, so I tried to delete it ...
[ { "answer_id": 305075, "author": "StingyJack", "author_id": 16391, "author_profile": "https://Stackoverflow.com/users/16391", "pm_score": 8, "selected": false, "text": "<p>make sure the service is stopped, the services control panel is closed, and no open file handles are open by the ser...
2008/11/20
[ "https://Stackoverflow.com/questions/305037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24550/" ]
Last time I create WAS profile and WASService then I try to config and run many script for learn how to config WAS, Finally it crash so i use wasprofile delete this profile and forgot delete WASService. Now I found IBM Webphere Application Server service display in services.msc list, so I tried to delete it with `WASS...
make sure the service is stopped, the services control panel is closed, and no open file handles are open by the service. Also make sure ProcessExplorer is not running.
305,064
<p>I'm trying to build a console application without using the CRT, or any other imports than kernel32.lib in any case. I get my code to compile, but can't wrap the linker around a few problems:</p> <pre><code>unresolved external symbol @__security_check_cookie@4 unresolved external symbol "int __cdecl FreeLibrary(voi...
[ { "answer_id": 305079, "author": "SoapBox", "author_id": 36384, "author_profile": "https://Stackoverflow.com/users/36384", "pm_score": 1, "selected": false, "text": "<p>You can look in Windows.h to see the prototypes you need for your kernel32 imports. In general, windows functions are ...
2008/11/20
[ "https://Stackoverflow.com/questions/305064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15477/" ]
I'm trying to build a console application without using the CRT, or any other imports than kernel32.lib in any case. I get my code to compile, but can't wrap the linker around a few problems: ``` unresolved external symbol @__security_check_cookie@4 unresolved external symbol "int __cdecl FreeLibrary(void *)" (?FreeLi...
\_wmainCRTStartup is the function that calls wmain() IIRC it should be available in some .o file that you can link with, look in your lib directory. Maybe this is useful reading too: [Reduce EXE and DLL Size with LIBCTINY.LIB](http://msdn.microsoft.com/en-us/magazine/cc301696.aspx) (and Matt Pietrek rocks :-)
305,081
<p>For the following header I get the same two errors on all my sitemaps. It's confusing because, if Google can't read my sitemap, then how can they say that each URL has the same priority? The header counts as line 2, after the XML declaration. Google claims only to have indexed about 2% of the URLs from the maps. ...
[ { "answer_id": 305091, "author": "TToni", "author_id": 20703, "author_profile": "https://Stackoverflow.com/users/20703", "pm_score": 4, "selected": true, "text": "<p>Have you validated your XML against the schema given here: <a href=\"http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.x...
2008/11/20
[ "https://Stackoverflow.com/questions/305081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33287/" ]
For the following header I get the same two errors on all my sitemaps. It's confusing because, if Google can't read my sitemap, then how can they say that each URL has the same priority? The header counts as line 2, after the XML declaration. Google claims only to have indexed about 2% of the URLs from the maps. Please...
Have you validated your XML against the schema given here: <http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd> If yes, what was the result? If not, what is the URL of your sitemap? If you don't know how to validate the XML against the schema, use <http://www.xmlvalidation.com/> Paste the sitemap-XML there, cl...
305,088
<p>I have a loader.exe with Main() that loads the 'UI' in WPF, the thing is that I want only one instance of the loader.exe, how can I achieve it? </p> <p>Is there a way a user clicks loader.exe it should check if an existing loader.exe is running and does nothing.</p> <p>currently I have </p> <p>loader.exe </p> <p...
[ { "answer_id": 305201, "author": "Winston Smith", "author_id": 35086, "author_profile": "https://Stackoverflow.com/users/35086", "pm_score": 2, "selected": false, "text": "<p>Have a look at:</p>\n\n<p><a href=\"http://yogesh.jagotagroup.com/blog/post/2008/07/03/Ways-of-making-a-WPF-appli...
2008/11/20
[ "https://Stackoverflow.com/questions/305088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39278/" ]
I have a loader.exe with Main() that loads the 'UI' in WPF, the thing is that I want only one instance of the loader.exe, how can I achieve it? Is there a way a user clicks loader.exe it should check if an existing loader.exe is running and does nothing. currently I have loader.exe with ``` main() .... .. Loa...
We use the following C# code to detect if an application is already running: ``` using System.Threading; string appSpecificGuid = "{007400FE-003D-00A5-AFFE-DA62E35CC1F5}"; bool exclusive; Mutex m = new Mutex(true, appSpecificGuid, out exclusive); if (exclusive) { // run } else { // already running } ``` ...
305,105
<p>On my app i am creating a real time trace (not sure how yet but i am!) and on the sp_trace_create function in SQlServer, i know that the @maxfilesize defaults to 5, but on my app its going to be stopped when the user wants to stop it...any ideas how this can be done?</p> <hr> <p>Because i dont want to have to save...
[ { "answer_id": 305110, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 2, "selected": true, "text": "<p>To start a trace with file rollover, instead of stopping at a maximum size, start the trace like so:</p>\n\n<pre><co...
2008/11/20
[ "https://Stackoverflow.com/questions/305105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36243/" ]
On my app i am creating a real time trace (not sure how yet but i am!) and on the sp\_trace\_create function in SQlServer, i know that the @maxfilesize defaults to 5, but on my app its going to be stopped when the user wants to stop it...any ideas how this can be done? --- Because i dont want to have to save the file...
To start a trace with file rollover, instead of stopping at a maximum size, start the trace like so: ``` exec @rc = sp_trace_create @TraceID output, 2, N'InsertFileNameHere', @maxfilesize, NULL ``` where @maxfilesize will define the size reached before a new rollover file will be created. **WARNING**: be very care...
305,125
<p>I have created a class to dynamically put together SQL function statements within a project. I have found this class to be pretty useful and would like to incorporate into future projects</p> <p>namespace connectionClass</p> <p>{</p> <pre><code> public class connClass { NpgsqlConnection conn = new N...
[ { "answer_id": 305198, "author": "Chris Kimpton", "author_id": 48310, "author_profile": "https://Stackoverflow.com/users/48310", "pm_score": 0, "selected": false, "text": "<p>One option is to have the connection class use the ConfigurationManager to get the name from the App.Config file ...
2008/11/20
[ "https://Stackoverflow.com/questions/305125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have created a class to dynamically put together SQL function statements within a project. I have found this class to be pretty useful and would like to incorporate into future projects namespace connectionClass { ``` public class connClass { NpgsqlConnection conn = new NpgsqlConnection(projectName....
Or simply make use of the Configuration Manager Connection Strings property: ``` String connStr = ConfigurationManager.ConnectionStrings["DefaultConnStr"].ConnectionString; ``` Then setup your app.config like so: ``` <configuration> <connectionStrings> <add name="DefaultConnStr" connectionString="Data ...
305,152
<p>I have a folder checked out using TortoiseSVN. If I copy a newer version of a file over the existing versioned file, TortoiseSVN correctly identifies that the file is modified. However when I do a "diff with previous version", it reports "no differences".</p> <p>If I use WinMerge I can see that the files ARE diffe...
[ { "answer_id": 305160, "author": "Nerdfest", "author_id": 7855, "author_profile": "https://Stackoverflow.com/users/7855", "pm_score": 2, "selected": false, "text": "<p>It may be your 'ignore white space' settings. If one is set to true, and this other is not, this behaviour will occur.</...
2008/11/20
[ "https://Stackoverflow.com/questions/305152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39296/" ]
I have a folder checked out using TortoiseSVN. If I copy a newer version of a file over the existing versioned file, TortoiseSVN correctly identifies that the file is modified. However when I do a "diff with previous version", it reports "no differences". If I use WinMerge I can see that the files ARE different. Does...
Diff with previous is a different command than looking what changed in your workingcopy. Previous is defined to be the version before the version you have in your workingcopy: ``` A revision argument can be one of: NUMBER revision number '{' DATE '}' rev...
305,177
<p>I am using this HTML</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;Title&gt;EBAY Search&lt;/title&gt; &lt;/head&gt; &lt;script language="JavaScript" src="ajaxlib.js"&gt;&lt;/script&gt; &lt;body&gt; Click here &lt;a href="#" OnClick="GetEmployee()"&gt;link&lt;/a&gt; to show content ...
[ { "answer_id": 305210, "author": "angus", "author_id": 36925, "author_profile": "https://Stackoverflow.com/users/36925", "pm_score": 0, "selected": false, "text": "<p>var url=\"get_employee.php\" <strong><em>+ \"?\"</em></strong></p>\n\n<p>(answering the comment)</p>\n\n<p><em>What</em> ...
2008/11/20
[ "https://Stackoverflow.com/questions/305177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
I am using this HTML ``` <html> <head> <Title>EBAY Search</title> </head> <script language="JavaScript" src="ajaxlib.js"></script> <body> Click here <a href="#" OnClick="GetEmployee()">link</a> to show content <div id="Result"><The result will be fetched here></div> </body> ...
use a javascript debugging tool like firebug, this will make your life simpler. you had a syntax error in your code that made the error "GetEmployee is not defined" it was a missing "catch" after the last try in "GetXmlHttpObject()". this is the same function after adding the missing "catch". ``` function GetXmlHttp...
305,179
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/210564/pdo-prepared-statements">PDO Prepared Statements</a> </p> </blockquote> <p>I'm using the mysqli extension in PHP and I'm wondering, is there possibly any way to see a prepared query as it will be execute...
[ { "answer_id": 305224, "author": "Alexandru Luchian", "author_id": 32188, "author_profile": "https://Stackoverflow.com/users/32188", "pm_score": 0, "selected": false, "text": "<p>See it where?\nIf it's your code you have the query and you have the prepared parameters, log them separately...
2008/11/20
[ "https://Stackoverflow.com/questions/305179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6615/" ]
> > **Possible Duplicate:** > > [PDO Prepared Statements](https://stackoverflow.com/questions/210564/pdo-prepared-statements) > > > I'm using the mysqli extension in PHP and I'm wondering, is there possibly any way to see a prepared query as it will be executed on the server, e.g. The query is something like t...
**Duplicate of [PDO Prepared Statements](https://stackoverflow.com/questions/210564/pdo-prepared-statements)** Short answer: no. A prepared query will never be converted to the query you expect. It's executed directly by the database server. You can use mysql's query log or PDO's undocumented function `debugDumpParams...
305,220
<p>I can´t find a way to restyle the IsChecked indicator of a checkbox. As I can see from the checkbox template there´s no possibilities to restyle the indicator, just the "box" of the checkbox. Does anyone knows if it´s possibly to restyle the IsChecked indicator?</p>
[ { "answer_id": 305243, "author": "stusmith", "author_id": 6604, "author_profile": "https://Stackoverflow.com/users/6604", "pm_score": 1, "selected": false, "text": "<p>You might find the following discussion helpful:</p>\n\n<p><a href=\"http://social.msdn.microsoft.com/Forums/en-US/wpf/t...
2008/11/20
[ "https://Stackoverflow.com/questions/305220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37271/" ]
I can´t find a way to restyle the IsChecked indicator of a checkbox. As I can see from the checkbox template there´s no possibilities to restyle the indicator, just the "box" of the checkbox. Does anyone knows if it´s possibly to restyle the IsChecked indicator?
You will have to replace the entire CheckBox control template. Start with the ChekcBox ControlTemplate MSDN example at <http://msdn.microsoft.com/en-us/library/ms752319.aspx> In the example you'll see this element: ``` <Path Width="7" Height="7" x:Name="CheckMark" SnapsToDevicePixels="False" Stroke="{StaticResour...
305,239
<p>Is it necessary for setter methods to have one argument? Usually setter methods accept one argument as the value of a certain property of an Object. What if I want to test first the validity which depends on another argument which is a boolean, if true, validate first, else just set the value.</p> <p>I am getting t...
[ { "answer_id": 305247, "author": "Marko", "author_id": 31141, "author_profile": "https://Stackoverflow.com/users/31141", "pm_score": 3, "selected": false, "text": "<p>By Java Bean specification setter have one argument. If you add another one, for whatever reason, it is not considered se...
2008/11/20
[ "https://Stackoverflow.com/questions/305239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37740/" ]
Is it necessary for setter methods to have one argument? Usually setter methods accept one argument as the value of a certain property of an Object. What if I want to test first the validity which depends on another argument which is a boolean, if true, validate first, else just set the value. I am getting the values ...
It is necessary specifically in the java bean framework model, but it s not mandatory in general. You can have setter with no argument when they are meant to "swith" a value. ``` void setCheck() ``` could for instance be meant to set the "check" boolean attribute to true. So even if it is not a "setter" in the jav...
305,244
<p>When reading a stack trace like:</p> <pre class="lang-none prettyprint-override"><code>[FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal) +2755599 System.Number.Parse...
[ { "answer_id": 305257, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "<p>I believe they're offsets into the code of the method - whether IL or JIT-compiled-assembly bytes, I'm not sure...</p...
2008/11/20
[ "https://Stackoverflow.com/questions/305244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12389/" ]
When reading a stack trace like: ```none [FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2755599 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo ...
It means: > > it’s an offset into the native instructions for the method. > > > Read [this](http://odetocode.com/blogs/scott/archive/2005/01/24/funny-numbers-in-my-stack-trace.aspx) for more details.
305,263
<p>I have two Spring proxies set up:</p> <pre><code> &lt;bean id="simpleBean" class="org.springframework.aop.framework.ProxyFactoryBean"&gt; &lt;property name="target"&gt; &lt;ref local="simpleBeanTarget"/&gt; &lt;/property&gt; &lt;property name="interceptorNames"&gt; &lt;list&gt; ...
[ { "answer_id": 314762, "author": "MikeHoss", "author_id": 39188, "author_profile": "https://Stackoverflow.com/users/39188", "pm_score": 1, "selected": false, "text": "<p>It was easy to fix, once I figured it out. SpringDao no longer inherits from JdbcDaoSupport and now it works.</p>\n" ...
2008/11/20
[ "https://Stackoverflow.com/questions/305263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39188/" ]
I have two Spring proxies set up: ``` <bean id="simpleBean" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="target"> <ref local="simpleBeanTarget"/> </property> <property name="interceptorNames"> <list> <value>cacheInterceptor</value> </list...
If the target of your proxy implements at least one interface then Spring's default behavior is to create a JDK Proxy that implements all the interfaces of the target. This means it will not be a subclass of the target class. You can override this by forcing the creation of CGLIB proxies instead which are dynamic subcl...
305,265
<p>I am using Delphi 7 and ICS components to communicate with php script and insert some data in mysql database...</p> <p>How to post unicode data using http post ?</p> <p>After using utf8encode from tnt controls I am doing it to post to PHP script </p> <pre><code>&lt;?php echo "Note = ". $_POST['note']; if($_POST[...
[ { "answer_id": 305273, "author": "bugmagnet", "author_id": 426, "author_profile": "https://Stackoverflow.com/users/426", "pm_score": 0, "selected": false, "text": "<p>I would expect (without knowing for sure) that you'd have to output them as &amp;#nnnnn entities (with the number in deci...
2008/11/20
[ "https://Stackoverflow.com/questions/305265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27016/" ]
I am using Delphi 7 and ICS components to communicate with php script and insert some data in mysql database... How to post unicode data using http post ? After using utf8encode from tnt controls I am doing it to post to PHP script ``` <?php echo "Note = ". $_POST['note']; if($_POST['action'] == 'i') { /* ...
Your example code shows your data coming from a TNT Unicode control. That value will have type `WideString`, so to get UTF-8 data, you should call `Utf8Encode`, which will return an `AnsiString` value. Then call `UrlEncode` on that value. Make sure `UrlEncode`'s input type is `AnsiString`. So, something like this: ```...
305,275
<p>I am putting together a build system and wanted to know if there is a reliable way to find out if a checked out SVN folder needs updating (i.e. is it out of sync with the repository). I want to avoid a nightly build unless something has changed. I could write a script that parses the results of the <code>svn updat...
[ { "answer_id": 305294, "author": "flolo", "author_id": 36472, "author_profile": "https://Stackoverflow.com/users/36472", "pm_score": 5, "selected": true, "text": "<p>Use the <a href=\"http://www.visualsvn.com/support/svnbook/ref/svn/#svn.ref.svn.sw.show_updates\" rel=\"noreferrer\">show ...
2008/11/20
[ "https://Stackoverflow.com/questions/305275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
I am putting together a build system and wanted to know if there is a reliable way to find out if a checked out SVN folder needs updating (i.e. is it out of sync with the repository). I want to avoid a nightly build unless something has changed. I could write a script that parses the results of the `svn update` command...
Use the [show updates option](http://www.visualsvn.com/support/svnbook/ref/svn/#svn.ref.svn.sw.show_updates) of the status command: ``` svn status -u ``` or ``` svn status --show-updates ```
305,293
<p>Paragraph 6.7.3.8 of the C99 spec states</p> <blockquote>If the specification of an array type includes any type qualifiers, the element type is so-qualified, not the array type. If the specification of a function type includes any type qualifiers, the behavior is undefined. </blockquote> <p>In the <a href="http://www.o...
[ { "answer_id": 305333, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 0, "selected": false, "text": "<p>The situation is awkward with pointers (ie, arrays), but here's my recollection of the details:</p>\n\n<p><code>const ...
2008/11/20
[ "https://Stackoverflow.com/questions/305293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33208/" ]
Paragraph 6.7.3.8 of the C99 spec states > If the specification of an array type includes any type qualifiers, the element type is so-qualified, not the array type. If the specification of a function type includes any type qualifiers, the behavior is undefined. In the [rationale](http://www.open-std.org/jtc1/sc22/wg14/www...
This is a known issue that has been discussed several times over the last 10 years at comp.std.c. The bottom line is that the specific case you presented is not currently legal in Standard C; you need to either remove the qualifier or refrain from using a pointer to an array to refer to the qualified elements in the ar...
305,307
<p>This code works perfectly</p> <pre><code>myNotebook = new wxNotebook( this, IDC_NOTEBOOK, wxDefaultPosition, wxSize(500, 500) ); myNotebook-&gt;AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 1" ); myNotebook-&gt;AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 2" ); myNot...
[ { "answer_id": 306042, "author": "ravenspoint", "author_id": 16582, "author_profile": "https://Stackoverflow.com/users/16582", "pm_score": 1, "selected": false, "text": "<p>After experimentation, I found this way:</p>\n\n<p>Add one line, after all the AddPage() calls</p>\n\n<pre><code> ...
2008/11/20
[ "https://Stackoverflow.com/questions/305307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16582/" ]
This code works perfectly ``` myNotebook = new wxNotebook( this, IDC_NOTEBOOK, wxDefaultPosition, wxSize(500, 500) ); myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 1" ); myNotebook->AddPage( new wxNotebookPage( myNotebook, -1 ), L"TEST RECOMMENDATIONS 2" ); myNotebook->AddPage( new ...
Finally, found an elegant solution. I need to force a refresh after resizing. ``` void MyFrame::OnSize(wxSizeEvent& ) { if( myNotebook ) { myNotebook->SetSize( GetClientRect() ); myNotebook->Refresh(); } } ```
305,313
<p>I created a simple batch file (.bat) containing a bunch of commands to be triggered automatically into the command window. The batch looks like this:</p> <pre><code>mmd dll1.dll -mf -aW mmd dll2.dll -mf -aW mmd dll3.dll -mf -aW </code></pre> <p>If I copy and paste the bunch of cmds into the command window, they ar...
[ { "answer_id": 305325, "author": "George Stocker", "author_id": 16587, "author_profile": "https://Stackoverflow.com/users/16587", "pm_score": 0, "selected": false, "text": "<p>Are you putting quotes around the file names you are calling? And are the file names on different lines? (If not...
2008/11/20
[ "https://Stackoverflow.com/questions/305313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35061/" ]
I created a simple batch file (.bat) containing a bunch of commands to be triggered automatically into the command window. The batch looks like this: ``` mmd dll1.dll -mf -aW mmd dll2.dll -mf -aW mmd dll3.dll -mf -aW ``` If I copy and paste the bunch of cmds into the command window, they are all correctly executed. ...
It is executing the dragged in file with a path relative to the .bat file (and not where those dlls actually are)?
305,320
<p>I'm trying to learn Actionscript 2 or 3, with AS2 I eventually figured by trial and error that I could get any named instance and modify it using a string with its name using</p> <pre><code>var theinstance = "titletext"; // actually exctracted from an array _root[theinstance].htmlText = "New text with &lt;b&gt;HTML...
[ { "answer_id": 305347, "author": "Matt Howell", "author_id": 2321, "author_profile": "https://Stackoverflow.com/users/2321", "pm_score": 2, "selected": false, "text": "<p>\"flash.display.DisplayObject\" is not literally part of the actual code that you call. Rather, the documentation is...
2008/11/20
[ "https://Stackoverflow.com/questions/305320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26115/" ]
I'm trying to learn Actionscript 2 or 3, with AS2 I eventually figured by trial and error that I could get any named instance and modify it using a string with its name using ``` var theinstance = "titletext"; // actually exctracted from an array _root[theinstance].htmlText = "New text with <b>HTML!</b>"; ``` but wh...
Just use either "root" (no underscore) or "stage" depending on exactly what you want to do. However - Why not just store a reference to the textField in the array instead of a string?
305,345
<p>This may or may not be a multi-interface problem, but I'm doing something like this:</p> <pre><code>var mockInterface1 = new Mock&lt;IInterface1&gt;(); var mockInterface2 = mockInterface1.As&lt;IInterface2&gt;(); mockInterface1.Expect( foo =&gt; foo.Foo(It.IsAny&lt;IInterface3&gt;() ) ); ... otherObject.DoSomethi...
[ { "answer_id": 306009, "author": "Steve Dunn", "author_id": 28901, "author_profile": "https://Stackoverflow.com/users/28901", "pm_score": 0, "selected": false, "text": "<p>I know this isn't an answer as such, but it does sound like a bug in MOQ. What version are you using? I just tried...
2008/11/20
[ "https://Stackoverflow.com/questions/305345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29021/" ]
This may or may not be a multi-interface problem, but I'm doing something like this: ``` var mockInterface1 = new Mock<IInterface1>(); var mockInterface2 = mockInterface1.As<IInterface2>(); mockInterface1.Expect( foo => foo.Foo(It.IsAny<IInterface3>() ) ); ... otherObject.DoSomething( (IInterface1)mockInterface2.Obj...
I found this link: [Castle Project Topic](http://forum.castleproject.org/viewtopic.php?p=14322&sid=6327e0e0b3a61cff948bf2d35a9e923d) which seems to indicate that its a problem in Castle's DynamicProxy, which is used by Moq (and RhinoMocks).
305,349
<p>I have seen that there is a NVL function for PL/SQL that substitutes a value when null is encountered.<br> But what if I want to set a field to NULL, e.g. </p> <pre><code>EXEC SQL UPDATE mytable SET myfield=NULL WHERE otherValue=1; </code></pre> <p>When I run this with C++ on HPUX, 0L is used for null while on Lin...
[ { "answer_id": 305363, "author": "Dave Costa", "author_id": 6568, "author_profile": "https://Stackoverflow.com/users/6568", "pm_score": 1, "selected": false, "text": "<p>NULL is the correct value in Oracle. I have no experience in calling Oracle from C++ so I don't know what the cause o...
2008/11/20
[ "https://Stackoverflow.com/questions/305349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have seen that there is a NVL function for PL/SQL that substitutes a value when null is encountered. But what if I want to set a field to NULL, e.g. ``` EXEC SQL UPDATE mytable SET myfield=NULL WHERE otherValue=1; ``` When I run this with C++ on HPUX, 0L is used for null while on Linux the statement fails with...
Oh, now I realize what must be happening. The C++ system headers have `#define NULL 0L` (in HPUX) and so the hardcoded NULL is being replaced with that value by the preprocessor. Several ideas: * Simply change the case of NULL in the SQL statement. Oracle doesn't care about the case, and if it doesn't match the defin...
305,357
<p>Okay i am working on someone elses code. They do alot of this:</p> <pre><code>char description[256]; description[0]=0; </code></pre> <p>I know this would put a \0 in the first spot of the character array. But is this even a safe way to erase a string?</p> <p>Also visual studio keeps reporting memory leaks, and i'...
[ { "answer_id": 305365, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 2, "selected": false, "text": "<p>This string is allocated on the stack, so there's no way to free the memory it uses until the function that it's called...
2008/11/20
[ "https://Stackoverflow.com/questions/305357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34395/" ]
Okay i am working on someone elses code. They do alot of this: ``` char description[256]; description[0]=0; ``` I know this would put a \0 in the first spot of the character array. But is this even a safe way to erase a string? Also visual studio keeps reporting memory leaks, and i've pretty much tied this done to ...
To *initialize* the string to 0, you could do: ``` char description[256] = {0}; ``` that will assign 0 to every element of the array. Just setting the first element to `0` (`'\0'`) does not erase it's contents. It doesn't even guarantee the entire string is set to the null character. As stated by others, you can't...
305,358
<p>Is there an Iterator implementation that merges multiple iterators? </p> <pre><code>class MergedIterator&lt;T&gt; implements Iterator&lt;T&gt; { MergedIterator(Iterator&lt;T&gt;... iters) .... } </code></pre> <p>And the next method should move on to <code>iters[1]</code> when <code>!iters[0].hasNext()</c...
[ { "answer_id": 305362, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "<p>I'd call that a ConcatenatedIterator myself - a MergedIterator should merge the results of several iterators e.g. base...
2008/11/20
[ "https://Stackoverflow.com/questions/305358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18573/" ]
Is there an Iterator implementation that merges multiple iterators? ``` class MergedIterator<T> implements Iterator<T> { MergedIterator(Iterator<T>... iters) .... } ``` And the next method should move on to `iters[1]` when `!iters[0].hasNext()` etc
I'd call that a ConcatenatedIterator myself - a MergedIterator should merge the results of several iterators e.g. based on sorting Naming aside, I'm sure there'll be an implementation in a 3rd party library somewhere. Just off to check [Google collections](http://code.google.com/p/google-collections/)... EDIT: Bingo ...
305,359
<p>I want to write a function that accepts a parameter which can be either a sequence or a single value. The type of value is str, int, etc., but I <strong>don't</strong> want it to be restricted to a hardcoded list. In other words, I want to know if the parameter X is a sequence or something I have to convert to a se...
[ { "answer_id": 305388, "author": "Dave Costa", "author_id": 6568, "author_profile": "https://Stackoverflow.com/users/6568", "pm_score": 1, "selected": false, "text": "<p>I think what I would do is check whether the object has certain methods that indicate it is a sequence. I'm not sure ...
2008/11/20
[ "https://Stackoverflow.com/questions/305359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38557/" ]
I want to write a function that accepts a parameter which can be either a sequence or a single value. The type of value is str, int, etc., but I **don't** want it to be restricted to a hardcoded list. In other words, I want to know if the parameter X is a sequence or something I have to convert to a sequence to avoid ...
> > The problem with all of the above > mentioned ways is that str is > considered a sequence (it's iterable, > has **getitem**, etc.) yet it's > usually treated as a single item. > > > For example, a function may accept an > argument that can either be a filename > or a list of filenames. What's the > most P...
305,378
<p>For some reason I can't find a way to get the equivalents of sqlite's interactive shell commands:</p> <pre><code>.tables .dump </code></pre> <p>using the Python sqlite3 API. </p> <p>Is there anything like that?</p>
[ { "answer_id": 305395, "author": "finnw", "author_id": 12048, "author_profile": "https://Stackoverflow.com/users/12048", "pm_score": 5, "selected": false, "text": "<p>I'm not familiar with the Python API but you can always use</p>\n\n<pre><code>SELECT * FROM sqlite_master;\n</code></pre>...
2008/11/20
[ "https://Stackoverflow.com/questions/305378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38557/" ]
For some reason I can't find a way to get the equivalents of sqlite's interactive shell commands: ``` .tables .dump ``` using the Python sqlite3 API. Is there anything like that?
You can fetch the list of tables and schemata by querying the SQLITE\_MASTER table: ``` sqlite> .tab job snmptarget t1 t2 t3 sqlite> select name from sqlite_master where type = 'table'; job t1 t2 snmptarget t3 sqlite> .schema job CREATE TABLE job ( id INTEGER PRIMARY KEY, da...
305,386
<p>I have two branches, the main branch(black) and a feature branch(yellow).</p> <p>As you can see, since the feature branch was forked, it was kept up to date fetching changes from main:</p> <p><a href="http://azkotoki.org/images/stackoverflow/tgh-reintegrate1.gif" rel="nofollow noreferrer">alt text http://azkotoki....
[ { "answer_id": 687167, "author": "oo_olo_oo", "author_id": 76857, "author_profile": "https://Stackoverflow.com/users/76857", "pm_score": 0, "selected": false, "text": "<p>When you take a closer look you will see that the both graphs are (almost) identical, but the presentation is differe...
2008/11/20
[ "https://Stackoverflow.com/questions/305386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28581/" ]
I have two branches, the main branch(black) and a feature branch(yellow). As you can see, since the feature branch was forked, it was kept up to date fetching changes from main: [alt text http://azkotoki.org/images/stackoverflow/tgh-reintegrate1.gif](http://azkotoki.org/images/stackoverflow/tgh-reintegrate1.gif) Whe...
The graph looks like this since the revisions are ordered by their revision numbers. The main repository has the revisions ordered and numbered like this: ``` 0 Imported initial repo. 1 Trivial change to also echo b. 2 Added another echo for c. 3 Echo for d. 4 Echo for e. ``` This reflects the order in which the cha...
305,393
<p>I am writing an unit test for a mvc web application that checks if a returned list of anonymous variables(in a jsonresult) is correct. therefore i need to iterate through that list but i cannot seem to find a way to do so.</p> <p>so i have 2 methods</p> <p>1) returns a json result . In that json result there is a ...
[ { "answer_id": 305412, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": true, "text": "<p>I think you mean \"anonymous type\" everywhere you've said \"anonymous variable\" - but you can still iterate over the...
2008/11/20
[ "https://Stackoverflow.com/questions/305393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am writing an unit test for a mvc web application that checks if a returned list of anonymous variables(in a jsonresult) is correct. therefore i need to iterate through that list but i cannot seem to find a way to do so. so i have 2 methods 1) returns a json result . In that json result there is a property called d...
I think you mean "anonymous type" everywhere you've said "anonymous variable" - but you can still iterate over the list with `foreach`, just declaring the iteration variable as type `object`: ``` foreach (object o in myList) { // Not sure what you're actually trying to do in here... } ``` If you need to check th...
305,422
<p>If any one can help me with Python code: If I input a letter, How can I print all the words start with that word?</p>
[ { "answer_id": 305430, "author": "csl", "author_id": 21028, "author_profile": "https://Stackoverflow.com/users/21028", "pm_score": 1, "selected": false, "text": "<p>There are many ways of doing this, e.g.:</p>\n\n<pre><code>words = [\"zwei\", \"peanuts\", \"were\", \"walking\", \"down\",...
2008/11/20
[ "https://Stackoverflow.com/questions/305422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If any one can help me with Python code: If I input a letter, How can I print all the words start with that word?
``` print [word for word in words if word.startswith(letter)] ```
305,424
<p>We get an abort when a C++ exception is thrown when running code compiled with -pthread.</p> <p>Platform: AIX 5.3 technical level 8 Compiler: gcc 3.4.6 Linker: AIX linker 1.65.2.4</p> <p>Test Code:</p> <pre><code>// exception.cpp #include &lt;iostream&gt; class MyException { public: MyException(){} ...
[ { "answer_id": 306106, "author": "user27141", "author_id": 27141, "author_profile": "https://Stackoverflow.com/users/27141", "pm_score": 2, "selected": false, "text": "<p>Tried your program on AIX:</p>\n<blockquote>\n<p>oslevel -r</p>\n<p>5200-08</p>\n</blockquote>\n<p>with g++ --version...
2008/11/20
[ "https://Stackoverflow.com/questions/305424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3978/" ]
We get an abort when a C++ exception is thrown when running code compiled with -pthread. Platform: AIX 5.3 technical level 8 Compiler: gcc 3.4.6 Linker: AIX linker 1.65.2.4 Test Code: ``` // exception.cpp #include <iostream> class MyException { public: MyException(){} virtual ~MyException(){}; }; v...
g++ 4.3.2 seems to work Ok for this problem. Also xlC v10 works.
305,434
<p>What I'm trying to do is run the same SQL select on many Oracle databases (at least a dozen), and display the output in a Gridview.</p> <p>I've hacked together something that works but unfortunately it's very slow. I think its exacerbated by the fact that at least 1 of the dozen databases will invariably be unreac...
[ { "answer_id": 306561, "author": "Nathan Prather", "author_id": 38255, "author_profile": "https://Stackoverflow.com/users/38255", "pm_score": 2, "selected": false, "text": "<p>could be a lot of factors causing it to be slow. What's the sql statement being executed that's running slow?</...
2008/11/20
[ "https://Stackoverflow.com/questions/305434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12744/" ]
What I'm trying to do is run the same SQL select on many Oracle databases (at least a dozen), and display the output in a Gridview. I've hacked together something that works but unfortunately it's very slow. I think its exacerbated by the fact that at least 1 of the dozen databases will invariably be unreachable or ot...
If you run the DataAdapter.Fill method on a DataTable object the table will be updated with the results from the query. So instead of creating new DataTable and DataSet objects and then copying the DataRows manually you can just add rows to the same table. Try something like this (in untested C# code): ``` public voi...
305,438
<p>I need in a bash script to get details about a file when I know the inode.The system is Linux.</p>
[ { "answer_id": 305492, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 0, "selected": false, "text": "<p>You can use <code>find</code> with a combination of <code>-inum</code> and <code>-xdev</code>. This gives you the file's...
2008/11/20
[ "https://Stackoverflow.com/questions/305438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I need in a bash script to get details about a file when I know the inode.The system is Linux.
Something like so: ``` find $SEARCHPATH -maxdepth $N -inum $INUM -exec ls -l {} \; ``` Since the filename links to the inode, ans not vice-versa, you need to do this in a brute force manner. The -maxdepth is to narrow it down if you have some idea of where it should be. You can also ad -xdev if your searching a tree...
305,458
<p>I need to create a site map/list, but I need the link-name to show up as well.</p> <p>What I mean by that is given, say, www.google.com, I need the following list to be created.</p> <pre><code>Google - www.google.com Images - http://images.google.com/imghp?hl=en&amp;tab=wi ... My Account - http://images.google.com...
[ { "answer_id": 309117, "author": "James", "author_id": 11604, "author_profile": "https://Stackoverflow.com/users/11604", "pm_score": 3, "selected": true, "text": "<p>Use SQL Server Profiler - it can connect to Analysis Services... When you create a trace make sure you click \"Show All Ev...
2008/11/20
[ "https://Stackoverflow.com/questions/305458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19731/" ]
I need to create a site map/list, but I need the link-name to show up as well. What I mean by that is given, say, www.google.com, I need the following list to be created. ``` Google - www.google.com Images - http://images.google.com/imghp?hl=en&tab=wi ... My Account - http://images.google.com/imghp?hl=en&tab=wi P...
Use SQL Server Profiler - it can connect to Analysis Services... When you create a trace make sure you click "Show All Events" and capture the "Execute MDX" events.
305,462
<p>Is there a way to query the current DATEFORMAT SQLServer 2005 is currently using with T-SQL?</p> <p>I have an application that reads pregenerated INSERT-statements and executes them against a database. To make the data to be inserted culture independent I store datetime-values represented in the invariant culture (...
[ { "answer_id": 305501, "author": "George Mastros", "author_id": 1408129, "author_profile": "https://Stackoverflow.com/users/1408129", "pm_score": 4, "selected": true, "text": "<p>Set Language and Set DateFormat only affect the current session. If you Disconnect from the database and con...
2008/11/20
[ "https://Stackoverflow.com/questions/305462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9602/" ]
Is there a way to query the current DATEFORMAT SQLServer 2005 is currently using with T-SQL? I have an application that reads pregenerated INSERT-statements and executes them against a database. To make the data to be inserted culture independent I store datetime-values represented in the invariant culture (month/day/...
Set Language and Set DateFormat only affect the current session. If you Disconnect from the database and connect again, the language and Dateformat are set back to their default values. There is a 'trick' you could use to determine if the DateFormat is m/d/y, or d/m/y. ``` Select DatePart(Month, '1/2/2000') ``` Thi...
305,464
<p>As the DetailsView uses &lt;td&gt; cells for both the header text and the data, I was wondering whether the behaviour of the control can be overridden to render the HeaderText of each row in a &lt;th&gt; cell?</p> <hr> <p>@Joel Coehoorn Thanks for the quick reply, but I was kind of hoping I wouldn't have to go dow...
[ { "answer_id": 305477, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 1, "selected": false, "text": "<p>There's no option built into the control itself. However, you can completely override the render behavior for any ...
2008/11/20
[ "https://Stackoverflow.com/questions/305464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1904/" ]
As the DetailsView uses <td> cells for both the header text and the data, I was wondering whether the behaviour of the control can be overridden to render the HeaderText of each row in a <th> cell? --- @Joel Coehoorn Thanks for the quick reply, but I was kind of hoping I wouldn't have to go down that route. I was wo...
I managed to find a way around this by using the ItemCreaed event handler and swapping the <td> cell for a <th> cell like this: ``` if (view.Rows.Count > 0) { // swap each header <td> cell for a <th> cell foreach (DetailsViewRow row in view.Rows) { if (row.RowType == DataControlRowType.DataRow) { ...
305,487
<p>Access can open DBF (dBase) files, but instead of physically converting the data into MDB format, it has the ability to link to the DBF table itself. This way the DBF is "linked" to the MDB.</p> <p>Is it possible to attach a DBF file in such manner using C#?</p> <p><strong>Edit</strong>: I would like to use Jet an...
[ { "answer_id": 305596, "author": "Fionnuala", "author_id": 2548, "author_profile": "https://Stackoverflow.com/users/2548", "pm_score": 3, "selected": true, "text": "<p>Perhaps this code from <a href=\"http://cookingwithcsharp.blogspot.com/2007/11/how-to-quickly-copy-tables-from-odbc.html...
2008/11/20
[ "https://Stackoverflow.com/questions/305487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21704/" ]
Access can open DBF (dBase) files, but instead of physically converting the data into MDB format, it has the ability to link to the DBF table itself. This way the DBF is "linked" to the MDB. Is it possible to attach a DBF file in such manner using C#? **Edit**: I would like to use Jet and avoid using MS Access direct...
Perhaps this code from [How to quickly copy tables from an ODBC source to MS Access within a C# project](http://cookingwithcsharp.blogspot.com/2007/11/how-to-quickly-copy-tables-from-odbc.html) might help: > > The VB function you’ll need to put > into MS Access is quite simple, and > basically calls the TransferDat...