qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
66,363 | <p>I need to find out the <strong>external</strong> IP of the computer a C# application is running on. </p>
<p>In the application I have a connection (via .NET remoting) to a server. Is there a good way to get the address of the client on the server side?</p>
<p><em>(I have edited the question, to be a little more clear. I'm apologize to all kind people who did their best to respond to the question, when I perhaps was a little too vague)</em></p>
<p><strong>Solution:</strong><br>
I found a way that worked great for me. By implementing a custom IServerChannelSinkProvider and IServerChannelSink where I have access to CommonTransportKeys.IPAddress, it's easy to add the client ip on the CallContext.</p>
<pre><code>public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack,
IMessage requestmessage, ITransportHeaders requestHeaders,
System.IO.Stream requestStream, out IMessage responseMessage,
out ITransportHeaders responseHeaders, out System.IO.Stream responseStream)
{
try
{
// Get the IP address and add it to the call context.
IPAddress ipAddr = (IPAddress)requestHeaders[CommonTransportKeys.IPAddress];
CallContext.SetData("ClientIP", ipAddr);
}
catch (Exception)
{
}
sinkStack.Push(this, null);
ServerProcessing srvProc = _NextSink.ProcessMessage(sinkStack, requestmessage, requestHeaders,
requestStream, out responseMessage, out responseHeaders, out responseStream);
return srvProc;
}
</code></pre>
<p>And then later (when I get a request from a client) just get the IP from the CallContext like this.</p>
<pre><code>public string GetClientIP()
{
// Get the client IP from the call context.
object data = CallContext.GetData("ClientIP");
// If the data is null or not a string, then return an empty string.
if (data == null || !(data is IPAddress))
return string.Empty;
// Return the data as a string.
return ((IPAddress)data).ToString();
}
</code></pre>
<p>I can now send the IP back to the client.</p>
| [
{
"answer_id": 66407,
"author": "UnkwnTech",
"author_id": 115,
"author_profile": "https://Stackoverflow.com/users/115",
"pm_score": 3,
"selected": false,
"text": "<?php\necho 'Your Public IP is: ' . $_SERVER['REMOTE_ADDR'];\n?>\n"
},
{
"answer_id": 66408,
"author": "FlySwat",... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/936/"
] |
66,382 | <p>In the ContainsIngredients method in the following code, is it possible to cache the <em>p.Ingredients</em> value instead of explicitly referencing it several times? This is a fairly trivial example that I just cooked up for illustrative purposes, but the code I'm working on references values deep inside <em>p</em> eg. <em>p.InnerObject.ExpensiveMethod().Value</em></p>
<p>edit:
I'm using the PredicateBuilder from <a href="http://www.albahari.com/nutshell/predicatebuilder.html" rel="nofollow noreferrer">http://www.albahari.com/nutshell/predicatebuilder.html</a></p>
<pre><code>public class IngredientBag
{
private readonly Dictionary<string, string> _ingredients = new Dictionary<string, string>();
public void Add(string type, string name)
{
_ingredients.Add(type, name);
}
public string Get(string type)
{
return _ingredients[type];
}
public bool Contains(string type)
{
return _ingredients.ContainsKey(type);
}
}
public class Potion
{
public IngredientBag Ingredients { get; private set;}
public string Name {get; private set;}
public Potion(string name) : this(name, null)
{
}
public Potion(string name, IngredientBag ingredients)
{
Name = name;
Ingredients = ingredients;
}
public static Expression<Func<Potion, bool>>
ContainsIngredients(string ingredientType, params string[] ingredients)
{
var predicate = PredicateBuilder.False<Potion>();
// Here, I'm accessing p.Ingredients several times in one
// expression. Is there any way to cache this value and
// reference the cached value in the expression?
foreach (var ingredient in ingredients)
{
var temp = ingredient;
predicate = predicate.Or (
p => p.Ingredients != null &&
p.Ingredients.Contains(ingredientType) &&
p.Ingredients.Get(ingredientType).Contains(temp));
}
return predicate;
}
}
[STAThread]
static void Main()
{
var potions = new List<Potion>
{
new Potion("Invisibility", new IngredientBag()),
new Potion("Bonus"),
new Potion("Speed", new IngredientBag()),
new Potion("Strength", new IngredientBag()),
new Potion("Dummy Potion")
};
potions[0].Ingredients.Add("solid", "Eye of Newt");
potions[0].Ingredients.Add("liquid", "Gall of Peacock");
potions[0].Ingredients.Add("gas", "Breath of Spider");
potions[2].Ingredients.Add("solid", "Hair of Toad");
potions[2].Ingredients.Add("gas", "Peacock's anguish");
potions[3].Ingredients.Add("liquid", "Peacock Sweat");
potions[3].Ingredients.Add("gas", "Newt's aura");
var predicate = Potion.ContainsIngredients("solid", "Newt", "Toad")
.Or(Potion.ContainsIngredients("gas", "Spider", "Scorpion"));
foreach (var result in
from p in potions
where(predicate).Compile()(p)
select p)
{
Console.WriteLine(result.Name);
}
}
</code></pre>
| [
{
"answer_id": 66710,
"author": "Fake Jim",
"author_id": 6199,
"author_profile": "https://Stackoverflow.com/users/6199",
"pm_score": 3,
"selected": true,
"text": "private static bool IsIngredientPresent(IngredientBag i, string ingredientType, string ingredient)\n{\n return i != null &... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9825/"
] |
66,385 | <p>What is a recommended architecture for providing storage for a dynamic logical database schema?</p>
<p>To clarify: Where a system is required to provide storage for a model whose schema may be extended or altered by its users once in production, what are some good technologies, database models or storage engines that will allow this? </p>
<p>A few possibilities to illustrate:</p>
<ul>
<li>Creating/altering database objects via dynamically generated DML</li>
<li>Creating tables with large numbers of sparse physical columns and using only those required for the 'overlaid' logical schema</li>
<li>Creating a 'long, narrow' table that stores dynamic column values as rows that then need to be pivoted to create a 'short, wide' rowset containing all the values for a specific entity</li>
<li>Using a BigTable/SimpleDB PropertyBag type system</li>
</ul>
<p>Any answers based on real world experience would be greatly appreciated</p>
| [
{
"answer_id": 66458,
"author": "Daniel Spiewak",
"author_id": 9815,
"author_profile": "https://Stackoverflow.com/users/9815",
"pm_score": 2,
"selected": false,
"text": "CREATE TABLE data (\n id INTEGER NOT NULL AUTO_INCREMENT,\n key VARCHAR(255),\n data TEXT,\n\n PRIMARY KEY... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6199/"
] |
66,402 | <p>I need to calculate <code>Math.exp()</code> from java very frequently, is it possible to get a native version to run faster than <strong>java</strong>'s <code>Math.exp()</code>??</p>
<p>I tried just jni + C, but it's slower than just plain <strong>java</strong>.</p>
| [
{
"answer_id": 66439,
"author": "John Millikin",
"author_id": 3560,
"author_profile": "https://Stackoverflow.com/users/3560",
"pm_score": 3,
"selected": false,
"text": "Math.exp()"
},
{
"answer_id": 424985,
"author": "martinus",
"author_id": 48181,
"author_profile": "... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9774/"
] |
66,420 | <p>When using Google Chrome, I want to debug some JavaScript code. How can I do that?</p>
| [
{
"answer_id": 66431,
"author": "Omer van Kloeten",
"author_id": 4979,
"author_profile": "https://Stackoverflow.com/users/4979",
"pm_score": 9,
"selected": false,
"text": "debugger;\n"
},
{
"answer_id": 16038207,
"author": "anand",
"author_id": 635231,
"author_profile... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9587/"
] |
66,422 | <p>I need to rotate an image at 12 midnight every day from a group of 5-10 images. How can I go about doing this with JavaScript or jQuery or even PHP?</p>
| [
{
"answer_id": 66453,
"author": "UnkwnTech",
"author_id": 115,
"author_profile": "https://Stackoverflow.com/users/115",
"pm_score": 1,
"selected": false,
"text": "<?php\nswitch(date('w'))\n {\n case '1':\n //Monday\n break;\n case '2':\n //Tuesday:\n break;\n...\n}\n?>\n"
},
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9750/"
] |
66,423 | <p>I have a servlet that is used for many different actions, used in the <a href="http://java.sun.com/blueprints/patterns/FrontController.html" rel="noreferrer">Front Controller pattern</a>. Does anyone know if it is possible to tell if the data posted back to it is enctype="multipart/form-data"? I can't read the request parameters until I decide this, so I can't dispatch the request to the proper controller.</p>
<p>Any ideas?</p>
| [
{
"answer_id": 66481,
"author": "Loren Segal",
"author_id": 6436,
"author_profile": "https://Stackoverflow.com/users/6436",
"pm_score": 5,
"selected": true,
"text": "Content-type"
},
{
"answer_id": 66509,
"author": "Kyle Boon",
"author_id": 1486,
"author_profile": "ht... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4257/"
] |
66,438 | <p>I'm writing a mobile phone game using j2me. In this game, I am using multiple Canvas objects.
For example, the game menu is a Canvas object, and the actual game is a Canvas object too.
I've noticed that, on some devices, when I switch from one Canvas to another, e.g from the main menu to the game, the screen momentarily "flickers". I'm using my own double buffered Canvas.</p>
<p>Is there anyway to avoid this?</p>
| [
{
"answer_id": 66742,
"author": "Vivek",
"author_id": 7418,
"author_profile": "https://Stackoverflow.com/users/7418",
"pm_score": 0,
"selected": false,
"text": "public class MyScreen extends Canvas {\n private Image osb;\n private Graphics osg;\n //...\n\n public MyScreen()\n {... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9771/"
] |
66,446 | <p>I am trying to achieve better performance for my Java SWT application, and I just found out it is possible to use OpenGL in SWT. It seems there are more than one Java binding for OpenGL. Which one do you prefer?</p>
<p>Note that I have never used OpenGL before, and that the application needs to work on Windows, Linux and Mac OS X.</p>
| [
{
"answer_id": 68392,
"author": "shoosh",
"author_id": 9611,
"author_profile": "https://Stackoverflow.com/users/9611",
"pm_score": 3,
"selected": false,
"text": "import org.eclipse.swt.*;\nimport org.eclipse.swt.layout.*;\nimport org.eclipse.swt.widgets.*;\n\nimport javax.media.opengl.*;... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66446",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9843/"
] |
66,455 | <p>For most GUI's I've used, when a control that contains text gets the focus, the entire contents of the control are selected. This means if you just start typing, you completely replace the former contents.</p>
<p>Example: You have spin control that is initialized with the value zero. You tab to it and type "1" The value in the control is now 1.</p>
<p>With Swing, this doesn't happen. The text in the control is not selected and the carat appears at one end or another of the existing text. Continuing the above example:</p>
<p>With a Swing JSpinner, when you tab to the spin control, the carat is at the left. You type "1" and the value in the control is now 10.</p>
<p>This drives me, (and my users) up a wall, and I'd like to change it. Even more important, I'd like to change it globally so the new behavior applies to JTextField, JPasswordField, JFormattedTextField, JTextArea, JComboBox, JSpinner, and so on. The only way I have found to do this to add a FocusAdapter to each control and override the focusGained() method to Do The Right Thing[tm].</p>
<p>There's gotta be an easier, and less fragile way. Please?</p>
<p>EDIT: One additional piece of information for this particular case. The form I am working with was generated using Idea's form designer. That means I normally don't actually write the code to create the components. It is possible to tell Idea that you want to create them yourself, but that's a hassle I'd like to avoid.</p>
<p>Motto: All good programmers are basically lazy.</p>
| [
{
"answer_id": 66645,
"author": "rcreswick",
"author_id": 3446,
"author_profile": "https://Stackoverflow.com/users/3446",
"pm_score": 2,
"selected": false,
"text": "public class AutoClearingTextField extends JTextField {\n final FocusListener AUTO_CLEARING_LISTENER = new FocusListener(... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391806/"
] |
66,475 | <p>I've got a multiline textBox that I would like to have a label on the form displaying the current line and column position of, as Visual Studio does.</p>
<p>I know I can get the line # with GetLineFromCharIndex, but how can I get the column # on that line?</p>
<p>(I really want the Cursor Position on that line, not 'column', per se)</p>
| [
{
"answer_id": 66561,
"author": "Omer van Kloeten",
"author_id": 4979,
"author_profile": "https://Stackoverflow.com/users/4979",
"pm_score": 2,
"selected": false,
"text": "textBox.SelectionStart -\ntextBox.GetFirstCharIndexFromLine(textBox.GetLineFromCharIndex(textBox.SelectionStart))\n"... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9857/"
] |
66,505 | <p>I hit this problem all the time. Suppose I am making a command line interface (Java or C#, the problem is the same I think, I will show C# here).</p>
<ol>
<li>I define an interface ICommand</li>
<li>I create an abstract base class CommandBase which implements ICommand, to contain common code.</li>
<li>I create several implementation classes, each extending the base class (and by extension the interface).</li>
</ol>
<p>Now - suppose that the interface specifies that all commands implement the Name property and the Execute method...</p>
<p>For Name each of my instance classes must return a string that is the name of that command. That string ("HELP", "PRINT" etc) is static to the class concerned. What I would love to be able to do is define:</p>
<p>public abstract static const string Name;</p>
<p>However (sadly) you cannot define static members in an interface.</p>
<p>I have struggled with this issue for years now (pretty much any place I have a family of similar classes) and so will post my own 3 possible solutions below for your votes. However since none of them is ideal I am hoping someone will post a more elegant solution.</p>
<hr>
<p>UPDATE:</p>
<ol>
<li>I can't get the code formatting to work properly (Safari/Mac?). Apologies.</li>
<li><p>The example I am using is trivial. In real life there are sometimes dozens of implementing classes and several fields of this semi-static type (ie static to the implementing class).</p></li>
<li><p>I forgot to mention - ideally I want to be able to query this information statically:</p>
<p>string name = CommandHelp.Name;</p></li>
</ol>
<p>2 of my 3 proposed solutions require that the class be instantiated before you can find out this static information which is ugly.</p>
| [
{
"answer_id": 66546,
"author": "Ewan Makepeace",
"author_id": 9731,
"author_profile": "https://Stackoverflow.com/users/9731",
"pm_score": 0,
"selected": false,
"text": "public string Name \n{\n get {return COMMAND_NAME;}\n}\n"
},
{
"answer_id": 66557,
"author": "Thomas Dane... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9731/"
] |
66,518 | <p>I need to flip an image so that a character faces in the right direction. This needs to be done "on the fly' as they say. </p>
<p>The issue I am having is that with Gif images, I seem to lose the transparency. (The background goes white)</p>
<p>Below is the code: (Alternatively someone could send me to a good example)</p>
<pre><code>$img = imagecreatefromgif("./unit.gif");
$size_x = imagesx($img);
$size_y = imagesy($img);
$temp = imagecreatetruecolor($size_x, $size_y);
imagecolortransparent($img, imagecolorallocate($img, 0, 0, 0));
imagealphablending($img, false);
imagesavealpha($img, true);
$x = imagecopyresampled($temp, $img, 0, 0, ($size_x-1), 0, $size_x, $size_y, 0-$size_x, $size_y);
if ($x) {
$img = $temp;
}
else {
die("Unable to flip image");
}
header("Content-type: image/gif");
imagegif($img);
imagedestroy($img);
</code></pre>
| [
{
"answer_id": 66574,
"author": "Alex M",
"author_id": 9652,
"author_profile": "https://Stackoverflow.com/users/9652",
"pm_score": 1,
"selected": false,
"text": "mogrify -flop"
},
{
"answer_id": 66586,
"author": "Jim",
"author_id": 8427,
"author_profile": "https://Sta... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2490/"
] |
66,528 | <p>I have the following Java 6 code:</p>
<pre><code> Query q = em.createNativeQuery(
"select T.* " +
"from Trip T join Itinerary I on (T.itinerary_id=I.id) " +
"where I.launchDate between :start and :end " +
"or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between :start and :end",
"TripResults" );
q.setParameter( "start", range.getStart(), TemporalType.DATE );
q.setParameter( "end", range.getEnd(), TemporalType.DATE );
@SqlResultSetMapping( name="TripResults",
entities={
@EntityResult( entityClass=TripEntity.class ),
@EntityResult( entityClass=CommercialTripEntity.class )
}
)
</code></pre>
<p>I receive a syntax error on the last closing right parenthesis. Eclipse gives: "Insert EnumBody to complete block statement" and "Insert enum Identifier to complete EnumHeaderName". Similar syntax error from javac.</p>
<p>What am I doing wrong?</p>
| [
{
"answer_id": 66697,
"author": "Jim Kiley",
"author_id": 7178,
"author_profile": "https://Stackoverflow.com/users/7178",
"pm_score": 2,
"selected": true,
"text": "@SqlResultSetMapping( name=\"TripResults\",\n entities={\n @EntityResult( entityClass=TripEntity.class ),\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
66,540 | <p>I know that garbage collection is automated in Java. But I understood that if you call <code>System.gc()</code> in your code that the JVM may or may not decide to perform garbage collection at that point. How does this work precisely? On what basis/parameters exactly does the JVM decide to do (or not do) a GC when it sees <code>System.gc()</code>?</p>
<p>Are there any examples in which case it's a good idea to put this in your code?</p>
| [
{
"answer_id": 66582,
"author": "Patrick",
"author_id": 429,
"author_profile": "https://Stackoverflow.com/users/429",
"pm_score": 4,
"selected": false,
"text": "System.gc()"
},
{
"answer_id": 66601,
"author": "DustinB",
"author_id": 7888,
"author_profile": "https://St... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
66,542 | <p>How do I get started?</p>
| [
{
"answer_id": 1685449,
"author": "Lauri Oherd",
"author_id": 9615,
"author_profile": "https://Stackoverflow.com/users/9615",
"pm_score": 4,
"selected": true,
"text": "\n(ns example\n (:require [clojure.contrib.sql :as sql])\n (:import [java.sql Types]))\n\n(def devdb {:classname \"or... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9615/"
] |
66,544 | <p>I want to write a small utility to call arbitrary functions from a C shared library. User should be able to list all the exported functions similar to what objdump or nm does. I checked these utilities' source but they are intimidating. Couldn't find enough information on google, if dl library has this functionality either.</p>
<p>(Clarification edit: I don't want to just call a function which is known beforehand. I will appreciate an example fragment along your answer.)</p>
| [
{
"answer_id": 68010,
"author": "gnkdl_gansklgna",
"author_id": 10470,
"author_profile": "https://Stackoverflow.com/users/10470",
"pm_score": -1,
"selected": false,
"text": "ld.so"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7988/"
] |
66,606 | <p>I'm trying to find <a href="http://httpd.apache.org/docs/2.0/programs/ab.html" rel="noreferrer">ab - Apache HTTP server benchmarking tool</a> for Ubuntu, I'm hoping there's a package I can install for it. I decided I need to do some simple load testing on my applications.</p>
| [
{
"answer_id": 66617,
"author": "Brian Phillips",
"author_id": 7230,
"author_profile": "https://Stackoverflow.com/users/7230",
"pm_score": 8,
"selected": true,
"text": "% sudo apt-get install apache2-utils"
},
{
"answer_id": 1199848,
"author": "0x89",
"author_id": 147058,... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/339/"
] |
66,610 | <p>For a particular project I have, no server side code is allowed. How can I create the web site in php (with includes, conditionals, etc) and then have that converted into a static html site that I can give to the client?</p>
<p>Update: Thanks to everyone who suggested wget. That's what I used. I should have specified that I was on a PC, so I grabbed the windows version from here: <a href="http://gnuwin32.sourceforge.net/packages/wget.htm" rel="noreferrer">http://gnuwin32.sourceforge.net/packages/wget.htm</a>.</p>
| [
{
"answer_id": 66652,
"author": "millenomi",
"author_id": 6061,
"author_profile": "https://Stackoverflow.com/users/6061",
"pm_score": 0,
"selected": false,
"text": "find site_folder -name \\*.static.php -print -exec Staticize {} \\;\n"
},
{
"answer_id": 66667,
"author": "Jake... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3741/"
] |
66,622 | <p>I need to enumerate though generic IList<> of objects. The contents of the list may change, as in being added or removed by other threads, and this will kill my enumeration with a "Collection was modified; enumeration operation may not execute."</p>
<p>What is a good way of doing threadsafe foreach on a IList<>? prefferably without cloning the entire list. It is not possible to clone the actual objects referenced by the list.</p>
| [
{
"answer_id": 66653,
"author": "Jason Punyon",
"author_id": 6212,
"author_profile": "https://Stackoverflow.com/users/6212",
"pm_score": 2,
"selected": false,
"text": "\nlock(collection){\n foreach (object o in collection){\n ...\n }\n}\n"
},
{
"answer_id": 66689,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3263/"
] |
66,636 | <p>I would like to make a child class that has a method of the parent class where the method is a 'classmethod' in the child class but <strong>not</strong> in the parent class.</p>
<p>Essentially, I am trying to accomplish the following:</p>
<pre><code>class foo(Object):
def meth1(self, val):
self.value = val
class bar(foo):
meth1 = classmethod(foo.meth1)
</code></pre>
| [
{
"answer_id": 66847,
"author": "Brian",
"author_id": 9493,
"author_profile": "https://Stackoverflow.com/users/9493",
"pm_score": 3,
"selected": true,
"text": "def convert_to_classmethod(method):\n return classmethod(method.im_func)\n\nclass bar(foo):\n meth1 = convert_to_classmeth... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9940/"
] |
66,643 | <p>Is there a way to detect, from within the finally clause, that an exception is in the process of being thrown?</p>
<p>See the example below:</p>
<pre><code>
try {
// code that may or may not throw an exception
} finally {
SomeCleanupFunctionThatThrows();
// if currently executing an exception, exit the program,
// otherwise just let the exception thrown by the function
// above propagate
}
</code></pre>
<p>or is ignoring one of the exceptions the only thing you can do?</p>
<p>In C++ it doesn't even let you ignore one of the exceptions and just calls terminate(). Most other languages use the same rules as java.</p>
| [
{
"answer_id": 66664,
"author": "zxcv",
"author_id": 9628,
"author_profile": "https://Stackoverflow.com/users/9628",
"pm_score": -1,
"selected": false,
"text": "try {\n // code that may or may not throw an exception\n} catch {\n// catch block must exist.\nfinally {\n SomeCleanupFun... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5963/"
] |
66,649 | <p>I am looking for some JavaScript plugin (preferably jQuery) to be able to scroll through an image, in the same way that <a href="http://maps.google.com" rel="noreferrer">Google Maps</a> works.</p>
<p>I can make the image draggable but then I see the whole image while dragging even if the parent div is <code>overflow:hidden</code>.</p>
<p>Any help would be greatly appreciated!</p>
| [
{
"answer_id": 96641,
"author": "NickFitz",
"author_id": 16782,
"author_profile": "https://Stackoverflow.com/users/16782",
"pm_score": 0,
"selected": false,
"text": "clip: rect(5px, 40px, 45px, 5px);\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5838/"
] |
66,671 | <p>I've gotten comfy with SVN, and now I need a way to deploy my code to staging or live servers more easily. I'd also like some method for putting build info in the footer of this site to aid in testing. Site is PHP/MySQL.</p>
| [
{
"answer_id": 66717,
"author": "Staale",
"author_id": 3355,
"author_profile": "https://Stackoverflow.com/users/3355",
"pm_score": 2,
"selected": false,
"text": "svn propset svn:keywords \"Rev\" file.txt\n"
},
{
"answer_id": 66741,
"author": "Loren Segal",
"author_id": 64... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7853/"
] |
66,677 | <p>I'm looking for a dead simple mailing list (unix friendly). Robustness, fine-grained configurability, "enterprise-readiness" (whatever that means) are not requirements. I just need to set up a tiny mailing list for a few friends. Rather than hack something up myself, I was wondering if anybody knows of anything already out there with a similar goal? </p>
<p>I should note right now that I <strong>don't</strong> want an externally hosted mailing list -- it needs to be software I can install and run on my server. I know of many places I can host a mailing list at (Google/Yahoo groups), but it would be nice to keep the data local.</p>
| [
{
"answer_id": 66780,
"author": "Michael Ridley",
"author_id": 4838,
"author_profile": "https://Stackoverflow.com/users/4838",
"pm_score": 4,
"selected": true,
"text": "/etc/aliases"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6436/"
] |
66,720 | <p>I'm looking for a tool that will render a RDF graph in a reasonably useful graphic format. The primary purpose of the graphic format being inclusion into a PowerPoint slide or printing on a large plotter for management review.</p>
<p>I am currently using TopBraid Composer which does a reasonably well at visualizing a single entity but doesn't seem to have a clear way of visualizing the entire graph (as a whole).</p>
<p>Anyone know of any good solutions to this problem?</p>
<p><img src="https://i.stack.imgur.com/2C2Q6.jpg" alt="TopBraid Composer Graph view screenshot"></p>
| [
{
"answer_id": 44326441,
"author": "dr0i",
"author_id": 1579915,
"author_profile": "https://Stackoverflow.com/users/1579915",
"pm_score": 2,
"selected": false,
"text": "$ rapper --input ntriples $fname.nt --output dot > $fname.dot\n$ dot -Tpng $fname.dot > $fname.png"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3957/"
] |
66,727 | <p>I have a bunch of legacy documents that are HTML-like. As in, they look like HTML, but have additional made up tags that aren't a part of HTML</p>
<pre><code><strong>This is an example of a <pseud-template>fake tag</pseud-template></strong>
</code></pre>
<p>I need to parse these files. PHP is the only only tool available. The documents don't come close to being well formed XML. </p>
<p>My original thought was to use the loadHTML methods on PHPs DOMDocument. However, these methods choke on the make up HTML tags, and will refuse to parse the string/file.</p>
<pre><code>$oDom = new DomDocument();
$oDom->loadHTML("<strong>This is an example of a <pseud-template>fake tag</pseud-template></strong>");
//gives us
DOMDocument::loadHTML() [function.loadHTML]: Tag pseud-template invalid in Entity, line: 1 occured in ....
</code></pre>
<p>The only solution I've been able to come up with is to pre-process the files with string replacement functions that will remove the invalid tags and replace them with a valid HTML tag (maybe a span with an id of the tag name).</p>
<p>Is there a more elegant solution? A way to let DOMDocument know about additional tags to consider as valid? Is there a different, robust HTML parsing class/object out there for PHP?</p>
<p>(if it's not obvious, I don't consider regular expressions a valid solution here)</p>
<p><strong>Update</strong>: The information in the fake tags is part of the goal here, so something like Tidy isn't an option. Also, I'm after something that does the some level, if not all, of well-formedness cleanup for me, which is why I was looking the DomDocument's loadHTML method in the first place.</p>
| [
{
"answer_id": 67115,
"author": "nickf",
"author_id": 9021,
"author_profile": "https://Stackoverflow.com/users/9021",
"pm_score": 1,
"selected": false,
"text": "DOMDocument->load()"
},
{
"answer_id": 69383,
"author": "nickf",
"author_id": 9021,
"author_profile": "http... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4668/"
] |
66,730 | <p>I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.</p>
| [
{
"answer_id": 66883,
"author": "Sebastian Rittau",
"author_id": 7779,
"author_profile": "https://Stackoverflow.com/users/7779",
"pm_score": 2,
"selected": false,
"text": "import gobject\n\nclass MyGObjectClass(gobject.GObject):\n ...\n\ngobject.signal_new(\"signal-name\", MyGObjectCl... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8453/"
] |
66,743 | <p>Are there any free (non-GPL) libraries for .NET that provide IMAP4 server side functionality?</p>
<p>E.g. handles the socket level and message handshaking so that an IMAP4 client (such as outlook) can retrieve, read, edit and/or delete messages. </p>
<p>I am not trying to connect to an IMAP4 server, I'd like the assistance to implement one.</p>
| [
{
"answer_id": 299845,
"author": "Martin Vobr",
"author_id": 16132,
"author_profile": "https://Stackoverflow.com/users/16132",
"pm_score": 0,
"selected": false,
"text": "* SMTP/POP3/IMAP4/WebMail\n* IP access filtering\n* User mailbox size limit\n* Supports XML or MSSQL databases\n* Nice... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7093/"
] |
66,750 | <p>Here is a quick test program:</p>
<pre><code> public static void main( String[] args )
{
Date date = Calendar.getInstance().getTime();
System.out.println("Months:");
printDate( "MMMM", "en", date );
printDate( "MMMM", "es", date );
printDate( "MMMM", "fr", date );
printDate( "MMMM", "de", date );
System.out.println("Days:");
printDate( "EEEE", "en", date );
printDate( "EEEE", "es", date );
printDate( "EEEE", "fr", date );
printDate( "EEEE", "de", date );
}
public static void printDate( String format, String locale, Date date )
{
System.out.println( locale + ": " + (new SimpleDateFormat( format, new Locale( locale ) )).format( date ) );
}
</code></pre>
<p>The output is:</p>
<p><code>
Months:
en: September
es: septiembre
fr: septembre
de: September
Days:
en: Monday
es: lunes
fr: lundi
de: Montag</code></p>
<p>How can I control the capitalization of the names. For some reason the Spanish and French always seem to return names that start with a lowercase letter.</p>
| [
{
"answer_id": 45249515,
"author": "Basil Bourque",
"author_id": 642706,
"author_profile": "https://Stackoverflow.com/users/642706",
"pm_score": 3,
"selected": false,
"text": "getDisplayName"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9661/"
] |
66,770 | <p>Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to speed up Rails' initial load or single out the part of my Rails app I need (e.g. ActiveRecord stuff only) so it doesn't load absolutely everything to run a few tests?</p>
| [
{
"answer_id": 67678,
"author": "Scott Matthewman",
"author_id": 10267,
"author_profile": "https://Stackoverflow.com/users/10267",
"pm_score": 6,
"selected": true,
"text": "script/spec"
},
{
"answer_id": 68538,
"author": "Pelle",
"author_id": 10724,
"author_profile": ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8344/"
] |
66,773 | <p>How can i add a line break to the text area in a html page?
i use VB.net for server side coding.</p>
| [
{
"answer_id": 66815,
"author": "Loren Segal",
"author_id": 6436,
"author_profile": "https://Stackoverflow.com/users/6436",
"pm_score": 5,
"selected": false,
"text": "<textarea>Hello\n\n\nBybye</textarea>\n"
},
{
"answer_id": 66826,
"author": "Forgotten Semicolon",
"autho... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/747/"
] |
66,800 | <p>I've been using make and makefiles for many many years, and although the concept
is sound, the implementation has something to be desired.</p>
<p>Has anyone found any good alternatives to make that don't overcomplicate
the problem?</p>
| [
{
"answer_id": 15550721,
"author": "Hotschke",
"author_id": 1057593,
"author_profile": "https://Stackoverflow.com/users/1057593",
"pm_score": 3,
"selected": false,
"text": "ninja"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9593/"
] |
66,810 | <p>Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a "complete" new custom style ... maybe someone can give me a hint.</p>
<p>We think of using Qt 4.3 (or even newer) ...</p>
| [
{
"answer_id": 499919,
"author": "David Boddie",
"author_id": 61047,
"author_profile": "https://Stackoverflow.com/users/61047",
"pm_score": 0,
"selected": false,
"text": " http://doc.qt.digia.com/4.4/stylesheet.html\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2012356/"
] |
66,819 | <p>Are there any good solutions to represent a parameterized enum in <code>C# 3.0</code>? I am looking for something like <a href="http://www.ocaml.org" rel="nofollow noreferrer">OCaml</a> or <a href="http://www.haxe.org" rel="nofollow noreferrer">Haxe</a> has. I can only think of class hierarchy with a simple enum field for easy switching for now, maybe there are better ideas?</p>
<p>See Ocaml example below in one of the replies, a Haxe code follows:</p>
<pre><code>enum Tree {
Node(left: Tree, right: Tree);
Leaf(val: Int);
}
</code></pre>
| [
{
"answer_id": 67321,
"author": "Orion Edwards",
"author_id": 234,
"author_profile": "https://Stackoverflow.com/users/234",
"pm_score": 4,
"selected": true,
"text": "enum Color{ Red, Green, Yellow, Blue };\nColor c = Color.Red;\n"
},
{
"answer_id": 68959,
"author": "user10834... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9777/"
] |
66,837 | <p>Are <strong>CDATA</strong> tags ever necessary in script tags and if so when?</p>
<p>In other words, when and where is this:</p>
<pre><code><script type="text/javascript">
//<![CDATA[
...code...
//]]>
</script>
</code></pre>
<p>preferable to this:</p>
<pre><code><script type="text/javascript">
...code...
</script>
</code></pre>
| [
{
"answer_id": 66865,
"author": "Michael Ridley",
"author_id": 4838,
"author_profile": "https://Stackoverflow.com/users/4838",
"pm_score": 10,
"selected": true,
"text": "i<10"
},
{
"answer_id": 66900,
"author": "Shadow2531",
"author_id": 1697,
"author_profile": "https... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/208/"
] |
66,870 | <p>I want a user-privileged (not root) process to launch new processes as user <code>nobody</code>. I've tried a straight call to <code>setuid</code> that fails with -1 <code>EPERM</code> on <code>Ubuntu 8.04</code>:</p>
<pre><code>#include <sys/types.h>
#include <unistd.h>
int main() {
setuid(65534);
while (1);
return 0;
}
</code></pre>
<p>How should I do this instead?</p>
| [
{
"answer_id": 66937,
"author": "squadette",
"author_id": 7754,
"author_profile": "https://Stackoverflow.com/users/7754",
"pm_score": 5,
"selected": true,
"text": "/etc/sudoers"
},
{
"answer_id": 67046,
"author": "Allan Wind",
"author_id": 9706,
"author_profile": "htt... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9947/"
] |
66,875 | <p>We have a case where clients seem to be eternally caching versions of applets. We're making use of the <code><param name="cache_version"></code> tag correctly within our <code><object></code> tag, or so we think. We went from a version string of <code>7.1.0.40</code> to <code>7.1.0.42</code> and this triggered a download for only about half of our clients.</p>
<p>It doesn't seem to matter which version of the JRE the client is running. We've seen people have this problem on 1.4, 1.5 and 1.6.</p>
<p>Does anybody have experience with explicit cache versions? Does it work more reliably (ignoring speed) to instead rely on the <code>cache_archive</code>'s "Last-Modified" and/or "Content-Length" values (as per <a href="http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/applet_caching.html" rel="noreferrer">Sun's Site</a>)?</p>
<p>FYI, object block looks like this:</p>
<pre><code><object>
<param name="ARCHIVE" value="foo.jar">
<param name="CODE" value="com.foo.class">
<param name="CODEBASE" value=".">
<param name="cache_archive" value="foo.jar">
<param name="cache_version" value="7.1.0.40">
<param name="NAME" value="FooApplet">
<param name="type" value="application/x-java-applet;jpi-version=1.4.2_13">
<param name="scriptable" value="true">
<param name="progressbar" value="true"/>
<param name="boxmessage" value="Loading Web Worksheet Applet..."/>
</object>
</code></pre>
| [
{
"answer_id": 15113420,
"author": "Ilya",
"author_id": 1143825,
"author_profile": "https://Stackoverflow.com/users/1143825",
"pm_score": 2,
"selected": false,
"text": "Java Control Panel"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
66,880 | <p>After reading <a href="https://stackoverflow.com/questions/63668/confessions-of-your-worst-wtf-moment-what-not-to-do#63730">this answer</a>, I wonder if there's a way to get a "testing" credit card number. One that you can experiment with but that doesn't actually charge anything.</p>
| [
{
"answer_id": 66988,
"author": "Mike",
"author_id": 1115144,
"author_profile": "https://Stackoverflow.com/users/1115144",
"pm_score": 6,
"selected": true,
"text": "MasterCard: 5431111111111111\nAmex: 341111111111111\nDiscover: 6011601160116611\nAmerican Express (15 digits) 378282246310... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5314/"
] |
66,882 | <p>Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?</p>
| [
{
"answer_id": 66908,
"author": "Daniel Spiewak",
"author_id": 9815,
"author_profile": "https://Stackoverflow.com/users/9815",
"pm_score": 1,
"selected": false,
"text": "int mask = 1 << 31;\n(a & mask) ^ (b & mask) < 0;\n"
},
{
"answer_id": 66928,
"author": "Patrick",
"au... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
66,885 | <p>What is current state of the art for enabling OpenID login in Ruby on Rails applications? This is a community wiki with up-to-date answers to this question.</p>
<h2>Authlogic</h2>
<p>The most advanced authentication solution seems to be <a href="http://github.com/binarylogic/authlogic" rel="noreferrer">Authlogic</a>. It supports OpenID with <a href="http://github.com/binarylogic/authlogic_openid" rel="noreferrer">Authlogic OpenID plugin</a>. It supports Rails 4 and 3. Rails 2 is supported in the rails2 branch.</p>
<p>You may want to watch <a href="http://railscasts.com/episodes/170-openid-with-authlogic" rel="noreferrer">"OpenID with Authlogic" railscast</a> (and the <a href="http://railscasts.com/episodes/160-authlogic" rel="noreferrer">"Authlogic" railscast</a>).</p>
<p>There is a sample application called <a href="http://github.com/shripadk/authlogic_openid_selector_example" rel="noreferrer">Authlogic OpenID Selector Example</a>.</p>
<h2>Devise</h2>
<p>Devise is flexible authentication framework for Rails. It supports OpenID with <a href="https://github.com/nbudin/devise_openid_authenticatable" rel="noreferrer"><code>devise_openid_authenticatable</code></a>.</p>
<h2>restful_authentication</h2>
<p>Another authentication library of choice is <a href="http://github.com/technoweenie/restful-authentication" rel="noreferrer"><code>restful_authentication</code></a> Rails plugin. Seems like you also need to install <a href="http://github.com/rails/open_id_authentication" rel="noreferrer"><code>open_id_authentication</code></a> plugin.</p>
<p>You may want to watch (old, circa 2007) <a href="http://railscasts.com/episodes/68-openid-authentication" rel="noreferrer">"OpenID Authentication" railscast</a>.</p>
<h2>Ruby OpenID</h2>
<p>Raw support for OpenID protocol is handled by <a href="http://github.com/openid/ruby-openid" rel="noreferrer">Ruby OpenID</a> library.</p>
| [
{
"answer_id": 120254,
"author": "tardate",
"author_id": 6329,
"author_profile": "https://Stackoverflow.com/users/6329",
"pm_score": 2,
"selected": false,
"text": "gem install ruby-openid\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7754/"
] |
66,893 | <p>I was looking for a tree or graph data structure in C#, but I guess there isn't one provided. <a href="http://msdn.microsoft.com/en-us/library/ms379574.aspx" rel="noreferrer">An Extensive Examination of Data Structures Using C# 2.0</a> a bit about why. Is there a convenient library which is commonly used to provide this functionality? Perhaps through a <a href="https://en.wikipedia.org/wiki/Strategy_pattern" rel="noreferrer">strategy pattern</a> to solve the issues presented in the article.</p>
<p>I feel a bit silly implementing my own tree, just as I would implementing my own ArrayList.</p>
<p>I just want a generic tree which can be unbalanced. Think of a directory tree. <a href="https://itu.dk/research/c5/" rel="noreferrer">C5</a> looks nifty, but their tree structures seem to be implemented as balanced red-black trees better suited to search than representing a hierarchy of nodes.</p>
| [
{
"answer_id": 2012855,
"author": "Aaron Gage",
"author_id": 226861,
"author_profile": "https://Stackoverflow.com/users/226861",
"pm_score": 7,
"selected": false,
"text": "delegate void TreeVisitor<T>(T nodeData);\n\nclass NTree<T>\n{\n private T data;\n private LinkedList<NTree<T>... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361/"
] |
66,912 | <p>In a JSP page, I created a <code><h:form enctype="multipart/form-data"></code> with some elements: <code><t:inputText></code>, <code><t:inputDate></code>, etc. Also, I added some <code><t:message for="someElement"></code> And I wanted to allow the user upload several files (one at a time) within the form (using <code><t:inputFileUpload></code> ) At this point my code works fine.</p>
<hr>
<p>The headache comes when I try to put the form inside a <code><t:panelTabbedPane serverSideTabSwitch="false"></code> (and thus of course, inside a <code><t:panelTab></code> ) </p>
<p>I copied the structure shown in the source code for TabbedPane example from <a href="http://www.irian.at/myfacesexamples/tabbedPane.jsf" rel="nofollow noreferrer">Tomahawk's examples</a>, by using the <code><f:subview></code> tag and putting the panelTab tag inside a new jsp page (using <code><jsp:include page="somePage.jsp"></code> directive)</p>
<p>First at all, the <code><t:inputFileUpload></code> fails to load the file at the value assigned in the Managed Bean UploadedFile attribute <code>#{myBean.upFile}</code></p>
<p>Then, <a href="http://markmail.org/message/b4nht4f6xb74noxp" rel="nofollow noreferrer" title="That has no answer when I readed it">googling for a clue</a>, I knew that <code><t:panelTabbedPane></code> generates a form called "autoform", so I was getting nested forms. Ok, I fixed that creating the <code><h:form></code> out of the <code><t:panelTabbedPane></code> and eureka! file input worked again! (the autoform doesn't generate) </p>
<p>But, oh surprise! oh terrible Murphy law! All my <code><h:message></code> begins to fail. The Eclipse console's output show me that all <code><t:message></code> are looking for nonexistents elements ID's (who have their ID's in part equals to they are looking for, but at the end of the ID's their names change)</p>
<p>At this point, I put a <code><t:mesagges></code> tag (note the "s" at the end) to show me all validation errors at once at the beginning of the Panel, and it works fine. So, validation errors exists and they show properly at the beginning of the Panel.</p>
<p>All validation error messages generated in this page are the JSF built-in validation messages. The backing bean at this moment doesn't have any validators defined.</p>
<h3>¿How can I get the <code><t:message for="xyz"></code> working properly?</h3>
<hr>
<p>I'm using Tomahawk-1.1.6 with myFaces-impl-1.2.3 in a eclipse Ganymede project with Geronimo as Application Server (Geronimo gives me the myFaces jar implementation while I put the tomahawk jar in the WEB-INF/lib folder of application) </p>
<hr>
<h2>"SOLVED": This problem is an issue reported to myFaces forum.</h2>
<p>Thanks to Kyle Renfro for the soon response and information. (Good job Kyle!)
<a href="https://issues.apache.org/jira/browse/MYFACES-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567158#action_12567158" rel="nofollow noreferrer">See the issue</a></p>
<hr>
<p><strong>EDIT 1</strong></p>
<p>1.- Thanks to Kyle Renfro for his soon response. The forceID attribute used inside the input element doesn't works at first time, but doing some very tricky tweaks I could make the <code><t:message for="xyz"></code> tags work.</p>
<p>What I did was:<br>
1. Having my tag <code><inputText id="name" forceId="true" required="true"></code> The <code><t:message></code> doesn't work.<br>
2. Then, after looking the error messages on eclipse console, I renamed my "id" attribute to this: <inputText id="<strong>namej_id_1</strong>" forceId="true" required="true"><br>
3. Then the <code><t:message></code> worked!! but after pressing the "Submit" button of the form the second time. ¡The second time! (I suspect that something is going on at the JSF lifecycle)<br>
4. This implies that the user have to press 2 times the submit button to get the error messages on the page.<br>
5. And using the "j_id_1" phrase at the end of IDs is very weird. </p>
<hr>
<p><strong>EDIT 2</strong></p>
<p>Ok, here comes the code, hope it not be annoying.</p>
<p>1.- <strong>mainPage.jsp</strong> (here is the <code><t:panelTabbedPane></code> and <code><f:subview></code> tags) </p>
<pre><code><%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<html>
<body>
<f:view>
<h:form enctype="multipart/form-data">
<t:panelTabbedPane serverSideTabSwitch="false" >
<f:subview id="subview_tab_detail">
<jsp:include page="detail.jsp"/>
</f:subview>
</t:panelTabbedPane>
</h:form>
</f:view>
</body>
</html>
</code></pre>
<p><br />
2.- <strong>detail.jsp</strong> (here is the <code><t:panelTab></code> tag) </p>
<pre><code><%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<t:panelTab label="TAB_1">
<t:panelGrid columns="3">
<f:facet name="header">
<h:outputText value="CREATING A TICKET" />
</f:facet>
<t:outputLabel for="ticket_id" value="TICKET ID" />
<t:inputText id="ticket_id" value="#{myBean.ticketId}" required="true" />
<t:message for="ticket_id" />
<t:outputLabel for="description" value="DESCRIPTION" />
<t:inputText id="description" value="#{myBean.ticketDescription}" required="true" />
<t:message for="description" />
<t:outputLabel for="attachment" value="ATTACHMENTS" />
<t:panelGroup>
<!-- This is for listing multiple file uploads -->
<!-- The panelGrid binding make attachment list grow as the user inputs several files (one at a time) -->
<t:panelGrid columns="3" binding="#{myBean.panelUpload}" />
<t:inputFileUpload id="attachment" value="#{myBean.upFile}" storage="file" />
<t:commandButton value="ADD FILE" action="#{myBean.upload}" />
</t:panelGroup>
<t:message for="attachment" />
<t:commandButton action="#{myBean.create}" value="CREATE TICKET" />
</t:panelGrid>
</t:panelTab>
</code></pre>
<hr>
<p><strong>EDIT 3</strong></p>
<p>On response to Kyle Renfro follow-up:</p>
<blockquote>
<p>Kyle says:</p>
<blockquote>
<p>"At the first view of the page, if you press the "CREATE TICKET" button with nothing in any of the inputTexts and no files uploaded, do the message tags work for the inputTexts? (ie. required = true) I'm just curious if the messages for the inputTexts are working but the message for the inputFileUpload is not." </p>
</blockquote>
</blockquote>
<p>Here is the behavior found:<br>
1.- There is no validation error messages shown at all (the message tags don't work) Even when I try to test only one validation error message (for example, testing the message for the first input text) none of them shows up.<br>
2.- The eclipse console shows me these internal errors: </p>
<pre><code>ERROR [HtmlMessageRendererBase] Could not render Message. Unable to find component 'ticket_id' (calling findComponent on component 'j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_5j_id_1'). If the provided id was correct, wrap the message and its component into an h:panelGroup or h:panelGrid.
ERROR [HtmlMessageRendererBase] Could not render Message. Unable to find component 'description' (calling findComponent on component 'j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_8j_id_1'). If the provided id was correct, wrap the message and its component into an h:panelGroup or h:panelGrid.
ERROR [HtmlMessageRendererBase] Could not render Message. Unable to find component 'attachment' (calling findComponent on component 'j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_14j_id_1'). If the provided id was correct, wrap the message and its component into an h:panelGroup or h:panelGrid.
</code></pre>
<p>Here is when I saw the <code>"j_id_1"</code> word at the generated IDs, for example, for the id "ticket_id": </p>
<pre><code>j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_5j_id_1
</code></pre>
<p>And, viewing the resulting HTML generated page, I saw that the IDs names are like this (whitout using "ForceId" atribute): </p>
<pre><code><input id="j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:ticket_idj_id_1" name="j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:ticket_idj_id_1">
</code></pre>
<hr>
| [
{
"answer_id": 72243,
"author": "Kyle Renfro",
"author_id": 8187,
"author_profile": "https://Stackoverflow.com/users/8187",
"pm_score": 1,
"selected": false,
"text": "<t:outputText id=\"xyz\" forceId=\"true\" value=\"#{mybean.stuff}\"/>\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/66912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9818/"
] |
66,919 | <p>While <kbd>Ctrl</kbd><kbd>X</kbd> works fine in vim under windows, <kbd>Ctrl</kbd><kbd>A</kbd> selects all (duh).</p>
<p>Is there a way to increment a number with a keystroke under windows?</p>
| [
{
"answer_id": 84055,
"author": "TMealy",
"author_id": 15954,
"author_profile": "https://Stackoverflow.com/users/15954",
"pm_score": 3,
"selected": false,
"text": "\" CTRL-A is Select all\nnoremap <C-A> gggH<C-O>G\ninoremap <C-A> <C-O>gg<C-O>gH<C-O>G\ncnoremap <C-A> <C-C>gggH<C-O>G\nonor... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6984/"
] |
66,921 | <p>Short version: I want to trigger the Form_Load() event without making the form visible. This doesn't work because Show() ignores the current value of the Visible property:</p>
<pre><code>tasksForm.Visible = false;
tasksForm.Show();
</code></pre>
<p>Long version: I have a WinForms application with two forms: main and tasks. The main form is always displayed. The user can either click a button to open the tasks form, or click some buttons that just run a task directly without opening the tasks form.</p>
<p>When a user asks to run a task directly, I'd like to just call some public methods on the tasks form without showing it. Unfortunately, the task logic depends on stuff that happens in the Form_Load() event. The only way I can find to trigger Form_Load() is to call Show(). The best I've been able to do is to show the form in the minimized state:</p>
<pre><code>tasksForm.WindowState = FormWindowState.Minimized;
tasksForm.Show();
</code></pre>
<p>I suppose the cleanest solution would be to pull the tasks logic out of the tasks form and into a controller class. Then I can use that class from the main form and from the tasks form, and only load the tasks form when I need it visible for the user. However, if it's an easy thing to load the form without displaying it, that would be a smaller change.</p>
| [
{
"answer_id": 66991,
"author": "McKenzieG1",
"author_id": 3776,
"author_profile": "https://Stackoverflow.com/users/3776",
"pm_score": 0,
"selected": false,
"text": "Load"
},
{
"answer_id": 67592,
"author": "configurator",
"author_id": 9536,
"author_profile": "https:/... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4794/"
] |
66,923 | <p>So you have a String that is retrieved from an admin web UI (so it is definitely a String). How can you find out whether this string is an IP address or a hostname in Java?</p>
<p>Update: I think I didn't make myself clear, I was more asking if there is anything in the Java SDK that I can use to distinguish between IPs and hostnames? Sorry for the confusion and thanks for everybody who took/will take the time to answer this.</p>
| [
{
"answer_id": 66944,
"author": "Sam",
"author_id": 9406,
"author_profile": "https://Stackoverflow.com/users/9406",
"pm_score": 5,
"selected": true,
"text": "\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10059/"
] |
66,934 | <p>We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable reports.
We can do this if we add textbox objects, and set the print object setting to false. (If you have another way, please direct me)</p>
<p>The code to add a textbox is:</p>
<pre><code>ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 145.5, 227.25, 304.5, 21#)
</code></pre>
<p>but the positioning is in points. We need a way to place it over a specific cell, and size it with the cell. How can we find out where to put it when we just know which cell to put it over?</p>
| [
{
"answer_id": 67740,
"author": "dreamlax",
"author_id": 10320,
"author_profile": "https://Stackoverflow.com/users/10320",
"pm_score": 4,
"selected": true,
"text": "With ActiveSheet\n .Shapes.AddTextbox msoTextOrientationHorizontal, .Cells(3,2).Left, .Cells(3,2).Top, .Cells(3,2).Width, ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
66,964 | <p>For example:</p>
<blockquote>
<p>This is main body of my content. I have a
footnote link for this line [1]. Then, I have some more
content. Some of it is interesting and it
has some footnotes as well [2].</p>
<p>[1] Here is my first footnote.</p>
<p>[2] Another footnote.</p>
</blockquote>
<p>So, if I click on the "[1]" link it directs the web page to the first footnote reference and so on. How exactly do I accomplish this in HTML?</p>
| [
{
"answer_id": 66983,
"author": "Peter Boughton",
"author_id": 9360,
"author_profile": "https://Stackoverflow.com/users/9360",
"pm_score": 7,
"selected": true,
"text": "#"
},
{
"answer_id": 66990,
"author": "Paul Dixon",
"author_id": 6521,
"author_profile": "https://S... | 2008/09/15 | [
"https://Stackoverflow.com/questions/66964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872/"
] |
67,021 | <p>I'm coding a framework along with a project which uses this framework. The project is a Bazaar repository, with the framework in a subfolder below the project.</p>
<p>I want to give the framework a Bazaar repository of its own. How do I do it?</p>
| [
{
"answer_id": 67126,
"author": "jamuraa",
"author_id": 9805,
"author_profile": "https://Stackoverflow.com/users/9805",
"pm_score": 0,
"selected": false,
"text": "branch project:\n.. other files.. \nframework/a.file\nframework/b.file\nframework/c.file\n\nbranch framework: \na.file\nb.fil... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6681/"
] |
67,029 | <p>I noticed that Google maps is providing directions in my local language (hungarian) when I am using google chrome, but English language directions when I am using it from IE. </p>
<p>I would like to know how chrome figures this out and how can I write code that is always returning directions on the user's language. </p>
| [
{
"answer_id": 67068,
"author": "millenomi",
"author_id": 6061,
"author_profile": "https://Stackoverflow.com/users/6061",
"pm_score": 3,
"selected": true,
"text": "HTTP"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/260/"
] |
67,045 | <p>I am trying to convince those who set standards at my current organization that we should use jQuery rather than Prototype and/or YUI. What are some convincing advantages I can use to convince them?</p>
| [
{
"answer_id": 72737,
"author": "Michael Thompson",
"author_id": 12276,
"author_profile": "https://Stackoverflow.com/users/12276",
"pm_score": 3,
"selected": false,
"text": "$('#something').width();\n"
},
{
"answer_id": 8296056,
"author": "Ruben Oliveira",
"author_id": 10... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
67,056 | <p>I would like to get data from from different webpages such as addresses of restaurants or dates of different events for a given location and so on. What is the best library I can use for extracting this data from a given set of sites? </p>
| [
{
"answer_id": 67166,
"author": "Drew Olson",
"author_id": 9434,
"author_profile": "https://Stackoverflow.com/users/9434",
"pm_score": 3,
"selected": false,
"text": "require 'rubygems'\nrequire 'hpricot'\nrequire 'open-uri'\n\nsites = %w(http://www.google.com http://www.stackoverflow.com... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/260/"
] |
67,063 | <p>It strikes me that Properties in C# should be use when trying to manipulate a field in the class. But when there's complex calculations or database involved, we should use a getter/setter.</p>
<p>Is this correct?</p>
<p>When do you use s/getter over properties?</p>
| [
{
"answer_id": 67186,
"author": "Sean Hanley",
"author_id": 7290,
"author_profile": "https://Stackoverflow.com/users/7290",
"pm_score": 1,
"selected": false,
"text": "open()"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10088/"
] |
67,069 | <p>So I get that most of you are frowning at me for not currently using any source control. I want to, I really do, now that I've spent some time reading the questions / answers here. I am a hobby programmer and really don't do much more than tinker, but I've been bitten a couple of times now not having the 'time machine' handy...</p>
<p>I still have to decide which product I'll go with, but that's not relevant to this question.</p>
<p>I'm really struggling with the flow of files under source control, so much so I'm not even sure how to pose the question sensibly.</p>
<p>Currently I have a directory hierarchy where all my PHP files live in a Linux Environment. I edit them there and can hit refresh on my browser to see what happens.</p>
<p>As I understand it, my files now live in a different place. When I want to edit, I check it out and edit away. But what is my substitute for F5? How do I test it? Do I have to check it back in, then hit F5? I admit to a good bit of trial and error in my work. I suspect I'm going to get tired of checking in and out real quick for the frequent small changes I tend to make. I have to be missing something, right?</p>
<p>Can anyone step me through where everything lives and how I test along the way, while keeping true to the goal of having a 'time machine' handy?</p>
| [
{
"answer_id": 67111,
"author": "Max Caceres",
"author_id": 4842,
"author_profile": "https://Stackoverflow.com/users/4842",
"pm_score": 0,
"selected": false,
"text": "working copy"
},
{
"answer_id": 68240,
"author": "willurd",
"author_id": 1943957,
"author_profile": "... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1444/"
] |
67,082 | <p>What is Windows' best I/O event notification facility? </p>
<p>By best I mean something that ...</p>
<ol>
<li>doesn't have a limit on number of input file descriptors</li>
<li>works on all file descriptors (disk files, sockets, ...)</li>
<li>provides various notification modes (edge triggered, limit triggered)</li>
</ol>
| [
{
"answer_id": 67594,
"author": "Chris Smith",
"author_id": 9073,
"author_profile": "https://Stackoverflow.com/users/9073",
"pm_score": 7,
"selected": true,
"text": "OVERLAPPED"
},
{
"answer_id": 16034678,
"author": "schlamar",
"author_id": 851737,
"author_profile": "... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9107/"
] |
67,093 | <p>The MySQL manual at <a href="http://web.archive.org/web/20160504181056/https://dev.mysql.com/doc/refman/5.1/en/rename-database.html" rel="noreferrer">MySQL</a> covers this.</p>
<p>Usually I just dump the database and reimport it with a new name. This is not an option for very big databases. Apparently <code>RENAME {DATABASE | SCHEMA} db_name TO new_db_name;</code> <a href="http://web.archive.org/web/20160504181056/https://dev.mysql.com/doc/refman/5.1/en/rename-database.html" rel="noreferrer">does bad things, exists only in a handful of versions, and is a bad idea overall</a>.</p>
<p>This needs to work with <a href="http://en.wikipedia.org/wiki/InnoDB" rel="noreferrer">InnoDB</a>, which stores things very differently than <a href="http://en.wikipedia.org/wiki/MyISAM" rel="noreferrer">MyISAM</a>.</p>
| [
{
"answer_id": 67187,
"author": "DeeCee",
"author_id": 5895,
"author_profile": "https://Stackoverflow.com/users/5895",
"pm_score": 5,
"selected": false,
"text": "cd /var/lib/mysql/\n"
},
{
"answer_id": 362408,
"author": "Community",
"author_id": -1,
"author_profile": ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/556/"
] |
67,103 | <p>I have an application that uses NHibernate as its ORM and sometimes it experiences performance issues due to how the data is being accessed by it. What kind of things can be done to improve the performance of NHibernate? (Please limit to one recommendation per answer)</p>
| [
{
"answer_id": 238788,
"author": "David P",
"author_id": 13145,
"author_profile": "https://Stackoverflow.com/users/13145",
"pm_score": 5,
"selected": false,
"text": " public class NHibernateSessionManager\n {\n private readonly ISessionFactory _sessionFactory;\n\n publ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872/"
] |
67,117 | <p>Are there any documented techniques for speeding up mySQL dumps and imports?</p>
<p>This would include my.cnf settings, using ramdisks, etc. </p>
<p>Looking only for documented techniques, preferably with benchmarks showing potential speed-up.</p>
| [
{
"answer_id": 73067,
"author": "Aleksandar Ivanisevic",
"author_id": 12537,
"author_profile": "https://Stackoverflow.com/users/12537",
"pm_score": 4,
"selected": false,
"text": "innodb_flush_log_at_trx_commit = 2\n"
},
{
"answer_id": 1112246,
"author": "gahooa",
"author_... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/556/"
] |
67,141 | <p>Does anybody here have positive experience of working with MS SQL Server 2005 from Rails 2.x?</p>
<p>Our developers use Mac OS X, and our production runs on Linux. For legacy reasons we should use MS SQL Server 2005.</p>
<p>We're using ruby-odbc and are running into various problems, too depressing to list here. I get an impression that we're doing something wrong. </p>
<p>I'm talking about the no-compromise usage, that is, with migrations and all.</p>
<p>Thank you,</p>
| [
{
"answer_id": 99768,
"author": "hectorsq",
"author_id": 14755,
"author_profile": "https://Stackoverflow.com/users/14755",
"pm_score": 2,
"selected": false,
"text": "gem install activerecord-sqlserver-adapter\n--source=http://gems.rubyonrails.org\n"
},
{
"answer_id": 185827,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67141",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7754/"
] |
67,151 | <p>How can I go about hosting flash content inside a WPF form and still use transparency/alpha on my WPF window? Hosting a WinForms flash controls does not allow this.</p>
| [
{
"answer_id": 22435069,
"author": "Ailayna Entarria",
"author_id": 2424285,
"author_profile": "https://Stackoverflow.com/users/2424285",
"pm_score": -1,
"selected": false,
"text": " private void Window_Loaded(object sender, RoutedEventArgs e)\n { \n MyHelper.ExtendFrame(this, new T... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67151",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10119/"
] |
67,154 | <p>I am working on a cocoa software and in order to keep the GUI responsive during a massive data import (Core Data) I need to run the import outside the main thread.</p>
<p>Is it safe to access those objects even if I created them in the main thread without using locks <strong>if</strong> I don't explicitly access those objects while the thread is running.</p>
| [
{
"answer_id": 67271,
"author": "Doug T.",
"author_id": 8123,
"author_profile": "https://Stackoverflow.com/users/8123",
"pm_score": 0,
"selected": false,
"text": "void CreateObject()\n{\n Object* sharedObj = new Object();\n PassObjectToUsingThread( sharedObj); // this function woul... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407138/"
] |
67,174 | <p>Does anybody know a "technique" to discover memory leaks caused by smart pointers? I am currently working on a large project written in <strong>C++</strong> that heavily uses smart pointers with reference counting. Obviously we have some memory leaks caused by smart pointers, that are still referenced somewhere in the code, so that their memory does not get free'd. It's very hard to find the line of code with the "needless" reference, that causes the corresponding object not to be free'd (although it's not of use any longer).</p>
<p>I found some advice in the web, that proposed to collect call stacks of the increment/decrement operations of the reference counter. This gives me a good hint, which piece of code has caused the reference counter to get increased or decreased.</p>
<p>But what I need is some kind of algorithm that groups the corresponding "increase/decrease call stacks" together. After removing these pairs of call stacks, I hopefully have (at least) one "increase call stack" left over, that shows me the piece of code with the "needless" reference, that caused the corresponding object not to be freed. Now it will be no big deal to fix the leak!</p>
<p>But has anybody an idea for an "algorithm" that does the grouping?</p>
<p>Development takes place under <strong>Windows XP</strong>.</p>
<p>(I hope someone understood, what I tried to explain ...)</p>
<p>EDIt: I am talking about leaks caused by circular references.</p>
| [
{
"answer_id": 67251,
"author": "Mike Stone",
"author_id": 122,
"author_profile": "https://Stackoverflow.com/users/122",
"pm_score": 1,
"selected": false,
"text": "def allocation?(line)\n # determine if this line is a log line indicating allocation/deallocation\nend\n\ndef unique_stack(... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2012356/"
] |
67,209 | <p>How do you customize the Copy/Paste behavior in Visual Studio 2008?</p>
<p>For example I create a new <code><div id="MyDiv"></div></code> and then copy and paste it in the same file.</p>
<p>VisualStudio pastes <code><div id="Div1"></div></code> instead of the original text I copied.</p>
<p>It is even more frustrating when I'm trying to copy a group of related div's that I would like to copy/paste several times and only change one part of the id.</p>
<p>Is there a setting I can tweak to change the copy/paste behavior?</p>
| [
{
"answer_id": 65760519,
"author": "Geospatial",
"author_id": 10039873,
"author_profile": "https://Stackoverflow.com/users/10039873",
"pm_score": 1,
"selected": false,
"text": "Tools > Text Editor > ASP.NET Web Forms"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3747/"
] |
67,219 | <p>When I use the PrintOut method to print a Worksheet object to a printer, the "Printing" dialog (showing filename, destination printer, pages printed and a Cancel button) is displayed even though I have set DisplayAlerts = False. The code below works in an Excel macro but the same thing happens if I use this code in a VB or VB.Net application (with the reference changes required to use the Excel object).</p>
<pre><code>Public Sub TestPrint()
Dim vSheet As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set vSheet = ActiveSheet
vSheet.PrintOut Preview:=False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
</code></pre>
<p>EDIT: The answer below sheds more light on this (that it may be a Windows dialog and not an Excel dialog) but does not answer my question. Does anyone know how to prevent it from being displayed?</p>
<p>EDIT: Thank you for your extra research, Kevin. It looks very much like this is what I need. Just not sure I want to blindly accept API code like that. Does anyone else have any knowledge about these API calls and that they're doing what the author purports?</p>
| [
{
"answer_id": 12731485,
"author": "Raghbir Singh",
"author_id": 1720679,
"author_profile": "https://Stackoverflow.com/users/1720679",
"pm_score": 2,
"selected": false,
"text": "sub test()\n\n activesheet.printout preview:= false\n\nend sub\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7209/"
] |
67,244 | <p>How do I determine using TSQL what roles are granted execute permissions on a specific stored procedure? Is there a system stored procedure or a system view I can use?</p>
| [
{
"answer_id": 67417,
"author": "palehorse",
"author_id": 312,
"author_profile": "https://Stackoverflow.com/users/312",
"pm_score": 0,
"selected": false,
"text": "SELECT\ngrantee_principal.name AS [Grantee],\nCASE grantee_principal.type WHEN 'R' THEN 3 WHEN 'A' THEN 4 ELSE 2 END - CASE '... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872/"
] |
67,273 | <p>How do you iterate through every file/directory recursively in standard C++?</p>
| [
{
"answer_id": 67286,
"author": "John Millikin",
"author_id": 3560,
"author_profile": "https://Stackoverflow.com/users/3560",
"pm_score": 2,
"selected": false,
"text": "open()"
},
{
"answer_id": 67307,
"author": "1800 INFORMATION",
"author_id": 3146,
"author_profile":... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10184/"
] |
67,275 | <p>I am trying to read a single file from a <code>java.util.zip.ZipInputStream</code>, and copy it into a <code>java.io.ByteArrayOutputStream</code> (so that I can then create a <code>java.io.ByteArrayInputStream</code> and hand that to a 3rd party library that will end up closing the stream, and I don't want my <code>ZipInputStream</code> getting closed).</p>
<p>I'm probably missing something basic here, but I never enter the while loop here:</p>
<pre><code>ByteArrayOutputStream streamBuilder = new ByteArrayOutputStream();
int bytesRead;
byte[] tempBuffer = new byte[8192*2];
try {
while ((bytesRead = zipStream.read(tempBuffer)) != -1) {
streamBuilder.write(tempBuffer, 0, bytesRead);
}
} catch (IOException e) {
// ...
}
</code></pre>
<p>What am I missing that will allow me to copy the stream?</p>
<p><strong>Edit:</strong></p>
<p>I should have mentioned earlier that this <code>ZipInputStream</code> is not coming from a file, so I don't think I can use a <code>ZipFile</code>. It is coming from a file uploaded through a servlet.</p>
<p>Also, I have already called <code>getNextEntry()</code> on the <code>ZipInputStream</code> before getting to this snippet of code. If I don't try copying the file into another <code>InputStream</code> (via the <code>OutputStream</code> mentioned above), and just pass the <code>ZipInputStream</code> to my 3rd party library, the library closes the stream, and I can't do anything more, like dealing with the remaining files in the stream.</p>
| [
{
"answer_id": 67377,
"author": "Boris Bokowski",
"author_id": 10114,
"author_profile": "https://Stackoverflow.com/users/10114",
"pm_score": 0,
"selected": false,
"text": " zipStream = zipFile.getInputStream(zipEntry)\n"
},
{
"answer_id": 67403,
"author": "ScArcher2",
"a... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4257/"
] |
67,299 | <p>I am working to integrate unit testing into the development process on the team I work on and there are some sceptics. What are some good ways to convince the sceptical developers on the team of the value of Unit Testing? In my specific case we would be adding Unit Tests as we add functionality or fixed bugs. Unfortunately our code base does not lend itself to easy testing.</p>
| [
{
"answer_id": 107137,
"author": "Andy Lester",
"author_id": 8454,
"author_profile": "https://Stackoverflow.com/users/8454",
"pm_score": 1,
"selected": false,
"text": "use_ok( 'Foo' );\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9431/"
] |
67,300 | <p>If you use the standard tab control in .NET for your tab pages and you try to change the look and feel a little bit then you are able to change the back color of the tab pages but not for the tab control. The property is available, you could set it but it has no effect. If you change the back color of the pages and not of the tab control it looks... uhm quite ugly.</p>
<p>I know Microsoft doesn't want it to be set. <a href="http://msdn.microsoft.com/en/library/w4sc610z(VS.80).aspx" rel="nofollow noreferrer">MSDN</a>: '<i>This property supports the .NET Framework infrastructure and is not intended to be used directly from your code. This member is not meaningful for this control.</i>' A control property just for color which supports the .NET infrastructure? ...hard to believe.</p>
<p>I hoped over the years Microsoft would change it but they did not. I created my own TabControl class which overrides the paint method to fix this. But is this really the best solution?</p>
<p>What is the reason for not supporting BackColor for this control? What is your solution to fix this? Is there a better solution than overriding the paint method?</p>
| [
{
"answer_id": 268271,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": false,
"text": "...\n\nDim r As Rectangle = tabControl1.GetTabRect(tabControl1.TabPages.Count-1)\nDim rf As RectangleF = New RectangleF(r.X + ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9470/"
] |
67,354 | <p>I have an iframe. The content is wider than the width I am setting so the iframe gets a horizontal scroll bar. I can't increase the width of the iframe so I want to just remove the scroll bar. I tried setting the scroll property to "no" but that kills both scroll bars and I want the vertical one. I tried setting overflow-x to "hidden" and that killed the horizontal scroll bar in ff but not in IE. sad for me.</p>
| [
{
"answer_id": 67568,
"author": "Rich Adams",
"author_id": 10018,
"author_profile": "https://Stackoverflow.com/users/10018",
"pm_score": 3,
"selected": false,
"text": "<html>\n <head>\n <title>iframe test</title>\n\n <style> \n #aTest { \n width... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5234/"
] |
67,370 | <p>I'm programming WCF using the ChannelFactory which expects a type in order to call the CreateChannel method. For example: </p>
<pre><code>IProxy proxy = ChannelFactory<IProxy>.CreateChannel(...);
</code></pre>
<p>In my case I'm doing routing so I don't know what type my channel factory will be using. I can parse a message header to determine the type but I hit a brick wall there because even if I have an instance of Type I can't pass that where ChannelFactory expects a generic type. </p>
<p>Another way of restating this problem in very simple terms would be that I'm attempting to do something like this:</p>
<pre><code>string listtype = Console.ReadLine(); // say "System.Int32"
Type t = Type.GetType( listtype);
List<t> myIntegers = new List<>(); // does not compile, expects a "type"
List<typeof(t)> myIntegers = new List<typeof(t)>(); // interesting - type must resolve at compile time?
</code></pre>
<p>Is there an approach to this I can leverage within C#?</p>
| [
{
"answer_id": 67530,
"author": "IDisposable",
"author_id": 2076,
"author_profile": "https://Stackoverflow.com/users/2076",
"pm_score": 6,
"selected": true,
"text": "string elementTypeName = Console.ReadLine();\nType elementType = Type.GetType(elementTypeName);\nType[] types = new Type[]... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64/"
] |
67,410 | <p><code>GNU sed version 4.1.5</code> seems to fail with International chars. Here is my input file:</p>
<pre><code>Gras Och Stenar Trad - From Moja to Minneapolis DVD [G2007DVD] 7812 | X
<br>
Gras Och Stenar Trad - From Möja to Minneapolis DVD [G2007DVD] 7812 | Y
</code></pre>
<p>(Note the umlaut in the second line.)</p>
<p>And when I do</p>
<pre><code>sed 's/.*| //' < in
</code></pre>
<p>I would expect to see only the <code>X</code> and <code>Y</code>, as I've asked to remove ALL chars up to the <code>'|'</code> and space beyond it. Instead, I get:</p>
<pre><code>X<br>
Gras Och Stenar Trad - From M? Y
</code></pre>
<p>I know I can use tr to remove the International chars. first, but is there a way to just use sed?</p>
| [
{
"answer_id": 67470,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": false,
"text": "sed"
},
{
"answer_id": 67575,
"author": "Torsten Marek",
"author_id": 9567,
"author_profile": "https://Stac... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10251/"
] |
67,418 | <p>I have a "watcher" module that is currently using global hierarchies inside it. I need to instantiate a second instance of this with a second global hierarchy.</p>
<p>Currently:</p>
<pre><code>module watcher;
wire sig = `HIER.sig;
wire bar = `HIER.foo.bar;
...
endmodule
watcher w; // instantiation
</code></pre>
<p>Desired:</p>
<pre><code>module watcher(input base_hier);
wire sig = base_hier.sig;
wire bar = base_hier.foo.bar;
...
endmodule
watcher w1(`HIER1); // instantiation
watcher w2(`HIER2); // second instantiation, except with a different hierarchy
</code></pre>
<p>My best idea is to use vpp (the Verilog preprocessor) to brute-force generate two virtually-identical modules (one with each hierarchy), but is there a more elegant way?</p>
| [
{
"answer_id": 68376,
"author": "DMC",
"author_id": 3148,
"author_profile": "https://Stackoverflow.com/users/3148",
"pm_score": 3,
"selected": false,
"text": "module watcher(sig, bar);\n input sig;\n input bar;\n...\nendmodule\n\nwatcher w1(`HIER1.sig, `HIER1.foo.bar); // instantiation... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8598/"
] |
67,421 | <p>I've built one, but I'm convinced it's wrong.</p>
<p>I had a table for customer details, and another table with the each date staying (i.e. a week's holiday would have seven records).</p>
<p>Is there a better way?</p>
<p>I code in PHP with MySQL</p>
| [
{
"answer_id": 67472,
"author": "Peter Bailey",
"author_id": 8815,
"author_profile": "https://Stackoverflow.com/users/8815",
"pm_score": 0,
"selected": false,
"text": "stay.check_in_time_scheduled\nstay.check_in_time_actual\nstay.check_out_time_scheduled\nstay.check_out_time_actual\n"
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
67,426 | <p>I'm fairly new to the STL, so I was wondering whether there are any dynamically sortable containers? At the moment my current thinking is to use a vector in conjunction with the various sort algorithms, but I'm not sure whether there's a more appropriate selection given the (presumably) linear complexity of inserting entries into a sorted vector.</p>
<p>To clarify "dynamically", I am looking for a container that I can modify the sorting order at runtime - e.g. sort it in an ascending order, then later re-sort in a descending order.</p>
| [
{
"answer_id": 67437,
"author": "Torlack",
"author_id": 5243,
"author_profile": "https://Stackoverflow.com/users/5243",
"pm_score": 2,
"selected": false,
"text": "std::set"
},
{
"answer_id": 67460,
"author": "Doug T.",
"author_id": 8123,
"author_profile": "https://Sta... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10247/"
] |
67,454 | <p>How to serve users a dynamically generated ZIP archive in Django?</p>
<p>I'm making a site, where users can choose any combination of available books and download them as ZIP archive. I'm worried that generating such archives for each request would slow my server down to a crawl. I have also heard that Django doesn't currently have a good solution for serving dynamically generated files.</p>
| [
{
"answer_id": 72180,
"author": "zgoda",
"author_id": 12138,
"author_profile": "https://Stackoverflow.com/users/12138",
"pm_score": 7,
"selected": true,
"text": "HttpResponse"
},
{
"answer_id": 12951461,
"author": "dbr",
"author_id": 745,
"author_profile": "https://St... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9812/"
] |
67,457 | <p>How can I show a web page in a transparent window and have the white part of the web page also transparent.</p>
| [
{
"answer_id": 72180,
"author": "zgoda",
"author_id": 12138,
"author_profile": "https://Stackoverflow.com/users/12138",
"pm_score": 7,
"selected": true,
"text": "HttpResponse"
},
{
"answer_id": 12951461,
"author": "dbr",
"author_id": 745,
"author_profile": "https://St... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44972/"
] |
67,492 | <p>Let's say the first N integers divisible by 3 starting with 9.</p>
<p>I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet.</p>
| [
{
"answer_id": 67552,
"author": "1800 INFORMATION",
"author_id": 3146,
"author_profile": "https://Stackoverflow.com/users/3146",
"pm_score": 0,
"selected": false,
"text": "yield"
},
{
"answer_id": 67562,
"author": "Charles Graham",
"author_id": 7705,
"author_profile":... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67492",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5056/"
] |
67,499 | <p>I have found that skin files only work if they are placed at the root theme folder in the App_Themes folder.</p>
<p>For example, if you have 2 themes in the App_Themes folder, you cannot add another sub folder to the theme folder and place a seperate skin file in that subfolder. </p>
<p>It's not much of a limitation, but it would give you more flexibility to further customize an app.</p>
<p>Can anyone shed light on why this behavior occurs as it does in 2.0?</p>
| [
{
"answer_id": 71634,
"author": "thomasb",
"author_id": 6776,
"author_profile": "https://Stackoverflow.com/users/6776",
"pm_score": 1,
"selected": false,
"text": "<asp:DataList runat=\"server\" SkinID=\"DataListColor\" Width=\"100%\">\n <ItemStyle BackColor=\"Blue\" ForeColor=\"Red\" />... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
67,518 | <p>I am trying to get the <code>Edit with Vim</code> context menu to open files in a new tab of the previously opened Gvim instance (if any).</p>
<p>Currently, using <code>Regedit</code> I have modified this key:</p>
<pre><code>\HKEY-LOCAL-MACHINE\SOFTWARE\Vim\Gvim\path = "C:\Programs\Vim\vim72\gvim.exe" -p --remote-tab-silent "%*"
</code></pre>
<p>The registry key type is <code>REG_SZ</code>.</p>
<p>This almost works... Currently it opens the file in a new tab, but it also opens another tab (which is the active tab) the tab is labeled <code>\W\S\--literal</code> and the file seems to be trying to open the following file. </p>
<pre><code>C:\Windows\System32\--literal
</code></pre>
<p>I think the problem is around the <code>"%*"</code> - I tried changing that to <code>"%1"</code> but if i do that I get an extra tab called <code>%1</code>.</p>
<p><strong>Affected version</strong></p>
<ul>
<li>Vim version 7.2 (same behaviour on 7.1) </li>
<li>Windows vista home premium</li>
</ul>
<p>Thanks for any help. </p>
<p>David. </p>
| [
{
"answer_id": 78234,
"author": "David Turner",
"author_id": 10171,
"author_profile": "https://Stackoverflow.com/users/10171",
"pm_score": 2,
"selected": false,
"text": "Windows Registry Editor Version 5.00\n\n[HKEY_CLASSES_ROOT\\*\\shell\\Edit with Vim]\n@=\"\"\n\n[HKEY_CLASSES_ROOT\\*\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10171/"
] |
67,554 | <p>I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel <a href="https://en.wikipedia.org/wiki/VTune" rel="noreferrer">VTune</a>, but it's not free either.</p>
| [
{
"answer_id": 8982554,
"author": "Arty",
"author_id": 1166346,
"author_profile": "https://Stackoverflow.com/users/1166346",
"pm_score": 4,
"selected": false,
"text": "void f()\n{\n srand(time(0));\n\n vector<double> v(300000);\n\n generate_n(v.begin(), v.size(), &random);\n ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10120/"
] |
67,561 | <p>The <a href="http://en.wikipedia.org/wiki/Law_Of_Demeter" rel="noreferrer">wikipedia article</a> about <a href="http://c2.com/cgi/wiki?LawOfDemeter" rel="noreferrer">Law of Demeter</a> says:</p>
<blockquote>
<p>The law can be stated simply as "use only one dot".</p>
</blockquote>
<p>However a <a href="http://weblogs.asp.net/jgalloway/archive/2006/12/06/a-simple-example-of-a-fluent-interface.aspx" rel="noreferrer">simple example</a> of a <a href="http://en.wikipedia.org/wiki/Fluent_interface" rel="noreferrer">fluent interface</a> may look like this:</p>
<pre><code>static void Main(string[] args)
{
new ZRLabs.Yael.Pipeline("cat.jpg")
.Rotate(90)
.Watermark("Monkey")
.RoundCorners(100, Color.Bisque)
.Save("test.png");
}
</code></pre>
<p>So does this goes together?</p>
| [
{
"answer_id": 67593,
"author": "Quibblesome",
"author_id": 1143,
"author_profile": "https://Stackoverflow.com/users/1143",
"pm_score": 3,
"selected": false,
"text": "CurrentCustomer.Orders[0].Manufacturer.Address.Email(text);\n"
},
{
"answer_id": 67615,
"author": "Jon Limjap... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2361/"
] |
67,612 | <p>In Javascript:
How does one find the coordinates (x, y, height, width) of every link in a webpage?</p>
| [
{
"answer_id": 67642,
"author": "Jim",
"author_id": 8427,
"author_profile": "https://Stackoverflow.com/users/8427",
"pm_score": 3,
"selected": true,
"text": "$(\"a\").each(function() {\n var link = $(this);\n var top = link.offset().top;\n var left = link.offset().left;\n var... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/401774/"
] |
67,621 | <p>I am working with ASP.net.<br><br>
I am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net.<br><br>
What would be the easiest way to accomplish this.
<br><br>
I have looked at PageMethods which for some reason are not working and found that a lot of other people have had trouble with them.</p>
| [
{
"answer_id": 297326,
"author": "Toran Billups",
"author_id": 2701,
"author_profile": "https://Stackoverflow.com/users/2701",
"pm_score": 0,
"selected": false,
"text": "Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\n Response.Cache.S... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3821/"
] |
67,631 | <p>How do I load a Python module given its full path?</p>
<p>Note that the file can be anywhere in the filesystem where the user has access rights.</p>
<hr />
<p><sub><strong>See also:</strong> <a href="https://stackoverflow.com/questions/301134">How to import a module given its name as string?</a></sub></p>
| [
{
"answer_id": 67672,
"author": "Matt",
"author_id": 10035,
"author_profile": "https://Stackoverflow.com/users/10035",
"pm_score": 3,
"selected": false,
"text": "imp.find_module()"
},
{
"answer_id": 67692,
"author": "Sebastian Rittau",
"author_id": 7779,
"author_profi... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10286/"
] |
67,647 | <p>I'm looking for a way to extract the audio part of a FLV file. </p>
<p>I'm recording from the user's microphone and the audio is encoded using the <a href="http://en.wikipedia.org/wiki/Nellymoser_Asao_Codec" rel="nofollow noreferrer">Nellymoser Asao Codec</a>. This is the default codec and there's no way to change this.</p>
| [
{
"answer_id": 76266,
"author": "Costo",
"author_id": 1130,
"author_profile": "https://Stackoverflow.com/users/1130",
"pm_score": 4,
"selected": true,
"text": "ffmpeg -i source.flv -nv -f mp3 destination.mp3"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1130/"
] |
67,676 | <p>How can I use .NET DataSet.Select method to search records that match a DateTime?
What format should I use to enter my dates in?</p>
| [
{
"answer_id": 67696,
"author": "Leo Moore",
"author_id": 6336,
"author_profile": "https://Stackoverflow.com/users/6336",
"pm_score": 3,
"selected": true,
"text": "ds.select(DBDate = '15 Sep 2008')\n"
},
{
"answer_id": 67753,
"author": "creohornet",
"author_id": 9111,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7277/"
] |
67,682 | <p>I'm trying to make it so when a user scrolls down a page, click a link, do whatever it is they need to do, and then come back to the pages w/ links, they are at the same (x-y) location in the browser they were before. How do I do that?</p>
<p>I'm a DOM Newbie so I don't know too much about how to do this. </p>
<p>Target Browsers: IE6/7/8, Firefox 2/3, Opera, Safari</p>
<p>Added: I'm using a program called JQuery to help me learn</p>
| [
{
"answer_id": 127998,
"author": "deepwell",
"author_id": 21473,
"author_profile": "https://Stackoverflow.com/users/21473",
"pm_score": 2,
"selected": false,
"text": "<html>\n <head>\n <script type=\"text/javascript\" src=\"jquery.js\"></script>\n <script type=\"text/jav... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10352/"
] |
67,685 | <p>I want my website to join some webcam recordings in FLV files (like this one). This needs to be done on Linux without user input. How do I do this? For simplicity's sake, I'll use the same flv as both inputs in hope of getting a flv that plays the same thing twice in a row.</p>
<p>That should be easy enough, right? There's even a full code example in the <a href="http://ffmpeg.mplayerhq.hu/faq.html#SEC31" rel="noreferrer">ffmpeg FAQ</a>.</p>
<p>Well, pipes seem to be giving me problems (both on my mac running Leopard and on Ubuntu 8.04) so let's keep it simple and use normal files. Also, if I don't specify a rate of 15 fps, the visual part plays <a href="http://www.marc-andre.ca/posts/blog/webcam/output-norate.flv" rel="noreferrer">extremely fast</a>. The example script thus becomes:</p>
<pre><code>ffmpeg -i input.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 \
- > temp.a < /dev/null
ffmpeg -i input.flv -an -f yuv4mpegpipe - > temp.v < /dev/null
cat temp.v temp.v > all.v
cat temp.a temp.a > all.a
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-f yuv4mpegpipe -i all.v -sameq -y output.flv
</code></pre>
<p>Well, using this will work for the audio, but I only get the video the first time around. This seems to be the case for any flv I throw as input.flv, including the movie teasers that come with red5.</p>
<p>a) Why doesn't the example script work as advertised, in particular why do I not get all the video I'm expecting?</p>
<p>b) Why do I have to specify a framerate while Wimpy player can play the flv at the right speed?</p>
<p>The only way I found to join two flvs was to use mencoder. Problem is, mencoder doesn't seem to join flvs:</p>
<pre><code>mencoder input.flv input.flv -o output.flv -of lavf -oac copy \
-ovc lavc -lavcopts vcodec=flv
</code></pre>
<p>I get a Floating point exception...</p>
<pre><code>MEncoder 1.0rc2-4.0.1 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Xeon(R) CPU 5150 @ 2.66GHz (Family: 6, Model: 15, Stepping: 6)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
success: format: 0 data: 0x0 - 0x45b2f
libavformat file format detected.
[flv @ 0x697160]Unsupported audio codec (6)
[flv @ 0x697160]Could not find codec parameters (Audio: 0x0006, 22050 Hz, mono)
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO: [FLV1] 240x180 0bpp 1000.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44 fourcc:0x31564C46 size:240x180 fps:1000.00 ftime:=0.0010
** MUXER_LAVF *****************************************************************
REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
OK, exit
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffflv] vfm: ffmpeg (FFmpeg Flash video)
==========================================================================
audiocodec: framecopy (format=6 chans=1 rate=22050 bits=16 B/s=0 sample-0)
VDec: vo config request - 240 x 180 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (240x180 fourcc=31564c46 [FLV1])
VIDEO CODEC ID: 22
AUDIO CODEC ID: 10007, TAG: 0
Writing header...
[NULL @ 0x67d110]codec not compatible with flv
Floating point exception
</code></pre>
<p>c) Is there a way for mencoder to decode and encode flvs correctly?</p>
<p>So the only way I've found so far to join flvs, is to use ffmpeg to go back and forth between flv and avi, and use mencoder to join the avis:</p>
<pre><code>ffmpeg -i input.flv -vcodec rawvideo -acodec pcm_s16le -r 15 file.avi
mencoder -o output.avi -oac copy -ovc copy -noskip file.avi file.avi
ffmpeg -i output.avi output.flv
</code></pre>
<p>d) There must be a better way to achieve this... Which one?</p>
<p>e) Because of the problem of the framerate, though, only flvs with constant framerate (like the one I recorded through <a href="http://ffmpeg.mplayerhq.hu/faq.html#SEC31" rel="noreferrer">facebook</a>) will be converted correctly to avis, but this won't work for the flvs I seem to be recording (like <a href="http://www.marc-andre.ca/posts/blog/webcam/test-wowza.flv" rel="noreferrer">this one</a> or <a href="http://www.marc-andre.ca/posts/blog/webcam/test-red5-publisher.flv" rel="noreferrer">this one</a>). Is there a way to do this for these flvs too?</p>
<p>Any help would be very appreciated.</p>
| [
{
"answer_id": 107523,
"author": "paranoio",
"author_id": 11124,
"author_profile": "https://Stackoverflow.com/users/11124",
"pm_score": -1,
"selected": false,
"text": "cat yourVideos/*.flv >> big.flv\n"
},
{
"answer_id": 143015,
"author": "Marc-André Lafortune",
"author_i... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8279/"
] |
67,699 | <p>My <code>master</code> and <code>development</code> branches are tracked remotely on <a href="http://en.wikipedia.org/wiki/GitHub" rel="noreferrer">GitHub</a>. How do I clone both these branches?</p>
| [
{
"answer_id": 67712,
"author": "MattoxBeckman",
"author_id": 10354,
"author_profile": "https://Stackoverflow.com/users/10354",
"pm_score": 5,
"selected": false,
"text": "git clone"
},
{
"answer_id": 67716,
"author": "elmarco",
"author_id": 1277510,
"author_profile": ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117/"
] |
67,706 | <p>Has anyone come up with a good way of performing full text searches (<code>FREETEXT() CONTAINS()</code>) for any number of arbitrary keywords using standard LinqToSql query syntax?</p>
<p>I'd obviously like to avoid having to use a Stored Proc or have to generate a Dynamic SQL calls.</p>
<p>Obviously I could just pump the search string in on a parameter to a SPROC that uses FREETEXT() or CONTAINS(), but I was hoping to be more creative with the search and build up queries like:</p>
<p>"pepperoni pizza" and burger, not "apple pie".</p>
<p>Crazy I know - but wouldn't it be neat to be able to do this directly from LinqToSql? Any tips on how to achieve this would be much appreciated.</p>
<p>Update: I think I may be on to something <a href="http://tomasp.net/blog/linq-expand-update.aspx" rel="nofollow noreferrer">here</a>...</p>
<p>Also: I rolled back the change made to my question title because it actually changed the meaning of what I was asking. I <em>know</em> that full text search is not supported in LinqToSql - I would have asked that question if I wanted to know that. Instead - I have updated my title to appease the edit-happy-trigger-fingered masses.</p>
| [
{
"answer_id": 361690,
"author": "LaserJesus",
"author_id": 45207,
"author_profile": "https://Stackoverflow.com/users/45207",
"pm_score": 3,
"selected": false,
"text": "string q = query.Query;\nIQueryable<Story> stories = ActiveStories\n .Join(tvf_SearchStories(q),... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1107/"
] |
67,713 | <p>In Google Reader, you can use a bookmarklet to "note" a page you're visiting. When you press the bookmarklet, a little Google form is displayed on top of the current page. In the form you can enter a description, etc. When you press Submit, the form submits itself without leaving the page, and then the form disappears. All in all, a very smooth experience.</p>
<p>I obviously tried to take a look at how it's done, but the most interesting parts are minified and unreadable. So...</p>
<p>Any ideas on how to implement something like this (on the browser side)? What issues are there? Existing blog posts describing this?</p>
| [
{
"answer_id": 67897,
"author": "Sam Hasler",
"author_id": 2541,
"author_profile": "https://Stackoverflow.com/users/2541",
"pm_score": 0,
"selected": false,
"text": "createElement"
},
{
"answer_id": 68110,
"author": "Anutron",
"author_id": 10071,
"author_profile": "ht... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10155/"
] |
67,734 | <p>I'd like to execute JavaScript code from within a C# assembly and have the results of the JavaScript code returned to the calling C# code.</p>
<p>It's easier to define things that I'm not trying to do:</p>
<ul>
<li><p>I'm not trying to call a JavaScript function on a web page from my code behind.</p></li>
<li><p>I'm not trying to load a WebBrowser control.</p></li>
<li><p>I don't want to have the JavaScript perform an AJAX call to a server.</p></li>
</ul>
<p>What I want to do is write unit tests in JavaScript and have then unit tests output JSON, even plain text would be fine. Then I want to have a generic C# class/executible that can load the file containing the JS, run the JS unit tests, scrap/load the results, and return a pass/fail with details during a post-build task.</p>
<p>I think it's possible using the old ActiveX ScriptControl, but it seems like there ought to be a .NET way to do this without using SilverLight, the DLR, or anything else that hasn't shipped yet. Anyone have any ideas?</p>
<p>update: <a href="http://blogs.msdn.com/brada/articles/239857.aspx" rel="nofollow noreferrer">From Brad Abrams blog</a></p>
<pre><code>namespace Microsoft.JScript.Vsa
{
[Obsolete("There is no replacement for this feature. " +
"Please see the ICodeCompiler documentation for additional help. " +
"http://go.microsoft.com/fwlink/?linkid=14202")]
</code></pre>
<p>Clarification:
We have unit tests for our JavaScript functions that are written in JavaScript using the JSUnit framework. Right now during our build process, we have to manually load a web page and click a button to ensure that all of the JavaScript unit tests pass. I'd like to be able to execute the tests during the post-build process when our automated C# unit tests are run and report the success/failure alongside of out C# unit tests and use them as an indicator as to whether or not the build is broken.</p>
| [
{
"answer_id": 67786,
"author": "scubabbl",
"author_id": 9450,
"author_profile": "https://Stackoverflow.com/users/9450",
"pm_score": 3,
"selected": false,
"text": "<add assembly=\"Microsoft.Vsa, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A\"/></assemblies>\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1538/"
] |
67,736 | <p>I have a service contract that defines a method with a parameter of type System.Object (xs:anyType in the WSDL). I want to be able to pass simple types as well as complex types in this parameter. Simple types work fine, but when I try to pass a complex type that is defined in my WSDL, I get this error:</p>
<p>Element '<a href="http://tempuri.org/:value" rel="nofollow noreferrer">http://tempuri.org/:value</a>' contains data of the '<a href="http://schemas.datacontract.org/2004/07/MyNamespace:MyClass" rel="nofollow noreferrer">http://schemas.datacontract.org/2004/07/MyNamespace:MyClass</a>' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'MyClass' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.</p>
<p>Adding it as a known type doesn't help because it's already in my WSDL. How can I pass an object of a complex type via an "xs:anyType" parameter?</p>
<p>More info:</p>
<p>I believe this works when using NetDataContract, but I can't use that because my client is Silverlight.</p>
<p>I have seen references to complex types explicitly extending xs:anyType, but I have no idea how to make WCF generate a WSDL that does that, and I have no idea whether or not it would even help.</p>
<p>Thanks</p>
| [
{
"answer_id": 81286,
"author": "sajidnizami",
"author_id": 9498,
"author_profile": "https://Stackoverflow.com/users/9498",
"pm_score": 1,
"selected": false,
"text": "public ServiceDataContract() { }\n\npublic ServiceDataContract(TValueType Value)\n{\n this.m_objValue = Value;\n}\n\np... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10391/"
] |
67,760 | <p>Has anyone got <a href="http://perldoc.perl.org/Sys/Syslog.html" rel="nofollow noreferrer">Sys::Syslog</a> to work on Solaris? (I'm running Sys::Syslog 0.05 on Perl v5.8.4 on SunOS 5.10 on SPARC). Here's what doesn't work for me:</p>
<pre><code>openlog "myprog", "pid", "user" or die;
syslog "crit", "%s", "Test from $0" or die;
closelog() or warn "Can't close: $!";
system "tail /var/adm/messages";
</code></pre>
<p>Whatever I do, the closelog returns an error and nothing ever gets logged anywhere.</p>
| [
{
"answer_id": 68121,
"author": "rjbs",
"author_id": 10478,
"author_profile": "https://Stackoverflow.com/users/10478",
"pm_score": 2,
"selected": false,
"text": "[ 'tcp', 'udp', 'unix', 'stream' ]\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
67,761 | <p>Despite the documentation, NetworkStream.Write does not appear to wait until the data has been sent. Instead, it waits until the data has been copied to a buffer and then returns. That buffer is transmitted in the background.</p>
<p>This is the code I have at the moment. Whether I use ns.Write or ns.BeginWrite doesn't matter - both return immediately. The EndWrite also returns immediately (which makes sense since it is writing to the send buffer, not writing to the network).</p>
<pre><code> bool done;
void SendData(TcpClient tcp, byte[] data)
{
NetworkStream ns = tcp.GetStream();
done = false;
ns.BeginWrite(bytWriteBuffer, 0, data.Length, myWriteCallBack, ns);
while (done == false) Thread.Sleep(10);
}
public void myWriteCallBack(IAsyncResult ar)
{
NetworkStream ns = (NetworkStream)ar.AsyncState;
ns.EndWrite(ar);
done = true;
}
</code></pre>
<p>How can I tell when the data has actually been sent to the client?</p>
<p>I want to wait for 10 seconds(for example) for a response from the server after sending my data otherwise I'll assume something was wrong. If it takes 15 seconds to send my data, then it will always timeout since I can only start counting from when NetworkStream.Write returns - which is before the data has been sent. I want to start counting 10 seconds from when the data has left my network card.</p>
<p>The amount of data and the time to send it could vary - it could take 1 second to send it, it could take 10 seconds to send it, it could take a minute to send it. The server does send an response when it has received the data (it's a smtp server), but I don't want to wait forever if my data was malformed and the response will never come, which is why I need to know if I'm waiting for the data to be sent, or if I'm waiting for the server to respond.</p>
<p>I might want to show the status to the user - I'd like to show "sending data to server", and "waiting for response from server" - how could I do that?</p>
| [
{
"answer_id": 67773,
"author": "palehorse",
"author_id": 312,
"author_profile": "https://Stackoverflow.com/users/312",
"pm_score": 0,
"selected": false,
"text": "ns.Flush()\n"
},
{
"answer_id": 67856,
"author": "sbeskur",
"author_id": 10446,
"author_profile": "https:... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4495/"
] |
67,790 | <p>I have some code with multiple functions very similar to each other to look up an item in a list based on the contents of one field in a structure. The only difference between the functions is the type of the structure that the look up is occurring in. If I could pass in the type, I could remove all the code duplication.</p>
<p>I also noticed that there is some mutex locking happening in these functions as well, so I think I might leave them alone...</p>
| [
{
"answer_id": 67838,
"author": "Charles Graham",
"author_id": 7705,
"author_profile": "https://Stackoverflow.com/users/7705",
"pm_score": -1,
"selected": false,
"text": "void foo(void* obj);\n\nvoid main()\n{\n struct bla obj;\n ...\n foo(&obj);\n ...\n}\n\nvoid foo(void* obj)\n{\n ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10394/"
] |
67,798 | <p>I'm looking for a multiline regex that will match occurrences after a blank line. For example, given a sample email below, I'd like to match "From: Alex". <code>^From:\s*(.*)$</code> works to match any From line, but I want it to be restricted to lines in the body (anything after the first blank line).</p>
<pre>
Received: from a server
Date: today
To: Ted
From: James
Subject: [fwd: hi]
fyi
----- Forwarded Message -----
To: James
From: Alex
Subject: hi
Party!
</pre>
| [
{
"answer_id": 67843,
"author": "Loren Segal",
"author_id": 6436,
"author_profile": "https://Stackoverflow.com/users/6436",
"pm_score": 3,
"selected": true,
"text": "\\A.*?\\r?\\n\\r?\\n.*?^From:\\s*([^\\r\\n]+)$\n"
},
{
"answer_id": 67862,
"author": "gregmac",
"author_id... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10392/"
] |
67,810 | <p>I would like to debug my separately running JSP/Struts/Tomcat/Hibernate application stack using the Eclipse IDE debugger. How do I setup the java JVM and eclipse so that I can set breakpoints, monitor variable values, and see the code that is currently executing?</p>
| [
{
"answer_id": 67927,
"author": "Dónal",
"author_id": 2648,
"author_profile": "https://Stackoverflow.com/users/2648",
"pm_score": 1,
"selected": false,
"text": "java"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/67810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10402/"
] |
67,819 | <p>In php, how can I get the number of apache children that are currently available <br>(<code>status = SERVER_READY</code> in the apache scoreboard)?</p>
<p>I'm really hoping there is a simple way to do this in php that I am missing.</p>
| [
{
"answer_id": 67832,
"author": "ceejayoz",
"author_id": 1902010,
"author_profile": "https://Stackoverflow.com/users/1902010",
"pm_score": 2,
"selected": false,
"text": "ps aux | grep httpd"
},
{
"answer_id": 67990,
"author": "giltotherescue",
"author_id": 8215,
"auth... | 2008/09/15 | [
"https://Stackoverflow.com/questions/67819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.