qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
256,255
<p>I read all over the place about how Spring encourages you to use interfaces in your code. I don't see it. There is no notion of interface in your spring xml configuration. What part of Spring actually encourages you to use interfaces (other than the docs)?</p>
[ { "answer_id": 256274, "author": "Jack Leow", "author_id": 31506, "author_profile": "https://Stackoverflow.com/users/31506", "pm_score": 2, "selected": false, "text": "org.springframework.core.io.Resource org.springframework.core.io.ClassPathResource org.springframework.core.io.FileSyste...
2008/11/01
[ "https://Stackoverflow.com/questions/256255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22063/" ]
256,264
<p>The symptom of the problem looks like "[0m[27m[24m[J[34;1" which on a terminal translates into the color blue.</p> <p>-A </p>
[ { "answer_id": 256393, "author": "cefstat", "author_id": 19155, "author_profile": "https://Stackoverflow.com/users/19155", "pm_score": 0, "selected": false, "text": "case $TERM in\nxterm-color)\nexport PS1='\\[\\e]0;\\W\\007\\]\\[\\e[34;1m\\]\\W\\[\\e[0m\\]\\$ '\n;;\n*)\nexport PS1='\\W\...
2008/11/01
[ "https://Stackoverflow.com/questions/256264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30636/" ]
256,267
<p>I have a windows service connecting to a SqlServer database on the local box. This works fine most all the time. At a large customer, however, the database connectivity gets corrupted for some rare and unknown reason. When this happens, calls to DbDataAdapter.Fill return a DataSet with a different number of colum...
[ { "answer_id": 256393, "author": "cefstat", "author_id": 19155, "author_profile": "https://Stackoverflow.com/users/19155", "pm_score": 0, "selected": false, "text": "case $TERM in\nxterm-color)\nexport PS1='\\[\\e]0;\\W\\007\\]\\[\\e[34;1m\\]\\W\\[\\e[0m\\]\\$ '\n;;\n*)\nexport PS1='\\W\...
2008/11/01
[ "https://Stackoverflow.com/questions/256267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18313/" ]
256,277
<p>"C Interfaces and Implementations" shows some interesting usage patterns for data structures, but I am sure there are others out there.</p> <p><a href="https://rads.stackoverflow.com/amzn/click/com/0201498413" rel="nofollow noreferrer" rel="nofollow noreferrer">http://www.amazon.com/Interfaces-Implementations-Tech...
[ { "answer_id": 256440, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 4, "selected": true, "text": "#include \"header.h\"\n #ifndef HEADER_H_INCLUDED\n#define HEADER_H_INCLUDED\n...operational body of header.h...\n...
2008/11/01
[ "https://Stackoverflow.com/questions/256277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30636/" ]
256,282
<p>On <a href="http://andrew.hedges.name/blog/" rel="nofollow noreferrer">my blog</a>, I display in the right nav the 10 most popular articles in terms of page hits. Here's how I get that:</p> <pre><code>SELECT * FROM entries WHERE is_published = 1 ORDER BY hits DESC, created DESC LIMIT 10 </code></pre> <p>What I wou...
[ { "answer_id": 256302, "author": "Stephen Walcher", "author_id": 25375, "author_profile": "https://Stackoverflow.com/users/25375", "pm_score": 4, "selected": true, "text": "SELECT *, AVG(hits / DATEDIFF(NOW(), created)) as avg_hits\nFROM entries\nWHERE is_published = 1\nGROUP BY id\nORDE...
2008/11/01
[ "https://Stackoverflow.com/questions/256282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
256,291
<p>What tools do you know, other than those in Visual Studio, to analyze performance bottlenecks in a Windows CE/Mobile application? I'm looking for something like AQTime for CE/Mobile, to profile C/C++ applications compiled to native code.</p>
[ { "answer_id": 256502, "author": "Shane Powell", "author_id": 23235, "author_profile": "https://Stackoverflow.com/users/23235", "pm_score": 4, "selected": true, "text": "// File: callcaphooks.c\n\n#include <stdio.h>\nint main();\n\nvoid _CAP_Enter_Function(void *p) \n{\n if (p != main...
2008/11/02
[ "https://Stackoverflow.com/questions/256291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8999/" ]
256,297
<p>In C++ I'd like to do something like:</p> <pre><code>int n = get_int_from_user(); char* matrix = new char[n][n]; matrix[0][0] = 'c'; //... matrix[n][n] = 'a'; delete [][] matrix; </code></pre> <p>but of course this doesn't work. What is the best way to do something similar? I've seen some solutions to this bu...
[ { "answer_id": 256303, "author": "Bernard", "author_id": 61, "author_profile": "https://Stackoverflow.com/users/61", "pm_score": 2, "selected": false, "text": "int n = get_int_from_user();\n\nchar** matrix = new char*[n];\nfor (int i = 0; i < n; i++) {\n matrix[i] = new char[n];\n}\n\...
2008/11/02
[ "https://Stackoverflow.com/questions/256297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30529/" ]
256,306
<p>I have a class that defines a CallRate type. I need to add the ability to create multiple instances of my class by reading the data from a file.</p> <p>I added a static method to my class CallRate that returns a <code>List&lt;CallRate&gt;</code>. Is it ok for a class to generate new instances of itself by calling o...
[ { "answer_id": 256308, "author": "Ray Lu", "author_id": 11413, "author_profile": "https://Stackoverflow.com/users/11413", "pm_score": 5, "selected": true, "text": "XmlReadrer reader = XmlReader.Create(filepathString);\n" }, { "answer_id": 256323, "author": "Jay Bazuzi", "...
2008/11/02
[ "https://Stackoverflow.com/questions/256306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10178/" ]
256,325
<p>For my Django app I have Events, Ratings, and Users. Ratings are related to Events and Users through a foreign keys. When displaying a list of Events I want to filter the ratings of the Event by a user_id so I know if an event has been rated by the user. </p> <p>If I do:</p> <pre><code>event_list = Event.objects....
[ { "answer_id": 256342, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 1, "selected": false, "text": "Event.objects.all() {% for e in event_list %}\n {{ e }}\n {% if e.rating_set.all %}{{ e.rating_set }}{% endif %}\n{% ...
2008/11/02
[ "https://Stackoverflow.com/questions/256325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5112/" ]
256,345
<p>Could you write a function that takes one argument (a positive integer) and</p> <ul> <li>divides it by two if it's even, or</li> <li>multiplies it by three and adds one if it's odd</li> </ul> <p>and then returns the resulting number.</p> <p>And then a separate function that takes one argument (a positive integer)...
[ { "answer_id": 256352, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 0, "selected": false, "text": "(define (collatz x)\n (if (even? x)\n (/ x 2)\n (+ (* x 3) 1)))\n (define (collatz-loop x)\n (if (= x 1) 1\n ...
2008/11/02
[ "https://Stackoverflow.com/questions/256345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30622/" ]
256,349
<p>I'm trying to find some info on the best and most common RESTful url actions.</p> <p>for example, what url do you use for displaying the details of an item, for editing the item, updating, etc.</p> <pre><code>/question/show/&lt;whatever&gt; /question/edit/&lt;whatever&gt; /question/update/&lt;whatever&gt; (this is...
[ { "answer_id": 256355, "author": "Allain Lalonde", "author_id": 2443, "author_profile": "https://Stackoverflow.com/users/2443", "pm_score": 4, "selected": false, "text": "/questions/10" }, { "answer_id": 256359, "author": "Brian R. Bondy", "author_id": 3153, "author_p...
2008/11/02
[ "https://Stackoverflow.com/questions/256349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
256,354
<p>In some my project I notice that during executing unit tests under VSTS2008 its VSTestHost's memory consuming grows. As I have very many tests in my solution it leads to OutOfMemroyException eventually. That looks very strange for me as I was sure that MSTest creates a new AppDomain for each unit test. Otherwise how...
[ { "answer_id": 256865, "author": "Shrike", "author_id": 27703, "author_profile": "https://Stackoverflow.com/users/27703", "pm_score": 3, "selected": false, "text": "public class Singleton\n{\n public static Singleton Instance = new Singleton();\n\n private Guid _token;\n private...
2008/11/02
[ "https://Stackoverflow.com/questions/256354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27703/" ]
256,387
<p>When using copy-on-write semantics to share memory among processes, how can you test if a memory page is writable or if it is marked as read-only? Can this be done by calling a specific assembler code, or reading a certain spot in memory, or through the OS's API?</p>
[ { "answer_id": 256409, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 3, "selected": true, "text": "$ cat /proc/self/maps\n\n002b3000-002cc000 r-xp 00000000 68:01 143009 /lib/ld-2.5.so\n002cc000-002cd000 r-xp 000180...
2008/11/02
[ "https://Stackoverflow.com/questions/256387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33364/" ]
256,405
<p>I have a C/C++ application and I need to create a X509 pem certificate containing both a public and private key. The certificate can be self signed, or unsigned, doesn't matter.</p> <p>I want to do this inside an app, not from command line.</p> <p>What OpenSSL functions will do this for me? Any sample code is a ...
[ { "answer_id": 256436, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 2, "selected": false, "text": "system openssl openssl-dev" }, { "answer_id": 15082282, "author": "Nathan Osman", "author_id": 193619, ...
2008/11/02
[ "https://Stackoverflow.com/questions/256405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
256,451
<p>I've written a VB.NET application that uses SQL CE 3.5. I'm curious if anyone has any best practice or code to help check if A) SQL CE is installed and B) If so, what version. </p> <p>I searched msdn and google for anything but I didn't find anything helpful. I was poking around the registry and found this key: ...
[ { "answer_id": 17834938, "author": "noelicus", "author_id": 865643, "author_profile": "https://Stackoverflow.com/users/865643", "pm_score": 0, "selected": false, "text": "<Fragment>\n <util:RegistrySearch\n Id='SearchForSQLCE'\n Variable=\"SQLCEInstalled\"\n ...
2008/11/02
[ "https://Stackoverflow.com/questions/256451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33371/" ]
256,456
<p>My application has a WCF service tier between the front-end and the database. Since we currently host in IIS6 we are using SOAP over HTTP. How can I find out how much real world time I am spending doing serialization activities in my application?</p>
[ { "answer_id": 256602, "author": "Ray Lu", "author_id": 11413, "author_profile": "https://Stackoverflow.com/users/11413", "pm_score": 1, "selected": false, "text": "AfterReceiveRequest\n{\n DateTime start = datetime.now;\n return start;\n}\nBeforeSendReply\n{\n // start will be passed ...
2008/11/02
[ "https://Stackoverflow.com/questions/256456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32992/" ]
256,460
<p>Is there anything similar to an <code>indexOf</code> function in the NSString objects?</p>
[ { "answer_id": 256464, "author": "Airsource Ltd", "author_id": 18017, "author_profile": "https://Stackoverflow.com/users/18017", "pm_score": 8, "selected": true, "text": "-[NSString rangeOfString:] - (NSRange)rangeOfString:(NSString *)aString;\n" }, { "answer_id": 7329792, "a...
2008/11/02
[ "https://Stackoverflow.com/questions/256460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12388/" ]
256,490
<p>I'm trying to go deep into Dictionary ADT and Skip List for Java. My textbook doesn't cover a lot about this and whatever it has covered is very complicated. Which is the best online site to get more information on Dictionary ADT and Skip List for Java. I'm looking for the one which talks visually and gives a lot of...
[ { "answer_id": 256498, "author": "Alan", "author_id": 17205, "author_profile": "https://Stackoverflow.com/users/17205", "pm_score": 3, "selected": true, "text": "ConcurrentSkipListSet ConcurrentSkipListMap Map" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/256490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33203/" ]
256,495
<p>Are there compilers for high-level languages (such as C) which can be targeted to various architectures by specifying the hardware resources of the target?</p> <p>I'm wondering if there are compilers which can target an architecture by specifying features such as the available registers and instruction set of the p...
[ { "answer_id": 256555, "author": "Javier", "author_id": 11649, "author_profile": "https://Stackoverflow.com/users/11649", "pm_score": 2, "selected": true, "text": ".md" }, { "answer_id": 256639, "author": "Louis Gerbarg", "author_id": 30506, "author_profile": "https:/...
2008/11/02
[ "https://Stackoverflow.com/questions/256495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17172/" ]
256,507
<p>I'm a Lisp beginner. I'm trying to memoize a recursive function for calculating the number of terms in a <a href="http://en.wikipedia.org/wiki/Collatz_conjecture" rel="noreferrer">Collatz sequence</a> (for problem 14 in <a href="http://projecteuler.net/index.php?section=problems&amp;id=14" rel="noreferrer">Project E...
[ { "answer_id": 256552, "author": "Javier", "author_id": 11649, "author_profile": "https://Stackoverflow.com/users/11649", "pm_score": 2, "selected": false, "text": "(setf collatz-steps (memoize lambda (n)\n (if (= 1 n) 0\n (if (evenp n) \n (1+ (collatz-steps (/ n 2)))\n ...
2008/11/02
[ "https://Stackoverflow.com/questions/256507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8127/" ]
256,517
<p>When I was learning Java coming from a background of some 20 years of procedural programming with basic, Pascal, COBOL and C, I thought at the time that the hardest thing about it was wrapping my head around the OOP jargon and concepts. Now with about 8 years of solid Java under my belt, I have come to the conclusi...
[ { "answer_id": 256591, "author": "Lawrence Dol", "author_id": 8946, "author_profile": "https://Stackoverflow.com/users/8946", "pm_score": 0, "selected": false, "text": "Object processIocMessage(Object msgsdr, int msgidn, Object msgdta)\n Object iocMessage(int mid, Object dta)\nvoid ioc...
2008/11/02
[ "https://Stackoverflow.com/questions/256517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8946/" ]
256,546
<p>Anyone know if there is already a validator for "type" strings?</p> <p>I want to make sure that the type attributes in my custom config are one of the following:</p> <pre> type="TopNamespace.SubNameSpace.ContainingClass, MyAssembly" type="TopNamespace.SubNameSpace.ContainingClass, MyAssembly, Version=1.3.0.0, Cult...
[ { "answer_id": 258944, "author": "jon without an h", "author_id": 27578, "author_profile": "https://Stackoverflow.com/users/27578", "pm_score": 0, "selected": false, "text": "List<>\n\"System.Collections.Generic.List`1\"\n\nList<string>\n\"System.Collections.Generic.List`1[[System.String...
2008/11/02
[ "https://Stackoverflow.com/questions/256546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91911/" ]
256,554
<p>In particular, I'm editing the AutoCompletion.plist file for CSSEdit (if that even matters).</p> <p>My question is, are there any characters withing the STRING elements that need to be escaped? spaces? quotes?</p> <p>EDIT: Just to be clear, I'm not using CSSEdit to edit the file - rather the file is part of the CS...
[ { "answer_id": 257149, "author": "Brian Webster", "author_id": 23324, "author_profile": "https://Stackoverflow.com/users/23324", "pm_score": 5, "selected": true, "text": "<string>Georgia, Times, &apos;Times New Roman&apos;, serif</string>" }, { "answer_id": 257185, "author": ...
2008/11/02
[ "https://Stackoverflow.com/questions/256554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17252/" ]
256,557
<p>One of the things that seems to be necessary with use of STL is a way to specify local functions. Many of the functions that I would normally provide cannot be created using STL function object creation tools ( eg bind ), I have to hand roll my function object.</p> <p>Since the C++ standard forbids local types to b...
[ { "answer_id": 256567, "author": "hazzen", "author_id": 5066, "author_profile": "https://Stackoverflow.com/users/5066", "pm_score": 2, "selected": false, "text": "struct operator() struct MyMinFunctor {\n bool operator()(const int& a, const int& b) { return a > b; }\n};\n\nvector<int> v...
2008/11/02
[ "https://Stackoverflow.com/questions/256557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29178/" ]
256,564
<p>I'm a Python novice, trying to use pyCurl. The project I am working on is creating a Python wrapper for the twitpic.com API (<a href="http://twitpic.com/api.do" rel="nofollow noreferrer">http://twitpic.com/api.do</a>). For reference purposes, check out the code (<a href="http://pastebin.com/f4c498b6e" rel="nofollow ...
[ { "answer_id": 256610, "author": "gimel", "author_id": 6491, "author_profile": "https://Stackoverflow.com/users/6491", "pm_score": 3, "selected": true, "text": "import sys\nimport pycurl\n\nclass Test:\n def __init__(self):\n self.contents = ''\n\n def body_callback(self, buf):...
2008/11/02
[ "https://Stackoverflow.com/questions/256564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33383/" ]
256,566
<p>I'm trying to create a function in C# which will allow me to, when called, return a reference to a given class type. The only types of functions like this that I have seen are in UnrealScript and even then the functionality is hard coded into its compiler. I'm wondering if I can do this in C#. Here's what I mean ...
[ { "answer_id": 256586, "author": "Martin v. Löwis", "author_id": 33006, "author_profile": "https://Stackoverflow.com/users/33006", "pm_score": 0, "selected": false, "text": "System.Type t = typeof(ActorChild);\n System.Type t = Type.GetType(\"NamespaceFoo.ActorChild\");\n public object C...
2008/11/02
[ "https://Stackoverflow.com/questions/256566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
256,579
<p>I'm working on an application developed by another mob and am confounded by the use of a char field instead of bit for all the boolean columns in the database. It uses "Y" for true and "N" for false (these have to be uppercase). The type name itself is then aliased with some obscure name like <em>ybln</em>.</p> <p>...
[ { "answer_id": 259176, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 1, "selected": false, "text": "WHERE BooleanColumn WHERE BitColumn = 1 IF @BitFlag = 1 IF @BooleanFlag NULL" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/256579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21966/" ]
256,625
<p>I have seen samples of closure from - <a href="https://stackoverflow.com/questions/36636/what-is-a-closure">What is a &#39;Closure&#39;?</a></p> <p>Can anyone provide simple example of when to use closure?<br></p> <p><b>Specifically, scenarios in which closure makes sense?</b><Br></p> <p>Lets assume that the lang...
[ { "answer_id": 256630, "author": "Rich", "author_id": 22003, "author_profile": "https://Stackoverflow.com/users/22003", "pm_score": 4, "selected": false, "text": "(defun make-adder (how-much)\n (lambda (x)\n (+ x how-much)))\n cl-user(2): (make-adder 5)\n#<Interpreted Closure (:inter...
2008/11/02
[ "https://Stackoverflow.com/questions/256625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23574/" ]
256,628
<p>I'm trying to set up a loop where an animation runs a certain number of times, and a function is run before each iteration of the animation. The timing ends up being off, though -- it runs the callback n times, then runs the animation n times. For example:</p> <pre><code>for (var i=0;i&lt;3;i++) { console.log(i)...
[ { "answer_id": 256645, "author": "MDCore", "author_id": 1896, "author_profile": "https://Stackoverflow.com/users/1896", "pm_score": 2, "selected": false, "text": "do_animation(max_runs, total_runs) {\n log();\n if (total_runs < max_runs) {\n $(foo).animate(..., do_animation(max...
2008/11/02
[ "https://Stackoverflow.com/questions/256628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33391/" ]
256,647
<p>I want to see how long a function takes to run. What's the easiest way to do this in PLT-Scheme? Ideally I'd want to be able to do something like this:</p> <pre><code>&gt; (define (loopy times) (if (zero? times) 0 (loopy (sub1 times)))) &gt; (loopy 5000000) 0 ;(after about a seco...
[ { "answer_id": 256652, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 2, "selected": false, "text": "(time-apply proc arg-list) > (time-apply loopy '(5000000))\n(0)\n621\n887\n0\n" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/256647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
256,700
<p>What is a view in Oracle?</p>
[ { "answer_id": 256703, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 7, "selected": false, "text": "SELECT customerid, customername FROM customers WHERE countryid='US';\n CREATE VIEW view_uscustomers\nAS\nSELECT customerid,...
2008/11/02
[ "https://Stackoverflow.com/questions/256700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
256,702
<p>I have used something like the following to compose policies for my application:</p> <p>The policy classes look like this:</p> <pre><code>struct Policy { static void init(); static void cleanup(); //... }; template &lt;class CarT, class CdrT&gt; struct Cons { static void init() { CarT::init(); Cdr...
[ { "answer_id": 256860, "author": "tabdamage", "author_id": 28022, "author_profile": "https://Stackoverflow.com/users/28022", "pm_score": 1, "selected": false, "text": "for_each<Policies>(InitPolicy());\n struct InitPolicy() {\n template<class Policy>\n void operator() (Policy& p) {...
2008/11/02
[ "https://Stackoverflow.com/questions/256702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28888/" ]
256,719
<p>In most versions of windows, you can get to the menu by pressing the F10 key, thus avoiding having to use the mouse. This behaviour does not appear to be present in Windows Mobile 5.0, but is desirable as the device I am using will be more keyboard than touch screen driven. </p> <p>Is there a way of programmatica...
[ { "answer_id": 256777, "author": "SmacL", "author_id": 22564, "author_profile": "https://Stackoverflow.com/users/22564", "pm_score": 2, "selected": true, "text": "void CMyFrame::OnFocusMenu()\n{\n PostMessage(WM_SYSCOMMAND,SC_KEYMENU,0);\n}\n ::SetActiveWindow(m_wndCommandBar.m_hWnd);\n...
2008/11/02
[ "https://Stackoverflow.com/questions/256719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22564/" ]
256,723
<p>We are using Subversion. We would like to </p> <pre><code>1. search across all commit messages ? 2. monitor the commits on certain important files ? 3. identify files that are never/rarely used ? 4. identify files that are most frequently changed ? 5. identify files that most developers have accessed ? 6....
[ { "answer_id": 256727, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 1, "selected": false, "text": "sed" }, { "answer_id": 257141, "author": "JesperE", "author_id": 13051, "author_profile": "https://S...
2008/11/02
[ "https://Stackoverflow.com/questions/256723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27474/" ]
256,724
<p>In C++, is it safe to extend scope via a reference?</p> <p>In code, what I mean is: </p> <pre><code>MyCLass&amp; function badIdea() { MyClass obj1; ... return obj1; } </code></pre>
[ { "answer_id": 256741, "author": "peterchen", "author_id": 31317, "author_profile": "https://Stackoverflow.com/users/31317", "pm_score": 1, "selected": false, "text": "int * p = NULL;\n{\n int y = 22;\n p = &y;\n}\n*p = 77; // BOOM!\n" }, { "answer_id": 256748, "author": "M...
2008/11/02
[ "https://Stackoverflow.com/questions/256724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
256,728
<pre><code>function AddTheatres() { Services.AdminWebServices.AddTheatresSVC(oTheatres, OnSuccessTheatres, OnError, OnTimeOut); } function OnSuccessTheatres(result1) { Services.AdminWebServices.AddTicketPricesSVC(oTicketPrices, OnSuccessTicketPrices, OnError, OnTimeOut); //working } function OnSuccessTicketPrices...
[ { "answer_id": 256747, "author": "naveen", "author_id": 17447, "author_profile": "https://Stackoverflow.com/users/17447", "pm_score": 0, "selected": false, "text": "function OnError(error)\n{\n alert(error.get_message());\n}\nfunction OnTimeOut()\n{\n alert('System Time Out');\n}\n...
2008/11/02
[ "https://Stackoverflow.com/questions/256728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17447/" ]
256,729
<p>I have a regular expression to match a persons name.</p> <p>So far I have ^([a-zA-Z\'\s]+)$ but id like to add a check to allow for a maximum of 4 spaces. How do I amend it to do this?</p> <p><strong>Edit:</strong> what i meant was 4 spaces anywhere in the string</p>
[ { "answer_id": 256735, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 4, "selected": true, "text": "1: Get Input \n2: Trim White Space\n3: If this makes sence, trim out any 'bad' characters. \n4: Use the \"split\" u...
2008/11/02
[ "https://Stackoverflow.com/questions/256729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17211/" ]
256,754
<p>The situation is somewhat like-</p> <pre><code>var someVar = some_other_function(); someObj.addEventListener("click", function(){ some_function(someVar); }, false); </code></pre> <p>The problem is that the value of <code>someVar</code> is not visible inside the listener function of the <code>addEventListener</...
[ { "answer_id": 256763, "author": "Sergey Ilinsky", "author_id": 23815, "author_profile": "https://Stackoverflow.com/users/23815", "pm_score": 9, "selected": true, "text": "some_function someVar function() { some_function(someVar); } \n someVar addEventListener var someVar; \nsomeVar = so...
2008/11/02
[ "https://Stackoverflow.com/questions/256754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30252/" ]
256,803
<p>A few days ago, I asked <a href="https://stackoverflow.com/questions/242577/c-what-is-string-really-good-for">why its not possible to store binary data, such as a jpg file into a string variable</a>.</p> <p>Most of the answers I got said that string is used for textual information such as what I'm writing now.</p> ...
[ { "answer_id": 256824, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 1, "selected": false, "text": "byte[] myJpegByteArray = GetBytesFromSomeImage();\n\nstring myString = Encoding.ASCII.GetString(myJpegByteArray);\n...
2008/11/02
[ "https://Stackoverflow.com/questions/256803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17211/" ]
256,804
<p>Is there a way to execute SQL custom functions with Enterpise Library? I've tried Database.ExecuteScalar() but for some reason it returns null.</p> <p>This is my function:</p> <pre><code>Database db = DatabaseFactory.CreateDatabase("ConnectionString"); DbCommand cmd = db.GetStoredProcCommand("FunctionName"); db.Ad...
[ { "answer_id": 256898, "author": "oglester", "author_id": 2017, "author_profile": "https://Stackoverflow.com/users/2017", "pm_score": 2, "selected": false, "text": "SELECT FuncName(@Param1)\n SELECT * FROM FuncName(@Param1)\n" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/256804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14533/" ]
256,806
<p>A common pattern in C++ is to create a class that wraps a lock - the lock is either implicitly taken when object is created, or taken explicitly afterwards. When object goes out of scope, dtor automatically releases the lock. Is it possible to do this in C#? As far as I understand there are no guarantees on when dto...
[ { "answer_id": 256818, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 2, "selected": false, "text": "lock (_myLockKey) { ... }\n" }, { "answer_id": 256842, "author": "denis phillips", "author_id": 748...
2008/11/02
[ "https://Stackoverflow.com/questions/256806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33426/" ]
256,807
<p>Is there any way to check if a given index of an array exists? I am trying to set numerical index but something like 1, 5, 6,10. And so I want to see if these indexes already exist and if they do just increase another counter.</p> <p>I normally work with php but I am trying to do this in c++, so basically I am tryi...
[ { "answer_id": 256825, "author": "user23167", "author_id": 23167, "author_profile": "https://Stackoverflow.com/users/23167", "pm_score": 4, "selected": true, "text": "int i[10];\ni[10] = 2; // Legal but very dangerous! Writing on memory you don't know about\n #include <map>\n#include <st...
2008/11/02
[ "https://Stackoverflow.com/questions/256807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8715/" ]
256,811
<p>How do you create non scrolling div that looks like the MS Office 2007 ribbon on a web page without two sets of scroll bars. One for the window and one for the div.</p>
[ { "answer_id": 256830, "author": "belugabob", "author_id": 13397, "author_profile": "https://Stackoverflow.com/users/13397", "pm_score": 3, "selected": false, "text": "<div> z-index <div> <div> <body>\n <div style=\"position: fixed; top: 0px; width:100%; height: 100px;\">\n HEa...
2008/11/02
[ "https://Stackoverflow.com/questions/256811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
256,822
<p>In RoR,how to validate a Chinese or a Japanese word for a posting form with utf8 code.</p> <p>In GBK code, it uses [\u4e00-\u9fa5]+ to validate Chinese words. In Php, it uses /^[\x{4e00}-\x{9fa5}]+$/u for utf-8 pages.</p>
[ { "answer_id": 256855, "author": "Rômulo Ceccon", "author_id": 23193, "author_profile": "https://Stackoverflow.com/users/23193", "pm_score": 3, "selected": false, "text": ">> \"acentuação\".scan(/\\xC3\\xA7/)\n=> [\"ç\"] \n /([\\x4E-\\x9E][\\x00-\\xFF])|(\\x9F[\\x00-\\xA5])/ # (untes...
2008/11/02
[ "https://Stackoverflow.com/questions/256822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20191/" ]
256,823
<p>The scenario is trying to adjust font size to get a nice graphic arrangement, or trying to decide where to break a caption/subtitle. a) In XL VBA is there a way to find out whether a text on a textbox, or caption on a label, still fits the control? b) Is there a way to know where was the text/caption broken on multi...
[ { "answer_id": 257458, "author": "jpinto3912", "author_id": 11567, "author_profile": "https://Stackoverflow.com/users/11567", "pm_score": 3, "selected": true, "text": "Function TextWidth(aText As String, Optional aFont As NewFont) As Single\n Dim theFont As New NewFont\n Dim notSee...
2008/11/02
[ "https://Stackoverflow.com/questions/256823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11567/" ]
256,832
<p>I'm used to work with Java where large amounts of examples are available. For various reasons I had to switch to C# and trying to do the following in SharpDevelop:</p> <pre><code>// Form has a menu containing a combobox added via SharpDevelop's GUI // --- Variables languages = new string[2]; languages[0] = "Englis...
[ { "answer_id": 256840, "author": "Alan", "author_id": 31223, "author_profile": "https://Stackoverflow.com/users/31223", "pm_score": 0, "selected": false, "text": "mnuActionLanguage.ComboBox.DisplayMember = \"Lang.Language\";\n mnuActionLanguage.ComboBox.DisplayMember = \"Language\";\n" ...
2008/11/02
[ "https://Stackoverflow.com/questions/256832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33429/" ]
256,859
<p>What, if any, is the performance difference between the following two loops?</p> <pre><code>for (Object o: objectArrayList) { o.DoSomething(); } </code></pre> <p>and </p> <pre><code>for (int i=0; i&lt;objectArrayList.size(); i++) { objectArrayList.get(i).DoSomething(); } </code></pre>
[ { "answer_id": 256861, "author": "Vijay Dev", "author_id": 27474, "author_profile": "https://Stackoverflow.com/users/27474", "pm_score": 9, "selected": true, "text": "// The preferred idiom for iterating over collections and arrays\nfor (Element e : elements) {\n doSomething(e);\n}\n"...
2008/11/02
[ "https://Stackoverflow.com/questions/256859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26567/" ]
256,892
<p>How do i backup a SQL database using PHP.</p> <p>Is there a vendor agnostic way to do this that conforms to ANSI SQL?</p> <p>If not maybe you can list how to do it for each of the database vendors?</p>
[ { "answer_id": 256907, "author": "vog", "author_id": 19163, "author_profile": "https://Stackoverflow.com/users/19163", "pm_score": 4, "selected": true, "text": "pg_dump mysqldump system() shell_exec() test <?php\nheader('Content-type: text/plain');\nsystem('pg_dump test');\n?>\n ~/.my.c...
2008/11/02
[ "https://Stackoverflow.com/questions/256892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13227/" ]
256,897
<p>I'm using <a href="http://www.codeplex.com/bizunit" rel="noreferrer" title="BizUnit">BizUnit</a> to unit-tests my Biztalk orchestrations, but some orchestrations consume a WebService,and testing these seems more like integration testing than unit testing.</p> <p>I'm familiar with using a mocking framework to mock t...
[ { "answer_id": 271044, "author": "David Hall", "author_id": 2660, "author_profile": "https://Stackoverflow.com/users/2660", "pm_score": 4, "selected": true, "text": "new Guid(\"\"), new Guid()" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/256897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18865/" ]
256,915
<p>I'm building small web shop with asp.net mvc and Structuremap ioc/di. My Basket class uses session object for persistence, and I want use SM to create my basket object through IBasket interface. My basket implementation need HttpSessionStateBase (session state wrapper from mvc) in constructor, which is available ins...
[ { "answer_id": 257496, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 3, "selected": true, "text": "public interface IHttpSessionStateWrapper\n{\n HttpSessionState GetSessionState();\n}\n\npublic class HttpSessionStat...
2008/11/02
[ "https://Stackoverflow.com/questions/256915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1407/" ]
256,919
<p>I am looking for suggestions on how to find the sizes (in bits) and range of floating point numbers in an architecture independent manner. The code could be built on various platforms (AIX, Linux, HPUX, VMS, maybe Windoze) using different flags - so results should vary. The sign, I've only seen as one bit, but how...
[ { "answer_id": 256926, "author": "mipadi", "author_id": 28804, "author_profile": "https://Stackoverflow.com/users/28804", "pm_score": 2, "selected": false, "text": "float.h" }, { "answer_id": 256928, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "h...
2008/11/02
[ "https://Stackoverflow.com/questions/256919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
256,932
<p>Is there a way of getting the websites absolute URL (<a href="http://www.domain.com/" rel="nofollow noreferrer">http://www.domain.com/</a>) using Java? because I've googled a bit but I only come across with having to make 2 or 3 classes to create that function =/</p> <h3>Update:</h3> <p>The thing is I am trying to c...
[ { "answer_id": 256995, "author": "Paul Croarkin", "author_id": 18995, "author_profile": "https://Stackoverflow.com/users/18995", "pm_score": 1, "selected": false, "text": "String realPath = getServletConfig().getServletContext().getRealPath(relativePath);\n" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/256932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28586/" ]
256,938
<p>I am writing a footer div that displays info from the database. The footer has a different background color than the rest of the page, and will have a height that depends on how much content the database throws to it. When I generate the content with php and call for a border around the footer div, the content app...
[ { "answer_id": 256948, "author": "stevemegson", "author_id": 25028, "author_profile": "https://Stackoverflow.com/users/25028", "pm_score": 2, "selected": false, "text": "<dl> <div> clear:both; </div> <div style='clear:both;'></div>\n" }, { "answer_id": 256965, "author": "Konr...
2008/11/02
[ "https://Stackoverflow.com/questions/256938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1149/" ]
256,953
<p>It seems that HTML 5 is going to be supported (partially) by Firefox 3.1 and other browsers. It is adding support for video and audio as tags, but these are new tags that XHTML 1.0 Transitional does not recognize. What is the behavior supposed to be if I use a new HTML 5 tag in a future version of Firefox but use th...
[ { "answer_id": 256998, "author": "hangy", "author_id": 11963, "author_profile": "https://Stackoverflow.com/users/11963", "pm_score": 4, "selected": true, "text": "<video> <audio>" }, { "answer_id": 257053, "author": "Ms2ger", "author_id": 33466, "author_profile": "htt...
2008/11/02
[ "https://Stackoverflow.com/questions/256953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10366/" ]
256,978
<p>Is there a way to persist an enum to the DB using NHibernate? That is have a table of both the code and the name of each value in the enum.</p> <p>I want to keep the enum without an entity, but still have a foreign key (the int representation of the enum) from all other referencing entities to the enum's table.</p>...
[ { "answer_id": 257073, "author": "Paco", "author_id": 13376, "author_profile": "https://Stackoverflow.com/users/13376", "pm_score": 3, "selected": false, "text": "private int myField;\npublic virtual MyEnum MyProperty\n{\n get { return (MyEnum)myField; }\n set { myField = value; }\n}...
2008/11/02
[ "https://Stackoverflow.com/questions/256978", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19956/" ]
256,997
<p>I have a PHP web application which uses a MySQL database for object tagging, in which I've used the tag structure accepted as the answer to <a href="https://stackoverflow.com/questions/20856/how-do-you-recommend-implementing-tags-or-tagging">this SO question</a>.</p> <p>I'd like to implement a tag hierarchy, where ...
[ { "answer_id": 257020, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 3, "selected": false, "text": "tag path\n--- ----\ndatabase database/\nmysql database/mysql/\nmysql4 database...
2008/11/02
[ "https://Stackoverflow.com/questions/256997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23732/" ]
257,005
<p>I want to do this using the <code>Math.Round</code> function</p>
[ { "answer_id": 257011, "author": "John Boker", "author_id": 2847, "author_profile": "https://Stackoverflow.com/users/2847", "pm_score": 7, "selected": false, "text": "twoDec = Math.Round(val, 2)\n" }, { "answer_id": 257017, "author": "Eoin Campbell", "author_id": 30155, ...
2008/11/02
[ "https://Stackoverflow.com/questions/257005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
257,030
<p>Writing something like this using the <a href="http://loki-lib.sourceforge.net/" rel="nofollow noreferrer">loki library</a>,</p> <pre><code>typedef Functor&lt;void&gt; BitButtonPushHandler; </code></pre> <p>throws a compiler error, but this works</p> <pre><code>typedef Functor&lt;void,TYPELIST_1(Matrix3D*)&gt; Pe...
[ { "answer_id": 257064, "author": "user23167", "author_id": 23167, "author_profile": "https://Stackoverflow.com/users/23167", "pm_score": 3, "selected": true, "text": "template <typename R = void, class TList = NullType,\n template<class, class> class ThreadingModel = LOKI_DEFAULT_...
2008/11/02
[ "https://Stackoverflow.com/questions/257030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209/" ]
257,047
<p>Where would i go to look for algorithms that take a 2d grid of values that are either 0 or 1 as input and then identifies all possible non-overlapping rectangles in it?</p> <p>In a more practical explanation: I am drawing a grid that is represented by a number of squares, and i wish to find a way to combine as many...
[ { "answer_id": 257075, "author": "Peter Olsson", "author_id": 2703, "author_profile": "https://Stackoverflow.com/users/2703", "pm_score": 1, "selected": false, "text": "0 0 1 1 1 0 0 0 1 1 1 1 0\n skip 2\ndraw 3\nskip 3\ndraw 4\nskip 1\n" }, { "answer_id": 257103, "author": "...
2008/11/02
[ "https://Stackoverflow.com/questions/257047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/145119/" ]
257,050
<p>Say you have a string, but you don't know what it contains. And you want to replace all occurences of a particular word or part of a word with a formatted version of the same word. For example, I have a string that contains "lorem ipsum" and i want to replace the entire word that contains "lo" with "lorem can" so th...
[ { "answer_id": 257054, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 1, "selected": true, "text": "$str = preg_replace('/lo(\\w*)/', 'lo$1 can', $str); \\w* \\w+" }, { "answer_id": 257063, "author": "eyelidlessnes...
2008/11/02
[ "https://Stackoverflow.com/questions/257050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24391/" ]
257,065
<p>The reason I am asking this is that I had accidentally done a <code>git commit -a</code> that included a file I did not yet want to commit. My solution was to do the following:</p> <pre><code>git reset --soft HEAD^ git reset -- file/with/changes_not_to_committed git commit -C HEAD@{1} </code></pre> <p>Here, I’ve r...
[ { "answer_id": 257105, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "git update-index git update-index --cacheinfo 100644 5be7e154c284fb8de8ddca0bb18b72a73089df9b filename\n git ls-tree git ...
2008/11/02
[ "https://Stackoverflow.com/questions/257065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9410/" ]
257,078
<p>I understand that using the "===" compares type, so running the following code results in "not equal" because it's comparing a number type to a string type.</p> <pre><code>var a = 20; var b = "20"; if (a === b) { alert("They are equal"); } else { alert("They are not equal"); } </code></pre> ...
[ { "answer_id": 257083, "author": "andy.gurin", "author_id": 22388, "author_profile": "https://Stackoverflow.com/users/22388", "pm_score": 5, "selected": true, "text": "== === \"20\" !== 20" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/257078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
257,085
<p>I have a JavaScript snippet that runs very well on Firefox and Safari, but refuses to run on IE:</p> <pre><code>var drop= function(id) { if(document.getElementById("select1").value == "Ficha de pediatria"){ top.location.href = "print.jsp?id="+id+"&amp;type=2"; } else if(document.getElementById("select1...
[ { "answer_id": 257095, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": true, "text": "id function drop(ctl,id)\n{\n var value = ctl.options[ctl.selectedIndex].value;\n\n if(value == \"Ficha de pediatria...
2008/11/02
[ "https://Stackoverflow.com/questions/257085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26004/" ]
257,091
<p>How do I clear the cin buffer in C++?</p>
[ { "answer_id": 257092, "author": "Gunnar Steinn", "author_id": 33468, "author_profile": "https://Stackoverflow.com/users/33468", "pm_score": 1, "selected": false, "text": "cin.flush();\n cin.ignore(INT_MAX);\n" }, { "answer_id": 257098, "author": "Evan Teran", "author_id"...
2008/11/02
[ "https://Stackoverflow.com/questions/257091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
257,093
<p>Given the following table, how does one calculate the hourly mode, or value with the highest frequency by hour?</p> <pre><code>CREATE TABLE Values ( ValueID int NOT NULL, Value int NOT NULL, LogTime datetime NOT NULL ) </code></pre> <p>So far, I've come up with the following query.</p> <pre><code>SELE...
[ { "answer_id": 257181, "author": "gbn", "author_id": 27535, "author_profile": "https://Stackoverflow.com/users/27535", "pm_score": 1, "selected": false, "text": "SELECT\n MAX(Frequency) AS [Mode],\n [Year],[Month],[Day],[Hour]\nFROM\n (SELECT\n COUNT(*) AS Frequency, \n ...
2008/11/02
[ "https://Stackoverflow.com/questions/257093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
257,102
<p>In other words, can <code>fn()</code> know that it is being used as <code>$var = fn();</code> rather than as <code>fn();</code>?</p> <p>A use case would be to <code>echo</code> the return value in the latter case but to <code>return</code> it in the former.</p> <p>Can this be done without passing a parameter to th...
[ { "answer_id": 257122, "author": "Stephen Walcher", "author_id": 25375, "author_profile": "https://Stackoverflow.com/users/25375", "pm_score": 0, "selected": false, "text": "if (namespace) {\n return $output;\n} else {\n echo $output;\n}\n" }, { "answer_id": 257184, "au...
2008/11/02
[ "https://Stackoverflow.com/questions/257102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17964/" ]
257,152
<p>If I have two things which are hex, can I someone how append their binary together to get a value?</p> <p>In C++, say I have</p> <pre><code>unsigned char t = 0xc2; // 11000010 unsigned char q = 0xa3; // 10100011 </code></pre> <p>What I want is somehow, <code>1100001010100011</code>, is this possible using bit-w...
[ { "answer_id": 257199, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 4, "selected": false, "text": "unsigned char t = 0xc2; // 11000010 \nunsigned char q = 0xa3; // 10100011\nunsigned short s = (((unsigned short)t)<<8...
2008/11/02
[ "https://Stackoverflow.com/questions/257152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33481/" ]
257,157
<p>I am attempting to build a simple method that creates an XML file from a database in ruby on rails. I feel like my code is right but I am not seeing all of the users in the XML.<br> I am a complete newbie to RoR.</p> <p>Here's my code:</p> <pre><code>def create_file @users = User.find(:all) file = File.ne...
[ { "answer_id": 257180, "author": "Rômulo Ceccon", "author_id": 23193, "author_profile": "https://Stackoverflow.com/users/23193", "pm_score": 3, "selected": true, "text": "add_element Elements#[] Elements#[] @users.each do |y|\n name_node = make.add_element \"name\"\n name_node.text = ...
2008/11/02
[ "https://Stackoverflow.com/questions/257157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33344/" ]
257,188
<p>I'm looking for a free (GPL or BSD-type license) outliner library that works in a browser. </p> <p>It doesn't have to be too complicated, just allow keyboard control of collapsing and expanding items, and changing their order.</p> <p>Anyone know a good library for this? Do any of the big UI component libraries hav...
[ { "answer_id": 6179661, "author": "Marcel", "author_id": 154877, "author_profile": "https://Stackoverflow.com/users/154877", "pm_score": 3, "selected": false, "text": "<li>" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/257188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8482/" ]
257,189
<p>I've heard a lot of people touting success using Linux based proxies to handle routing for high availability of web applications, but what are others doing with web services? I have a bank of WCF services that need to be moved to a high availability (failover) model, meaning that if a particular server hosting the W...
[ { "answer_id": 6179661, "author": "Marcel", "author_id": 154877, "author_profile": "https://Stackoverflow.com/users/154877", "pm_score": 3, "selected": false, "text": "<li>" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/257189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469/" ]
257,190
<p>Here is a simple scenario with table characters:</p> <pre><code>CharacterName GameTime Gold Live Foo 10 100 3 Foo 20 100 2 Foo 30 95 2 </code></pre> <p>How do I get this output for the query <code>SELECT Gold, Live FROM characters WHERE name = 'Foo' ORDER BY GameTime</code>:</p> <pre><code>Gold Live 100 3 0 -1 ...
[ { "answer_id": 257213, "author": "Eoin Campbell", "author_id": 30155, "author_profile": "https://Stackoverflow.com/users/30155", "pm_score": 2, "selected": false, "text": "GameID CharacterName GameTime Gold Live\n----------- ------------- ----------- ----------- ----------...
2008/11/02
[ "https://Stackoverflow.com/questions/257190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15345/" ]
257,220
<h2>solution structure [Plain Winforms + VS 2008 Express Edition]</h2> <ul> <li>CoffeeMakerInterface (NS CoffeeMaker)</li> <li>CoffeeMakerSoftware (NS CoffeeMakerSoftware)</li> <li>TestCoffeeMaker (NS TestCoffeeMaker)</li> </ul> <p>CoffeeMakerSoftware proj references CoffeeMakerInterface. TestCoffeeMaker proj referen...
[ { "answer_id": 258076, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 1, "selected": false, "text": "1. CoffeeMaker > CoffeeMakerInterfaces\n2. [X] > CoffeeMaker > CoffeeMakerSoftware\n3. [X] > TestCo...
2008/11/02
[ "https://Stackoverflow.com/questions/257220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
257,229
<p>I am writing a quick application myself - first project, however I am trying to find the VBA code for writing the result of an input string to a named cell in Excel.</p> <p>For example, a input box asks the question "Which job number would you like to add to the list?"... the user would then enter a reference numbe...
[ { "answer_id": 257247, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 5, "selected": true, "text": "Range(\"C1\").Value = Inputbox(\"Which job number would you like to add to the list?)\n" }, { "answer_id": 25...
2008/11/02
[ "https://Stackoverflow.com/questions/257229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22284/" ]
257,250
<p>I'm relatively new to jQuery, but so far what I've seen I like. What I want is for a div (or any element) to be across the top of the page as if "position: fixed" worked in every browser.</p> <p>I do not want something complicated. I do not want giant CSS hacks. I would prefer if just using jQuery (version 1.2.6) i...
[ { "answer_id": 257972, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 7, "selected": true, "text": "<div id=\"myElement\" style=\"position: absolute\">This stays at the top</div>\n $(window).scroll(function() {\n $('#myEleme...
2008/11/02
[ "https://Stackoverflow.com/questions/257250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11917/" ]
257,251
<p>I swear I've seen someone do this, but I can't find it in the various lists of shortcuts.</p> <p>Given:</p> <pre><code>String s = "A very long ............................ String"; </code></pre> <p>Is there an Eclipse shortcut to turn it into:</p> <pre><code>String s = "A very long ............................ "...
[ { "answer_id": 257652, "author": "John Stoneham", "author_id": 2040146, "author_profile": "https://Stackoverflow.com/users/2040146", "pm_score": 0, "selected": false, "text": "StringBuilder MessageFormat" }, { "answer_id": 26861386, "author": "Tomáš Záluský", "author_id":...
2008/11/02
[ "https://Stackoverflow.com/questions/257251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18995/" ]
257,255
<p>I'm looking for a really generic way to "fill out" a form based on a parameter string using javascript.</p> <p>for example, if i have this form:</p> <pre><code>&lt;form id="someform"&gt; &lt;select name="option1"&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;...
[ { "answer_id": 257287, "author": "Shadow2531", "author_id": 1697, "author_profile": "https://Stackoverflow.com/users/1697", "pm_score": 1, "selected": false, "text": "function setFormSelectValues(form, dataset) {\n var sel = form.getElementsByTagName(\"select\");\n dataset.replace(...
2008/11/02
[ "https://Stackoverflow.com/questions/257255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12983/" ]
257,259
<pre><code>void addNewNode (struct node *head, int n) { struct node* temp = (struct node*) malloc(sizeof(struct node)); temp -&gt; data = n; temp -&gt; link = head; head = temp; } </code></pre> <p>The code give above is the popularly wrong version of a function for adding a new node at the head of a li...
[ { "answer_id": 257267, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 2, "selected": false, "text": "addNode list.add(element)\n list = add(list, element)\n" }, { "answer_id": 257268, "author": "Daniel Spiewak", ...
2008/11/02
[ "https://Stackoverflow.com/questions/257259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6561/" ]
257,286
<p>in C++ I have two chars holding hex values e.g.:</p> <pre><code>char t = 0x4; char q = 0x4; </code></pre> <p>How would i compare if the two values held in the char are the same?? I tried</p> <pre><code>if (t == q) // should give me true </code></pre> <p>but no, any help, thanks!</p>
[ { "answer_id": 257291, "author": "BobS", "author_id": 33481, "author_profile": "https://Stackoverflow.com/users/33481", "pm_score": -1, "selected": false, "text": "if (t & q)\n" }, { "answer_id": 257304, "author": "Brian R. Bondy", "author_id": 3153, "author_profile":...
2008/11/02
[ "https://Stackoverflow.com/questions/257286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33481/" ]
257,288
<p>Is it possible to write a template that changes behavior depending on if a certain member function is defined on a class?</p> <p>Here's a simple example of what I would want to write:</p> <pre><code>template&lt;class T&gt; std::string optionalToString(T* obj) { if (FUNCTION_EXISTS(T-&gt;toString)) retu...
[ { "answer_id": 257315, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 5, "selected": false, "text": "template <typename T>\nstruct response_trait {\n static bool const has_tostring = false;\n};\n\ntemplate <>\nstruc...
2008/11/02
[ "https://Stackoverflow.com/questions/257288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21482/" ]
257,324
<p>I need to add 30 minutes to values in a Oracle date column. I do this in my SELECT statement by specifying </p> <p><code>to_char(date_and_time + (.000694 * 31)</code></p> <p>which works fine most of the time. But not when the time is on the AM/PM border. For example, adding 30 minutes to <code>12:30</code> [whi...
[ { "answer_id": 257337, "author": "Camilo Díaz Repka", "author_id": 861, "author_profile": "https://Stackoverflow.com/users/861", "pm_score": 1, "selected": false, "text": "SELECT to_char((to_date('12:40 PM', 'HH:MI AM') + (1/24/60) * 30), 'HH24:MI') as time\n FROM dual\n\nTIME\n--------...
2008/11/02
[ "https://Stackoverflow.com/questions/257324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3401/" ]
257,329
<p>I'm working on writing a kernel, and I have a few friends working with me on the project. We've been using DJGPP to compile the project for a while, but we're having some cross-platform compatibility issues with compiling this way that have left my main Partnet on the project unable to compile on Windows XP. (DJGPP'...
[ { "answer_id": 7827309, "author": "Unsigned", "author_id": 629493, "author_profile": "https://Stackoverflow.com/users/629493", "pm_score": 1, "selected": false, "text": "elf32" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/257329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19521/" ]
257,331
<p>What is the clearest explanation of what computer scientists mean by "the naive implementation"? I need a good clear example which will illustrate — ideally, even to non-technical people — that the naive implementation may <em>technically</em> be a functioning solution to the problem, but <em>practically</em> be ut...
[ { "answer_id": 257340, "author": "Quibblesome", "author_id": 1143, "author_profile": "https://Stackoverflow.com/users/1143", "pm_score": -1, "selected": false, "text": "foreach(object o in set1)\n{\n foreach(object p in set1)\n {\n // codez\n }\n}\n public static SomeObje...
2008/11/02
[ "https://Stackoverflow.com/questions/257331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33904/" ]
257,339
<p>I've never done it myself, and I've never subscribed to a feed, but it seems that I'm going to have to create one, so I'm wondering. The only way that seems apparent to me is that when the system is updated with a new item (blog post, news item, whatever), a new element should be written to the rss file. Or alternat...
[ { "answer_id": 257366, "author": "Nick", "author_id": 14072, "author_profile": "https://Stackoverflow.com/users/14072", "pm_score": 0, "selected": false, "text": "<%@ Page Language=\"C#\" EnableViewState=\"false\" %>\n<%@ OutputCache Duration=\"300\" VaryByParam=\"none\" %>\n\n<%@ Import...
2008/11/02
[ "https://Stackoverflow.com/questions/257339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12765/" ]
257,343
<p>If I have a range of say <code>000080-0007FF</code> and I want to see if a char containing hex is within that range, how can I do it?</p> <p>Example</p> <pre><code>char t = 0xd790; if (t is within range of 000080-0007FF) // true </code></pre>
[ { "answer_id": 257346, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 3, "selected": false, "text": "wchar_t t = 0xd790;\n\nif (t >= 0x80 && t <= 0x7ff) ...\n wchar_t char" }, { "answer_id": 257372, "author": "...
2008/11/02
[ "https://Stackoverflow.com/questions/257343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33481/" ]
257,350
<p>I need to create a form with, half linear view (textboxes and dropdownlists in separate line) and the other half, non linear view i.e. the textboxes will appear next to each other, like first name and last name will be next to each other. </p> <p>I am aware how to acomplish the linear view with CSS. I am using</p> ...
[ { "answer_id": 257995, "author": "Cyril Gupta", "author_id": 33052, "author_profile": "https://Stackoverflow.com/users/33052", "pm_score": 0, "selected": false, "text": "display: inline display: block float: left" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/257350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23667/" ]
257,353
<p>Is there a native c++ variable type that's "bigger" than a double?<br> float is 7<br> double is 15 (of course depending on the compiler)<br> Is there anything bigger that's native, or even non-native?</p>
[ { "answer_id": 257359, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 6, "selected": true, "text": "long double double double long double" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/257353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31325/" ]
257,391
<p>I have a const char arr[] parameter that I am trying to iterate over,</p> <pre><code>char *ptr; for (ptr= arr; *ptr!= '\0'; ptr++) /* some code*/ </code></pre> <p>I get an error: assignment discards qualifiers from pointer target type</p> <p>Are const char [] handled differently than non-const?</p>
[ { "answer_id": 257394, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 5, "selected": true, "text": "const char* ptr;\n" }, { "answer_id": 257420, "author": "Drew Hall", "author_id": 23934, "author_profi...
2008/11/02
[ "https://Stackoverflow.com/questions/257391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9628/" ]
257,396
<p>I'm having some trouble understanding how command parameter binding works.</p> <p>When I create an instance of the widget class before the call to InitializeComponent it seems to work fine. Modifications to the parameter(Widget) in the ExecuteCommand function will be "applied" to _widget. This is the behavior I e...
[ { "answer_id": 257508, "author": "Todd White", "author_id": 30833, "author_profile": "https://Stackoverflow.com/users/30833", "pm_score": 2, "selected": false, "text": "public static readonly DependencyProperty TestWidgetProperty =\n DependencyProperty.Register(\"TestWidget\", typeof(...
2008/11/02
[ "https://Stackoverflow.com/questions/257396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22522/" ]
257,398
<p>Is there a UI library to create a message box or input box in python?</p>
[ { "answer_id": 8678916, "author": "akoc kanor", "author_id": 1122830, "author_profile": "https://Stackoverflow.com/users/1122830", "pm_score": 1, "selected": false, "text": "import *\nimport os\n\n class Dialog(Toplevel):\n\n def __init__(self, parent, title = None):\n\n Top...
2008/11/02
[ "https://Stackoverflow.com/questions/257398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2220518/" ]
257,400
<p>I am trying to load <code>UIImage</code> object from <code>NSData</code>, and the sample code was to <code>NSImage</code>, I guess they should be the same. But just now loading the image, I am wondering what's the best to troubleshoot the <code>UIImage</code> loading <code>NSData</code> issue.</p>
[ { "answer_id": 257451, "author": "Noah Witherspoon", "author_id": 30618, "author_profile": "https://Stackoverflow.com/users/30618", "pm_score": 6, "selected": true, "text": "initWithData:" }, { "answer_id": 258122, "author": "leonho", "author_id": 30883, "author_profi...
2008/11/02
[ "https://Stackoverflow.com/questions/257400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32096/" ]
257,409
<p>I am writing a scraper that downloads all the image files from a HTML page and saves them to a specific folder. All the images are part of the HTML page.</p>
[ { "answer_id": 258511, "author": "Ryan Ginstrom", "author_id": 10658, "author_profile": "https://Stackoverflow.com/users/10658", "pm_score": 7, "selected": true, "text": "\"\"\"\ndumpimages.py\n Downloads all the images on the supplied URL, and saves them to the\n specified output ...
2008/11/02
[ "https://Stackoverflow.com/questions/257409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2220518/" ]
257,418
<p>I've been seeing that expression for over 10 years now. I've been trying to think what it's good for. Since I see it mostly in #defines, I assume it's good for inner scope variable declaration and for using breaks (instead of gotos.)</p> <p>Is it good for anything else? Do you use it?</p>
[ { "answer_id": 257421, "author": "Jere.Jones", "author_id": 19476, "author_profile": "https://Stackoverflow.com/users/19476", "pm_score": 7, "selected": false, "text": "do {\n // do something\n if (error) {\n break;\n }\n // do something else\n if (error) {\n break;\n }\n //...
2008/11/02
[ "https://Stackoverflow.com/questions/257418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31515/" ]
257,423
<p>I've been trying to trace down why I have 100% iowait on my box. If I do something like a mysql select query, system goes to 100% iowait (on more than one cpu on my server,) which kills my watchdogs and sometimes kills httpd itself. </p> <p>In vmstat I see that every 8 seconds or so, there's a 5MB disk write. And t...
[ { "answer_id": 257434, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 0, "selected": false, "text": "strace dtrace" }, { "answer_id": 257783, "author": "Charles Duffy", "author_id": 14122, "author_profile"...
2008/11/02
[ "https://Stackoverflow.com/questions/257423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31515/" ]
257,433
<p>I wonder if the UNIX domain socket connections with postgresql are faster then tcp connections from localhost in high concurrency rate and if it does, by how much?</p>
[ { "answer_id": 257490, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 3, "selected": false, "text": "read() write()" } ]
2008/11/02
[ "https://Stackoverflow.com/questions/257433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20955/" ]
257,462
<p>So I have this c# application that needs to ping my web server thats running linux/php stack.<br> I am having problems with the c# way of base 64 encoding bytes.</p> <p>my c# code is like:</p> <pre><code>byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("the string"); String enc = Convert.ToBase64String(encbuff)...
[ { "answer_id": 257470, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 1, "selected": false, "text": "byte[] bytes = new byte[1000];\nConsole.WriteLine(Convert.ToBase64String(bytes));\n $data enc" }, { "answer_id":...
2008/11/02
[ "https://Stackoverflow.com/questions/257462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146637/" ]
257,505
<p>Within an unordered list:</p> <pre><code>&lt;li&gt;&lt;span&gt;&lt;/span&gt; The lazy dog.&lt;/li&gt; &lt;li&gt;&lt;span&gt;AND&lt;/span&gt; The lazy cat.&lt;/li&gt; &lt;li&gt;&lt;span&gt;OR&lt;/span&gt; The active goldfish.&lt;/li&gt; </code></pre> <p>Adding a class or style attribute is permitted but padding the...
[ { "answer_id": 257524, "author": "Stephen Caldwell", "author_id": 33437, "author_profile": "https://Stackoverflow.com/users/33437", "pm_score": 10, "selected": true, "text": "ul {\n list-style-type: none;\n padding-left: 0px;\n}\n\nul li span {\n float: left;\n width: 40px;\n} <ul>\n...
2008/11/02
[ "https://Stackoverflow.com/questions/257505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1293/" ]
257,507
<p>I understand how the implementation of dynamic binding works and also the difference between static and dynamic binding, I am just having trouble wrapping my brain around the definition of dynamic binding. Basically other than it is a run-time binding type.</p>
[ { "answer_id": 257565, "author": "kings90", "author_id": 33269, "author_profile": "https://Stackoverflow.com/users/33269", "pm_score": 1, "selected": false, "text": "class Animal\n{\nvoid talk();\n}\n\nclass Dog extends Animal\n{\npublic void talk() { System.out.println(\"woof\"); }\n}\n...
2008/11/02
[ "https://Stackoverflow.com/questions/257507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29299/" ]
257,514
<p>I need to find out the pixel position of one element in a list that's been displayed using a <code>ListView</code>. It seems like I should get one of the <strong>TextView's</strong> and then use <code>getTop()</code>, but I can't figure out how to get a child view of a <code>ListView</code>.</p> <p><strong>Update:<...
[ { "answer_id": 340691, "author": "jasonhudgins", "author_id": 24590, "author_profile": "https://Stackoverflow.com/users/24590", "pm_score": -1, "selected": false, "text": " View element = listView.getListAdapter().getView(position, null, null);\n" }, { "answer_id": 2679284, ...
2008/11/02
[ "https://Stackoverflow.com/questions/257514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2652/" ]
257,519
<p>I'm completely new at C# and NUnit.</p> <p>In Boost.Test there is a family of <code>BOOST_*_THROW</code> macros. In Python's test module there is <code>TestCase.assertRaises</code> method.</p> <p>As far as I understand it, in C# with NUnit (2.4.8) the only method of doing exception test is to use <code>ExpectedExc...
[ { "answer_id": 257523, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 3, "selected": false, "text": "Assert.That( delegate { ... }, Throws.Exception<ArgumentException>())\n" }, { "answer_id": 257526, "a...
2008/11/02
[ "https://Stackoverflow.com/questions/257519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26141/" ]
257,550
<p>I have put together a script which is very much like the flickr photostream feature. Two thumbnails next to each other, and when you click the next or prev links the next (or previous) two images slide in. Cool!</p> <p>Currently when the page loads it loads the two images. The first time nxt / prv is used then the ...
[ { "answer_id": 257594, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 5, "selected": true, "text": "var img = new Image();\nimg.src = \"http://example.com/new/image.jpg\";\n src" }, { "answer_id": 257601, "auth...
2008/11/02
[ "https://Stackoverflow.com/questions/257550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28241/" ]