qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
102,056 | <p>"The Google" is very helpful... unless your language is called "R," in which case it spits out tons of irrelevant stuff.</p>
<p>Anyone have any search engine tricks for "R"? There are some specialized websites, like those below, but how can you tell Google you mean "R" the language? If I'm searching for something specific, I'll use an R-specific term, like "cbind." Are there other such tricks?</p>
<ul>
<li><a href="http://rweb.stat.umn.edu/R/doc/html/search/SearchEngine.html" rel="noreferrer">rweb.stat.umn.edu</a></li>
<li><a href="http://www.rseek.org/" rel="noreferrer">www.rseek.org</a></li>
<li><a href="http://search.r-project.org/" rel="noreferrer">search.r-project.org</a> </li>
<li><a href="http://www.dangoldstein.com/search_r.html" rel="noreferrer">www.dangoldstein.com/search_r.html</a></li>
</ul>
| [
{
"answer_id": 1098043,
"author": "Frank",
"author_id": 60628,
"author_profile": "https://Stackoverflow.com/users/60628",
"pm_score": 0,
"selected": false,
"text": "cran.r-project.org"
},
{
"answer_id": 5745338,
"author": "Andrie",
"author_id": 602276,
"author_profile... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,057 | <p>I've got a Fitnesse RowFixture that returns a list of business objects. The object has a field which is a float representing a percentage between 0 and 1. The <em>consumer</em> of the business object will be a web page or report that comes from a designer, so the formatting of the percentage will be up to the designer rather than the business object. </p>
<p>It would be nicer if the page could emulate the designer when converting the number to a percentage, i.e. instead of displaying 0.5, it should display 50%. But I'd rather not pollute the business object with the display code. Is there a way to specify a format string in the RowFixture?</p>
| [
{
"answer_id": 105997,
"author": "Josh",
"author_id": 11702,
"author_profile": "https://Stackoverflow.com/users/11702",
"pm_score": 3,
"selected": true,
"text": "public class BusinessObject\n{\n public float Percent { get; private set; }\n}\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6902/"
] |
102,058 | <p>The server.xml which controls the startup of Apache Tomcat's servlet container contains a debug attribute for nearly every major component. The debug attribute is more or less verbose depending upon the number you give it, zero being least and 99 being most verbose. How does the debug level affect Tomcat's speed when servicing large numbers of users? I assume zero is fast and 99 is relatively slower, but is this true. If there are no errors being thrown, does it matter?</p>
| [
{
"answer_id": 105997,
"author": "Josh",
"author_id": 11702,
"author_profile": "https://Stackoverflow.com/users/11702",
"pm_score": 3,
"selected": true,
"text": "public class BusinessObject\n{\n public float Percent { get; private set; }\n}\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13930/"
] |
102,059 | <p>With previous versions of flash, entering the full screen mode increased the height and width of the stage to the dimensions of the screen. Now that hardware scaling has arrived, the height and width are set to the dimensions of the video (plus borders if the aspect ratio is different).</p>
<p>That's fine, unless you have controls placed over the video. Before, you could control their size; but now they're blown up by the same scale as the video, and pixellated horribly. Controls are ugly and subtitles are unreadable.</p>
<p>It's possible for the user to turn off hardware scaling, but all that achieves is to turn off anti-aliasing. The controls are still blown up to ugliness.</p>
<p>Is there a way to get the old scaling behaviour back?</p>
| [
{
"answer_id": 106667,
"author": "Brent",
"author_id": 10680,
"author_profile": "https://Stackoverflow.com/users/10680",
"pm_score": -1,
"selected": false,
"text": "stage.align = StageAlign.TOP_LEFT; \nstage.scaleMode = StageScaleMode.NO_SCALE;\nstage.addEventListener(Event.RESIZE, o... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15371/"
] |
102,064 | <p>I've developed a Windows service which tracks business events. It uses the Windows clock to timestamp events. However, the underlying clock can drift quite dramatically (e.g. losing a few seconds per minute), particularly when the CPUs are working hard. Our servers use the Windows Time Service to stay in sync with domain controllers, which uses NTP under the hood, but the sync frequency is controlled by domain policy, and in any case even syncing every minute would still allow significant drift. Are there any techniques we can use to keep the clock more stable, other than using hardware clocks?</p>
| [
{
"answer_id": 102142,
"author": "Nick Craver",
"author_id": 13249,
"author_profile": "https://Stackoverflow.com/users/13249",
"pm_score": 0,
"selected": false,
"text": "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\W32Time\\TimeProviders\\NtpClient\\SpecialPollInterval\n"
}... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16881/"
] |
102,072 | <p>A friend of mine was explaining how they do ping-pong pairing with TDD at his workplace and he said that they take an "adversarial" approach. That is, when the test writing person hands the keyboard over to the implementer, the implementer tries to do the bare simplest (and sometimes wrong thing) to make the test pass.</p>
<p>For example, if they're testing a GetName() method and the test checks for "Sally", the implementation of the GetName method would simply be:</p>
<pre><code>public string GetName(){
return "Sally";
}
</code></pre>
<p>Which would, of course, pass the test (naively).</p>
<p>He explains that this helps eliminate naive tests that check for specific canned values rather than testing the actual behavior or expected state of components. It also helps drive the creation of more tests and ultimately better design and fewer bugs.</p>
<p>It sounded good, but in a short session with him, it seemed like it took a lot longer to get through a single round of tests than otherwise and I didn't feel that a lot of extra value was gained.</p>
<p>Do you use this approach, and if so, have you seen it pay off?</p>
| [
{
"answer_id": 102348,
"author": "James A Wilson",
"author_id": 13892,
"author_profile": "https://Stackoverflow.com/users/13892",
"pm_score": -1,
"selected": true,
"text": "return \"Sally\";"
},
{
"answer_id": 55129930,
"author": "jamie",
"author_id": 337881,
"author_... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10862/"
] |
102,082 | <p>How to add child rows in datagrid c#.net windows forms?</p>
| [
{
"answer_id": 102280,
"author": "NotDan",
"author_id": 3291,
"author_profile": "https://Stackoverflow.com/users/3291",
"pm_score": 0,
"selected": false,
"text": "DataTable myDataTable = new DataTable();\nDataGridView myGridView = new DataGridView();\nmyGridView.DataSource = myDataTable;... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,083 | <p>Preferably free tools if possible.</p>
<p>Also, the option of searching for multiple regular expressions and each replacing with different strings would be a bonus.</p>
| [
{
"answer_id": 102141,
"author": "Alex Fort",
"author_id": 12624,
"author_profile": "https://Stackoverflow.com/users/12624",
"pm_score": 6,
"selected": true,
"text": "perl -pi -e 's/something/somethingelse/g' *.log\n"
},
{
"answer_id": 102155,
"author": "Craig Trader",
"a... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13967/"
] |
102,084 | <p>I have learned quite a bit browsing through <a href="https://stackoverflow.com/questions/9033/hidden-features-of-c">Hidden Features
of C#</a> and was surprised when I couldn't find something
similar for VB.NET.</p>
<p>So what are some of its hidden or lesser known features?</p>
| [
{
"answer_id": 102112,
"author": "Jasha87",
"author_id": 18874,
"author_profile": "https://Stackoverflow.com/users/18874",
"pm_score": 5,
"selected": false,
"text": "With ReallyLongClassName\n .Property1 = Value1\n .Property2 = Value2\n ...\nEnd With\n"
},
{
"answer_id":... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12842/"
] |
102,093 | <p>I wrote a small <code>PHP</code> application several months ago that uses the <code>WordPress XMLRPC library</code> to synchronize two separate WordPress blogs. I have a general "RPCRequest" function that packages the request, sends it, and returns the server response, and I have several more specific functions that customize the type of request that is sent.</p>
<p>In this particular case, I am calling "getPostIDs" to retrieve the number of posts on the remote server and their respective postids. Here is the code:</p>
<pre><code>$rpc = new WordRPC('http://mywordpressurl.com/xmlrpc.php', 'username', 'password');
$rpc->getPostIDs();
</code></pre>
<p>I'm receiving the following error message:</p>
<pre><code>expat reports error code 5
description: Invalid document end
line: 1
column: 1
byte index: 0
total bytes: 0
data beginning 0 before byte index:
</code></pre>
<p>Kind of a cliffhanger ending, which is also strange. But since the error message isn't formatted in XML, my intuition is that it's the local XMLRPC library that is generating the error, not the remote server.</p>
<p>Even stranger, if I change the "getPostIDs()" call to "getPostIDs(1)" or any other integer, it works just fine.</p>
<p>Here is the code for the WordRPC class:</p>
<pre><code>public function __construct($url, $user, $pass) {
$this->url = $url;
$this->username = $user;
$this->password = $pass;
$id = $this->RPCRequest("blogger.getUserInfo",
array("null", $this->username, $this->password));
$this->blogID = $id['userid'];
}
public function RPCRequest($method, $params) {
$request = xmlrpc_encode_request($method, $params);
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml",
'content' => $request
)));
$file = file_get_contents($this->url, false, $context);
return xmlrpc_decode($file);
}
public function getPostIDs($num_posts = 0) {
return $this->RPCRequest("mt.getRecentPostTitles",
array($this->blogID, $this->username,
$this->password, $num_posts));
}
</code></pre>
<p>As I mentioned, it works fine if "getPostIDs" is given a positive integer argument. Furthermore, this used to work perfectly well as is; the default parameter of 0 simply indicates to the RPC server that it should retrieve <em>all</em> posts, not just the most recent <code>$num_posts</code> posts. Only recently has this error started showing up.</p>
<p>I've tried googling the error without much luck. My question, then, is <strong>what exactly does "expat reports error code 5" mean, and who is generating the error?</strong> Any details/suggestions/insights beyond that are welcome, too!</p>
| [
{
"answer_id": 104047,
"author": "Novaktually",
"author_id": 13243,
"author_profile": "https://Stackoverflow.com/users/13243",
"pm_score": 0,
"selected": false,
"text": "XML_ERROR_UNCLOSED_TOKEN"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13604/"
] |
102,102 | <p>It should also support SSH2 and public key auth for starters.
secondly on Mac/Windows it should have a decent installer.</p>
| [
{
"answer_id": 104682,
"author": "Will Robertson",
"author_id": 4161,
"author_profile": "https://Stackoverflow.com/users/4161",
"pm_score": 0,
"selected": false,
"text": "git-gui"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18769/"
] |
102,128 | <p>Sorry, I'm new to SVN and I looked around a little for this. How do you mark a major version in SVN, kind of like set up a restore point. Right now I just setup my server and added all my files- I've been intermittently committing different changes. When I have something in a stable state is there a way to mark this so I can easily revert back to it if necessary?</p>
| [
{
"answer_id": 102149,
"author": "Stephen Deken",
"author_id": 7154,
"author_profile": "https://Stackoverflow.com/users/7154",
"pm_score": 4,
"selected": false,
"text": "svn cp http://svn.example.com/trunk/ http://svn.example.com/tags/major-revision-01/\n"
},
{
"answer_id": 10218... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17614/"
] |
102,171 | <p>I'm looking for a method that computes the line number of a given text position in a JTextPane with wrapping enabled.</p>
<p>Example:</p>
<blockquote>
<p>This a very very very very very very very very very very very very very very very very very very very very very very long line.<br>
This is another very very very very very very very very very very very very very very very very very very very very very very long line.<strong>|</strong></p>
</blockquote>
<p>The cursor is on line number four, not two.</p>
<p>Can someone provide me with the implementation of the method:</p>
<pre><code>int getLineNumber(JTextPane pane, int pos)
{
return ???
}
</code></pre>
| [
{
"answer_id": 102737,
"author": "Richard",
"author_id": 16475,
"author_profile": "https://Stackoverflow.com/users/16475",
"pm_score": 4,
"selected": true,
"text": " /**\n * Return an int containing the wrapped line index at the given position\n * @param component JTextPane\n * @pa... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8330/"
] |
102,185 | <p>MXML lets you do some really quite powerful data binding such as:</p>
<pre><code><mx:Button id="myBtn" label="Buy an {itemName}" visible="{itemName!=null}"/>
</code></pre>
<p>I've found that the BindingUtils class can bind values to simple properties, but neither of the bindings above do this. Is it possible to do the same in AS3 code, or is Flex silently generating many lines of code from my MXML?
Can anyone duplicate the above in pure AS3, starting from:</p>
<pre><code>var myBtn:Button = new Button();
myBtn.id="myBtn";
???
</code></pre>
| [
{
"answer_id": 102924,
"author": "Theo",
"author_id": 1109,
"author_profile": "https://Stackoverflow.com/users/1109",
"pm_score": 2,
"selected": false,
"text": "bindSetter"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102185",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13220/"
] |
102,198 | <p>Is there a way to "align" columns in a data repeater control? </p>
<p>I.E currently it looks like this:</p>
<pre><code>user1 - colA colB colC colD colE
user2 - colD colE
</code></pre>
<p>I want it to look like:</p>
<pre><code> user1
-colA
-colB
-colC
-colD
-colE
user1
-colD
-colE
</code></pre>
<p>I need to columns for each record to align properly when additional
records might not have data for a given column.</p>
<p>The requirements call for a repeater and not a grid control.</p>
<p>Any ideas?</p>
| [
{
"answer_id": 102233,
"author": "Nick Craver",
"author_id": 13249,
"author_profile": "https://Stackoverflow.com/users/13249",
"pm_score": 2,
"selected": false,
"text": "<td colspan='<%# MissingCount(Contatiner.DataItem) %>'>\n"
},
{
"answer_id": 102367,
"author": "Community"... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,213 | <p>I am getting ready to start a new asp.net web project, and I am going to LINQ-to-SQL. I have done a little bit of work getting my data layer setup using some info I found by <a href="http://mikehadlow.blogspot.com/" rel="nofollow noreferrer" title="Mike Hadlow">Mike Hadlow</a> that uses an Interface and generics to create a Repository for each table in the database. I thought this was an interesting approach at first. However, now I think it might make more sense to create a base Repository class and inherit from it to create a TableNameRepository class for the tables I need to access. </p>
<p>Which approach will be allow me to add functionality specific to a Table in a clean testable way? Here is my Repository implementation for reference.</p>
<pre><code>public class Repository<T> : IRepository<T> where T : class, new()
{
protected IDataConnection _dcnf;
public Repository()
{
_dcnf = new DataConnectionFactory() as IDataConnection;
}
// Constructor injection for dependency on DataContext
// to actually connect to a database
public Repository(IDataConnection dc)
{
_dcnf = dc;
}
/// <summary>
/// Return all instances of type T.
/// </summary>
/// <returns>IEnumerable<T></returns>
public virtual IEnumerable<T> GetAll()
{
return GetTable;
}
public virtual T GetById(int id)
{
var itemParam = Expression.Parameter(typeof(T), "item");
var whereExp = Expression.Lambda<Func<T, bool>>
(
Expression.Equal(
Expression.Property(itemParam, PrimaryKeyName),
Expression.Constant(id)
), new ParameterExpression[] { itemParam }
);
return _dcnf.Context.GetTable<T>().Where(whereExp).Single();
}
/// <summary>
/// Return all instances of type T that match the expression exp.
/// </summary>
/// <param name="exp"></param>
/// <returns>IEnumerable<T></returns>
public virtual IEnumerable<T> FindByExp(Func<T, bool> exp)
{
return GetTable.Where<T>(exp);
}
/// <summary>See IRepository.</summary>
/// <param name="exp"></param><returns></returns>
public virtual T Single(Func<T, bool> exp)
{
return GetTable.Single(exp);
}
/// <summary>See IRepository.</summary>
/// <param name="entity"></param>
public virtual void MarkForDeletion(T entity)
{
_dcnf.Context.GetTable<T>().DeleteOnSubmit(entity);
}
/// <summary>
/// Create a new instance of type T.
/// </summary>
/// <returns>T</returns>
public virtual T Create()
{
//T entity = Activator.CreateInstance<T>();
T entity = new T();
GetTable.InsertOnSubmit(entity);
return entity;
}
/// <summary>See IRepository.</summary>
public virtual void SaveAll()
{
_dcnf.SaveAll();
}
#region Properties
private string PrimaryKeyName
{
get { return TableMetadata.RowType.IdentityMembers[0].Name; }
}
private System.Data.Linq.Table<T> GetTable
{
get { return _dcnf.Context.GetTable<T>(); }
}
private System.Data.Linq.Mapping.MetaTable TableMetadata
{
get { return _dcnf.Context.Mapping.GetTable(typeof(T)); }
}
private System.Data.Linq.Mapping.MetaType ClassMetadata
{
get { return _dcnf.Context.Mapping.GetMetaType(typeof(T)); }
}
#endregion
}
</code></pre>
| [
{
"answer_id": 103668,
"author": "Squirrel",
"author_id": 11835,
"author_profile": "https://Stackoverflow.com/users/11835",
"pm_score": 2,
"selected": true,
"text": "public class Home {\n public static IRepository<T> For<T> {\n get {\n return Container.Resolve<IRepository<T>>();... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203/"
] |
102,215 | <p>What is the best way to add "Expires" in http header for static content? eg. images, css, js</p>
<p>The web server is IIS 6.0; the language is classical ASP</p>
| [
{
"answer_id": 102302,
"author": "Aaron",
"author_id": 7659,
"author_profile": "https://Stackoverflow.com/users/7659",
"pm_score": -1,
"selected": false,
"text": "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-store\">\n<META HTTP-EQUIV... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100/"
] |
102,240 | <p>I'd like to add a drop-down list to a Windows application. It will have two choices, neither of which are editable. What's the best control to use? Is it a combo box with the editing property set to No?</p>
<p>I'm using Visual Studio 2008.</p>
| [
{
"answer_id": 102266,
"author": "JP Richardson",
"author_id": 10333,
"author_profile": "https://Stackoverflow.com/users/10333",
"pm_score": 2,
"selected": false,
"text": "yourComboBox.DropDownStyle = ComboBoxStyle.DropDownList"
},
{
"answer_id": 23814141,
"author": "Scroude"... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18891/"
] |
102,261 | <p>First off, I'm working on an app that's written such that some of your typical debugging tools can't be used (or at least I can't figure out how :). </p>
<p>JavaScript, html, etc are all "cooked" and encoded (I think; I'm a little fuzzy on how the process works) before being deployed, so I can't attach VS 2005 to ie, and firebug lite doesn't work well. Also, the interface is in frames (yuck), so some other tools don't work as well.</p>
<p>Firebug works great in Firefox, which isn't having this problem (nor is Safari), so I'm hoping someone might spot something "obviously" wrong with the way my code will play with IE. There's more information that can be given about its quirkiness, but let's start with this.</p>
<p>Basically, I have a function that "collapses" tables into their headers by making normal table rows not visible. I have <code>"onclick='toggleDisplay("theTableElement", "theCollapseImageElement")'"</code> in the <code><tr></code> tags, and tables start off with "class='closed'". </p>
<p>Single clicks collapse and expand tables in FF & Safari, but IE tables require multiple clicks (a seemingly arbitrary number between 1 and 5) to expand. Sometimes after initially getting "opened", the tables will expand and collapse with a single click for a little while, only to eventually revert to requiring multiple clicks. I can tell from what little I can see in Visual Studio that the function is actually being reached each time. Thanks in advance for any advice!</p>
<p>Here's the JS code:</p>
<pre><code>bURL_RM_RID="some image prefix";
CLOSED_TBL="closed";
OPEN_TBL="open";
CLOSED_IMG= bURL_RM_RID+'166';
OPENED_IMG= bURL_RM_RID+'167';
//collapses/expands tbl (a table) and swaps out the image tblimg
function toggleDisplay(tbl, tblimg) {
var rowVisible;
var tblclass = tbl.getAttribute("class");
var tblRows = tbl.rows;
var img = tblimg;
//Are we expanding or collapsing the table?
if (tblclass == CLOSED_TBL) rowVisible = false;
else rowVisible = true;
for (i = 0; i < tblRows.length; i++) {
if (tblRows[i].className != "headerRow") {
tblRows[i].style.display = (rowVisible) ? "none" : "";
}
}
//set the collapse images to the correct state and swap the class name
rowVisible = !rowVisible;
if (rowVisible) {
img.setAttribute("src", CLOSED_IMG);
tbl.setAttribute("class",OPEN_TBL);
}
else {
img.setAttribute("src", OPENED_IMG);
tbl.setAttribute("class",CLOSED_TBL);
}
}
</code></pre>
<p></p>
| [
{
"answer_id": 102295,
"author": "Chris Marasti-Georg",
"author_id": 96,
"author_profile": "https://Stackoverflow.com/users/96",
"pm_score": 2,
"selected": false,
"text": "tblRows[i].style.display = (rowVisible) ? \"none\" : \"\";\n"
},
{
"answer_id": 102335,
"author": "Lark"... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18860/"
] |
102,271 | <p>More information from <a href="http://en.wikipedia.org/wiki/Perl_6#Junctions" rel="noreferrer">the Perl 6 Wikipedia entry</a></p>
<p><strong>Junctions</strong></p>
<p>Perl 6 introduces the concept of junctions: values that are composites of other values.[24] In the earliest days of Perl 6's design, these were called "superpositions", by analogy to the concept in quantum physics of quantum superpositions — waveforms that can simultaneously occupy several states until observation "collapses" them. A Perl 5 module released in 2000 by Damian Conway called Quantum::Superpositions[25] provided an initial proof of concept. While at first, such superpositional values seemed like merely a programmatic curiosity, over time their utility and intuitiveness became widely recognized, and junctions now occupy a central place in Perl 6's design.</p>
<p>In their simplest form, junctions are created by combining a set of values with junctive operators:</p>
<pre><code>my $any_even_digit = 0|2|4|6|8; # any(0, 2, 4, 6, 8)
my $all_odd_digits = 1&3&5&7&9; # all(1, 3, 5, 7, 9)
</code></pre>
<p>| indicates a value which is equal to either its left or right-hand arguments. & indicates a value which is equal to both its left and right-hand arguments. These values can be used in any code that would use a normal value. Operations performed on a junction act on all members of the junction equally, and combine according to the junctive operator. So, ("apple"|"banana") ~ "s" would yield "apples"|"bananas". In comparisons, junctions return a single true or false result for the comparison. "any" junctions return true if the comparison is true for any one of the elements of the junction. "all" junctions return true if the comparison is true for all of the elements of the junction.</p>
<p>Junctions can also be used to more richly augment the type system by introducing a style of generic programming that is constrained to junctions of types:</p>
<pre><code>sub get_tint ( RGB_Color|CMYK_Color $color, num $opacity) { ... }
sub store_record (Record&Storable $rec) { ... }
</code></pre>
| [
{
"answer_id": 117746,
"author": "Brad Gilbert",
"author_id": 1337,
"author_profile": "https://Stackoverflow.com/users/1337",
"pm_score": 5,
"selected": true,
"text": "given( $month ){\n when any(qw'1 3 5 7 8 10 12') {\n $day = 31\n }\n when any(qw'4 6 9 11') {\n $day = 30\n }\... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102271",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18446/"
] |
102,278 | <p>OK, so practically every database based application has to deal with "non-active" records. Either, soft-deletions or marking something as "to be ignored". I'm curious as to whether there are any radical alternatives thoughts on an `active' column (or a status column).</p>
<p>For example, if I had a list of people</p>
<pre><code>CREATE TABLE people (
id INTEGER PRIMARY KEY,
name VARCHAR(100),
active BOOLEAN,
...
);
</code></pre>
<p>That means to get a list of active people, you need to use</p>
<pre><code>SELECT * FROM people WHERE active=True;
</code></pre>
<p>Does anyone suggest that non active records would be moved off to a separate table and where appropiate a UNION is done to join the two?</p>
<p>Curiosity striking...</p>
<p><strong>EDIT:</strong> I should make clear, I'm coming at this from a purist perspective. I can see how data archiving might be necessary for large amounts of data, but that is not where I'm coming from. If you do a SELECT * FROM people it would make sense to me that those entries are in a sense "active"</p>
<p>Thanks</p>
| [
{
"answer_id": 102333,
"author": "Mike McAllister",
"author_id": 16247,
"author_profile": "https://Stackoverflow.com/users/16247",
"pm_score": 6,
"selected": true,
"text": "CREATE TABLE people\n(\n id NUMBER(10),\n name VARCHAR2(100),\n active NUMBER(1)\n)\nPARTITION BY... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1087/"
] |
102,317 | <p>I have two tables Organisation and Employee having one to many relation i.e one organisation can have multiple employees. Now I want to select all information of a particular organisation plus first name of all employees for this organisation. What’s the best way to do it? Can I get all of this in single record set or I will have to get multiple rows based on no. of employees? Here is a bit graphical demonstration of what I want:</p>
<pre><code>Org_ID Org_Address Org_OtherDetails Employess
1 132A B Road List of details Emp1, Emp2, Emp3.....
</code></pre>
| [
{
"answer_id": 102361,
"author": "Mike McAllister",
"author_id": 16247,
"author_profile": "https://Stackoverflow.com/users/16247",
"pm_score": 0,
"selected": false,
"text": "select\n o.org_id,\n o.org_address,\n o.org_otherdetails,\n org_employees( o.org_id ) as org_employees\nfr... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,325 | <p>Since Java 6 there is a class <code>java.awt.Desktop</code>. There are some nice methods but the class is not supported on all platforms. The methods <a href="http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#getDesktop()" rel="nofollow noreferrer"><code>java.awt.Desktop.getDesktop()</code></a> throws an </p>
<blockquote>
<p>java.lang.UnsupportedOperationException: Desktop API is not supported
on the current platform</p>
</blockquote>
<p>on some platforms. Or the method <a href="http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#isDesktopSupported()" rel="nofollow noreferrer"><code>java.awt.Desktop.isDesktopSupported()</code></a> return false.</p>
<p>I know that it work on Windows XP, Windows 2003 and also Windows Vista. The question is on which platform is it not supported?</p>
| [
{
"answer_id": 19537699,
"author": "Kishan Bheemajiyani",
"author_id": 2762311,
"author_profile": "https://Stackoverflow.com/users/2762311",
"pm_score": 2,
"selected": false,
"text": "java.lang.UnsupportedOperationException: The system tray is not supported on the current platform.\n"
... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12631/"
] |
102,343 | <p>I have a need to open a popup detail window from a gridview (VS 2005 / 2008). What I am trying to do is in the markup for my TemplateColumn have an asp:Button control, sort of like this:</p>
<pre><code><asp:Button ID="btnShowDetails" runat="server" CausesValidation="false"
CommandName="Details" Text="Order Details"
onClientClick="window.open('PubsOrderDetails.aspx?OrderId=<%# Eval("order_id") %>',
'','scrollbars=yes,resizable=yes, width=350, height=550');"
</code></pre>
<p>Of course, what isn't working is the appending of the <%# Eval...%> section to set the query string variable.</p>
<p>Any suggestions? Or is there a far better way of achieving the same result?</p>
| [
{
"answer_id": 102373,
"author": "Tom Ritter",
"author_id": 8435,
"author_profile": "https://Stackoverflow.com/users/8435",
"pm_score": 5,
"selected": true,
"text": "onClientClick=<%# string.Format(\"window.open('PubsOrderDetails.aspx?OrderId={0}',scrollbars=yes,resizable=yes, width=350,... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12253/"
] |
102,382 | <p>I use ssh-agent with password-protected keys on Linux. Every time I log into a certain machine, I do this:</p>
<pre><code>eval `ssh-agent` && ssh-add
</code></pre>
<p>This works well enough, but every time I log in and do this, I create another ssh-agent. Once in a while, I will do a <code>killall ssh-agent</code> to reap them. Is there a simple way to reuse the same ssh-agent process across different sessions?</p>
| [
{
"answer_id": 102420,
"author": "Blair Conrad",
"author_id": 1199,
"author_profile": "https://Stackoverflow.com/users/1199",
"pm_score": 2,
"selected": false,
"text": "SSH_ENV=\"$HOME/.ssh/environment\"\n\nfunction start_agent {\n echo \"Initialising new SSH agent...\"\n /usr/bi... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742/"
] |
102,384 | <p>I have looked at the ability to use tabs in Vim (with <code>:tabe</code>, <code>:tabnew</code>, etc.) as a replacement for my current practice of having many files open in the same window in hidden buffers.</p>
<p>I would like every distinct file that I have open to always be in its own tab. However, there are some things that get in the way of this. How do I fix these:</p>
<ol>
<li><p>When commands like <code>gf</code> and <code>^]</code> jump to a location in another file, the file opens in a new buffer in the current tab. Is there a way to have all of these sorts of commands open the file in a new tab, or switch to the existing tab with the file if it is already open?</p></li>
<li><p>When switching buffers I can use
<code>:b <part of filename><tab></code>
and it will complete the names of files in existing buffers. <code><part of filename></code> can even be the middle of a filename instead of the beginning. Is there an equivalent for switching tabs?</p></li>
</ol>
| [
{
"answer_id": 102486,
"author": "Lucas Oman",
"author_id": 6726,
"author_profile": "https://Stackoverflow.com/users/6726",
"pm_score": 2,
"selected": false,
"text": "map gf :tabe <cfile><CR>\n"
},
{
"answer_id": 103590,
"author": "Zathrus",
"author_id": 16220,
"autho... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7706/"
] |
102,394 | <p>I am trying to sort a dict based on its key and return an iterator to the values from within an overridden iter method in a class. Is there a nicer and more efficient way of doing this than creating a new list, inserting into the list as I sort through the keys?</p>
| [
{
"answer_id": 102438,
"author": "Thomas Wouters",
"author_id": 17624,
"author_profile": "https://Stackoverflow.com/users/17624",
"pm_score": 2,
"selected": false,
"text": "def sorted_dict(d):\n keys = d.keys()\n keys.sort()\n for key in keys:\n yield d[key]\n"
},
{
... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102394",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18909/"
] |
102,398 | <p>I am looking for a .NET implementation of a priority queue or heap data structure</p>
<blockquote>
<p>Priority queues are data structures that provide more flexibility than simple sorting, because they allow new elements to enter a system at arbitrary intervals. It is much more cost-effective to insert a new job into a priority queue than to re-sort everything on each such arrival.</p>
<p>The basic priority queue supports three primary operations:</p>
<ul>
<li>Insert(Q,x). Given an item x with key k, insert it into the priority queue Q.</li>
<li>Find-Minimum(Q). Return a pointer to the item
whose key value is smaller than any other key in the priority queue
Q.</li>
<li>Delete-Minimum(Q). Remove the item from the priority queue Q whose key is minimum</li>
</ul>
</blockquote>
<p>Unless I am looking in the wrong place, there isn't one in the framework. Is anyone aware of a good one, or should I roll my own?</p>
| [
{
"answer_id": 102434,
"author": "Ben Hoffstein",
"author_id": 4482,
"author_profile": "https://Stackoverflow.com/users/4482",
"pm_score": 7,
"selected": true,
"text": "OrderedBag"
},
{
"answer_id": 1114323,
"author": "functor",
"author_id": 77609,
"author_profile": "... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11173/"
] |
102,425 | <p>I have a properties file in java, in which I store all information of my app, like logo image filename, database name, database user and database password.</p>
<p>I can store the password encrypted on the properties file. But, the key or passphrase can be read out of the jar using a decompiler.</p>
<p>Is there a way to store the db pass in a properties file securely?</p>
| [
{
"answer_id": 102827,
"author": "jjnguy",
"author_id": 2598,
"author_profile": "https://Stackoverflow.com/users/2598",
"pm_score": 2,
"selected": false,
"text": "getBytes()"
},
{
"answer_id": 102920,
"author": "David Webb",
"author_id": 3171,
"author_profile": "https... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13116/"
] |
102,427 | <p>I'm working on a .Net applications with multiple threads doing all sorts of things.
When something goes wrong in production I want to be able to see which threads are running (by their managed name) and also be able to pause / kill them.</p>
<p>Anyway to achieve this ?</p>
<p>VS isn't always available (although a good option when is), and WinDbg UI isn't for the lite hearted.</p>
<p>I considered a in-program threads window, like VS has while debugging, but couldn't find a programmatic way to do this. Process.GetThreads returns very little usable data.</p>
| [
{
"answer_id": 1569519,
"author": "rosenfield",
"author_id": 184897,
"author_profile": "https://Stackoverflow.com/users/184897",
"pm_score": 2,
"selected": false,
"text": "using System.Diagnostics;\n\nProcessThreadCollection threads = Process.GetCurrentProcess().Threads;\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18910/"
] |
102,453 | <p>I got pretty big webflow definition, which I do not want to copy/paste for reusing. There are references to action bean in XML, which is kind natural.</p>
<p>I want to use same flow definiton twice: second time with actions configured differently (inject different implementation of service to it). </p>
<p>Is there easy way to do this?</p>
<hr>
<p>Problem is I want to use same flow with different beans at once, in the same app. Copy/Paste is bad, but I dont see other solution for now.</p>
| [
{
"answer_id": 4057210,
"author": "bobtins",
"author_id": 338552,
"author_profile": "https://Stackoverflow.com/users/338552",
"pm_score": 1,
"selected": false,
"text": "<action-state id=\"checkForParams\">\n <on-entry>\n <set name=\"flowScope.clientKey\" value=\"requestParamete... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,457 | <p>Given an existing valid SVG document, what's the best way to create "informational popups", so that when you hover or click on certain elements (let's say ) you popup a box with an arbitrary amount (i.e. not just a single line tooltip) of extra information?</p>
<p>This should display correctly at least in Firefox and be invisible if the image was rasterized to a bitmap format.</p>
| [
{
"answer_id": 105636,
"author": "Sparr",
"author_id": 13675,
"author_profile": "https://Stackoverflow.com/users/13675",
"pm_score": 6,
"selected": true,
"text": "<svg>\n <text id=\"thingyouhoverover\" x=\"50\" y=\"35\" font-size=\"14\">Mouse over me!</text>\n <text id=\"thepopup\" x=\... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2846/"
] |
102,464 | <p>Is their a way to access a web server such as windows server 2003 installed on a virtual box such as vmware from the host machine?</p>
| [
{
"answer_id": 59373777,
"author": "slowlert",
"author_id": 7071915,
"author_profile": "https://Stackoverflow.com/users/7071915",
"pm_score": 0,
"selected": false,
"text": "192.168.0.37 some.url-you.need\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18159/"
] |
102,466 | <p>We create thumb images on our server and I'm looking for a way to save metadata (text) in that image. Is that possible?</p>
<p>At this moment we use <code>PHP</code> and we create <code>JPG</code> images.</p>
| [
{
"answer_id": 17890619,
"author": "Matías Cánepa",
"author_id": 702353,
"author_profile": "https://Stackoverflow.com/users/702353",
"pm_score": 2,
"selected": false,
"text": "<?\ndefine(\"IPTC_OBJECT_NAME\", \"005\");\ndefine(\"IPTC_EDIT_STATUS\", \"007\");\ndefine(\"IPTC_PRIORITY\", \"... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,468 | <p>I'm trying to write a piece of code that will do the following:</p>
<p>Take the numbers 0 to 9 and assign one or more letters to this number. For example:</p>
<pre><code>0 = N,
1 = L,
2 = T,
3 = D,
4 = R,
5 = V or F,
6 = B or P,
7 = Z,
8 = H or CH or J,
9 = G
</code></pre>
<p>When I have a code like 0123, it's an easy job to encode it. It will obviously make up the code NLTD. When a number like 5,6 or 8 is introduced, things get different. A number like 051 would result in more than one possibility:</p>
<p>NVL and NFL</p>
<p>It should be obvious that this gets even "worse" with longer numbers that include several digits like 5,6 or 8.</p>
<p>Being pretty bad at mathematics, I have not yet been able to come up with a decent solution that will allow me to feed the program a bunch of numbers and have it spit out all the possible letter combinations. So I'd love some help with it, 'cause I can't seem to figure it out. Dug up some information about permutations and combinations, but no luck.</p>
<p>Thanks for any suggestions/clues. The language I need to write the code in is PHP, but any general hints would be highly appreciated.</p>
<h3>Update:</h3>
<p>Some more background: (and thanks a lot for the quick responses!)</p>
<p>The idea behind my question is to build a script that will help people to easily convert numbers they want to remember to words that are far more easily remembered. This is sometimes referred to as "pseudo-numerology".</p>
<p>I want the script to give me all the possible combinations that are then held against a database of stripped words. These stripped words just come from a dictionary and have all the letters I mentioned in my question stripped out of them. That way, the number to be encoded can usually easily be related to a one or more database records. And when that happens, you end up with a list of words that you can use to remember the number you wanted to remember.</p>
| [
{
"answer_id": 102664,
"author": "jdmichal",
"author_id": 12275,
"author_profile": "https://Stackoverflow.com/users/12275",
"pm_score": 0,
"selected": false,
"text": "pn"
},
{
"answer_id": 102676,
"author": "Matthew Scharley",
"author_id": 15537,
"author_profile": "ht... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18922/"
] |
102,472 | <p>When a branch is reintegrated to the trunk, is that branch effectively dead? </p>
<p>Can you make modifications to the branch after the reintegration and merge those back into the trunk at a later date?</p>
| [
{
"answer_id": 113925,
"author": "Mauli",
"author_id": 917,
"author_profile": "https://Stackoverflow.com/users/917",
"pm_score": 2,
"selected": false,
"text": "/your_project\n /trunk\n /branches\n /tags\n"
},
{
"answer_id": 2330325,
"author": "JW.",
"author_id": 4321,
... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12969/"
] |
102,483 | <p>I am adding some user controls dynamically to a PlaceHolder server control. My user control consists of some labels and some textbox controls. </p>
<p>When I submit the form and try to view the contents of the textboxes (within each user control) on the server, they are empty.</p>
<p>When the postback completes, the textboxes have the data that I entered prior to postback. This tells me that the text in the boxes are being retained through ViewState. I just don't know why I can't find them when I'm debugging. </p>
<p>Can someone please tell me why I would not be seeing the data the user entered on the server?</p>
<p>Thanks for any help.</p>
| [
{
"answer_id": 102619,
"author": "Chris Porter",
"author_id": 13495,
"author_profile": "https://Stackoverflow.com/users/13495",
"pm_score": 1,
"selected": false,
"text": "Private dynControl As ASP.MyNamespace_MyControl_ascx\n"
},
{
"answer_id": 1137518,
"author": "Middletone"... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10589/"
] |
102,496 | <p>We're developing a service that will accept a <code>POST</code> request. Some of the <code>POST</code> data will need to be encrypted before the <code>POST</code> as it will be stored in hidden fields on a form.</p>
<p>The application is written in C#, but we want third party clients to be able to easily integrate with it. We find that most clients use PHP, Classic ASP or VB.Net.</p>
<p>The third parties should only be doing the encryption. We'd do the decryption. There is no two-way communication.</p>
<p>What are the most compatible combinations of encryption algorithm, padding mode and other options?</p>
| [
{
"answer_id": 108664,
"author": "Ian P",
"author_id": 10853,
"author_profile": "https://Stackoverflow.com/users/10853",
"pm_score": 1,
"selected": false,
"text": "function XOREncryption($InputString, $KeyPhrase){\n\n $KeyPhraseLength = strlen($KeyPhrase);\n\n for ($i = 0; $i < str... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11503/"
] |
102,521 | <p>I know that <a href="http://wiki.lessthandot.com/index.php/How_to_find_the_first_and_last_days_in_years,_months_etc" rel="nofollow noreferrer">Sql Server has some handy built-in quarterly</a> stuff, but what about the .Net native <a href="http://msdn.microsoft.com/en-us/library/system.datetime_members(VS.80).aspx" rel="nofollow noreferrer">DateTime</a> object? What is the best way to add, subtract, and traverse quarters?</p>
<p>Is it a <em>bad thing</em>™ to use the VB-specific <a href="http://msdn.microsoft.com/en-us/library/hcxe65wz(VS.80).aspx" rel="nofollow noreferrer">DateAdd()</a> function? e.g.:</p>
<pre><code>Dim nextQuarter As DateTime = DateAdd(DateInterval.Quarter, 1, DateTime.Now)
</code></pre>
<p>Edit:
Expanding @bslorence's function:</p>
<pre><code>Public Shared Function AddQuarters(ByVal originalDate As DateTime, ByVal quarters As Integer) As Datetime
Return originalDate.AddMonths(quarters * 3)
End Function
</code></pre>
<p>Expanding @Matt's function:</p>
<pre><code>Public Shared Function GetQuarter(ByVal fromDate As DateTime) As Integer
Return ((fromDate.Month - 1) \ 3) + 1
End Function
</code></pre>
<p>Edit: here's a couple more functions that were handy:</p>
<pre><code>Public Shared Function GetFirstDayOfQuarter(ByVal originalDate As DateTime) As DateTime
Return AddQuarters(New DateTime(originalDate.Year, 1, 1), GetQuarter(originalDate) - 1)
End Function
Public Shared Function GetLastDayOfQuarter(ByVal originalDate As DateTime) As DateTime
Return AddQuarters(New DateTime(originalDate.Year, 1, 1), GetQuarter(originalDate)).AddDays(-1)
End Function
</code></pre>
| [
{
"answer_id": 102712,
"author": "Ben Dunlap",
"author_id": 8722,
"author_profile": "https://Stackoverflow.com/users/8722",
"pm_score": 2,
"selected": false,
"text": "Dim nextQuarter As DateTime = DateTime.Now.AddMonths(3);\n"
},
{
"answer_id": 102834,
"author": "Matt Blaine"... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1414/"
] |
102,523 | <p>I am a big fan of the light colors on a dark background color scheme for programming - which is unfortunately not what Quest's Toad comes with by default. </p>
<p>I notice that it is possible to export and import settings under the language management window, and I know that Toad has a large level of community involvement. So I assume there must be some location where people are posting their custom coloring schemes. However, in part because I don't know what the Toad guys call them (skins? colorization? themes?) and in part because its so hard to Google Toad +skins I cannot for the life of me find them.</p>
<p>Does anyone know if there is such a place so I don't have to set the colors by hand?</p>
| [
{
"answer_id": 8763905,
"author": "one.beat.consumer",
"author_id": 146610,
"author_profile": "https://Stackoverflow.com/users/146610",
"pm_score": 4,
"selected": true,
"text": ".dvtcolortheme"
},
{
"answer_id": 54554825,
"author": "ylondono",
"author_id": 4143968,
"a... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5056/"
] |
102,531 | <p>Within an XSLT document, is it possible to loop over a set of files in the current directory?</p>
<p>I have a situation where I have a directory full of xml files that need some analysis done to generate a report. I have my stylesheet operating on a single document fine, but I'd like to extend that without going to another tool to merge the xml documents. </p>
<p>I was thinking along these lines:</p>
<pre><code><xsl:for-each select="{IO Selector Here}">
<xsl:variable select="document(@url)" name="contents" />
<!--More stuff here-->
</xsl:for-each>
</code></pre>
| [
{
"answer_id": 102944,
"author": "Dave DuPlantis",
"author_id": 8174,
"author_profile": "https://Stackoverflow.com/users/8174",
"pm_score": 0,
"selected": false,
"text": "document()"
},
{
"answer_id": 104760,
"author": "JeniT",
"author_id": 6739,
"author_profile": "ht... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1672/"
] |
102,534 | <p>Here is the situation: I have 2 pages.</p>
<p>What I want is to have a number of text links(<code><a href=""></code>) on page 1 all directing to page 2, but I want each link to send a different value.</p>
<p>On page 2 I want to show that value like this: </p>
<blockquote>
<p>Hello you clicked {value}</p>
</blockquote>
<p>Another point to take into account is that I can't use any php in this situation, just html.</p>
| [
{
"answer_id": 102565,
"author": "Craig",
"author_id": 7861,
"author_profile": "https://Stackoverflow.com/users/7861",
"pm_score": 2,
"selected": false,
"text": "var qs = new Querystring();\nvar v1 = qs.get(\"ValueName\")\n"
},
{
"answer_id": 102577,
"author": "Stephen Wright... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,535 | <p>I'm starting to learn Python and I've come across generator functions, those that have a yield statement in them. I want to know what types of problems that these functions are really good at solving.</p>
| [
{
"answer_id": 102632,
"author": "Thomas Wouters",
"author_id": 17624,
"author_profile": "https://Stackoverflow.com/users/17624",
"pm_score": 9,
"selected": true,
"text": "big_list = list(the_generator)\n"
},
{
"answer_id": 102634,
"author": "nosklo",
"author_id": 17160,
... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4834/"
] |
102,547 | <p>I am trying to add a new hello world service to amfphp, I am developing locally</p>
<pre><code><?php
/**
* First tutorial class
*/
class HelloWorld {
/**
* first simple method
* @returns a string saying 'Hello World!'
*/
function sayHello()
{
return "Hello World!";
}
}
?>
</code></pre>
<p>when exploring in the amfphp browser i get a
"TypeError: Error #1009: Cannot access a property or method of a null object reference."
need help...</p>
| [
{
"answer_id": 104232,
"author": "defmeta",
"author_id": 10875,
"author_profile": "https://Stackoverflow.com/users/10875",
"pm_score": 1,
"selected": false,
"text": "<?php\n\nclass Products {\n\n public function __construct() {\n mysql_connect(\"localhost\", \"myuser\", \"mypas... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,558 | <p>What are some of the advantages of using one over the other?</p>
| [
{
"answer_id": 2535340,
"author": "En.",
"author_id": 298793,
"author_profile": "https://Stackoverflow.com/users/298793",
"pm_score": 1,
"selected": false,
"text": "bool IMyView.IsAdminSectionVisible{\n get{return pnlAdmin.Visible;}\n get{pnlAdmin.Visible=value;}\n }\n"
... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18931/"
] |
102,567 | <p>What's the best way to shut down the computer from a C# program?</p>
<p>I've found a few methods that work - I'll post them below - but none of them are very elegant. I'm looking for something that's simpler and natively .net.</p>
| [
{
"answer_id": 102580,
"author": "RichS",
"author_id": 6247,
"author_profile": "https://Stackoverflow.com/users/6247",
"pm_score": 3,
"selected": false,
"text": "shutdown -s -t 0"
},
{
"answer_id": 102583,
"author": "roomaroo",
"author_id": 3464,
"author_profile": "ht... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3464/"
] |
102,568 | <p>I'm trying to understand someone else's Perl code without knowing much Perl myself. I would appreciate your help.</p>
<p>I've encountered a Perl function along these lines:</p>
<pre><code>MyFunction($arg1,$arg2__size,$arg3)
</code></pre>
<p>Is there a meaning to the double-underscore syntax in <code>$arg2</code>, or is it just part of the name of the second argument?</p>
| [
{
"answer_id": 103936,
"author": "Drew Stephens",
"author_id": 17339,
"author_profile": "https://Stackoverflow.com/users/17339",
"pm_score": 2,
"selected": false,
"text": "__FILE__"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10261/"
] |
102,587 | <p>I'm working on a drop in assembly that has predefined pages and usable controls. I am having no difficulties with creating server controls, but I'm wondering what the "best practices" are with dealing with pages in an assembly. Can you compile a page into an assembly and release it as just a dll? How would this be accessed from the client browser's perspective as far as the address they would type or be directed to with a link? As an example, I have a simple login page with the standard username and password text boxes, and the log in button and a "remember me" checkbox, with a "I can't remember my username and/or password" hyperlink. Can I access that page as like a webresource? such as "<a href="http://www.site.name/webresource.axd?related_resource_id_codes" rel="nofollow noreferrer">http://www.site.name/webresource.axd?related_resource_id_codes</a>"</p>
| [
{
"answer_id": 102709,
"author": "Mark Brackett",
"author_id": 2199,
"author_profile": "https://Stackoverflow.com/users/2199",
"pm_score": 1,
"selected": false,
"text": "<httpHandlers>\n <add verb=\"*\" path=\"login.aspx\" type=\"MyPages.LoginPage, MyPages\" />\n</httpHandlers>\n"
}
... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18893/"
] |
102,591 | <p>In my database (SQL 2005) I have a field which holds a comment but in the comment I have an id and I would like to strip out just the id, and IF possible convert it to an int:</p>
<p><code>activation successful of id 1010101</code></p>
<p>The line above is the exact structure of the data in the db field.</p>
<p>And no I don't want to do this in the code of the application, I actually don't want to touch it, just in case you were wondering ;-)</p>
| [
{
"answer_id": 102687,
"author": "Cervo",
"author_id": 16219,
"author_profile": "https://Stackoverflow.com/users/16219",
"pm_score": 0,
"selected": false,
"text": "-- Test table, you will probably use some query \nDECLARE @testTable TABLE(comment VARCHAR(255)) \nINSERT INTO @testTable(... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1841427/"
] |
102,605 | <p>I would like to use client-side Javascript to perform a DNS lookup (hostname to IP address) as seen from the client's computer. Is that possible?</p>
| [
{
"answer_id": 102662,
"author": "Alex Fort",
"author_id": 12624,
"author_profile": "https://Stackoverflow.com/users/12624",
"pm_score": -1,
"selected": false,
"text": "ipAddress = java.net.InetAddress.getLocalHost().getHostAddress();\n"
},
{
"answer_id": 102681,
"author": "Z... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102605",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13172/"
] |
102,606 | <p>Below is part of the XML which I am processing with <a href="http://php.net/XSLTProcessor" rel="nofollow noreferrer">PHP's XSLTProcessor</a>:</p>
<pre><code><result>
<uf x="20" y="0"/>
<uf x="22" y="22"/>
<uf x="4" y="3"/>
<uf x="15" y="15"/>
</result>
</code></pre>
<p>I need to know how many "uf" nodes exist where x == y.</p>
<p>In the above example, that would be 2.</p>
<p>I've tried looping and incrementing a counter variable, but I can't redefine variables.</p>
<p>I've tried lots of combinations of xsl:number, with count/from, but couldn't get the XPath expression right.</p>
<p>Thanks!</p>
| [
{
"answer_id": 102707,
"author": "Oliver Mellet",
"author_id": 12001,
"author_profile": "https://Stackoverflow.com/users/12001",
"pm_score": 1,
"selected": false,
"text": "count('/result/uf[@x = @y]')\n"
},
{
"answer_id": 102708,
"author": "Mike Tunnicliffe",
"author_id":... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14645/"
] |
102,614 | <p>I am looking for a way to have some control over the shape of a simple MessageBox in Winforms. I would like to control where the passed in text wraps so that the dialog rect is narrower. Windows seems to want to make the dialog as wide as possible before wrapping the text. Is there an easy way to control the maximum width of the dialog without resorting to creating my own custom form?</p>
| [
{
"answer_id": 102622,
"author": "Ferruccio",
"author_id": 4086,
"author_profile": "https://Stackoverflow.com/users/4086",
"pm_score": 3,
"selected": true,
"text": "\"message text...\\nmore text...\"\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12281/"
] |
102,626 | <p>I get this error when I do a <strong>bulk insert</strong> with <code>select * from [table_name]</code>, and another table name:</p>
<pre><code>the locale id '0' of the source column 'PAT_NUM_ADT' and the locale id '1033'
of the destination column 'PAT_ID_OLD' do not match
</code></pre>
<p>I tried resetting my db collation but this did not help. </p>
<p>Has anyone seen this error?</p>
| [
{
"answer_id": 8257390,
"author": "Deepak Dwivedi",
"author_id": 1063944,
"author_profile": "https://Stackoverflow.com/users/1063944",
"pm_score": 3,
"selected": false,
"text": "SqlConnectionStringBuilder cb = new SqlConnectionStringBuilder(\"Data Source=ServerName;User Id=userid;Passwor... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,631 | <p>I have had thoughts of trying to write a simple crawler that might crawl and produce a list of its findings for our NPO's websites and content.</p>
<p>Does anybody have any thoughts on how to do this? Where do you point the crawler to get started? How does it send back its findings and still keep crawling? How does it know what it finds, etc,etc.</p>
| [
{
"answer_id": 102820,
"author": "slim",
"author_id": 7512,
"author_profile": "https://Stackoverflow.com/users/7512",
"pm_score": 7,
"selected": false,
"text": "while(list of unvisited URLs is not empty) {\n take URL from list\n remove it from the unvisited list and add it to the v... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
102,640 | <p>So essentially does margin collapsing occur when you don't set any margin or padding or border to a given div element?</p>
| [
{
"answer_id": 102755,
"author": "Jim",
"author_id": 8427,
"author_profile": "https://Stackoverflow.com/users/8427",
"pm_score": 7,
"selected": true,
"text": "<div>"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1368/"
] |
102,683 | <p>I have a legacy app I am currently supporting that is having problems when people copy large quantities of data from a datasheet view. </p>
<p>The App is built in MS Access and the amount of rows being copied can get pretty large (sometimes in the thousands). </p>
<p>The funny thing about it is, you can paste the data out, but then Access keeps "rendering" the data into different formats and becomes CPU bound for LONG periods of time.</p>
<p>The Status message beside the progress bar at the bottom right of the MS Access Window is </p>
<blockquote>
<p>Rendering Data to format: Biff5</p>
</blockquote>
<p>Biff5 is a "Binary Interchange File Format (BIFF) version 5" According to <a href="http://support.microsoft.com/kb/150447" rel="nofollow noreferrer">Source</a></p>
<p>The app code doesn't use BIFF5 anywhere so I don't think this is an app problem.</p>
<p>I cannot find any data on this error anywhere on the web so I thought it would be a good question for stackoverflow.</p>
<p>So, can anyone help please?</p>
| [
{
"answer_id": 22442133,
"author": "Yayo",
"author_id": 3426665,
"author_profile": "https://Stackoverflow.com/users/3426665",
"pm_score": 0,
"selected": false,
"text": "RunCommand acCmdCopy\n\n Dim xlApp As Object \n Set xlApp = CreateObject(Class:=\"Excel.Application\")\n\n 'New ... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2806/"
] |
102,690 | <p>This question comes out of the discussion on <a href="https://stackoverflow.com/questions/101825/whats-the-best-way-of-using-a-pair-triple-etc-of-values-as-one-value-in-c">tuples</a>.</p>
<p>I started thinking about the hash code that a tuple should have.
What if we will accept KeyValuePair class as a tuple? It doesn't override the GetHashCode() method, so probably it won't be aware of the hash codes of it's "children"... So, run-time will call Object.GetHashCode(), which is not aware of the real object structure.</p>
<p>Then we can make two instances of some reference type, which are actually Equal, because of the overloaded GetHashCode() and Equals(). And use them as "children" in tuples to "cheat" the dictionary.</p>
<p>But it doesn't work! Run-time somehow figures out the structure of our tuple and calls the overloaded GetHashCode of our class!</p>
<p>How does it work? What's the analysis made by Object.GetHashCode()? </p>
<p>Can it affect the performance in some bad scenario, when we use some complicated keys? (probably, impossible scenario... but still)</p>
<p>Consider this code as an example:</p>
<pre><code>namespace csharp_tricks
{
class Program
{
class MyClass
{
int keyValue;
int someInfo;
public MyClass(int key, int info)
{
keyValue = key;
someInfo = info;
}
public override bool Equals(object obj)
{
MyClass other = obj as MyClass;
if (other == null) return false;
return keyValue.Equals(other.keyValue);
}
public override int GetHashCode()
{
return keyValue.GetHashCode();
}
}
static void Main(string[] args)
{
Dictionary<object, object> dict = new Dictionary<object, object>();
dict.Add(new KeyValuePair<MyClass,object>(new MyClass(1, 1), 1), 1);
//here we get the exception -- an item with the same key was already added
//but how did it figure out the hash code?
dict.Add(new KeyValuePair<MyClass,object>(new MyClass(1, 2), 1), 1);
return;
}
}
}
</code></pre>
<p><strong>Update</strong> I think I've found an explanation for this as stated below in my answer. The main outcomes of it are:</p>
<ul>
<li>Be careful with your keys and their hash codes :-)</li>
<li>For complicated dictionary keys you must override Equals() and GetHashCode() correctly.</li>
</ul>
| [
{
"answer_id": 103114,
"author": "Cory R. King",
"author_id": 16742,
"author_profile": "https://Stackoverflow.com/users/16742",
"pm_score": -1,
"selected": false,
"text": "MyClass"
},
{
"answer_id": 103587,
"author": "Max Galkin",
"author_id": 2351099,
"author_profile... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2351099/"
] |
102,720 | <p>I just finished a medium sized web site and one thing I noticed about my css organization was that I have a lot of hard coded colour values throughout. This obviously isn't great for maintainability. Generally, when I design a site I pick 3-5 main colours for a theme. I end up setting some default values for paragraphs, links, etc... at the beginning of my main css, but some components will change the colour (like the legend tag for example) and require me to restyle with the colour I wanted. How do you avoid this? I was thinking of creating separate rules for each colour and just use those when I need to restyle.</p>
<p>i.e.</p>
<pre><code>.color1 {
color: #3d444d;
}
</code></pre>
| [
{
"answer_id": 102817,
"author": "Josh Millard",
"author_id": 13600,
"author_profile": "https://Stackoverflow.com/users/13600",
"pm_score": 2,
"selected": false,
"text": "h1 { \n padding...\n margin...\n font-family...\n}\n\np {\n ...\n}\n\ncode {\n ...\n}\n\n/* time passes */\n\n/* thes... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12529/"
] |
102,759 | <p>Everyone has accidentally forgotten the <code>WHERE</code> clause on a <code>DELETE</code> query and blasted some un-backed up data once or twice. I was pondering that problem, and I was wondering if the solution I came up with is practical.</p>
<p>What if, in place of actual <code>DELETE</code> queries, the application and maintenance scripts did something like:</p>
<pre><code>UPDATE foo SET to_be_deleted=1 WHERE blah = 50;
</code></pre>
<p>And then a cron job was set to go through and actually delete everything with the flag? The downside would be that pretty much every other query would need to have <code>WHERE to_be_deleted != 1</code> appended to it, but the upside would be that you'd never mistakenly lose data again. You could see "2,349,325 rows affected" and say, "Hmm, looks like I forgot the <code>WHERE</code> clause," and reset the flags. You could even make the to_be_deleted field a <code>DATE</code> column, so the cron job would check to see if a row's time had come yet.</p>
<p>Also, you could remove <code>DELETE</code> permission from the production database user, so even if someone managed to inject some SQL into your site, they wouldn't be able to remove anything.</p>
<p>So, my question is: Is this a good idea, or are there pitfalls I'm not seeing? </p>
| [
{
"answer_id": 102915,
"author": "yukondude",
"author_id": 726,
"author_profile": "https://Stackoverflow.com/users/726",
"pm_score": 2,
"selected": false,
"text": "DELETE"
},
{
"answer_id": 105978,
"author": "David Schmitt",
"author_id": 4918,
"author_profile": "https... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16034/"
] |
102,788 | <p>I would like to encrypt strings which could potentially only be about three or four characters but run to about twenty characters. A hashing function (<a href="http://www.php.net/md5" rel="noreferrer">md5</a>, <a href="http://www.php.net/sha1" rel="noreferrer">sha1</a>, <a href="http://www.php.net/crypt" rel="noreferrer">crypt</a> etc) is not suitable as I would like to be able to decrypt the information as well. The <a href="http://au.php.net/mcrypt" rel="noreferrer">mcrypt</a> extension has a thoroughly daunting array of possibilities. </p>
<p>Does anyone have any ideas about the best way to safely encrypt short strings and <em>why</em>? Does anyone have any links to any material introducing a casual programmer to practical encryption scenarios?</p>
| [
{
"answer_id": 25953310,
"author": "Nasz Njoka Sr.",
"author_id": 1688471,
"author_profile": "https://Stackoverflow.com/users/1688471",
"pm_score": 0,
"selected": false,
"text": "function encryptstring($string) {\n\n$string_length=strlen($string);\n$encrychars=\"\"; \n/**\n*For each char... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15004/"
] |
102,829 | <p>I am looking for a text editor that will be able to load a 4+ Gigabyte file into it. Textpad doesn't work. I own a copy of it and have been to its support site, it just doesn't do it. Maybe I need new hardware, but that's a different question. The editor needs to be free OR, if its going to cost me, then no more than $30. For Windows.</p>
| [
{
"answer_id": 163941,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 7,
"selected": true,
"text": "Main Search"
},
{
"answer_id": 858117,
"author": "Aaron Digulla",
"author_id": 34088,
"author_profile": "htt... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14728/"
] |
102,832 | <p>I have a query form that I would like to submit as a GET request so the result page may be bookmarked and otherwise RESTful. It's your classical text field with a submit button. How do I induce Seam/JSF to use GET and include the query expression as a parameter rather than POST, the default?</p>
| [
{
"answer_id": 2239602,
"author": "Shervin Asgari",
"author_id": 37298,
"author_profile": "https://Stackoverflow.com/users/37298",
"pm_score": 1,
"selected": false,
"text": "s:button"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4893/"
] |
102,846 | <p>OK, this might sound a bit confusing and complicated, so bear with me.</p>
<p>We've written a framework that allows us to define friendly URLs. If you surf to any arbitrary URL, IIS tries to display a 404 error (or, in some cases, 403;14 or 405). However, IIS is set up so that anything directed to those specific errors is sent to an .aspx file. This allows us to implement an HttpHandler to handle the request and do stuff, which involves finding the an associated template and then executing whatever's associated with it.</p>
<p>Now, this all works in IIS 5 and 6 and, to an extent, on IIS7 - but for one catch, which happens when you post a form.</p>
<p>See, when you post a form to a non-existent URL, IIS says "ah, but that url doesn't exist" and throws a 405 "method not allowed" error. Since we're telling IIS to redirect those errors to our .aspx page and therefore handling it with our HttpHandler, this normally isn't a problem. But as of IIS7, all POST information has gone missing after being redirected to the 405. And so you can no longer do the most trivial of things involving forms.</p>
<p>To solve this we've tried using a HttpModule, which preserves POST data but appears to not have an initialized Session at the right time (when it's needed). We also tried using a HttpModule for all requests, not just the missing requests that hit 404/403;14/405, but that means stuff like images, css, js etc are being handled by .NET code, which is terribly inefficient.</p>
<p>Which brings me to the actual question: has anyone ever encountered this, and does anyone have any advice or know what to do to get things working again? So far someone has suggested using Microsoft's own <a href="http://learn.iis.net/page.aspx/460/using-url-rewrite-module/" rel="nofollow noreferrer">URL Rewriting module</a>. Would this help solve our problem?</p>
<p>Thanks.</p>
| [
{
"answer_id": 109172,
"author": "Stefan Rusek",
"author_id": 19704,
"author_profile": "https://Stackoverflow.com/users/19704",
"pm_score": 2,
"selected": false,
"text": "using System.Web;\nusing System.Web.UI;\n\nclass Smart404Module : IHttpModule\n{\n public void Dispose() {}\n\n ... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16308/"
] |
102,850 | <p>Doesn't work with other modules, but to give an example. I installed Text::CSV_XS with a CPAN setting:</p>
<pre><code>'makepl_arg' => q[PREFIX=~/lib],
</code></pre>
<p>When I try running a test.pl script:</p>
<blockquote>
<p>$ perl test.pl</p>
</blockquote>
<pre><code>#!/usr/bin/perl
use lib "/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi";
use Text::CSV_XS;
print "test";
</code></pre>
<p>I get</p>
<pre>
Can't load '/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so' for module Text::CSV_XS: /homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so: cannot open shared object file: No such file or directory at /www/common/perl/lib/5.8.2/i686-linux/DynaLoader.pm line 229.
at test.pl line 6
Compilation failed in require at test.pl line 6.
BEGIN failed--compilation aborted at test.pl line 6.
</pre>
<p>I traced the error back to DynaLoader.pm it happens at this line:</p>
<pre><code># Many dynamic extension loading problems will appear to come from
# this section of code: XYZ failed at line 123 of DynaLoader.pm.
# Often these errors are actually occurring in the initialisation
# C code of the extension XS file. Perl reports the error as being
# in this perl code simply because this was the last perl code
# it executed.
my $libref = dl_load_file($file, $module->dl_load_flags) or
croak("Can't load '$file' for module $module: ".dl_error());
</code></pre>
<p><b>CSV_XS.so exists in the above directory</b></p>
| [
{
"answer_id": 103018,
"author": "Frosty",
"author_id": 7476,
"author_profile": "https://Stackoverflow.com/users/7476",
"pm_score": 2,
"selected": false,
"text": "'makepl_arg' => q[PREFIX=~/]\n"
},
{
"answer_id": 103501,
"author": "Frosty",
"author_id": 7476,
"author_... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10523/"
] |
102,866 | <p>I have one <code>JSON</code> that is coming in a <code>string</code> format. I need to store it in a <code>key-pair</code> value or something like that. I am using <code>asp.net 2.0</code> and can not use 3rd party <code>DLL</code> like <code>Newtonsoft.Json.dll</code>. I guess last option will be to use <code>regular expression</code>. </p>
<p><em>Can anybody please help me in this?</em></p>
| [
{
"answer_id": 405416,
"author": "Dan Herbert",
"author_id": 392,
"author_profile": "https://Stackoverflow.com/users/392",
"pm_score": 2,
"selected": false,
"text": "using Microsoft.JScript;\nusing Microsoft.JScript.Vsa;\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/102866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1312208/"
] |
102,877 | <p>I need to create a PRIVATE message queue on a remote machine and I have resolved to fact that I can't do this with the .NET Framework in a straight forward manner. I can create a public message queue on a remote machine, but not a PRIVATE one. I can create a message queue (public or private) locally.</p>
<p>I am wondering if anyone knows how to access MSMQ through WMI.</p>
<p><strong>Edit:</strong> I don't see anything to do it with using the MSMQ Provider. May have to get tricky and use PSExec to log onto a remote server and execute some code.</p>
| [
{
"answer_id": 287206,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "set qinfo = CreateObject(\"MSMQ.MSMQQueueInfo\")\nqinfo.PathName = \".\\Private$\\TestQueue\"\nqinfo.Label = \".\\Private$\\Te... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18475/"
] |
102,881 | <p>I am running some queries to track down a problem with our backup logs and would like to display datetime fields in 24-hour military time. Is there a simple way to do this? I've tried googling and could find nothing.</p>
| [
{
"answer_id": 102909,
"author": "Joe Skora",
"author_id": 14057,
"author_profile": "https://Stackoverflow.com/users/14057",
"pm_score": 5,
"selected": true,
"text": "select to_char(sysdate,'DD/MM/YYYY HH24:MI:SS') from dual;\n"
},
{
"answer_id": 102918,
"author": "Grant John... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5056/"
] |
102,913 | <p>I have an MVC-based site, which is using a Repository/Service pattern for data access.
The Services are written to be using in a majority of applications (console, winform, and web). Currently, the controllers communicate directly to the services. This has limited the ability to apply proper caching.</p>
<p>I see my options as the following:</p>
<ul>
<li>Write a wrapper for the web app, which implements the IWhatEverService which does caching. </li>
<li>Apply caching in each controller by cache the ViewData for each Action.</li>
<li>Don't worry about data caching and just implement OutputCaching for each Action.</li>
</ul>
<p>I can see the pros and cons of each. What is/should the best practice be for caching with Repository/Service </p>
| [
{
"answer_id": 6232477,
"author": "Brendan Enrick",
"author_id": 22381,
"author_profile": "https://Stackoverflow.com/users/22381",
"pm_score": 5,
"selected": false,
"text": "public class CachedAlbumRepository : IAlbumRepository\n{\n private readonly IAlbumRepository _albumRepository;\... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1296/"
] |
102,964 | <p>I have a Java bean like this:</p>
<pre><code>class Person {
int age;
String name;
}
</code></pre>
<p>I'd like to iterate over a collection of these beans in a JSP, showing each person in a HTML table row, and in the last row of the table I'd like to show the total of all the ages.</p>
<p>The code to generate the table rows will look something like this:</p>
<pre><code><c:forEach var="person" items="${personList}">
<tr><td>${person.name}<td><td>${person.age}</td></tr>
</c:forEach>
</code></pre>
<p>However, I'm struggling to find a way to calculate the age total that will be shown in the final row <strong>without resorting to scriptlet code</strong>, any suggestions?</p>
| [
{
"answer_id": 103065,
"author": "ScArcher2",
"author_id": 1310,
"author_profile": "https://Stackoverflow.com/users/1310",
"pm_score": 3,
"selected": false,
"text": "<c:set var=\"ageTotal\" value=\"${0}\" />\n<c:forEach var=\"person\" items=\"${personList}\">\n <c:set var=\"ageTotal\" v... | 2008/09/19 | [
"https://Stackoverflow.com/questions/102964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648/"
] |
103,000 | <p>I need to retrieve a record from a database, display it on a web page (I'm using ASP.NET) but store the ID (primary key) from that record somewhere so I can go back to the database later with that ID (perhaps to do an update).</p>
<p>I know there are probably a few ways to do this, such as storing the ID in ViewState or a hidden field, but what is the best method and what are the reasons I might choose this method over any others?</p>
| [
{
"answer_id": 103024,
"author": "Chris James",
"author_id": 3193,
"author_profile": "https://Stackoverflow.com/users/3193",
"pm_score": -1,
"selected": false,
"text": "Session[\"MyId\"]=myval;\n"
},
{
"answer_id": 103103,
"author": "blowdart",
"author_id": 2525,
"aut... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4605/"
] |
103,005 | <p>Here is my situation:</p>
<p>Table one contains a set of data that uses an id for an unique identifier. This table has a one to many relationship with about 6 other tables such that.</p>
<p>Given Table 1 with Id of 001:
Table 2 might have 3 rows with foreign key: 001
Table 3 might have 12 rows with foreign key: 001
Table 4 might have 0 rows with foreign key: 001
Table 5 might have 28 rows with foreign key: 001</p>
<p>I need to write a report that lists all of the rows from Table 1 for a specified time frame followed by all of the data contained in the handful of tables that reference it.</p>
<p>My current approach in pseudo code would look like this:</p>
<pre><code>select * from table 1
foreach(result) {
print result;
select * from table 2 where id = result.id;
foreach(result2) {
print result2;
}
select * from table 3 where id = result.id
foreach(result3) {
print result3;
}
//continued for each table
}
</code></pre>
<p>This means that the single report can run in the neighbor hood of 1000 queries. I know this is excessive however my sql-fu is a little weak and I could use some help. </p>
| [
{
"answer_id": 103044,
"author": "Forgotten Semicolon",
"author_id": 1960,
"author_profile": "https://Stackoverflow.com/users/1960",
"pm_score": 2,
"selected": false,
"text": "SELECT Table1.*, Table2.*, Table3.*, Table4.*, Table5.*\nFROM Table1\nLEFT OUTER JOIN Table2 ON Table1.ID = Tabl... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2246765/"
] |
103,006 | <p>I've got a CSV file containing latitude and longitude values, such as:</p>
<blockquote>
<p>"25°36'55.57""E","45°39'12.52""N"</p>
</blockquote>
<p>Anyone have a quick and simple piece of C# code to convert this to double values?</p>
<p>Thanks</p>
| [
{
"answer_id": 103057,
"author": "ine",
"author_id": 4965,
"author_profile": "https://Stackoverflow.com/users/4965",
"pm_score": 5,
"selected": true,
"text": "String hour = \"25\";\nString minute = \"36\";\nString second = \"55.57\";\nDouble result = (hour) + (minute) / 60 + (second) / 3... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932/"
] |
103,059 | <p>Anyone have any suggestions on where to start for a newbie wanting to try out some sort of source-control along with a new journey into ASP.NET? SVN, VSS, CVS...I dont even know where to start!</p>
| [
{
"answer_id": 103545,
"author": "Thiago Arrais",
"author_id": 17801,
"author_profile": "https://Stackoverflow.com/users/17801",
"pm_score": 2,
"selected": false,
"text": "init"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18953/"
] |
103,118 | <p>For years, one of my most important tools has been incremental copy utility that compares the contents of two directories and shows me which files are newer / older / added / deleted. Every day I find myself copying folders of source code between my two desktop machines and the server, and such a utility is critical to avoid overwriting newer files with older ones and also to save time by only copying changed files. In addition, the utility allows me to see new files in the source folder that I don't necessarily want to copy (like temp files) that I instead can delete.</p>
<p>Like anyone who subscribes to the <a href="http://en.wikipedia.org/wiki/Not_Invented_Here" rel="nofollow noreferrer">NIH</a> way of thinking, I wrote my own utility to compare the contents of two folders and let me mark files to be copied, deleted, diffed or ignored. I've had many versions of this utility going back to DOS, OS/2 and Win32.</p>
<p>I use this utility on a daily basis, and it leaves me wondering: What do others use? Surely there are similar programs out there to do this... My utility doesn't have a diff screen, and it would be occasionally nice to see what the difference is between two changed files.</p>
<p>What do you use for comparing and incrementally copying between folders?</p>
| [
{
"answer_id": 278948,
"author": "Ola",
"author_id": 31990,
"author_profile": "https://Stackoverflow.com/users/31990",
"pm_score": 1,
"selected": false,
"text": "robocopy source destination /MIR"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8752/"
] |
103,136 | <p>I am trying to execute some stored procedures in groovy way. I am able to do it quite easily by using straight JDBC but this does not seem in the spirit of Grails.</p>
<p>I am trying to call the stored procedure as:</p>
<pre><code>sql.query( "{call web_GetCityStateByZip(?,?,?,?,?)}",[params.postalcode,
sql.out(java.sql.Types.VARCHAR), sql.out(java.sql.Types.VARCHAR),
sql.out(java.sql.Types.INTEGER), sql.out(java.sql.Types.VARCHAR)]) { rs ->
params.city = rs.getString(2)
params.state = rs.getString(3)
}
</code></pre>
<p>I tried various ways like <code>sql.call</code>. I was trying to get output variable value after this.</p>
<p>Everytime error:</p>
<pre><code>Message: Cannot register out parameter.
Caused by: java.sql.SQLException: Cannot register out parameter.
Class: SessionExpirationFilter
</code></pre>
<p>but this does not seem to work.</p>
<p>Can anyone point me in the right direction?</p>
| [
{
"answer_id": 116620,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": " Sql sql = new Sql(dataSource)\nConnection conn\nResultSet rs\ntry {\n conn = sql.createConnection()\n Callab... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103136",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
103,157 | <p>Can someone please remind me how to create a .Net class from an XML file?<br></p>
<p>I would prefer the batch commands, or a way to integrate it into the shell.<br></p>
<p>Thanks!</p>
| [
{
"answer_id": 104260,
"author": "Nescio",
"author_id": 14484,
"author_profile": "https://Stackoverflow.com/users/14484",
"pm_score": 2,
"selected": false,
"text": "@Echo off\nSet XsdExePath=\"C:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\Bin\\XSD.exe\"\nSet Language=VB\n%~d1\... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14484/"
] |
103,177 | <p>How do you enumerate the fields of a certificate help in a store. Specifically, I am trying to enumerate the fields of personal certificates issued to the logged on user.</p>
| [
{
"answer_id": 103228,
"author": "Duncan Smart",
"author_id": 1278,
"author_profile": "https://Stackoverflow.com/users/1278",
"pm_score": 1,
"selected": false,
"text": "using System.Security.Cryptography.X509Certificates;\n...\nvar store = new X509Store(StoreName.My);\nforeach(var cert i... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
103,178 | <p>I figured someone can answer the question generally but if anyone wants to get specific I am trying to use:</p>
<p>using System.Web.Security.SingleSignOn;
using System.Web.Security.SingleSignOn.Authorization;</p>
<p>I've googled my brains out and this is the closest answer I found:</p>
<p>"We discussed this offline, but it looks like the ADFS assembly is GACed, but
not installed on the file system or registered with VS.NET so that it shows
up in the .NET tab. I'm guessing MS may need to beef up the installer for
this scenario. In the meantime, you probably need to do this yourself."</p>
<p>What on earth, do WHAT myself?</p>
| [
{
"answer_id": 103539,
"author": "Travis Illig",
"author_id": 8116,
"author_profile": "https://Stackoverflow.com/users/8116",
"pm_score": 0,
"selected": false,
"text": "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\.NETFramework\\AssemblyFolders"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18309/"
] |
103,179 | <p>I know I can specify one for each form, or for the root form and then it'll cascade through to all of the children forms, but I'd like to have a way of overriding the default Java Coffee Cup for all forms even those I might forget.</p>
<p>Any suggestions?</p>
| [
{
"answer_id": 103295,
"author": "Paul Brinkley",
"author_id": 18160,
"author_profile": "https://Stackoverflow.com/users/18160",
"pm_score": 4,
"selected": true,
"text": "JFrame"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2443/"
] |
103,184 | <p>We have a system where we want to prevent the same credit card number being registered for two different accounts. As we don't store the credit card number internally - just the last four digits and expiration date - we cannot simply compare credit card numbers and expiration dates.</p>
<p>Our current idea is to store a hash (SHA-1) in our system of the credit card information when the card is registered, and to compare hashes to determine if a card has been used before.</p>
<p>Usually, a salt is used to avoid dictionary attacks. I assume we are vulnerable in this case, so we should probably store a salt along with the hash.</p>
<p>Do you guys see any flaws in this method? Is this a standard way of solving this problem?</p>
| [
{
"answer_id": 1267757,
"author": "MiniQuark",
"author_id": 38626,
"author_profile": "https://Stackoverflow.com/users/38626",
"pm_score": 3,
"selected": false,
"text": "hash(stored_CC1_salt+CC2)==stored_CC1_hash"
},
{
"answer_id": 25833770,
"author": "Michael",
"author_id... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6120/"
] |
103,203 | <p>We recently had a security audit and it exposed several weaknesses in the systems that are in place here. One of the tasks that resulted from it is that we need to update our partner credentials system make it more secure. </p>
<p>The "old" way of doing things was to generate a (bad) password, give it to the partner with an ID and then they would send that ID and a Base 64 encoded copy of that password in with all of their XML requests over https. We then decode them and validate them.</p>
<p>These passwords won't change (because then our partners would have to make coding/config changes to change them and coordinating password expirations with hundreds of partners for multiple environments would be a nightmare) and they don't have to be entered by a human or human readable. I am open to changing this if there is a better but still relatively simple implementation for our partners.</p>
<p>Basically it comes down to two things: I need a more secure Java password generation system and to ensure that they are transmitted in a secure way.</p>
<p>I've found a few hand-rolled password generators but nothing that really stood out as a standard way to do this (maybe for good reason). There may also be a more secure way to transmit them than simple Base 64 encoding over https. </p>
<p>What would you do for the password generator and do you think that the transmission method in place is secure enough for it?</p>
<p>Edit: The XML comes in a SOAP message and the credentials are in the header not in the XML itself. Also, since the passwords are a one-off operation for each partner when we set them up we're not too worried about efficiency of the generator.</p>
| [
{
"answer_id": 103768,
"author": "erickson",
"author_id": 3474,
"author_profile": "https://Stackoverflow.com/users/3474",
"pm_score": 4,
"selected": true,
"text": " SecureRandom rnd = new SecureRandom();\n /* Byte array length is multiple of LCM(log2(64), 8) / 8 = 3. */\n byte[] passw... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12662/"
] |
103,240 | <p>I have a table in a RDLC report which is utilized as a subreport, and the first column of this table is a static string. Does anyone know how I can determine if a row is the first in the table. I tried using "=First("My String")" but it didn't work.</p>
| [
{
"answer_id": 104361,
"author": "Stephen Wrighton",
"author_id": 7516,
"author_profile": "https://Stackoverflow.com/users/7516",
"pm_score": 2,
"selected": false,
"text": "=IIf(RowNumber(Nothing)=1,\"myString\", \"\")\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7516/"
] |
103,261 | <p>I recently inherited an old visual basic 6/ crystal reports project which connects to a sql server database. The error message I get (Error# -2147191803 A String is required here) when I attempt to run the project seems to be narrowed down to the .Printout command in the following code: </p>
<pre>
'Login to database
Set Tables = Report.Database.Tables
Set Table = Tables.Item(1)
Table.SetLogOnInfo ConnName, DBName, user, pass
DomainName = CStr(selected)
'Set parameter Fields
'Declare parameter holders
Set ParamDefs = Report.ParameterFields
'Store parameter objects
For Each ParamDef In ParamDefs
With ParamDef
MsgBox("DomainName : " + DomainName)
Select Case .ParameterFieldName
Case "Company Name"
.SetCurrentValue DomainName
End Select
Select Case .Name
Case "{?Company Name}"
.SetCurrentValue DomainName
End Select
'Flag to see what is assigned to Current value
MsgBox("paramdef: " + ParamDef.Value)
End With
Next
Report.EnableParameterPrompting = False
Screen.MousePointer = vbHourglass
'CRViewer1.ReportSource = Report
'CRViewer1.ViewReport
test = 1
**Report.PrintOut**
test = test + 3
currenttime = Str(Now)
currenttime = Replace(currenttime, "/", "-")
currenttime = Replace(currenttime, ":", "-")
DomainName = Replace(DomainName, ".", "")
startName = mPath + "\crysta~1.pdf"
endName = mPath + "\" + DomainName + "\" + DomainName + " " + currenttime + ".pdf"
rc = MsgBox("Wait for PDF job to finish", vbInformation, "H/W Report")
Name startName As endName
Screen.MousePointer = vbDefault
End If
</pre>
<p>During the run, the form shows up, the ParamDef variable sets the "company name" and when it gets to the <strong>Report.PrintOut</strong> line which prompts to print, it throws the error. I'm guessing the crystal report isn't receiving the "Company Name" to properly run the crystal report. Does any one know how to diagnose this...either on the vb6 or crystal reports side to determine what I'm missing here? </p>
<p><strong>UPDATE:</strong> </p>
<ul>
<li>inserted CStr(selected) to force DomainName to be a string</li>
<li>inserted msgboxes into the for loop above and below the .setcurrentvalue line </li>
<li>inserted Case "{?Company Name}" statement to see if that helps setting the value</li>
<li>tried .AddCurrentValue and .SetCurrentValue functions as suggested by other forum websites</li>
<li>ruled out that it was my development environement..loaded it on another machine with the exact same vb6 crystal reports 8.5 running on winxp prof sp2 and the same errors come up. </li>
</ul>
<p>and when I run the MsgBox(ParamDef.Value) and it also turns up blank with the same missing string error. I also can't find any documentation on the craxdrt.ParameterFieldDefinition class to see what other hidden functions are available. When I see the list of methods and property variables, it doesn't list SetCurrentValue as one of the functions.
Any ideas on this?</p>
| [
{
"answer_id": 104259,
"author": "nathaniel",
"author_id": 11947,
"author_profile": "https://Stackoverflow.com/users/11947",
"pm_score": 1,
"selected": false,
"text": "Dim dv As New ParameterDiscreteValue\ndv.Value = showphone\nrpt.ParameterFields(\"showphone\").CurrentValues.Add(dv)\n"
... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18853/"
] |
103,280 | <p>If by some miracle a segfault occurs in our program, I want to catch the SIGSEGV and let the user (possibly a GUI client) know with a single return code that a serious problem has occurred. At the same time I would like to display information on the command line to show which signal was caught.</p>
<p>Today our signal handler looks as follows:</p>
<pre><code>void catchSignal (int reason) {
std :: cerr << "Caught a signal: " << reason << std::endl;
exit (1);
}
</code></pre>
<p>I can hear the screams of horror with the above, as I have read from this <a href="http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/6184795b39508519/f775c1f48284b212?lnk=gst&q=deadlock#" rel="nofollow noreferrer">thread</a> that it is evil to call a non-reentrant function from a signal handler.</p>
<p>Is there a portable way to handle the signal and provide information to users?</p>
<p><strong>EDIT:</strong> Or at least portable within the POSIX framework?</p>
| [
{
"answer_id": 103926,
"author": "Richard Corden",
"author_id": 11698,
"author_profile": "https://Stackoverflow.com/users/11698",
"pm_score": 5,
"selected": true,
"text": "#include <csignal>\n\n#ifdef _WINDOWS_\n#define _exit _Exit\n#else\n#include <unistd.h>\n#endif\n\n#define PRINT_SIG... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11698/"
] |
103,298 | <p>From managed C++, I am calling an unmanaged C++ method which returns a double. How can I convert this double into a managed string?</p>
| [
{
"answer_id": 103350,
"author": "Scott Nichols",
"author_id": 4299,
"author_profile": "https://Stackoverflow.com/users/4299",
"pm_score": 2,
"selected": false,
"text": "double d = 123.45;\nstd::ostringstream oss;\noss << d;\nstd::string s = oss.str();\n"
},
{
"answer_id": 103381... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18170/"
] |
103,312 | <p>How can I test for the <code>EOF</code> flag in R? </p>
<p>For example:</p>
<pre><code>f <- file(fname, "rb")
while (???) {
a <- readBin(f, "int", n=1)
}
</code></pre>
| [
{
"answer_id": 1204916,
"author": "ars",
"author_id": 2611,
"author_profile": "https://Stackoverflow.com/users/2611",
"pm_score": 3,
"selected": false,
"text": "while (length(a <- readBin(f, 'int', n=1)) > 0) {\n # do something\n}\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
103,316 | <p>In bash, environmental variables will tab-expand correctly when placed after an echo command, for example:</p>
<pre><code>echo $HOME
</code></pre>
<p>But after cd or cat, bash places a \ before the $ sign, like so:</p>
<pre><code>cd \$HOME
</code></pre>
<p>If I use a variable as the second argument to a command, it won't expand at all:</p>
<pre><code>cp somefile $HOM
</code></pre>
<p>What mysterious option do I have in my .bashrc or .inputrc file that is causing me such distress?</p>
| [
{
"answer_id": 103463,
"author": "Brent ",
"author_id": 3764,
"author_profile": "https://Stackoverflow.com/users/3764",
"pm_score": 2,
"selected": false,
"text": "help complete\n"
},
{
"answer_id": 110181,
"author": "bd808",
"author_id": 8171,
"author_profile": "https... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14102/"
] |
103,325 | <p>Given this XML, what XPath returns all elements whose <code>prop</code> attribute contains <code>Foo</code> (the first three nodes):</p>
<pre><code><bla>
<a prop="Foo1"/>
<a prop="Foo2"/>
<a prop="3Foo"/>
<a prop="Bar"/>
</bla>
</code></pre>
| [
{
"answer_id": 103417,
"author": "evilhomer",
"author_id": 2806,
"author_profile": "https://Stackoverflow.com/users/2806",
"pm_score": 10,
"selected": true,
"text": "//a[contains(@prop,'Foo')]\n"
},
{
"answer_id": 103432,
"author": "Metro Smurf",
"author_id": 9664,
"a... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] |
103,366 | <p>I've been playing around with <code>OpenGL ES</code> development on Android. <code>OpenGL ES</code> applications seem to run slowly in the Emulator on my development machine. Does this reflect likely performance of actual hardware? I'm concerned about spending too much time developing an application if the graphics performance is going to be sluggish.</p>
| [
{
"answer_id": 103428,
"author": "taudep",
"author_id": 8531,
"author_profile": "https://Stackoverflow.com/users/8531",
"pm_score": 3,
"selected": false,
"text": "Mobile Intel Pentium M 725, 1600 MHz"
},
{
"answer_id": 32769331,
"author": "Satyavrat",
"author_id": 4969037... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
103,382 | <p>I'm using managed c++ to implement a method that returns a string. I declare the method in my header file using the following signature:</p>
<pre><code>String^ GetWindowText()
</code></pre>
<p>However, when I'm using this method from C#, the signature is:</p>
<pre><code>string GetWindowTextW();
</code></pre>
<p>How do I get rid of the extra "W" at the end of the method's name?</p>
| [
{
"answer_id": 103398,
"author": "Shog9",
"author_id": 811,
"author_profile": "https://Stackoverflow.com/users/811",
"pm_score": 3,
"selected": true,
"text": "#undef GetWindowText\nString^ GetWindowText()\n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15157/"
] |
103,395 | <p>I've got an open-source app that is hosted at code.google.com. It is cross platform ( Linux / Windows / Mac ). I uploaded the code initially from a WinXP machine using TortoiseSVN and it seems that none of the "configure" batch files that are used for the linux build have their "execute" bits set. </p>
<p>What would be the easiest way to set these for the files that need them? Using TortoiseSVN would be easier, I suppose, but if that can't be used, then I could also use the command line SVN on my linux machine.</p>
| [
{
"answer_id": 103498,
"author": "bmdhacks",
"author_id": 14032,
"author_profile": "https://Stackoverflow.com/users/14032",
"pm_score": 6,
"selected": false,
"text": "for file in `find . -name configure`; do\n svn ps svn:executable yes ${file}\ndone\n"
},
{
"answer_id": 1723303,... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103395",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13676/"
] |
103,402 | <p>In SharePoint, it is easy to set up a List webpart consisting of Links to other documents, folders, sites, etc. Unfortunately, when clicking these links, the default behavior is for the page to open in the current browser window. That is, it does NOT open the page in a new instance of the browser. This has proven annoying for a number of the users on my site.</p>
<p>Does anyone know of a way to have the default behavior be to open in a NEW browser window? </p>
<p>I'm hoping this is something that can be set in SharePoint rather than having users need to adjust some sort of setting in their browser.</p>
| [
{
"answer_id": 103541,
"author": "vitule",
"author_id": 1287,
"author_profile": "https://Stackoverflow.com/users/1287",
"pm_score": 2,
"selected": false,
"text": "A"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6602/"
] |
103,407 | <p>When attempting to call functions in <code>math.h</code>, I'm getting link errors like the following </p>
<pre><code>undefined reference to sqrt
</code></pre>
<p>But I'm doing a <code>#include <math.h></code><br>
I'm using gcc and compiling as follows:</p>
<pre><code>gcc -Wall -D_GNU_SOURCE blah.c -o blah
</code></pre>
<p>Why can't the linker find the definition for <code>sqrt</code>?</p>
| [
{
"answer_id": 103411,
"author": "FreeMemory",
"author_id": 2132,
"author_profile": "https://Stackoverflow.com/users/2132",
"pm_score": 2,
"selected": false,
"text": "-lm"
},
{
"answer_id": 45885013,
"author": "Billy Raseman",
"author_id": 6451035,
"author_profile": "... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2132/"
] |
103,421 | <p>I have a sprite loaded as a texture and I need to animate it, allowing it to "face" left or right -- essentially sometimes I need to "flip" it. I know that OpenGL has a gltranslate which repositions an object, and glrotate which rotates it. Is there a method that simply flips it across one axis? If not, how would you accomplish this?</p>
| [
{
"answer_id": 311849,
"author": "Ivan Vučica",
"author_id": 39974,
"author_profile": "https://Stackoverflow.com/users/39974",
"pm_score": 4,
"selected": true,
"text": "glTranslatef()"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13968/"
] |
103,422 | <p>A lot of contact management programs do this - you type in a name (<em>e.g.</em>, "John W. Smith") and it automatically breaks it up internally into:</p>
<p><strong>First name:</strong> John<br>
<strong>Middle name:</strong> W.<br>
<strong>Last name:</strong> Smith</p>
<p>Likewise, it figures out things like "Mrs. Jane W. Smith" and "Dr. John Doe, Jr." correctly as well (assuming you allow for fields like "prefix" and "suffix" in names). </p>
<p>I assume this is a fairly common things that people would want to do... so the question is... how would you do it? Is there a <em>simple</em> algorithm for this? Maybe a regular expression?</p>
<p>I'm after a .NET solution, but I'm not picky.</p>
<p><strong>Update:</strong> I appreciate that there is no simple solution for this that covers ALL edge cases and cultures... but let's say for the sake of argument that you need the name in pieces (filling out forms - as in, say, tax or other government forms - is one case where you are bound to enter the name into fixed fields, whether you like it or not), but you don't necessarily want to force the user to enter their name into discrete fields (less typing = easier for novice users). </p>
<p>You'd want to have the program "guess" (as best it can) on what's first, middle, last, etc. If you can, look at how Microsoft Outlook does this for contacts - it lets you type in the name, but if you need to clarify, there's an extra little window you can open. I'd do the same thing - give the user the window in case they want to enter the name in discrete pieces - but allow for entering the name in one box and doing a "best guess" that covers <em>most</em> common names.</p>
| [
{
"answer_id": 103513,
"author": "Vincent McNabb",
"author_id": 16299,
"author_profile": "https://Stackoverflow.com/users/16299",
"pm_score": 3,
"selected": false,
"text": " Name = Name.Trim();\n\n arrNames = Name.Split(' ');\n\n if (arrNames.Length > 0) {\n GivenName = a... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5956/"
] |
103,423 | <p>I've always taken the approach of first deploying the database with a minimal set of indexes and then adding/changing indexes as performance dictates.</p>
<p>This approach works reasonably well. However, it still doesn't tell me where I could improve performance. It only tells me where performance is so bad that users complain about it.</p>
<p>Currently, I'm in the process of refactoring database objects on a lot of our applications. </p>
<p>So should I not bother to look for performance improvements since "premature optimization is the root of all evil"? </p>
<p>When refactoring application code, the developer is constantly looking for ways to improve the code quality. Is there a way to constantly be looking for improvements in database performance as well? If so, what tools and techniques have you found to be most helpful? </p>
<p>I've briefly played around with the "Database engine tuning advisor" but didn't find it to be helpful at all. Maybe I just need more experience interpreting the results.</p>
| [
{
"answer_id": 45939640,
"author": "Dhyan Mohandas",
"author_id": 5323907,
"author_profile": "https://Stackoverflow.com/users/5323907",
"pm_score": 1,
"selected": false,
"text": "SELECT Cash, Age, Amount FROM Investments; \n"
}
] | 2008/09/19 | [
"https://Stackoverflow.com/questions/103423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5458/"
] |
103,453 | <p>Is there an easy way of finding out the host name of a machine that generated a user mode dump file via WinDbg? </p>
<p>Or at least any piece of identifying information to try and confirm that two dump files came from the same system.</p>
| [
{
"answer_id": 103492,
"author": "Kris Kumler",
"author_id": 4281,
"author_profile": "https://Stackoverflow.com/users/4281",
"pm_score": 1,
"selected": false,
"text": "0: kd> x srv!SrvComputerName\nbe8ce2e8 srv!SrvComputerName = _UNICODE_STRING \"AIGM-MYCOMP-PUB01\"\n"
},
{
"an... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631/"
] |
103,460 | <p>I need to get the name of the machine my .NET app is running on. What is the best way to do this?</p>
| [
{
"answer_id": 103468,
"author": "Billy Jo",
"author_id": 3447,
"author_profile": "https://Stackoverflow.com/users/3447",
"pm_score": 3,
"selected": false,
"text": "System.Environment.MachineName"
},
{
"answer_id": 104154,
"author": "Ray Hayes",
"author_id": 7093,
"au... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14101/"
] |
103,489 | <p>Below is the code I use to build an HTML table on the fly (using JSON data received from the server).</p>
<p>I display an animated pleasewait (.gif) graphic while the data is loading. However, the graphic freezes while the JavaScript function is building the table. At first, I was just happy to make this happen (display the table), I guess now I need to work on efficiency. At the very least I need to stop the animated graphic from freezing. I can go to a static "Loading" display, but I would rather make this method work.</p>
<p>Suggestions for my pleasewait display? And efficiency? Possibly a better way to build the table? Or maybe not a table, but some other "table" like display</p>
<pre><code>var t = eval( "(" + request + ")" ) ;
var myTable = '' ;
myTable += '<table id="myTable" cellspacing=0 cellpadding=2 border=1>' ;
myTable += "<thead>" ;
myTable += "<tr>";
for (var i = 0; i < t.hdrs.length; i++) {
myTable += "<th>" + header + "</th>";
}
myTable += "</tr>" ;
myTable += "</thead>" ;
myTable += "<tbody>" ;
for (var i = 0; i < t.data.length; i++) {
myTable += '<tr>';
for (var j = 0; j < t.hdrs.length; j++) {
myTable += '<td>';
if (t.data[i][t.hdrs[j]] == "") {
myTable += "&nbsp;" ;
}
else {
myTable += t.data[i][t.hdrs[j]] ;
}
myTable += "</td>";
}
myTable += "</tr>";
}
myTable += "</tbody>" ;
myTable += "</table>" ;
$("#result").append(myTable) ;
$("#PleaseWaitGraphic").addClass("hide");
$(".rslt").removeClass("hide") ;
</code></pre>
| [
{
"answer_id": 103527,
"author": "Jim",
"author_id": 8427,
"author_profile": "https://Stackoverflow.com/users/8427",
"pm_score": 2,
"selected": false,
"text": "$(\"<table>\")"
},
{
"answer_id": 104053,
"author": "Lasar",
"author_id": 9438,
"author_profile": "https://S... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2755/"
] |
103,512 | <p>I've heard that the <code>static_cast</code> function should be preferred to C-style or simple function-style casting. Is this true? Why?</p>
| [
{
"answer_id": 103529,
"author": "prakash",
"author_id": 123,
"author_profile": "https://Stackoverflow.com/users/123",
"pm_score": 3,
"selected": false,
"text": "double d = 3.14159265;\nint i = static_cast<int>(d);\n"
},
{
"answer_id": 103612,
"author": "DrPizza",
"aut... | 2008/09/19 | [
"https://Stackoverflow.com/questions/103512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11575/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.