qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
274,465
<p>I have some question:</p> <p>How to make a role based web application? Such as in forum sites, there is many user types, admin, moderator etc... is the roles of these user types stored in database or web.config? And when a user login to our site, how to control this users roles? In short I want to learn about autho...
[ { "answer_id": 274486, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 1, "selected": true, "text": "TblUsers:\n-----------------------------------------------------------------\n| UserID (PK) | UserName | HashedPassword | Per...
2008/11/08
[ "https://Stackoverflow.com/questions/274465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439507/" ]
274,469
<p>This works (prints, for example, “3 arguments”):</p> <pre><code>to run argv do shell script "echo " &amp; (count argv) &amp; " arguments" end run </code></pre> <p>This doesn't (prints only “Argument 3: three”, and not the previous two arguments):</p> <pre><code>to run argv do shell script "echo " &amp; (c...
[ { "answer_id": 274526, "author": "Sören Kuklau", "author_id": 1600, "author_profile": "https://Stackoverflow.com/users/1600", "pm_score": 0, "selected": false, "text": "do shell script do shell script \"echo foo\"\ndelay 2\ndo shell script \"echo bar\"\n to run argv\n do shell script ...
2008/11/08
[ "https://Stackoverflow.com/questions/274469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30461/" ]
274,474
<p>My usage case is compiling generated source files from a java program using the ToolProvider and JavaCompiler classes provided in JDK 6. The source files contain references to classes in the context classloader (it runs in a J2EE container), but not in the system classloader. My understanding is that by default the...
[ { "answer_id": 665896, "author": "Leihca", "author_id": 74289, "author_profile": "https://Stackoverflow.com/users/74289", "pm_score": 3, "selected": false, "text": " StandardJavaFileManager fileManager = compiler.getStandardFileManager(this /* diagnosticlistener */, null, null);\n// g...
2008/11/08
[ "https://Stackoverflow.com/questions/274474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33897/" ]
274,482
<p>I am just getting started with CodeIgniter, and I am trying to hash out my regular modules/functions to get them working properly within the MVC framework. I have a few specific questions for anyone who has a strong CodeIgniter background:</p> <p><strong>SESSIONS</strong></p> <p>The CodeIgniter session stores sess...
[ { "answer_id": 274506, "author": "John McCollum", "author_id": 22946, "author_profile": "https://Stackoverflow.com/users/22946", "pm_score": 2, "selected": false, "text": "$data['title'] = 'about us';\n$data['content'] = 'hello world!';\n\n$this->load->view('headerview', $data);\n$this->...
2008/11/08
[ "https://Stackoverflow.com/questions/274482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27580/" ]
274,493
<p>When copying large files using <code>shutil.copy()</code>, you get no indication of how the operation is progressing..</p> <p>I have put together something that works - it uses a simple ProgressBar class (which simple returns a simple ASCII progress bar, as a string), and a loop of <code>open().read()</code> and <c...
[ { "answer_id": 274497, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 5, "selected": true, "text": "copy_with_prog def copy_with_prog(src, dest, callback = None):\n while True:\n # copy loop stuff\n if cal...
2008/11/08
[ "https://Stackoverflow.com/questions/274493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745/" ]
274,496
<p>I've built web apps before that utilize phpBB session, and user data. The common move is to use code like this:</p> <pre><code>define('IN_PHPBB', true); //replace $phpbb_root_path with path to your forum $phpbb_root_path = '../forum/'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'...
[ { "answer_id": 274497, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 5, "selected": true, "text": "copy_with_prog def copy_with_prog(src, dest, callback = None):\n while True:\n # copy loop stuff\n if cal...
2008/11/08
[ "https://Stackoverflow.com/questions/274496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24708/" ]
274,512
<p>I'm going to have my website hosted soon on a VPS or dedicated server (with Windows 2008), so I'm trying to plan ahead. I wonder whether the built-in SMTP server that comes with IIS7 is reliable enough for a production server or should I look for an alternative? I heard good things about hmailserver and best of all ...
[ { "answer_id": 10336338, "author": "Jess Coburn", "author_id": 489393, "author_profile": "https://Stackoverflow.com/users/489393", "pm_score": 2, "selected": false, "text": "VPS/Dedicated" } ]
2008/11/08
[ "https://Stackoverflow.com/questions/274512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/676066/" ]
274,523
<p>if Form.Release is called after using the form, it will free all related memory but not set the form variable to nil.</p> <pre><code>if not assigned (Form1) then begin Application.CreateForm(Tform1, Form1); try // Do something finally Form1.Release end; end; </code></pre> <p>To be a...
[ { "answer_id": 274535, "author": "Roddy", "author_id": 1737, "author_profile": "https://Stackoverflow.com/users/1737", "pm_score": 1, "selected": false, "text": "FreeAndNil(Form1)\n" }, { "answer_id": 274546, "author": "Community", "author_id": -1, "author_profile": "...
2008/11/08
[ "https://Stackoverflow.com/questions/274523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5015/" ]
274,529
<p>Am working with django Publisher example, I want to list all the publishers in the db via my list_publisher.html template, my template looks like;</p> <pre><code>{% extends "admin/base_site.html" %} {% block title %}List of books by publisher{% endblock %} {% block content %} &lt;div id="content-main"&gt; &lt;h1&g...
[ { "answer_id": 274537, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": true, "text": "{% block content %}{% endblock %} {%regroup publisher by name as pub_list %}{{ pub_list|length }} {% regroup publisher|dictsort:...
2008/11/08
[ "https://Stackoverflow.com/questions/274529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26143/" ]
274,560
<p>Is there an easy way to verify that a given private key matches a given public key? I have a few <code>*.pub</code>and a few <code>*.key</code> files, and I need to check which go with which.</p> <p>Again, these are pub/key files, DSA.</p> <p>I would really prefer a one-liner of some sort...</p>
[ { "answer_id": 274570, "author": "Martin v. Löwis", "author_id": 33006, "author_profile": "https://Stackoverflow.com/users/33006", "pm_score": 4, "selected": false, "text": " openssl x509 -in certfile -modulus -noout\n openssl rsa -in keyfile -modulus -noout\n" }, { "answe...
2008/11/08
[ "https://Stackoverflow.com/questions/274560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17324/" ]
274,567
<p>Can someone please derive a concrete example from the following:</p> <p><a href="http://www.urdalen.com/blog/?p=210" rel="nofollow noreferrer">http://www.urdalen.com/blog/?p=210</a></p> <p>..that shows how to deal with <code>one-to-many</code> and <code>many-to-many</code> relationships?</p> <p>I've emailed the a...
[ { "answer_id": 274684, "author": "troelskn", "author_id": 18180, "author_profile": "https://Stackoverflow.com/users/18180", "pm_score": 4, "selected": true, "text": "$car42 = $car_gateway->fetch(42);\n$wheels = $wheel_gateway->selectByCar($car42);\n $car42 = $car_gateway->fetch(42);\n$wh...
2008/11/08
[ "https://Stackoverflow.com/questions/274567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
274,575
<p>While LOC (# lines of code) is a problematic measurement of a code's complexity, it is the most popular one, and when used very carefully, can provide a rough estimate of at least relative complexities of code bases (i.e. if one program is 10KLOC and another is 100KLOC, written in the same language, by teams of roug...
[ { "answer_id": 274600, "author": "Treb", "author_id": 22114, "author_profile": "https://Stackoverflow.com/users/22114", "pm_score": 1, "selected": false, "text": "for (int i = 0; i < list.count; i++)\n{\n // do some stuff\n}\n\nfor (int i = 0; i < list.count; i++){\n // do some stu...
2008/11/08
[ "https://Stackoverflow.com/questions/274575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
274,586
<p>In ASP.NET MVC, I'm trying to create a link that includes an anchor tag (that is, directing the user to a page, and a specific section of the page).</p> <p>The URL I am trying to create should look like the following:</p> <pre><code>&lt;a href="/category/subcategory/1#section12"&gt;Title for a section on the page&...
[ { "answer_id": 274637, "author": "LorenzCK", "author_id": 3118, "author_profile": "https://Stackoverflow.com/users/3118", "pm_score": 8, "selected": true, "text": "<a href=\"<%=Url.Action(\"Subcategory\", \"Category\", new { categoryID = parent.ID }) %>#section12\">link text</a>\n" }, ...
2008/11/08
[ "https://Stackoverflow.com/questions/274586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29092/" ]
274,619
<p>My platform: Visual C# 2008 Express Edition with NUnit 2.2.7</p> <p>I have a solution with my code in one project and my NUnit unit tests in a different project in the same solution.</p> <p>I have been struggling hard to debug and single-step through the NUnit tests. I found some references online that suggested ...
[ { "answer_id": 274628, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 2, "selected": false, "text": "Runner Debugger.Attach()" }, { "answer_id": 274701, "author": "Gishu", "author_id": 1695, "author_...
2008/11/08
[ "https://Stackoverflow.com/questions/274619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18542/" ]
274,626
<p>In c++ what is object slicing and when does it occur?</p>
[ { "answer_id": 274634, "author": "David Dibben", "author_id": 5022, "author_profile": "https://Stackoverflow.com/users/5022", "pm_score": 9, "selected": false, "text": "class A {\n int foo;\n};\n\nclass B : public A {\n int bar;\n};\n B foo bar B b;\n\nA a = b;\n b bar a" }, { ...
2008/11/08
[ "https://Stackoverflow.com/questions/274626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35737/" ]
274,639
<p>What the minimum basic setup required to begin developing a Firefox extension?</p>
[ { "answer_id": 274647, "author": "Balaji Sowmyanarayanan", "author_id": 35738, "author_profile": "https://Stackoverflow.com/users/35738", "pm_score": 4, "selected": false, "text": "firefox.exe -profilemanager\n content 1mffext chrome/\n <?xml version=\"1.0\"?>\n<RDF:RDF xmlns:em=\"http:/...
2008/11/08
[ "https://Stackoverflow.com/questions/274639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35738/" ]
274,646
<p>I am getting the following error while loading a page.</p> <p>[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]</p> <p>No idea what to do ? Can anyone help me ?</p>
[ { "answer_id": 274688, "author": "Martin Brown", "author_id": 20553, "author_profile": "https://Stackoverflow.com/users/20553", "pm_score": 2, "selected": false, "text": "Response.Redirect(\"../SomePage.aspx\");\n ../ http://www.example.com/SomePage.aspx" }, { "answer_id": 932170...
2008/11/08
[ "https://Stackoverflow.com/questions/274646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29982/" ]
274,656
<p>I've been trying to build subversion (on a limited account) for a long time but without any luck :(</p> <p>The instructions I'm following: <a href="http://wiki.dreamhost.com/Subversion_Installation" rel="nofollow noreferrer">http://wiki.dreamhost.com/Subversion_Installation</a></p> <p>Running this:</p> <pre><code...
[ { "answer_id": 274661, "author": "Martin v. Löwis", "author_id": 33006, "author_profile": "https://Stackoverflow.com/users/33006", "pm_score": 3, "selected": false, "text": "aptitude install libssl-dev" }, { "answer_id": 274666, "author": "VonC", "author_id": 6309, "a...
2008/11/08
[ "https://Stackoverflow.com/questions/274656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18274/" ]
274,668
<p>I want to be able to change the status message for Live Messenger, but everything I've found only works for the music message (see <a href="http://coldacid.net/images/screenshots/live-messenger-status-and-music-messages" rel="nofollow noreferrer">this screenshot</a> to see the difference between the two).</p> <p>It...
[ { "answer_id": 274676, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 1, "selected": false, "text": "/psm new message Attribute VB_Name = \"Form1\"\nAttribute VB_GlobalNameSpace = False\nAttribute VB_Creatable = False\nAttribute...
2008/11/08
[ "https://Stackoverflow.com/questions/274668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5697/" ]
274,753
<p>There seem to be 3 ways of telling GCC to weak link a symbol:</p> <ul> <li><code>__attribute__((weak_import))</code></li> <li><code>__attribute__((weak))</code></li> <li><code>#pragma weak symbol_name</code></li> </ul> <p>None of these work for me:</p> <pre><code>#pragma weak asdf extern void asdf(void) __attribu...
[ { "answer_id": 730267, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "-Wl,-flat_namespace,-undefined,dynamic_lookup" }, { "answer_id": 3749780, "author": "Jeffrey Scofield", "autho...
2008/11/08
[ "https://Stackoverflow.com/questions/274753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
274,762
<p>I read somewhere in the Microsoft documentation that the content of the ASP.NET's <strong>web.config is cached</strong>. If that is true, <strong>where</strong> is it cached - in <strong>memory or on disk</strong>?</p> <p>And a follow-up question: are there any performance considerations I have to make, if I have t...
[ { "answer_id": 274851, "author": "AnthonyWJones", "author_id": 17516, "author_profile": "https://Stackoverflow.com/users/17516", "pm_score": 4, "selected": true, "text": "GetSection ConfigurationSection GetSection GetSection" }, { "answer_id": 67498636, "author": "Shirish Pat...
2008/11/08
[ "https://Stackoverflow.com/questions/274762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6461/" ]
274,785
<p>I would like to provide two different versions of my iPhone app on the App Store -- one free that is limited by the number of items displayed through the application, and another one completely unlimited.</p> <p>The source code for both apps will be exactly the same, the only difference would be the SQLite database...
[ { "answer_id": 274956, "author": "mxg", "author_id": 11157, "author_profile": "https://Stackoverflow.com/users/11157", "pm_score": 3, "selected": false, "text": "#ifdef FULL_APP\n // unlimited size\n #define SIZE -1\n#else\n #define SIZE 100\n#endif\n gcc program.cc -o program.o -DFUL...
2008/11/08
[ "https://Stackoverflow.com/questions/274785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35478/" ]
274,796
<p>I have the following code which plays a video clip but when it is finished it does not release the form but instead leaves the last frame of the video. how do I get it to clear when playback ends so that I can see the orignal contents of the form it took over to play the video?</p> <pre><code>_video = new Video("vi...
[ { "answer_id": 274847, "author": "user38275", "author_id": 38275, "author_profile": "https://Stackoverflow.com/users/38275", "pm_score": 1, "selected": false, "text": "_video.Ending += new System.EventHandler(this.video_stopped);\n\nprivate void video_stopped(object sender, EventArgs e)\...
2008/11/08
[ "https://Stackoverflow.com/questions/274796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38275/" ]
274,806
<p>I have an app built against MVC Preview 3 (referencing local copies of the MVC assemblies) that I'm trying to modify/test on a machine with the ASP.NET MVC beta installed. I am not interesting in updating this app to run against MVC beta yet - I just need to make a few small changes.</p> <p>It's failing with Missi...
[ { "answer_id": 297717, "author": "Matt Mitchell", "author_id": 364, "author_profile": "https://Stackoverflow.com/users/364", "pm_score": 0, "selected": false, "text": "System.Web.Mvc,version=\"1.0.0.0\",culture=\"neutral\",publicKeyToken=\"31BF3856AD364E35\",processorArchitecture=\"MSIL\...
2008/11/08
[ "https://Stackoverflow.com/questions/274806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5017/" ]
274,814
<p>How do I get a list of all the headings in a word document by using VBA?</p>
[ { "answer_id": 274830, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 6, "selected": true, "text": "astrHeadings = docSource.GetCrossReferenceItems(wdRefTypeHeading) Public Sub CreateOutline()\n Dim docOutline As Word.Documen...
2008/11/08
[ "https://Stackoverflow.com/questions/274814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35762/" ]
274,822
<p>How do I check for an open connection in jdbc for oracle database?</p> <p>Note: <code>conn.isClosed()</code> cannot be used for this.</p>
[ { "answer_id": 274870, "author": "RealHowTo", "author_id": 25122, "author_profile": "https://Stackoverflow.com/users/25122", "pm_score": 3, "selected": false, "text": "Statement stmt = null;\nResultSet rs =null;\ntry {\n stmt = conn.createStatement();\n // oracle\n rs = stmt.execut...
2008/11/08
[ "https://Stackoverflow.com/questions/274822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450206/" ]
274,823
<p>(This is a question about the UI rather than the technology required to do it)</p> <p>What is the clearest way to display a time for events occurring in different timezones to a user? Does your "average" user understand UTC and timezones?</p> <p>We capture the local time and UTC offset and store it in the database...
[ { "answer_id": 274832, "author": "Toby Allen", "author_id": 6244, "author_profile": "https://Stackoverflow.com/users/6244", "pm_score": 2, "selected": false, "text": "15:18 GMT+1\n 15:18 CET \n" }, { "answer_id": 327294, "author": "benc", "author_id": 2910, "author_pr...
2008/11/08
[ "https://Stackoverflow.com/questions/274823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1456/" ]
274,826
<p>When I use <code>DateTime.Now</code> I get the date and time from the server point of view. Is there any way to get the <em>client</em> date and time in ASP.NET?</p>
[ { "answer_id": 274987, "author": "Ryan", "author_id": 29762, "author_profile": "https://Stackoverflow.com/users/29762", "pm_score": 4, "selected": false, "text": "<script language=\"javascript\">\nfunction checkClientTimeZone()\n{\n // Set the client time zone\n var dt = new Date()...
2008/11/08
[ "https://Stackoverflow.com/questions/274826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34096/" ]
274,840
<p>I have a Perl module that I would like to use from Java. Is there a way to call this code using either ActiveState Perl on Windows or the generic Perl that comes with Linux? I have found references to JPL but it doesn’t appear to be maintained anymore.</p>
[ { "answer_id": 274849, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 5, "selected": true, "text": "org.perl.inline.java.InlinePerlCaller use Inline Java => <<END ;\nimport java.util.* ;\nimport org.perl.inline.java.* ;\n\nclass...
2008/11/08
[ "https://Stackoverflow.com/questions/274840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14744/" ]
274,841
<p>I am writing multi-thread socket chat in C++Builder 2009.<br> It is almost complete in accordance with what I need to do but I have a little problem. I need to pass the TMemo* pointer into CreateThread WinAPI function which upcasts it to void*.</p> <p>I tryed this way:<br></p> <pre><code>HANDLE xxx = MemoChat-&gt;...
[ { "answer_id": 274856, "author": "Martin v. Löwis", "author_id": 33006, "author_profile": "https://Stackoverflow.com/users/33006", "pm_score": 2, "selected": false, "text": "hNetThread = CreateThread(NULL, 0, NetThread, MemoChat, 0, &dwNetThreadId);\n" }, { "answer_id": 275036, ...
2008/11/08
[ "https://Stackoverflow.com/questions/274841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28298/" ]
274,843
<p>I have some elements on a page which are draggable. These same elements have a click event which navigates to another page. I'm trying to determine the best way of preventing the click event from firing if the user is dragging but still allow the click event if not dragging. Anyone have any ideas of the best way to ...
[ { "answer_id": 274875, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 0, "selected": false, "text": "new Draggable('tag', \n {\n revert:function()\n {\n $('tag').onclick = function(){return false;};\...
2008/11/08
[ "https://Stackoverflow.com/questions/274843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22436/" ]
274,857
<p>is there an easy way to reset ALL text fields in an asp.net form - like the reset button for html controls?</p>
[ { "answer_id": 274866, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 2, "selected": false, "text": "document.forms[0].reset();\n theForm.reset(); // at least with ASP.NET 2.0\n <input type='button' id='resetButton' val...
2008/11/08
[ "https://Stackoverflow.com/questions/274857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
274,861
<p>If I have a date, how do I calculate the week number for that date within that year?</p> <p>For example, in 2008, January 1st to January 6th are in week 1 and January 7th to the 13th are in week 2, so if my date was January 10th 2008, my week number would be 2.</p> <p>An algorithm would be great to get me started an...
[ { "answer_id": 274913, "author": "Olie", "author_id": 34820, "author_profile": "https://Stackoverflow.com/users/34820", "pm_score": 6, "selected": true, "text": "int julian = getDayOfYear(myDate) // Jan 1 = 1, Jan 2 = 2, etc...\nint dow = getDayOfWeek(myDate) // Sun = 0, Mon = 1, et...
2008/11/08
[ "https://Stackoverflow.com/questions/274861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15669/" ]
274,865
<p>I am modifying some code and came across a declaration that I am having trouble understanding:</p> <pre><code>int *userMask[3][4] = {0}; </code></pre> <p>What exactly is this pointing to? Is it a matrix where every element is a pointer? Or is it pointing to a matrix of size [3][4]?</p> <p>Thanks</p> <hr> <p>I...
[ { "answer_id": 274869, "author": "ChrisN", "author_id": 3853, "author_profile": "https://Stackoverflow.com/users/3853", "pm_score": 4, "selected": false, "text": "int if(userMask[2][maskElement][user] && blah)\n result = true;\n userMask int int* int int userMask int userArray[2] = { ...
2008/11/08
[ "https://Stackoverflow.com/questions/274865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35767/" ]
274,892
<p>I have information spread out across a few databases and want to put all the information onto one webpage using PHP. I was wondering how I can connect to multiple databases on a single PHP webpage.</p> <p>I know how to connect to a single database using:</p> <pre><code>$dbh = mysql_connect($hostname, $username, $...
[ { "answer_id": 274919, "author": "Tom Haigh", "author_id": 22224, "author_profile": "https://Stackoverflow.com/users/22224", "pm_score": 9, "selected": true, "text": "mysql_xx mysqli_xx mysql_connect() $new_link $dbh1 = mysql_connect($hostname, $username, $password); \n$dbh2 = mysql_conn...
2008/11/08
[ "https://Stackoverflow.com/questions/274892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33194/" ]
274,894
<p>I have a bit of an unusual question. I'm running an old DOS game in dosbox under windows xp and i'm trying to determine when and where it access it's data file.</p> <p>what can i use that will give me a log of all read requests made to a file? I want to know the "when", "from" and "size" of each file read.</p> <p>...
[ { "answer_id": 277194, "author": "Artelius", "author_id": 31945, "author_profile": "https://Stackoverflow.com/users/31945", "pm_score": 2, "selected": false, "text": "fread()" } ]
2008/11/08
[ "https://Stackoverflow.com/questions/274894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11813/" ]
274,899
<p>How have you guys handled working with jQuery includes </p> <pre><code>&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; </code></pre> <p>in Asp.Net MVC when working with partial views/view controls? Basically, I don't want to make the jquery include in the master page because I am not using jq...
[ { "answer_id": 274906, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 0, "selected": false, "text": "function loadJSInclude(scriptPath, callback)\n{\n var scriptNode = document.createElement('SCRIPT');\n scriptNode.type...
2008/11/08
[ "https://Stackoverflow.com/questions/274899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8534/" ]
274,915
<p>What is the best way to call C/C++ from other languages such as Java, Python, Perl, PHP, etc?</p>
[ { "answer_id": 274924, "author": "Ned Batchelder", "author_id": 14343, "author_profile": "https://Stackoverflow.com/users/14343", "pm_score": 2, "selected": false, "text": "os.system(\"myccode -v args etc\")\n" }, { "answer_id": 274979, "author": "Brad Gilbert", "author_i...
2008/11/08
[ "https://Stackoverflow.com/questions/274915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14744/" ]
274,918
<p>The CSS Friendly Control Adapters for ASP.NET are great for creating markup that is easy to style. A big benefit of the GridView adapter is that it generates THEAD, TBODY, and TFOOT tags, which allow you to do some really great things with libraries like jQuery - for instance, <a href="http://tablesorter.com/docs/"...
[ { "answer_id": 279464, "author": "David Boike", "author_id": 10039, "author_profile": "https://Stackoverflow.com/users/10039", "pm_score": 0, "selected": false, "text": "myGrid.UseAccessibleHeader = true;\nmyGrid.HeaderRow.TableSection = TableRowSection.TableHeader;\nmyGrid.FooterRow.Tab...
2008/11/08
[ "https://Stackoverflow.com/questions/274918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10039/" ]
274,951
<p>You can pass a function pointer, function object (or boost lambda) to std::sort to define a strict weak ordering of the elements of the container you want sorted.</p> <p>However, sometimes (enough that I've hit this several times), you want to be able to chain "primitive" comparisons.</p> <p>A trivial example woul...
[ { "answer_id": 274963, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 2, "selected": false, "text": "std::sort std::stable_sort" }, { "answer_id": 275014, "author": "siukurnin", "author_id": 35273, ...
2008/11/08
[ "https://Stackoverflow.com/questions/274951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32136/" ]
274,958
<p>According to <a href="http://www.scalabium.com/faq/dct0150.htm" rel="noreferrer">this page,</a> it's possible to use <code>TClientDataset</code> as an in-memory dataset, completely independent of any actual databases or files. It describes how to setup the dataset's table structure and how to load data into it at r...
[ { "answer_id": 274976, "author": "Tom", "author_id": 13219, "author_profile": "https://Stackoverflow.com/users/13219", "pm_score": 3, "selected": false, "text": "table.CreateDataSet" }, { "answer_id": 274989, "author": "MikeJ", "author_id": 10676, "author_profile": "h...
2008/11/08
[ "https://Stackoverflow.com/questions/274958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32914/" ]
274,984
<p>How can I correctly serve WSDL of a WCF webservice located in a private LAN from behind a reverse proxy listening on public IP?</p> <p>I have an Apache webserver configured in reverse proxy mode which listens for requests on a public IP address and serves them from the internal IIS host. WCF webservice generates WS...
[ { "answer_id": 947276, "author": "Richard Collette", "author_id": 107683, "author_profile": "https://Stackoverflow.com/users/107683", "pm_score": 4, "selected": false, "text": "<ServiceBehavior(AddressFilterMode:=AddressFilterMode.Any)>\n https://... http://..... AddressFilterMode.Any w...
2008/11/08
[ "https://Stackoverflow.com/questions/274984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5970/" ]
274,994
<p>I know we are <em>really</em> behind the times here, but we are just about to upgrade from .NET 1.1 to .NET 2.0. </p> <p>Thank you for your sympathy. </p> <p>Anyhow, are there any gotchas we should look out for?<br> Do you have any general advice before we jump in? </p> <p>Please do not post telling me to go ...
[ { "answer_id": 275020, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 1, "selected": false, "text": "ctl0_ ctl00_..." } ]
2008/11/08
[ "https://Stackoverflow.com/questions/274994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7211/" ]
274,996
<p>First, I am Linq to Sql newbie, so please be gentle :).</p> <p>I have existing ASP.Net application developed over last 3.5 years. It has pretty big data model underneath, around 350 tables. I am trying to do some new things with Linq to SQL. </p> <p>First impression is that linq designer and SqlMetal are built for...
[ { "answer_id": 3675696, "author": "James McCormack", "author_id": 71906, "author_profile": "https://Stackoverflow.com/users/71906", "pm_score": 2, "selected": false, "text": "/code" } ]
2008/11/08
[ "https://Stackoverflow.com/questions/274996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25732/" ]
275,004
<p>I wish to calculate the time it took for an API to return a value. The time taken for such an action is in the space of nanoseconds. As the API is a C++ class/function, I am using the timer.h to calculate the same:</p> <pre><code> #include &lt;ctime&gt; #include &lt;iostream&gt; using namespace std; int mai...
[ { "answer_id": 275031, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 5, "selected": false, "text": "inline __int64 GetCpuClocks()\n{\n\n // Counter\n struct { int32 low, high; } counter;\n\n // Use RDTSC instruction to...
2008/11/08
[ "https://Stackoverflow.com/questions/275004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35416/" ]
275,005
<p>I am writing a program that will draw a solid along the curve of a spline. I am using visual studio 2005, and writing in C++ for OpenGL. I'm using FLTK to open my windows (fast and light toolkit).</p> <p>I currently have an algorithm that will draw a Cardinal Cubic Spline, given a set of control points, by breaking...
[ { "answer_id": 275040, "author": "Sunlight", "author_id": 33650, "author_profile": "https://Stackoverflow.com/users/33650", "pm_score": 0, "selected": false, "text": "gluLookAt" }, { "answer_id": 275152, "author": "shoosh", "author_id": 9611, "author_profile": "https:...
2008/11/08
[ "https://Stackoverflow.com/questions/275005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33583/" ]
275,011
<p>I am having a problem displaying a Javascript string with embedded Unicode character escape sequences (\uXXXX) where the initial "\" character is itself escaped as "&amp;#92;" What do I need to do to transform the string so that it properly evaluates the escape sequences and produces output with the correct Unicode ...
[ { "answer_id": 275032, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "eval(new String(\"this is a &#92;u201ctest&#amp;92;u201d\")); eval(new String(\"this is a &#92;u201ctest&#amp;92;u201d\".repla...
2008/11/08
[ "https://Stackoverflow.com/questions/275011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
275,018
<p>How do I remove the last character of a string if it is a newline?</p> <pre><code>&quot;abc\n&quot; --&gt; &quot;abc&quot; </code></pre>
[ { "answer_id": 275025, "author": "Rich Bradshaw", "author_id": 16511, "author_profile": "https://Stackoverflow.com/users/16511", "pm_score": 11, "selected": false, "text": "rstrip() >>> 'test string\\n'.rstrip()\n'test string'\n rstrip() chomp >>> 'test string \\n \\r\\n\\n\\r \\n\\n'.rs...
2008/11/08
[ "https://Stackoverflow.com/questions/275018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
275,022
<p>With squid, we can cache webpages. I am not sure if it provides the same number of caching methods as ASP.NET caching (I primarily use ASP.NET), but it's a tool to cache webpages.</p> <p>Then we have memcached, which can cache database tables. I believe this is correct, and it is like SqlCacheDependency (correct me...
[ { "answer_id": 275025, "author": "Rich Bradshaw", "author_id": 16511, "author_profile": "https://Stackoverflow.com/users/16511", "pm_score": 11, "selected": false, "text": "rstrip() >>> 'test string\\n'.rstrip()\n'test string'\n rstrip() chomp >>> 'test string \\n \\r\\n\\n\\r \\n\\n'.rs...
2008/11/08
[ "https://Stackoverflow.com/questions/275022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32484/" ]
275,034
<p>One of the features of the modern (64 bit OS X and iPhone OS) Objective C runtime is the ability for properties to dynamically synthesize ivars without explicitly declaring them in the class:</p> <pre><code>@interface MyClass : NSObject { // NSString *name; unnecessary on modern runtimes } @property (retain) NSSt...
[ { "answer_id": 5542886, "author": "JD Brennan", "author_id": 304712, "author_profile": "https://Stackoverflow.com/users/304712", "pm_score": -1, "selected": false, "text": "[myObject setValue:@\"whatever\" forKey:@\"foo\"];\n" }, { "answer_id": 9045742, "author": "Farcaller",...
2008/11/08
[ "https://Stackoverflow.com/questions/275034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30506/" ]
275,038
<p>I wish to convert a single string with multiple delimiters into a key=>value hash structure. Is there a simple way to accomplish this? My current implementation is:</p> <pre><code>sub readConfigFile() { my %CONFIG; my $index = 0; open(CON_FILE, "config"); my @lines = &lt;CON_FILE&gt;; close(CON_...
[ { "answer_id": 275127, "author": "brian d foy", "author_id": 2766176, "author_profile": "https://Stackoverflow.com/users/2766176", "pm_score": 3, "selected": true, "text": "$." }, { "answer_id": 275163, "author": "Jonathan Leffler", "author_id": 15168, "author_profile...
2008/11/08
[ "https://Stackoverflow.com/questions/275038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35416/" ]
275,039
<p>I got an image with which links to another page using <code>&lt;a href="..."&gt; &lt;img ...&gt; &lt;/a&gt;</code>.</p> <p>How can I make it make a post like if it was a button <code>&lt;input type="submit"...&gt;</code>?</p>
[ { "answer_id": 275048, "author": "Shawn", "author_id": 26, "author_profile": "https://Stackoverflow.com/users/26", "pm_score": 3, "selected": false, "text": "<form action=\"page-you're-submitting-to.html\" method=\"POST\">\n <a href=\"#\" onclick=\"document.forms[0].submit();return fa...
2008/11/08
[ "https://Stackoverflow.com/questions/275039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26004/" ]
275,062
<p>So I was hoping that some old school Vim'ers could help me out. These are all separate questions and normally I would put them up each on their own but I'm not sure if that qualifies as question whoring here. </p> <p>Plus I think if you know enough to be asking any of these questions they will all be coming up in t...
[ { "answer_id": 275108, "author": "Ali Afshar", "author_id": 28380, "author_profile": "https://Stackoverflow.com/users/28380", "pm_score": 0, "selected": false, "text": ":cd {path}\n :he cd\n :lcd" }, { "answer_id": 275167, "author": "Luc Hermitte", "author_id": 15934, ...
2008/11/08
[ "https://Stackoverflow.com/questions/275062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23829/" ]
275,063
<p>I would like to be able to set "Extend my Windows desktop onto this monitor" via code. A PowerShell script would be ideal. WMI seems the way forward but I have zero knowledge in WMI.</p>
[ { "answer_id": 275123, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 2, "selected": false, "text": "Option Explicit\nDim WshShell, Dummy, Splash\n\nOn Error Resume Next\n\nSet WshShell = WScript.CreateObject(\"WScript.Shell\")\...
2008/11/08
[ "https://Stackoverflow.com/questions/275063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/176626/" ]
275,064
<p>I read a properties-file at the webapplication startup phase (contextInitialized()) and I started to think about how to make these settings 'visible' to the servlets. Do I need to loop through the keys and add each and every one to the context, like this</p> <pre><code>Iterator i = settings.keySet().iterator(); whi...
[ { "answer_id": 275065, "author": "Josh", "author_id": 2204759, "author_profile": "https://Stackoverflow.com/users/2204759", "pm_score": 1, "selected": false, "text": "String key = null;\nIterator<String> i = settings.keySet().iterator();\nwhile (i.hasNext())\n context.setAttribute(key = ...
2008/11/08
[ "https://Stackoverflow.com/questions/275064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31518/" ]
275,073
<p>I have just noticed that a multidimensional array in C# does not implement <code>IEnumerable&lt;T&gt;</code>, while it does implement <code>IEnumerable</code>. For single-dimensional arrays, both <code>IEnumerable&lt;T&gt;</code> and <code>IEnumerable</code> are implemented.</p> <p>Why this difference? If a multi-d...
[ { "answer_id": 275107, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 1, "selected": false, "text": "IEnumerable<int> int[] singleDimensionArray = new int[10];\nint[][] multiJagged = new int[10][];\n\nDebug.WriteLi...
2008/11/08
[ "https://Stackoverflow.com/questions/275073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13627/" ]
275,092
<p>We have a JavaScript function named "move" which does just "windows.location.href = <em>any given anchor</em>". <br/> This function works on IE, Opera and Safari, but somehow is ignored in Firefox. Researching on Google doesn't produce a satisfactory answer <strong>why</strong> it doesn't work. <br/> Does any JavaSc...
[ { "answer_id": 275102, "author": "Dan Herbert", "author_id": 392, "author_profile": "https://Stackoverflow.com/users/392", "pm_score": 6, "selected": true, "text": "window.location = 'url';\n window.location.href location window.location" }, { "answer_id": 275104, "author": "...
2008/11/08
[ "https://Stackoverflow.com/questions/275092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34815/" ]
275,109
<p>I'm writing a url rewrite in django that when a person goes to <a href="http://mysite.com/urlchecker/http://www.google.com" rel="nofollow noreferrer">http://mysite.com/urlchecker/http://www.google.com</a> it sends the url: <a href="http://ww.google.com" rel="nofollow noreferrer">http://ww.google.com</a> to a view ...
[ { "answer_id": 275117, "author": "Peter Rowell", "author_id": 17017, "author_profile": "https://Stackoverflow.com/users/17017", "pm_score": 3, "selected": true, "text": "(r'^urlchecker/(?P<url>.+)$', 'mysite.main.views.urlchecker')," } ]
2008/11/08
[ "https://Stackoverflow.com/questions/275109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23695/" ]
275,120
<p>Given a class, <a href="http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/views/navigator/ResourceNavigator.html" rel="noreferrer">org.eclipse.ui.views.navigator.ResourceNavigator</a> for example, how do I find out which jar file to use? I know it's in org.ecli...
[ { "answer_id": 275125, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 1, "selected": false, "text": "jar -vtf foo.jar" }, { "answer_id": 275144, "author": "user28791", "author_id": 28791, "author_profile"...
2008/11/08
[ "https://Stackoverflow.com/questions/275120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3827/" ]
275,128
<p>Is there any way of doing parallel assignment in C++? Currently, the below compiles (with warnings)</p> <pre><code>#include &lt;iostream&gt; int main() { int a = 4; int b = 5; a, b = b, a; std::cout &lt;&lt; "a: " &lt;&lt; a &lt;&lt; endl &lt;&lt; "b: " &lt;&lt; b &lt;&lt; endl; return 0; ...
[ { "answer_id": 275146, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 1, "selected": false, "text": "int a = 4;\nint b = 5;\n\n{\n int tmp = a;\n a = b;\n b = tmp;\n}\n { a, b }" }, { "answer_id": ...
2008/11/08
[ "https://Stackoverflow.com/questions/275128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35807/" ]
275,150
<p>My website is XHTML Transitional compliant <strong>except for one thing</strong>: the &amp; (ampersand) in the URL are written as it is, instead of <code>&amp;amp;</code></p> <p>That is, all the URLs in my pages are usually like this:</p> <pre><code>&lt;a href=&quot;http://www.example.org/page.aspx?x=1&amp;y=2&quot;...
[ { "answer_id": 275154, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": false, "text": "&amp; & <a href=\"http://www.example.org/page.aspx?x=1&amp;y=2\">Foo</a>\n /mypath/mypage?b=%26stuff\n" }, { "answer_id...
2008/11/08
[ "https://Stackoverflow.com/questions/275150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
275,153
<p>Basically I have a website. I have a properly setup sitemap so I assume Google knows about all of my pages. And I've seen on some sites, the search form leads to a page with the shell of the original site but the results are clearly provided by Google. Similar to codinghorror.com's search, however his results are...
[ { "answer_id": 275157, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 4, "selected": false, "text": "<form method=\"get\" action=\"http://www.google.com/search\">\n\n<div style=\"border:1px solid black;padding:4px;width:20em;\">...
2008/11/08
[ "https://Stackoverflow.com/questions/275153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428190/" ]
275,160
<p>Just starting to explore the 'wonders' of regex. Being someone who learns from trial and error, I'm really struggling because my trials are throwing up a disproportionate amount of errors... My experiments are in PHP using ereg().</p> <p>Anyway. I work with first and last names separately but for now using the s...
[ { "answer_id": 275177, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 7, "selected": true, "text": "a-z" }, { "answer_id": 275180, "author": "Robert Gamble", "author_id": 25222, "author_profile"...
2008/11/08
[ "https://Stackoverflow.com/questions/275160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1444/" ]
275,169
<p>I have 2 files:</p> <pre><code>/****demo.cpp****/ #include &lt;iostream.h&gt; #include "gc.h" class foo{}; int main(){ gc&lt;foo&gt; x1; cout&lt;&lt;x1; } /*****gc.h*****/ template &lt;class T&gt; class gc { T* ptr; public: operator T*(){} }; </code></pre> <p>If I don't write <code>operator T*(...
[ { "answer_id": 275176, "author": "Rob Walker", "author_id": 3631, "author_profile": "https://Stackoverflow.com/users/3631", "pm_score": 2, "selected": false, "text": "T*(){} gc<T> T* ptr template <class T>\nstd::ostream& operator<<( std::ostream& os, const gc<T>& x)\n{\n // os << .. s...
2008/11/08
[ "https://Stackoverflow.com/questions/275169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
275,174
<p>I have a string that is HTML encoded: </p> <pre><code>'''&amp;lt;img class=&amp;quot;size-medium wp-image-113&amp;quot;\ style=&amp;quot;margin-left: 15px;&amp;quot; title=&amp;quot;su1&amp;quot;\ src=&amp;quot;http://blah.org/wp-content/uploads/2008/10/su1-300x194.jpg&amp;quot;\ alt=&amp;quot;&amp;quot; width=&...
[ { "answer_id": 275195, "author": "Jake", "author_id": 24730, "author_profile": "https://Stackoverflow.com/users/24730", "pm_score": 2, "selected": false, "text": "htmlCodes = [\n ['&', '&amp;'],\n ['<', '&lt;'],\n ['>', '&gt;'],\n ['\"', '&quot;'],\n]\nhtmlCodesReversed = htm...
2008/11/08
[ "https://Stackoverflow.com/questions/275174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23695/" ]
275,178
<p>We are using IIS 6 and ASP.Net, When users make secure page requests using </p> <blockquote> <p><strong><a href="https://somesite.com/securePage.aspx" rel="nofollow noreferrer">https://somesite.com/securePage.aspx</a></strong></p> </blockquote> <p>the user gets an error:</p> <hr> <blockquote> <p><strong>Erro...
[ { "answer_id": 275210, "author": "djn", "author_id": 9673, "author_profile": "https://Stackoverflow.com/users/9673", "pm_score": -1, "selected": false, "text": "RewriteEngine On\nRewriteCond %{HTTP_HOST} ^example\\.com$ [NC]\nRewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]\n" },...
2008/11/08
[ "https://Stackoverflow.com/questions/275178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4814/" ]
275,194
<p>How can I format data coming from a DataBinder.Eval statement in an ASPX page?</p> <p>For example, I want to display the published date of the news items in a particular format in the homepage. I'm using the ASP.NET 2.0 Repeater control to show the list of news items.</p> <p>The code for this goes like this:</p> ...
[ { "answer_id": 275218, "author": "DOK", "author_id": 27637, "author_profile": "https://Stackoverflow.com/users/27637", "pm_score": 7, "selected": true, "text": "<%# DataBinder.Eval(Container.DataItem, \"expression\"[, \"format\"]) %>\n <asp:Label id=\"lblNewsDate\" runat=\"server\" Text=...
2008/11/08
[ "https://Stackoverflow.com/questions/275194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11172/" ]
275,199
<p>How do you do the following operations in C++?</p> <ol> <li>Opening Files</li> <li>Closing Files</li> <li>Reading Files</li> <li>Writing Files</li> </ol>
[ { "answer_id": 275224, "author": "Martin York", "author_id": 14065, "author_profile": "https://Stackoverflow.com/users/14065", "pm_score": 4, "selected": false, "text": "#include <fstream>\nint main()\n{\n std::ifstream inputFile(\"MyFileName\") // Opens a File.\n\n int x;\n ...
2008/11/08
[ "https://Stackoverflow.com/questions/275199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35821/" ]
275,207
<p>My friend produced a small proof-of-concept assembler that worked on x86. I decided to port it for x86_64 as well, but I immediately hit a problem.</p> <p>I wrote a small piece of program in C, then compiled and objdumped the code. After that I inserted it to my python script, therefore the x86_64 code is correct:<...
[ { "answer_id": 275333, "author": "vincent", "author_id": 34871, "author_profile": "https://Stackoverflow.com/users/34871", "pm_score": 2, "selected": false, "text": "mprotect VirtualProtect" }, { "answer_id": 275426, "author": "Cheery", "author_id": 21711, "author_pro...
2008/11/08
[ "https://Stackoverflow.com/questions/275207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21711/" ]
275,213
<p>Previously, I had a class that wrapped an internal <code>System.Collections.Generic.List&lt;Item&gt;</code> (where Item is a class I created). The wrapper class provided several collection-level properties that provided totals, averages, and other computations on items in the list. I was creating a <code>BindingSo...
[ { "answer_id": 275392, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "IList IListSource IList DataMember BindingSource TextBox AverageValue DataGridView DataSource DataMember=\"Items\"" ...
2008/11/08
[ "https://Stackoverflow.com/questions/275213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4849/" ]
275,214
<p>I am starting again with c++ and was thinking about the scope of variables. If I have a variable inside a function and then I return that variable will the variable not be "dead" when it's returned because the scope it was in has ended?</p> <p>I have tried this with a function returning a string and it did work. Ca...
[ { "answer_id": 275225, "author": "Kieveli", "author_id": 15852, "author_profile": "https://Stackoverflow.com/users/15852", "pm_score": 2, "selected": false, "text": "int funcB() {\n int j = 12;\n return j;\n}\n\nvoid A() {\n int i;\n i = funcB();\n}\n" }, { "answer_id": 27522...
2008/11/08
[ "https://Stackoverflow.com/questions/275214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8715/" ]
275,230
<p>I know how to use the OleDbConnection class to open an excel file and select from it, but is there a simple method to read the data from an excel file that has been read into a Stream? And is there also a similar method for QuickBooks?</p>
[ { "answer_id": 275225, "author": "Kieveli", "author_id": 15852, "author_profile": "https://Stackoverflow.com/users/15852", "pm_score": 2, "selected": false, "text": "int funcB() {\n int j = 12;\n return j;\n}\n\nvoid A() {\n int i;\n i = funcB();\n}\n" }, { "answer_id": 27522...
2008/11/08
[ "https://Stackoverflow.com/questions/275230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13855/" ]
275,233
<p>What I would like to do is the following. I have a single table, Products, containing a private key ProductID. Instead of having SQL Server auto-increment ProductID on inserts, I want to increment it in the DataContext partial method "InsertProduct":</p> <pre><code>Partial Public Class MyDataContext Private Su...
[ { "answer_id": 275350, "author": "valure", "author_id": 9919, "author_profile": "https://Stackoverflow.com/users/9919", "pm_score": 0, "selected": false, "text": "context.SubmitChanges()" } ]
2008/11/08
[ "https://Stackoverflow.com/questions/275233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9919/" ]
275,237
<p>i.e. I just want them to be permanently accepted all the time.</p>
[ { "answer_id": 3506961, "author": "Doug K", "author_id": 423329, "author_profile": "https://Stackoverflow.com/users/423329", "pm_score": 3, "selected": false, "text": "* Tools -> Options -> Advanced -> Encryption -> View Certificates\n* Under Authorities tab, enter \"RSA Security 1024\" ...
2008/11/08
[ "https://Stackoverflow.com/questions/275237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34594/" ]
275,249
<p>What is a good use case for uncaught_exception?</p>
[ { "answer_id": 275537, "author": "coppro", "author_id": 16855, "author_profile": "https://Stackoverflow.com/users/16855", "pm_score": 2, "selected": false, "text": "uncaught_exception throw; uncaught_exception" } ]
2008/11/08
[ "https://Stackoverflow.com/questions/275249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14069/" ]
275,250
<p>I'm writing some disposable Haskell scripts to solve some of the <a href="http://projecteuler.net" rel="nofollow noreferrer">Project Euler</a> problems. I don't really want to have to compile them because of the number of changes I'm constantly having to make, but in a few cases I've found that I've run out of stack...
[ { "answer_id": 275623, "author": "yfeldblum", "author_id": 12349, "author_profile": "https://Stackoverflow.com/users/12349", "pm_score": 1, "selected": false, "text": "module Main where\nmain = do\n print solution\nsolution = ...\n ghc --make -O3 Problem123.hs\n./Problem123\n" }, ...
2008/11/08
[ "https://Stackoverflow.com/questions/275250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27779/" ]
275,273
<p>I recently downloaded PLT Scheme and DrScheme. When I open DrScheme, I am told to choose a language. However, I'm not familiar with any of my options, and the help guides don't really break it down to help me easily choose which choice.</p> <p>So, first - is DrScheme and PLT Scheme really the tools I need to learn ...
[ { "answer_id": 275313, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 5, "selected": true, "text": "#lang scheme\n" } ]
2008/11/08
[ "https://Stackoverflow.com/questions/275273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
275,314
<p>When using MYSQL C API to query results. The results are returned as a <code>MYSQL_ROW</code> type, which according to the MYSQL C API documentation, I can easily <code>printf("%s", row[0])</code>. But what if I want to transfer the contents of <code>row[0]</code> into a string or a char*?</p>
[ { "answer_id": 54962732, "author": "jww", "author_id": 608639, "author_profile": "https://Stackoverflow.com/users/608639", "pm_score": 0, "selected": false, "text": "mysql_fetch_lengths MYSQL_ROW MYSQL_ROW mysql_fetch_row() mysql_fetch_row MYSQL_ROW row;\nunsigned int num_fields;\nunsign...
2008/11/08
[ "https://Stackoverflow.com/questions/275314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28462/" ]
275,338
<p>What is the <em>best</em> way to print the cells of a <code>String[][]</code> array as a right-justified table? For example, the input</p> <pre><code>{ { "x", "xxx" }, { "yyy", "y" }, { "zz", "zz" } } </code></pre> <p>should yield the output</p> <pre><code> x xxx yyy y zz zz </code></pre> <p>This seems like...
[ { "answer_id": 275438, "author": "Chris Conway", "author_id": 1412, "author_profile": "https://Stackoverflow.com/users/1412", "pm_score": 3, "selected": false, "text": "public static void printTable(String[][] table) {\n // Find out what the maximum number of columns is in any row\n in...
2008/11/08
[ "https://Stackoverflow.com/questions/275338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
275,351
<p>Is there a way to get all methods (private, privileged, or public) of a javascript object from within? Here's the sample object:</p> <pre><code>var Test = function() { // private methods function testOne() {} function testTwo() {} function testThree() {} // public methods function getMethods() { ...
[ { "answer_id": 275362, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 0, "selected": false, "text": "this var t = new Test();\nt.getMethods();\n" }, { "answer_id": 275390, "author": "eswald", "author_id": 21229,...
2008/11/08
[ "https://Stackoverflow.com/questions/275351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4853/" ]
275,355
<p>another request sorry.. Right now I am reading the tokens in one by one and it works, but I want to know when there is a new line..</p> <p>if my file contains</p> <pre><code>Hey Bob Now </code></pre> <p>should give me</p> <pre><code>Hey Bob [NEW LINE] NOW </code></pre> <p>Is there a way to do this without using...
[ { "answer_id": 275405, "author": "Martin York", "author_id": 14065, "author_profile": "https://Stackoverflow.com/users/14065", "pm_score": 5, "selected": true, "text": "std::string line;\nwhile(std::getline(std::cin,line))\n{\n\n // If you then want to tokenize the line use a string...
2008/11/08
[ "https://Stackoverflow.com/questions/275355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33481/" ]
275,374
<p>I am trying to make a basic API for my website so certain other websites that I approve of can show content from my site. I have a PHP script on my server that the other websites can access to pull content in XML format. How can I make sure that only certain websites can access this php page on my server?</p>
[ { "answer_id": 275379, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 2, "selected": false, "text": "Order allow, deny\nDeny from 192.168.0.10\nDeny from 212.155.\nDeny from 1.2.3.4 5.6.7.8 127.0.0.1\nAllow from all\...
2008/11/08
[ "https://Stackoverflow.com/questions/275374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
275,375
<p>From googling around it looks like Xcode (3.1 in my case) should be at least trying to give me a sane debug view of STL containers - or at least vectors.</p> <p>However, whenever I go to look at a vector in the debugger I just see M_impl, with M_start and M_finish members (and a couple of others) - but nothing in-b...
[ { "answer_id": 275398, "author": "Michel", "author_id": 31122, "author_profile": "https://Stackoverflow.com/users/31122", "pm_score": 2, "selected": true, "text": "template <class T> struct S { T m_t; }\n" } ]
2008/11/08
[ "https://Stackoverflow.com/questions/275375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32136/" ]
275,382
<p>I currently have 2 domain names that I want to setup different websites for. I am currently looking at using some free hosting that works well for my current needs but doesn't give me any way to point "mydomain.com" to the actual site. Instead I have to give users a longer, harder to remember url.</p> <p>My propose...
[ { "answer_id": 275388, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 1, "selected": false, "text": "if(Request.Url.Authority == \"www.site1.com\")\n Response.Redirect(...);\n" }, { "answer_id": 276556, ...
2008/11/08
[ "https://Stackoverflow.com/questions/275382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20489/" ]
275,386
<p>I'm writing a Linux kernel module that needs to open and read files. What's the best way to accomplish that?</p>
[ { "answer_id": 275396, "author": "Evan Teran", "author_id": 13430, "author_profile": "https://Stackoverflow.com/users/13430", "pm_score": 3, "selected": false, "text": "open read close mm_segment_t fs = get_fs();\nset_fs(KERNEL_DS);\n\nfd = (*syscall_open)(file, flags, mode);\nif(fd != -...
2008/11/08
[ "https://Stackoverflow.com/questions/275386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28804/" ]
275,404
<p>How do you split a string into tokens in C++?</p>
[ { "answer_id": 275413, "author": "Martin York", "author_id": 14065, "author_profile": "https://Stackoverflow.com/users/14065", "pm_score": 2, "selected": false, "text": "std::string line(\"A line of tokens\");\nstd::stringstream lineStream(line);\n\nstd::string token;\nwhile(lineStream...
2008/11/09
[ "https://Stackoverflow.com/questions/275404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33481/" ]
275,411
<p>I'm writing a php program that pulls from a database source. Some of the varchars have quotes that are displaying as black diamonds with a question mark in them (�, <a href="http://www.fileformat.info/info/unicode/char/fffd/index.htm" rel="noreferrer">REPLACEMENT CHARACTER</a>, I assume from Microsoft Word text).</p...
[ { "answer_id": 275448, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 6, "selected": false, "text": "header(\"Content-Type: text/html; charset=ISO-8859-1\");\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-...
2008/11/09
[ "https://Stackoverflow.com/questions/275411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
275,437
<p>I want to display the "infinity" symbol using </p> <pre><code>CGContextSelectFont(context, "HelveticaNeue", textSize, kCGEncodingMacRoman); CGContextShowTextAtPoint(context, myCenter.x, myCenter.y + textHeight, [sName cStringUsingEncoding:NSMacOSRomanStringEncoding], [sName length]); </code></pre> <p>It i...
[ { "answer_id": 275447, "author": "Jason Coco", "author_id": 34218, "author_profile": "https://Stackoverflow.com/users/34218", "pm_score": 5, "selected": true, "text": "- (void)drawRect:(CGRect)rect {\n unichar inf = 0x221E; // infinity symbol\n NSString* sName = [[NSString alloc] i...
2008/11/09
[ "https://Stackoverflow.com/questions/275437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29642/" ]
275,442
<p>How can I make a local drive visible to a Windows XP VMWare image?</p> <p>Preferably, I'd like to make local drives available as Drive Letters within the VM Ware Image.</p>
[ { "answer_id": 275451, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "vm > settings > options > shared folders\n" }, { "answer_id": 10649033, "author": "ntg", "author_id": 508907, ...
2008/11/09
[ "https://Stackoverflow.com/questions/275442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9467/" ]
275,444
<p>What are the things that Medium Trust stops you from doing? For example, I've already learned that Medium Trust stops you from using System.IO.Path.GetTempPath(). What other things like that?</p>
[ { "answer_id": 275445, "author": "Shawn", "author_id": 26, "author_profile": "https://Stackoverflow.com/users/26", "pm_score": 2, "selected": false, "text": " <trust level=\"Full|High|Medium|Low|Minimal\" />\n" }, { "answer_id": 275533, "author": "Corey Trager", "author_i...
2008/11/09
[ "https://Stackoverflow.com/questions/275444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9328/" ]
275,453
<p>I can't seem to get a scrollbar to work in an inner stack/flow. Does anyone know how to?</p>
[ { "answer_id": 358198, "author": "user45200", "author_id": 45200, "author_profile": "https://Stackoverflow.com/users/45200", "pm_score": 1, "selected": false, "text": "<div> #my_div {\n width: [some_width]px;\n height: [some_height]px;\n overflow: auto;\n}\n" }, { "answer_id": 61...
2008/11/09
[ "https://Stackoverflow.com/questions/275453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35852/" ]
275,456
<p>Working with a traditional listener callback model. I have several listeners that collect various stuff. Each listener's collected stuff is inside the listener in internal structures.</p> <p>The problem is that I want some of the listeners to be aware of some of the "stuff" in the other listeners.</p> <p>I enforce...
[ { "answer_id": 275470, "author": "sblundy", "author_id": 4893, "author_profile": "https://Stackoverflow.com/users/4893", "pm_score": 2, "selected": false, "text": "interface Listener {\n String getId();\n Collection<String> getDependencies();\n onEvent(char e);\n}\n interface Listener...
2008/11/09
[ "https://Stackoverflow.com/questions/275456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2204759/" ]
275,458
<p>Has anyone converted a large (ours is 550,000 lines) program of Fortran 77 code to C++ ? What pitfalls did you run into ? Was the conversion a success ? Did you use a tool like <code>for_c</code> ( <a href="http://www.cobalt-blue.com/fc/fcmain.htm" rel="noreferrer">http://www.cobalt-blue.com/fc/fcmain.htm</a> ) ?...
[ { "answer_id": 275488, "author": "EvilTeach", "author_id": 7734, "author_profile": "https://Stackoverflow.com/users/7734", "pm_score": 3, "selected": false, "text": "label10:;\n\n goto label10;\n #define XMAX 10 + 1\n#define YMAX 20 + 1 \nfloat a[XMAX][YMAX];\n for (x = 1; x <= XMAX; ...
2008/11/09
[ "https://Stackoverflow.com/questions/275458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35854/" ]
275,464
<p>What does the following error mean? </p> <p>Geeneration of designer file failed: Exception from HRESULT: 0x80042929 </p> <p>It started showing up in my application when building and I'm not sure what's causing it. I'm using VS.Net 2008 and .Net 3.5</p>
[ { "answer_id": 275488, "author": "EvilTeach", "author_id": 7734, "author_profile": "https://Stackoverflow.com/users/7734", "pm_score": 3, "selected": false, "text": "label10:;\n\n goto label10;\n #define XMAX 10 + 1\n#define YMAX 20 + 1 \nfloat a[XMAX][YMAX];\n for (x = 1; x <= XMAX; ...
2008/11/09
[ "https://Stackoverflow.com/questions/275464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33633/" ]
275,471
<p>I'm trying to use GDB to debug (to find an annoying segfault). When I run:</p> <pre><code>gdb ./filename </code></pre> <p>from the command line, I get the following error:</p> <pre><code>This GDB was configured as "i686-pc-linux- gnu"..."/path/exec": not in executable format: File format not recognized </code><...
[ { "answer_id": 275763, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 2, "selected": false, "text": "gdb executable-file core-file\n gdb executable-file\n executable-file" }, { "answer_id": 1123312, "au...
2008/11/09
[ "https://Stackoverflow.com/questions/275471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1266/" ]
275,484
<p>I'm pretty sure this is a simple question in regards to formatting but here's what I want to accomplish:</p> <p>I want to output data onto the screen using <code>cout</code>. I want to output this in the form of a table format. What I mean by this is the columns and rows should be properly aligned. Example:</p> ...
[ { "answer_id": 275489, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 3, "selected": false, "text": "cout << format(\"%|1$30| %2%\") % var1 % var2;\n" }, { "answer_id": 275494, "author": "Eugene Yokota", ...
2008/11/09
[ "https://Stackoverflow.com/questions/275484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33481/" ]
275,493
<p>I'm using a RichTextBox in WinForms 3.5 and I found that when I programmatically edit the contained text, those changes are no longer available to the built in undo functionality.</p> <p>Is there a way to make it so these changes are available for undo/redo?</p>
[ { "answer_id": 275621, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 3, "selected": true, "text": " string buffer = String.Empty;\n string buffer2 = String.Empty;\n public Form3()\n {\n ...
2008/11/09
[ "https://Stackoverflow.com/questions/275493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194/" ]
275,514
<p>Something is eluding me ... it seems obvious, but I can't quite figure it out.</p> <p>I want to add/remove a couple of HTML controls to a page (plain old html) when a user changes value of a dropdown list. An example is to add or remove a "number of guests in this room" textbox for each (of a number) of rooms requ...
[ { "answer_id": 275521, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 2, "selected": false, "text": "<script>\n //swap $ with applicable lib call (if avail)\n function $(id){\n return document.getElementById(id);\n }\...
2008/11/09
[ "https://Stackoverflow.com/questions/275514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34770/" ]
275,536
<p>Where would the physical files be?</p>
[ { "answer_id": 275538, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 6, "selected": true, "text": "<SYSTEMDRIVE>\\Documents and Settings\\<user>\\Local Settings\\Application Data\\Microsoft\\IsolatedStorage \n <SYSTEMDR...
2008/11/09
[ "https://Stackoverflow.com/questions/275536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9328/" ]
275,540
<p>I would like to call an ejb3 at runtime. The name of the ejb and the method name will only be available at runtime, so I cannot include any remote interfaces at compile time.</p> <pre><code>String bean = 'some/Bean'; String meth = 'doStuff'; //lookup the bean Object remoteInterface = (Object) new InitialContext()....
[ { "answer_id": 461625, "author": "Pavel", "author_id": 48340, "author_profile": "https://Stackoverflow.com/users/48340", "pm_score": 0, "selected": false, "text": "Object ejb = ctx.lookup(bean);\nfor (Method m : ejb.getClass().getMethods()) {\n if (m.getName().equals(meth) && m.getPar...
2008/11/09
[ "https://Stackoverflow.com/questions/275540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]