qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
344,018 | <p>I have an ASP.NET application which tracks statistics by creating and writing to custom performance counters. Occasionally, I see in the error logs that indicate that the counters have failed to open because they had already been used in the current process. I presume this is due to my .NET appdomain having been reset within the same w3wp.exe process. How can I avoid these errors and re-establish a connection to my performance counters when my app domain has been recycled?</p>
<p>Counter construction:</p>
<pre><code>PerformanceCounter pc = new PerformanceCounter();
pc.CategoryName = category_name;
pc.CounterName = counter_name;
pc.ReadOnly = false;
pc.InstanceLifetime =
PerformanceCounterInstanceLifetime.Process;
pc.InstanceName = instance_name;
</code></pre>
<p>Counter usage:</p>
<pre><code>pc.Increment()
</code></pre>
<p>[Update on 3/26/09]
The error message received is:</p>
<p>Instance '_lm_w3svc_1_root_myapp' already exists with a lifetime of Process. It cannot be recreated or reused until it has been removed or until the process using it has exited.
already exists with a lifetime of Process.</p>
<p>I tried to replicate the exception in a console application by initializing the performance counters and writing to one of them in a transient AppDomain. I then unload the AppDomain and do it again in a second Appdomain (same process). They both succeed. I'm unsure now exactly what the cause of this is, my assumption about AppDomain recycling in ASP.NET seems to be false.</p>
| [
{
"answer_id": 698491,
"author": "Ender",
"author_id": 84296,
"author_profile": "https://Stackoverflow.com/users/84296",
"pm_score": 0,
"selected": false,
"text": "lock (this.lockObject)\n{\n //Create performance counter\n}\n"
},
{
"answer_id": 1008759,
"author": "Alan McBee"... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7450/"
] |
344,047 | <p>I want to get at the item that is being data bound, during the ItemDataBound event of an asp:repeater.</p>
<p>I tried the following (which was an unaccepted answer in a <a href="https://stackoverflow.com/questions/284420/datagridview-bindinghow-to-color-line-depending-of-the-object-binded#284470">stackoverflow question</a>):</p>
<pre><code>protected void myRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
Object dataItem = e.Item.DataItem;
...
}
</code></pre>
<p>but <code>e.Item.DataItem</code> is null.</p>
<p>How can I access the item being data bound during the event called ItemDataBound. I assume the event ItemDataBound happens when an item is being data bound.</p>
<p>I want to get at the object so I can take steps to control how it is displayed, in addition the object may have additional helpful properties to let me enrich how it is displayed.</p>
<h2>Answer</h2>
<p><a href="https://stackoverflow.com/questions/344047/aspnet-how-to-access-the-item-being-data-bound-during-itemdatabound#344073">Tool</a> had the right answer. The answer is that <code>e.Item.Data</code> is only valid when <code>e.Item.ItemType</code> is (Item, AlternatingItem). Other times it is not valid. In my case, I was receiving ItemDataBound events during header (or footer) rows, where there is no DataItem:</p>
<pre><code>protected void myRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
// if the data bound item is an item or alternating item (not the header etc)
if (e.Item.ItemType != ListItemType.Item &&
e.Item.ItemType != ListItemType.AlternatingItem)
{
return;
}
Object dataItem = e.Item.DataItem;
...
}
</code></pre>
| [
{
"answer_id": 344073,
"author": "Programmin Tool",
"author_id": 21691,
"author_profile": "https://Stackoverflow.com/users/21691",
"pm_score": 5,
"selected": true,
"text": "if (e.Item.ItemType == ListItemType.Item ||\n e.Item.ItemType == ListItemType.AlternatingItem)\n{\n //Put stu... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12597/"
] |
344,068 | <p>I have a table like so:</p>
<pre><code>keyA keyB data
</code></pre>
<p>keyA and keyB together are unique, are the primary key of my table and make up a clustered index.</p>
<p>There are 5 possible values of keyB but an unlimited number of possible values of keyA,. keyB generally increments.</p>
<p>For example, the following data can be ordered in 2 ways depending on which key column is ordered first:</p>
<pre><code>keyA keyB data
A 1 X
B 1 X
A 3 X
B 3 X
A 5 X
B 5 X
A 7 X
B 7 X
</code></pre>
<p>or</p>
<pre><code>keyA keyB data
A 1 X
A 3 X
A 5 X
A 7 X
B 1 X
B 3 X
B 5 X
B 7 X
</code></pre>
<p>Do I need to tell the clustered index which of the key columns has fewer possible values to allow it to order the data by that value first? Or does it not matter in terms of performance which is ordered first?</p>
| [
{
"answer_id": 344397,
"author": "Michael Haren",
"author_id": 29,
"author_profile": "https://Stackoverflow.com/users/29",
"pm_score": 1,
"selected": false,
"text": "ORDER BY KeyA, KeyB\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34632/"
] |
344,069 | <p>I am unit testing a .NET application (.exe) that uses an app.config file to load configuration properties. The unit test application itself does not have an app.config file. </p>
<p>When I try to unit test a method that utilizes any of the configuration properties, they return <em>null</em>. I'm assuming this is because the unit test application is not going to load in the target application's app.config.</p>
<p>Is there a way to override this or do I have to write a script to copy the contents of the target app.config to a local app.config? </p>
<p><a href="https://stackoverflow.com/questions/168931/unit-testing-the-appconfig-file-with-nunit">This</a> post kind-of asks this question but the author is really looking at it from a different angle than I am.</p>
<p><strong>EDIT:</strong> I should mention that I'm using VS08 Team System for my unit tests.</p>
| [
{
"answer_id": 344124,
"author": "Jeromy Irvine",
"author_id": 8223,
"author_profile": "https://Stackoverflow.com/users/8223",
"pm_score": 7,
"selected": true,
"text": ".config"
},
{
"answer_id": 344233,
"author": "bryanbcook",
"author_id": 30809,
"author_profile": "h... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20133/"
] |
344,070 | <p>Good day,</p>
<p>we just moved from asp.net 1.1 to asp.net 2.0. We are using ajax update panels.</p>
<p>In an Apress book (Pro asp.net 2008) , I've read that when you use the updatepanel, you don't reduce the acount of bandwidth sent, because the entire page is still sent. </p>
<p>That in mind, I've also read on many websites that it is better to use multiple updatepanels instead of only one containing the entire page to 'reduce the amount of bandwidth sent'. In my opinion, there is a contradiction with the Apress book, and I was wondering what you guys think.</p>
<p>Is it better to use only one updatepanel containing the entire page, or many ones? The performance is my main concern.</p>
| [
{
"answer_id": 344124,
"author": "Jeromy Irvine",
"author_id": 8223,
"author_profile": "https://Stackoverflow.com/users/8223",
"pm_score": 7,
"selected": true,
"text": ".config"
},
{
"answer_id": 344233,
"author": "bryanbcook",
"author_id": 30809,
"author_profile": "h... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42848/"
] |
344,072 | <p>I have a table with a large amount of information, how do i select just the last months worth? (ie just the last 31 cells in the column?)</p>
<p>The data is in the form</p>
<pre><code>date1 numbers
date2 numbers
. .
. .
. .
daten numbers
</code></pre>
<p>where date1 is dd/mm/ccyy</p>
<p>cheers</p>
| [
{
"answer_id": 344123,
"author": "CestLaGalere",
"author_id": 6684,
"author_profile": "https://Stackoverflow.com/users/6684",
"pm_score": 1,
"selected": false,
"text": "LastRow = Sheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row\n"
},
{
"answer_id": 344131,
"a... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,092 | <p>I work for a large website. Our marketing department asks us to add ever more web ad tracking pixels to our pages. I have no problem with tracking the effectiveness of ad campaigns, but the servers serving those pixels can be unreliable. I'm sure most of you have seen web pages that refuse to finish loading because a pixel from yieldmanager.com won't finish downloading.</p>
<p>If the pixel never finishes downloading, onLoad never fires, and, in our case, the page won't function without that. </p>
<p>We have the additional problem of Gomez. As you may know they have bots all over the world that measure site speed, and it's important for us to look good in their measurements, despite flaws in their methodology. Their bots execute onLoad handlers. So even if I use a script that runs onLoad to add the pixels to the page after everything else finishes, we can still get crappy Gomez scores if the pixel takes 80 seconds to load. </p>
<p>My solution was to add the pixels to the page via an onMouseMove handler, so only humans will trigger them. Do you guys have any better ideas ?</p>
| [
{
"answer_id": 344118,
"author": "Stevo",
"author_id": 1937,
"author_profile": "https://Stackoverflow.com/users/1937",
"pm_score": 4,
"selected": true,
"text": " $(document).ready(function(){\n // Your code here\n });\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43670/"
] |
344,095 | <p>Is that possible to have a single PHP SOAP server which will handle requests to several classes (services)?</p>
<p>If yes, could you please show an example implementation?</p>
<p>If not, could you please describe why?</p>
| [
{
"answer_id": 346571,
"author": "gnud",
"author_id": 27204,
"author_profile": "https://Stackoverflow.com/users/27204",
"pm_score": 0,
"selected": false,
"text": "class ServiceProxy {\n private $map = array();\n\n public function addMethod($name, $callback) {\n if(is_callabl... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43668/"
] |
344,098 | <p>Consider the following table:</p>
<pre><code>mysql> select * from phone_numbers;
+-------------+------+-----------+
| number | type | person_id |
+-------------+------+-----------+
| 17182225465 | home | 1 |
| 19172225465 | cell | 1 |
| 12129876543 | home | 2 |
| 13049876543 | cell | 2 |
| 15064223454 | home | 3 |
| 15064223454 | cell | 3 |
| 18724356798 | home | 4 |
| 19174335465 | cell | 5 |
+-------------+------+-----------+
</code></pre>
<p>I'm trying to find those people who have home phones but not cells. </p>
<p>This query works:</p>
<pre><code>mysql> select h.*
-> from phone_numbers h
-> left join phone_numbers c
-> on h.person_id = c.person_id
-> and c.type = 'cell'
-> where h.type = 'home'
-> and c.number is null;
+-------------+------+-----------+
| number | type | person_id |
+-------------+------+-----------+
| 18724356798 | home | 4 |
+-------------+------+-----------+
</code></pre>
<p>but this one doesn't:</p>
<pre><code>mysql> select h.*
-> from phone_numbers h
-> left join phone_numbers c
-> on h.person_id = c.person_id
-> and h.type = 'home'
-> and c.type = 'cell'
-> where c.number is null;
+-------------+------+-----------+
| number | type | person_id |
+-------------+------+-----------+
| 19172225465 | cell | 1 |
| 13049876543 | cell | 2 |
| 15064223454 | cell | 3 |
| 18724356798 | home | 4 |
| 19174335465 | cell | 5 |
+-------------+------+-----------+
</code></pre>
<p>The only difference between the two is the location of the <code>h.type = 'home'</code> condition - in the first it's in the <code>where</code> clause and in the second it's part of the <code>on</code> clause.</p>
<p>Why doesn't the second query return the same result as the first?</p>
| [
{
"answer_id": 344127,
"author": "Tony Andrews",
"author_id": 18747,
"author_profile": "https://Stackoverflow.com/users/18747",
"pm_score": 4,
"selected": true,
"text": "for each row in phone_numbers h /* Note this is ALL home AND cell phones */\n select c.number from phone_numbers c\n... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1094969/"
] |
344,101 | <p>Wish to simultaneously call a function multiple times. I wish to use threads to call a function which will utilize the machines capability to the fullest. This is a 8 core machine, and my requirement is to use the machine cpu from 10% to 100% or more. </p>
<p>My requirement is to use the boost class. Is there any way I can accomplish this using the boost thread or threadpool library? Or some other way to do it?</p>
<p>Also, if I have to call multiple functions with different parameters each time (with separate threads), what is the best way to do this? [using boost or not using boost] and how?</p>
<pre><code>#include <iostream>
#include <fstream>
#include <string.h>
#include <time.h>
#include <boost/thread/mutex.hpp>
#include <boost/bind.hpp>
using namespace std;
using boost::mutex;
using boost::thread;
int threadedAPI1( );
int threadedAPI2( );
int threadedAPI3( );
int threadedAPI4( );
int threadedAPI1( ) {
cout << "Thread0" << endl;
}
int threadedAPI2( ) {
cout << "Thread1" << endl;
}
int threadedAPI3( ) {
cout << "Thread2" << endl;
}
int threadedAPI4( ) {
cout << "Thread3" << endl;
}
int main(int argc, char* argv[]) {
boost::threadpool::thread_pool<> threads(4);
// start a new thread that calls the "threadLockedAPI" function
threads.schedule(boost::bind(&threadedAPI1,0));
threads.schedule(boost::bind(&threadedAPI2,1));
threads.schedule(boost::bind(&threadedAPI3,2));
threads.schedule(boost::bind(&threadedAPI4,3));
// wait for the thread to finish
threads.wait();
return 0;
}
</code></pre>
<p>The above is not working and I am not sure why? :-(</p>
| [
{
"answer_id": 344522,
"author": "James Hopkin",
"author_id": 11828,
"author_profile": "https://Stackoverflow.com/users/11828",
"pm_score": 2,
"selected": false,
"text": "int threadedAPI1( );\n\nboost::bind(&threadedAPI1,0)\n"
},
{
"answer_id": 344726,
"author": "jalf",
"... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35416/"
] |
344,104 | <p>I was wondering which was better:</p>
<pre><code>$lookup = array( "a" => 1, "b" => 2, "c" => 3 );
return $lookup[$key];
</code></pre>
<p>or</p>
<pre><code>if ( $key == "a" ) return 1
else if ( $key == "b" ) return 2
else if ( $key == "c" ) return 3
</code></pre>
<p>or maybe just a nice switch...</p>
<pre><code>switch($key){
case "a": return 1;
case "b": return 2;
case "c": return 3;
}
</code></pre>
<p>I always prefer the first method as I can separate the data from the code; At this scale it looks quite silly but on a larger scale with thousands of lines of lookup entries; How much longer is PHP going to take building an array and then only checking maybe 1 or 2 entries per request.</p>
<p>I think it'd have to be tested and clocked, but I'd say the bigger and more complicated the array the slower it's going to become.</p>
<p>PHP Should be able to handle lookups faster than I can in PHP-code, but building the array in the first place surely takes up a lot of time.</p>
| [
{
"answer_id": 344156,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "if()"
},
{
"answer_id": 344365,
"author": "Christopher Lightfoot",
"author_id": 24525,
"author_profile": "... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24525/"
] |
344,117 | <p>Is there any way to get a String[] with the roles a user has in the JSP or Servlet?</p>
<p>I know about request.isUserInRole("role1") but I also want to know all the roles of the user.</p>
<p>I searched the servlet source and it seems this is not possible, but this seems odd to me.</p>
<p>So... any ideas?</p>
| [
{
"answer_id": 344153,
"author": "Steve McLeod",
"author_id": 2959,
"author_profile": "https://Stackoverflow.com/users/2959",
"pm_score": 4,
"selected": false,
"text": " System.out.println(\"type = \" + request.getUserPrincipal().getClass());\n"
},
{
"answer_id": 344223,
"... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43671/"
] |
344,128 | <p>I'm pulling back a Date and a Time from a database. They are stored in separate fields, but I would like to combine them into a java.util.Date object that reflects the date/time appropriately.</p>
<p>Here is my original approach, but it is flawed. I always end up with a Date/Time that is 6 hours off what it should be. I think this is because the Time has a timezone offset as well as the Date, and I really only need one of them to have the timezone offset.</p>
<p>Any suggestions on how to do this so that it will give me the correct Date/Time?</p>
<pre><code>import java.sql.Time;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.lang.time.DateUtils;
public static Date combineDateTime(Date date, Time time)
{
if (date == null)
return null;
Date newDate = DateUtils.truncate(date, Calendar.DATE);
if (time != null)
{
Date t = new Date(time.getTime());
newDate = new Date(newDate.getTime() + t.getTime());
}
return newDate;
}
</code></pre>
| [
{
"answer_id": 344165,
"author": "Paul Tomblin",
"author_id": 3333,
"author_profile": "https://Stackoverflow.com/users/3333",
"pm_score": 4,
"selected": true,
"text": " Calendar dCal = Calendar.getInstance();\n dCal.setTime(date);\n Calendar tCal = Calendar.getInstance();\n tCal.setT... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1310/"
] |
344,161 | <p>Using WMI VB scripting, I would like to create/attach multiple child processes to a parent process, such as the explorer process.</p>
<p>When an app is started by clicking on it, it becomes a child process of the explorer process. The same is true for all apps that are loaded when Windows starts up.</p>
<p>If you kill the explorer process using the "End Process Tree" context menu option in the task manager, it kills all child processes of the explorer process as well (a quick, brute force way to clean up memory without restarting).</p>
<p>I have two scripts - one that kills a bunch of specific processes, and another that restarts those processes.</p>
<p>Most of the processes/apps in my scripts are loaded at start-up thus they are children of the explorer process. When I kill the explorer process tree, all these process die, as explained earlier.</p>
<p>When I restart these apps using a script, they are no longer children of the explorer process. When I kill the kill the explorer process tree, the apps started by the script do not die.</p>
<p>Now, I know I can kill each process individually using a script. But it would be nice to just kill the explorer processes tree in a script without having to specify the individual apps I want to kill.</p>
<p>So, if I have one script that can start my apps as children of the explorer process, my other script just has to kill the explorer processes tree.</p>
<p>I have a script that does just that. It loops through and kills all the child processes of the explorer process. However it only works on apps that load at start up or are are clicked on.</p>
<p>Also, by preventing these apps from loading at start-up, Windows loads MUCH faster. Later, I click on my script icon to load my apps when needed.</p>
<p>That's why I want to create a script that can start apps as children of the explorer process.</p>
<p>An interesting side note: I have to postpone killing any command/console processes, otherwise the script may kill itself before getting the rest of the processes.</p>
<p>Any ideas how this can be done?</p>
<p>Below is my code that fails.</p>
<pre><code>Option Explicit
dim wmi, rootProcessName, rootProcess, objStartup, objConfig, objProcess, strComputer, dropbox, itunes, skype
strComputer = "."
dropbox="C:\Program Files\Dropbox\Dropbox.exe"
itunes="C:\Program Files\iTunes\iTunes.exe"
skype="C:\Program Files\Skype\Phone\Skype.exe"
Const NORMAL = 32
Set wmi = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objStartup = wmi.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.PriorityClass = NORMAL
rootProcessName = "'explorer.exe'"
set rootProcess = wmi.ExecQuery("Select * from Win32_Process Where Name = " & rootProcessName )
For Each objProcess in rootProcess
objProcess.Create dropbox, null, objConfig
objProcess.Create itunes, null, objConfig
objProcess.Create skype, null, objConfig
Next
WScript.Quit
</code></pre>
| [
{
"answer_id": 71476435,
"author": "Spokes",
"author_id": 3411895,
"author_profile": "https://Stackoverflow.com/users/3411895",
"pm_score": 0,
"selected": false,
"text": "dim shell = wscript.createObject(\"wscript.shell\")\nshell.run(<path-to-application>\\excel.exe)\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43244/"
] |
344,162 | <p>I have a bunch of old classic ASP pages, many of which show database data in tables. None of the pages have any sorting functionality built in: you are at the mercy of whatever ORDER BY clause the original developer saw fit to use.</p>
<p>I'm working on a quick fix to tack on sorting via client-side javascript. I have a script already written that mostly does what I need. However, I still need to add one bit of functionality. The table rows in these pages will often have alternating row colors, and the mechanism used to achieve this varies among the pages. It might be as simple as changing a CSS class or the styles may have been rendered inline by the ASP code.</p>
<p>Right now after sorting the table each row keeps the coloring scheme is was rendered with and so the alternating rows no longer alternate. I was hoping to fix it with something simple like this:</p>
<pre><code>/* "table" is a var for the table element I'm sorting.
I've already verified it exists, and that there are at least three rows.
At this point the first row (index 0) is always the header row.
*/
// check for alternating row styles:
var RowStyle = table.rows[1].style;
var AltStyle = table.rows[2].style;
// SORT HAPPENS HERE!!
// snip
// Apply alternating row styles
if (RowStyle === AltStyle) return true;
for (var i=1,il=table.rows.length;i<il;i+=1)
{
if (i%2==0) table.rows[i].style=RowStyle;
else table.rows[i].style=AltStyle;
}
</code></pre>
<p>Unfortunately, you can't just set to an element's style property like this. It complains that the object has no setter. How else can I do this simply? No frameworks like jQuery allowed here- that's out of my hands.</p>
<p><strong>Update:</strong><br>
While it would be the best solution, it's just not practical to refactor 100+ pages to all use classes rather than inline style. Also, sometimes there's more involved than just the background color. For example, a row may be much darker or lighter than the alternating row, with one style having a different foreground color as well to accommodate. Or an alternating style may set borders differently. I really don't know what is used on all of these pages, so I need something that will generically apply <em>all</em> styles from one row to another.</p>
| [
{
"answer_id": 344204,
"author": "Jonathan Lonowski",
"author_id": 15031,
"author_profile": "https://Stackoverflow.com/users/15031",
"pm_score": 6,
"selected": true,
"text": "cssText"
},
{
"answer_id": 344336,
"author": "Tomalak",
"author_id": 18771,
"author_profile":... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] |
344,168 | <p>I have a page that allows users to enter a lot of information about them (metadata) they can then click on a icon which opens a modal window containing a googlemap which allows them to add locations, and a title for that location.</p>
<p>Using mootools I can pass the value of a form field back to the original form, using onclose. The main page form then has a single hidden input field, which goes into the database as one field, serialised. </p>
<p>The problem is a user can add as many locations as they want, there are also 3 types of location. Each with its own set of co-ordinates, which can be single or multiple!</p>
<p>So I want to know the best way to handle all of this data, is it possible to load it into one form and then use Moo to submit that form to a single form field, or can I use moo to just append all the information into a single hidden input field, but if I do that, how does user input come into it. Im stumped and looking at some suggestions on how to set this up in the 'best' possible way.</p>
<p>Currently I have a table, and each item is added as a new row, by JS when a user clicks on the map, it creates a new row with the details about the click, item and then a user input field.</p>
<p>If its a single location then its added as 'placemark', a user input field for the name and then the co-ordinates go into a 3rd table cell.
However if its a shape, then the first cell contains 'shape', user input field for name/description, and the third cell contains a list of co-ordinates one for each point, this is the same for lines.</p>
<p>The problem I have is I could write it all to a single form field, but then how do I allow for user input of the titles, I need to use a form field for that? The other option is to take each row from a table and input it into the single form field, seperated by a pipe or similar, but then im not sure if I can read from other form fields.</p>
<p>I hope the above makes some sense!! All feedback welcome!</p>
<p>Im using mootools for this, but providing I can get my head around the layout then that should not really be an issue.</p>
| [
{
"answer_id": 344408,
"author": "Elocution Safari",
"author_id": 43670,
"author_profile": "https://Stackoverflow.com/users/43670",
"pm_score": 3,
"selected": true,
"text": "var usersLocations = {\"locations\": [\n {\"type\": \"point\", \"coords\": [100,200]},\n {\"type\": ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28241/"
] |
344,171 | <p>As we know that, with compute function of datatable we can get sum of columns.
But I want to get sum of a row of datatable.
I will explain with a example:</p>
<p>I have a datatable like image below: With compute function we can get the sum of each column (product). Such as for product1, 2 + 12 + 50 + 13= 77.</p>
<p>I want to get sum of company1 : 2 + 6 + 4 + 3 + 5 = 20</p>
<p><a href="http://img123.imageshack.us/img123/1517/61519307xx5.jpg" rel="nofollow noreferrer">http://img123.imageshack.us/img123/1517/61519307xx5.jpg</a></p>
<p>How can I do it with asp.net 1.1?</p>
| [
{
"answer_id": 344215,
"author": "Galwegian",
"author_id": 3201,
"author_profile": "https://Stackoverflow.com/users/3201",
"pm_score": 2,
"selected": false,
"text": "\"Quantity * UnitPrice\""
},
{
"answer_id": 344279,
"author": "Jason Jackson",
"author_id": 13103,
"au... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/439507/"
] |
344,199 | <p>I know how to do a regular php mysql search and display the results. However, because of the nature of what I'm trying to accomplish I need to be able to sort by relevancy. Let me explain this better:</p>
<p>Normal Query "apple iphone applications" will search the database using %apple iphone application%, but if there aren't records which display that phrase in that exact order the search will produce nothing.</p>
<p>What I basically need to do is search for 'apple', 'iphone' and 'applications' all separately and then merge the results into one, and then I need to grade the relevancy by how many instances of the word are found in the records. For example if I did what I wanted to do and it returned them following:</p>
<pre><code>Iphone Applications From Apple
Apple Make The Best Apple Iphone Applications
Iphone Applications
</code></pre>
<p>They would rank as follows:</p>
<pre><code>Apple Make The Best Apple Iphone Applications
Iphone Applications From Apple
Iphone Applications
</code></pre>
<p>Because of how many instances of the search terms are found. See highlighted:</p>
<pre><code>[Apple] Make The Best [Apple] [Iphone] [Applications]
[Iphone] [Applications] From [Apple]
[Iphone] [Applications]
</code></pre>
<p>I hope I have explained this well enough and I would be extremely grateful if anyone could give me any pointers.</p>
| [
{
"answer_id": 344213,
"author": "Filip Ekberg",
"author_id": 39106,
"author_profile": "https://Stackoverflow.com/users/39106",
"pm_score": 3,
"selected": false,
"text": "select title, match (title,content) against (”internet”) as score \nfrom cont \nwhere match (title,content) against (... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26823/"
] |
344,203 | <p>What is the maximum number of threads that can be created by a process under Linux?</p>
<p>How (if possible) can this value be modified?</p>
| [
{
"answer_id": 344264,
"author": "Vincent Van Den Berghe",
"author_id": 39259,
"author_profile": "https://Stackoverflow.com/users/39259",
"pm_score": 4,
"selected": false,
"text": "cat /proc/sys/kernel/threads-max\n"
},
{
"answer_id": 344292,
"author": "Robert Gamble",
"a... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,210 | <p>I'm using the ASP.net cache in a web project, and I'm writing a "status" page for it which shows the items in the cache, and as many statistics about the cache as I can find. Is there any way that I can get the total size (in bytes) of the cached data? The size of each item would be even better. I want to display this on a web page, so I don't think I can use a performance counter.</p>
| [
{
"answer_id": 344329,
"author": "Ryan Cook",
"author_id": 43029,
"author_profile": "https://Stackoverflow.com/users/43029",
"pm_score": 5,
"selected": true,
"text": "Cache.EffectivePrivateBytesLimit"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16872/"
] |
344,212 | <p>Ok I need to change the value of a hidden field in a gridview and here is what I have so far:</p>
<pre><code>for(var i = 0; i < gv_Proofs.rows.length; i++)
{
var tbl_Cell = gv_Proofs.rows[i].cells[0];
var sdiFound = false;
for(var x = 0; x < tbl_Cell.childNodes.length; x++)
{
if(tbl_Cell.childNodes[x].id == "_ctl0_MasterContentPlaceHolder_gv_Proofs__ctl2_lbl_SDI")
{
if(tbl_Cell.childNodes[x].innerHTML == sdi)
sdiFound = true;
}
if(tbl_Cell.childNodes[x].id == "_ctl0_MasterContentPlaceHolder_gv_Proofs__ctl2_lbl_Updated" && sdiFound)
tbl_Cell.childNodes[x].value = "true";
}
}
</code></pre>
<p>can anyone tell me what I am doing wrong? Thank You!</p>
| [
{
"answer_id": 344266,
"author": "Mike Robinson",
"author_id": 43687,
"author_profile": "https://Stackoverflow.com/users/43687",
"pm_score": 0,
"selected": false,
"text": "<%= lbl_SDI.ClientID %>\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344212",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2486/"
] |
344,236 | <p>I have yet another managed C++ KeyValuePair question where I know what to do in C#, but am having a hard time translating to managed C++. Here is the code that does what I want to do in C#:</p>
<pre><code>KeyValuePair<String, String> KVP = new KeyValuePair<string, string>("this", "that");
</code></pre>
<p>I've reflected it into MC++ and get this:</p>
<pre><code>KeyValuePair<String __gc*, String __gc*> __gc* KVP = (S"this", S"that");
</code></pre>
<p>which I'm translating to:</p>
<pre><code>KeyValuePair<String ^, String ^> KVP = (gcnew String("this"), gcnew String("that"));
</code></pre>
<p>I know from my <a href="https://stackoverflow.com/questions/341477/generic-generics-in-managed-c">previous question</a> that KeyValuePair is a value type; is the problem that it's a value type in C++ and a reference type in C#? Can anyone tell me how to set the key and value of a KeyValuePair from C++? </p>
| [
{
"answer_id": 344331,
"author": "Excel Kobayashi",
"author_id": 42911,
"author_profile": "https://Stackoverflow.com/users/42911",
"pm_score": 3,
"selected": true,
"text": "KeyValuePair< String ^, String ^> k(gcnew String(\"Foo\"), gcnew String(\"Bar\"));"
},
{
"answer_id": 34437... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2831/"
] |
344,257 | <p>I want to create tag in subversion. On the command line I have tried the following:</p>
<p><strong>svn copy <a href="http://myserver.mycompany.com:8080/svn/SVN_Main/trunk" rel="nofollow noreferrer">http://myserver.mycompany.com:8080/svn/SVN_Main/trunk</a> <a href="http://myserver.mycompany.com:8080/svn/SVN_Main/tag/Build-5.4.3.2" rel="nofollow noreferrer">http://myserver.mycompany.com:8080/svn/SVN_Main/tag/Build-5.4.3.2</a> -m "Build 5.4.3.2 tag"</strong></p>
<p>I get this error:</p>
<p><strong>svn: Path '<a href="http://myserver.mycompany.com:8080/svn/SVN_Main/trunk" rel="nofollow noreferrer">http://myserver.mycompany.com:8080/svn/SVN_Main/trunk</a>' does not exist for revision 1234</strong></p>
<p>The path <a href="http://myserver.mycompany.com:8080/svn/SVN_Main/trunk" rel="nofollow noreferrer">http://myserver.mycompany.com:8080/svn/SVN_Main/trunk</a> is exact same path that I have when I use the repro-browser on that folder. Any ideas on what may be causing this problem? I have also tried it w/wo username/password.</p>
| [
{
"answer_id": 344330,
"author": "derobert",
"author_id": 27727,
"author_profile": "https://Stackoverflow.com/users/27727",
"pm_score": 1,
"selected": false,
"text": "-r"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43688/"
] |
344,263 | <p>I want to pass the params collection from the controller to the model to parse filtering and sorting conditions. Does having a method in the model that takes the params from the controller break MVC?</p>
| [
{
"answer_id": 344483,
"author": "Daniel Lucraft",
"author_id": 11951,
"author_profile": "https://Stackoverflow.com/users/11951",
"pm_score": 2,
"selected": false,
"text": "class Model < ActiveRecord::Base\n def update_from_params(params)\n ....\n end\nend\n\nclass ModelsController ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,273 | <p>I have a SQL Report that insists on printing an extra blank page at the end, even though all the report items should fit on one page. I tried shortening the elements on the page that is spilling over, but no matter how much I compress them, or how much blank space is left on the first page, SRS still thinks it needs to take up another page as well. This is annoying because it's such a common problem - all it takes is one mistake to make a report spill over. So I'm not asking how can I fix this on this one report, but how can I fix this on this and future reports: Is there a flag or setting I can set to tell SRS "No matter what, never print more than 1 page"? Or "Suppress blank pages = true"?</p>
| [
{
"answer_id": 28583841,
"author": "Biruk Tilahun",
"author_id": 4098056,
"author_profile": "https://Stackoverflow.com/users/4098056",
"pm_score": 0,
"selected": false,
"text": "ConsumeContainerWhitespace"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,280 | <p>I'm currently writing an app for a Windows Mobile 5.0 app and it seems to possess some firewall-esqe feature where I need to permit the running of any deployed executable. Is there some kind of registry key I can use to turn this off during development as it's frustrating having to babysit the device.</p>
| [
{
"answer_id": 28583841,
"author": "Biruk Tilahun",
"author_id": 4098056,
"author_profile": "https://Stackoverflow.com/users/4098056",
"pm_score": 0,
"selected": false,
"text": "ConsumeContainerWhitespace"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1143/"
] |
344,315 | <p>I am trying to test a class that manages data access in the database (you know, CRUD, essentially). The DB library we're using happens to have an API wherein you first get the table object by a static call:</p>
<pre><code>function getFoo($id) {
$MyTableRepresentation = DB_DataObject::factory("mytable");
$MyTableRepresentation->get($id);
... do some stuff
return $somedata
}
</code></pre>
<p>...you get the idea.</p>
<p>We're trying to test this method, but mocking the DataObject stuff so that (a) we don't need an actual db connection for the test, and (b) we don't even need to include the DB_DataObject lib for the test.</p>
<p>However, in PHPUnit I can't seem to get $this->getMock() to appropriately set up a static call. I have...</p>
<pre><code> $DB_DataObject = $this->getMock('DB_DataObject', array('factory'));
</code></pre>
<p>...but the test still says unknown method "factory". I know it's creating the object, because before it said it couldn't find DB_DataObject. Now it can. But, no method?</p>
<p>What I really want to do is to have two mock objects, one for the table object returned as well. So, not only do I need to specify that factory is a static call, but also that it returns some specified other mock object that I've already set up.</p>
<p>I should mention as a caveat that I did this in SimpleTest a while ago (can't find the code) and it worked fine.</p>
<p>What gives?</p>
<p>[UPDATE]</p>
<p>I am starting to grasp that it has something to do with expects()</p>
| [
{
"answer_id": 344531,
"author": "Eran Galperin",
"author_id": 10585,
"author_profile": "https://Stackoverflow.com/users/10585",
"pm_score": 0,
"selected": false,
"text": " public function setUp() {\n $mockDb = new MockDb();\n DB_DataObject::setAdapter($mockDb);\n }\n"
},
{... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344315",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577/"
] |
344,317 | <p>On a Unix system, where does gcc look for header files?</p>
<p>I spent a little time this morning looking for some system header files, so I thought this would be good information to have here.</p>
| [
{
"answer_id": 344321,
"author": "Bill the Lizard",
"author_id": 1288,
"author_profile": "https://Stackoverflow.com/users/1288",
"pm_score": 4,
"selected": false,
"text": " /usr/local/include\n libdir/gcc/target/version/include\n /usr/target/include\n /usr/include\n"
},
{
"answer... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1288/"
] |
344,325 | <p>For testing purposes I need to get my Outlook 2003 addin (vb.net) disabled so that it can only be reactivated through the help menu or by deleting the resilency key from within the registry.</p>
<p>I tried to achieve this by creating an unhandled invalid cast exception during the startup eventhandler but this does not help. Outlook only says that it could not load the addin but it does not disable it.</p>
<p>How can I create a crash which does disable the addin?</p>
| [
{
"answer_id": 368884,
"author": "user20389",
"author_id": 20389,
"author_profile": "https://Stackoverflow.com/users/20389",
"pm_score": 0,
"selected": false,
"text": "System.Threading.Thread.Sleep(10000)"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25428/"
] |
344,327 | <p>I am doing some simple sanity validation on various types. The current test I'm working on is checking to make sure their properties are populated. In this case, populated is defined as not null, having a length greater than zero (if a string), or not equal to 0 (if an integer).</p>
<p>The "tricky" part of this test is that some properties are immune to this check. Right now I use a giant if statement that weeds out properties that don't need to be checked.</p>
<pre><code>//Gets all the properties of the currect feature.
System.Reflection.PropertyInfo[] pi = t.GetProperties();
for(int i = 0; i < pi.Length; i++)
{
if(!pi[i].Name.Equals("PropertyOne")
&& !pi[i].Name.Equals("PropertyTwo")
&& !pi[i].Name.Equals("PropertyThree")
//... repeat a bunch more times
&& !pi[i].Name.IndexOf("ValueOne") != -1
&& !pi[i].Name.IndexOf("ValueTwo") != -1
//... repeat a bunch more times
{
//Perform the validation check.
}
}
</code></pre>
<p>When profiling, I noticed the if statement is actually performing worse than the reflection (not that the reflection is blazing fast). Is there a more efficient way to filter the properties of several different types? </p>
<p>I've thought about a massive regular expression but I'm unsure on how to format it, plus it would probably be unreadable given its size. I've also considered storing the values in a List and then using Linq but I'm not sure how to handle the cases that use String.IndexOf() to find if the property contains a certain value.</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 344340,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 3,
"selected": true,
"text": "var matchingProperties = pi.Where(exactNames.Contains(pi.Name) ||\n partialNames.Any(name => pi.... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43699/"
] |
344,343 | <p>I'm looking for digital low pass filter code/library/class for a .net windows forms project, preferably written in c, c++ or c#. I probably need to set the number of poles, coefficients, windowing, that sort of thing. I can't use any of the gpl'd code that's available, and don't know what else is out there. Any suggestions appreciated. </p>
| [
{
"answer_id": 344362,
"author": "Keith Sirmons",
"author_id": 1048,
"author_profile": "https://Stackoverflow.com/users/1048",
"pm_score": 5,
"selected": true,
"text": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Filter\n{\npublic class ButterworthLo... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28343/"
] |
344,350 | <p>There is a column in a database that is of type INT (Sql server).</p>
<p>This int value is used at a bit flag, so I will be AND'ing and OR'ing on it.</p>
<p>I have to pass a parameter into my sproc, and that parameter will represent a specific flag item.</p>
<p><b>I would normally use an enumeration and pass the int representation to the sproc</b>, but since many different modules will be accessing it it won't be practicial for them all to have my enum definition (if it is changed, it will be a headache to roll it out).</p>
<p>So should I use a 'string' or a magic-number as the parameter value, then in my sproc I will do:</p>
<pre><code>IF(@blah = 'approved')
BEGIN
// bit banging here
END
</code></pre>
| [
{
"answer_id": 344423,
"author": "Tomalak",
"author_id": 18771,
"author_profile": "https://Stackoverflow.com/users/18771",
"pm_score": 2,
"selected": false,
"text": "CREATE PROCEDURE BitBang(@Flag AS VARCHAR(50), @Id AS INT)\nAS\nBEGIN\n DECLARE @Bit INT\n\n SET @BIT = CASE @Flag\n ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] |
344,363 | <p>I have a base class that has a private static member:</p>
<pre><code>class Base
{
private static Base m_instance = new Base();
public static Base Instance
{
get { return m_instance; }
}
}
</code></pre>
<p>And I want to derive multiple classes from this:</p>
<pre><code>class DerivedA : Base {}
class DerivedB : Base {}
class DerivedC : Base {}
</code></pre>
<p>However, at this point calling DerivedA::Instance will return the same exact object as will DerivedB::Instance and DerivedC::Instance. I can solve this by declaring the instance in the derived class, but then every single derived class will need to do that and that just seems like it should be unneccessary. So is there any way to put all this in the base class? Could a design pattern be applied?</p>
| [
{
"answer_id": 344376,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 3,
"selected": false,
"text": "private static Dictionary<Type, Base> instances = new Dictionary<Type, Base>();\npublic static T GetInstance<T>() where T : Ba... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18202/"
] |
344,372 | <p>just now the dba let me connect to the database using Sql Server Management Studio, this is how i noticed that the default database for the tfs setup and service users is master, is this ok?, is this why I'm having this error?, Let me post part of the log and the properties of the Setup user to confirm that the users are configured correctly. </p>
<p>Here is part of the log with the error: </p>
<pre><code>Using workflow file from location exe.
Executing workflow 'Quiesce ATDT'...
Stopping Windows Service 'TFSServerScheduler'...
Stopping Windows Service 'CoverAn'...
Stopping Windows Service 'W3SVC'...
Starting Windows Service 'W3SVC'...
Disabling SQL Jobs for databases
FSActivityLogging,TFSBuild,TFSIntegration,TFSVersionControl,TFSWorkItemTracking,TFSWorkItemTrackingAttachments,TFSWarehouse
CREATE TABLE permission denied in database 'master'.
Retrying...
Disabling SQL Jobs for databases
TFSActivityLogging,TFSBuild,TFSIntegration,TFSVersionControl,TFSWorkItemTracking,TFSWorkItemTrackingAttachments,TFSWarehouse
CREATE TABLE permission denied in database 'master'.
Retrying...
Disabling SQL Jobs for databases
TFSActivityLogging,TFSBuild,TFSIntegration,TFSVersionControl,TFSWorkItemTracking,TFSWorkItemTrackingAttachments,TFSWarehouse
CREATE TABLE permission denied in database 'master'.
Retrying...
Disabling SQL Jobs for databases
TFSActivityLogging,TFSBuild,TFSIntegration,TFSVersionControl,TFSWorkItemTracking,TFSWorkItemTrackingAttachments,TFSWarehouse
CREATE TABLE permission denied in database 'master'.
Retrying...
Disabling SQL Jobs for databases
TFSActivityLogging,TFSBuild,TFSIntegration,TFSVersionControl,TFSWorkItemTracking,TFSWorkItemTrackingAttachments,TFSWarehouse
CREATE TABLE permission denied in database 'master'.
Retrying...
Disabling SQL Jobs for databases
TFSActivityLogging,TFSBuild,TFSIntegration,TFSVersionControl,TFSWorkItemTracking,TFSWorkItemTrackingAttachments,TFSWarehouse
SQL Error #1
SQL Message: CREATE TABLE permission denied in database 'master'.
SQL LineNumber: 13
SQL Source: .Net SqlClient Data Provider
SQL Procedure:
System.Data.SqlClient.SqlException: CREATE TABLE permission denied in database 'master'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.TeamFoundation.Admin.TFSQuiesce.Quiescer.DisableJobs(XPathNavigator workflow)
at Microsoft.TeamFoundation.Admin.TFSQuiesce.Quiescer.ProcessSqlDatabaseElement(XPathNavigator workflow, String action, String dbName)
at Microsoft.TeamFoundation.Admin.TFSQuiesce.Quiescer.ExecuteWorkflowStep(XPathNavigator workflow, String action, String nameAttribute)
at Microsoft.TeamFoundation.Admin.TFSQuiesce.Quiescer.ExecuteWorkflowStepWithRetry(XPathNavigator workflow, String action, String nameAttribute)
at Microsoft.TeamFoundation.Admin.TFSQuiesce.Quiescer.RunWorkflow(String workflowName)
Exception Data:
Key: HelpLink.ProdName, Value: Microsoft SQL Server
Key: HelpLink.ProdVer, Value: 09.00.3054
Key: HelpLink.EvtSrc, Value: MSSQLServer
Key: HelpLink.EvtID, Value: 262
Key: HelpLink.BaseHelpUrl, Value: http://go.microsoft.com/fwlink
Key: HelpLink.LinkId, Value: 20476
Executing workflow 'Unquiesce ATDT'...
Enabling SQL Jobs.
Unblocking service account from accessing database TFSActivityLogging
Unblocking service account from accessing database TFSBuild
Unblocking service account from accessing database TFSIntegration
Unblocking service account from accessing database TFSVersionControl
Unblocking service account from accessing database TFSWorkItemTracking
Unblocking service account from accessing database TFSWorkItemTrackingAttachments
Unblocking service account from accessing database TFSWarehouse
Stopping Windows Service 'W3SVC'...
Starting Windows Service 'W3SVC'...
Starting Windows Service 'TFSServerScheduler'...
Starting Windows Service 'CoverAn'...
Workflow 'Quiesce ATDT' failed! ExitCode = 9000.
12/03/08 16:29:03 DDSet_Status: Process returned 9000
12/03/08 16:29:03 DDSet_Status: Found the matching error code for return value '9000' and it is: '29207'
12/03/08 16:29:03 DDSet_Error: 9000
12/03/08 16:29:03 DDSet_CARetVal: 29207
12/03/08 16:29:03 DDSet_Status: QuietExec returned 29207
12/03/08 16:29:03 DDSet_Exit: QuietExec ended
MSI (s) (44:18) [16:29:03:812]: User policy value 'DisableRollback' is 0
MSI (s) (44:18) [16:29:03:812]: Machine policy value 'DisableRollback' is 0
Action ended 16:29:03: InstallFinalize. Return value 3.
</code></pre>
<p>Here are the properties of the setup user in SQL:</p>
<p><strong>General</strong><br>
Login Name: CNBYV\SRVSTFTN<br>
Windows Authentication<br>
Default database: master<br>
Default Language: English </p>
<p><strong>Server Roles</strong><br>
dbcreator<br>
public<br>
sercurityadmin </p>
<p><strong>User Mapping</strong><br>
Map Database User DefaultSchema Default Role<br>
Checked master CNBYV\SRVSTFTN ... public<br>
Checked TfsActivityLogging dbo dbo dbo_owner, public<br>
Checked TfsBuild dbo dbo dbo_owner, public<br>
Checked TfsIntegration dbo dbo dbo_owner, public<br>
Checked TfsVersionControl dbo dbo dbo_owner, public<br>
Checked TfsWarehouse dbo dbo dbo_owner, public<br>
Checked TfsWorkItemTracking dbo dbo dbo_owner, public<br>
Checked TfsWorkItemTrackingAttachments dbo dbo dbo_owner, public </p>
<p>Those are the settings that i found more important, if you need more information let me know. </p>
<p>Thanks a lot.</p>
<p>PS: It was just a f<em>ck</em> pain to post the table above, i don't know why people like Markdown, if someone know how to fix it so it appears like a table please edit the question.</p>
<p>Juan Zamudio</p>
| [
{
"answer_id": 344376,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 3,
"selected": false,
"text": "private static Dictionary<Type, Base> instances = new Dictionary<Type, Base>();\npublic static T GetInstance<T>() where T : Ba... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15058/"
] |
344,380 | <p>In <code>java.util.Calendar</code>, January is defined as month 0, not month 1. Is there any specific reason to that ?</p>
<p>I have seen many people getting confused about that...</p>
| [
{
"answer_id": 344393,
"author": "Powerlord",
"author_id": 15880,
"author_profile": "https://Stackoverflow.com/users/15880",
"pm_score": -1,
"selected": false,
"text": "Calendar.JANUARY"
},
{
"answer_id": 344400,
"author": "Jon Skeet",
"author_id": 22656,
"author_prof... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11618/"
] |
344,419 | <p>In HTML, I can find a file starting from the <strong>web server's</strong> root folder by beginning the filepath with "/". Like:</p>
<pre><code>/images/some_image.jpg
</code></pre>
<p>I can put that path in any file in any subdirectory, and it will point to the right image.</p>
<p>With PHP, I tried something similar:</p>
<pre><code>include("/includes/header.php");
</code></pre>
<p>...but that doesn't work.</p>
<p>I think that that <a href="http://us2.php.net/manual/en/ini.core.php#ini.include-path" rel="noreferrer">this page</a> is saying that I can set <code>include_path</code> once and after that, it will be assumed. But I don't quite get the syntax. Both examples start with a period, and it says:</p>
<blockquote>Using a . in the include path allows for relative includes as it means the current directory.</blockquote>
<p>Relative includes are exactly what I <strong>don't</strong> want.</p>
<p><strong>How do I make sure that all my includes point to the <code>root/includes</code> folder?</strong> (Bonus: what if I want to place that folder outside the public directory?)</p>
<h2>Clarification</h2>
<p>My development files are currently being served by XAMPP/Apache. Does that affect the absolute path? (I'm not sure yet what the production server will be.)</p>
<h2>Update</h2>
<p>I don't know what my problem was here. The <code>include_path</code> thing I referenced above was exactly what I was looking for, and the syntax isn't really confusing. I just tried it and it works great.</p>
<p>One thing that occurs to me is that some people may have thought that "/some/path" was an "absolute path" because they assumed the OS was Linux. This server is Windows, so an absolute path would have to start with the drive name.</p>
<p>Anyway, problem solved! :)</p>
| [
{
"answer_id": 344445,
"author": "Rob Prouse",
"author_id": 30827,
"author_profile": "https://Stackoverflow.com/users/30827",
"pm_score": 7,
"selected": true,
"text": "define( 'ROOT_DIR', dirname(__FILE__) );\n"
},
{
"answer_id": 344464,
"author": "gnud",
"author_id": 272... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4376/"
] |
344,421 | <p>Some people have suggested that when doing an estimate one should make a lower and upper range on the expected time to delivery. The few project tools I have seen, seem to demand one fixed date. Are there any tools that support this concept of a estimation range?</p>
| [
{
"answer_id": 344680,
"author": "BIBD",
"author_id": 685,
"author_profile": "https://Stackoverflow.com/users/685",
"pm_score": 2,
"selected": false,
"text": "computed_result = (b + 4e + w)/6\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7734/"
] |
344,428 | <p>How do I access 'a' below?</p>
<pre><code>var test = function () {
return {
'a' : 1,
'b' : this.a + 1 //doesn't work
};
};
</code></pre>
| [
{
"answer_id": 344453,
"author": "Tomalak",
"author_id": 18771,
"author_profile": "https://Stackoverflow.com/users/18771",
"pm_score": 3,
"selected": false,
"text": "var test = function () {\n var o = {};\n o['a'] = 1;\n o['b'] = o['a'] + 1;\n return o;\n};\n"
},
{
"answer_id... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,430 | <p>I have an aspx page where i am Processing a large number of records from a table and doing some manipulation.after each manipuation,(each record),I have a Response.Write("Record : "+rec);
Response.Flush()</p>
<p>I have set Response.Buffer property to false.
It is working fine
But If i want to render the output as a table row,its not working as of Response.Write
After fininshing all the records in the loop only , the table is getting printed</p>
<p>How to solve this ?</p>
| [
{
"answer_id": 344456,
"author": "Timothy Lee Russell",
"author_id": 12919,
"author_profile": "https://Stackoverflow.com/users/12919",
"pm_score": 0,
"selected": false,
"text": ".column1 { width: 40px; }\n.column2 { width: 40px; }\n\nResponse.Write(\"<div id=\\\"column1\\\">some text</di... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40521/"
] |
344,440 | <p>I have a general exception handler, Application_error in my global.asax where I'm trying to isolate all the uncaught exceptions on all my many pages. I don't want to use Page_error to catch exception because it's inefficient to call that on so many pages. So where in the exception can I find what page actually caused the exception?</p>
| [
{
"answer_id": 344463,
"author": "jlew",
"author_id": 7450,
"author_profile": "https://Stackoverflow.com/users/7450",
"pm_score": 6,
"selected": true,
"text": "HttpContext con = HttpContext.Current;\ncon.Request.Url.ToString()\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8456/"
] |
344,451 | <p>I'm using jQuery in conjunction with the <a href="http://malsup.com/jquery/form/" rel="nofollow noreferrer">form plugin</a> and I'd like to intercept the form data before submission and make changes. </p>
<p>The form plugin has a property called beforeSubmit that should do this, but I seem to be having trouble getting the function I specify to run.</p>
<p>Here's the markup for the form (some style details omitted):</p>
<pre><code><form id="form1">
<fieldset id="login">
<legend>Please Log In</legend>
<label for="txtLogin">Login</label>
<input id="txtLogin" type="text" />
<label for="txtPassword">Password</label>
<input id="txtPassword" type="password" />
<button type="submit" id="btnLogin">Log In</button>
</fieldset>
</form>
</code></pre>
<p>And here's the javascript that I have so far:</p>
<pre><code>$(document).ready(function() {
var options = {
method: 'post',
url: 'Login.aspx',
beforeSubmit: function(formData, form, options) {
$.each(formData, function() { log.info(this.value); });
return true;
}
};
$('form#form1').ajaxForm(options);
});
</code></pre>
<p>(log.info() is from the <a href="http://www.gscottolson.com/blackbirdjs/" rel="nofollow noreferrer">Blackbird</a> debugger library I'm using)</p>
<p>When I click the submit button, rather than the POST verb I specified it uses a GET instead, and nothing is logged from my beforeSubmit function. It seems that the ajaxForm plugin is not being applied to the form at all, but I don't see why. Can anybody help with this?</p>
| [
{
"answer_id": 344918,
"author": "Ariel",
"author_id": 24654,
"author_profile": "https://Stackoverflow.com/users/24654",
"pm_score": 3,
"selected": true,
"text": "<script type=\"text/javascript\">\n $(document).ready(function() {\n var options = {\n beforeSubmit: showData\n }... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249/"
] |
344,460 | <p>I am trying to put the stuff within parentheses into the value of a src attribute in an img tag:</p>
<pre><code>while(<TOCFILE>)
{
$toc_line = $_;
$toc_line =~ s/<inlineFig.*?(\.\.\/pics\/ch09_inline99_*?\.jpg)*?<\/inlineFig>/<img src="${1}" alt="" \/\>/g;
$new_toc_file .= $toc_line;
}
</code></pre>
<p>So I expected to see tags like this in the output:</p>
<pre><code><img src="../pics/ch09_inline99_00" alt="" />
</code></pre>
<p>But instead I'm getting:</p>
<pre><code><img src="" alt="" />
</code></pre>
| [
{
"answer_id": 344577,
"author": "bart",
"author_id": 19966,
"author_profile": "https://Stackoverflow.com/users/19966",
"pm_score": 4,
"selected": false,
"text": "inline99_*?\\.jpg\n ^^^ \n"
},
{
"answer_id": 344650,
"author": "Ape-inago",
"author_id": 42082,
"... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,468 | <p>When I get a vanilla Windows system, there's a bunch of stuff I change to make it more developer-friendly.</p>
<p>Some of it I remember every time, other stuff I only do as and when.</p>
<p>Examples:</p>
<ul>
<li>Show extensions of all file types</li>
<li>Make hidden and system file visible</li>
<li>Turn off Windows Defender</li>
</ul>
<p>I seem to remember a blog post from Jeff on this topic, but can't locate it!</p>
<p>What else do you do, and do you have any tools that automate this process?</p>
| [
{
"answer_id": 344506,
"author": "PhiLho",
"author_id": 15459,
"author_profile": "https://Stackoverflow.com/users/15459",
"pm_score": 5,
"selected": false,
"text": "regsvr32 /u zipfldr.dll"
},
{
"answer_id": 344767,
"author": "Sam Hasler",
"author_id": 2541,
"author_p... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1737/"
] |
344,478 | <p>Can LINQ to SQL query using <strong>NOT IN</strong>? </p>
<p>e.g., SELECT au_lname, state FROM authors WHERE state NOT IN ('CA', 'IN', 'MD')</p>
| [
{
"answer_id": 344498,
"author": "Galwegian",
"author_id": 3201,
"author_profile": "https://Stackoverflow.com/users/3201",
"pm_score": 3,
"selected": false,
"text": "NorthwindDataContext dc = new NorthwindDataContext();\ndc.Log = Console.Out;\nvar query =\n from c in dc.Customers\n ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1316/"
] |
344,479 | <p>Is it possible to get the expiry <code>DateTime</code> of an <code>HttpRuntime.Cache</code> object?</p>
<p>If so, what would be the best approach?</p>
| [
{
"answer_id": 350374,
"author": "Tom Jelen",
"author_id": 28399,
"author_profile": "https://Stackoverflow.com/users/28399",
"pm_score": 6,
"selected": true,
"text": "private DateTime GetCacheUtcExpiryDateTime(string cacheKey)\n{\n object cacheEntry = Cache.GetType().GetMethod(\"Get\"... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/343/"
] |
344,503 | <pre><code>class MyBase
{
protected object PropertyOfBase { get; set; }
}
class MyType : MyBase
{
void MyMethod(MyBase parameter)
{
// I am looking for:
object p = parameter.PropertyOfBase; // error CS1540: Cannot access protected member 'MyBase.PropertyOfBase' via a qualifier of type 'MyBase'; the qualifier must be of type 'MyType' (or derived from it)
}
}
</code></pre>
<p>Is there a way to get a protected property of a parameter of a type from an extending type without reflection? Since the extending class knows of the property through its base type, it would make sense if possible.</p>
| [
{
"answer_id": 344668,
"author": "Jay Bazuzi",
"author_id": 5314,
"author_profile": "https://Stackoverflow.com/users/5314",
"pm_score": 3,
"selected": false,
"text": "class Other : MyBase { }\n\nnew MyType().MyMethod(new Other());\n"
},
{
"answer_id": 11028991,
"author": "Med... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31505/"
] |
344,509 | <p>Trying to get this example working from <a href="http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx" rel="nofollow noreferrer">http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx</a></p>
<p>However, I can't seem to get the namespace or syntax right for "Process" below.</p>
<pre><code><Border x:Name="panelDialog" Visibility="Collapsed">
<Grid>
<Border Background="Black" Opacity="0.49"></Border>
<!--While Xmal Content of the dialog will go here-->
</Grid>
</Border>
</code></pre>
<p>The blog post goes on to say.....</p>
<p>Just put two function for hide and display the dialog. Total Code is given bellow. In bellow code I have Displayed a loading screen with light box effect. When displaying modal dialog just invoke show and hide wait screen methods. Its good to send your cpu expansive jobs to background thread and use dispatcher to update UI while you are in background thread.</p>
<pre><code><Page x:Class="Home">
<Grid>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<!--All the contents will go here-->
</ScrollViewer>
<Border x:Name="panelLoading" Visibility="Collapsed">
<Grid>
<Border Background="Black" Opacity="0.49"></Border>
<local:TMEWaitScreen></local:TMEWaitScreen>
</Grid>
</Border>
</Grid>
</Page>
</code></pre>
<p>Here is the codebehind</p>
<pre><code>#region About Wait Screen
/// <summary>
/// Show wait screen before a web request
/// </summary>
public void ShowWaitScreen()
{
Process del = new Process(ShowWaitScreenUI);
Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, del);
}
private void ShowWaitScreenUI()
{
panelLoading.Visibility = Visibility.Visible;
}
/// <summary>
/// Hide a wait screen after a web request
/// </summary>
public void HideWaitScreen()
{
Process del = new Process(HideWaitScreenUI);
Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, del);
}
private void HideWaitScreenUI()
{
panelLoading.Visibility = Visibility.Collapsed;
}
#endregion
</code></pre>
<p>I'm having issues with this lines specifically:</p>
<pre><code>Process del = new Process(ShowWaitScreenUI);
</code></pre>
<p>The only Process I can find is in System.Diagnostics, and takes no arguments. Is the blog post I'm trying to learn from off,or am I just in the wrong place?</p>
| [
{
"answer_id": 344610,
"author": "John Z",
"author_id": 43430,
"author_profile": "https://Stackoverflow.com/users/43430",
"pm_score": 2,
"selected": false,
"text": "private delegate void Process();\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22451/"
] |
344,519 | <p>I am trying to filter an IEnumerable object of the duplicate values, so I would like to get the distinct values from it, for example, lets say that it holds days:</p>
<p>monday
tuesday
wednesday
wednesday</p>
<p>I would like to filter it and return:</p>
<p>monday
tuesday
wednesday</p>
<p>What is the most efficient way to do this in .net 2.0?</p>
| [
{
"answer_id": 344536,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 3,
"selected": true,
"text": "Dictionary<object, object> list = new Dictionary<object, object>();\nforeach (object o in enumerable)\n if (!list.ContainsKe... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7952/"
] |
344,533 | <p>I'm struggling to understand Dependency Properties in Silverlight 2. Does anybody have a good explanation or link that clearly explains the DependencyObject and/or DependencyProperty?</p>
| [
{
"answer_id": 344536,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 3,
"selected": true,
"text": "Dictionary<object, object> list = new Dictionary<object, object>();\nforeach (object o in enumerable)\n if (!list.ContainsKe... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1463/"
] |
344,557 | <p>Why is garbage collection required for tail call optimization? Is it because if you allocate memory in a function which you then want to do a tail call on, there'd be no way to do the tail call and regain that memory? (So the stack would have to be saved so that, after the tail call, the memory could be reclaimed.)</p>
| [
{
"answer_id": 346761,
"author": "Claudiu",
"author_id": 15055,
"author_profile": "https://Stackoverflow.com/users/15055",
"pm_score": 2,
"selected": false,
"text": "list *result = filter(make900MBlist(), funcptr);\n"
},
{
"answer_id": 363702,
"author": "dsimcha",
"author... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15055/"
] |
344,559 | <p>I have a directory full (~10<sup>3</sup>, 10<sup>4</sup>) of XML files from which I need to extract the contents of several fields.
I've tested different xml parsers, and since I don't need to validate the contents (expensive) I was thinking of simply using xml.parsers.expat (the fastest one) to go through the files, one by one to extract the data. </p>
<ol>
<li>Is there a more efficient way? (simple text matching doesn't work)</li>
<li>Do I need to issue a new ParserCreate() for each new file (or string) or can I reuse the same one for every file?</li>
<li>Any caveats?</li>
</ol>
<p>Thanks!</p>
| [
{
"answer_id": 349472,
"author": "Torsten Marek",
"author_id": 9567,
"author_profile": "https://Stackoverflow.com/users/9567",
"pm_score": 2,
"selected": false,
"text": "iterparse"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/280/"
] |
344,588 | <p>The title pretty much says it all. :-) I have lots of virtual hosts and I want to put a single rewriting block at the top of the httpd.conf file that rewrites URLs no matter which virtual host the request might be directed to. How the heck do I do this?</p>
<p>I found <a href="http://www.webmasterworld.com/forum92/1359.htm" rel="noreferrer">this</a> but my question is the same: how can I do this without resorting to .htaccess files and performing some other action for each virtual host?</p>
<p>OMGTIA!</p>
| [
{
"answer_id": 378802,
"author": "Jeremy Bourque",
"author_id": 2192597,
"author_profile": "https://Stackoverflow.com/users/2192597",
"pm_score": 3,
"selected": false,
"text": "include"
},
{
"answer_id": 1772829,
"author": "Travis Wilson",
"author_id": 8735,
"author_p... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16609/"
] |
344,590 | <p>I am creating a WCF service hosted within IIS7 on Windows Vista SP1. I am getting the following error:</p>
<p>The certificate 'CN=SignedByLocalHost' must have a private key that is capable of key exchange. The process must have access rights for the private key. </p>
<p>It looks like I would need to give the host process assess to the certificate which was done in the past with winhttpcertcfg which has been deprecated for Vista. The article I found indicates to use the certificate console, but I am missing somethign because I don't see any capability to edit my cert. </p>
<p>Any help would be great!</p>
<p>Thanks</p>
| [
{
"answer_id": 344643,
"author": "JoshBerke",
"author_id": 26160,
"author_profile": "https://Stackoverflow.com/users/26160",
"pm_score": 3,
"selected": false,
"text": "All Tasks / Manage Private Keys"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26160/"
] |
344,591 | <p>I have build server inside our domain (and it needs to be because it also talks to other boxes in the domain), and a webserver that is in the DMZ.</p>
<p>As part of our build scripts, I would like to deploy websites to the webserver in the DMZ, using the Nant copy task. The problem is, that Nant is invoked from TeamCity which runs under the System account on the build server, and there is no way that I can find to give the build server system account access to the DMZ webserver directories. (It probably isn't a good idea anyway).</p>
<p>Is there anyway to tell Nant to run a specific task under a different windows user, or is there another solution to my problem?</p>
<p><strong>Edit:</strong> One other restriction I am running under is that I can't create new domain accounts (well, at least not without going through an approval process). I can create local machine accounts, but in that case, it doesn't seem that runas will work across the DMZ.</p>
| [
{
"answer_id": 347775,
"author": "Scott Saad",
"author_id": 4916,
"author_profile": "https://Stackoverflow.com/users/4916",
"pm_score": 3,
"selected": true,
"text": "<scp"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24954/"
] |
344,607 | <p>I have recently started working with Unified Communication Managed API 2.0 (UCMA) and Office Communication Server(OCS) 2007. I have a need in my app that I have to create custom presence for my users? Has anyone of you guys done this before and can point me in right direction?</p>
<p>There is not much documentation out there regarding this, so I am struggling here.</p>
<p>Thanks</p>
| [
{
"answer_id": 347775,
"author": "Scott Saad",
"author_id": 4916,
"author_profile": "https://Stackoverflow.com/users/4916",
"pm_score": 3,
"selected": true,
"text": "<scp"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43007/"
] |
344,608 | <p>This question relates to an ASP.NET website, originally developed in VS 2005 and now in VS 2008.</p>
<p>This website uses two unmanaged external DLLs which are not .NET and I do not have the source code to compile them and have to use them as is.</p>
<p>This website runs fine from within Visual Studio, locating and accessing these external DLLs correctly. However, when the website is published on a webserver (runnning IIS6 and ASP.NET 2.0) rather than the development PC it cannot locate and access these external DLLs, and I get the following error:</p>
<p><code>Unable to load DLL 'XYZ.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)</code></p>
<p>The external DLLs are located in the bin directory of the website, along with the managed DLLs that wrap them and all the other DLLs for the website.</p>
<p>Searching this problem reveals that many other people seem to have the same problem accessing external non.NET DLLs from ASP.NET websites, but I haven't found a solution that works.</p>
<p>I have tried the following:</p>
<ul>
<li>Running DEPENDS to check the dependencies to establish that the first three
are in System32 directory in the path, the last is in the .NET 2
framework.</li>
<li>I put the two DLLs and their dependencies in
System32 and rebooted the server, but website still
couldn't load these external DLLs.</li>
<li>Gave full rights to ASPNET, IIS_WPG and IUSR (for that server) to
the website bin directory and rebooted, but website still couldn't
load these external DLLs.</li>
<li>Added the external DLLs as existing items to the projects and set
their "Copy to Output" property to "Copy Always", and website
still can't find the DLLs.</li>
<li>Also set their "Build Action" property to "Embedded resource" and
website still can't find the DLLs.</li>
</ul>
<p>Any assistance with this problem would be greatly appreciated!</p>
| [
{
"answer_id": 4598747,
"author": "Matt Woodard",
"author_id": 179187,
"author_profile": "https://Stackoverflow.com/users/179187",
"pm_score": 5,
"selected": false,
"text": "System.Environment.SetEnvironmentVariable(\"Path\", searchPath + \";\" + oldPath)\n"
},
{
"answer_id": 342... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27569/"
] |
344,630 | <p>I have an enumeration value marked with the following attribute. The second parameter instructs the compiler to error whenever the value is used. I want this behavior for anyone that implements my library, but I need to use this enumeration value within my library. How do I tell the compiler to ignore the Obsolete error for the couple of uses in my library.</p>
<pre><code>public enum Choices
{
One,
Two,
[ObsoleteAttribute("don't use me", true)]
Three,
Four
}
</code></pre>
<hr>
<p>Solution (Thanks everyone)</p>
<pre><code>public class EnumHack
{
static EnumHack()
{
// Safety check
if (Choices!= (Choices)Enum.Parse(typeof(Choices), "Three"))
throw new Exception("Choices.Three != 3; Who changed my Enum!");
}
[Obsolete("Backwards compatible Choices.Three", false)]
public const Choices ChoicesThree = (Choices)3;
}
</code></pre>
| [
{
"answer_id": 344635,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 3,
"selected": true,
"text": "private const Choices BackwardsCompatibleThree = (Choices) 3;\n"
},
{
"answer_id": 344666,
"author": "Ryan Co... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28736/"
] |
344,657 | <p>I'm trying to learn about trees by implementing one from scratch.
In this case I'd like to do it in C# Java or C++. (without using built in methods)</p>
<p>So each node will store a character and there will be a maximum of 26 nodes per node.</p>
<p>What data structure would I use to contain the pointers to each of the nodes?</p>
<p>Basically I'm trying to implement a radix tree from scratch.</p>
<p>Thanks,</p>
| [
{
"answer_id": 344827,
"author": "Bill K",
"author_id": 12943,
"author_profile": "https://Stackoverflow.com/users/12943",
"pm_score": 1,
"selected": false,
"text": "nextNode=nodes[c-'a'];\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43734/"
] |
344,665 | <p>I have a table like this:</p>
<pre><code> Column | Type | Modifiers
---------+------+-----------
country | text |
food_id | int |
eaten | date |
</code></pre>
<p>And for each country, I want to get the food that is eaten most often. The best I can think of (I'm using postgres) is:</p>
<pre><code>CREATE TEMP TABLE counts AS
SELECT country, food_id, count(*) as count FROM munch GROUP BY country, food_id;
CREATE TEMP TABLE max_counts AS
SELECT country, max(count) as max_count FROM counts GROUP BY country;
SELECT country, max(food_id) FROM counts
WHERE (country, count) IN (SELECT * from max_counts) GROUP BY country;
</code></pre>
<p>In that last statement, the GROUP BY and max() are needed to break ties, where two different foods have the same count.</p>
<p>This seems like a lot of work for something conceptually simple. Is there a more straight forward way to do it?</p>
| [
{
"answer_id": 344713,
"author": "John MacIntyre",
"author_id": 29043,
"author_profile": "https://Stackoverflow.com/users/29043",
"pm_score": 2,
"selected": false,
"text": "select country, food_id, count(*) cnt \ninto #tempTbl \nfrom mytable \ngroup by country, food_id\n\nselect country,... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34382/"
] |
344,672 | <p>What is the algorithm for storing the pixels in a spiral in JS?</p>
| [
{
"answer_id": 344945,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 4,
"selected": true,
"text": "var Spiral = function(a) {\n this.initialize(a);\n}\n\nSpiral.prototype = {\n _a: 0.5,\n\n constructor: Spiral,... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18149/"
] |
344,697 | <p>I have a site with the following robots.txt in the root:</p>
<pre><code>User-agent: *
Disabled: /
User-agent: Googlebot
Disabled: /
User-agent: Googlebot-Image
Disallow: /
</code></pre>
<p>And pages within this site are getting scanned by Googlebots all day long. Is there something wrong with my file or with Google?</p>
| [
{
"answer_id": 344700,
"author": "Sean Carpenter",
"author_id": 729,
"author_profile": "https://Stackoverflow.com/users/729",
"pm_score": 6,
"selected": true,
"text": "Disallow:"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29493/"
] |
344,705 | <p>I'm thinking of choosing Adobe AIR as the client-side implementation technology for an upcoming project. (The previous choice was C# and WPF, but I've been really impressed with Flash/Flex/AIR lately.)</p>
<p>But one of the most important features of my product will be its plugin architecture, allowing third party developers to extend the functionality and GUI in interesting ways.</p>
<p>I know how I'd design the architecture in C#: A plug-in loader would enumerate all of the assemblies in the local "app/plugins/" directory. For each assembly, it'd enumerate all of the classes, looking for implementations of the "IPluginFactory" interface. For each plugin created by the factory, I'd ask it for its MVC classes, and snap its GUI elements (menu items, panels, etc) into the appropriate slots in the existing GUI layout.</p>
<p>I'd like to accomplish the same thing within AIR (loading plugins from the local filesystem, not from the web). After reading <a href="http://www.adobe.com/devnet/air/articles/introduction_to_air_security.html" rel="noreferrer">this article</a>, my understanding is that it's possible, and that the basic architecture (loading SWFs into sandboxed ApplicationDomains, etc) is very similar to the way you'd do it in .NET.</p>
<p>But I'm curious about the gotchas.</p>
<p>If any of you have done any dynamic classloading with the flash player (preferably in mixed flash/flex apps, and ESPECIALLY within the AIR host), I'd love to hear about your experiences building your plugin framework and where you ran into tricky situations with the flash player, and with the flash, flex, and AIR APIs.</p>
<p>For example, if someone asked me this same question, but with the Java platform in mind, I'd definitely mention that the JVM has no notion of "modules" or "assemblies". The highest level of aggregation is the "class", so it can be difficult to create organizational structures within a plugin system for managing large projects. I'd also talk about issues with multiple classloaders and how each maintains its own separate instance of a loaded class (with its own separate static vars).</p>
<hr>
<p>Here are a few specific questions still unanswered for me:</p>
<p>1) The actionscript "Loader" class can load an SWF into an ApplicationDomain. But what exactly does that appdomain contain? Modules? Classes? How are MXML components represented? How do I find all of the classes that implement my plugin interface?</p>
<p>2) If you've loaded a plugin into a separate ApplicationDomain from the main application, is it substantially more complicated to call code from within that other appdomain? Are there any important limitations about the kinds of data that can pass through the inter-appdomain marshalling layer? Is marshalling prohibitively expensive?</p>
<p>3) Ideally, I'd like to develop the majority of my own main code as a plugin (with the main application being little more than a plugin-loading shell) and use the plugin architecture to hoist that functionality into the app. Does that strike fear in your heart?</p>
| [
{
"answer_id": 349767,
"author": "hasseg",
"author_id": 4111,
"author_profile": "https://Stackoverflow.com/users/4111",
"pm_score": 4,
"selected": true,
"text": "ModuleManager"
},
{
"answer_id": 476125,
"author": "RogerV",
"author_id": 48048,
"author_profile": "https:... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22979/"
] |
344,714 | <p>!!! This is not a duplicate question since the solutions offered in the other topics didn't work for me.</p>
<p>When I try to commit:</p>
<p>Error: Working copy 'D:\Webs\Drupal 6' locked<br>
Error: Please execute the "Cleanup" command.</p>
<p>When I try to do a cleanup:</p>
<p>Cleanup failed to process the following paths:
D:\Webs\Drupal 6</p>
<p>Does anyone know how I can solve this problem?</p>
| [
{
"answer_id": 344745,
"author": "derobert",
"author_id": 27727,
"author_profile": "https://Stackoverflow.com/users/27727",
"pm_score": 2,
"selected": false,
"text": "D:\\Webs\\Drupal 6"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,715 | <p>I'm writing some code that id like to be able to work with any window, such as a window created through the windows API, MFC, wxWidgets, etc.</p>
<p>The problem is that for some things I need to use the same thread that created the window, which in many cases is just sat in a message loop.</p>
<p>My first thought was to post a callback message to the window, which would then call a function in my code when it recieves the message using one of the params and a function pointer of some sorts. However there doesnt seem to be a standard windows message to do this, and I cant create my own message since I dont control the windows code, so cant add the needed code to the message handler to implement the callback...</p>
<p>Is there some other way to get the thread that created the window to enter my function?</p>
<p>EDIT:
John Z sugessted that I hooked the windows messages. If I do that is there some way to get "ids" for custom messages without the risk of conflicting with any custom messages the window already has?</p>
<p>eg I might do</p>
<pre><code>WM_CALLBACK = WM_APP+1
</code></pre>
<p>But if the window I'm hooking has already done something with WM_APP+1 I'm gonna run into problems.</p>
<p>EDIT2:
just found RegisterWindowMessage :)</p>
| [
{
"answer_id": 344738,
"author": "John Z",
"author_id": 43430,
"author_profile": "https://Stackoverflow.com/users/43430",
"pm_score": 3,
"selected": true,
"text": "// Subclass the edit control. \nwpOrigEditProc = (WNDPROC) SetWindowLong(hwndEdit, GWL_WNDPROC, (LONG)EditSubclassProc); \n\... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6266/"
] |
344,737 | <p>I have a XML Structure that looks like this.</p>
<pre><code><sales>
<item name="Games" sku="MIC28306200" iCat="28"
sTime="11/26/2008 8:41:12 AM"
price="1.00" desc="Item Name" />
<item name="Games" sku="MIC28307100" iCat="28"
sTime="11/26/2008 8:42:12 AM"
price="1.00" desc="Item Name" />
...
</sales>
</code></pre>
<p>I am trying to find a way to SORT the nodes based on the sTime attribute which is a DateTime.ToString() value. The trick is I need to keep the Nodes in tact and for some reason I can't find a way to do that. I'm fairly certain that LINQ and XPath have a way to do it, but I'm stuck because I can't seem to sort based on DateTime.ToString() value.</p>
<pre><code>XPathDocument saleResults = new XPathDocument(@"temp/salesData.xml");
XPathNavigator navigator = saleResults.CreateNavigator();
XPathExpression selectExpression = navigator.Compile("sales/item/@sTime");
selectExpression.AddSort("@sTime",
XmlSortOrder.Descending,
XmlCaseOrder.None,
"",
XmlDataType.Number);
XPathNodeIterator nodeIterator = navigator.Select(selectExpression);
while( nodeIterator.MoveNext() )
{
string checkMe = nodeIterator.Current.Value;
}
</code></pre>
<p>I also need to maintain a pointer to the NODE to retrieve the values of the other attributes. </p>
<p>Perhaps this isn't a simple as I thought it would be.</p>
<p>Thanks.</p>
<p><strong>Solution</strong>: Here's what I ended up using. Taking the selected answer and the IComparable class this is how I get the XML nodes sorted based on the sTime attribute and then get the all the attributes into the appropriate Arrays to be used later.</p>
<pre><code> XPathDocument saleResults = new XPathDocument(@"temp/salesData.xml");
XPathNavigator navigator = saleResults.CreateNavigator();
XPathExpression selectExpression = navigator.Compile("sales/item");
XPathExpression sortExpr = navigator.Compile("@sTime");
selectExpression.AddSort(sortExpr, new DateTimeComparer());
XPathNodeIterator nodeIterator = navigator.Select(selectExpression);
int i = 0;
while (nodeIterator.MoveNext())
{
if (nodeIterator.Current.MoveToFirstAttribute())
{
_iNameList.SetValue(nodeIterator.Current.Value, i);
}
if (nodeIterator.Current.MoveToNextAttribute())
{
_iSkuList.SetValue(nodeIterator.Current.Value, i);
}
...
nodeIterator.Current.MoveToParent();
i++;
}
</code></pre>
| [
{
"answer_id": 344764,
"author": "jlew",
"author_id": 7450,
"author_profile": "https://Stackoverflow.com/users/7450",
"pm_score": 3,
"selected": true,
"text": " class Program\n {\n static void Main(string[] args)\n {\n XPathDocument saleResults... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30408/"
] |
344,741 | <p>I am looking to create an expression tree by parsing xml using C#.
The xml would be like the following:</p>
<pre><code><Expression>
<If>
<Condition>
<GreaterThan>
<X>
<Y>
</GreaterThan>
</Condition>
<Expression />
<If>
<Else>
<Expression />
</Else>
<Expression>
</code></pre>
<p>or another example...</p>
<pre><code><Expression>
<Add>
<X>
<Expression>
<Y>
<Z>
</Expression>
</Add>
</Expression>
</code></pre>
<p>...any pointers on where to start would be helpful.</p>
<p>Kind regards,</p>
| [
{
"answer_id": 344811,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 4,
"selected": true,
"text": "using System.Linq.Expressions; //in System.Core.dll\n\nExpression BuildExpr(XmlNode xmlNode)\n { switch(xmlNode.Name)\n ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21586/"
] |
344,744 | <p>The DB load on my site is getting really high so it is time for me to cache common queries that are being called 1000s of times an hour where the results are not changing.
So for instance on my city model I do the following: </p>
<pre><code>def self.fetch(id)
Rails.cache.fetch("city_#{id}") { City.find(id) }
end
def after_save
Rails.cache.delete("city_#{self.id}")
end
def after_destroy
Rails.cache.delete("city_#{self.id}")
end
</code></pre>
<p>So now when I can City.find(1) the first time I hit the DB but the next 1000 times I get the result from memory. Great. But most of the calls to city are not City.find(1) but @user.city.name where Rails does not use the fetch but queries the DB again... which makes sense but not exactly what I want it to do. </p>
<p>I can do City.find(@user.city_id) but that is ugly. </p>
<p>So my question to you guys. What are the smart people doing? What is
the right way to do this? </p>
| [
{
"answer_id": 344854,
"author": "mwilliams",
"author_id": 23909,
"author_profile": "https://Stackoverflow.com/users/23909",
"pm_score": 0,
"selected": false,
"text": "class Product < ActiveRecord::Base\n extend ActiveSupport::Memoizable\n\n belongs_to :category\n\n def filesize(num =... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43744/"
] |
344,748 | <p>I'm trying to do something like </p>
<pre><code>URL clientks = com.messaging.SubscriptionManager.class.getResource( "client.ks" );
String path = clientks.toURI().getPath();
System.setProperty( "javax.net.ssl.keyStore", path);
</code></pre>
<p>Where client.ks is a file stored in com/messaging in the jar file that I'm running.</p>
<p>The thing that reads the javax.net.ssl.keyStore is expecting a path to the client.ks file which is in the jar. I'd rather not extract the file and put in on the client's machine if possible. So is it possible to reference a file in a jar?</p>
<p>This doesn't work as getPath() returns null. Is there another way to do this?</p>
| [
{
"answer_id": 344782,
"author": "Jason Day",
"author_id": 737,
"author_profile": "https://Stackoverflow.com/users/737",
"pm_score": 3,
"selected": false,
"text": "InputStream"
},
{
"answer_id": 17352927,
"author": "user2529737",
"author_id": 2529737,
"author_profile"... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7949/"
] |
344,753 | <p>i am trying to do something with the PIL Image library in django, but i experience some problems.</p>
<p>I do like this:</p>
<p><code>
import Image
</code></p>
<p>And then I do like this</p>
<p><code>
images = map(Image.open, glob.glob(os.path.join(dirpath, '*.thumb.jpg')))
</code></p>
<p>But when i try to run this i get an error and it leeds me to think that its not imported correctly, anybody know?</p>
<p><code>
type object 'Image' has no attribute 'open'
</code></p>
| [
{
"answer_id": 344791,
"author": "Manuel Ceron",
"author_id": 23657,
"author_profile": "https://Stackoverflow.com/users/23657",
"pm_score": 0,
"selected": false,
"text": "from PIL import Image\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42546/"
] |
344,777 | <p>I'm trying to add two folders to my eclipse project's classpath, let's say Folder A and Folder B. B is inside A. Whenever I add A to the classpath</p>
<pre><code><classpathentry kind="lib" path="/A"/>
</code></pre>
<p>it works just fine, but I need to be able to access the files in B as well. Whenever I try to add</p>
<pre><code><classpathentry kind="lib" path="/A/B"/>
</code></pre>
<p>to the classpath, it says </p>
<blockquote>
<p>Cannot nest 'A/B inside library A'</p>
</blockquote>
<p>I'm a newbie when it comes to editing the classpath, so I'm wondering, is there is anyway to add a folder in the eclipse classpath that is nested in another folder that is also in the eclipse classpath?</p>
| [
{
"answer_id": 8398181,
"author": "michaelliu",
"author_id": 726894,
"author_profile": "https://Stackoverflow.com/users/726894",
"pm_score": 2,
"selected": false,
"text": "<classpathentry kind=\"lib\" path=\"/A\" excluding=\"B/\"/>\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1459442/"
] |
344,784 | <p>I have some library code which is used from my application and is also used by a .NET custom action in a Visual Studio installer project. The library code in turn uses the Enterprise Library logging block to do its logging. How can I get configuration information to the Enterprise Library in the context of my custom action running inside msiexec? Is it possible to bootstrap the config mechanism in code before I make any calls to the EntLib?</p>
<p>Update: I've produced a hack that seems like it will work but relies on setting a non-public static field using reflection. It's a shame that EntLib is so tightly coupled to the .NET ConfigurationManager.</p>
<pre><code>var factory = new LogWriterFactory( new FakeConfigSource( "foo.config" ) );
var field = typeof ( Logger ).GetField( "factory", BindingFlags.Static | BindingFlags.NonPublic );
field.SetValue( null, factory );
Logger.Write( "Test" );
</code></pre>
<p>Update 2: Although that hack works in a testbed, when run in the context of msiexec, the assembly loader does not find the assemblies referenced in the config file. Fuslogvw indicates that AppBase is the windows system32 directory, which makes some sense. What I don't understand is why the custom action assembly's manifest dependencies (which are in the [TargetDir] directory alongside the custom action assembly) are found, but dynamically-loaded assemblies called out in the config file are not. Can't see any way around this.</p>
| [
{
"answer_id": 362029,
"author": "w4g3n3r",
"author_id": 36745,
"author_profile": "https://Stackoverflow.com/users/36745",
"pm_score": 0,
"selected": false,
"text": "Const msiMessageTypeInfo = &H04000000\nConst msiMessageTypeFatalExit = &H00000000\nConst msiMessageTypeError = &H01000000\... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7450/"
] |
344,789 | <p>I want to install PEAR on PHP 5, so I can use Spreadsheet_Excel_Writer.</p>
<p>I don`t know how to install it on my ISP nor my personal MacBook.</p>
<p>Thoughts for both?</p>
| [
{
"answer_id": 344830,
"author": "jlleblanc",
"author_id": 586,
"author_profile": "https://Stackoverflow.com/users/586",
"pm_score": 2,
"selected": false,
"text": "pear install Spreadsheet_Excel_Writer\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,797 | <p>What is the best solution to build several CDT C++ projects from the command line? The projects have references and so it is not possible to just build single projects.</p>
| [
{
"answer_id": 962610,
"author": "James Blackburn",
"author_id": 115144,
"author_profile": "https://Stackoverflow.com/users/115144",
"pm_score": 6,
"selected": false,
"text": "eclipse -nosplash \n -application org.eclipse.cdt.managedbuilder.core.headlessbuild \n -import {[u... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,801 | <p>Deletion operations seems to be the slowest in a YUI datatable. I have a datatable with > 300 rows. I need to delete selected rows. I tried removing the selected records from the <code>recordset</code> and then calling <code>table.render()</code> .. While this is okay, can it be made better?</p>
| [
{
"answer_id": 346747,
"author": "Evan Anderson",
"author_id": 40764,
"author_profile": "https://Stackoverflow.com/users/40764",
"pm_score": 2,
"selected": false,
"text": "var selected = theDataTable.getSelectedRows();\nvar rset = theDataTable.getRecordSet();\n\nfor (var x = 0; x < selec... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,823 | <p>On various pages throughout my PHP web site and in various nested directories I want to include a specific file at a path relative to the root.</p>
<p>What single command can I put on both of these pages...</p>
<pre>http://www.example.com/pageone.php</pre>
<pre>http://www.example.com/somedirectory/pagetwo.php</pre>
<p>...to include this page:</p>
<pre>http://www.example.com/includes/analytics.php</pre>
<p>This does not work:</p>
<pre><code><?php include('/includes/analytics.php'); ?>
</code></pre>
<p>Does it matter that this is hosted in IIS on Windows?</p>
| [
{
"answer_id": 344831,
"author": "Stefan Mai",
"author_id": 13257,
"author_profile": "https://Stackoverflow.com/users/13257",
"pm_score": 1,
"selected": false,
"text": "include 'includes/analytics.php';\n"
},
{
"answer_id": 344848,
"author": "Greg",
"author_id": 24181,
... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/83/"
] |
344,826 | <p>Today I'm starting a little project to create a Django based school administration program. I'm currently designing the models and their corresponding relationships. Being rather new to Django and relational databases in general, I would like some input.</p>
<p>Before I show you the current model layout, you need to have an idea of what the program is meant to do. Keep in mind that it is my goal for the software to be usable by both individual schools and entire school systems.</p>
<p>Features:
- Create multiple schools<br>
- Track student population per school<br>
- Track student demographics, parent contact info, etc.<br>
- Grade books<br>
- Transcripts<br>
- Track disciplinary record.<br>
- Fees schedules and payment tracking<br>
- Generate reports (student activity, student transcripts, class progress, progress by demographic, payment reports, disciplinary report by student class and demographic)<br>
-- Automated PDF report email to parents for student reports.</p>
<p>Given those feature requirements, here is the model layout that I currently have:
Models</p>
<pre><code>* Person
o ID: char or int
o FirstName: char
o MiddleName: char
o FamilyName: char
o Sex: multiple choice
o Ethnicity: multiple choice
o BirthDate: date
o Email: char
o HomePhone: char
o WordPhone: char
o CellPhone: char
o Address: one-to-one with Location
* Student (inherent Person)
o Classes: one-to-many with Class
o Parents: one-to-many with Parent
o Account: one-to-one with PaymentSchedule
o Tasks: one-to-many with Tasks
o Diciplin: one-to-many with Discipline
* Parent (inherent Person)
o Children: one-to-many with Student
* Teacher (inherent Person)
o Classes: one-to-many with Class
* Location
o Address: char
o Address2: char
o Address3: char
o City: char
o StateProvince: char
o PostalCode: char
o Country: multiple choice
* Course
o Name: char
o Description: text field
o Grade: int
* Class
o School: one-to-one with School
o Course: one-to-one with Course
o Teacher: one-to-one with Teacher
o Students: one-to-many with Student
* School
o ID: char or int
o Name: char
o Location: one-to-one with location
* Tasks
o ID: auto increment
o Type: multiple choice (assignment, test, etc.)
o DateAssigned: date
o DateCompleted: date
o Score: real
o Weight: real
o Class: one-to-one with class
o Student: one-to-one with Student
* Discipline
o ID: auto-increment
o Discription: text-field
o Reaction: text-field
o Students: one-to-many with Student
* PaymentSchedule
o ID: auto-increment
o YearlyCost: real
o PaymentSchedule: multiple choice
o ScholarshipType: multiple choice, None if N/A
o ScholarshipAmount: real, 0 if N/A
o Transactions: one-to-many with Payments
* Payments
o auto-increment
o Amount: real
o Date: date
</code></pre>
<p>If you have ideas on how this could be improved upon, I'd love to year them!</p>
<h1>Update</h1>
<p>I've written the initial models.py code, which is probably in need of much love. If you would like to take a look, or even join the project, check out the link.<br>
<a href="http://bazaar.launchpad.net/~djangoschools/djangoschools/trunk/files" rel="nofollow noreferrer"><a href="http://bazaar.launchpad.net/~djangoschools/djangoschools/trunk/files" rel="nofollow noreferrer">http://bazaar.launchpad.net/~djangoschools/djangoschools/trunk/files</a></a></p>
| [
{
"answer_id": 345403,
"author": "Justin Voss",
"author_id": 5616,
"author_profile": "https://Stackoverflow.com/users/5616",
"pm_score": 0,
"selected": false,
"text": "from django.db import models\n\nSEX_CHOICES = (\n ('M', 'Male'),\n ('F', 'Female')\n)\n\nETHNICITY_CHOICES = (\n ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33383/"
] |
344,828 | <p>Basically I am trying to retrieve a list of stored procedure parameters using Linq to SQL? Is there a way to do this?</p>
| [
{
"answer_id": 345403,
"author": "Justin Voss",
"author_id": 5616,
"author_profile": "https://Stackoverflow.com/users/5616",
"pm_score": 0,
"selected": false,
"text": "from django.db import models\n\nSEX_CHOICES = (\n ('M', 'Male'),\n ('F', 'Female')\n)\n\nETHNICITY_CHOICES = (\n ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9382/"
] |
344,829 | <p>I got a core that looks very different from the ones I usually get - most of the threads are in __kernel_vsyscall() :</p>
<pre><code> 9 process 11334 0xffffe410 in __kernel_vsyscall ()
8 process 11453 0xffffe410 in __kernel_vsyscall ()
7 process 11454 0xffffe410 in __kernel_vsyscall ()
6 process 11455 0xffffe410 in __kernel_vsyscall ()
5 process 11474 0xffffe410 in __kernel_vsyscall ()
4 process 11475 0xffffe410 in __kernel_vsyscall ()
3 process 11476 0xffffe410 in __kernel_vsyscall ()
2 process 11477 0xffffe410 in __kernel_vsyscall ()
1 process 11323 0x08220782 in MyClass::myfunc ()
</code></pre>
<p>What does that mean?</p>
<p>EDIT:
In particular, I usually see a lot of threads in "pthread_cond_wait" and "___newselect_nocancel" and now those are on the second frame in each thread - why is this core different?</p>
| [
{
"answer_id": 344841,
"author": "coppro",
"author_id": 16855,
"author_profile": "https://Stackoverflow.com/users/16855",
"pm_score": 6,
"selected": true,
"text": "__kernel_vsyscal"
},
{
"answer_id": 347355,
"author": "Community",
"author_id": -1,
"author_profile": "h... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779/"
] |
344,845 | <p>I am regularly required to compare data sent to me in Excel spreadsheets with data that lives in SQL Server. I know that you can connect SQL Server to spreadsheets but it always seemed clunky</p>
<p>This is really a post to show off my solution but I would love to hear other peoples ideas.</p>
| [
{
"answer_id": 344846,
"author": "wcm",
"author_id": 2173,
"author_profile": "https://Stackoverflow.com/users/2173",
"pm_score": 3,
"selected": true,
"text": "Sub CreateOpenXML()\n\n Dim cols, rows As Long\n cols = Selection.Columns.Count\n rows = Selection.rows.Count\n Dim H... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2173/"
] |
344,851 | <p>I added a <code>get_absolute_url</code> function to one of my models.</p>
<pre><code>def get_absolute_url(self):
return '/foo/bar'
</code></pre>
<p>The admin site picks it up and adds a "view on site" link to the detail page for that object (when I put a real URL there instead of "/foo/bar").</p>
<p>The problem is instead of going to <code>http://localhost:8000/foo/bar</code>, it goes to <code>http://example.com/foo/bar</code>.</p>
<p>What am I doing wrong?</p>
| [
{
"answer_id": 11420955,
"author": "supervacuo",
"author_id": 399367,
"author_profile": "https://Stackoverflow.com/users/399367",
"pm_score": 2,
"selected": false,
"text": "sites"
},
{
"answer_id": 54986923,
"author": "Xerion",
"author_id": 92436,
"author_profile": "h... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/437/"
] |
344,856 | <p>I have a form action that needs to have its value set from a variable. I need to set the variable once and it will be reflected many times throughout the DOM.</p>
<p>So:</p>
<p>variable = "somthing.html";
...
</p>
| [
{
"answer_id": 344869,
"author": "Mitchel Sellers",
"author_id": 13279,
"author_profile": "https://Stackoverflow.com/users/13279",
"pm_score": 2,
"selected": false,
"text": "var variableName = \"myform.htm\";\n\nthis.form.action = variableName;\n"
},
{
"answer_id": 344885,
"a... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4444/"
] |
344,860 | <p>Let's say I have the three following lists</p>
<p>A1<br>
A2<br>
A3 </p>
<p>B1<br>
B2</p>
<p>C1<br>
C2<br>
C3<br>
C4<br>
C5 </p>
<p>I'd like to combine them into a single list, with the items from each list as evenly distributed as possible sorta like this:</p>
<p>C1<br>
A1<br>
C2<br>
B1<br>
C3<br>
A2<br>
C4<br>
B2<br>
A3<br>
C5</p>
<p>I'm using .NET 3.5/C# but I'm looking more for how to approach it then specific code.</p>
<p>EDIT: I need to keep the order of elements from the original lists.</p>
| [
{
"answer_id": 344896,
"author": "nlucaroni",
"author_id": 157,
"author_profile": "https://Stackoverflow.com/users/157",
"pm_score": 1,
"selected": false,
"text": "- filter lists into three categories\n - lists of length 1\n - first half of the elements of lists with > 1 elements\n... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1786/"
] |
344,881 | <p>I'm doing some straight up asynchronous calls from javascript using the XMLHTTPRequest object. On success, with certain return values, I would like to do an asynchonous post back on an update panel and run some server side methods. This is about how I'm implementing it now:</p>
<pre><code><script language="javascript">
function AjaxCallback_Success(objAjax) {
if (objAjax.responseText == "refresh") {
document.getElementById('<%= btnHidden.ClientID %>').click();
}
}
</script>
<asp:UpdatePanel ID="upStatus" runat="server">
<ContentTemplate>
<asp:Button ID="btnHidden" runat="server" style="display: none;" OnClick="SomeMethod" />
<asp:DropDownList ID="ddlStatus" field="Orders_Status" parent="Orders" runat="server">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</code></pre>
<p>This has to do with work flow. If while you are working on an order, someone invoices it, then the options available in the status drop down actually changes. So a timed even checks for changes and if there is a change, which wouldn't normally happen, the update panel posts back and the drop down list gets re-bound to a new data table based on various return values from the ajax response text. </p>
<p>My original code is actually much more complicated than this, but I've abstracted just enough to make my concept clearer. Is there a better, cleaner way to do this by dropping the hidden button and making a straight javascript call that will cause an update panel to asynchonously postback and run a server side method?</p>
| [
{
"answer_id": 344903,
"author": "Aaron Powell",
"author_id": 11388,
"author_profile": "https://Stackoverflow.com/users/11388",
"pm_score": 3,
"selected": true,
"text": "__doPostBack('eventTarget','eventArguments');\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18893/"
] |
344,906 | <p>I thought it is a very simple task to export data in a view from SQL Server 2005 to a fixed width text file. But the wizard is a pain. The format is not correct. Does anybody know how to deal with it? or any better way to do that?</p>
| [
{
"answer_id": 345058,
"author": "jerryhung",
"author_id": 37568,
"author_profile": "https://Stackoverflow.com/users/37568",
"pm_score": 4,
"selected": true,
"text": "bcp \"SELECT * FROM AdventureWorks.Person.Contact\" queryout Contacts.txt -c -T\n"
},
{
"answer_id": 345542,
... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344906",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31689/"
] |
344,908 | <p>In a web-based application that uses the Model-View-Controller design pattern, the logic relating to processing form submissions seems to belong somewhere in between the Model layer and the Controller layer. This is especially true in the case of a complex form (i.e. where form processing goes well beyond simple CRUD operations).</p>
<p>What's the best way to conceptualize this? Are forms simply a kind of glue between models and controllers? Or does form logic belong squarely in the M or C camp?</p>
<p>EDIT: I understand the basic flow of information in an MVC application (see chills42's answer for a summary). My question is where the form processing logic belongs - in the controller, in the model, or somewhere else?</p>
| [
{
"answer_id": 2635553,
"author": "Samnan",
"author_id": 296542,
"author_profile": "https://Stackoverflow.com/users/296542",
"pm_score": 2,
"selected": false,
"text": "class User_controller\n{\n\n function login()\n {\n $form = new LoginForm(); // this is the class you would... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103/"
] |
344,924 | <p>I did this in the past, and can't remember the correct command (I think I was using instring or soemthign?)</p>
<p>I want to list all the windows services running that have the word 'sql' in them.</p>
<p>Listing all the windows services is:</p>
<pre><code>Get-Service
</code></pre>
<p>Is there a instring function that does this?</p>
| [
{
"answer_id": 344933,
"author": "Steven Murawski",
"author_id": 1233,
"author_profile": "https://Stackoverflow.com/users/1233",
"pm_score": 6,
"selected": true,
"text": "Get-Service -Name *sql*\n"
},
{
"answer_id": 11266713,
"author": "Nisanth.KV",
"author_id": 1456981,
... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] |
344,928 | <p>I am working on an ASP.NET web application that is required to bring up a popup on a roolover. I am using the "OnMouseOver" event and it works as expected. The problem is that the event is on a "hair trigger"; even a casual passage of the mouse over the control brings up the popup (which then must be manually dismissed). I want to add a delay so that a rapid pass over the control in question does not trigger the event. Is there a way to set such a delay or is there a different event that I could use to get the same "trigger event on a slow rollover"? </p>
| [
{
"answer_id": 344940,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": true,
"text": "onmouseover"
},
{
"answer_id": 345022,
"author": "JonStonecash",
"author_id": 23862,
"author_profile": "htt... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23862/"
] |
344,934 | <p>I'd like one of my table rows to be a button that takes up an entire row of my UITableView. I figured the best way to go about this is to instantiate a UIButton, and give it the same frame size as an instance of UITableViewCell, and add that as a subview to the cell. I'm almost there, but quite a few pixels off to not get that perfect touch to it. Is there a better approach to this, or perhapsps can my placement accuracy be fixed up to get that perfect alignment?</p>
<pre><code>cell = [tv dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil) {
cell = [self tableviewCellWithReuseIdentifier:CellIdentifier];
}
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setFrame:CGRectMake(0.0f, 5.0f, 320.0f, 44.0f)];
[button setTitle:@"Do Stuff" forState:UIControlStateNormal];
[button addTarget:self action:@selector(doStuff:) forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:button];
</code></pre>
| [
{
"answer_id": 345062,
"author": "Ryan Townshend",
"author_id": 24707,
"author_profile": "https://Stackoverflow.com/users/24707",
"pm_score": 4,
"selected": false,
"text": "[[[self tableView] cellForRowAtIndexPath:indexPath] setSelected:YES animated:YES];\n[self doStuff];\n[[[self tableV... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40882/"
] |
344,961 | <p>I'm trying to remember how the math is worked out to compute the remainder of an XOR algorithm in Cyclical Redundancy Checks to verify the remainder bits of a network message.</p>
<p>I shouldn't have tossed that text book.</p>
<p>This is easily done in code, but how is it worked out by hand?</p>
<p>I know it looks something like a standard division algorithm, but I can't remember where to go from there to get the remainder. </p>
<pre><code> ___________
1010 | 101101000
</code></pre>
<p><strong>Note:</strong> I did google it, but wasn't able to find a place where they mapped the steps in figuring the remainder.</p>
| [
{
"answer_id": 5977379,
"author": "Anant Rao",
"author_id": 750480,
"author_profile": "https://Stackoverflow.com/users/750480",
"pm_score": 3,
"selected": false,
"text": "1010 | 101101000\n 1010\n 0001 this result is 1011 XOR 1010 = 0001\n 1010\n 1010\n ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34183/"
] |
344,963 | <p>I'm trying to use the freeware <a href="http://www.nontube.com/products/multiple-find-and-replace/" rel="nofollow noreferrer">Multiple Find And Replace 1.00</a> suggested in <a href="https://stackoverflow.com/questions/268045/multi-line-search-and-replace-tool#272325">this question</a>.</p>
<p><a href="http://www.nontube.com/images/screenshot-mfar.png" rel="nofollow noreferrer">Multiple Find And Replace 1.00 http://www.nontube.com/images/screenshot-mfar.png</a></p>
<p>Unfortunately it requires that I explicitly select each file I'd like it to search.</p>
<p>But, it does allow me to load in a text file of the file paths.</p>
<pre>C:\one.txt
C:\two.txt
C:\somedirectory\three.txt</pre>
<p><strong>I'd like a text file of paths to all files with extension .php within a certain directory and all its subdirectories (recursive).</strong></p>
<p>Does anyone know of a ready-made tool I can use to quickly generate such a list of files?</p>
| [
{
"answer_id": 344974,
"author": "Cory Foy",
"author_id": 4083,
"author_profile": "https://Stackoverflow.com/users/4083",
"pm_score": 2,
"selected": false,
"text": "dir /S /B *.php"
},
{
"answer_id": 344980,
"author": "Brett",
"author_id": 43778,
"author_profile": "ht... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/83/"
] |
344,964 | <p>I have a binary field in my database that is hard to describe in a UI using a single "Is XXXX?"-type checkbox. I'd rather use a pair of radio buttons (e.g. "Do it the Foo way" and "Do it the Bar way"), but right now all the other fields on my form are data-bound to a business object. I'd like to data-bind the pair of radio buttons to the business object as well, but haven't come up with a good way to do it yet. I can bind one of the buttons to the field, such that the field is set "true" if the button is selected, but while selecting the other button does de-select the first one (that is, the two radio buttons are properly paired), the value of the field does not update to reflect this.</p>
<p>I'd like to be able to say</p>
<pre><code>button1.DataBindings.Add(new Binding("checked", source, "useFoo"));
button2.DataBindings.Add(new Binding("checked", source, "!useFoo"));
</code></pre>
<p>but I'm pretty sure that will throw when it runs. Is there an easier way, or should I just put more thought into how to word a single checkbox? I don't want to add extra functions to handle something this trivial...</p>
<p>ETA: A commenter has suggested considering a dropdown (ComboBox). I had thought about this, but how would I data-bind that to a boolean field in a database/Property in a business object? If I bind the SelectedItem to the useFoo property, what would go in the Items collection? Would I have to add just "True" and "False", or could I somehow add a key/value pair object that ties a displayed item ("Use Foo" / "Do Not Use Foo") to the boolean value behind it? I'm having trouble finding docs on this.</p>
<hr>
<p>About the answer: the solution I wound up using involved modifying the business object -- the basic idea is very similar to the one posted by Gurge, but I came up with it separately before I read his response. In short, I added a separate property that simply returns <code>!useFoo</code>. One radio button is bound to <code>source.UseFoo</code>, and the other is bound to <code>source.UseBar</code> (the name of the new property). It's important to make sure the new property has both getters and setters, or you'll wind up with really odd behavior.</p>
| [
{
"answer_id": 345568,
"author": "Guge",
"author_id": 37771,
"author_profile": "https://Stackoverflow.com/users/37771",
"pm_score": 2,
"selected": true,
"text": "IIF(Foo=true, false, true)"
},
{
"answer_id": 378662,
"author": "Community",
"author_id": -1,
"author_prof... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26286/"
] |
344,966 | <p>I want to override the bad default tabbing scheme in emacs so that it will work like most other editors (eclipse, notepad++). I want to set it so that regardless of mode, tab will insert a tab, and pressing enter will keep me at my current tab depth.</p>
<p>I tried this, but it does nothing:</p>
<pre><code>(global-set-key (kbd "TAB") 'tab-to-tab-stop)
(setq default-tab-width 4) ;; 8 is way too many
</code></pre>
| [
{
"answer_id": 344970,
"author": "J Cooper",
"author_id": 38803,
"author_profile": "https://Stackoverflow.com/users/38803",
"pm_score": 1,
"selected": false,
"text": "C-j"
},
{
"answer_id": 345291,
"author": "ShreevatsaR",
"author_id": 4958,
"author_profile": "https:/... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40397/"
] |
344,969 | <p>I have a JQueryDialog with a text field, an OK button and a cancel button.</p>
<p>I want to be able to hit the enter key after filling in the text fields and have it do the same action as when I click the OK button.</p>
| [
{
"answer_id": 345005,
"author": "Jason Day",
"author_id": 737,
"author_profile": "https://Stackoverflow.com/users/737",
"pm_score": 6,
"selected": true,
"text": "getRootPane().setDefaultButton(okButton)"
},
{
"answer_id": 1308758,
"author": "John Yeary",
"author_id": 160... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32899/"
] |
344,973 | <p>I would like to have alternate behavior during a print stylesheet on a web page. Something along the lines of:</p>
<blockquote>
<p>If this page is being printed, don't
bother calling SWFObject to summon an
.swf into existence. Just leave the
HTML that the Flash will replace.</p>
</blockquote>
<p>I've tried things like setting a known element to a known style that exists for the screen but not for the print stylesheet. But getting a "style" via Javascript doesn't get a <em>computed</em> style.</p>
<p>Summary: In a cross-browser way, is it possible to tell which stylesheet is in effect?</p>
| [
{
"answer_id": 345011,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 4,
"selected": true,
"text": "display:none;"
},
{
"answer_id": 345012,
"author": "Victor",
"author_id": 42518,
"author_profile": ... | 2008/12/05 | [
"https://Stackoverflow.com/questions/344973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12694/"
] |
344,987 | <p>In VisualBasic.Net When I activate a picture box and then draw something on it, it draws and then immediately goes blank. Works fine when I re-draw it, but almost always messes up the first time I draw on it. This has happenned with several different programs, and the help file is no help.</p>
| [
{
"answer_id": 344995,
"author": "Andrew Rollings",
"author_id": 40410,
"author_profile": "https://Stackoverflow.com/users/40410",
"pm_score": 1,
"selected": false,
"text": "DoubleBuffered"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
344,998 | <p>Can we access div tags of user control in Master page? I am trying to change the background color for each one of the div tags on some event.</p>
| [
{
"answer_id": 345193,
"author": "Jared",
"author_id": 3442,
"author_profile": "https://Stackoverflow.com/users/3442",
"pm_score": 1,
"selected": false,
"text": "Control myControl = this.Page.Master.FindControl(\"[Your name here]\");\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/344998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21918/"
] |
345,003 | <p>I know that new-ing something in one module and delete-ing it in another can often cause problems in VC++. Problems with different runtimes. Mixing modules with staticly linked runtimes and/or dynamically linked versioning mismatches both can screw stuff up if I recall correctly.</p>
<p><strong>However, is it safe to use VC++ 2008's std::tr1::shared_ptr across modules?</strong></p>
<p>Since there is only one version of the runtime that even knows what what a shared_ptr is, static linking is my only danger (for now...). I thought I've read that boost's version of a shared_ptr was safe to use like this, but I'm using Redmond's version...</p>
<p>I'm trying to avoid having a special call to free objects in the allocating module. (or something like a "delete this" in the class itself). If this all seems a little hacky, I'm using this for unit testing. If you've ever tried to unit test existing C++ code you can understand how <strong><em>creative</em></strong> you need to be at times. My memory is allocated by an EXE, but ultimately will be freed in a DLL (if the reference counting works the way I think it does).</p>
| [
{
"answer_id": 345079,
"author": "dalle",
"author_id": 19100,
"author_profile": "https://Stackoverflow.com/users/19100",
"pm_score": 2,
"selected": false,
"text": "std"
},
{
"answer_id": 345474,
"author": "Tim Lesher",
"author_id": 14942,
"author_profile": "https://St... | 2008/12/05 | [
"https://Stackoverflow.com/questions/345003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3655/"
] |
345,009 | <p>I'm building a demo app in WPF, which is new to me. I'm currently displaying text in a FlowDocument, and need to print it.</p>
<p>The code I'm using looks like this:</p>
<pre><code> PrintDialog pd = new PrintDialog();
fd.PageHeight = pd.PrintableAreaHeight;
fd.PageWidth = pd.PrintableAreaWidth;
fd.PagePadding = new Thickness(50);
fd.ColumnGap = 0;
fd.ColumnWidth = pd.PrintableAreaWidth;
IDocumentPaginatorSource dps = fd;
pd.PrintDocument(dps.DocumentPaginator, "flow doc");
</code></pre>
<p>fd is my FlowDocument, and for now I'm using the default printer instead of allowing the user to specify print options. It works OK, except that after the document prints, the FlowDocument displayed on screen has changed to to use the settings I specified for printing. </p>
<p>I can fix this by manually resetting everything after I print, but is this the best way? Should I make a copy of the FlowDocument before I print it? Or is there another approach I should consider?</p>
| [
{
"answer_id": 853461,
"author": "Cheeso",
"author_id": 48082,
"author_profile": "https://Stackoverflow.com/users/48082",
"pm_score": 6,
"selected": true,
"text": " private void DoThePrint(System.Windows.Documents.FlowDocument document)\n {\n // Clone the source document's c... | 2008/12/05 | [
"https://Stackoverflow.com/questions/345009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1338/"
] |
345,010 | <p>Does combining an Enterprise Messaging solution with Web Services result in a real performance gain over simple HTTP requests over sockets?</p>
<p>(if implementation details will help, interested in JMS with a SOAP webservice)</p>
| [
{
"answer_id": 853461,
"author": "Cheeso",
"author_id": 48082,
"author_profile": "https://Stackoverflow.com/users/48082",
"pm_score": 6,
"selected": true,
"text": " private void DoThePrint(System.Windows.Documents.FlowDocument document)\n {\n // Clone the source document's c... | 2008/12/05 | [
"https://Stackoverflow.com/questions/345010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2362/"
] |
345,021 | <p>Our organization provides a variety of services to our clients (e.g., web hosting, tech support, custom programming, etc...). There's a page on our website that lists all available services and their corresponding prices. This was static data, but my boss wants it all pulled from a database instead.</p>
<p>There are about 100 services listed. Only two of them, however, have a non numeric value for "price" (specifically, the strings "ISA" and "cost + 8%" - I really don't know what they're supposed to mean, so don't ask me). </p>
<p>I'd hate to make the "price" column a varchar just because of these two listings. My current approach is to create a special "price_display" field, which is either blank or contains the text to display in place of the price. This solution feels too much like a dirty hack though (it would needlessly complicate the queries), so is there a better solution?</p>
| [
{
"answer_id": 1155482,
"author": "HLGEM",
"author_id": 9034,
"author_profile": "https://Stackoverflow.com/users/9034",
"pm_score": 2,
"selected": false,
"text": "Price Unit Display\n10.00 item null\n100.00 box null\nnull null \"Call for Pricing\"\n"
}
] | 2008/12/05 | [
"https://Stackoverflow.com/questions/345021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32998/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.