text
stringlengths
8
267k
meta
dict
Q: Eliminating coupling out of classes that have strong conceptual bonds with each other I have the types Rock, Paper, and Scissors. These are components, or "hands" of the Rock, Paper, Scissors game. Given two players' hands the game must decide who wins. How do I solve the problem of storing this chain chart with...
{ "language": "en", "url": "https://stackoverflow.com/questions/383921", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Apache giving a 400 Error on a FastCGI VirtualHost Apache is spitting out a HTTP response of code: 400 "Bad Request" with no details whenever I access a page driven that is handled by a FastCGI script. * *I've installed the mod_fcgid module and it's loaded and configured in the Apache config files *I've tested s...
{ "language": "en", "url": "https://stackoverflow.com/questions/383927", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I burn CD/DVD from delphi2007 win32 Is there any good lib to enable me to burn CD/DVD from Delphi 2007 win32 ? Thanks A: I know of a couple: * *Bayden's Delphi CD Burning Library *Dance Mammal's Free Delphi CD Burning Library *Zyl Burner for Delphi (Needs Nero to be installed). A: We are using Magic...
{ "language": "en", "url": "https://stackoverflow.com/questions/383938", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: What is a Python equivalent of PHP's var_dump()? When debugging in PHP, I frequently find it useful to simply stick a var_dump() in my code to show me what a variable is, what its value is, and the same for anything that it contains. What is a good Python equivalent for this? A: Old topic, but worth a try. Here is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/383944", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "485" }
Q: What does it mean to "program to an interface"? I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this? I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly. Is it just so if you were to do: IInter...
{ "language": "en", "url": "https://stackoverflow.com/questions/383947", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "910" }
Q: Best way to return the language of a given string More specifically, I'm trying to check if given string (a sentence) is in Turkish. I can check if the string has Turkish characters such as Ç, Ş, Ü, Ö, Ğ etc. However that's not very reliable as those might be converted to C, S, U, O, G before I receive the string. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/383966", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Can I find the file/linenumber where a method was defined? Duplicate: How To Find Where A Ruby Method Is Defined At Runtime With a given object, is it possible to find out where each method was defined? A: After the fact, it will be pretty tough, but you can use a hook method to observe the line numbers where a me...
{ "language": "en", "url": "https://stackoverflow.com/questions/383968", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is args[0] guaranteed to be the path of execution? This is a fundamental question, but an important one none the less... When starting a C++ program whose main method has the following common signature: int main(int argc, char* args[]) { //Magic! return 0; } is args[0] always guaranteed to be the path to th...
{ "language": "en", "url": "https://stackoverflow.com/questions/383973", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Viewing more than 10,000 files on a FTP file server? I've queued up over 10,000 files to be uploaded to a UNIX based FTP server using a freeware (Windows based) FTP client which as far as i can see has finished without error. Now, when i view the remote directory (using the Windows software) the output is truncated ...
{ "language": "en", "url": "https://stackoverflow.com/questions/383977", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: How useful is the -[NSObject isMemberOfClass:] method? Here's a small test program I wrote: #import <Foundation/Foundation.h> int main(int argc, char **argv) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSArray *arr = [NSArray array]; printf("Arr isMemberOfClass NSArray: %d\n", [arr ...
{ "language": "en", "url": "https://stackoverflow.com/questions/383978", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Dynamically construct querystring behaviour in IE and FF / Chrome This code function LoadContent(Id) { alert('Controls/Network/NetworkDetail.aspx?' + rnd() + '&CtlId=' + Id); $.get('Controls/Network/NetworkDetail.aspx?' + rnd() + '&CtlId=' + Id, function(data) { $(Id).append(data); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/383979", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Where should I start drawing? (Java,GUI) I have the points by the end of the GenerateButton class but now that I got my public double[][] matrix with all the points in, where do I begin drawing them??? my Main.java: import java.awt.*; import javax.swing.*; public class Main { public static Display display = ne...
{ "language": "en", "url": "https://stackoverflow.com/questions/383995", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-2" }
Q: Using LINQ how do I have a grouping by a "calculated field" I am using LINQ to EF and have the following LINQ query: var results = (from x in ctx.Items group x by x.Year into decades orderby decades.Count() descending select new { Decade = decades.Key, DecadeCount = decad...
{ "language": "en", "url": "https://stackoverflow.com/questions/384004", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Can someone explain source (versioning) control to me? I've never worked on a professional project with a team, as I'm still in high school. As a consequence, I've never been exposed to this whole "versioning" and "source control" thing. Are they the same? How exactly does a program that manages code manage code? I'...
{ "language": "en", "url": "https://stackoverflow.com/questions/384016", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: c++ continuous integration with performance metrics I want to set up a continuous integration and test framework for my open source C++ project. The desired features are: 1. check out the source code 2. run all the unit and other tests 3. run performance tests (these measure the software quality - for example how lo...
{ "language": "en", "url": "https://stackoverflow.com/questions/384036", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Terminology used for language and culture-aware software I have always thought that the terms "internationalization" and "localization" (and their funny abbreviations i18n and l10n) were universally accepted and used for talking about software which is aware of language and cultural differences. But I recently read ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384038", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Can I Limit the depth of a Generic Stack? Is there a built in way to limit the depth of a System.Collection.Generics.Stack? So that if you are at max capacity, pushing a new element would remove the bottom of the stack? I know I can do it by converting to an array and rebuilding the stack, but I figured there's prob...
{ "language": "en", "url": "https://stackoverflow.com/questions/384042", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Add references manually Is there anyway I can make the process of adding references to C# projects less painful? Every time I create a new C# class library project. I have to use the Add Reference dialog for 5 times at least. A: Install the PowerCommands for Visual Studio. You can then simply copy and paste a bunch...
{ "language": "en", "url": "https://stackoverflow.com/questions/384050", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: div tags-on and off Should be super simple for you guys...div one gets clicked, div two appears. What I don't know how to do is make div 2 go away when div one is clicked again. <img src="/..." width="" height"" onClick="MM_showHideLayers('logo','','show','logoEasterEgg','',show')"> What should I add to this line o...
{ "language": "en", "url": "https://stackoverflow.com/questions/384053", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Web interface to versioning system Is there a versioning system with a great web interface so that it can basically be managed and used from a web browser? The interface would need to function in the areas of committing new code and viewing/downloading previous commits. A: GitHub is kind of like the aforementioned ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384073", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How can I color Python logging output? Some time ago, I saw a Mono application with colored output, presumably because of its log system (because all the messages were standardized). Now, Python has the logging module, which lets you specify a lot of options to customize output. So, I'm imagining something similar ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384076", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "493" }
Q: Entity Framework - how do I use the entity associations? When I have tables in my database that have PK/FK relationships (int) and when they are modeled by the Entity Framework designer everything seems as it should be. I can write the code below and everything seems like it's going to work fine as well but then wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/384078", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How should I pass an int into stringWithFormat? I am try to use stringWithFormat to set a numerical value on the text property of a label but the following code is not working. I cannot cast the int to NSString. I was expecting that the method would know how to automatically convert an int to NSString. What do I nee...
{ "language": "en", "url": "https://stackoverflow.com/questions/384089", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "69" }
Q: Can the Eclipse Java formatter be used stand-alone Is there a way to use the formatter that comes with eclipse, outside of eclipse? I would like to format some java files using my formatter.xml file that I have configured using eclipse. Does anyone have any code examples that would allow me to do this? I would al...
{ "language": "en", "url": "https://stackoverflow.com/questions/384101", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Moving from CVS to Git: $Id$ equivalent? I read through a bunch of questions asking about simple source code control tools and Git seemed like a reasonable choice. I have it up and running, and it works well so far. One aspect that I like about CVS is the automatic incrementation of a version number. I understand th...
{ "language": "en", "url": "https://stackoverflow.com/questions/384108", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "131" }
Q: Smart pointers for Windows Mobile 6 SDK I cannot get std::tr1::shared_ptr for my WinMobile project since the STL for WinCE is maintained by a different team at Microsoft :( aarrgh... Anyone worked with another thread-safe, reference counting smart pointers? I'm actually using yasper which seems to be good. Thank yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/384110", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to remove contents from CALayer? I have a CALayer with some image contents. When a button touched, I want to remove the contents from the layer, and I use this code: [m_aCellLayer setContents:nil] but I get EXC_BAD_ACCESS exception when executing above line. Do you have any idea why? A: Just the obvious stuff...
{ "language": "en", "url": "https://stackoverflow.com/questions/384111", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: .NET SMTPClient - where is pending outgoing mail stored? If I've queued up some email to be sent via the System.Net.Mail.SMTPClent, where can I find this mail? With the Windows SMTP Client, it's in the C:\inetpub\mailroot folder - is there a similar folder for the .NET client? EDIT: Here's an example. If I turn off ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384119", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Creating a module system (dynamic loading) in C How would one go about loading compiled C code at run time, and then calling functions within it? Not like simply calling exec(). EDIT: The the program loading the module is in C. A: See this question has been answered but thought others interested in this topic may...
{ "language": "en", "url": "https://stackoverflow.com/questions/384121", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "43" }
Q: How did the term "caret" for text insertion evolve? Where did the term "caret" originate for a text insertion point? I've tried to google for it, but this is something difficult to locate (even my historic computer reference books don't seem to help here). I'm reasonably sure I remember some archaic Wang/mainframe ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384124", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Entity Framework - how do I use the entity relationships in my extended classes? I am trying to extend the partial classes that the entity framework creates so that I can more easily work with objects like in the code below (please let me know if there's a better or more exceptable way of doing this with the entity ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384138", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to allow plugins to have custom properties? I have wpf app and I am allowing usercontrol plugins that implement an interface. i want to allow the plugins to have their own properties but I want to have these properties access from menu in the host. How would this be architected best? The properties could be st...
{ "language": "en", "url": "https://stackoverflow.com/questions/384141", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Expanding a parent to the height of its children I have a page structure similar to this: <body> <div id="parent"> <div id="childRightCol"> /*Content*/ </div> <div id="childLeftCol"> /*Content*/ </div> </div> </body> I would like for the parent div to expand in height when the inner...
{ "language": "en", "url": "https://stackoverflow.com/questions/384145", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "373" }
Q: Not printing results from AJAX I am working on a script to send data to a mysql table and I have it all working properly but the success part of the call, it is not loading my results in to my results column on my page. My code is below. Any suggestions on what I can do to fix that? I am guessing the problem is with...
{ "language": "en", "url": "https://stackoverflow.com/questions/384157", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Can't assign a member which is a pointer to a templatized class My problem is that in my "Widget" class i've the following declaration: MouseEvent* X; In a member function I initialize the pointer with an address the normal way: X = new MouseEvent; Ok, this last line makes the compiler stop at: error C2166: l-va...
{ "language": "en", "url": "https://stackoverflow.com/questions/384159", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: asp.net mvc: page can not found I'm trying to setup the MVC development enviroment on my laptop. I'm running WinXP Pro with IIS 5.1 I got the environment setup with the sample MVC application that come with beta. I can only get to the home page. when i try to open About us page. i run into the page can not be found ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384184", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I make a Java ResultSet available in my jsp? I'd like to swap out an sql:query for some Java code that builds a complex query with several parameters. The current sql is a simple select. <sql:query var="result" dataSource="${dSource}" sql="select * from TABLE "> </sql:query> How do I take my Java ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384189", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: C++ Operator Ambiguity Forgive me, for I am fairly new to C++, but I am having some trouble regarding operator ambiguity. I think it is compiler-specific, for the code compiled on my desktop. However, it fails to compile on my laptop. I think I know what's going wrong, but I don't see an elegant way around it. Pleas...
{ "language": "en", "url": "https://stackoverflow.com/questions/384200", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to use a calendar to choose dates on web page? I have an html page that contains startdate and enddate as user inputs. I need to let the user choose from a calendar for these inputs, instead of requiring the user to type the dates. Can you suggest anything to help? EDIT: I have an HTML page: StartDate: yyyy-mm-...
{ "language": "en", "url": "https://stackoverflow.com/questions/384214", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: CSS "see-through" background - crazy navigation menu problem I have a crazy navigation menu that I have to code. It's kind of tough. Please see the screenshot of the design here: navigation menu screenshot As you can see, the background of the "Home" menu item is quite tough! I can't figure out how to make its bac...
{ "language": "en", "url": "https://stackoverflow.com/questions/384220", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: View lost when refreshing ObjectDataProvider I'm implementing a textbox filter on a list based on Josh Smith's example at http://joshsmithonwpf.wordpress.com/2007/06/12/searching-for-items-in-a-listbox. Basically, it sets the Filter on the view to a delegate that checks against the text in the search box. I hook up ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384221", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Database does not update automatically with MySQL and Python I'm having some trouble updating a row in a MySQL database. Here is the code I'm trying to run: import MySQLdb conn=MySQLdb.connect(host="localhost", user="root", passwd="pass", db="dbname") cursor=conn.cursor() cursor.execute("UPDATE compinfo SET Co_num...
{ "language": "en", "url": "https://stackoverflow.com/questions/384228", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "40" }
Q: Good 'ole Internet Explorer Problems I'm running into some little glitch on Internet Explorer. The site looks like it should in Firefox (http://i27.photobucket.com/albums/c190/blcArmadillo/FirefoxView.jpg). But when I load it in Internet Explorer the background from my top bar seems to be applied across the site as ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384232", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: CSS changes not reflecting on site Whenever we make changes to the CSS, it generally takes 24 hours to reflect those changes on my site. I have tried clearing the server cache and browser cache but it doesn't help too. Is there any other way to make the CSS changes reflect immediately after updation? it happens in a...
{ "language": "en", "url": "https://stackoverflow.com/questions/384247", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: if the with keyword is bad (for C#), is this a nice alternative? var insInvoice = new NpgsqlCommand( @"INSERT INTO invoice_detail( invoice_id, invoice_detail_id, product_id, qty, price, amount) VALUES ( :_invoice_id, :_invoice_detail_id, :_product_id, :_qty, :_pric...
{ "language": "en", "url": "https://stackoverflow.com/questions/384262", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do you implement default text for a search box in WPF? I want to implement something exactly like "Changing the Default Text in the Search Box" for a WPF search TextBox. The box should show some greyed out "Search.." text when it's empty, and then it should function normally when text is typed in. The linked art...
{ "language": "en", "url": "https://stackoverflow.com/questions/384264", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How do I rename an open file in Emacs? Is there a way to rename an open file in Emacs? While I'm viewing it? Something like save-as, but the original one should go away. A: Try this function from Steve Yegge's .emacs: ;; source: http://steve.yegge.googlepages.com/my-dot-emacs-file (defun rename-file-and-buffer (ne...
{ "language": "en", "url": "https://stackoverflow.com/questions/384284", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "274" }
Q: How do you check if a JavaScript Object is a DOM Object? I'm trying to get: document.createElement('div') //=> true {tagName: 'foobar something'} //=> false In my own scripts, I used to just use this since I never needed tagName as a property: if (!object.tagName) throw ...; So for the second object, I came up w...
{ "language": "en", "url": "https://stackoverflow.com/questions/384286", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "314" }
Q: Code refactoring help - how to reorganize validations We have a web application that takes user inputs or database lookups to form some operations against some physical resources. The design can be simply presented as following diagram: user input <=> model object <=> database storage validations are needed with req...
{ "language": "en", "url": "https://stackoverflow.com/questions/384291", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Where is the implementation of InternalEquals(object objA, object objB) While disassembling the .Net Source Code using Reflector, I came upon the Equals implementation in the Object Class and it refers to bool InternalEquals(object objA, object objB); Which again refers to internal static extern bool InternalEqua...
{ "language": "en", "url": "https://stackoverflow.com/questions/384294", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Creating local user account c# and .NET 2.0 How can I create a local user account using .NET 2.0 and c# and also be able to set the "Password never expires" to never. I have tried using "Net.exe" using Process.Start and passing its parameters but it seems that the "net user" is unable to set the "Password never exp...
{ "language": "en", "url": "https://stackoverflow.com/questions/384304", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: How are an application's manifest-specified details used? I am upgrading an unmanaged C++ application to use the XP/Vista style common controls by adding a manifest. According to MSDN's page on application manifests, you are required to specify the name and version in the manifest, and optionally the description: <...
{ "language": "en", "url": "https://stackoverflow.com/questions/384306", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What is the best method for paging with datagrid performance? On a site with a high number of users, should paging be handled in code, or with a stored procedure. If you have employed caching, please include your success factors. A: Personally, I never page stuff outside SQL Server. I do this at database level as ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384310", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Overriding Rails to_param? How do I get the to_param method to deliver keyword slugs all the time? I have trouble getting it to work with this route: map.pike '/auction/:auction_id/item/:id', :controller => 'items', :action => 'show' Earlier the overridden to_param was working for 'items/1-cashmere-scarf' but fails...
{ "language": "en", "url": "https://stackoverflow.com/questions/384316", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: What is the fully qualified name of a C# method? In any class, how do I explicitly refer to a certain method of my class? For example, this code works: class Test : IEnumerable<T> { public IEnumerator<T> GetEnumerator() { return null; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } B...
{ "language": "en", "url": "https://stackoverflow.com/questions/384318", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Input button image - not work in Chrome & Safari? I have the following code in my index.html <li> <select name="cmbtype" style="display:none" id="cmbtype" onChange="Changetype()"> <option value="0"> <input type="image" src="images/ocean.png" value="Play" onclick="previewplay(); " /> </option> </select> </li> In f...
{ "language": "en", "url": "https://stackoverflow.com/questions/384324", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Google Friend Connect + CSS Style Switching I have been playing around with CSS Style Switching on my blog www.whataboutki.com and have also added Google Friend Connect. I would now like to change the colours of the GFC widget when the user changes styles. This is the script for GFC... the div id="div-1229769625913"...
{ "language": "en", "url": "https://stackoverflow.com/questions/384326", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: A program to kill long-running runaway programs I manage Unix systems where, sometimes, programs like CGI scripts run forever, sometimes eating a lot of CPU time and wasting resources. I want a program (typically invoked from cron) which can kill these runaways, based on the following criteria (combined with AND an...
{ "language": "en", "url": "https://stackoverflow.com/questions/384332", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do you manage your Django applications? I just wanted to try to build a project with django. Therefore I have a (basic) question on how to manage such a project. Since I cannot find any guidelines or so on how to split a project into applications. Let's take a kind of SO as an example. Which applications would y...
{ "language": "en", "url": "https://stackoverflow.com/questions/384333", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Using Python Web GET data I'm trying to pass information to a python page via the url. I have the following link text: "<a href='complete?id=%s'>" % (str(r[0])) on the complete page, I have this: import cgi def complete(): form = cgi.FieldStorage() db = MySQLdb.connect(user="", passwd="", db="todo") c =...
{ "language": "en", "url": "https://stackoverflow.com/questions/384336", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Why .NET strips off one tag from the page if there is already a form with runat server attribute? It doesn't remove everything inside the 2nd form tag but just hides the and tags from the page Any ideas and workaround? A: Nesting of forms is not allowed in html. So you cant add another form inside the server-for...
{ "language": "en", "url": "https://stackoverflow.com/questions/384350", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Overlaying of charts I want to know whether this is possible using Google Charts API: First, create a bar chart with the given input data. And then overlay a line chart (or a line) on top of it. My use case here, is to show a student's performance in a test when compared to the rest of the crowd which is already ava...
{ "language": "en", "url": "https://stackoverflow.com/questions/384352", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Hyper-V Manager MMC SnapIn in Windows 2008 Web Edition. Possible? Is there any possibility to run Hyper-V Manager MMC SnapIn on Windows 2008 Web edition ? Thanks A: Too bad. But this is quite strange if you think about it. MS has released Hyper-V Manager MMC SnapIn for Vista so why they could'n release it for Windo...
{ "language": "en", "url": "https://stackoverflow.com/questions/384364", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to wget a website and then export all the pages into a single pdf? IS there any way i can do that? A: I did this once. It was almost 10 years ago, however, so I don't remember the details. I used: * *wget to download the pages *html2ps to convert the individual pages to PostScript *ps2ps to splice the indi...
{ "language": "en", "url": "https://stackoverflow.com/questions/384373", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: javascript-problem with lightbox 2 on ie7 I am having a problem with lightbox2 on IE7. I've modified lightbox, moved the navigation around a bit - everything works fine on Firefox but in IE7 there is a problem: the first time I click on a thumbnail only a part of the background dims and the large image doesn't show....
{ "language": "en", "url": "https://stackoverflow.com/questions/384382", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to signal select() to return immediately? I have a worker thread that is listening to a TCP socket for incoming traffic, and buffering the received data for the main thread to access (let's call this socket A). However, the worker thread also has to do some regular operations (say, once per second), even if ther...
{ "language": "en", "url": "https://stackoverflow.com/questions/384391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: Yield keyword value added? still trying to find where i would use the "yield" keyword in a real situation. I see this thread on the subject What is the yield keyword used for in C#? but in the accepted answer, they have this as an example where someone is iterating around Integers() public IEnumerable<int> Integers...
{ "language": "en", "url": "https://stackoverflow.com/questions/384392", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Implementing RSA in C# I'm currently trying to implement a class to handle secure communications between instances of my app using RSACrytoServiceProveider class. First question : is it a good idea implement a single class to handle sender/reciever roles or should i split the roles into individual classes ?. This i...
{ "language": "en", "url": "https://stackoverflow.com/questions/384401", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Tool to Show Class Hierarchies in .NET Is there a way/tool that could show me all the classes/interfaces that implement a certain interface in my project? In Eclipse (Java) I would use the context menu "Open Type Hierarchy" option, which would show me a (pretty) tree of types that extend the selected type. Is there ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384406", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: LISP Displaying binary tree level by level I have a list that looks like (A (B (C D)) (E (F))) which represents this tree: A / \ B E / \ / C D F How do I print it as (A B E C D F) ? This is as far as I managed: ((lambda(tree) (loop for ele in tree do (print ele))) my-list) But it prints: A...
{ "language": "en", "url": "https://stackoverflow.com/questions/384419", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: C++ Header files - Confused! game.h needs: - packet.h - socket.h server.h needs: - socket.h socket.h needs: - game.h The problem comes when I try to include socket.h into game.h, because socket.h has game.h included already. How do I solve these kind of problems? A: The key is forward declaration. Take the stuff...
{ "language": "en", "url": "https://stackoverflow.com/questions/384431", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: f# byte[] -> hex -> string conversion I have byte array as input. I would like to convert that array to string that contains hexadecimal representation of array values. This is F# code: let ByteToHex bytes = bytes |> Array.map (fun (x : byte) -> String.Format("{0:X2}", x)) let ConcatArray stringArray = St...
{ "language": "en", "url": "https://stackoverflow.com/questions/384442", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: What are the best programmatic security controls and design patterns? There's a lot of security advice out there to tell programmers what not to do. What in your opinion are the best practices that should be followed when coding for good security? Please add your suggested security control / design pattern below. Su...
{ "language": "en", "url": "https://stackoverflow.com/questions/384451", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: internal methods and data structures . if i have a protected method, can i pass in a parameter where the data type is declared internal? A: No, unless the type (with the protected member) is itself internal. Internal types cannot be part of a public/protected API, as the consumer would have no way of using it. You...
{ "language": "en", "url": "https://stackoverflow.com/questions/384462", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: MySQL-db lib for Python 3.x? So, looking for a mysql-db-lib that is compatible with py3k/py3.0/py3000, any ideas? Google turned up nothing. A: I was looking for it too, but also found nothing, so I ported MySQL-python-1.2.3 to py3k you can read it here http://sourceforge.net/p/mysql-python/discussion/70460/thread/6...
{ "language": "en", "url": "https://stackoverflow.com/questions/384471", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: How do I find and remove unused classes to cleanup my code? Is there a quick way to detect classes in my application that are never used? I have just taken over a project and I am trying to do some cleanup. I do have ReSharper if that helps. A: I don't recommend deleting old code on a new-to-you project. That's re...
{ "language": "en", "url": "https://stackoverflow.com/questions/384481", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: What are the best rules to follow for what characters to allow in a password? Without thinking about it at all I just want to say I should allow every character. It gets hashed in any case, and I don't want to limit people who want to create strong passwords. However, thinking about it more, there are plenty of cha...
{ "language": "en", "url": "https://stackoverflow.com/questions/384489", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: Why setFrame increases the reference count of layer? Executing this code: mainLyr = [[CALayer layer] retain]; [mainLyr setFrame:CGRectMake(0.0,0.0,23.0,23.0)]; in debugger, I found that after retain, the reference count of mainLyr is 2. This is correct. But after setFrame, the reference count increased to 3. Why? A...
{ "language": "en", "url": "https://stackoverflow.com/questions/384496", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Initial callback to manipulate ThickBox content with jQuery Here is the scenario: ThickBox is opened from parent window (when button is pressed) with Ajax content (div based form) that contains the set of inputs with autocomplete support. Once ThickBox(form) is closed the input values should be passed to parent wind...
{ "language": "en", "url": "https://stackoverflow.com/questions/384500", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What is the bit size of long on 64-bit Windows? Not to long ago, someone told me that long are not 64 bits on 64 bit machines and I should always use int. This did not make sense to me. I have seen docs (such as the one on Apple's official site) say that long are indeed 64 bits when compiling for a 64-bit CPU. I loo...
{ "language": "en", "url": "https://stackoverflow.com/questions/384502", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "157" }
Q: Enumerator Implementation: Use struct or class? I noticed that List<T> defines its enumerator as a struct, while ArrayList defines its enumerator as a class. What's the difference? If I am to write an enumerator for my class, which one would be preferable? EDIT: My requirements cannot be fulfilled using yield, so I'...
{ "language": "en", "url": "https://stackoverflow.com/questions/384511", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Views and presenters directorys structure . For a winforms app, what do you think the ideal directory structure for views and presenters and your model are A: namespace XXX.Core or XXX.BusinessObjects -> models namespace XXX.Views -> views namespace XXX.Controllers -> controllers
{ "language": "en", "url": "https://stackoverflow.com/questions/384523", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What are other ASP.NET web applications that are as well done as StackOverflow? It's my understanding that StackOverflow (SO) was built using ASP.NET. What surprised me is it's so well designed and well implemented. Without knowing much about the internals of SO, here are my observations and educated guesses: * ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384547", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Managed Direct3D or XNA for non-game related 3D graphics programming? Which is the preferred approach for doing .NET 3D graphics programming: Direct3D or XNA seem to be the current technologies, but which is best for non-game related programming? Also, has Managed Direct 3D been discontinued? XNA doesn't really ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384561", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Determining the best way to break up code into different folders and namespaces i have the following directories: -UI -BusinessLogic -DataAccess -BusinessObjects if i have a class that is a client stub to a server side service that changes state on a server system, where would that go . . A: this code belongs in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384562", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I get Volume GUIDs using WMI? Is there any way to retrieve the following type of path: \\?\Volume{GUID}\ for USB drives Using WMI? A: In windows 2003 and above ( not XP !) you can use: Win32_Volume Class. I don't think there is a way to retrieve the guid with wmi in xp and below. Can't be sure. albert refe...
{ "language": "en", "url": "https://stackoverflow.com/questions/384569", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Slow MySQL in a laptop(localhost), faster in a production machine(desktop) What are the reasons when I am connecting to the MySQL server in my laptop(development machine) using MySQL Administrator it is too slow, but when I am connecting to the MySQL server in the prouction machine it is faster. Does setting on the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384573", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I intercept uncaught exceptions on Tomcat? I am trying to figure out a clean way to intercept uncaught exceptions that occur in my application. I have log4j configured for logging the normal application flow and caught exceptions, so that is taken care of. Right now, I have a class that takes all error-leve...
{ "language": "en", "url": "https://stackoverflow.com/questions/384574", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to seamlessly mix ASP.NET and PHP Web applications I have two websites, one driven by ASP.NET and the other in PHP. The PHP site is hosted on a relatively inexpensive host provider ('unlimited bandwidth and diskspace for $10 a month). The PHP site also provides REST URLs which would help me in monetizing my we...
{ "language": "en", "url": "https://stackoverflow.com/questions/384575", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Strange Problem with updating Database from Dataset Operations: Delete in DataGridView selected row from Dataset: FuDataSet.FuRow row = (FuDataSet.FuRow) ((DataRowView)FuBindingSource.Current).Row; row.Delete(); To add a new Row I'm doing: FuDataSet.FuRow row = FuDataSet.Fus.NewFuRow(); row.Someting = "Some initial...
{ "language": "en", "url": "https://stackoverflow.com/questions/384583", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: C++ I'm stuck filling this BST with its proper values I have created a BST full of WordInfo objects that have a vector to point out which of the other WordInfo objects is a synonym or antonym. Each word is identified by an integer on its source file, dictionary.txt. The BST has received so far its list of words, but...
{ "language": "en", "url": "https://stackoverflow.com/questions/384587", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-2" }
Q: How to safely and effectively cache ADO.NET commands? I want to use this pattern: SqlCommand com = new SqlCommand(sql, con); com.CommandType = CommandType.StoredProcedure;//um com.CommandTimeout = 120; //com.Connection = con; //EDIT: per suggestions below SqlParameter par; par = new SqlParameter("@id", SqlDbType.I...
{ "language": "en", "url": "https://stackoverflow.com/questions/384592", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: "Parameter is not valid." when using saving bitmap Im trying to save a bitmap jpg format with a specified encoding quality. However im getting an exception ("Parameter is not valid.") when calling the save method. If i leave out the two last parameters in the bmp.save it works fine. EncoderParameters eps = n...
{ "language": "en", "url": "https://stackoverflow.com/questions/384593", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: comboBox width depending on longest item i've got a ComboBox that i generate dynamically and fill with some items. i would like to set this control's width to the width of the longest item. how do i count the display width of some text? edit: i'm using windows forms, but i would like to do it in asp.net as well A: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384596", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Singleton with a public (single-instance) constructor As an exercise, I'm translating parts of our large and battle-hardened Delphi-framework to C#. Included in this framework is a generic singleton parent class. Of course, implementing a singleton in C# is fairly easy (there is even a Jon Skeet article, so what mo...
{ "language": "en", "url": "https://stackoverflow.com/questions/384610", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do you write your applications to be database independent? My boss asks me to write only ANSI SQL to make it database independent. But I learned that it is not that easy as no database fully ANSI SQL compatible. SQL code can rarely be ported between database systems without modifications. I saw people do differe...
{ "language": "en", "url": "https://stackoverflow.com/questions/384623", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: When will a Comparer make Sort throw an ArgumentException? The documentation for Sort says that Sort will throw an ArgumentException if "The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself." Apart from the example given, can anyo...
{ "language": "en", "url": "https://stackoverflow.com/questions/384632", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Select the maximal item from collection, by some criterion i am new to .net 3.5. I have a collection of items: IList<Model> models; where class Model { public string Name { get; private set; } } I would like to get the element, which has the longest name's length. I tried string maxItem ...
{ "language": "en", "url": "https://stackoverflow.com/questions/384633", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Load an image from Firefox cache? I'm trying to load an image from the Firefox cache as the title suggests. I'm running Ubuntu, so the location of my cache is /home/me/.mozilla/firefox/xxxxxx.default/Cache However, in the Cache (and this is on Mac, too) the filenames are just ridiculous combinations of letters and n...
{ "language": "en", "url": "https://stackoverflow.com/questions/384634", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to include Javascript in xml-document? The task seems to be pretty easy: how to include a Javascript file in xml-document so that at least Opera and Firefox could actually parse it and execute the code? A: <script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('Hello'); ]]></script> Or for external javas...
{ "language": "en", "url": "https://stackoverflow.com/questions/384639", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }