qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
250,289 | <p>Obviously (methinks), creating an index on a <code>BIT</code> column is unnecessary. However, if you had a column that you need to search in which every value is likely unique, like <code>BlogPost</code> or <code>StreetAddress</code> or something, then an index seems appropriate (again, methinks).</p>
<p>But what's the cutoff? What if you expect 10,000 rows and you'll have about 20 unique values among them. Should an index be created?</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 250338,
"author": "kͩeͣmͮpͥ ͩ",
"author_id": 26479,
"author_profile": "https://Stackoverflow.com/users/26479",
"pm_score": 1,
"selected": false,
"text": "BIT"
},
{
"answer_id": 18809883,
"author": "Ardalan Shahgholi",
"author_id": 2063547,
"author_profi... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32382/"
] |
250,304 | <p>A VBScript cannot edit the registry by default on Vista. How do I get elevation (even if the user has to do something when they run the script) so that the script can edit the registry?</p>
<p>The error is:</p>
<pre><code>---------------------------
Windows Script Host
---------------------------
Script: blah blah blah.vbs
Line: 6
Char: 1
Error: Permission denied
Code: 800A0046
Source: Microsoft VBScript runtime error
---------------------------
OK
---------------------------
</code></pre>
| [
{
"answer_id": 250343,
"author": "Tomalak",
"author_id": 18771,
"author_profile": "https://Stackoverflow.com/users/18771",
"pm_score": 0,
"selected": false,
"text": "regedit.exe"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1490/"
] |
250,324 | <p>I am wondering what the best way is using php to obtain a list of all the rows in the database, and when clicking on a row show the information in more detail, such as a related image etc.</p>
<p>Should I use frames to do this? Are there good examples of this somewhere?</p>
<p>Edit:</p>
<p>I need much simpler instructions, as I am not a programmer and am just starting out. Can any links or examples be recommended?</p>
| [
{
"answer_id": 250331,
"author": "changelog",
"author_id": 5646,
"author_profile": "https://Stackoverflow.com/users/5646",
"pm_score": 0,
"selected": false,
"text": "$_GET['id']"
},
{
"answer_id": 251880,
"author": "kevtrout",
"author_id": 1149,
"author_profile": "htt... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1246613/"
] |
250,357 | <p>I am looking for a way to truncate a string in Python that will not cut off the string in the middle of a word.</p>
<p>For example:</p>
<pre>
Original: "This is really awesome."
"Dumb" truncate: "This is real..."
"Smart" truncate: "This is really..."
</pre>
<p>I'm looking for a way to accomplish the "smart" truncate from above.</p>
| [
{
"answer_id": 250373,
"author": "Adam",
"author_id": 30084,
"author_profile": "https://Stackoverflow.com/users/30084",
"pm_score": 7,
"selected": true,
"text": "def smart_truncate(content, length=100, suffix='...'):\n if len(content) <= length:\n return content\n else:\n ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24998/"
] |
250,369 | <p>We are ready to start a brand new project at work, no legacy code. We did use Subsonic in the past and we pretty happy with it. But that was before Linq.</p>
<p>Has anyone had to face this same issue (Linq x Subsonic)? </p>
<p>What was your decision? What were the reasons?</p>
<p>Any insight appreciated.</p>
| [
{
"answer_id": 250416,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": 2,
"selected": false,
"text": "FROM a in db.Orders\nwhere a.Total > 100\nSELECT new {a.Item.Desc, a.Customer.Name};\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3440/"
] |
250,374 | <p>With the Ajax Control Toolkit, one can easily drag and drop all types of great extender onto controls, but they register a boatload of JavaScript to do it. </p>
<ol>
<li>How do I control this? </li>
<li>If the <code>ScriptManager</code> is in the <code>MasterPage</code>, is there anyway to control the loading of a script on one page that isn't in another?</li>
</ol>
<p>For example: calendar extender is on one page, but the script for it gets loaded on every page that is a child of the master page.</p>
| [
{
"answer_id": 250416,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": 2,
"selected": false,
"text": "FROM a in db.Orders\nwhere a.Total > 100\nSELECT new {a.Item.Desc, a.Customer.Name};\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7952/"
] |
250,375 | <p>for some reason, templatetags do not render in templates for django admin.</p>
<p>with this snippet from:
<a href="http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#shortcut-for-simple-tags" rel="nofollow noreferrer">http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#shortcut-for-simple-tags</a></p>
<pre><code>{% if is_logged_in %}Thanks for logging in!{% else %}Please log in.{% endif %}
</code></pre>
<p>when placed in admin index.html, if a user is logged in, it shows "Please log in"</p>
<p>same with templatetags, can not get any app ones to show, do anything. there is no error/they do not get processed either </p>
| [
{
"answer_id": 250479,
"author": "Brett",
"author_id": 11958,
"author_profile": "https://Stackoverflow.com/users/11958",
"pm_score": 3,
"selected": false,
"text": "is_logged_in"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
250,377 | <p>As they are in .Net 3.5. I know they are in 4.0, as that's what the DLR works with, but I'm interested in the version we have now.</p>
| [
{
"answer_id": 250896,
"author": "Tim Robinson",
"author_id": 32133,
"author_profile": "https://Stackoverflow.com/users/32133",
"pm_score": 2,
"selected": false,
"text": "while"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18658/"
] |
250,378 | <p>Can source code examples be kept in a SQL database <strong>while retaining all formatting</strong> (tabs, newlines, etc.)? If so what data type would be used?</p>
| [
{
"answer_id": 250384,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 2,
"selected": true,
"text": "TEXT"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13227/"
] |
250,398 | <p>I can't find any proper documentation on how to specify relations
using the declarative syntax of SQLAlchemy.. Is it unsupported? That is, should I use the "traditional" syntax?<br>
I am looking for a way to specify relations at a higher level, avoiding having to mess with foreign keys etc.. I'd like to just declare "addresses = OneToMany(Address)" and let the framework handle the details.. I know that Elixir can do that, but I was wondering if "plain" SQLA could do it too.<br>
Thanks for your help!</p>
| [
{
"answer_id": 251077,
"author": "Ali Afshar",
"author_id": 28380,
"author_profile": "https://Stackoverflow.com/users/28380",
"pm_score": 3,
"selected": true,
"text": "class User(Base):\n __tablename__ = 'users'\n\n id = Column('id', Integer, primary_key=True)\n addresses = rela... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3497/"
] |
250,403 | <p>I'm auditing a project that uses what is called a <a href="http://en.wikipedia.org/wiki/Business_rules_engine" rel="noreferrer">Rules Engine</a>. In short, it's a way to externalize business logic from application code. </p>
<p>This concept is entirely new to me and I'm pretty skeptical about it. After hearing people talk about <a href="http://www.martinfowler.com/bliki/AnemicDomainModel.html" rel="noreferrer">Anemic Domain Models</a> for the past few years, I'm questioning the Rules Engine Approach. To me they seem like a great way to WEAKEN a domain model. For example say I'm doing a java webapp interacting with a Rules Engine. Then I decide I want to have an Android app based on the same domain. Unless I want the Android app to interact with the Rules Engine as well, I'm going to have to miss out on whatever business logic was already written. </p>
<p>As I don't have any experience with them yet, just curiosity, I was interested to hear about the pros and cons are in using a Rules Engine? The only pro that I can think of is that you don't need to rebuild your entire Application just to change some business rule (but really, how many apps really have that many changes?). But using a Rules Engine to solve that problem kind of sounds to me like putting a band-aid over a shotgun wound. </p>
<p>UPDATE - since writing this, the god himself, Martin Fowler, has <a href="http://martinfowler.com/bliki/RulesEngine.html" rel="noreferrer">blogged about using a Rules engine</a>.</p>
| [
{
"answer_id": 250641,
"author": "brian d foy",
"author_id": 2766176,
"author_profile": "https://Stackoverflow.com/users/2766176",
"pm_score": 4,
"selected": false,
"text": "if"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/543/"
] |
250,404 | <p>I found <a href="https://stackoverflow.com/questions/122778/capture-console-output-for-debugging-in-vs">this question</a>, but what I want to know is different - does the output from Console.WriteLine go anywhere when debugging? I know that for it to go to the output window I should should Debug.WriteLine() or other methods, but where does the standard Console.WriteLine() go?</p>
<p><strong>Edit</strong>
When debugging, you don't see the black console window / test log - so the <strong>real question is</strong> how can I access/view this output during debugging?</p>
| [
{
"answer_id": 2075892,
"author": "AMissico",
"author_id": 163921,
"author_profile": "https://Stackoverflow.com/users/163921",
"pm_score": 3,
"selected": false,
"text": "NullStream"
},
{
"answer_id": 5577749,
"author": "Carl R",
"author_id": 480986,
"author_profile": ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] |
250,408 | <p>I tried the example from Rails Cookbook and managed to get it to work. However the <code>text_field_with_auto_complete</code> works only for one value.</p>
<pre><code>class Expense < ActiveRecord::Base
has_and_belongs_to_many :categories
end
</code></pre>
<p>In the New Expense View rhtml</p>
<pre><code><%= text_field_with_auto_complete :category, :name %>
</code></pre>
<p>Auto complete works for the first category. How do I get it working for multiple categories? e.g. Category1, Category2<br>
<em>Intended behavior: like the StackOverflow Tags textbox</em></p>
<p><strong>Update:</strong><br>
With some help and some more tinkering, I got multiple comma-seperated autocomplete to show up (will post code-sample here).<br>
<em>However on selection, the last value replaces the content of the text_field_with_auto_complete.</em> So instead of Category1, Category2.. the textbox shows Category2 when the second Category is selected via auto-complete. Any ideas how to rectify this? </p>
| [
{
"answer_id": 9945411,
"author": "Rustam A. Gasanov",
"author_id": 644810,
"author_profile": "https://Stackoverflow.com/users/644810",
"pm_score": 0,
"selected": false,
"text": "<%= f.autocomplete_field :brand_name, welcome_autocomplete_brand_name_path, \"data-delimiter\" => ', ' %>"
... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1695/"
] |
250,410 | <p>If I write <code>Session["asdf"] = 234;</code></p>
<p>In my asp.net web app, does this mean the client will have a cookie stored on their browser?</p>
| [
{
"answer_id": 250414,
"author": "ine",
"author_id": 4965,
"author_profile": "https://Stackoverflow.com/users/4965",
"pm_score": 4,
"selected": false,
"text": "lit3py55t21z5v55vlm25s55"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
250,415 | <p>I need to write some registration data (unique computer number, and corresponding activation code).</p>
<p>The Computer Number needs to be visible from <i>other</i> programs and <em>all</em> accounts ({Admin|Non Admin} with User Access Control turned {On|Off} )</p>
<p>It's acceptable to write the Computer Number and Activation Code only from an Admin account, but it needs to be readable from any of the other accounts. </p>
<p>Currently (and I need to test this more) it seems that if the the CN and Activation Code are written with UAC off then when the user switches UAC ON the Computer Number isn't visible.</p>
| [
{
"answer_id": 250414,
"author": "ine",
"author_id": 4965,
"author_profile": "https://Stackoverflow.com/users/4965",
"pm_score": 4,
"selected": false,
"text": "lit3py55t21z5v55vlm25s55"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4906/"
] |
250,421 | <p>I am writing a macro for Visual studio that will generate some code.</p>
<p>I would like for the macro to generate for both C# and VB, is there a way to determine what language is being used in the active (current) document?</p>
| [
{
"answer_id": 250532,
"author": "Brian Schmitt",
"author_id": 30492,
"author_profile": "https://Stackoverflow.com/users/30492",
"pm_score": 3,
"selected": true,
"text": "DTE.ActiveDocument.Language = \"CSharp\"\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30492/"
] |
250,423 | <p>I'm a web developer with no formal computing background behind me, I've been writing code now some years now, but every time I need to create a new class / function / variable, I spend about two minutes just deciding on a name and then how to type it.</p>
<p>For instance, if I write a function to sum up a bunch of numbers. Should I call it</p>
<pre><code>Sum()
GetSum()
getSum()
get_sum()
AddNumbersReturnTotal()
</code></pre>
<p>I know there is a right way to do this, and a link to a good definitive source is all I ask :D</p>
<p><strong>Closed as a duplicate of <a href="https://stackoverflow.com/questions/14967/c-coding-standard-best-practices">c# Coding standard / Best practices</a></strong></p>
| [
{
"answer_id": 250440,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": 0,
"selected": false,
"text": "Sum()"
},
{
"answer_id": 250442,
"author": "Nicholas Mancuso",
"author_id": 8945,
"author_profile... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31765/"
] |
250,451 | <p>It's rare that I hear someone using <a href="http://martinfowler.com/articles/injection.html" rel="nofollow noreferrer">Inversion of Control (Ioc)</a> principle with .Net. I have some friends that work with Java that use a lot more Ioc with Spring and PicoContainer.</p>
<p>I understand the principle of removing dependencies from your code... but I have a doubt that it's so much better.</p>
<p><strong>Why do .Net programmers not use (or use less) those types of frameworks? If you do, do you really find a positive effect in the long term?</strong></p>
| [
{
"answer_id": 250483,
"author": "cfeduke",
"author_id": 5645,
"author_profile": "https://Stackoverflow.com/users/5645",
"pm_score": 2,
"selected": false,
"text": "IPersonMapper"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13913/"
] |
250,468 | <p>Is the SqlClient.SqlDataReader a .NET managed object or not?
Why do we have to call the Close() method explicitly close an open connection?
Shouldn't running out of scope for such an object automatically close this?
Shouldn't garbage collector clean it up anyway?</p>
<p>Please help me understand what is the best practise here.</p>
<p>I have seen a related question <a href="https://stackoverflow.com/questions/247311/sqldatareader-in-this-scenario-will-the-reader-get-closed">here</a> and it further illustrates the issue I have with a web application. The issue is that we were running out of connections. The detailed error is here:</p>
<pre><code>Exception: System.InvalidOperationException
Message: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Source: System.Data
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
</code></pre>
<p>To fix this, I had to explicitly close all the SQLDataReader objects.</p>
<p>I am using .NET Framework 3.5</p>
| [
{
"answer_id": 250535,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 4,
"selected": false,
"text": "using (SqlConnection conn = new SqlConnection(conStr))\n{\n using (SqlCommand command = new SqlCommand())\n {\n ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13370/"
] |
250,494 | <p>I have a class that downloads, examines and saves some large XML files. Sometimes I want the UI to tell me what's going on, but sometimes I will use the class and ignore the events. So I have placed lines of code like this in a dozen places:</p>
<pre><code>RaiseEvent Report("Sending request: " & queryString)
RaiseEvent Report("Saving file: " & fileName)
RaiseEvent Report("Finished")
</code></pre>
<p>My question is this - will these events slow down my code if nothing is listening for them? Will they even fire?</p>
| [
{
"answer_id": 250830,
"author": "Binary Worrier",
"author_id": 18797,
"author_profile": "https://Stackoverflow.com/users/18797",
"pm_score": 4,
"selected": true,
"text": "GetMystring()"
},
{
"answer_id": 250897,
"author": "Shane Miskin",
"author_id": 16415,
"author_p... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16415/"
] |
250,506 | <p>I made a class that derives from Component:</p>
<pre><code>public class MyComponent: System.ComponentModel.Component
{
}
</code></pre>
<p>I saw that Visual Studio put this code in for me:</p>
<pre><code>protected override void Dispose(bool disposing)
{
try
{
if (disposing && (components != null))
{
components.Dispose();
}
}
catch
{
throw;
}
finally
{
base.Dispose(disposing);
}
}
</code></pre>
<p><code>MyComponent</code> has a member that is a <code>DataSet</code> and maybe there's some other members that implement <code>IDisposable</code>. What, if anything, do i need to modify with the <code>Dispose()</code> method to make sure things are cleaned up properly? Thanks for helping.</p>
| [
{
"answer_id": 250541,
"author": "Nicholas Mancuso",
"author_id": 8945,
"author_profile": "https://Stackoverflow.com/users/8945",
"pm_score": 3,
"selected": true,
"text": "if (disposing && (components != null))\n{\n components.Dispose();\n}\n"
},
{
"answer_id": 9169564,
"... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
250,508 | <p>I am trying to pull data from an ACD call data system, <code>Nortel Contact Center 6.0</code> to be exact, and if you use that particular system what I am trying to capture is the daily call by call data. However when I use this code</p>
<p>(sCW is a common word string that equals <code>eCallByCallStat</code> and
sDate is </p>
<p><code>dDate = Format(Month(deffDate) & "/" & iStartDay & "/" & Year(deffDate), "mm/dd/yyyy")</code></p>
<p><code>sDate = Format(dDate, "yyyymmdd")</code>
)</p>
<pre><code>sSql = ""
sConn = "ODBC;DSN=Aus1S002;UID=somevaliduser;PWD=avalidpassword;SRVR=Thecorrectserver;DB=blue"
sSql = "SELECT " & sCW & sDate & ".Timestamp, "
sSql = sSql & sCW & sDate & ".CallEvent, "
sSql = sSql & sCW & sDate & ".CallEventName, "
sSql = sSql & sCW & sDate & ".CallID, "
sSql = sSql & sCW & sDate & ".TelsetLoginID, "
sSql = sSql & sCW & sDate & ".AssociatedData, "
sSql = sSql & sCW & sDate & ".Destination, "
sSql = sSql & sCW & sDate & ".EventData, "
sSql = sSql & sCW & sDate & ".Source, "
sSql = sSql & sCW & sDate & ".Time " & vbCrLf
sSql = sSql & "FROM blue.dbo.eCallByCallStat" & sDate & " " & sCW & sDate & vbCrLf
sSql = sSql & " ORDER BY " & sCW & sDate & ".Timestamp"
Set oQT = ActiveSheet.QueryTables.Add(Connection:=sConn, Destination:=Range("A1"), Sql:=sSql)
oQT.Refresh BackgroundQuery:=False
Do While oQT.Refreshing = True
Loop"
</code></pre>
<p>When I run this I get an odd error message at oQT.Refresh BackgroundQuery:=False</p>
<p>Oddly enough it worked for a month or so then just died</p>
<hr>
<p>@ loopo
I actually added the <code>""</code> to the connection string and actually have the user name and password hard coded into the query with out quotes, I have since removed them for clarity in the posting</p>
<hr>
<p>The error I recieve is </p>
<blockquote>
<p>Run-time error '-2147417848(80010108)':
Method 'Refresh" of Object "_QueryTable' Failed</p>
</blockquote>
<hr>
<p>Thanks for your input Kevin. The Database is never in a state where no one is accessing it, it is a Call Handling system that is on 24 x 7 and always connected to is clients. At least that is my understanding. If I do this manually through Excel I never get an error, or have any issues only when I am doing this via a macro does it give me issues which lead me to think that it was my code causing the issue.</p>
<p>I am connecting to the database via ODBC as recommended by the manuafacturer, but I wonder if they ever envisioned this sort of thing.</p>
<p>I will see if I can leverage this into a .NET project and see if that helps.</p>
| [
{
"answer_id": 250929,
"author": "Loopo",
"author_id": 32763,
"author_profile": "https://Stackoverflow.com/users/32763",
"pm_score": 1,
"selected": false,
"text": "sConn = \"ODBC;DSN=Aus1S002;UID=\"\"somevaliduser\"\";PWD=\"\"avalidpassword\"\";SRVR=\"\"Thecorrectserver\"\";DB=blue\"\n"
... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250508",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32790/"
] |
250,509 | <p>Is there a way that you can have SERVEROUTPUT set to ON in sqlplus but somehow repress the message "PL/SQL procedure successfully completed" that is automatically generated upon completed execution of a plsql procedure?</p>
| [
{
"answer_id": 250540,
"author": "Tony Andrews",
"author_id": 18747,
"author_profile": "https://Stackoverflow.com/users/18747",
"pm_score": 7,
"selected": true,
"text": "SET FEEDBACK OFF\n"
},
{
"answer_id": 58718276,
"author": "MikeA",
"author_id": 10807594,
"author_... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5658/"
] |
250,517 | <p>I see many different Java terms floating around. I need to install the JDK 1.6. It was my understanding that Java 6 == Java 1.6. However, when I install Java SE 6, I get a JVM that reports as version 11.0! Who can solve the madness?</p>
| [
{
"answer_id": 250534,
"author": "Jonathan Leffler",
"author_id": 15168,
"author_profile": "https://Stackoverflow.com/users/15168",
"pm_score": 8,
"selected": false,
"text": "sun.com"
},
{
"answer_id": 250559,
"author": "Paul Tomblin",
"author_id": 3333,
"author_profi... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250517",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1541/"
] |
250,545 | <p>Does anyone know of any specific DSL implementations used to import legacy Oracle database schemas. I have tried to just run db:schema:dump on my existing db I want to port to a new ruby app. However, the rake dies about halfway through with out any error. It kinda just locks up. I started looking for the best way to tackle this and found examples of how to override some stuff for SQLServer but not much for Oracle. </p>
<p>I basically want to pull in the schema and generate a scaffold and model from it.</p>
<p>Is there a more simple way to do this or will I have to invent the wheel?</p>
| [
{
"answer_id": 250725,
"author": "Gene T",
"author_id": 413049,
"author_profile": "https://Stackoverflow.com/users/413049",
"pm_score": 3,
"selected": true,
"text": "rake --trace"
},
{
"answer_id": 252864,
"author": "Raimonds Simanovskis",
"author_id": 16829,
"author_... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30807/"
] |
250,550 | <p>this is probably a newbie ruby question. I have several libraries and apps that I need to deploy to several different hosts. All of the apps and libs will share some common settings for those hosts-- e.g. host name, database server/user/pass, etc.</p>
<p>My goal is to do something like:</p>
<pre><code>cap host1 stage deploy
cap host2 stage deploy
cap host1 prod deploy
# ...
</code></pre>
<p>My question is how do you include these common settings in all of your deploy.rb files? More specifically, I want to create a an rb file that I can include that has some common settings and several host specific task definitions:</p>
<pre><code>set :use_sudo, false
# set some other options
task :host1 do
role :app, "host1.example.com"
role :web, "host1.example.com"
role :db, "host1.example.com", :primary => true
set :rodb_host, "dbhost"
set :rodb_user, "user"
set :rodb_pass, "pass"
set :rodb_name, "db"
end
task :host2 do
#...
end
deploy.task :carsala do
transaction do
setup
update_code
symlink
end
end
</code></pre>
<p>And then "include" this file in all of my deploy.rb files where I define stage, prod, etc and overwrite any "common" configuration parameters as necessary. Any suggestions would be appreciated. I've tried a few different things, but I get errors from cap for all of them. </p>
<p>Edit: I've tried </p>
<pre><code>require 'my_module'
</code></pre>
<p>But I get errors complaining about an undefined task object.</p>
| [
{
"answer_id": 250747,
"author": "Jon Wood",
"author_id": 25258,
"author_profile": "https://Stackoverflow.com/users/25258",
"pm_score": 2,
"selected": false,
"text": "require 'my_extension'\n"
},
{
"answer_id": 250985,
"author": "Daniel Beardsley",
"author_id": 13216,
... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8243/"
] |
250,553 | <p>I'd like something like</p>
<pre><code>int minIndex = list.FindMin(delegate (MyClass a, MyClass b) {returns a.CompareTo(b);});
</code></pre>
<p>Is there a builtin way to do this in .NET?</p>
| [
{
"answer_id": 250567,
"author": "Nicholas Mancuso",
"author_id": 8945,
"author_profile": "https://Stackoverflow.com/users/8945",
"pm_score": 6,
"selected": true,
"text": "List<MyClass> list = new List();\n//add whatever you need to add\n\nMyClass min = list.Min();\nMyClass max = list.Ma... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] |
250,560 | <p>I am working in Java on a fairly large project. My question is about how to best structure the set of Properties for my application.</p>
<p>Approach 1: Have some static Properties object that's accessible by every class. (Disadvantages: then, some classes lose their generality should they be taken out of the context of the application; they also require explicit calls to some static object that is located in a different class and may in the future disappear; it just doesn't <em>feel</em> right, am I wrong?)</p>
<p>Approach 2: Have the Properties be instantiated by the main class and handed down to the other application classes. (Disadvantages: you end up passing a pointer to the Properties object to almost every class and it seems to become very redundant and cumbersome; I don't <em>like</em> it.)</p>
<p>Any suggestions?</p>
| [
{
"answer_id": 250585,
"author": "sblundy",
"author_id": 4893,
"author_profile": "https://Stackoverflow.com/users/4893",
"pm_score": 1,
"selected": false,
"text": "ConfigurationManagerClass.instance()"
},
{
"answer_id": 250593,
"author": "S.Lott",
"author_id": 10661,
... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10675/"
] |
250,564 | <p>How to check, from C#, are files for complex script and rtl languages (Regional and Language settings) installed?</p>
<p>Edit:
Or is there another way of checking whether right to left text will display correctly in my form?</p>
<p>Edit for better explanation (I hope :))
I'm creating an application that will use Arabic letters (free dictionary). So, I want to check are: "Files for complex script and right-to-left languages(Including Thai)" (CheckBox in "Regional and Language Options" in Language Tab) installed (Is CheckBox checked.).
If they are not installed, Arabic words will not display correctly,and I want to warn user if that is the case.</p>
<p>Thanks</p>
| [
{
"answer_id": 261187,
"author": "Afree",
"author_id": 11317,
"author_profile": "https://Stackoverflow.com/users/11317",
"pm_score": 0,
"selected": false,
"text": "...\n uint32 MaxNumberOfProcesses;\n uint64 MaxProcessMemorySize;\n string MUILanguages[]; //I don't see this field, and ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11317/"
] |
250,566 | <p>What is the best plugin for Rails that <strong>gzips</strong> my webpage output?</p>
<p><strong>Edit:</strong>
The company I am hosting with has stated they will not install <code>mod_deflate</code>.</p>
| [
{
"answer_id": 251012,
"author": "Otto",
"author_id": 9594,
"author_profile": "https://Stackoverflow.com/users/9594",
"pm_score": 4,
"selected": false,
"text": "Content-Encoding: gzip"
},
{
"answer_id": 13877091,
"author": "Sam Figueroa",
"author_id": 201524,
"author_... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1632/"
] |
250,576 | <p>In Visual Studio, is there any way to make the debugger break whenever a certain file (or class) is entered? Please don't answer "just set a breakpoint at the beginning of every method" :)</p>
<p>I am using C#.</p>
| [
{
"answer_id": 250594,
"author": "JC.",
"author_id": 3615,
"author_profile": "https://Stackoverflow.com/users/3615",
"pm_score": 2,
"selected": false,
"text": "System.Diagnostics.Debugger.Break();\n"
},
{
"answer_id": 539655,
"author": "devdimi",
"author_id": 54983,
"... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16012/"
] |
250,577 | <p>I have an Ant script with a junit target where I want it to start up the VM with a different working directory than the basedir. How would I do this?</p>
<p>Here's a pseudo version of my target.</p>
<pre><code><target name="buildWithClassFiles">
<mkdir dir="${basedir}/UnitTest/junit-reports"/>
<junit fork="true" printsummary="yes">
<classpath>
<pathelement location="${basedir}/UnitTest/bin"/>
<path refid="classpath.compile.tests.nojars"/>
</classpath>
<jvmarg value="-javaagent:${lib}/jmockit/jmockit.jar=coverage=:html"/>
<formatter type="xml" />
<test name="GlobalTests" todir="${basedir}/UnitTest/junit-reports" />
</junit>
</target>
</code></pre>
| [
{
"answer_id": 250651,
"author": "James Van Huis",
"author_id": 31828,
"author_profile": "https://Stackoverflow.com/users/31828",
"pm_score": 3,
"selected": false,
"text": " <junit fork=\"true\" printsummary=\"yes\" dir=\"workingdir\">\n"
},
{
"answer_id": 250927,
"author": "... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6583/"
] |
250,582 | <p>Which language for quick GUI app + sqlite database CRUD (2-4 tables). Java, Python? (Please no jokes like VBasic), some reference, source code to look on?</p>
<p>added:</p>
<p>First idea:
1 database SQLite (Win) + client GUI app (Win)
clients table + orders table + others
import, export database
add, del, edit, etc. entries</p>
<p>Second idea:
1 hosted database (PostgreSQL ,MySQL) + web app client
clients table + orders table + others
import, export database
add, del, edit, etc. entries</p>
<p>Thinking about Django, RoR or local Java(Netbeans), Python(wxPython+ORM).</p>
<p>???</p>
| [
{
"answer_id": 250967,
"author": "robintw",
"author_id": 1912,
"author_profile": "https://Stackoverflow.com/users/1912",
"pm_score": 3,
"selected": true,
"text": "scaffold"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9099/"
] |
250,583 | <p>I'm trying to get all property names / values from an Outlook item. I have custom properties in addition to the default outlook item properties. I'm using redemption to get around the Outlook warnings but I'm having some problems with the GetNamesFromIDs method on a Redemption.RDOMail Item....</p>
<p>I'm using my redemption session to get the message and trying to use the message to get the names of all the properties.</p>
<pre><code>Dim rMessage as Redemption.RDOMail = _RDOSession.GetMessageFromID(EntryID, getPublicStoreID())
Dim propertyList As Redemption.PropList = someMessage.GetPropList(Nothing)
For i As Integer = 1 To propertyList.Count + 1
Console.WriteLine(propertyList(i).ToString())
Console.WriteLine(someMessage.GetNamesFromIDs(________, propertyList(i)))
Next
</code></pre>
<p>I'm not totally sure what to pass in as the first parameter to getNamesFromIDs. The definition of GetNamesFromIDs is as follows:</p>
<pre><code>GetNamesFromIDs(MAPIProp as Object, PropTag as Integer) As Redemption.NamedProperty
</code></pre>
<p>I'm not totally sure what should be passed in as the MAPIProp object. I don't see this property referenced in the documentation. <a href="http://www.dimastr.com/redemption/rdo/MAPIProp.htm#properties" rel="nofollow noreferrer">http://www.dimastr.com/redemption/rdo/MAPIProp.htm#properties</a></p>
<p>Any help or insight would be greatly appreciated.</p>
| [
{
"answer_id": 250967,
"author": "robintw",
"author_id": 1912,
"author_profile": "https://Stackoverflow.com/users/1912",
"pm_score": 3,
"selected": true,
"text": "scaffold"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1385358/"
] |
250,597 | <p>I have a WPF TreeView with just 1 level of items. The TreeView is data bound to an ObservableCollection of strings. How can I ensure that the same icon appears to the left of each node in the TreeView?</p>
| [
{
"answer_id": 253243,
"author": "James Osborn",
"author_id": 6686,
"author_profile": "https://Stackoverflow.com/users/6686",
"pm_score": 4,
"selected": false,
"text": "<Style TargetType=\"{x:Type TreeViewItem}\">\n <Setter Property=\"HeaderTemplate\">\n <Setter.Value>\n ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/132931/"
] |
250,599 | <p>In the following code, used to get a list of products in a particular line, the command only returns results when I hard code (concatenate) <code>productLine</code> into the SQL. The parameter substitution never happens.</p>
<pre><code> + "lineName = '@productLine' "
+ "and isVisible = 1 ";
MySqlDataAdapter adap = new MySqlDataAdapter(sql, msc);
adap.SelectCommand.Parameters.Add("@productLine", productLine);
</code></pre>
| [
{
"answer_id": 250640,
"author": "Ian G",
"author_id": 31765,
"author_profile": "https://Stackoverflow.com/users/31765",
"pm_score": 0,
"selected": false,
"text": "+ \"lineName = '@productLine' \" \n"
},
{
"answer_id": 250659,
"author": "Omer van Kloeten",
"author_id": 49... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8741/"
] |
250,603 | <p>I'm sure I'm going to have to write supporting javascript code to do this. I have an autocomplete extender set up that selects values from a database table, when a selection is made, i would like it to set the ID of the value selected to a hidden control. I can do that by handling a value change on the text box and making a select call to the database, Select idCompany from Companies Where CompanyName = "the text box value"; </p>
<p>The most important thing is to constrain the values of the text box that is the targetcontrol for the autocomplete extender to ONLY use values from the autocomplete drop down. Is this possible with that control, is there examples somewhere? is there a better control to use (within the ajax control toolkit or standard .net framework - not a third party control)?</p>
<p>I'm going to be trying to work out some javascript, but I'll be checking back to this question to see if anyone has some useful links. I've been googling this last night for quite a while.</p>
<p>Update: I did not get an answer or any useful links, I've posted an almost acceptable user control that does what I want, with a few workable issues. </p>
| [
{
"answer_id": 265532,
"author": "stephenbayer",
"author_id": 18893,
"author_profile": "https://Stackoverflow.com/users/18893",
"pm_score": 3,
"selected": true,
"text": "<%@ Control Language=\"C#\" AutoEventWireup=\"true\" CodeFile=\"SelectCompany.ascx.cs\" Inherits=\"Controls_SelectComp... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18893/"
] |
250,616 | <p>A <a href="https://stackoverflow.com/questions/217618/construct-vs-sameasclassname-for-constructor-in-php">similar question discusses <code>__construct</code></a>, but I left it in my title for people searching who find this one.</p>
<p>Apparently, __get and __set take a parameter that is the variable being gotten or set. However, you have to know the variable name (eg, know that the age of the person is $age instead of $myAge). So I don't see the point if you HAVE to know a variable name, especially if you are working with code that you aren't familiar with (such as a library).</p>
<p>I found some pages that explain <a href="http://www.hudzilla.org/phpbook/read.php/6_14_2" rel="nofollow noreferrer"><code>__get()</code></a>, <a href="http://www.hudzilla.org/phpbook/read.php/6_14_3" rel="nofollow noreferrer"><code>__set()</code></a>, and <a href="http://www.hudzilla.org/phpbook/read.php/6_14_4" rel="nofollow noreferrer"><code>__call()</code></a>, but I still don't get why or when they are useful.</p>
| [
{
"answer_id": 250637,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": true,
"text": "__set()"
},
{
"answer_id": 250639,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackov... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572/"
] |
250,622 | <p>I'd trying to style my ComboBoxes to match the rest of the UI but I'm having problems with the IsMouseOver highlighting. It highlights with the color I specify for a second and then fades back to the default color, kind of a cool effect but not what I'm going for. Here is my style:</p>
<pre><code><Style TargetType="ComboBox">
<Style.Triggers>
<Trigger Property="ComboBox.IsMouseOver" Value="True">
<Setter Property = "Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</code></pre>
<p>What can I do to make the background color stay?</p>
| [
{
"answer_id": 252450,
"author": "Todd White",
"author_id": 30833,
"author_profile": "https://Stackoverflow.com/users/30833",
"pm_score": 3,
"selected": true,
"text": "<Style TargetType=\"{x:Type ComboBox}\">\n <Setter Property=\"Template\">\n <Setter.Value>\n <Contr... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21186/"
] |
250,643 | <p>I want to attach a 'click' event handler to the first child of an element with ID 'foo' using <a href="http://en.wikipedia.org/wiki/JQuery" rel="nofollow noreferrer">jQuery</a>. I understand that the syntax for doing this is:</p>
<pre><code>$('#foo:first-child').bind('click', function(event) {
// I want to access the first child here
})
</code></pre>
<p>Within the handler body I want to access the element which caused the event to be fired. I've read somewhere that you can't simply refer to it via 'this', so how can I access it?</p>
| [
{
"answer_id": 250656,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 2,
"selected": false,
"text": "$(this).doStuff()\n"
},
{
"answer_id": 250661,
"author": "Greg",
"author_id": 24181,
"author_profile": "htt... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648/"
] |
250,652 | <p>I use <code>_vimrc</code> to configure my vim 7.2 (windows) default settings. One setting "set number" will display line numbers on the left side. My vim background color is white (I cannot find setting for this. Maybe the default is white. Anyway I accept this setting).</p>
<p>I would like the background color for line numbers to be Grey or dimmed color. What is the command I can put in my <code>_vimrc</code> to configure this default setting?</p>
| [
{
"answer_id": 250686,
"author": "robert",
"author_id": 32805,
"author_profile": "https://Stackoverflow.com/users/32805",
"pm_score": 7,
"selected": true,
"text": "highlight LineNr ctermfg=grey ctermbg=white\n"
},
{
"answer_id": 250964,
"author": "David.Chu.ca",
"author_i... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250652",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62776/"
] |
250,679 | <p>I'm currently using <a href="http://magpierss.sourceforge.net/" rel="noreferrer">Magpie RSS</a> but it sometimes falls over when the RSS or Atom feed isn't well formed. Are there any other options for parsing RSS and Atom feeds with PHP?</p>
| [
{
"answer_id": 251102,
"author": "Brian Cline",
"author_id": 32536,
"author_profile": "https://Stackoverflow.com/users/32536",
"pm_score": 7,
"selected": false,
"text": "class BlogPost\n{\n var $date;\n var $ts;\n var $link;\n\n var $title;\n var $text;\n}\n\nclass BlogFee... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25343/"
] |
250,687 | <p>I'm having trouble getting a rails app on Dreamhost's Passenger to see compiled libraries in my ~/opt/lib directory. I have to put them here because I don't have root access. </p>
<p>I can boot up my app in ./script/console and it sees them libraries just fine because I updated my .bash_profile's <code>LD_LIBRARY_PATH</code> environment variable to include ~/opt/lib.</p>
<p>I've tried putting <code>ENV['LD_LIBRARY_PATH'] = '~/opt/lib'</code> in my environment.rb file but it doesn't seem too help. I get the following error from Passenger when I navigate to my site:
libodbcinst.so.1: cannot open shared object file: No such file or directory - /home/username/opt/lib/odbc.so</p>
<p>Anyone have experience with this?</p>
<p>Thanks</p>
| [
{
"answer_id": 423767,
"author": "aussiegeek",
"author_id": 51567,
"author_profile": "https://Stackoverflow.com/users/51567",
"pm_score": 1,
"selected": false,
"text": ".bashrc"
},
{
"answer_id": 431735,
"author": "sammich",
"author_id": 50276,
"author_profile": "http... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1766771/"
] |
250,688 | <p>I have the following HTML node structure:</p>
<pre><code><div id="foo">
<div id="bar"></div>
<div id="baz">
<div id="biz"></div>
</div>
<span></span>
</div>
</code></pre>
<p>How do I count the number of immediate children of <code>foo</code>, that are of type <code>div</code>? In the example above, the result should be two (<code>bar</code> and <code>baz</code>).</p>
| [
{
"answer_id": 250694,
"author": "Garry Shutler",
"author_id": 6369,
"author_profile": "https://Stackoverflow.com/users/6369",
"pm_score": 9,
"selected": true,
"text": "$(\"#foo > div\").length\n"
},
{
"answer_id": 250702,
"author": "gizmo",
"author_id": 9396,
"author... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648/"
] |
250,690 | <p>I'm looking for a good JavaScript RegEx to convert names to proper cases. For example:</p>
<pre><code>John SMITH = John Smith
Mary O'SMITH = Mary O'Smith
E.t MCHYPHEN-SMITH = E.T McHyphen-Smith
John Middlename SMITH = John Middlename SMITH
</code></pre>
<p>Well you get the idea.</p>
<p>Anyone come up with a comprehensive solution?</p>
| [
{
"answer_id": 250772,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": 1,
"selected": false,
"text": "Regex fixnames = new Regex(\"(Ma?C)?(\\w)(\\w*)(\\W*)\");\nstring newName = fixnames.Replace(badName, NameFixer);\n\n... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262775/"
] |
250,692 | <p>I'm building a class library that will have some public & private methods. I want to be able to unit test the private methods (mostly while developing, but also it could be useful for future refactoring).</p>
<p>What is the correct way to do this?</p>
| [
{
"answer_id": 250703,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": 2,
"selected": false,
"text": "internal"
},
{
"answer_id": 250748,
"author": "Jason Jackson",
"author_id": 13103,
"author_profil... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6522/"
] |
250,700 | <p>I'm trying to write a python script that packages our software. This script needs to build our product, and package it. Currently we have other scripts that do each piece individually which include csh, and perl scripts. One such script is run like:</p>
<pre><code>sudo mod args
</code></pre>
<p>where mod is a perl script; so in python I would do </p>
<pre><code>proc = Popen(['sudo', 'mod', '-p', '-c', 'noresource', '-u', 'dtt', '-Q'], stderr=PIPE, stdout=PIPE, stdin=PIPE)
</code></pre>
<p>The problem is that this mod script needs a few questions answered. For this I thought that the traditional </p>
<pre><code>(stdout, stderr) = proc.communicate(input='y')
</code></pre>
<p>would work. I don't think it's working because the process that Popen is controlling is sudo, not the mod script that is asking the question. Is there any way to communicate with the mod script and still run it through sudo?</p>
| [
{
"answer_id": 250804,
"author": "mipadi",
"author_id": 28804,
"author_profile": "https://Stackoverflow.com/users/28804",
"pm_score": 1,
"selected": false,
"text": "sudo"
},
{
"answer_id": 250819,
"author": "Rômulo Ceccon",
"author_id": 23193,
"author_profile": "https... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7949/"
] |
250,713 | <p>Why would a stored procedure that returns a table with 9 columns, 89 rows using this code take 60 seconds to execute (.NET 1.1) when it takes < 1 second to run in SQL Server Management Studio? It's being run on the local machine so little/no network latency, fast dev machine</p>
<pre><code>Dim command As SqlCommand = New SqlCommand(procName, CreateConnection())
command.CommandType = CommandType.StoredProcedure
command.CommandTimeout = _commandTimeOut
Try
Dim adapter As new SqlDataAdapter(command)
Dim i as Integer
For i=0 to parameters.Length-1
command.Parameters.Add(parameters(i))
Next
adapter.Fill(tableToFill)
adapter.Dispose()
Finally
command.Dispose()
End Try
</code></pre>
<p>my paramter array is typed (for this SQL it's only a single parameter)</p>
<pre><code>parameters(0) = New SqlParameter("@UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, True, 19, 0, "", DataRowVersion.Current, userID)
</code></pre>
<p>The Stored procedure is only a select statement like so:</p>
<pre><code>ALTER PROC [dbo].[web_GetMyStuffFool]
(@UserID BIGINT)
AS
SELECT Col1, Col2, Col3, Col3, Col3, Col3, Col3, Col3, Col3
FROM [Table]
</code></pre>
| [
{
"answer_id": 250961,
"author": "HTTP 410",
"author_id": 13118,
"author_profile": "https://Stackoverflow.com/users/13118",
"pm_score": 7,
"selected": true,
"text": "SET ARITHABORT OFF"
},
{
"answer_id": 492868,
"author": "Steve Wright",
"author_id": 3256,
"author_pro... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3256/"
] |
250,717 | <p>I'm trying to write a log parsing script to extract failed events. I can pull these with grep:</p>
<pre><code>$ grep -A5 "FAILED" log.txt
2008-08-19 17:50:07 [7052] [14] DEBUG: data: 3a 46 41 49 4c 45 44 20 20 65 72 72 3a 30 32 33 :FAILED err:023
2008-08-19 17:50:07 [7052] [14] DEBUG: data: 20 74 65 78 74 3a 20 00 text: .
2008-08-19 17:50:07 [7052] [14] DEBUG: Octet string dump ends.
2008-08-19 17:50:07 [7052] [14] DEBUG: SMPP PDU dump ends.
2008-08-19 17:50:07 [7052] [14] DEBUG: SMPP[test] handle_pdu, got DLR
2008-08-19 17:50:07 [7052] [14] DEBUG: DLR[internal]: Looking for DLR smsc=test, ts=1158667543, dst=447872123456, type=2
--
2008-08-19 17:50:07 [7052] [8] DEBUG: data: 3a 46 41 49 4c 45 44 20 20 65 72 72 3a 30 32 34 :FAILED err:024
2008-08-19 17:50:07 [7052] [8] DEBUG: data: 20 74 65 78 74 3a 20 00 text: .
2008-08-19 17:50:07 [7052] [8] DEBUG: Octet string dump ends.
2008-08-19 17:50:07 [7052] [8] DEBUG: SMPP PDU dump ends.
2008-08-19 17:50:07 [7052] [8] DEBUG: SMPP[test] handle_pdu, got DLR
2008-08-19 17:50:07 [7052] [8] DEBUG: DLR[internal]: Looking for DLR smsc=test, ts=1040097716, dst=447872987654, type=2
</code></pre>
<p>What I'm interested in is, for each block, the error code (i.e. the "023" part of ":FAILED err:023" on the first line) and the dst number (i.e."447872123456" from "dst=447872123456" on the last line.)</p>
<p>Can anyone help with a shell one-liner to extract those two values, or provide some hints as to how I should approach this?</p>
| [
{
"answer_id": 250761,
"author": "Michael Gundlach",
"author_id": 4105,
"author_profile": "https://Stackoverflow.com/users/4105",
"pm_score": 3,
"selected": true,
"text": "grep -A 5 FAILED log.txt | \\ # Get FAILED and dst and other lines\n egrep '(FAILED|dst=)' | \\ ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
250,718 | <p>If I grant execute permissions to a role via</p>
<pre><code>GRANT EXECUTE ON [DBO].[MYPROC] TO MY_ROLE
</code></pre>
<p>what's the equivalent syntax to remove them?</p>
| [
{
"answer_id": 250724,
"author": "Godeke",
"author_id": 28006,
"author_profile": "https://Stackoverflow.com/users/28006",
"pm_score": 4,
"selected": false,
"text": "DENY EXECUTE ON [DBO].[MYPROC] TO MY_ROLE\n"
},
{
"answer_id": 250726,
"author": "Marcus King",
"author_id"... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4540/"
] |
250,755 | <p>I'm trying to export a Crystal Report to an HTML file, but when I call the Export method, I immediately get this error:</p>
<blockquote>
<p><strong>Source</strong>: Crystal Reports ActiveX Designer </p>
<p><strong>Description</strong>: Failed to export the report.</p>
</blockquote>
<p>I have tried both crEFTHTML40 and crEFTHTML32Standard as export format types - and both result in the same error.</p>
<p>Here is a highly simplified version of what I'm doing:</p>
<pre><code>Dim objCRReport As CRAXDRT.Report
[...]
objCRReport.ExportOptions.FormatType = 32 'crEFTHTML40
objCRReport.ExportOptions.DestinationType = 1 'crEDTDiskFile
objCRReport.ExportOptions.DiskFileName = "C:\reportInHtmlFormat.html"
objCRReport.Export False '<--- "Failed to export the report" error here
</code></pre>
<p>Please note that I am referencing the "Crystal Reports 9 ActiveX Designer Runtime Library" specifically.</p>
| [
{
"answer_id": 269715,
"author": "user35193",
"author_id": 35193,
"author_profile": "https://Stackoverflow.com/users/35193",
"pm_score": 2,
"selected": true,
"text": "[...]"
},
{
"answer_id": 2149646,
"author": "ANeto",
"author_id": 260378,
"author_profile": "https://... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21263/"
] |
250,757 | <p>I'm writing an application using Qt4.</p>
<p>I need to download a very short text file from a given http address.</p>
<p>The file is short and is needed for my app to be able to continue, so I would like to make sure the download is blocking (or will timeout after a few seconds if the file in not found/not available).</p>
<p>I wanted to use QHttp::get(), but this is a non-blocking method.</p>
<p>I thought I could use a thread : my app would start it, and wait for it to finish. The thread would handle the download and quit when the file is downloaded or after a timeout.</p>
<p>But I cannot make it work :</p>
<pre><code>class JSHttpGetterThread : public QThread
{
Q_OBJECT
public:
JSHttpGetterThread(QObject* pParent = NULL);
~JSHttpGetterThread();
virtual void run()
{
m_pHttp = new QHttp(this);
connect(m_pHttp, SIGNAL(requestFinished(int, bool)), this, SLOT(onRequestFinished(int, bool)));
m_pHttp->setHost("127.0.0.1");
m_pHttp->get("Foo.txt", &m_GetBuffer);
exec();
}
const QString& getDownloadedFileContent() const
{
return m_DownloadedFileContent;
}
private:
QHttp* m_pHttp;
QBuffer m_GetBuffer;
QString m_DownloadedFileContent;
private slots:
void onRequestFinished(int Id, bool Error)
{
m_DownloadedFileContent = "";
m_DownloadedFileContent.append(m_GetBuffer.buffer());
}
};
</code></pre>
<p>In the method creating the thread to initiate the download, here is what I'm doing :</p>
<pre><code>JSHttpGetterThread* pGetter = new JSHttpGetterThread(this);
pGetter->start();
pGetter->wait();
</code></pre>
<p>But that doesn't work and my app keeps waiting. It looks lit the slot 'onRequestFinished' is never called.</p>
<p>Any idea ?</p>
<p>Is there a better way to do what I'm trying to do ?</p>
| [
{
"answer_id": 250950,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": false,
"text": "QThread::quit()"
},
{
"answer_id": 251631,
"author": "Dusty Campbell",
"author_id": 2174,
"author_profile"... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250757",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2796/"
] |
250,766 | <p>I am using a Windows XP Home Edition. I need to install a few extensions to PHP -- memcache, APC, .etc. And I would very much like to use PECL to make this happen. The problem is PECL takes it for granted that I will have certain programs on my computer. On another post, I read, for instance, that you need to have Microsoft Visual Studio C++ installed on your machine. However, the new version of Visual Studio, which I downloaded, does not have msdev.exe and instead uses vcbuild.exe, which has a completely different api and fails to compile the .dsp files that come with these modules. </p>
<p>So I tried to find a script that would upgrade the dsp to work with vcbuild.exe...and it turns out vcbuild.exe can do that, but of course that didn't pan out. </p>
<p>Another thing I tried was to find a make script for Windows (nmake2make). But there was no make file in the module's root folder.</p>
<p>I tried also downloading Cygwin and MinGW in hopes of finding a build script that would work as simply as in *nix operating systems, but to no avail. </p>
<p>How else do I use install PHP extensions on a Windows machine? Can anyone help me out of this predicament?</p>
| [
{
"answer_id": 250806,
"author": "Robert K",
"author_id": 24950,
"author_profile": "https://Stackoverflow.com/users/24950",
"pm_score": 2,
"selected": false,
"text": "C:\\xampp\\php\\ext"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32816/"
] |
250,774 | <p>I want to make some passages of a standard tooltip bold in a WinForms application. Is this possible?</p>
<p>If not, is there a (free) tooltip component that allows me to style them (preferably also border and background)?</p>
<p>Thanks!</p>
| [
{
"answer_id": 20812702,
"author": "user3141530",
"author_id": 3141530,
"author_profile": "https://Stackoverflow.com/users/3141530",
"pm_score": -1,
"selected": false,
"text": "_toolTip.SetToolTip(button, String.Format(\"<font face=\\\"Microsoft Yahei\\\" color=\\\"blue\\\">{0}</font>\",... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
250,779 | <p>I was taught that a regression test was a small (only enough to prove you didn't break anything with the introduction of a change or new modules) sample of the overall tests. However, <a href="http://www.iceincusa.com/16csp/content/16_smoke/smkrgt.htm" rel="noreferrer">this article</a> by Ron Morrison and Grady Booch makes me think differently:</p>
<blockquote>
<p>The desired strategy would be to bring each unit in one at a time, perform an extensive regression test, correct any defects and then proceed to the next unit.</p>
</blockquote>
<p>The same document also says:</p>
<blockquote>
<p>As soon as a small number of units are added, a test version is generated and "smoke tested," wherein a small number of tests are run to gain confidence that the integrated product will function as expected. The intent is neither to thoroughly test the new unit(s) nor to completely regression test the overall system.</p>
</blockquote>
<p>When describing smoke testing, the authors say this:</p>
<blockquote>
<p>It is also important that the Smoke Test perform a quick check of the entire system, not just the new component(s).</p>
</blockquote>
<p>I've never seen "extensive" and "regression test" used together nor a regression test described as "completely regression test the overall system". Regression tests are supposed to be as light and quick as possible. And the definition of smoke test is what I learned a regression test was.</p>
<p>Did I misunderstand what I was taught? Was I taught incorrectly? Or are there multiple interpretations of "regression test"?</p>
| [
{
"answer_id": 250783,
"author": "Bill the Lizard",
"author_id": 1288,
"author_profile": "https://Stackoverflow.com/users/1288",
"pm_score": 4,
"selected": true,
"text": "Foo"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572/"
] |
250,789 | <p>I have a CSV data file with rows that may have lots of columns 500+ and some with a lot less. I need to transpose it so that each row becomes a column in the output file. The problem is that the rows in the original file may not all have the same number of columns so when I try the transpose method of array I get:</p>
<blockquote>
<p>`transpose': element size differs (12 should be 5) (IndexError)</p>
</blockquote>
<p>Is there an alternative to transpose that works with uneven array length?</p>
| [
{
"answer_id": 250926,
"author": "bltxd",
"author_id": 11892,
"author_profile": "https://Stackoverflow.com/users/11892",
"pm_score": 4,
"selected": true,
"text": "a = [[1, 2, 3], [3, 4]]\n\n# This would throw the error you're talking about\n# a.transpose\n\n# Largest row\nsize = a.max { ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6805/"
] |
250,790 | <p>So I'm creating some HTML using javascript based on where the user clicks on the page. On page load the script replaces an empty div with a ul and some data. The user clicks on that data to receive more and so on. Now when the user navigates off the page and then hits the back button to go back to the page, IE displays a blank page with the replaced divs, in all other browsers, FF, Opera, Safari, the page either reloads to the initial ul or goes back to the last state with the dynamic data in it.</p>
<p>Anyone have an idea as to what might be happening here? Any help is appreciated.</p>
| [
{
"answer_id": 250926,
"author": "bltxd",
"author_id": 11892,
"author_profile": "https://Stackoverflow.com/users/11892",
"pm_score": 4,
"selected": true,
"text": "a = [[1, 2, 3], [3, 4]]\n\n# This would throw the error you're talking about\n# a.transpose\n\n# Largest row\nsize = a.max { ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
250,792 | <p>We're looking for a way to log any call to stored procedures in Oracle, and see what parameter values were used for the call.</p>
<p>We're using Oracle 10.2.0.1</p>
<p>We can log SQL statements and see the bound variables, but when we track stored procedures we see bind variables B1, B2, etc. but no values.</p>
<p>We'd like to see the same kind of information we've seen in MS SQL Server Profiler.</p>
<p>Thanks for any help</p>
| [
{
"answer_id": 251665,
"author": "Clyde",
"author_id": 945,
"author_profile": "https://Stackoverflow.com/users/945",
"pm_score": 0,
"selected": false,
"text": "Begin dbo.UPKG_PACKAGENAME.PROC(:v0, :v1, :v2 ...); End;\n/\nBegin dbo.UPKG_PACKAGENAME.PROC2(:v0, :v1, :v2 ...); End;\n/\n...\n... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/945/"
] |
250,794 | <p>I realize this would violate convention, but I'm curious to know if you can do this through configuration.</p>
<p><strong>Edit: I understand why I wouldn't want to do this. BUT, I do want to understand the internals of this time of project.</strong></p>
| [
{
"answer_id": 250825,
"author": "Larsenal",
"author_id": 337,
"author_profile": "https://Stackoverflow.com/users/337",
"pm_score": 1,
"selected": false,
"text": "internal const string CodeDirectoryName = \"App_Code\";\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/337/"
] |
250,801 | <p>Hi does anybody know how to initialize two list at the same time with ajax?</p>
<p>This is my code</p>
<pre><code><html>
<body onload="iniciaListas()">
<script type="text/javascript">
var xmlHttp
function iniciaListas()
{
muestraListaPaises();
muestraListaProfesiones();
}
function muestraListaProfesiones()
{
//Se inicializa el objeto ajax para manipular los eventos asincronos al servidor
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
//Se obtine el id de la lista
var obCon = document.getElementById("ocupacion");
//Por medio del metodo GET se llama nuestra pagina PHP
xmlHttp.open("GET", "../Listas/listaProfesiones.php");
//On ready funcion es la funcion que se da cuenta cuando la pagina php acaba de hacer su proceso
xmlHttp.onreadystatechange = function() {
//el estado 4 indica que esta listo para procesar la instruccion
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
//despues que nuestro objeto ajax proceso la pagina php recupera un xml generado
obXML = xmlHttp.responseXML;
//despues obtine los datos contenidos en las siguites etiquetas
obCod = obXML.getElementsByTagName("ID");
obDes = obXML.getElementsByTagName("NOMPROFESION");
//esta funcion devuelve en su la longitud de todos los registros
obCon.length=obCod.length;
//cilclo de llenado para las listas
for (var i=0; i<obCod.length;i++) {
obCon.options[i].value=obCod[i].firstChild.nodeValue;
obCon.options[i].text=obDes[i].firstChild.nodeValue;
}
}
}
//este objeto envia un nulll debido a que el metodo utilizado es get
xmlHttp.send(null);
}
function muestraListaPaises()
{
//Se inicializa el objeto ajax para manipular los eventos asincronos al servidor
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
//Se obtine el id de la lista
var obCon = document.getElementById("pais");
//Por medio del metodo GET se llama nuestra pagina PHP
xmlHttp.open("GET", "../Listas/listaPaises.php");
//On ready funcion es la funcion que se da cuenta cuando la pagina php acaba de hacer su proceso
xmlHttp.onreadystatechange = function() {
//el estado 4 indica que esta listo para procesar la instruccion
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
//despues que nuestro objeto ajax proceso la pagina php recupera un xml generado
obXML = xmlHttp.responseXML;
//despues obtine los datos contenidos en las siguites etiquetas
obCod = obXML.getElementsByTagName("ID");
obDes = obXML.getElementsByTagName("NOMPAIS");
//esta funcion devuelve en su la longitud de todos los registros
obCon.length=obCod.length;
//cilclo de llenado para las listas
for (var i=0; i<obCod.length;i++) {
obCon.options[i].value=obCod[i].firstChild.nodeValue;
obCon.options[i].text=obDes[i].firstChild.nodeValue;
}
}
}
//este objeto envia un nulll debido a que el metodo utilizado es get
xmlHttp.send(null);
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
</script>
<html>
<body onload="iniciaListas()">
<script type="text/javascript" src="lists.js"> </script>
<b>Country</b><br>
<select name="pais" id="pais" ></select>
<b>Ocupation</b><br>
<select name="pais" id="pais" ></select>
</body>
</html>
</code></pre>
| [
{
"answer_id": 250820,
"author": "Chris Marasti-Georg",
"author_id": 96,
"author_profile": "https://Stackoverflow.com/users/96",
"pm_score": 2,
"selected": false,
"text": "//Se obtine el id de la lista\nvar obCon = document.getElementById(\"pais\");\nvar obOcupation = document.getElement... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
250,818 | <p>How do I find a stored procedure in a Sybase database given a text string that appears somewhere in the proc? I want to see if any other proc in the db has similar logic to the one I'm looking at, and I think I have a pretty unique search string (literal)</p>
<p>Edit:</p>
<p>I'm using Sybase version 11.2</p>
| [
{
"answer_id": 250862,
"author": "Graeme Perrow",
"author_id": 1821,
"author_profile": "https://Stackoverflow.com/users/1821",
"pm_score": 3,
"selected": false,
"text": "select * from SYS.SYSPROCEDURE where proc_defn like '%whatever%'\n"
},
{
"answer_id": 268773,
"author": "A... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5472/"
] |
250,840 | <p>The TextWrapping property of the TextBox has three possible values:</p>
<ul>
<li>Wrap</li>
<li>NoWrap</li>
<li>WrapWithOverflow</li>
</ul>
<p>I would like to bind to the IsChecked property of a MenuItem. If the MenuItem is checked, I want to set the TextWrapping property of a TextBox to Wrap. If the MenuItem is not checked, I want to set the TextWrapping property of the TextBox to NoWrap.</p>
<p>To sum up, I am trying to bind a control that has two states to two values of an enumeration that has more than two values.</p>
<p><strong>[edit]</strong> I would like to accomplish this in XAML, if possible.</p>
<p><strong>[edit]</strong> I figured out how to do this using an IValueConverter. Perhaps there is a better way to do this? Here is what I did:</p>
<hr>
<p>In Window.Resources, I declared a reference to my ValueConverter.</p>
<pre><code><local:Boolean2TextWrapping x:Key="Boolean2TextWrapping" />
</code></pre>
<p>In my TextBox, I created the binding to a MenuItem and included the Converter in the binding statement.</p>
<pre><code>TextWrapping="{Binding ElementName=MenuItemWordWrap, Path=IsChecked, Converter={StaticResource Boolean2TextWrapping}}"
</code></pre>
<p>and the ValueConverter looks like this:</p>
<pre><code>public class Boolean2TextWrapping : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo cultureInfo)
{
if (((bool)value) == false)
{
return TextWrapping.NoWrap;
}
return TextWrapping.Wrap;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
</code></pre>
| [
{
"answer_id": 252284,
"author": "Todd White",
"author_id": 30833,
"author_profile": "https://Stackoverflow.com/users/30833",
"pm_score": 4,
"selected": true,
"text": "<StackPanel>\n <CheckBox x:Name=\"WordWrap\">Word Wrap</CheckBox>\n <TextBlock Width=\"50\">\n Lorem ipsum ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12919/"
] |
250,845 | <blockquote>
<p>Clarification: this is not about <em>user agent</em> calls to pages, but Classic ASP calling ASP.NET!</p>
</blockquote>
<p>I have applications that are midway through a transition from Classic ASP to ASP.NET. There are a half million lines of code, so a complete rewrite of everything at once was simply not plausible, or frankly prudent considering that the vast majority of Classic ASP pages work just fine. We translate pages and functionality as they come up for revision <em>anyway</em>, not just because it is "cool".</p>
<p>Now that about half the pages have been converted we have moved some of the key functionality over to ASP.NET. Instead of keeping the legacy versions of this functionality (which means two places to maintain instead of one) I have been moving towards using SOAP to expose this functionality.</p>
<p>Well... not really. Instead, we have been using what I used to call "Poor Man's SOAP", although today it is trendy to call it REST. I have been using ServerXMLHTTP to contact the destination page, bundling up a ball of XML and POSTing it over to the ASP.NET side. For the result I have been bundling up some XML and using XPATH to tear it down into variables.</p>
<p>All of this works surprisingly well. However, I have been contemplating the built in ASP.NET SOAP features, which would seem to remove the need to custom write landing pages for my cross platform calls... but when I look at consuming SOAP from Classic ASP most suggest using the seemingly depreciated Soap Toolkit. </p>
<p>The question is; do any of you have experience with this kind of setup and if so are there any better ways to do it than custom REST pages or Soap Toolkit? I think being able to expose more of the ASP.NET functionality quicker would help with the migration, but I don't want to get myself mired in legacy technology like Soap Toolkit unnecessarily.</p>
| [
{
"answer_id": 1749591,
"author": "wwilkins",
"author_id": 4098,
"author_profile": "https://Stackoverflow.com/users/4098",
"pm_score": 1,
"selected": false,
"text": "Set xmlhttp = CreateObject(\"MSXML2.ServerXMLHTTP\") \nxmlhttp.open \"POST\", soapServer, False\n... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28006/"
] |
250,846 | <p>I am loading some data from an XML document, modifying it, and writing back out to XML. The reading is done using a SAX parser library and the writing is done with a piece of custom code. Sometimes, the file is modified externally, and extra elements are added (such as references to stylesheets). Rather than losing these extra elements when I load and save the file, I would like to pass through any unknown tags so that they appear </p>
<p>When unknown elements are separate from interpreted elements, it should be straightforward to save unknown elements and attributes as strings and output these afterwards, but when they are interspersed and nested inside interpreted elements, it becomes less obvious. </p>
<p>Can anybody suggest a succinct way to do this? Would it be simpler to switch to a DOM parser? Performance is not an issue.</p>
<p><em>NB.</em> I am working in C++ with the Gnome Glib::Markup::Parser, but would prefer language/library agnostic answers.</p>
| [
{
"answer_id": 251295,
"author": "ChuckB",
"author_id": 28605,
"author_profile": "https://Stackoverflow.com/users/28605",
"pm_score": 1,
"selected": false,
"text": "startElement()"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32817/"
] |
250,849 | <p>Similar to the one here on StackOverFlow, I would be needing to implement a way for people to vote up and vote down comments in a forum like site.</p>
<p>However instead of having a generic overall score, we will display the total amount of "thumbs up" and "thumbs down". The overall score will be needed for filtering purposes, such as "sort by highest rated", "show only ratings with + 3"</p>
<p>What is the best implementation strategy?</p>
<p>As a user suggested, I would also be storing the information who casted the vote</p>
| [
{
"answer_id": 250861,
"author": "Oli",
"author_id": 12870,
"author_profile": "https://Stackoverflow.com/users/12870",
"pm_score": 3,
"selected": true,
"text": "SUM-WHERE"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32372/"
] |
250,867 | <p>Assuming a table of tags like the stackoverflow question tags:</p>
<blockquote>
<p>TagID (bigint), QuestionID (bigint), Tag (varchar)</p>
</blockquote>
<p>What is the most efficient way to get the 25 most used tags using LINQ? In SQL, a simple GROUP BY will do:</p>
<pre><code>SELECT Tag, COUNT(Tag) FROM Tags GROUP BY Tag
</code></pre>
<p>I've written some LINQ that works:</p>
<pre><code>var groups = from t in DataContext.Tags
group t by t.Tag into g
select new { Tag = g.Key, Frequency = g.Count() };
return groups.OrderByDescending(g => g.Frequency).Take(25);
</code></pre>
<p>Like, really? Isn't this mega-verbose? The sad thing is that I'm doing this to save a massive number of queries, as my Tag objects already contain a Frequency property that would otherwise need to check back with the database for every Tag if I actually used the property.</p>
<p>So I then parse these anonymous types <em>back</em> into Tag objects:</p>
<pre><code>groups.OrderByDescending(g => g.Frequency).Take(25).ToList().ForEach(t => tags.Add(new Tag()
{
Tag = t.Tag,
Frequency = t.Frequency
}));
</code></pre>
<p>I'm a LINQ newbie, and this doesn't seem right. Please show me how it's really done.</p>
| [
{
"answer_id": 250910,
"author": "GalacticCowboy",
"author_id": 29638,
"author_profile": "https://Stackoverflow.com/users/29638",
"pm_score": 5,
"selected": false,
"text": "var groups = from t in DataContext.Tags\n group t by t.Tag into g\n select new Tag() { Tag ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192/"
] |
250,868 | <p>I've heard that there are some things one cannot do as a computer programmer, but I don't know what they are. One thing that occurred to me recently was: wouldn't it be nice to have a class that could make a copy of the source of the program it runs, modify that program and add a method to the class that it is, and then run the copy of the program and terminate itself. Is it possible for code to write code?</p>
| [
{
"answer_id": 250893,
"author": "dlamblin",
"author_id": 459,
"author_profile": "https://Stackoverflow.com/users/459",
"pm_score": 5,
"selected": true,
"text": "#include<stdio.h>\n\nmain()\n{\n char *a = \"main(){char *a = %c%s%c; int b = '%c'; printf(a,b,a,b,b);}\";\n int b = '\"';\n... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29182/"
] |
250,874 | <p>How do implement the iterator pattern in <a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET" rel="nofollow noreferrer">VB.NET</a>, which does not have the <code>yield</code> keyword?</p>
| [
{
"answer_id": 5712861,
"author": "Sam Saffron",
"author_id": 17174,
"author_profile": "https://Stackoverflow.com/users/17174",
"pm_score": 5,
"selected": true,
"text": "Private Iterator Function SomeNumbers() As IEnumerable\n ' Use multiple yield statements.\n Yield 3\n Yield 5... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31766/"
] |
250,890 | <p>I have a <code>QDirModel</code> whose current directory is set. Then I have a <code>QListView</code> which is supposed to show the files in that directory. This works fine.</p>
<p>Now I want to limit the files shown, so it only shows <em>png</em> files (the filename ends with .png). The problem is that using a <code>QSortFilterProxyModel</code> and setting the filter regexp will try to match every parent of the files as well. According to the documentation:</p>
<blockquote>
<p>For hierarchical models, the filter is
applied recursively to all children.
If a parent item doesn't match the
filter, none of its children will be
shown.</p>
</blockquote>
<p>So, how do I get the <code>QSortFilterProxyModel</code> to only filter the files in the directory, and not the directories it resides in?</p>
| [
{
"answer_id": 253949,
"author": "Caleb Huitt - cjhuitt",
"author_id": 9876,
"author_profile": "https://Stackoverflow.com/users/9876",
"pm_score": 3,
"selected": false,
"text": "filterAcceptsRow"
},
{
"answer_id": 4106006,
"author": "RoLi",
"author_id": 498317,
"autho... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1585/"
] |
250,901 | <p>I was wondering what would be the best approach you guys would take to relocate an entire Eclipse workspace? Assuming it's either versioned and exported, what would you do? Import the file? Checkout the whole thing from the repo? Thanks much in advance!</p>
| [
{
"answer_id": 250908,
"author": "matt b",
"author_id": 4249,
"author_profile": "https://Stackoverflow.com/users/4249",
"pm_score": 0,
"selected": false,
"text": "Switch workspace"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6992/"
] |
250,911 | <p>An application I am working on reads information from files to populate a database. Some of the characters in the files are non-English, for example accented French characters.</p>
<p>The application is working fine in Windows but on our Solaris machine it is failing to recognise the special characters and is throwing an exception. For example when it encounters the accented e in "Gérer" it says :-</p>
<pre> Encountered: "\u0161" (353), after : "\'G\u00c3\u00a9rer les mod\u00c3"</pre>
<p>(an exception which is thrown from our application)</p>
<p>I suspect that in order to stop this from happening I need to change the file.encoding property of the JVM. I tried to do this via System.setProperty() but it has not stopped the error from occurring.</p>
<p>Are there any suggestions for what I could do? I was thinking about setting the basic locale of the solaris platform in /etc/default/init to be UTF-8. Does anyone think this might help?</p>
<p>Any thoughts are much appreciated.</p>
| [
{
"answer_id": 250944,
"author": "sakana",
"author_id": 28921,
"author_profile": "https://Stackoverflow.com/users/28921",
"pm_score": 2,
"selected": false,
"text": "java -Dfile.encoding=UTF-8 ...\n"
},
{
"answer_id": 250947,
"author": "sblundy",
"author_id": 4893,
"au... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250911",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22061/"
] |
250,931 | <p>I have some HTML that displays fine on FireFox3/Opera/Safari but not with IE7. The snippet is as follows:</p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body bgcolor="#AA5566" >
<table width="100%">
<tr>
<td height="37" valign="top"><img style="float:right;" border="0" src="foo.png" width="37" height="37"/></td>
<td width="600" rowspan="2" >
<table width="600" height="800"><tr><td><img src="bar.jpg" width="600" height="800"/></td></tr></table>
</td>
<td height="37" valign="top"><img style="float:left;" border="0" src="foo.png" width="37" height="37"/></td>
</tr>
<!-- This row doesnt fill the vertical space on IE7 //-->
<tr>
<td valign="top" bgcolor="#112233">&nbsp;</td>
<td valign="top" bgcolor="#112233">&nbsp;</td>
</tr>
</table>
</body>
</code></pre>
<p>The second row wont fill the vertical space created by the first rows middle column (notice the rowspan="2") correctly. Instead the first rows 1st and 3rd columns expand down even though I set their height to 37. The image below shows what happens in IE7 and Firefox3...</p>
<p><img src="https://i.stack.imgur.com/DpxMK.png" alt="alt text"></p>
<p>EDIT: added the HTML doc type to the code snippit. Added a screenshot.</p>
<p>Any help appreciated, thanks :)</p>
| [
{
"answer_id": 251315,
"author": "Eli",
"author_id": 27580,
"author_profile": "https://Stackoverflow.com/users/27580",
"pm_score": 3,
"selected": true,
"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14260/"
] |
250,932 | <p>I have a hyper link like this :</p>
<pre><code><A Href=My_Java_Servlet?User_Action=Admin_Download_Records&User_Id=Admin onClick=\"Check_Password();\" target=_blank>Download Records</A>
</code></pre>
<p>When a user clicks on it, a password window will open, the user can try 3 times for the right password.</p>
<p>The Javascript looks like this :</p>
<pre><code><Script Language="JavaScript">
function Check_Password()
{
var testV=1;
var pass1=prompt('Password','');
while (testV<3)
{
if (!pass1) history.go(-1);
if (pass1=="password") { return true; }
testV+=1;
var pass1=prompt('Access Denied - Password Incorrect.','');
}
return "false";
}
</Script>
</code></pre>
<p>If user enters the wrong password 3 times, it's supposed to not do anything, but it still opens a new window and displays the protected info, how to fix the javascript or my html hyper link so only the right password will open a new target window, a wrong password will make it do nothing ?</p>
| [
{
"answer_id": 250943,
"author": "kͩeͣmͮpͥ ͩ",
"author_id": 26479,
"author_profile": "https://Stackoverflow.com/users/26479",
"pm_score": 1,
"selected": false,
"text": "false"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32834/"
] |
250,937 | <p>I have a very simple ASP.Net page that acts as a front end for a stored procedure. It just runs the procedure and shows the output using a gridview control: less than 40 lines of total code, including aspx markup. The stored procedure itself is very... volatile. It's used for a number of purposes and the output format changes regularly. </p>
<p>The whole thing works great, because the gridview control doesn't really need to care what columns the stored procedure returns: it just shows them on the page, which is exactly what I want.</p>
<p>However, the database this runs against has a number of datetime columns all over the place where the time portion isn't really important- it's always zeroed out. What I would like to be able to do is control the formatting of just the datetime columns in the gridview, without ever knowing precisely which columns those will be. Any time a column in the results has a datetime type, just apply a given format string that will trim off the time component.</p>
<p>I know I could convert to a varchar at the database, but I'd really don't want to have to make developers care about formatting in the query and this belongs at the presentation level anyway. Any other ideas?</p>
<hr>
<p>Finally got this working in an acceptable (or at least improved) way using this code:</p>
<pre><code>Protected Sub OnRowDatabound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim d As DateTime
For Each cell As TableCell In e.Row.Cells
If Date.TryParse(cell.Text, d) AndAlso d.TimeOfDay.Ticks = 0 Then
cell.Text = d.ToShortDateString()
End If
Next cell
End If
End Sub
</code></pre>
| [
{
"answer_id": 250963,
"author": "Eoin Campbell",
"author_id": 30155,
"author_profile": "https://Stackoverflow.com/users/30155",
"pm_score": 2,
"selected": false,
"text": "<asp:BoundField DataField=\"Whatever\" ... DataFormatString=\"{0:dd/MM/yyyy}\" HtmlEncode=\"False\"/ > \n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250937",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] |
250,940 | <p>I have an SQLite table that contains a BLOB I need to do a size/length check on. How do I do that?</p>
<p>According to documentation <code>length(blob)</code> only works on texts and will stop counting after the first NULL. My tests confirmed this. I'm using SQLite 3.4.2.</p>
| [
{
"answer_id": 251134,
"author": "Javier",
"author_id": 11649,
"author_profile": "https://Stackoverflow.com/users/11649",
"pm_score": 7,
"selected": true,
"text": "length(hex(glob))/2"
},
{
"answer_id": 3780193,
"author": "Chris",
"author_id": 456378,
"author_profile"... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2815/"
] |
250,969 | <p>I believe that quantifying the productivity increase (extra working hours) is the most effective way to do this.</p>
<p>My case in point: I have a fast machine at home and a slow one at work. My estimate is that I would gain about 30 minutes a day of extra productivity at work if I had my home machine at work. This productivity would come from less waiting to do all the tasks that I do. (An extra 30 minutes a day is about 3 weeks a year.)</p>
<p>Problem: I need to measure this.</p>
<p>Is there a software utility that can monitor and scientifically quantify time taken by tasks on a machine?</p>
| [
{
"answer_id": 251047,
"author": "warren",
"author_id": 4418,
"author_profile": "https://Stackoverflow.com/users/4418",
"pm_score": 0,
"selected": false,
"text": "time"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1463/"
] |
250,970 | <p>The object I’m working on is instantiated in JavaScript, but used in VBScript. In one code path, the variable <code>M.DOM.IPt</code> is defined and has a value, in the other however it is not. I need to detect if it has been defined or not. I checked that <code>M.DOM</code> is defined and accessable in both code paths. Every test I have tried simply results in this error:</p>
<blockquote>
<p>Error: Object doesn't support this property or method</p>
</blockquote>
<p>I have tried:</p>
<ul>
<li><code>IsEmpty(M.DOM.IPt)</code></li>
<li><code>M.DOM.IPt is Nothing</code></li>
<li><code>isNull(M.DOM.IPt)</code></li>
</ul>
<p>Is there any way to detect the variable isn’t defined and avoid the error?</p>
<p>Note: I can put <code>On Error Resume Next</code> in and it will simply ignore the error, but I actually need to detect it and conditionally do something about it.</p>
| [
{
"answer_id": 251107,
"author": "Arvo",
"author_id": 35777,
"author_profile": "https://Stackoverflow.com/users/35777",
"pm_score": 1,
"selected": false,
"text": "On Error Resume Next\nErr.Clear\nMyVariable=M.DOM.Ipt\nIf Err.Number<> 0 Then\n 'error occured - Ipt not defined\n 'do ... | 2008/10/30 | [
"https://Stackoverflow.com/questions/250970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80/"
] |
250,973 | <p>I wanted to write a Visual Studio Macro or something similar which can fetch function name and insert into preset location in the error report part. It's clearer if you look at the example</p>
<pre><code>Class SampleClass
{
public void FunctionA()
{
try
{
//Do some work here
}
catch (Exception ex)
{
Logger.WriteLine(LogLevelEnum.Error, "SampleClass", "FunctionA Failed");
Logger.WriteLine(LogLevelEnum.Error, "FunctionA", ex.ToString());
}
finally
{
}
}
}
</code></pre>
<p>So, I followed the similar pattern of most of the critical functions of my common library. I would like to be able to insert "FunctionA" into the logging section during pre-built so that I don't have to remember to type in the right name or forgetting to rename it after copy and paste. Either that can be invoke manually from the toolbar or via shortcut key.</p>
<p>So, where should I start?</p>
<p>NOTE:
I'm considered intermediate in .Net, been writting in C# and VB for more than 3 years, but I'm fresh on Macro, don't mind to learn though.
Don't worry about the code itself and the exception, this is just an example.</p>
<p>EDIT:
Thanks Ovidiu Pacurar and cfeduke. What I wanted here was a one off way to change-and-forget. PostSharp will incur overhead on every one of those function, even when exception is not thrown. Digging from the stacktrace is feasible, but at some point I would also like to just log "FunctionA Failed" without spending too much processing in getting the stacktrace. Further more, if the library is obfuscated, the stacktrace would be cryptic.</p>
<p>Actually there was another need for this feature, which I forgot to mention earlier. When the library is ready to be delivered, I would want to change all the function name into function code, "FunctionA" might be "0001", by referring to a table, so as to solve the "obfuscated" log problem.</p>
| [
{
"answer_id": 251042,
"author": "cfeduke",
"author_id": 5645,
"author_profile": "https://Stackoverflow.com/users/5645",
"pm_score": 1,
"selected": false,
"text": "__FILE__"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20007/"
] |
250,980 | <p>How can one open a PNG formatted image file with VB6? Ideally, I (that is my customer) would like to have the PNG file open and placed into seperate R(ed), G(reen) and B(lue) arrays.</p>
<p>VB6 is not my tool of choice (for lack of knowledge) and I be thrilled if some one could point me in the right direction for a VB6 solution.</p>
| [
{
"answer_id": 251042,
"author": "cfeduke",
"author_id": 5645,
"author_profile": "https://Stackoverflow.com/users/5645",
"pm_score": 1,
"selected": false,
"text": "__FILE__"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/250980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32836/"
] |
251,030 | <p>In <a href="https://stackoverflow.com/questions/226206/alternating-item-style">this question</a>, I was given a really cool answer to alternating an image and its description between left and right, respectively. Now I want to apply styling to both, e.g. padding-top, padding-bottom etc. How do I apply a style to both the RowStyle and AlternatingRowStyle in this scenario.</p>
<pre><code><AlternatingRowStyle CssClass="ProductAltItemStyle" />
<RowStyle CssClass="ProductItemStyle" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<div class="Image"><asp:Image runat="server" ID="productImage" ImageUrl='<%# Eval("imageUrl") %>' /></div>
<div class="Description"><asp:Label runat="server" ID="lblProductDesc" Width="100%" Text='<%# Eval("productDesc") %>'></asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
</code></pre>
| [
{
"answer_id": 251037,
"author": "changelog",
"author_id": 5646,
"author_profile": "https://Stackoverflow.com/users/5646",
"pm_score": 5,
"selected": false,
"text": ".ProductAltItemStyle, .ProductItemStyle {\n // CSS Rules that apply to both go here\n}"
},
{
"answer_id": 25116... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8741/"
] |
251,033 | <p>How can I convert a varchar field of the form YYYYMMDD to a datetime in T-SQL?</p>
<p>Thank you.</p>
| [
{
"answer_id": 251045,
"author": "bobwienholt",
"author_id": 24257,
"author_profile": "https://Stackoverflow.com/users/24257",
"pm_score": 5,
"selected": true,
"text": "select convert(datetime, '20081030')\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/251033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2443/"
] |
251,035 | <p>I have a simple app which is writing to an xml file on every button click. Once this is done, I read the Xml file soon after (as in, a couple of lines below with no methods to be stepped in to in between).</p>
<p>When the app runs for the first time, the xml file is written to/read from fine, but if I press the button again I get a "File is in use by another process". I am doing the whole flush, close, dispose thing with my streams and intend on using ProcessMon to check what process is holding the file.</p>
<p>Programatically, what is the best strategy to avoid this problem?</p>
<p>Thanks</p>
| [
{
"answer_id": 251174,
"author": "John",
"author_id": 30006,
"author_profile": "https://Stackoverflow.com/users/30006",
"pm_score": 0,
"selected": false,
"text": "object locker = new Object();\n\n....\n\nlock (locker)\n{\n //write xml file\n}\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/251035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32484/"
] |
251,068 | <p>Does a comparison sort have to compare the A[i] largest and A[i+1] largest values? I think any comparison sort must, but I'm not sure. I've checked out mergesort, insertion sort, and quicksort and in each of them the A[i] largest and A[i+1] largest values have to be compared.</p>
| [
{
"answer_id": 251127,
"author": "David Nehme",
"author_id": 14167,
"author_profile": "https://Stackoverflow.com/users/14167",
"pm_score": 1,
"selected": false,
"text": "A[i] > A[j] and A[j] > A[k] implies A[i] > A[k].\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/251068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27884/"
] |
251,069 | <p>I having to downgrade my Oracle instance from 10g (10.1.0.2.0) to 9i (9.2.x.x.x).
Not having planned on ever doing this, I didn't document 10g dependencies.</p>
<p>What are some of the dependencies on 10g that I will have to address?</p>
<p>Is there any type of query that I could perform to detect dependencies?</p>
<p>Of course I'm hoping for a magic bullet, not sifting through volumes of feature additions to compare with 100 klocs of PL/SQL.</p>
<p>By the way, we are not downgrading the database in place, we are migrating from a 10g instance to a separate 9i instance.</p>
| [
{
"answer_id": 251127,
"author": "David Nehme",
"author_id": 14167,
"author_profile": "https://Stackoverflow.com/users/14167",
"pm_score": 1,
"selected": false,
"text": "A[i] > A[j] and A[j] > A[k] implies A[i] > A[k].\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/251069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13930/"
] |
251,090 | <p>I like Vim's visual mode. <kbd>v</kbd> for highlight/select chars or lines, <kbd>Ctrl</kbd><kbd>v</kbd> for rectangle highlighting, as far as I know (I am a beginner). Is there any way to use visual mode to highlight last two chars, for example, on each line for some selected lines? The selected lines are in different length. Basically, I would like to find a quick way to remove the last two chars for some selected lines. Not sure I can use visual mode to highlight irregular area.</p>
| [
{
"answer_id": 251132,
"author": "ryan_s",
"author_id": 13728,
"author_profile": "https://Stackoverflow.com/users/13728",
"pm_score": 2,
"selected": false,
"text": ":10,20 normal $xx\n"
},
{
"answer_id": 251137,
"author": "reedstrm",
"author_id": 5430,
"author_profile... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251090",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62776/"
] |
251,104 | <p>Windows Vista has "Presentation Mode", which you can turn on with the Mobility Center.</p>
<p>How can I turn it on programmatically?</p>
| [
{
"answer_id": 10632946,
"author": "fmuecke",
"author_id": 105643,
"author_profile": "https://Stackoverflow.com/users/105643",
"pm_score": 3,
"selected": true,
"text": "presentationsettings.exe"
},
{
"answer_id": 37039715,
"author": "Bewc",
"author_id": 1370448,
"auth... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8446/"
] |
251,110 | <p>I tried this:</p>
<pre><code>ALTER TABLE My.Table DROP MyField
</code></pre>
<p>and got this error:</p>
<p>-MyField is not a constraint.</p>
<p>-Could not drop constraint. See previous errors.</p>
<p>There is just one row of data in the table and the field was just added.</p>
<p><strong>EDIT:</strong>
Just to follow up, the sql was missing COLUMN indeed.
Now I get even more seriously looking errors though:</p>
<ul>
<li>The object 'some_object__somenumbers' is dependent on column 'MyField'</li>
<li>ALTER TABLE DROP COLUMN MyField failed because one or more objects access this column.</li>
</ul>
<p><strong>EDIT:</strong></p>
<pre><code>ALTER TABLE TableName DROP Constraint ConstraintName
</code></pre>
<p>worked, after that I was able to use the previous code to remove the column. Credit goes to both of you, thanks.</p>
| [
{
"answer_id": 251114,
"author": "Brian R. Bondy",
"author_id": 3153,
"author_profile": "https://Stackoverflow.com/users/3153",
"pm_score": 3,
"selected": false,
"text": "ALTER TABLE TableName DROP COLUMN ColumnName\n"
},
{
"answer_id": 251184,
"author": "Lance McNearney",
... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2631856/"
] |
251,115 | <p>I am working on a project where I search through a large text file (large is relative, file size is about 1 Gig) for a piece of data. I am looking for a token and I want a dollar value immediately after that token. For example,</p>
<p>this is the token 9,999,999.99</p>
<p>So here's is how I am approaching this problem. After a little analysis it appears that the token is usually near the end of the file so I thought I would start searching from the end of the file. Here is the code I have so far (vb.net):</p>
<pre><code> Dim sToken As String = "This is a token"
Dim sr As New StreamReader(sFileName_IN)
Dim FileSize As Long = GetFileSize(sFileName_IN)
Dim BlockSize As Integer = CInt(FileSize / 1000)
Dim buffer(BlockSize) As Char
Dim Position As Long = -BlockSize
Dim sBuffer As String
Dim CurrentBlock As Integer = 0
Dim Value As Double
Dim i As Integer
Dim found As Boolean = False
While Not found And CurrentBlock < 1000
CurrentBlock += 1
Position = -CurrentBlock * BlockSize
sr.BaseStream.Seek(Position, SeekOrigin.End)
i = sr.ReadBlock(buffer, 0, BlockSize)
sBuffer = New String(buffer)
found = SearchBuffer(sBuffer, sToken, Value)
End While
</code></pre>
<p>GetFileSize is a function that returns the filesize. SearchBuffer is a function that will search a string for the token. I am not familiar with regular expressions but will explore it for that function.</p>
<p>Basically I read in a small chunk of the file search it and if I don't find it load another chunk and so on...</p>
<p>Am I on the right track or is there a better way? </p>
| [
{
"answer_id": 9757796,
"author": "Yes Man",
"author_id": 1231202,
"author_profile": "https://Stackoverflow.com/users/1231202",
"pm_score": 0,
"selected": false,
"text": "Dim stream As New FileStream(\"something.txt\")\nDim findBytes As [Byte]() = BitConverter.GetBytes(\"whatever\")\nDim... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
251,116 | <p>I use Eclipse with "external" projects - i.e. projects created from existing source.</p>
<p>Poking around in the workspace files, I cannot find any reference to these projects. My question is: how does Eclipse keep track of these projects?</p>
<p>I'd like to be able to add such a project to the workspace automatically (by generating <code>.project</code> and <code>.classpath</code> files).</p>
| [
{
"answer_id": 251129,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 8,
"selected": true,
"text": "<workspace>\\.metadata\\.plugins\\org.eclipse.core.resources\\.projects\\\n"
},
{
"answer_id": 251163,
"author": "Da... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251116",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16977/"
] |
251,117 | <p>So yeah, I'm a Java guy in this crazy iPhone world. When it comes to memory management I stiill don't have a very good idea of what I'm doing. </p>
<p>I have an app that uses a navigation controller, and when it's time to go on to the next view I have code that looks like this:</p>
<pre><code>UIViewController *myController = [[MyViewController alloc] initWithNibName:@"MyView"
bundle:[NSBundle mainBundle];
[[self navigationController] pushViewController:myController animated:YES];
</code></pre>
<p>Now according to Apple's fundamental rule on memory management</p>
<blockquote>
<p>You take ownership of an object if you create it using a method whose name begins with “alloc” or “new” or contains “copy” (for example, <code>alloc</code>, <code>newObject</code>, or <code>mutableCopy</code>), or if you send it a <code>retain</code> message. You are responsible for relinquishing ownership of objects you own using <code>release</code> or <code>autorelease</code>. Any other time you receive an object, you must not release it.</p>
</blockquote>
<p>To me that means that I should be releasing <code>myController</code>, or giving it an <code>autorelease</code> message. But, whenever I try doing that my application winds up crashing as I push and pop views off of the stack. </p>
<p>This didn't smell right to me, but in running Instruments it claims that I don't have any memory leaks. </p>
<p>So I my question is</p>
<ol>
<li>Am I doing this right?</li>
<li>Is the Navigation Controller taking ownership of MyViewController, explaining the lack of a memory leak?</li>
<li>Should I assign myController to an instance variable in my root ViewController? In that case it would be marked retain and I would release in the root's dealloc method</li>
</ol>
| [
{
"answer_id": 251233,
"author": "Ben Gottlieb",
"author_id": 6694,
"author_profile": "https://Stackoverflow.com/users/6694",
"pm_score": 3,
"selected": false,
"text": "-release"
},
{
"answer_id": 251847,
"author": "dnolen",
"author_id": 32797,
"author_profile": "http... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/543/"
] |
251,155 | <p>I am developing an iPhone application that persists data to a SQLite3 database. </p>
<p>For each row I persist I wish to include a 'created date' and a 'last modified date'</p>
<p>My question is what is the recommend approach for storing this information in a table? </p>
<p>The properties are represented as NSDate in my application but I am unsure how to represent this information in my table.</p>
<p>It appears that SQLite3 provides a DATETIME type but does not have a native understanding of how to parse this information.</p>
<p>Any help would be much appreciated.</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 251197,
"author": "drewh",
"author_id": 1967,
"author_profile": "https://Stackoverflow.com/users/1967",
"pm_score": 5,
"selected": true,
"text": "sqlite3_bind_double(statement, index, [dateObject timeIntervalSince1970]);\n"
},
{
"answer_id": 251371,
"author": "... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3596/"
] |
251,159 | <p>In C++, a function's signature depends partly on whether or not it's const. This means that a class can have two member functions with identical signatures except that one is const and the other is not. If you have a class like this, then the compiler will decide which function to call based on the object you call it on: if it's a const instance of the class, the const version of the function will be called; if the object isn't const, the other version will be called.</p>
<p>In what circumstances might you want to take advantage of this feature?</p>
| [
{
"answer_id": 59016421,
"author": "user265906",
"author_id": 9528554,
"author_profile": "https://Stackoverflow.com/users/9528554",
"pm_score": -1,
"selected": false,
"text": "#include <iostream>\nusing namespace std;\nclass base\n{\n\npublic:\nvoid fun() const\n{\n cout<<\"have fun\"... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11575/"
] |
251,181 | <p>I have a DTS package that drops a table then creates it and populates it but sometimes something happens and the package fails after the drop table. If it's rerun it fails cuz the table hasn't been created yet. </p>
<p>Is there something like "if exists" for SQLServer 2000 like in MySQL?</p>
<p>thanks.</p>
| [
{
"answer_id": 251190,
"author": "Brian R. Bondy",
"author_id": 3153,
"author_profile": "https://Stackoverflow.com/users/3153",
"pm_score": 3,
"selected": false,
"text": "IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TableName]') AND type in (N'U'))\nDROP TABL... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/730/"
] |
251,198 | <p>I am developing a C# program, and i have one function that consumes too much CPU. I would like to know a way to control this by code (not with any external application) and restrict the percentage of CPU usage.
For example, if it uses 90% of the CPU usage, to make my app consume only a 20%, even if it becomes slower. It must be done automatically and from within the app.
If you provide a class, it would be fantastic.</p>
| [
{
"answer_id": 251220,
"author": "dpurrington",
"author_id": 5573,
"author_profile": "https://Stackoverflow.com/users/5573",
"pm_score": 5,
"selected": true,
"text": "Thread.CurrentThread.Priority = ThreadPriority.Lowest;\n"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/251198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31791/"
] |
251,204 | <p>I want to fade out an element and all its child elements after a delay of a few seconds. but I haven't found a way to specify that an effect should start after a specified time delay.</p>
| [
{
"answer_id": 251214,
"author": "swilliams",
"author_id": 736,
"author_profile": "https://Stackoverflow.com/users/736",
"pm_score": 7,
"selected": true,
"text": "setTimeout(function() { $('#foo').fadeOut(); }, 5000);\n"
},
{
"answer_id": 454387,
"author": "Sampson",
"aut... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648/"
] |
251,218 | <p>I'm using Wise Package Studio 7.0 SP2 on Windows XP.</p>
<p>I've got an MSI Wrapped EXE installation that goes about happily installing some files and then running one of the files from the installation which we can refer to as app.exe.</p>
<p>So on the "Execute Deferred" tab of the MSI Editor, I had to add the lines:</p>
<pre><code>If Not Installed then
Execute Installed Program app.exe (Action)
End
</code></pre>
<p>This ensured that my app.exe would be run <em>only</em> on an installation and not during a modify/repair/removal. When app.exe runs, it conveniently adds itself to the system tray.</p>
<p>I'm looking for something that will do the reverse during a removal. I want to stop the app.exe process thus removing it from the system tray.</p>
<p>Currently my removal gets rid of all the files however the app.exe remains running and still shows up in the systems tray. I've looked at adding the conditional statement:</p>
<pre><code>If REMOVE~="ALL" then
*remove the app from the systray!*
End
</code></pre>
<p>The conditional statement will let me do something only on a removal, however I'm not sure of the best approach to go about actually terminating the process. Is there an MSI command I can run that will let me do that? Should I write my own .exe that will do that?</p>
| [
{
"answer_id": 252627,
"author": "Froosh",
"author_id": 26000,
"author_profile": "https://Stackoverflow.com/users/26000",
"pm_score": 0,
"selected": false,
"text": "strMachine = \"localhost\"\nstrAppName = \"notepad.exe\"\n\nSet objProcesses = GetObject(\"winmgmts://\" & strMachine).Exec... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26853/"
] |
251,225 | <p>We have a large application in Ruby on Rails with many filters. Some of these filters can be complex. I am looking for a way to individually test these filters with a unit test. Right now I test them by testing them through an action that uses them with a functional test. This just doesn't feel like the right way.<br>
Does anyone have advice or experience with this?</p>
| [
{
"answer_id": 251616,
"author": "Orion Edwards",
"author_id": 234,
"author_profile": "https://Stackoverflow.com/users/234",
"pm_score": 2,
"selected": false,
"text": "class SomeController\n before_filter :ensure_awesomeness\n\n ...\nend\n"
},
{
"answer_id": 251981,
"author... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5935/"
] |
251,243 | <p>I'm trying to figure out why my app's TCP/IP connection keeps hiccuping every 10 minutes (exactly, within 1-2 seconds). I ran Wireshark and discovered that after 10 minutes of inactivity the other end is sending a packet with the reset (RST) flag set. A google search tells me "the RESET flag signifies that the receiver has become confused and so wants to abort the connection" but that is a little short of the detail I need. What could be causing this? And is it possible that some router along the way is responsible for it or would this always come from the other endpoint?</p>
<p><strong>Edit:</strong> There is a router (specifically a Linksys WRT-54G) sitting between my computer and the other endpoint -- is there anything I should look for in the router settings?</p>
| [
{
"answer_id": 1172103,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": false,
"text": "RST"
}
] | 2008/10/30 | [
"https://Stackoverflow.com/questions/251243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/327/"
] |
251,246 | <p>Ok I have an <code>apache IBM HTTP Server WAS 6.1</code> setup </p>
<p>I have my <code>certs</code> correctly installed and can successfully load <code>http</code> and <code>https</code> pages.</p>
<p>After a successful <code>j_security_check</code> authentication via <code>https</code>, I want the now authorized page (and all subsequent pages) to load as <code>http</code>.</p>
<p>I want this all to work with <code>mod_rewrite</code> because I don't want to change application code for something that really should be simple to do on the webserver.</p>
<p>I would think this would work but it doesn't and I fear it's because <code>j_security_check</code> is bypassing <code>mod_rewrite</code> somehow.</p>
<pre><code>RewriteCond %{HTTPS} =off
RewriteCond %{THE_REQUEST} login\.jsp.*action=init [OR]
RewriteCond %{THE_REQUEST} login\.jsp.*action=submit
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] <<-- this rule is working
RewriteCond %{HTTPS} =on
RewriteCond %{THE_REQUEST} !login\.jsp.*action=init [OR]
RewriteCond %{THE_REQUEST} !login\.jsp.*action=submit
RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R,L] <--- this rule is not working or the condition is not returning true
</code></pre>
<p>I know the <code>[R,L]</code> will force the executed rule to be the last rule to run on a request and redirect accordingly.</p>
<p>I found this little jewel after a little googleing.</p>
<pre><code>mod_rewrite: My rules are ignored. Nothing is written to the rewrite log.
The most common cause of this is placing mod_rewrite directives at global scope (outside of any VirtualHost containers) but expecting the directives to apply to requests which were matched by a VirtualHost container.
In this example, the mod_rewrite configuration will be ignored for requests which are received on port 443:
RewriteEngine On
RewriteRule ^index.htm$ index.html
<VirtualHost *:443>
existing vhost directives
</VirtualHost>
Unlike most configurable features, the mod_rewrite configuration is not inherited by default within a <VirtualHost > container. To have global mod_rewrite directives apply to a VirtualHost, add these two extra directives to the VirtualHost container:
<VirtualHost *:443>
existing vhost directives
RewriteEngine On
RewriteOptions Inherit
</VirtualHost>
</code></pre>
<p>Adding the Inherit declaration to my single <code>virtualhost</code> declaration that points to the machine ip and <code>port 443</code> did NOT help one bit.</p>
<p>Now I know that my app server communicates on <code>9080</code> and <code>9443</code> respectively but I can't find a single <code>virtualhost</code> in the web server <code>httpd.conf</code>. </p>
<p>I did some testing with different rewrite rules while not authenticated and saw that my <code>mod rewrite</code> code worked.. </p>
<p><strong>So: how do I make websphere use mod rewrite after authentication?</strong> </p>
<p>It's like the web server is only used for unauthenticated requests and after that some blackbox container serves up everything somehow.</p>
| [
{
"answer_id": 251871,
"author": "Maglob",
"author_id": 27520,
"author_profile": "https://Stackoverflow.com/users/27520",
"pm_score": -1,
"selected": false,
"text": "RewriteCond %{THE_REQUEST} !login\\.jsp.*action=init\nRewriteCond %{THE_REQUEST} !login\\.jsp.*action=submit\n"
},
{
... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30807/"
] |
251,248 | <p>I am looking for an easy way to get the SID for the current Windows user account. I know I can do it through WMI, but I don't want to go that route.</p>
<p>Apologies to everybody that answered in C# for not specifying it's C++. :-)</p>
| [
{
"answer_id": 251267,
"author": "Roger Lipscombe",
"author_id": 8446,
"author_profile": "https://Stackoverflow.com/users/8446",
"pm_score": 7,
"selected": true,
"text": "TokenUser"
},
{
"answer_id": 251308,
"author": "silverbugg",
"author_id": 29650,
"author_profile"... | 2008/10/30 | [
"https://Stackoverflow.com/questions/251248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17028/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.