qid int64 4 19.1M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
396,495 | <p><strong>Background:</strong> JEdit (and some other text editors as well) support a feature called <a href="http://groups.csail.mit.edu/uid/projects/simuledit/usenix01.html" rel="nofollow noreferrer">Multiple simultaneous text insertion points</a>. (at least that's what I'm calling it here).</p>
<p>To understand what this means, take a look at the link. </p>
<p>Out of all the features in use in modern text editors, initial research seems to indicate that this is one feature that <em>both</em> Emacs and Vim do not actually support. If correct, this would be pretty exceptional since it's quite difficult to find a text editor feature that has not made its way into at least <em>one</em> of these two old-school editors.</p>
<p><strong>Question:</strong> Has anyone ever seen or implemented this feature in either Emacs, Vim, or both? If so, please point me to a link, script, reference or summary that explains the details.</p>
<p>If you know an alternate way to do the same (or similar) thing, please let me know.</p>
| [
{
"answer_id": 396535,
"author": "Charlie Martin",
"author_id": 35092,
"author_profile": "https://Stackoverflow.com/users/35092",
"pm_score": 3,
"selected": false,
"text": "M-x find-grep find-next"
},
{
"answer_id": 399143,
"author": "Trey Jackson",
"author_id": 6148,
... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42223/"
] |
396,500 | <p>Is there any way to render a Silverlight text to a path or graphics object <strong>at runtime</strong>? I know this can be done using the design tools, but I want to be able to do this on the fly.</p>
<p>I've seen an example that <a href="http://blogs.msdn.com/webnext/archive/2007/05/22/silverlight-convert-text-to-path.aspx" rel="nofollow noreferrer">calls a webservice which uses WPF constructs to convert a WPF FormattedText object to a PathGeometry</a>, but those objects aren't available in Silverlight.</p>
<p>I'm pretty sure this just isn't supported in Silverlight, but thought it was worth asking.</p>
| [
{
"answer_id": 6070579,
"author": "Bathineni",
"author_id": 761357,
"author_profile": "https://Stackoverflow.com/users/761357",
"pm_score": 0,
"selected": false,
"text": "/// Method tested with SilverLight 2.0\n\n\n// this method will generates path with the data string\n\npublic PathGeo... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5/"
] |
396,506 | <p>I am looking to find a librray that emulates part of the capabilities of Ruby's ERB library. ie substitute text for variables between <% and %>. I dont need the code execution part that ERB provides but if you know of something that has this I would be super appreciative.</p>
| [
{
"answer_id": 396637,
"author": "Patrik Svensson",
"author_id": 936,
"author_profile": "https://Stackoverflow.com/users/936",
"pm_score": 2,
"selected": false,
"text": "Substitutioner sub = new Substitutioner(\n \"Hello world <%=Wow%>! My name is <%=Name%>\");\n\nMyClass myClass = ne... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10676/"
] |
396,513 | <p>As I've been incorporating the Linq mindset, I have been more and more inclined to pass around collections via the <code>IEnumerable<T></code> generic type which seems to form the basis of most Linq operations.</p>
<p>However I wonder, with the late evaluation of the <code>IEnumerable<T></code> generic type if that is a good idea. Does it make more sense to use the <code>T[]</code> generic type? <code>IList<T></code>? Or something else?</p>
<p><strong>Edit:</strong> The comments below are quite interesting. One thing that has not gotten addressed though seems to be the issue of thread safety. If, for example, you take an <code>IEnumerable<T></code> argument to a method and it gets enumerated in a different thread, then when that thread attempts to access it the results might be different than those that were meant to be passed in. Worse still, attempting to enumerate an <code>IEnumerable<T></code> twice - I believe throws an exception. Shouldn't we be striving to make our methods thread safe?</p>
| [
{
"answer_id": 396541,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 2,
"selected": false,
"text": "T[] IEnumerable<T>"
},
{
"answer_id": 396544,
"author": "Jay Bazuzi",
"author_id": 5314,
"author_... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5056/"
] |
396,519 | <p>I'm working on a program that uses PHP's internal array pointers to iterate along a multidimensional array. I need to get an element from the current row, and I've been doing it like so:</p>
<pre><code>$arr[key($arr)]['item']
</code></pre>
<p>However, I'd much prefer to use something like:</p>
<pre><code>current($arr)['item'] // invalid syntax
</code></pre>
<p>I'm hoping there's a function out there that I've missed in my scan of the documentation that would enable me to access the element like so:</p>
<pre><code>getvalue(current($arr), 'item')
</code></pre>
<p>or</p>
<pre><code>current($arr)->getvalue('item')
</code></pre>
<p>Any suggestions?</p>
| [
{
"answer_id": 396532,
"author": "Adam Wright",
"author_id": 1200,
"author_profile": "https://Stackoverflow.com/users/1200",
"pm_score": 5,
"selected": true,
"text": "function getvalue($array, $key)\n{\n return $array[$key];\n}\n current($arr)['item']"
},
{
"answer_id": 398104,
... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/658/"
] |
396,521 | <pre><code>int z = 1;
double result = Math.Log(z); //works
</code></pre>
<p>However trying to do the same thing with an array of numbers doesn't work:</p>
<pre><code>int[] z = new [] {1,2,3,4};
double[] result = Math.Log(z); //Syntax 1 - error CS1503: Argument '1': cannot convert from 'int[]' to 'double'
double[] result = z.Select(p => Log(p)).ToArray(); //Syntax 2 - OK
</code></pre>
<p>How can I make Syntax #1 work? Syntax #2 seems dirty to me.</p>
| [
{
"answer_id": 396534,
"author": "user21826",
"author_id": 21826,
"author_profile": "https://Stackoverflow.com/users/21826",
"pm_score": -1,
"selected": false,
"text": "\nfor (int i = 0; i < z.Length; i++)\n{\n Math.Log(z[i]);\n}\n \n static void Process()\n {\n ... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
396,545 | <p>Are there any Vi clones that are still in wide use today (besides Viper mode in Emacs ;)), other than Vim? If so, what are the pros/cons to using it instead of Vim?</p>
| [
{
"answer_id": 411090,
"author": "Dave Sherohman",
"author_id": 18914,
"author_profile": "https://Stackoverflow.com/users/18914",
"pm_score": 0,
"selected": false,
"text": "elvis vim"
}
] | 2008/12/28 | [
"https://Stackoverflow.com/questions/396545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
396,557 | <p>Using a few different patterns but they each come up with this error - so what's wrong?</p>
<p>My shortest one to diagnose is:</p>
<pre><code>$pattern = "<img([^>]*[^/])>";
preg_match_all($pattern, $subject, $matches);
</code></pre>
<p>Thanks</p>
| [
{
"answer_id": 396563,
"author": "PEZ",
"author_id": 44639,
"author_profile": "https://Stackoverflow.com/users/44639",
"pm_score": 4,
"selected": false,
"text": "$pattern = \"#<img([^>]*[^/])>#i\";\n"
},
{
"answer_id": 396571,
"author": "Waquo",
"author_id": 34149,
"a... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
396,567 | <p>Is there a standard way to do an <code>fopen</code> with a Unicode string file path?</p>
| [
{
"answer_id": 396587,
"author": "TokenMacGuy",
"author_id": 49287,
"author_profile": "https://Stackoverflow.com/users/49287",
"pm_score": 2,
"selected": false,
"text": "$ locale\nLANG=en_US.UTF-8\nLC_CTYPE=\"en_US.UTF-8\"\n"
},
{
"answer_id": 396606,
"author": "rob",
"au... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3153/"
] |
396,569 | <p>Currently, I only know a way of doing RPC for POJOs in Java, and is with the very complex EJB/JBoss solution. </p>
<p>Is there any better way of providing a similar functionality with a thiner layer (within or without a Java EE container), using RMI or something that can serialize and send full blown objects over the wire?</p>
<p>I'm not currently interested in HTTP/JSON serialization BTW.</p>
<p><em>EDIT</em>: For clarification: I'm trying to replace an old EJB 2.1/JBoss 4 solution with something more easy to manage at the container level. I need to have entire control over the database(planning to use iBATIS which would allow me to use fairly complex SQL very easily), but the only things I want to keep over the wire are:</p>
<ul>
<li>Invocation of lookup/data modification methods (automagic serialization goes here). </li>
<li>Transparent session control (authentication/authorization). I still have to see how to accomplish this.</li>
</ul>
<p>Both items have to work as a whole, of course. No access should be granted to users without credentials.</p>
<p>Because I'm not very fond of writing webapps, I plan to build a GUI (Swing or SWT) that would only manage POJOs, do some reporting and invoke methods from the container. I want the serialization to be as easy as possible.</p>
| [
{
"answer_id": 396775,
"author": "cletus",
"author_id": 18393,
"author_profile": "https://Stackoverflow.com/users/18393",
"pm_score": 3,
"selected": true,
"text": "HttpSession"
}
] | 2008/12/28 | [
"https://Stackoverflow.com/questions/396569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861/"
] |
396,579 | <p>I'm trying to create a randomized maze in C++, but I can't start because I don't know how to create grids or cells. How could I create it? And I also want to create it using ASCII characters. how can i store it in array? (can any one give a sample code and some explanation so i can understand it better)</p>
<p>Another question: What data stuctures should I need to learn and use? I'm planning to use Eller's algorithm or Kruskal's algorithm.</p>
<p>Thank you guys for helping me! im a begginer programmer, and i want to learn about this, because this is a part of my project, thank you vary much!</p>
| [
{
"answer_id": 396600,
"author": "ShreevatsaR",
"author_id": 4958,
"author_profile": "https://Stackoverflow.com/users/4958",
"pm_score": 3,
"selected": false,
"text": "(x,y) (x,y) (x,y±1) (x±1,y) -- (x,y) (x,y+1) | (x,y) (x+1,y)"
},
{
"answer_id": 396611,
"author": "stalepret... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49609/"
] |
396,586 | <p>I am looking for a XSL snippet that simply returns the XML unaltered. It sounds trivial but I can't seem to find an example anywhere on the web. Any help out there? </p>
| [
{
"answer_id": 396595,
"author": "krosenvold",
"author_id": 23691,
"author_profile": "https://Stackoverflow.com/users/23691",
"pm_score": 0,
"selected": false,
"text": "<xsl:template match =\"/\">\n <xsl:copy-of select=\".\"/>\n</xsl:template>\n"
},
{
"answer_id": 396694,
"a... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49611/"
] |
396,589 | <p>Can I develop a windows application using .NET framework and IBM.Data.DB2 provider to access a DB2 database running on OS/390?</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 396863,
"author": "paxdiablo",
"author_id": 14860,
"author_profile": "https://Stackoverflow.com/users/14860",
"pm_score": 1,
"selected": false,
"text": "db2jcc_cisuz.jar"
}
] | 2008/12/28 | [
"https://Stackoverflow.com/questions/396589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
396,594 | <p>Is there any way to force PHP to blow up (error, whatever) if I misspell a variable name? What about if I'm using an instance of a class and I spell the name of a variable wrong?</p>
<p>[I know that I should just get used to it, but maybe there's a way to enforce name checking?] </p>
<p>Thanks!</p>
<p><strong>Edit:</strong> Sorry, that wasn't very specific. Here's the code, and I would like to get <strong>two</strong> errors. Right now I only get one (for the last line).</p>
<pre><code>error_reporting(E_ALL|E_STRICT);
class Joe {
public $lastName;
}
$joe = new Joe();
$joe->lastNombre = "Smith";
echo "And here it is " . $jose;
</code></pre>
| [
{
"answer_id": 396604,
"author": "Ryan Doherty",
"author_id": 956,
"author_profile": "https://Stackoverflow.com/users/956",
"pm_score": 1,
"selected": false,
"text": "error_reporting(E_ALL);\n php_error_reporting=5\n"
},
{
"answer_id": 396605,
"author": "PEZ",
"author_id"... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8047/"
] |
396,610 | <p>I have a DateTime which I want to store in a Date MySQL column. I am using MySQLi and prepared statements. </p>
<p>When binding parameters, I cannot specify date as a type, only strings and integers.</p>
<p>How do I convert the DateTime to a MySQL date string representation? There is very little documentation on the DateTime class.</p>
| [
{
"answer_id": 396628,
"author": "Bill Karwin",
"author_id": 20860,
"author_profile": "https://Stackoverflow.com/users/20860",
"pm_score": 3,
"selected": true,
"text": "SELECT * FROM MyTable WHERE DateTimeCol = ?\n YYYY-MM-DD HH:MM <?php $mysql_date = date('Y-m-d H:i:s', $timestamp); ?>\... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
396,620 | <p>I'm wondering if there is an equivalent function to PHP's <code>call_user_func()</code> in ASP.NET application. I'm looking to do a conversion from a PHP application to ASP.NET as a means of teaching myself the language, by taking a CMS I built professionally and trying to recreate it in this other language.</p>
<p>The reason I need a function similar to this, is because the current structure of my PHP CMS involves a plugin architecture, and specific parts of the CMS expose themselves for the plugins, and it then handles the returned information as an array. It's pretty much the same system Drupal uses.</p>
<p>Am I perhaps on the wrong track with this?</p>
<p>I think for clarification I should provide an example of how this works in my current system:</p>
<pre><code><?php
class Test {
function TestMessage() {
// set up array
$arrTest = array("Hello", "World");
// get extra values from all available plugins
$arrExtras = CMS::InvokeHook("HelloTest");
// now contains Hello, World, Foo, Bar
$arrTests = array_merge($arrTest, $arrExtras);
}
}
class CMS {
InvokeHook($function) {
// now contains a couple plugins
$plugins = CMS::GetPlugins();
// empty array of values
$values = array();
foreach($plugins as $plugin) {
// if this plugin has the called method...
if(method_exists($plugin, $function)) {
// call the function and merge in the results
$values[] = call_user_func(array($plugin, $function));
}
}
// return results as an array
return $values;
}
}
class FooTest {
function HelloTest() {
return "Foo";
}
}
class BarTest {
function HelloTest() {
return "Bar";
}
}
?>
</code></pre>
<p>NOTE: The InvokeHook() call is simplified as I'm writing this from memory, but that is the gist of it.</p>
| [
{
"answer_id": 396653,
"author": "Oli",
"author_id": 12870,
"author_profile": "https://Stackoverflow.com/users/12870",
"pm_score": 0,
"selected": false,
"text": "System.Reflection.MethodInfo method = this.GetType().GetMethod(myMethodName);\n// method.Invoke(args, null);\n"
},
{
"... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41654/"
] |
396,621 | <p>I'm trying to combine a number of <code>List<T> where T:IGetTime</code> (i.e <code>T</code> will always have method <code>getTime()</code>).</p>
<p>Then I'm trying order the items by the <code>DateTime</code> that <code>getTime()</code> returns. </p>
<p>My LINQ looks like this:</p>
<pre><code>public static List<T> Combine(List<T> one, List<T> two, List<T> three)
{
var result = from IGetTime item in one
from IGetTime item2 in two
from IGetTime item3 in three
select new{ item, item2, item3 };
return result.ToList();
}
</code></pre>
<p>I've yet to add an <code>orderby</code>. Which should look somthing like this:</p>
<pre><code>var thestream = from T item in this
orderby item.getTime() descending
select item;
</code></pre>
<p>Is there anyway to both combine and order the final list????</p>
<p>Thanks in advance,</p>
<p>Roberto</p>
| [
{
"answer_id": 396629,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 6,
"selected": true,
"text": "IEnumerable<X> X T return one.Concat(two)\n .Concat(three)\n .OrderByDescending(x => x.GetTime())\n ... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5648/"
] |
396,644 | <p>I'm interested in using something other than the <strong>C</strong> preprocessor to preprocess my <strong>C</strong> and Objective-C source code. Are there good alternatives?</p>
<p>An example would be something that allowed one to escape out into a python or perl snippet in the middle of <strong>C</strong> code, and where the snippet spit out <strong>C</strong> that is then compiled as normal.</p>
| [
{
"answer_id": 396692,
"author": "strager",
"author_id": 39992,
"author_profile": "https://Stackoverflow.com/users/39992",
"pm_score": 2,
"selected": false,
"text": "#include #include"
},
{
"answer_id": 397000,
"author": "Norman Ramsey",
"author_id": 41661,
"author_pr... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17320/"
] |
396,649 | <p>Is it possible to retrieve the geometric position (i.e. top/left offsets from either the parent element, the page, etc) of a text node?</p>
| [
{
"answer_id": 49642909,
"author": "fregante",
"author_id": 288906,
"author_profile": "https://Stackoverflow.com/users/288906",
"pm_score": 3,
"selected": false,
"text": "Range.getBoundingClientRect() // Get your text node\nconst el = document.querySelector('strong')\nconst textNode = el... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27122/"
] |
396,663 | <p>For testing purposes I need my ABAP program to wait for few seconds. How can this be done?</p>
| [
{
"answer_id": 396903,
"author": "Esti",
"author_id": 25687,
"author_profile": "https://Stackoverflow.com/users/25687",
"pm_score": 6,
"selected": true,
"text": "WAIT UP TO 42 SECONDS.\nWAIT UP TO '0.5' SECONDS. \" decimals are possible since ABAP 7.40 SP 8\n ENQUE_SLEEP CALL FUNCTIO... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25737/"
] |
396,674 | <p>I'm working on a WordPress template and need to add a hyperlink to the cartoon bubble at the top of the page. The bubble, as far as I can tell, is php. Where do I insert the href?</p>
<pre><code><h1><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>
</code></pre>
<p></p>
<p>The href should point to <a href="http://www.ojaivalleynews.com" rel="nofollow noreferrer">www.ojaivalleynews.com</a></p>
<p>The blog url is <a href="http://www.ovnblog.com" rel="nofollow noreferrer">www.ovnblog.com</a> if you want a visual on the bubble. I've used firebug to ispect, but alas I don't know enough about php to make sense of it.</p>
<h2>Update</h2>
<p>I missed the second line of code regarding the above question, and based off of the suggestions here, have made corrections to this line and it works.</p>
<pre><code><h1><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div id="bubble"><p><a href="http://www.ojaivalleynews.com/" target="_blank"><?php bloginfo('description'); ?></p></div>
</code></pre>
| [
{
"answer_id": 396681,
"author": "Patryk Kordylewski",
"author_id": 30927,
"author_profile": "https://Stackoverflow.com/users/30927",
"pm_score": 1,
"selected": false,
"text": "<h1><a href=\"<?php echo bloginfo('url'); ?>/\"><?php echo bloginfo('name'); ?></a></h1>\n"
},
{
"answe... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396674",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39781/"
] |
396,684 | <p>How should I perform garbage collection in a program that consists of multiple threads or processes?</p>
<p>How can I scan the stack from each of those threads and processes?</p>
<p>Does each process require its own garbage collection routine? Is it a good idea to run the garbage collector in a separate thread/process from the actual program?</p>
| [
{
"answer_id": 396700,
"author": "Hrvoje Prgeša",
"author_id": 45875,
"author_profile": "https://Stackoverflow.com/users/45875",
"pm_score": 3,
"selected": false,
"text": "no-return function XY (int):\n load_param 1 \n ipush 1\n iadd\n call Z (assume: int function Z (int, int))\n new som... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21711/"
] |
396,706 | <p>Is it ok to do the following:</p>
<pre><code>View(new {Object A, Object B})
</code></pre>
<p>Or should Object A and Object B be explicitly declared in a new type?</p>
<p>Thanks.</p>
| [
{
"answer_id": 396715,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 3,
"selected": true,
"text": "TypeDescriptor"
},
{
"answer_id": 396719,
"author": "Todd Smith",
"author_id": 31624,
"author_prof... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49632/"
] |
396,739 | <p>Quite often I come across a nice looking or functional website, and wonder what technology was used to create it. What techniques are available to figure out what a
particular website was built with?</p>
<p>Few frameworks seem to include any kind of generator meta tag like web editors do. Are there any tell-tale signs of particular languages and/or frameworks?</p>
<hr>
<p><strong><em>Summary of answers</em></strong></p>
<p>Site URLs may betray the framework and/or programming language but cannot be relied upon (e.g. file extensions such as .asp). HTTP response headers, cookies, stylesheets and source comments may also give clues.</p>
<p>Some nice tools for querying site details (no doubt there are many more):</p>
<ul>
<li><a href="http://builtwith.com/" rel="noreferrer">BuiltWith</a></li>
<li><a href="http://www.domaintools.com/" rel="noreferrer">DomainTools</a></li>
<li><a href="http://news.netcraft.com/" rel="noreferrer">NetCraft</a></li>
<li><a href="http://w3techs.com/sites" rel="noreferrer">W3Techs</a></li>
<li><a href="http://www.similartech.com" rel="noreferrer">SimilarTech</a></li>
</ul>
<p>Firefox addons:</p>
<ul>
<li><a href="http://wappalyzer.com/" rel="noreferrer">Wappalyzer</a> - CMS, frameworks/libraries, e-commerce, message boards etc.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2166" rel="noreferrer">Domain Details</a> - IP, country and webserver details</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/10083" rel="noreferrer">Library Detector</a> - Javascript libraries in use</li>
</ul>
<p>Chrome Extensions:</p>
<ul>
<li><a href="http://wappalyzer.com/" rel="noreferrer">Wappalyzer</a></li>
<li><a href="https://chrome.google.com/webstore/detail/similartech-site-technolo/jiabgmelnfhgjkfdaoiccfcbaedjfcnm" rel="noreferrer">SimilarTech</a></li>
<li><a href="https://chrome.google.com/webstore/detail/pagexray/aedmpdookgbneegaeajpoldpnpfbpmlb" rel="noreferrer">PageXray</a></li>
</ul>
<p>Bookmarklets:</p>
<ul>
<li><a href="http://blog.olicio.us/2008/11/08/wtframework-bookmarklet/" rel="noreferrer">WTFramework</a> - shows Javascript framework in use</li>
</ul>
| [
{
"answer_id": 396774,
"author": "Milo",
"author_id": 49649,
"author_profile": "https://Stackoverflow.com/users/49649",
"pm_score": 2,
"selected": false,
"text": "__VIEWSTATE _ctl0 model_name[attribute_name]"
},
{
"answer_id": 7540125,
"author": "basilboli",
"author_id": ... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42974/"
] |
396,748 | <p>I am wondering if there is away (possibly a better way) to order by the order of the values in an IN() clause.</p>
<p>The problem is that I have 2 queries, one that gets all of the IDs and the second that retrieves all the information. The first creates the order of the IDs which I want the second to order by. The IDs are put in an IN() clause in the correct order.</p>
<p>So it'd be something like (extremely simplified):</p>
<pre><code>SELECT id FROM table1 WHERE ... ORDER BY display_order, name
SELECT name, description, ... WHERE id IN ([id's from first])
</code></pre>
<p>The issue is that the second query does not return the results in the same order that the IDs are put into the IN() clause.</p>
<p>One solution I have found is to put all of the IDs into a temp table with an auto incrementing field which is then joined into the second query.</p>
<p>Is there a better option?</p>
<p><strong>Note:</strong> As the first query is run "by the user" and the second is run in a background process, there is no way to combine the 2 into 1 query using sub queries.</p>
<p>I am using MySQL, but I'm thinking it might be useful to have it noted what options there are for other DBs as well.</p>
| [
{
"answer_id": 396758,
"author": "chaos",
"author_id": 47529,
"author_profile": "https://Stackoverflow.com/users/47529",
"pm_score": 1,
"selected": false,
"text": "SELECT name, description, ...\nWHERE id IN\n (SELECT id FROM table1 WHERE...)\nORDER BY\n (SELECT display_order FROM t... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5441/"
] |
396,749 | <p>What is the recommended method for escaping variables before inserting them into the database in Java?</p>
<p>As I understand, I can use PreparedStatement.setString() to escape the data, but PreparedStatement seems somewhat impractical if I don't plan to run the same query ever again.. Is there a better way to do it without preparing every query?</p>
| [
{
"answer_id": 396765,
"author": "S.Lott",
"author_id": 10661,
"author_profile": "https://Stackoverflow.com/users/10661",
"pm_score": 6,
"selected": true,
"text": "PreparedStatement PreparedStatement"
}
] | 2008/12/28 | [
"https://Stackoverflow.com/questions/396749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49644/"
] |
396,756 | <p>I'm creating an API for a module and after I created several methods inside my classes, I asked myself this question.</p>
<p>Right now, and as an example, I'm doing this:</p>
<pre><code>public Company GetMonitoredCompany( String companyName ) { ... }
public List<Company> GetMonitoredCompanies( ) { ... }
</code></pre>
<p>But I realize that for several times that I use other API's / Services sometimes they have <strong>Collection</strong> in the name maybe like:</p>
<pre><code>public List<Company> GetMonitoredCompanyCollection( ) { ... }
</code></pre>
<p>is there a rule for this? a pattern? or either way should be ok?</p>
| [
{
"answer_id": 396837,
"author": "Alex",
"author_id": 42707,
"author_profile": "https://Stackoverflow.com/users/42707",
"pm_score": 1,
"selected": false,
"text": "ListMonitoredCompanies\n"
}
] | 2008/12/28 | [
"https://Stackoverflow.com/questions/396756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28004/"
] |
396,817 | <p>Following on from my question on the <em><a href="https://stackoverflow.com/questions/396778/legalities-of-screen-scraping">Legalities of screen scraping</a></em>, even if it's illegal people will still try, so:</p>
<p><strong>What technical mechanisms can be employed to <em>prevent</em> or at least disincentivise screen scraping?</strong></p>
<p>Oh and just for grins and to make life difficult, it may well be nice to retain access for search engines. I may well be playing devil's advocate here but there is a serious underlying point.</p>
| [
{
"answer_id": 899267,
"author": "Dave",
"author_id": 9056,
"author_profile": "https://Stackoverflow.com/users/9056",
"pm_score": 2,
"selected": false,
"text": " Price : 1\n Price : 2\n Price\\n:\\n3\n"
}
] | 2008/12/28 | [
"https://Stackoverflow.com/questions/396817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42974/"
] |
396,830 | <p>I work at a small LAMP Development Studio where the idea has been to just get the code done and go on to the next item on the list.</p>
<p>The team works in Zend Studio 5.5 connected to the Live server via FTP or SFTP. What they love about this is the speed of their deployment of code (since its just modifying live code).</p>
<p>But of course this is not good due to many obvious reasons.</p>
<p>I would like to move them to a Versioning System (CVS, SVN or any other tool) but the catch is, I am not their senior so I need a carrot for them to start using this.</p>
<p>What kind of setup would I need to build on their machine so they can code along as usual?</p>
<p>What I would do is create this setup on my machine and then show them. </p>
<p>I know this is kinda unusual but it's turned into a passion of mine to change their way of thinking from the usual hacking of code to structure and elegance. Thanks.</p>
<p>UPDATE (for Jonathan Leffler's answer):</p>
<ol>
<li>Yes</li>
<li>No</li>
<li>Yes, they really do</li>
</ol>
<p>Question also, the studio makes a centralized CMS system that is hosted on hundreds of sites, they need to modify individual sites, should the sites be in the main compository or within their own one?</p>
| [
{
"answer_id": 397682,
"author": "SchizoDuckie",
"author_id": 18077,
"author_profile": "https://Stackoverflow.com/users/18077",
"pm_score": 2,
"selected": false,
"text": " echo(' updating from svn<br>' );\n $username = Settings::Load()->Get('svn','username');\n $password = Setti... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22459/"
] |
396,856 | <p>I don't understand how classes are used. The following code gives me an error when I try to use the class.</p>
<pre><code>class MyStuff:
def average(a, b, c): # Get the average of three numbers
result = a + b + c
result = result / 3
return result
# Now use the function `average` from the `MyStuff` class
print(MyStuff.average(9, 18, 27))
</code></pre>
<p>Error:</p>
<pre><code>File "class.py", line 7, in <module>
print(MyStuff.average(9, 18, 27))
TypeError: unbound method average() must be called with MyStuff instance as first argument (got int instance instead)
</code></pre>
<p>What's wrong?</p>
| [
{
"answer_id": 396871,
"author": "Ryan",
"author_id": 49139,
"author_profile": "https://Stackoverflow.com/users/49139",
"pm_score": 7,
"selected": true,
"text": "x = mystuff()\nprint x.average(9,18,27)\n TypeError: average() takes exactly 3 arguments (4 given)\n"
},
{
"answer_id"... | 2008/12/28 | [
"https://Stackoverflow.com/questions/396856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12386/"
] |
396,896 | <p>I would like to change the contents of the list of a <code>JComboBox</code> (like adding another list in place of and older one). Is there any way I might be able to do that?
Thanks in advance!</p>
| [
{
"answer_id": 8386476,
"author": "pal",
"author_id": 482808,
"author_profile": "https://Stackoverflow.com/users/482808",
"pm_score": 3,
"selected": false,
"text": "oldComboBox.setModel(new JComboBox<>(new_items).getModel());\n"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/396896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23486/"
] |
396,905 | <p>I'm using Delphi 2007.</p>
<p>I am copying files to a remote drive. When the copying ends, I shutdown/standby the machine. It can happen that some files don't get copied from buffer to disk, and the remote disk gets disconnected, so the backup is not completed. I need to detect disk activity on that disk to properly be able to take the close action on the machine.</p>
<p>Is there a way to detect disk activity in this scenario?</p>
| [
{
"answer_id": 396982,
"author": "Wouter van Nifterick",
"author_id": 38813,
"author_profile": "https://Stackoverflow.com/users/38813",
"pm_score": 3,
"selected": false,
"text": "// ==================== DISC DRIVE MONITOR =====================================\n//\n// Class and Component ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/396905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48705/"
] |
396,913 | <p>If I have a certain week number (eg 51) and a given year (eg 2008), how do I find the date of the first Monday of that same week?</p>
<p>Many thanks</p>
| [
{
"answer_id": 396926,
"author": "Robert Gamble",
"author_id": 25222,
"author_profile": "https://Stackoverflow.com/users/25222",
"pm_score": 6,
"selected": true,
"text": ">>> import time\n>>> time.asctime(time.strptime('2008 50 1', '%Y %W %w'))\n'Mon Dec 15 00:00:00 2008'\n %U %W %W"
}... | 2008/12/29 | [
"https://Stackoverflow.com/questions/396913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/143732/"
] |
396,930 | <p>It would appear that CHM help files are no longer the help file format of choice.</p>
<p>WinHelp<br>
- obsolete</p>
<p>HtmlHelp (CHM)<br>
- not supported on Vista by default<br>
- does not work well on a network share</p>
<p>Help 2 (HXS)<br>
- I understand this is used in VS2005+ for displaying help</p>
<p>Web Based<br>
- Could be hard to manage for multiple versions</p>
<p>What help file format would you use in a new (C#) application that provides multiple versions from the same codebase?</p>
<p>We would like to use CHM help however it doesn't appear to be the direction that Microsoft wants us to move in. </p>
<p>Does anyone employ HXS for their help files?</p>
<p>Feeback appreciated</p>
<hr>
<p>Update based upon lassevk comments;</p>
<p>Looks as though HXS help is not intended to be used for normal help projects. </p>
<hr>
| [
{
"answer_id": 396939,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 3,
"selected": false,
"text": "this.Mode = Modes.Rant;\n this.Mode = Modes.JustTicked;\n"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/396930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48499/"
] |
396,933 | <p>I need some mind reading here, since I am trying to do what I do not completely understand.</p>
<p>There is a 32-bit application (electronic trading application called CQG) which provides a COM API for external access. I have sample programs and scripts which access this API from Excel, .NET (C++, VB and C#) and shell VBScript. I have these .NET applications as source code and as compiled executables (32-bit, compiled on Windows XP).</p>
<p>Now I have Windows Vista Home 64-bit which makes my head to spin. Excel examples work just fine (in Excel 2003). Compiled .NET sample executables work as well.</p>
<p>But when I am trying to run .NET C# sample converted to and compiled by Visual Studio C# Expression, or run the VBScript script, I am getting error 80004005 when trying to create an object. Initially the .NET application also gave me 80040154 but then I figured how to make it produce 32-bit code and not 64-bit, so now the errors in C# and VBScript applications are the same. That's all the progress I got for now.</p>
<p>And yes, I tried running 32-bit versions of cscript.exe/WScript from SysWOW64 folder on my VBS, but still the result is the same (80004005).</p>
<p>How to solve this problem? I am almost ready to believe it is practically impossible, but the fact that Excel VBA works and .NET executables compiled on Windows XP run just fine just makes me angry. There should be a way to beat this thing (some secret which probably only Windows Vista developers know)! I will appreciate any help!</p>
<p>PS: I believe code samples do not make much sense here, but this is the line of VBScript which fails:</p>
<pre><code>Set CEL = WScript.CreateObject("CQG.CQGCEL.4.0", "CEL_")
</code></pre>
<p>And this is C#:</p>
<pre><code>CQGCEL CEL = new CQGCEL();
</code></pre>
<p>Update: Forgot to say <a href="http://en.wikipedia.org/wiki/User_Account_Control" rel="nofollow noreferrer">UAC</a> is off, of course. And I am working from account with administrator priviledges.</p>
<p>I also tried watching which registry keys are read using Process Monitor but everything looks OK for GUIDs of this object. I could not recognize some other GUIDs so I am not sure whether they were critical or not.</p>
<p>Is there a chance that this COM object uses Internet Explorer and gets the wrong one (like Internet Explorer 7 instead of Internet Explorer 6 engine or something)?</p>
| [
{
"answer_id": 3527714,
"author": "xwiz",
"author_id": 425939,
"author_profile": "https://Stackoverflow.com/users/425939",
"pm_score": 1,
"selected": false,
"text": "bcdedit.exe /set {current} nx AlwaysOff\n bcdedit.exe /set {current} nx AlwaysOn\n wmic OS Get DataExecutionPrevention_Sup... | 2008/12/29 | [
"https://Stackoverflow.com/questions/396933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49678/"
] |
396,943 | <p>How do we combine <a href="https://stackoverflow.com/questions/19412/how-to-request-a-random-row-in-sql">How to request a random row in SQL?</a> and <a href="https://stackoverflow.com/questions/183124/multiple-random-values-in-sql-server-2005">Multiple random values in SQL Server 2005</a> to select N random rows using a single pure-SQL query? Ideally, I'd like to avoid the use of stored procedures if possible. Is this even possible?</p>
<p><strong>CLARIFICATIONS</strong>:</p>
<ol>
<li>Pure SQL refers to as close as possible to the ANSI/ISO standard.</li>
<li>The solution should be "efficient enough". Granted ORDER BY RAND() might work but as others have pointed out this isn't feasible for medium-sized tables.</li>
</ol>
| [
{
"answer_id": 396946,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 3,
"selected": false,
"text": "SELECT * FROM table ORDER BY RAND() LIMIT 1\n SELECT TOP 1 * FROM table ORDER BY newid()\n"
},
{
"answer_id":... | 2008/12/29 | [
"https://Stackoverflow.com/questions/396943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14731/"
] |
396,947 | <p>Is it possible to detect if a page is opened in 2 different browsers?</p>
<p>I have built an small app, that stores some data in $_SESSION, and the problem is that when multiple tabs gets opened, the session vars gets overwritten (search filters in a search form) and so the tabs may display the same results for apparently different searches.</p>
<p>The main browser used for this app is IE, so it took a while to hit this problem and the app got ..larger and harder to modify. </p>
<p>Until i fix all the references to this search, i would like to do a "quick & dirty fix" and deny opening two tabs with the same page,or at least display a warning..</p>
<p>edit:
@arjun: yes, i know, but i have to restore the search filters when the user return to the search page:) so $SESSION is the way to go for this. Also, the filters are sent down by AJAX and it gets hard to debug when you have lots of filters(GET is limited in size, so i use POST)</p>
<p>@tomhaigh: thx..but this is what i'm trying to do right now, but this will take a while because this tab "thing" affects the whole app, and i have to change the filters in all modules... i was looking for something quick&dirty for now. Tip: i dont want to use time() and rand() as theese functions can (and eventually will) generate duplicate numbers. In the new "rewrite" i use microtime from PHP and Date.getTime() in JS and concatenate theese 2 to generate a truly unique id. Also, i wrote a function to parse the SESSION from time to time and cleanup stored filters older than 2 hours so it wont grow too big.</p>
<p>@Gortok: i know..but is was designed with IE6 in mind and most of the users (something like 90%) still use IE6 while logging into this app... so i never saw the need to consider multiple open tabs.</p>
| [
{
"answer_id": 396969,
"author": "George Stocker",
"author_id": 16587,
"author_profile": "https://Stackoverflow.com/users/16587",
"pm_score": 0,
"selected": false,
"text": "$_SESSION"
},
{
"answer_id": 396979,
"author": "Laodimos",
"author_id": 49461,
"author_profile"... | 2008/12/29 | [
"https://Stackoverflow.com/questions/396947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11301/"
] |
396,955 | <p>For fun when I have time, I like to code games to see how hard it is or just because I want to see how it works from the inside or just for personal challenge. I just like coding. For now, I made <a href="http://pages.videotron.com/spirch/FredGames" rel="nofollow noreferrer">these ones</a>.</p>
<p>So I made a Sudoku board. First it was the normal 3x3x3 board but then someone asked me to do a 4x4x4 board. I was successful but my algorithm is pretty slow.</p>
<p>The question is, <strong>how would you do a fast algorithm for a 4x4x4 (or more) Sudoku board</strong>?</p>
<p>My current algorithm works like this: I will fill grid 1 with a random number, making sure I don't put back the same number, then switch to grid 2. When I'm in the position 0.0 or any other one in the grid I remove any possible number from grid 1. I go on like that for every line/column in the grid. (By now you can see that English is not my first language so I'm sorry if it's hard to understand.) </p>
<hr>
<p><strong>Update:</strong><br>
a little followup, a few months later.</p>
<p>My current solution can be found <a href="http://www.codeproject.com/KB/vb/CodeBehindSudoku.aspx" rel="nofollow noreferrer">here</a></p>
<p>So when I started this question, it as doing 1 grid every 30-50 seconds and now it's over 300 per seconds</p>
| [
{
"answer_id": 397165,
"author": "joel.neely",
"author_id": 3525,
"author_profile": "https://Stackoverflow.com/users/3525",
"pm_score": 3,
"selected": false,
"text": " 1 2 3 4 | 5 6 7 8 | 9 10 11 12 | 13 14 15 16\n 5 6 7 8 | 9 10 11 12 | 13 14 15 16 | 1 2 3 4\n 9 10 11 12... | 2008/12/29 | [
"https://Stackoverflow.com/questions/396955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40868/"
] |
396,973 | <p>I'm developing a web-based, turn-based strategy game which takes place on a 10x10 board.</p>
<p>Each tile represents an area of land and has its own set of statistics (eg, income, population, fertility, natural resources).</p>
<p>Each time the client loads it will download all of the information for the game (ie, loading the stats of only one tile is not necessary). The board size is static, that is, there are always exactly 100 tiles.</p>
<p>What would be the best option for storing this data on the server? (ignoring keys and such)</p>
<ul>
<li>In a database: a table with (num of statistics per tile) fields and 100 records for each game.</li>
<li>In a database: a table with one record for each game and 100*(num stats/tile) fields</li>
<li>In a flat file.</li>
</ul>
| [
{
"answer_id": 397011,
"author": "Soviut",
"author_id": 46914,
"author_profile": "https://Stackoverflow.com/users/46914",
"pm_score": 1,
"selected": false,
"text": "Table Board\n{\n BigInt id;\n String name;\n Date date_played;\n etc...\n}\n\nTable Tile\n{\n BigInt id;\n ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/396973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
397,001 | <p>I want to automatically commit the database when we copy files from one branch to the other in Subversion. Is it safe to use <code>svn commmit</code> as part of a pre-commit hook assuming that we do it in very specific cases?</p>
| [
{
"answer_id": 397092,
"author": "Otto",
"author_id": 9594,
"author_profile": "https://Stackoverflow.com/users/9594",
"pm_score": 3,
"selected": true,
"text": "svn commit pre-commit pre-commit"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1959/"
] |
397,019 | <p>I am not sure what the problem is but I keep receiving this error when I try to use a while statement in my code.</p>
<blockquote>
<p>Invalid token 'while' in class,
struct, or interface member
declaration</p>
</blockquote>
<p>I want to use a while loop to have something continuously update while a statement is true.</p>
<p>The rest of my code is rather long but whenever I type in the syntax:</p>
<pre><code>while(a<b)
{
//do whatever i want it to do here
}
</code></pre>
<p>It gives me that compiler error right off the bat. Not quite sure what the problem is. I am doing this in a C# windows application under the Form1.cs file with all the other event handlers (for buttons and such).
Thanks!</p>
<hr>
<p>I was unaware that loops had to be placed within a method (fairly new to c#), but I tried it and no errors were returned. Thanks for your help everybody!</p>
<p>Previously, I just had the loop within the main class of the program.</p>
| [
{
"answer_id": 28347042,
"author": "NealWalters",
"author_id": 160245,
"author_profile": "https://Stackoverflow.com/users/160245",
"pm_score": 0,
"selected": false,
"text": "public static string GetPasswordForEnvironment)\n public static string GetPasswordForEnvironment()\n"
},
{
... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49549/"
] |
397,034 | <p>So I was writing up a simple binary tree in Python and came across [...]</p>
<p>I don't believe this to be related to the Ellipsis object, more it seems to have something to do with an infinity loop (due to Python's shallow copy?). The source of this infinity loop and why it doesn't get expanded while expanding when accessed is something I'm completely lost to, however
<code></p>
<pre><code>>>> a
[[[[[], [], 8, 3], [[], [], 3, 2], 6, 3], [], 1, 4], [[], [], -4, 2], 0, 0]
>>> Keys(a)#With a+b
[0, 1, 6, 8, 3, -4]
>>> Keys(a)#With [a,b]
[8, [...], [...], 3, [...], [...], 6, [...], [...], 1, [...], [...], -4, [...], [...], 0, [...], [...]]
>>> Keys(a)[1]#??
[8, [...], [...], 3, [...], [...], 6, [...], [...], 1, [...], [...], -4, [...], [...], 0, [...], [...], 8, [...], [...], 3, [...], [...], 6, [...], [...], 1, [...], [...], -4, [...], [...], 0, [...], [...]]
</code></pre>
<p></code></p>
<p>Version using a+b</p>
<pre><code>def Keys(x,y=[]):
if len(x):y+=[x[2]]+Keys(x[0],y)+Keys(x[1],y)#Though it seems I was using y=y[:]+, this actually outputs an ugly mess
return y
</code></pre>
<p>version using [a,b]</p>
<pre><code>def Keys(x,y=[]):
if len(x):y+=[x[2],Keys(x[0],y),Keys(x[1],y)]
return y
</code></pre>
<p>So what exactly is [...]?</p>
| [
{
"answer_id": 397054,
"author": "CAdaker",
"author_id": 30579,
"author_profile": "https://Stackoverflow.com/users/30579",
"pm_score": 5,
"selected": false,
"text": ">>> a = [1,2]\n>>> a.append(a)\n>>> a\n[1, 2, [...]]\n>>> \n y y y return [x[2]]+keys(x[0])+keys(x[1])\n y += [x[2]]\nkeys... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40172/"
] |
397,052 | <p>I'm writing some functional tests for a controller in rails, using mocha to do mocking/stubbing. </p>
<p>Is there a way to prevent the template from being rendered during the test, so that I can test only the code in the controller?</p>
<p>It looks like rspec provides something like this, but I'm not using rspec.</p>
| [
{
"answer_id": 397188,
"author": "J Cooper",
"author_id": 38803,
"author_profile": "https://Stackoverflow.com/users/38803",
"pm_score": 0,
"selected": false,
"text": "render_to_string"
},
{
"answer_id": 397668,
"author": "Starr Horne",
"author_id": 37708,
"author_prof... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37708/"
] |
397,064 | <p>Imagine I am doing something like this:</p>
<pre><code>void *p = malloc (1000);
*((char*)p) = some_opcode;
*((char*)p+1) = another_opcode; // for the sake of the example: the opcodes are ok
....
etc...
</code></pre>
<p>How can I define a function pointer to call p as if it was a function? (i'm using VC++ 2008 express).</p>
<p>Thanks </p>
| [
{
"answer_id": 397066,
"author": "Eclipse",
"author_id": 8701,
"author_profile": "https://Stackoverflow.com/users/8701",
"pm_score": 3,
"selected": false,
"text": "typedef void (*voidFunc)();\n\nchar *p = malloc (1000);\np[0] = some_opcode;\np[1] = another_opcode; // for the sake of the ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49710/"
] |
397,073 | <p>I've a requirement of creating a HttpHandler that will serve an image file (simple static file) and also it'll insert a record in the SQL Server table. (e.g <a href="http://site/some.img" rel="nofollow noreferrer">http://site/some.img</a>, where some.img being a HttpHandler) I need an in-memory object (like Generic List object) that I can add items to on each request (I also have to consider a few hundreds or thousands requests per second) and I should be able unload this in-memory object to sql table using SqlBulkCopy. </p>
<p>List --> DataTable --> SqlBulkCopy</p>
<p>I thought of using the Cache object. Create a Generic List object and save it in the HttpContext.Cache and insert every time a new Item to it. This will NOT work as the CacheItemRemovedCallback would fire right away when the HttpHandler tries to add a new item. I can't use Cache object as in-memory queue.</p>
<p>Anybody can suggest anything? Would I be able to scale in the future if the load is more?</p>
| [
{
"answer_id": 400476,
"author": "patridge",
"author_id": 48700,
"author_profile": "https://Stackoverflow.com/users/48700",
"pm_score": 0,
"selected": false,
"text": "Private Shared Sub CacheRemovalCallbackFunction(ByVal cacheKey As String, ByVal cacheObject As Object, ByVal removalReaso... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1683839/"
] |
397,075 | <p>In C and C++, what is the difference between <code>exit()</code> and <code>abort()</code>? I am trying to end my program after an error (not an exception).</p>
| [
{
"answer_id": 397079,
"author": "Brian R. Bondy",
"author_id": 3153,
"author_profile": "https://Stackoverflow.com/users/3153",
"pm_score": 5,
"selected": false,
"text": "SomeClassType someobject;\n\nvoid myProgramIsTerminating1(void)\n{\n cout<<\"exit function 1\"<<endl;\n}\n\nvoid myP... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
397,085 | <p>I have a problem with CDATA deserialization using standard .Net XmlSerializer.</p>
<p><strong>Update</strong>: I get XML from external system and I can't influence it's format so I can't make CData be enclosed in a separate Element of Attribute.</p>
<p>Serialization gives this:</p>
<pre><code><?xml version="1.0" encoding="utf-16"?>
<MyClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><![CDATA[Hello, world!]]></MyClass>
</code></pre>
<p>Deserialization does not restore object to it's original state.</p>
<p>Here's class that is being serialized:</p>
<pre><code>public class MyClass
{
string _data;
[XmlIgnore]
public string Data
{
get { return _data; }
set { _data = value; }
}
[XmlAnyElement]
public XmlCDataSection CData
{
get { return new XmlDataDocument().CreateCDataSection(Data); }
set { Data = value.Value; }
}
}
</code></pre>
<p>Here's the test which fails:</p>
<pre><code>[Test]
public void CData_as_inner_text_test()
{
MyClass item = new MyClass();
item.Data = "Hello, world!";
XmlSerializer serializer = new XmlSerializer(item.GetType());
string serialized;
using (StringWriter sw = new StringWriter())
{
serializer.Serialize(sw, item);
serialized = sw.GetStringBuilder().ToString();
}
MyClass deserialized;
using (StringReader sr = new StringReader(serialized))
{
deserialized = (MyClass)serializer.Deserialize(sr);
}
Assert.AreEqual(item.Data, deserialized.Data); // For some reason, deserialized.Data == null
}
</code></pre>
<p>I found the same problem here but there's no answer:
<a href="http://bytes.com/groups/net-xml/179323-xmlserializer-xmlanyelement-cdata" rel="noreferrer">XmlSerializer, XmlAnyElement and CDATA</a></p>
| [
{
"answer_id": 397462,
"author": "oefe",
"author_id": 49793,
"author_profile": "https://Stackoverflow.com/users/49793",
"pm_score": 4,
"selected": true,
"text": "<MyClass><![CDATA[Hello, world!]]></MyClass>\n <MyClass>Hello, world!</MyClass>\n public class MyClass\n{\n string _data;\n... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1423922/"
] |
397,094 | <p>I have 3 drop down list having Date,Month ,Year.So when Updating I want this 3 Field to be a single Datafield in Sql Database. Iam using Asp.Net 2.0 Version(VB.Net).(Now these 3 Dropdown list values are saved as 3 Datafields in sql Database)</p>
| [
{
"answer_id": 397098,
"author": "Dave Markle",
"author_id": 24995,
"author_profile": "https://Stackoverflow.com/users/24995",
"pm_score": 2,
"selected": false,
"text": "Dim cmd as SqlCommand(\"update tableX set dt = @var where ID = 1\");\ncmd.Parameters.AddWithValue(\"@var\", new DateTi... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49722/"
] |
397,113 | <p>We have a user provided string that may contain unicode characters, and we want the robot to type that string.</p>
<p>How do you convert a string into keyCodes that the robot will use?<br>
How do you do it so it is also java version independant (1.3 -> 1.6)?</p>
<p>What we have working for "ascii" chars is</p>
<pre><code>//char c = nextChar();
//char c = 'a'; // this works, and so does 'A'
char c = 'á'; // this doesn't, and neither does 'Ă'
Robot robot = new Robot();
KeyStroke key = KeyStroke.getKeyStroke("pressed " + Character.toUpperCase(c) );
if( null != key ) {
// should only have to worry about case with standard characters
if (Character.isUpperCase(c))
{
robot.keyPress(KeyEvent.VK_SHIFT);
}
robot.keyPress(key.getKeyCode());
robot.keyRelease(key.getKeyCode());
if (Character.isUpperCase(c))
{
robot.keyRelease(KeyEvent.VK_SHIFT);
}
}
</code></pre>
| [
{
"answer_id": 397152,
"author": "javamonkey79",
"author_id": 27657,
"author_profile": "https://Stackoverflow.com/users/27657",
"pm_score": 2,
"selected": false,
"text": "Robot robot = new Robot();\nchar curChar = 'Ã';\n\n// -- isUnicode( char ) should be pretty easy to figure out\nif ( ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37558/"
] |
397,117 | <p>I have a window with a title on it. When the user selects a choice from a drop down list, the title image can change. The problem is when the image loads, it's a blurred, stretched, and pixelated. These are PNG files I'm working with and they look good prior to setting the source dynamically.</p>
<p>Here's the code I'm using to change the image's source.</p>
<pre><code>string strUri2 = String.Format(@"pack://application:,,,/MyAssembly;component/resources/main titles/{0}", CurrenSelection.TitleImage);
Stream iconStream2 = App.GetResourceStream(new Uri(strUri2)).Stream;
imgTitle.Source = HelperFunctions.returnImage(iconStream2);
</code></pre>
<p>Here are the helper functions.</p>
<pre><code> public static BitmapImage returnImage(Stream iconStream)
{
Bitmap brush = new Bitmap(iconStream);
System.Drawing.Image img = brush.GetThumbnailImage(brush.Height, brush.Width, null, System.IntPtr.Zero);
var imgbrush = new BitmapImage();
imgbrush.BeginInit();
imgbrush.StreamSource = ConvertImageToMemoryStream(img);
imgbrush.CreateOptions = BitmapCreateOptions.PreservePixelFormat;
imgbrush.EndInit();
var ib = new ImageBrush(imgbrush);
return imgbrush;
}
public static MemoryStream ConvertImageToMemoryStream(System.Drawing.Image img)
{
var ms = new MemoryStream();
img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
return ms;
}
</code></pre>
<p>And the XAML</p>
<pre><code> <Image x:Name="imgTitle" HorizontalAlignment="Left" VerticalAlignment="Bottom" Grid.Column="1" Grid.Row="1" Stretch="None" d:IsLocked="False"/>
</code></pre>
<p>And for Ref:</p>
<pre><code>xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
</code></pre>
<p>Anyone have any ideas what's up?</p>
| [
{
"answer_id": 397345,
"author": "Nir",
"author_id": 3509,
"author_profile": "https://Stackoverflow.com/users/3509",
"pm_score": 6,
"selected": true,
"text": "string strUri2 = String.Format(@\"pack://application:,,,/MyAseemby;component/resources/main titles/{0}\", CurrenSelection.TitleIm... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22451/"
] |
397,121 | <p>Hopefully I'm just missing something obvious, but I'm trying to get my head around the differences between the Load and the Shown events in <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a>.</p>
<p>Traditionally, I've only used Load (or actually OnLoad, since I think it's cleaner to override a method than to rely on the designer to hook up an event on yourself), since that is available in all versions of .NET. With .NET 2.0 the Shown event was introduced.</p>
<p>Now, if you look at the descriptions for these in the MSDN documentation ("Load: Occurs before a form is displayed for the first time.", "Shown: Occurs whenever the form is first displayed.") it <em>sounds</em> like the Load event should occur, then the form should become visible, then the Shown event should occur; the combination of the two thereby letting you carry out some tasks both before and after the form is visible. Makes sense, right?</p>
<p>However, experimentation has shown that the Shown event invariably occurs <em>before</em> the Load event, whenever I try it (and both occur before the form becomes visible). And yet, when I google around whenever I discover a page that talks about the order these events are fired in, they always list the Load event being fired first.</p>
<p>Am I just going crazy, or have I missed something? (And if they do occur at about the same time, then why was the Shown event added in the first place?)</p>
<p>(My current solution for doing something both before and after showing the form is to use OnLoad for the "before showing" stuff and start a short-duration one-shot timer for the "after showing" stuff. Which works OK and reliably, but it's a bit ugly and I was hoping there was a cleaner solution. But it looks like the Shown event isn't it.)</p>
| [
{
"answer_id": 397124,
"author": "Fredou",
"author_id": 40868,
"author_profile": "https://Stackoverflow.com/users/40868",
"pm_score": 1,
"selected": false,
"text": "Public Class Form1\n\nPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43534/"
] |
397,125 | <p>I'm trying to read the target file/directory of a shortcut (<code>.lnk</code>) file from Python. Is there a headache-free way to do it? The spec is way over my head.
I don't mind using Windows-only APIs.</p>
<p>My ultimate goal is to find the <code>"(My) Videos"</code> folder on Windows XP and Vista. On XP, by default, it's at <code>%HOMEPATH%\My Documents\My Videos</code>, and on Vista it's <code>%HOMEPATH%\Videos</code>. However, the user can relocate this folder. In the case, the <code>%HOMEPATH%\Videos</code> folder ceases to exists and is replaced by <code>%HOMEPATH%\Videos.lnk</code> which points to the new <code>"My Videos"</code> folder. And I want its absolute location.</p>
| [
{
"answer_id": 397137,
"author": "gak",
"author_id": 11125,
"author_profile": "https://Stackoverflow.com/users/11125",
"pm_score": 3,
"selected": false,
"text": "import os, sys\nimport pythoncom\nfrom win32com.shell import shell, shellcon\n\nshortcut = pythoncom.CoCreateInstance (\n she... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397125",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/109696/"
] |
397,128 | <p>I wrote a device controller (rs232) and it is being used successfully, however users want to view data and control the device (or perhaps communicate through my program) from Excel. I dismissed DDE as an option and found that RTD (IRtdServer) is probably a good start (though no way to send data back to the "server" from the real time data client). </p>
<p>I found these resources for the RTD part:
<a href="http://support.microsoft.com/?id=327215" rel="nofollow noreferrer">http://support.microsoft.com/?id=327215</a>
and
<a href="http://support.microsoft.com/?id=327215" rel="nofollow noreferrer">http://support.microsoft.com/?id=327215</a></p>
<p>This is a multi-threaded app and I had already added the ability to have multiple listeners on the com port so that I could update multiple clients. I will add the COM interface to the EXE.</p>
<p>But what I need after that is some way of controlling my app/proxying commands to the device through my app from Excel.</p>
<p>What would be the best way to do that?</p>
<p>Perhaps another COM interface and calling it from VBA or something? I am not familiar with using scripting from Excel, so perhaps someone can provice sample code or links that show both the code for a COM object and the accompanying VB(A?) code?</p>
<p>Keep in mind that this is an unmanaged C++ application and it cannot be converted to managed or C# right now. Alternatives using C# are welcome as well, but that is a long-term rewrite.</p>
<p>Thanks</p>
<p>EDIT
I have an alternative to adding COM support into the existing EXE. I think it is more flexible to add a two-way communications (cross platform - maybe boost or corba or just straight IP based with my own message protocol) </p>
<p>A COM server (or two) can wrap that communications channel - whatever it is. This doesn;t really affect my question at all - I still would like to know the options for controlling an external EXE from Excel.</p>
<p>EDIT
Not having to roll out .NET to customers is also an big plus. many of these devices are on PCs that are pretty old and have perhaps NT or XP on them and I don't relish increasing my setup/install package from 700KB to the ridiculous .NET install size...</p>
| [
{
"answer_id": 397137,
"author": "gak",
"author_id": 11125,
"author_profile": "https://Stackoverflow.com/users/11125",
"pm_score": 3,
"selected": false,
"text": "import os, sys\nimport pythoncom\nfrom win32com.shell import shell, shellcon\n\nshortcut = pythoncom.CoCreateInstance (\n she... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10755/"
] |
397,142 | <p>I have a class called User with static function loginRequired(), which returns false if the user is logged in and true if the user is logged out. It also appends an error to an error class that I created that tells the person using the site that they must be logged in to view the content.</p>
<p>The idea is that for the top of each function that would require the user to be logged in, we write this code:</p>
<pre><code>if(User::loginRequired()) return;
</code></pre>
<p>Which will output the error and immediately return from the function. I would rather do this, however:</p>
<pre><code>User::loginRequired();
</code></pre>
<p>And return from the calling function inside of the loginRequired function... but because loginRequired() is in a separate class in a separate file, this won't work. Is it possible to return from the function that calls loginRequired(), within loginRequired()?</p>
<p>Thanks.</p>
| [
{
"answer_id": 397176,
"author": "nickf",
"author_id": 9021,
"author_profile": "https://Stackoverflow.com/users/9021",
"pm_score": 3,
"selected": true,
"text": "require_login()"
},
{
"answer_id": 397187,
"author": "Anthony",
"author_id": 49478,
"author_profile": "http... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29595/"
] |
397,148 | <p>OK, I'm aware that triple-quotes strings can serve as multiline comments. For example,</p>
<pre><code>"""Hello, I am a
multiline comment"""
</code></pre>
<p>and </p>
<pre><code>'''Hello, I am a
multiline comment'''
</code></pre>
<p>But technically speaking these are strings, correct?</p>
<p>I've googled and read the Python style guide, but I was unable to find a technical answer to why there is no formal implementation of multiline, /* */ type of comments. I have no problem using triple quotes, but I am a little curious as to what led to this design decision.</p>
| [
{
"answer_id": 397192,
"author": "stalepretzel",
"author_id": 1615,
"author_profile": "https://Stackoverflow.com/users/1615",
"pm_score": 0,
"selected": false,
"text": "#a comment <!--comments like this-->"
},
{
"answer_id": 397216,
"author": "Charlie Martin",
"author_id"... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24059/"
] |
397,153 | <p>I have a these structures definitions</p>
<pre><code>typedef struct my_s {
int x;
int y;
} my_T;
typedef struct your_s {
my_T * x;
} your_T;
your_T array[MAX_COL][MAX_ROW];
</code></pre>
<p>To initialize the array's pointer to NULL, can I do:</p>
<pre><code>memset (array, 0, sizeof(array))
</code></pre>
<p>this does not look right to me.</p>
| [
{
"answer_id": 397162,
"author": "rampion",
"author_id": 9859,
"author_profile": "https://Stackoverflow.com/users/9859",
"pm_score": 2,
"selected": false,
"text": "your_T array[MAX_COL][MAX_ROW] = {{{0}}};\n"
},
{
"answer_id": 397166,
"author": "Johannes Schaub - litb",
"... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
397,184 | <p>I am trying to use jCarousel plugin for jQuery in order to provide my website users with scrollable (horizontal) content.</p>
<p>The content I am mentioning is basically user defined <code><li></code> elements, styled so that they have a feel and look of a tab. so basically I am trying to achieve the same effect of the tabs in pageflakes.com. As you may imagine, the users are creating tabs and providing tab names by themselves..</p>
<p>jCarousel needs you to specify a fixed width for the content e.g., all their examples are based upon images that have fixed height and width. but in my case I have not control over what the user will name his/her tab...making it impossible for me to guess the width of the total container div.</p>
<p>I have tried using a silly method such as guessing the width programatically assuming each letter being approx 5 pixels and multiplying 5 with the length of the word they have given as a name for a tab. even in this case, i needed to manipulate the css file dynamically which I am not sure how to do and even if it is feasable to do so..</p>
<p>Any solutions appreciated...</p>
<pre><code><lu>
<li class='MyTab' id='578'>This is my tab</li>
<li class='MyTab' id='579'>of which I can</li>
<li class='MyTab' id='580'>never guess</li>
<li class='MyTab' id='581'><img src='img/bullet_key.png' /> The length of</li>
</lu>
</code></pre>
<p>The above html is produced programatically through ajax_tabs_output.aspx, loaded into a javascript array and the jCarousel takes care of the rest.. </p>
<pre><code> function outputTabsArray() {
$.ajax({
url: 'ajax_tabs_output.aspx',
type: 'get',
data: 'q=array',
async: false,
success: function(out)
{
tabs_array = out;
}
});
}// end outputTabsArray
function mycarousel_itemLoadCallback(carousel, state)
{
for (var i = carousel.first; i <= carousel.last; i++) {
if (carousel.has(i)) {
continue;
}
if (i > tabs_array.length) {
break;
}
carousel.add(i, mycarousel_getItemHTML(tabs_array[i-1]));
}
};
/**
* Item html creation helper.
*/
function mycarousel_getItemHTML(item)
{
return '<div class="MyTab" id="' + item.tab_id + "'>" + item.tab_name + '</div>';
};
$('#mycarousel').jcarousel({
size: tabs_array.length,
itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
});
</code></pre>
| [
{
"answer_id": 408404,
"author": "Borgar",
"author_id": 27388,
"author_profile": "https://Stackoverflow.com/users/27388",
"pm_score": 4,
"selected": true,
"text": "<div class=\"scrollable\">\n <div class=\"window\">\n <div class=\"space\">\n <ul class=\"tabs\">\n <li clas... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49742/"
] |
397,185 | <p>I need to enable the <a href="http://au2.php.net/manual/en/book.mcrypt.php" rel="noreferrer">mcrypt</a> functions on my website, except I'm on a shared host (running linux) and obviously don't have access to the <code>php.ini</code> file. There does seem to be options for installing PEAR modules but a search told me mcrypt wasn't available. Is there any way I can do this, short of begging technical support to help me?</p>
<hr>
<p>Update: Looking around a bit more, it looks like I might be able to use the <code>dl()</code> function to dynamically load a library at run time. Since I'm only using the mcrypt functions in one spot, I could probably get away with doing this since the performance hit (I assume there is a hit) should be minimal. The only problem now is how to get the <code>libmcrypt.so</code> file?</p>
<hr>
<p>Another update: I've downloaded the libmcrypt.tar.bz2 file from Sourceforge and run <code>./configure</code>, <code>make</code>, and then copied the <code>libmcrypt.so.4.4.8</code> file into my home directory (as <code>libmcrypt.so</code>), but now I can't find where to put it so that the <code>dl()</code> function will find it.</p>
| [
{
"answer_id": 397207,
"author": "UnkwnTech",
"author_id": 115,
"author_profile": "https://Stackoverflow.com/users/115",
"pm_score": 3,
"selected": true,
"text": "wget http://superb-east.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz\ntar -xzvf libmcrypt-2.5.8.tar.gz\ncd li... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397185",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9021/"
] |
397,250 | <p>The list of valid XML characters is well known, as defined by the spec it's:</p>
<pre><code>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
</code></pre>
<p>My question is whether or not it's possible to make a PCRE regular expression for this (or its inverse) without actually hard-coding the codepoints, by using Unicode general categories. An inverse might be something like [\p{Cc}\p{Cs}\p{Cn}], except that improperly covers linefeeds and tabs and misses some other invalid characters.</p>
| [
{
"answer_id": 961504,
"author": "Jeff Atwood",
"author_id": 1,
"author_profile": "https://Stackoverflow.com/users/1",
"pm_score": 7,
"selected": false,
"text": "[\\u0009\\u000a\\u000d\\u0020-\\uD7FF\\uE000-\\uFFFD]\n // filters control characters but allows only properly-formed surrogat... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23845/"
] |
397,253 | <p>I need to pull large Unicode textual strings (e.g. 200Mb) from a Database (nvarchar) and store in memory for processing. i.e. I need random access to all parts of the strings.</p>
<p>Looking at this from strictly memory centric point of view, what are the pro’s and con’s of using a System.IO.MemoryStream versus a System.String as my in memory representation.</p>
<p>Some factors I am trying to research are:</p>
<ul>
<li>How these objects act in a [hypothetical] highly fragmented low memory environment</li>
<li>Immutability </li>
<li>Actual size in memory
(if stream is UTF8, have we nearly
halved size)</li>
<li>Is there another object I have not thought about?</li>
</ul>
<p>I am looking for clarity and advice on these points, as well as any other memory considerations I have not thought of?</p>
<p><em>Note: There may be better way of processing these strings, but at this point I am realy just asking about the memory consideration of storing such an object.</em></p>
| [
{
"answer_id": 397388,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": true,
"text": "List<byte> // has a nicer interface for processing\n"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46100/"
] |
397,257 | <p>I have a WPF listbox which displays messages. It contains an avatar on the left side and the username and message stacked vertically to the right of the avatar. The layout is fine until the message text should word wrap, but instead I get a horizontal scroll bar on the listbox. </p>
<p>I've Googled and found solutions to similar issues, but none of them worked.</p>
<pre><code><ListBox HorizontalContentAlignment="Stretch" ItemsSource="{Binding Path=FriendsTimeline}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Border BorderBrush="DarkBlue" BorderThickness="3" CornerRadius="2" Margin="3" >
<Image Height="32" Width="32" Source="{Binding Path=User.ProfileImageUrl}"/>
</Border>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Path=User.UserName}"/>
<TextBlock Text="{Binding Path=Text}" TextWrapping="WrapWithOverflow"/> <!-- This is the textblock I'm having issues with. -->
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</code></pre>
| [
{
"answer_id": 397287,
"author": "Nash",
"author_id": 49761,
"author_profile": "https://Stackoverflow.com/users/49761",
"pm_score": 8,
"selected": true,
"text": "TextBlock TextWrapping StackPanel DockPanel Grid ScrollViewer.HorizontalScrollBarVisibility Disabled ListBox Hidden Disabled"
... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/100/"
] |
397,263 | <p>I'm used to doing Java programming, where you never really have to think about pointers when programming. However, at the moment I'm writing a program in C++. When making classes that have members of other classes, when should I use pointers and when should I not? For example, when would I want to do this:</p>
<pre><code>class Foo {
Bar b;
}
</code></pre>
<p>As opposed to this:</p>
<pre><code>class Foo {
Bar* b;
}
</code></pre>
| [
{
"answer_id": 397267,
"author": "Reunanen",
"author_id": 19254,
"author_profile": "https://Stackoverflow.com/users/19254",
"pm_score": 6,
"selected": true,
"text": "Bar Foo Bar Foo Bar null Bar"
},
{
"answer_id": 397269,
"author": "kgiannakakis",
"author_id": 24054,
... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
397,283 | <p>I have a class Test in C:/proj/test_xml/Test.java. Given
parser.parse("test.xml");
I need a way to parse test.xml whether it is in current directory, proj or in C:/
Also, the solution should not make use of java.io</p>
<p>Thanks</p>
| [
{
"answer_id": 397267,
"author": "Reunanen",
"author_id": 19254,
"author_profile": "https://Stackoverflow.com/users/19254",
"pm_score": 6,
"selected": true,
"text": "Bar Foo Bar Foo Bar null Bar"
},
{
"answer_id": 397269,
"author": "kgiannakakis",
"author_id": 24054,
... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
397,293 | <p>I'm looking for a high performance method or library for scanning all files on disk or in a given directory and grabbing their basic stats - filename, size, and modification date. </p>
<p>I've written a python program that uses <code>os.walk</code> along with <code>os.path.getsize</code> to get the file list, and it works fine, but is not particularly fast. I noticed one of the freeware programs I had downloaded accomplished the same scan much faster than my program. </p>
<p>Any ideas for speeding up the file scan? Here's my python code, but keep in mind that I'm not at all married to os.walk and perfectly willing to use others APIs (including windows native APIs) if there are better alternatives.</p>
<pre><code>for root, dirs, files in os.walk(top, topdown=False):
for name in files:
...
</code></pre>
<p>I should also note I realize the python code probably can't be sped up that much; I'm particularly interested in any native APIs that provide better speed.</p>
| [
{
"answer_id": 397539,
"author": "rob",
"author_id": 43927,
"author_profile": "https://Stackoverflow.com/users/43927",
"pm_score": 2,
"selected": false,
"text": "os.walk"
},
{
"answer_id": 397647,
"author": "S.Lott",
"author_id": 10661,
"author_profile": "https://Stac... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13055/"
] |
397,301 | <p>I was reading <a href="https://stackoverflow.com/questions/392397/arrays-whats-the-point">this post</a> the other night about the inner workings of the Array, and learned a lot from the answers posted, especially from <a href="https://stackoverflow.com/questions/392397/arrays-whats-the-point#392426">Jonathan Holland</a>'s one.</p>
<p>So the reason you give a size to an array beforehand is so that space will need to be reserved beforehand, so that elements in the array will be placed next each other in memory, and thus providing O(1) access time, because of the <code>pointer + offset</code> traversal.</p>
<hr>
<p>But in JavaScript, you can initialize an array like such:</p>
<pre><code>var anArray = []; //Initialize an empty array, without a dimension
</code></pre>
<p>So my question is, since in JavaScript you can initialize an array Without specifying a dimension before hand, <strong>how is memory allocated for an array to still provide a O(1) access time since the 'amount' of memory locations is not specified beforehand ?</strong></p>
| [
{
"answer_id": 397796,
"author": "Jason S",
"author_id": 44330,
"author_profile": "https://Stackoverflow.com/users/44330",
"pm_score": 2,
"selected": false,
"text": "A=[0,1,4,9,16];\n B={a:'ha',b:27,c:30};\n js>A=[0,1,4,9,16];\n0,1,4,9,16\njs>A instanceof Array\ntrue\njs>A.length\n5\njs>... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44084/"
] |
397,320 | <p>I am having a frame-based webpage with 3 frames. A topliner, a navigation on the left side and a content frame on the bottom right side.</p>
<p>Now, I want to show up a popup-menu when the user right-clicks on the content-frame. Because a div-container can not go out of the frame, my idea was, placing the whole frame-page into a new iframe. In that page I could have a second iframe which is my popup-menu.</p>
<p>So now, I am having this layout:</p>
<pre><code><html> (start-page)
<iframe (real content)
<frameset
top-frame
navigation-frame
content-frame
>
>
<iframe> (my popup-menu, positioned absolutelly and hidden by default)
</html>
</code></pre>
<p>In my content-frame I am having a "onmouseover"-event assigned to the body-tag. This event should open the popup-iframe at the current mouse-position. And exactly here is my problem: How to get the mouse-coordinates relativelly to the top-website (start-page in my draft)?</p>
<p>Currently I am having this mouseDown-function (works in IE only, right now - but getting it working in FF & Co shouldn't be the problem...)</p>
<pre><code>function mouseDown(e)
{
if (window.event.button === 2 || window.event.which === 3)
{
top.popupFrame.style.left = event.screenX + "px";
top.popupFrame.style.top = event.screenY + "px";
top.popupFrame.style.display = "";
return false;
}
}
</code></pre>
<p>As you can see, the "event.screenX" and "screenY" - variables are not that variables I can use, because they are not relative to the mainpage.</p>
<p>Any ideas?</p>
| [
{
"answer_id": 400404,
"author": "qbeuek",
"author_id": 5348,
"author_profile": "https://Stackoverflow.com/users/5348",
"pm_score": 1,
"selected": false,
"text": "window.createPopup(...)\n"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49772/"
] |
397,332 | <p>Ctrl M-L doesn't toggle all the regions in vb.net (2008) when there's a hierarchy between the regions. I don't like regions. Is there a way to expand ALL the regions or remove them permanently? </p>
| [
{
"answer_id": 397344,
"author": "Bernhard Hofmann",
"author_id": 39722,
"author_profile": "https://Stackoverflow.com/users/39722",
"pm_score": 1,
"selected": false,
"text": " <Element Type=\"Type\" Id=\"DefaultType\">\n <Elements>\n <Element>\n <Elements />\n ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5232/"
] |
397,337 | <p>I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are limitations to the complexity of the UIs you can build with the available tools, specifically in the types of available widgets.</p>
<p>I'm interested in using some of the more advanced wxPython widgets such as the ListView (grid), Tree, etc. This would involve using a complete wxFrame (window) to display the whole UI, which would essentially mean that window would no longer be tied to Maya. Not a deal breaker, but it means when Maya is minimized, the window won't follow suit.</p>
<p>I've tried something like this before with tkinter as a test, but found that it needed a MainLoop to run in its own thread. This is logical, but in my case, it conflicts with Maya's own thread, essentially making Maya hang until the window is closed. This is due to the fact that Maya runs all scripts, be they MEL or Python, in a single thread that the main Maya GUI shares. This is to prevent one script from, say, deleting an object while another script is trying to do work on the same object.</p>
<p>wxPython has this same "mainloop" methodolgy. I'm wondering if there's any way around it so that it can work within Maya?</p>
| [
{
"answer_id": 399413,
"author": "Matt",
"author_id": 49135,
"author_profile": "https://Stackoverflow.com/users/49135",
"pm_score": 3,
"selected": true,
"text": "def initializePumpThread():\n global pumpedThread\n global app\n if pumpedThread == None:\n app = QtGui.QAppli... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46914/"
] |
397,341 | <p>I'm reading through "A Gentle Introduction to Haskell," and early on it uses this example, which works fine in GHC and horribly in my brain:</p>
<pre><code>initial = 0
next resp = resp
process req = req+1
reqs = client initial resps
resps = server reqs
server (req:reqs) = process req : server reqs
client initial ~(resp:resps) = initial : client (next resp) resps
</code></pre>
<p>And the calling code:<br>
<code>take 10 reqs</code></p>
<p>How I'm seeing it, is <code>reqs</code> is called, yielding a call to <code>client</code> with args 0 and <code>resps</code>. Thus wouldn't <code>resps</code> now need to be called... which in turn calls <code>reqs</code> again? It all seems so infinite... if someone could detail how it's actually working, I'd be most appreciative!</p>
| [
{
"answer_id": 397352,
"author": "Jon",
"author_id": 25111,
"author_profile": "https://Stackoverflow.com/users/25111",
"pm_score": 2,
"selected": false,
"text": "take 10 reqs"
},
{
"answer_id": 397442,
"author": "xtofl",
"author_id": 6610,
"author_profile": "https://S... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38803/"
] |
397,346 | <p>Is possible to set an image as an iPhone application unique icon in code instead of adding a PNG format image file and naming it <code>Icon.png</code>?</p>
| [
{
"answer_id": 400121,
"author": "Ryan E",
"author_id": 31344,
"author_profile": "https://Stackoverflow.com/users/31344",
"pm_score": 1,
"selected": true,
"text": "<key>CFBundleIconFile</key>\n<string>app.png</string>\n"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35405/"
] |
397,355 | <p>How do I create subdomains in ASP.NET?
I have few links on my homepage(Home.aspx)
Example: Link1 and Link2</p>
<p>I need to create two sub domains link1.example.com and link2.example.com
and redirect to them. I will be using Response.Redirect for navigation. </p>
<p>Questions:
Do the files need to reside in different directory or something?
Can I test or simulate this example on localhost?</p>
<p>Any help to this newbie ASP.NET programmer will be appreciated.</p>
| [
{
"answer_id": 397896,
"author": "patridge",
"author_id": 48700,
"author_profile": "https://Stackoverflow.com/users/48700",
"pm_score": 3,
"selected": true,
"text": "RewriteCond %{HTTP_Host} ^(?~new-sub-domain.yourdomain.com).*$ [I]\nRewriteRule ^(.*)$ http://www.yourdomain.com/new-sub-d... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48307/"
] |
397,384 | <p>EDIT:</p>
<p>I'm told that making you guys read means I get less attention. My apologies. Here's a simpler version:</p>
<p>Bill got $100 dollars worth of items from a store.</p>
<p>He wants to return enough of the items to get exactly $30 dollars back.</p>
<p>The store has a Point of Return system that will help him do this.</p>
<p>Here is the data after he scans his items:</p>
<pre><code> item ¦ price ¦
socks 4.00
cheap tv 22.00
book on tape 9.00
book on paper 7.00
party hats 3.00
picture frame 10.00
hammer 5.00
juicer 16.00
mysql guide 24.00
total items ¦ total price ¦
9 100.00
Option 1
===============
item ¦ price ¦
cheap tv 22.00
party hats 3.00
hammer 5.00
===============
Option 2
===============
item ¦ price ¦
socks 4.00
picture frame 10.00
juicer 16.00
===============
Option 3
===============
item ¦ price ¦
book on tape 9.00
hammer 5.00
juicer 16.00
</code></pre>
<p>I probably missed a few options, since I made all of this up.</p>
<p>So, the big question is:</p>
<p>Is there a way (with GROUP BY, probably) to have one query that would return ever possible combination of items?</p>
<p>Thanks!</p>
<p>a</p>
| [
{
"answer_id": 397466,
"author": "WW.",
"author_id": 14663,
"author_profile": "https://Stackoverflow.com/users/14663",
"pm_score": 2,
"selected": true,
"text": "SELECT\n i1.id AS id1,\n NULL AS id2,\n NULL AS id3,\n i1.amount\nFROM\n items i1\nUNION ALL\nSELECT\n i1.id AS id1... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49478/"
] |
397,396 | <p>In my web app I use several asmx (Web Services) from the same provider, they have one for this, other for that, but all require a SOAP Header with Authentication.</p>
<p>It is simple to add the Authentication:</p>
<pre><code>public static SoCredentialsHeader AttachCredentialHeader()
{
SoCredentialsHeader ch = new SoCredentialsHeader();
ch.AuthenticationType = SoAuthenticationType.CRM5;
ch.UserId = "myUsername";
ch.Secret = apUtilities.CalculateCredentialsSecret(
SoAuthenticationType.CRM5, apUtilities.GetDays(), "myUsername", "myPassword");
return ch;
}
</code></pre>
<p>The problem is this SoCredentialsHeader come (derivation) from ONE webservice and I need to add the same code to the others, like:</p>
<pre><code>public static wsContact.SoCredentialsHeader AttachContactCredentialHeader()
{
wsContact.SoCredentialsHeader ch = new wsContact.SoCredentialsHeader();
ch.AuthenticationType = wsContact.SoAuthenticationType.CRM5;
ch.UserId = "myUsername";
ch.Secret = apUtilities.CalculateCredentialsSecret(
wsContact.SoAuthenticationType.CRM5, apUtilities.GetDays(), "myUsername", "myPassword");
return ch;
}
public static wsDiary.SoCredentialsHeader AttachDiaryCredentialHeader()
{
wsDiary.SoCredentialsHeader ch = new wsDiary.SoCredentialsHeader();
ch.AuthenticationType = wsDiary.SoAuthenticationType.CRM5;
ch.UserId = "myUsername";
ch.Secret = apUtilities.CalculateCredentialsSecret(
wsDiary.SoAuthenticationType.CRM5, apUtilities.GetDays(), "myUsername", "myPassword");
return ch;
}
</code></pre>
<p>Is there a way to implement a design pattern in order to use only one function but that suits all webServices?</p>
<p>sometimes I see the <strong>T</strong> letter, is this a case for that? if yes, how can I accomplish such feature?</p>
<p>P.S. I could pass an enum and use a switch to check the enum name and apply the correct Header but everytime I need to add a new WebService, I need to add the enum and the code, I'm searcging for an advanced technique for this.</p>
<p>Thank you.</p>
| [
{
"answer_id": 402268,
"author": "Ricardo Villamil",
"author_id": 19314,
"author_profile": "https://Stackoverflow.com/users/19314",
"pm_score": 0,
"selected": false,
"text": "public static T AttachDiaryCredentialHeader<T>() where T: class\n{\n T ch = new T();\n Type objType = ch.Ge... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28004/"
] |
397,404 | <p>Say we have:</p>
<pre><code>
Class Base
{
virtual void f(){g();};
virtual void g(){//Do some Base related code;}
};
Class Derived : public Base
{
virtual void f(){Base::f();};
virtual void g(){//Do some Derived related code};
};
int main()
{
Base *pBase = new Derived;
pBase->f();
return 0;
}
</code></pre>
<p>Which <code>g()</code> will be called from <code>Base::f()</code>? <code>Base::g()</code> or <code>Derived::g()</code>?</p>
<p>Thanks... </p>
| [
{
"answer_id": 397409,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 7,
"selected": true,
"text": "Base::g();\n virtual void g() {\n Base::g();\n // some work related to derived\n}\n pub... pubseekoff ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46418/"
] |
397,410 | <p>I accumulated a quite a lot of data in a raw form (csv and binary) - 4GB per day for a few months to be precise.</p>
<p>I decided to join the civilized world and use database to access the data and I wondered what would be the correct layout; the format is quite simple: a few rows for every time tick (bid, ask, timestamp, etc.) x up to 0.5Million/day x hundreds of financial instruments x monthes of data.</p>
<p>There is a MySQL server with MYISAM (which I understood would be the correct engine for this type of usage) running on commodity harware (2 x 1GB RAID 0 SATA, core 2 @ 2.7GHz)</p>
<p><strong>What would be correct layout of the database? How should the tables/indices look like? What are the general recommendations with this scenario? What would you predict set me pitfalls along the way?</strong></p>
<p>Edit: my common usage will be simple queries to extract time series information for a specific date and instruments, e.g.</p>
<pre><code>SELECT (ask + bid) / 2
WHERE instrument='GOOG'
AND date = '01-06-2008'
ORDER BY timeStamp;
</code></pre>
<p>Edit: I tried to stuff all my data in one table indexed by the timeStamp but it was way too slow - therefore I reckoned it would take a more elaborate scheme.</p>
| [
{
"answer_id": 397421,
"author": "cletus",
"author_id": 18393,
"author_profile": "https://Stackoverflow.com/users/18393",
"pm_score": 4,
"selected": true,
"text": "CREATE TABLE instrument (\n id BIGINT NOT NULL AUTO_INCREMENT,\n code CHAR(4),\n company_name VARCHAR(100),\n PRIMARY KE... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28772/"
] |
397,412 | <p>I have recently been exploring Apache Ofbiz and was impressed by its ability to customize most areas of the application: UI, workflow, entities.</p>
<p>Is there any similar (not necessarily an ERP system) application developed in C#/.Net which offers a similar level of customization?</p>
<p>I am looking for examples of applications developed in C# that are highly customizable in terms of UI, Workflow and Entity Model</p>
| [
{
"answer_id": 397421,
"author": "cletus",
"author_id": 18393,
"author_profile": "https://Stackoverflow.com/users/18393",
"pm_score": 4,
"selected": true,
"text": "CREATE TABLE instrument (\n id BIGINT NOT NULL AUTO_INCREMENT,\n code CHAR(4),\n company_name VARCHAR(100),\n PRIMARY KE... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397412",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46279/"
] |
397,425 | <p>In which situations should I choose to use a functional programming language over a more verbose object-oriented language like C++, C# or Java?</p>
<p>I understand what functional programming is, what I don't really understand is for what types of problems is it a perfect solution?</p>
| [
{
"answer_id": 397882,
"author": "Phil",
"author_id": 49642,
"author_profile": "https://Stackoverflow.com/users/49642",
"pm_score": 1,
"selected": false,
"text": "logger.expects(once()).method(\"error\")\n .with( and(stringContains(action),stringContains(cause)) );"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/47630/"
] |
397,426 | <p>Currently I'm having a problem with generating class files from a xsd with repeating elements. I’m using the custom tool ‘MsDatasetGenerator’ in VS2005 SP1 witch create a typed dataset from the xsd for c#. I’m trying to parse the xml by this schema</p>
<pre><code> <?xml version="1.0" encoding=\"utf-8\"?>
<xs:schema id="XSDobject" targetNamespace="http://tempuri.org/XSDobject.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XSDobject.xsd" xmlns:mstns="http://tempuri.org/XSDobject.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="order">
<xs:complexType>
<xs:sequence>
<xs:element name="contact">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" />
<xs:element name="phone" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="buyer">
<xs:complexType>
<xs:sequence>
<xs:element name="contact">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" />
<xs:element name="phone" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</code></pre>
<p>But I get following error “<strong>The same table 'contact' cannot be the child table in two nested relations.</strong>”</p>
<p>The XSD compiles correctly but it’s the typed dataset that can’t handle repeating tables. Now I have tested also the xsd.exe tool but it seems to generate the same code as the msdatasetgenerator. I also tried some third party code generator tools like XSD2Code, CodeXS, AltovaXmlSpy but also I can’t get it to work with nested elements.</p>
<p>Alternatively I could solve the problem with xslt transformation at the input and the output but it would cost me a lot of performance. </p>
<p>So now I’m asking if someone could help me with a good solution for VS2005, or know good xsd class generator that can handle this problem. It doesn’t have to be a typed dataset if it works as an array or a list it is also perfect as long it is easy to serializing and deserializing it.</p>
<p>Thanks in advance
Freggel</p>
| [
{
"answer_id": 397446,
"author": "nick_alot",
"author_id": 46100,
"author_profile": "https://Stackoverflow.com/users/46100",
"pm_score": 1,
"selected": false,
"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<xs:schema id=\"XSDobject\" targetNamespace=\"http://tempuri.org/XSDobject.x... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49788/"
] |
397,430 | <p>I want to write a cocoa application which downloads a file using ftp. I read about the NSURL class which has "NSURLHandle FTP Property Keys". I want to know how do I make use of these constants to provide username and password to the ftp site.</p>
| [
{
"answer_id": 397431,
"author": "csl",
"author_id": 21028,
"author_profile": "https://Stackoverflow.com/users/21028",
"pm_score": 1,
"selected": false,
"text": "ftp://user:pass@ftp.somewhere.com/path/to/file\n"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39270/"
] |
397,435 | <p>I've a DLL assembly, in which there are various classes. Each class has around 50-100 members and 4-5 functions. How can I create a list of all the classes and their respective members using a VB.NET program?</p>
<p>I need to show to the user for performing an operation using a particular class.</p>
| [
{
"answer_id": 397451,
"author": "amazedsaint",
"author_id": 45956,
"author_profile": "https://Stackoverflow.com/users/45956",
"pm_score": 4,
"selected": false,
"text": "Assembly thisAsm = Assembly.GetExecutingAssembly();\nList<Type> types = thisAsm.GetTypes().Where(t => t.IsClass && !t.... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397435",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49372/"
] |
397,465 | <p>Is it possible to use the ASP.Net Range validator when the format string is dd/MMM/yyyy?</p>
| [
{
"answer_id": 397693,
"author": "HectorMac",
"author_id": 1400,
"author_profile": "https://Stackoverflow.com/users/1400",
"pm_score": 0,
"selected": false,
"text": "Thread.CurrentThread.CurrentCulture = \n CultureInfo.CreateSpecificCulture(\"en-GB\");\nThread.CurrentThread.CurrentUIC... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21586/"
] |
397,477 | <p>In my asp.net-mvc website I have a field that usually has a string (from database) but can from time to time contain nothing.
Because IE doesn't know how to handle the css "empty-cells" tag, empty table cells need to be filled with an &nbsp;<br>
I thought </p>
<pre><code>Html.Encode(" ");
</code></pre>
<p>would fix this for me, but apparantly, it just returns " ".
I could implement this logic as follows</p>
<pre>
Html.Encode(theString).Equals(" ")?"&nbsp;":Html.Encode(theString);
</pre>
<p>Also a non-shorthand-if would be possible but frankly, both options are but ugly.
Isn't there a more readable, compact way of putting that optional space there?</p>
| [
{
"answer_id": 397531,
"author": "devio",
"author_id": 21336,
"author_profile": "https://Stackoverflow.com/users/21336",
"pm_score": 3,
"selected": true,
"text": "public class MyHtml\n{\n public static string Encode(string s)\n {\n if (string.IsNullOrEmpty(s) || s.Trim()==\"... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11333/"
] |
397,483 | <p>What is the best way to have an associative array with arbitrary value types for each key in C++?</p>
<p>Currently my plan is to create a "value" class with member variables of the types I will be expecting. For example:</p>
<pre><code>class Value {
int iValue;
Value(int v) { iValue = v; }
std::string sValue;
Value(std::string v) { sValue = v; }
SomeClass *cValue;
Value(SomeClass *v) { cValue = c; }
};
std::map<std::string, Value> table;
</code></pre>
<p>A downside with this is you have to know the type when accessing the "Value". i.e.:</p>
<pre><code>table["something"] = Value(5);
SomeClass *s = table["something"].cValue; // broken pointer
</code></pre>
<p>Also the more types that are put in Value, the more bloated the array will be.</p>
<p>Any better suggestions?</p>
| [
{
"answer_id": 397487,
"author": "Bombe",
"author_id": 43582,
"author_profile": "https://Stackoverflow.com/users/43582",
"pm_score": 2,
"selected": false,
"text": "Value IntValue StringValue"
},
{
"answer_id": 397493,
"author": "Johannes Schaub - litb",
"author_id": 34509... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11125/"
] |
397,488 | <p>Is there something like python's interactive REPL mode, but for Java?
So that I can, for example, type <code>InetAddress.getAllByName( localHostName )</code> in a window, and immediately get results, without all this public static void nightmare() thing?</p>
| [
{
"answer_id": 397496,
"author": "speciousfool",
"author_id": 39584,
"author_profile": "https://Stackoverflow.com/users/39584",
"pm_score": 4,
"selected": false,
"text": ">>> from java.net import *\n>>> InetAddress.getAllByName(\"google.com\")\narray(java.net.InetAddress,[google.com/209.... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397488",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34161/"
] |
397,489 | <p>After making a few modifications to a rails app I am tinkering on, railroad stopped working. The verbose output gives some clues. I wonder if other folks have encountered this and if there are some pointers for fixing this problem. Is it a data modeling error? Is it a problem with railroad? Error log follows...</p>
<pre><code>railroad -vM Loading application environment
Loading application classes
Generating models diagram
...[snip]...
Processing Person
Processing model association authorships
Processing model association person_image
Processing model association publications
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/reflection.rb:224:in `derive_class_name': You have a nil object when you didn't expect it! (NoMethodError)
The error occurred while evaluating nil.class_name
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/reflection.rb:106:in `class_name'
from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:134:in `process_association'
from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:102:in `process_class'
from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:101:in `each'
from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:101:in `process_class'
from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:27:in `generate'
from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:26:in `each'
from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:26:in `generate'
from /usr/lib/ruby/gems/1.8/gems/railroad-0.5.0/bin/railroad:47
from /usr/bin/railroad:19:in `load'
from /usr/bin/railroad:19
</code></pre>
| [
{
"answer_id": 397496,
"author": "speciousfool",
"author_id": 39584,
"author_profile": "https://Stackoverflow.com/users/39584",
"pm_score": 4,
"selected": false,
"text": ">>> from java.net import *\n>>> InetAddress.getAllByName(\"google.com\")\narray(java.net.InetAddress,[google.com/209.... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39584/"
] |
397,495 | <p>i want to compare the current time and file creation time in Perl but both are in different format. localtime is in this format:</p>
<pre><code>22116291110813630
</code></pre>
<p>and file creation time is </p>
<pre><code>Today, December 29, 2008, 2:38:37 PM
</code></pre>
<p>How do i compare which one is greater and their difference?</p>
| [
{
"answer_id": 397526,
"author": "ysth",
"author_id": 17389,
"author_profile": "https://Stackoverflow.com/users/17389",
"pm_score": 2,
"selected": false,
"text": "localtime Mon Dec 29 03:16:33 2008 stat time() localtime()"
},
{
"answer_id": 397540,
"author": "Nathan Fellman",... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
397,507 | <p>I just wanted to check with you guys if you know what the maximum number of rows - in a combo / list is. I know that VB6 had a 32k limit - I couldn't find anything to confirm with a quick google search so I thought I'd throw it out to the experts.</p>
<p>Cheers,
Dave</p>
| [
{
"answer_id": 399383,
"author": "Mitch Wheat",
"author_id": 16076,
"author_profile": "https://Stackoverflow.com/users/16076",
"pm_score": 1,
"selected": false,
"text": "BeginUpdate EndUpdate EndUpdate"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26446/"
] |
397,524 | <p>I want to retrieve a set of records from a database, do a rs.next() and then assign the result of this to a variable to pass to a method that will use this record, in the same way that I would without assigning it to a variable and passing it to a method
is there any way to do this?
I'm using JAVA (1.5)</p>
<hr>
<p>Thank you for all the answers</p>
<p>I do not want to pass the whole resultSet to a method, only the current row, but as I understand, it is not possible to do this</p>
| [
{
"answer_id": 397546,
"author": "OscarRyz",
"author_id": 20654,
"author_profile": "https://Stackoverflow.com/users/20654",
"pm_score": 1,
"selected": true,
"text": "while( rs.next() ) { \n list.add( createFrom( rs ) );\n}\n\n...\n\npublic Object createFrom( ResultSet rs ) { // Here ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49805/"
] |
397,537 | <p>I want to insert multiple invisible watermarks into my JPEG pictures through C# code. That means that I need a .NET library that does this work and not some external batch application.</p>
<p>Any suggestions?</p>
| [
{
"answer_id": 397559,
"author": "splattne",
"author_id": 6461,
"author_profile": "https://Stackoverflow.com/users/6461",
"pm_score": 1,
"selected": false,
"text": " ICoverFile cover = new BMPCoverFile(\"cover.bmp\");\n cover.CreateStegoFile(\"stego.bmp\",\"Hello\",\"MyPwd\"); \n ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49807/"
] |
397,556 | <p>I've got an enum like this:</p>
<pre><code>public enum MyLovelyEnum
{
FirstSelection,
TheOtherSelection,
YetAnotherOne
};
</code></pre>
<p>I got a property in my DataContext:</p>
<pre><code>public MyLovelyEnum VeryLovelyEnum { get; set; }
</code></pre>
<p>And I got three RadioButtons in my WPF client.</p>
<pre><code><RadioButton Margin="3">First Selection</RadioButton>
<RadioButton Margin="3">The Other Selection</RadioButton>
<RadioButton Margin="3">Yet Another one</RadioButton>
</code></pre>
<p>Now how do I bind the RadioButtons to the property for a proper two-way binding?</p>
| [
{
"answer_id": 406798,
"author": "Lars",
"author_id": 42809,
"author_profile": "https://Stackoverflow.com/users/42809",
"pm_score": 10,
"selected": true,
"text": "public class EnumBooleanConverter : IValueConverter\n{\n #region IValueConverter Members\n public object Convert(object val... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7021/"
] |
397,558 | <p>How can I make a text entry field that takes the input characters and displays it in another place, character by character as a the typest type them!</p>
| [
{
"answer_id": 397570,
"author": "quark",
"author_id": 46680,
"author_profile": "https://Stackoverflow.com/users/46680",
"pm_score": 2,
"selected": false,
"text": "<input type=\"text\" id=\"textField\" />\n<br />\n<span id=\"textOutput\"></span>\n\n<script type=\"text/javascript\">\n\n ... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49809/"
] |
397,572 | <p>I am writing a cocoa application which has a NSWindow. I want to change the background color of the window to a specific color. But the window properties in the inspector only provide "Textured Window" alternative. How can I make the color of the window as desired?</p>
| [
{
"answer_id": 397607,
"author": "diciu",
"author_id": 2811,
"author_profile": "https://Stackoverflow.com/users/2811",
"pm_score": 1,
"selected": false,
"text": "- (id)initWithContentRect:(NSRect)contentRect\n styleMask:(NSUInteger)styleMask\n backing:(NSB... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39270/"
] |
397,581 | <p>Let's assume I'm a complete lazy bum and I don't want to invest the several dozen keystrokes needed for my own exception class (it's not utterly important which gets used, really). However, to pretend I'm following good practices here, I want a pre-existing one that best fits my situation.</p>
<p><strong>Problem:</strong> I need to throw an exception when my class's constructor receives an object in its parameters that is not found within a given list I've built elsewhere.</p>
<p>Which exception class would be appropriate to throw for that?</p>
| [
{
"answer_id": 397586,
"author": "C. K. Young",
"author_id": 13,
"author_profile": "https://Stackoverflow.com/users/13",
"pm_score": 5,
"selected": true,
"text": "IllegalArgumentException"
},
{
"answer_id": 397823,
"author": "Phil",
"author_id": 49642,
"author_profile... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19825/"
] |
397,601 | <p>Reading source code of sample projects, such as Beast and Bort, are recommended as a good way to learn rails. But I found myself getting lost in reading source code of these projects, cause the included plugins might bring in some strange code without any hint, such as <code>"require"</code> or <code>"include"</code>. Could you share your rails code reading experience? Lots of thanks ahead.</p>
| [
{
"answer_id": 398213,
"author": "Samuel",
"author_id": 32465,
"author_profile": "https://Stackoverflow.com/users/32465",
"pm_score": 3,
"selected": true,
"text": "class Demo::Sub::HelloController < ActionController::Base\n\nend\n module Demo\n module Sub\n class HelloController < Ac... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44512/"
] |
397,612 | <p>Given the <a href="http://www.drdobbs.com/dangers-of-suid-shell-scripts/199101190" rel="nofollow noreferrer">dangers of SUID shell scripts</a>, is there a more secure way of giving passwordless access to scripts (bash, PHP) with root permissions in Linux?</p>
<p>(Ubuntu 8.10)</p>
| [
{
"answer_id": 397616,
"author": "C. K. Young",
"author_id": 13,
"author_profile": "https://Stackoverflow.com/users/13",
"pm_score": 3,
"selected": false,
"text": "sudoers"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20074/"
] |
397,628 | <p>I'm getting this error message on all projects (including brand new empty templates) I'm trying to build with Visual Studio 2008:</p>
<blockquote>
<p>Unexpected debug information initialization error
-- 'Failed to find a required export in the runtime.'</p>
</blockquote>
<p>The <a href="http://msdn.microsoft.com/en-us/library/d82598t0.aspx" rel="nofollow noreferrer">Error Help for Compiler Error CS0040</a> is not very helpful:</p>
<blockquote>
<p>This error can occur when using the
/debug compiler option and indicates
that the compiler was unable to write
to the .pdb file. Possible resolutions
to this error include reinstalling
Visual Studio, ensuring that the
compiler has write access to a file or
directory, or not compiling with
/debug.</p>
</blockquote>
<p>I can manually create files in the intended {bin,obj}\Debug directories, running the Studio as Administrator didn't help, uninstalling both the 3.5 framework and the Visual Studio 2008 and re-installed both with their respective Service Packs and I'm still getting the error.</p>
<p>Removing all <code>/debug</code> switches from the command line obviously removes the error message as indicated, but is no option for further development.</p>
<p>How can I further debug this?</p>
| [
{
"answer_id": 397683,
"author": "David Schmitt",
"author_id": 4918,
"author_profile": "https://Stackoverflow.com/users/4918",
"pm_score": 2,
"selected": true,
"text": "csc.exe Process Name is \"csc.exe\" csc.exe Windows\\Microsoft.NET\\Framework\\v2.0.50727\\diasymreader.dll"
}
] | 2008/12/29 | [
"https://Stackoverflow.com/questions/397628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4918/"
] |
397,631 | <p>I hope someone could help me on this.</p>
<p>I want to add a month to a database date, but I want to prevent two jumping over month on those days at the end.</p>
<p>For instance I may have:</p>
<p>Jan 31 2009 </p>
<p>And I want to get</p>
<p>Feb 28 2009 </p>
<p>and not </p>
<p>March 2 2009 </p>
<p>Next date would be</p>
<p>March 28 2009</p>
<p>Jun 28 2009 </p>
<p>etc. </p>
<p>Is there a function that already perform this kind of operation in oracle?</p>
<p><strong>EDIT</strong></p>
<p>Yeap. I want to copy each month all the records with some status to the next ( so the user don't have to enter again 2,000 rows each month )</p>
<p>I can fetch all the records and update the date manually ( well in an imperative way ) but I would rather let the SQL do the job.</p>
<p>Something like:</p>
<pre><code>insert into the_table
select f1,f2,f3, f_date + 30 /* sort of ... :S */ from the_Table where date > ?
</code></pre>
<p>But the problem comes with the last day.</p>
<p>Any idea before I have to code something like this?</p>
<pre><code>for each record in
createObject( record )
object.date + date blabala
if( date > 29 and if februrary and the moon and the stars etc etc 9
end
update.... et
</code></pre>
<p><strong>EDIT:2</strong></p>
<p>Add months did the trick. </p>
<p>now I just have this:</p>
<pre><code>insert into my_table
select f1, add_months( f2, 1 ) from my_table where status = etc etc
</code></pre>
<p>Thanks for the help.</p>
| [
{
"answer_id": 397698,
"author": "Tony Andrews",
"author_id": 18747,
"author_profile": "https://Stackoverflow.com/users/18747",
"pm_score": 5,
"selected": true,
"text": "SQL> select add_months(date '2008-01-31',1) from dual;\n\nADD_MONTHS(\n-----------\n29-FEB-2008\n\nSQL> select add_mon... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20654/"
] |
397,667 | <p>This is my first question in this forum...
I have a file with numerous data fields (both numeric and characters) in the file.
I want to delimit the file with set of delimiter length like 2,5,1,9,6 etc.</p>
<p>(<em>Alternatively: I have a list of field lengths such as 2,5,1,9,6, and I want to insert comma delimiters in (a copy of) the source string after each field.</em>)</p>
<p>For example, if my file is like this: </p>
<pre><code>9483trdcvge245621jde
</code></pre>
<p>then I need to insert commas at 2,5,1,9,6 etc.
and the output will be:</p>
<pre><code>94,83trd,c,vge245621,jde,
</code></pre>
<p>I need to do this in <strong>JAVA</strong> </p>
<p>Please help me to solve this issue.
Thanks in advance </p>
| [
{
"answer_id": 397671,
"author": "Bombe",
"author_id": 43582,
"author_profile": "https://Stackoverflow.com/users/43582",
"pm_score": 1,
"selected": false,
"text": "String newString = line.substring(0, firstComma) + \",\" + line.substring(firstComma + 1);\n"
},
{
"answer_id": 3976... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
397,677 | <p>I have a piece of text, that I wish to show truncated, but when clicked it will expand to show the rest. Clicking again should truncate it.</p>
<p>I was trying to use the onclick event to handle this as follows (<strong>WARNING</strong>: Do not run following code without reading below...):</p>
<pre><code><span id='blah' onclick='showAllComment("this is a long comment to see it all", 9, true )'>this is a...</span>
<script>
function showAllComment( comment, shortCommentLen, showFullComment )
{
alert( $("#blah").html() );
if( showFullComment )
{
$("#blah").html( comment );
$("#blah").click( showAllComment( comment, shortCommentLen, false ) );
}
else
{
$("#blah").html( comment.substring( 0, shortCommentLen ) + "..." );
$("#blah").click( showAllComment( comment, shortCommentLen, true ) );
}
}
</script>
</code></pre>
<p>But as you will see, it repeatedly calls itself and you have to end task the browser (so be careful when running this code!!!!)</p>
<p>Can anyone suggest why this is happening, and what to do to resolve it.</p>
<p>Thanks in advance</p>
| [
{
"answer_id": 397690,
"author": "Andreas Grech",
"author_id": 44084,
"author_profile": "https://Stackoverflow.com/users/44084",
"pm_score": 3,
"selected": true,
"text": "showAllComment function showAllComment( comment, shortCommentLen, showFullComment )\n{\n alert( $(\"#blah\").html(... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1478/"
] |
397,684 | <p>I have used <a href="http://www.ericmmartin.com/projects/simplemodal/" rel="nofollow noreferrer">SimpleModal</a>. Now the problem is the resizing of the modal dialog.
I have a confirm dialog, and it is basically small after pressing Yes.</p>
<p>The second one is <code>my.php</code> and it contains large data. I am using the concept of
appending an already existing model. How do I resize the content?</p>
<p>And my JavaScript snippet has:</p>
<pre><code>$(document).ready(function () {
$('#confirmbutton, #confirmDialog a.confirm').click(function (e) {
e.preventDefault();
confirm("Continue to the SimpleModal project page?", function () {
window.location.href = 'http://localdata/';
});
});
});
function confirm(message, callback) {
$('#confirm').modal({
close:false,
position: ["20%",],
overlayId:'confirmModalOverlay',
containerId:'confirmModalContainer',
onShow: function (dialog) {
dialog.data.find('.message').append(message);
// If the user clicks "yes"
dialog.data.find('.yes').click(function () {
// Call the callback
// $.modal.close();
$.get("my.php", function (data) {
/* Sample response:
* <div id="title">My title</div>
* <div id="message">My message</div>
*
*/
var resp = $("<div/>").append(data);
var title = resp.find("#title").html(),
message = resp.find("#message").html();
dialog.data.find(".header span").html(title);
dialog.data.find(".message").html(message);
dialog.data.find(".buttons .yes").hide();
dialog.data.find(".buttons .no").hide();
//dialog.data.find(".buttons .no").html("Close");
// No need to call the callback or $.modal.close()
});// End for click
});//End for on show
} //End for modal
}); //Close for modal
}
</code></pre>
<p>My CSS:</p>
<pre><code>confirmModalContainer {height:700px; width:700px; font-family:'Trebuchet MS', Verdana, Arial; font-size:16px; text-align:left; background:#fff; border:2px solid #336699;}
</code></pre>
<p>How do I modify the SimpleModal container size? On an Ajax call?</p>
| [
{
"answer_id": 790332,
"author": "tghw",
"author_id": 2363,
"author_profile": "https://Stackoverflow.com/users/2363",
"pm_score": 2,
"selected": false,
"text": ">> $('.modalContainer').addClass('wide')\n"
},
{
"answer_id": 809901,
"author": "brianpeiris",
"author_id": 224... | 2008/12/29 | [
"https://Stackoverflow.com/questions/397684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44984/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.