text
stringlengths
8
267k
meta
dict
Q: Could not load type from assembly error I have written the following simple test in trying to learn Castle Windsor's Fluent Interface: using NUnit.Framework; using Castle.Windsor; using System.Collections; using Castle.MicroKernel.Registration; namespace WindsorSample { public class MyComponent : IMyComponent {...
{ "language": "en", "url": "https://stackoverflow.com/questions/124841", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "153" }
Q: Flags in a database rows, best practices I am asking this out of a curiosity. Basically my question is when you have a database which needs a row entry to have things which act like flags, what is the best practice? A good example of this would be the badges on stack overflow, or the operating system field in bugzil...
{ "language": "en", "url": "https://stackoverflow.com/questions/124844", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "37" }
Q: OpenGL still better than Direct3D for non-games? The standard model has been that OpenGL is for professional apps (CAD) and Direct3D is for games. With the debacle of openGL 3.0, is openGl still the natural choice for technical 3D apps (cad/GIS)? Are there scenegraph libraries for Direct3D? (Of course Direct3D i...
{ "language": "en", "url": "https://stackoverflow.com/questions/124851", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: How can I select an element programmatically using JavaScript? I have an <img> in an HTML document that I would like to highlight as though the user had highlighted it using the mouse. Is there a way to do that using JavaScript? I only need it to work in Mozilla, but any and all information is welcome. EDIT: The re...
{ "language": "en", "url": "https://stackoverflow.com/questions/124854", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How do I prevent a class from being allocated via the 'new' operator? (I'd like to ensure my RAII class is always allocated on the stack.) I'd like to ensure my RAII class is always allocated on the stack. How do I prevent a class from being allocated via the 'new' operator? A: I'm not convinced of your motivation....
{ "language": "en", "url": "https://stackoverflow.com/questions/124856", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "51" }
Q: Options for Dynamic content in ASP.Net What choices do I have for creating stateful dynamic content in an ASP.Net web site? Here's my scenario. I have a site that has multiple, nested content regions. The top level are actions tied to a functional area Catalog, Subscriptions, Settings. When you click on the functi...
{ "language": "en", "url": "https://stackoverflow.com/questions/124863", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: XML Schema (XSD) validation tool? At the office we are currently writing an application that will generate XML files against a schema that we were given. We have the schema in an .XSD file. Are there tool or libraries that we can use for automated testing to check that the generated XML matches the schema? We would...
{ "language": "en", "url": "https://stackoverflow.com/questions/124865", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "274" }
Q: How does the .doc format work? I recently learned about the basic structure of the .docx file (it's a specially structured zip archive). However, docx is not formated like a doc. How does a doc file work? What is the file format, structure, etc? A: The basic idea behind the MS Word DOC format is an OLE Compund Do...
{ "language": "en", "url": "https://stackoverflow.com/questions/124869", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: What is Castle Windsor, and why should I care? I'm a long-time Windows developer, having cut my teeth on win32 and early COM. I've been working with .NET since 2001, so I'm pretty fluent in C# and the CLR. I'd never heard of Castle Windsor until I started participating in Stack Overflow. I've read the Castle Wind...
{ "language": "en", "url": "https://stackoverflow.com/questions/124871", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "198" }
Q: Is it possible to prevent stack allocation of an object and only allow it to be instantiated with 'new'? Is it possible to prevent stack allocation of an object and only allow it to be instiated with 'new' on the heap? A: One way you could do this would be to make the constructors private and only allow constructio...
{ "language": "en", "url": "https://stackoverflow.com/questions/124880", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "55" }
Q: Access Intranet via SSL using WebBrowser Winforms Control I have a .Net 2.0 app that is used internally and we want to use the WebBrowser control to access some Web resources. We want to add encryption to these sites using SSL using self signed certificates. My question is if there is way to disable all the warnings...
{ "language": "en", "url": "https://stackoverflow.com/questions/124885", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to get the application executable name in WindowsC++/CLI? I need to change the functionality of an application based on the executable name. Nothing huge, just changing strings that are displayed and some internal identifiers. The application is written in a mixture of native and .Net C++-CLI code. Two ways tha...
{ "language": "en", "url": "https://stackoverflow.com/questions/124886", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: XMLDocument.Load(url) through a proxy I have a bit of code that basically reads an XML document using the XMLDocument.Load(uri) method which works fine, but doesn't work so well if the call is made through a proxy. I was wondering if anyone knew of a way to make this call (or achieve the same effect) through a proxy...
{ "language": "en", "url": "https://stackoverflow.com/questions/124932", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: How do I make an Ajax.Autocompleter perform a request without typing? I'm using scriptaculous's Ajax.Autocompleter for a search with different filters. http://github.com/madrobby/scriptaculous/wikis/ajax-autocompleter The filters are requiring me to pass data into the autocompleter dynamically, which I've successfu...
{ "language": "en", "url": "https://stackoverflow.com/questions/124935", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: C# file read/write fileshare doesn't appear to work My question is based off of inheriting a great deal of legacy code that I can't do very much about. Basically, I have a device that will produce a block of data. A library which will call the device to create that block of data, for some reason I don't entirely u...
{ "language": "en", "url": "https://stackoverflow.com/questions/124946", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: dTrace scripts and tools I've recently began using dTrace and have noticed just how awesome it is. Its the perfect tool for profiling without placing the burden on programmers to set up hundreds of probes in their applications. I've found some nice one liner and sample scripts here and there, but I was wondering abo...
{ "language": "en", "url": "https://stackoverflow.com/questions/124952", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: glob() - sort array of files by last modified datetime stamp I'm trying to display an array of files in order of date (last modified). I have done this buy looping through the array and sorting it into another array, but is there an easier (more efficient) way to do this? A: Since PHP 7.4 the best solution is to us...
{ "language": "en", "url": "https://stackoverflow.com/questions/124958", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "61" }
Q: Create Word Document using PHP in Linux Whats the available solutions for PHP to create word document in linux environment? A: OpenTBS can create DOCX dynamic documents in PHP using the technique of templates. No temporary files needed, no command lines, all in PHP. It can add or delete pictures. The created docume...
{ "language": "en", "url": "https://stackoverflow.com/questions/124959", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "60" }
Q: Existence map in C++ I want something like an std::map, but I only want to see if the item exists or not, I don't actually need a key AND a value. What should I use? A: If you want the same type of behavior as std::map, then you want std::set. If you are mixing insert/delete and query operations, then std::set is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/124966", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Getting logged on user's name with or without domain in Windows Is there a direct API to get the currently logged in user's name with the domain? So, it would return something like "domain\user" when a machine is on the domain, but at the same time it would return "user" when the machine is not on the domain? If the...
{ "language": "en", "url": "https://stackoverflow.com/questions/124967", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Lower than low level common bsd sockets How do you do low low level sockets in C, example: actually sending a SYN. A: Raw sockets are your friend. There have been some links to useful information on this question. Also consult Chapter 25 "Raw sockets" of Steven's "Unix Network Programming" If you're attempting cros...
{ "language": "en", "url": "https://stackoverflow.com/questions/124968", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Windows Forms textbox that has line numbers? I'm looking for a free winforms component for an application I'm writing. I basicly need a textbox that contains line numbers in a side column. Being able to tabulate data within it would be a major plus too. Does anyone know of a premade component that could do this? A:...
{ "language": "en", "url": "https://stackoverflow.com/questions/124975", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Switching to a Standing Desk At work I have a standard desk (4 legs, flat surface, you get the picture). For a while now I've been thinking about converting to a standing desk. What would be the best way to go about this on a limited budget? Are there some good laptop/keyboard stands I could place on my existing ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125016", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Beginner looking for beautiful and instructional Python code As a complete beginner with no programming experience, I am trying to find beautiful Python code to study and play with. Please answer by pointing to a website, a book or some software project. I have the following criterias: * *complete code listings (...
{ "language": "en", "url": "https://stackoverflow.com/questions/125019", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Install PHP on XP / IIS 5.1? I am trying to install PHP onto my development box (XP SP3 / IIS 5.1) I've got PHP 5.2.6 stable downloaded (the MSI installer package) and I am getting an error "Cannot find httpd.conf". After that the install seems to breeze by quickly (more quickly than I would have expected) and whe...
{ "language": "en", "url": "https://stackoverflow.com/questions/125022", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Sending SVN commits to an RSS feed So my favourite web tool, Subtlety, was recently discontinued, which means that I no longer have easy access to the commit logs of various SVN projects that I follow. Are there any other tools that easily pump out an RSS feed of commits for a public SVN repo? A: I was going to su...
{ "language": "en", "url": "https://stackoverflow.com/questions/125028", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: What is the easiest, most concise way to make selected attributes in an instance be readonly? In Python, I want to make selected instance attributes of a class be readonly to code outside of the class. I want there to be no way outside code can alter the attribute, except indirectly by invoking methods on the instan...
{ "language": "en", "url": "https://stackoverflow.com/questions/125034", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: What's the difference between Polymorphism and Multiple Dispatch? ...or are they the same thing? I notice that each has its own Wikipedia entry: Polymorphism, Multiple Dispatch, but I'm having trouble seeing how the concepts differ. Edit: And how does Overloading fit into all this? A: Polymorphism is the facility t...
{ "language": "en", "url": "https://stackoverflow.com/questions/125050", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "35" }
Q: Synchronize a DataSet and DataTables with Database I am using ADO.net with a DataSet and DataTables for the first time and I have run into a pretty significant problem. Each time that I change anything in my database table definitions, I don't seem to have an easy way to synchronize these changes to my DataTable def...
{ "language": "en", "url": "https://stackoverflow.com/questions/125074", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is the worst project failure you've ever been on? Most importantly, why did it fail? What I'm looking for here is pathologies that anyone, whether new to the team or just waking up one day,can spot. A: My latest project failed because all the developers spent their time asking and answering questions on Stack ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125081", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Transparently swapping pointers to character arrays in C++ I have a 2D character array: char nm[MAX1][MAX2] = { "john", "bob", "david" }; I want to swap two of these elements (without std::swap) by simply writing swapPointers(nm[0], nm[1]); where swapPointers looks like this void swapPointers(char *&a, char *&b) ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125094", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can I turn off impersonation just in a couple instances I have an app that has impersonation used throughout. But when a user is logged in as an admin, a few operation require them to write to the server itself. Now if these users do not have rights on the actual server (some don't) it will not let them write. Wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/125096", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Formula for controlling the movement of a tank-like vehicle? Anyone know the formula used to control the movement of a simple tank-like vehicle? To 'steer' it, you need to alter the force applied the left and right "wheels". Eg. 1 unit of force on both wheels makes it go forward. -1 units of force on both wheels ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125099", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Free/Open Source Test Generator for Java? Are there any libraries for Java that can generate unit tests or unit test skeletons for existing code? I'm looking for something similar to pythoscope. Ideally it would generate code that follows JUnit4 or TestNG conventions. It looks like Agitar does something like this, b...
{ "language": "en", "url": "https://stackoverflow.com/questions/125100", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Adding New Element to Text Substring Say I have the following string: "I am the most foo h4ck3r ever!!" I'm trying to write a makeSpecial(foo) function where the foo substring would be wrapped in a new span element, resulting in: "I am the most <span class="special">foo></span> h4ck3r ever!!" BeautifulSoup seemed ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125102", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Where can I find a template for documentation about server-side installation of software? I'm looking for a good template on server-side installation of software for a project I'm working on. The client-side is pretty straight-forward. The server-side installation is a little trickier. It is made up of several piece...
{ "language": "en", "url": "https://stackoverflow.com/questions/125107", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: winForms + DataGridView binding to a List I'm trying to bind a List<T> to a DataGridView control, and I'm not having any luck creating custom bindings. I have tried: gvProgramCode.DataBindings.Add(new Binding("Opcode",code,"Opcode")); It throws an exception, saying that nothing was found by that property name. The ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125109", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "34" }
Q: PHP code to convert a MySQL query to CSV What is the most efficient way to convert a MySQL query to CSV in PHP please? It would be best to avoid temp files as this reduces portability (dir paths and setting file-system permissions required). The CSV should also include one top line of field names. A: Check out this...
{ "language": "en", "url": "https://stackoverflow.com/questions/125113", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "136" }
Q: Rounded corners, is this Mozilla specific? I was looking at how some site implemented rounded corners, and the CSS had these odd tags that I've never really seen before. -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5...
{ "language": "en", "url": "https://stackoverflow.com/questions/125117", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: C++ Passing Options To Executable How do you pass options to an executable? Is there an easier way than making the options boolean arguments? EDIT: The last two answers have suggested using arguments. I know I can code a workable solution like that, but I'd rather have them be options. EDIT2: Per requests for cla...
{ "language": "en", "url": "https://stackoverflow.com/questions/125124", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: WYSIWYG HTML Editor for Windows Mobile forms app I am developing a forms app (not web) for Windows Mobile, using .NET CF 3.5. I need an HTML editor control. I'm looking for something along the lines of a simple FCKEditor, but for using in a forms app (EXE). Any suggestions? A: Pocket IE (the web browser included ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125143", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Long running ruby process that uses ActiveRecord to store records in a database I'm trying to write an app using Ruby on Rails and I'm trying to achieve the following: The app needs to receive UDP messages coming in on a specific port (possibly 1 or more per second) and store them in the database so that the rest o...
{ "language": "en", "url": "https://stackoverflow.com/questions/125146", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: 1000's of locations have a desktop application that need to upload diff's of their db to a central store There are literally thousands of locations where an application is running (.net desktop app),and a requirement is to have the updates to their database (diff from the last upload) to be sent to a central server ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125153", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Relative path reference in WebConfig.ConnectionString Is it possible to specify a relative path reference in connectionstring, attachDbFileName property in a web.config? For example, In my database is located in the App_data folder, I can easily specify the AttachDBFilename as|DataDirectory|\mydb.mdf and the |Datadi...
{ "language": "en", "url": "https://stackoverflow.com/questions/125157", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Passing a regex substitution as a variable in Perl I need to pass a regex substitution as a variable: sub proc { my $pattern = shift; my $txt = "foo baz"; $txt =~ $pattern; } my $pattern = 's/foo/bar/'; proc($pattern); This, of course, doesn't work. I tried eval'ing the substitution: eval("$txt =~ $pa...
{ "language": "en", "url": "https://stackoverflow.com/questions/125171", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: What's a good tool to screen-scrape with Javascript support? Is there a good test suite or tool set that can automate website navigation -- with Javascript support -- and collect the HTML from the pages? Of course I can scrape straight HTML with BeautifulSoup. But this does me no good for sites that require Javascr...
{ "language": "en", "url": "https://stackoverflow.com/questions/125177", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: Does Postscript have a concept of a table? What I'm trying to achieve is to determine if the Postscript that I'm parsing contains any element that resides in a table (box). Im asking whether if it had a built-in way to lay out tabular data on the page. My guess is that postscript doesnt have a concept of a table, co...
{ "language": "en", "url": "https://stackoverflow.com/questions/125188", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Any quirks I should be aware of in Drupal's XML-RPC and BlogAPI implementations? I'm beginning work on a project that will access a Drupal site to create (and eventually edit) nodes on the site, via the XML-RPC facility and BlogAPI module shipped with Drupal. This includes file uploading, as the project is to allow ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125190", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Reinstalling/ un-revoking digital certificate So I have a problem in Vista which I can't run certain applications (well, the entier MS suite, Office, Visual Studio, etc) as an Administrator. From the looks of the problem it is caused by the Digital Certificate, and the fact that it has been "revoked". So now I have ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125191", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: STL like container typedef shortcut? A common pattern with STL containers is this: map<Key, Value> map; for(map<Key, Value>::iterator iter = map.begin(); iter != map.end(); ++iter) { ... } So in order to avoid writing the declaration of the template parameters we can do this somewhere: typedef map<Key, Value> TNi...
{ "language": "en", "url": "https://stackoverflow.com/questions/125192", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: extracting text from MS word files in python for working with MS word files in python, there is python win32 extensions, which can be used in windows. How do I do the same in linux? Is there any library? A: I know this is an old question, but I was recently trying to find a way to extract text from MS word files, a...
{ "language": "en", "url": "https://stackoverflow.com/questions/125222", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: MySQL search and replace some text in a field What MySQL query will do a text search and replace in one particular field in a table? I.e. search for foo and replace with bar so a record with a field with the value hello foo becomes hello bar. A: And if you want to search and replace based on the value of another fi...
{ "language": "en", "url": "https://stackoverflow.com/questions/125230", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "297" }
Q: Is there an equivalent to Ctrl-Shift-R in Safari/WebKit? Something that would really reload the page or resource, ignoring whatever might be in cache. A: Safari always reloads (ctrl+r) a page ignoring whatever that might be in the cache. As Athena points out, iframes are cached. It's actually not the iframe conten...
{ "language": "en", "url": "https://stackoverflow.com/questions/125245", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is there a way to validate hAtom microformat? I have implemented hAtom microformat on my blog. At least, I think I have, but I can't find any validator (or any software that uses hAtom) in order to determine if I have done this correctly. A Google search for "hatom validator" currently doesn't return anything usef...
{ "language": "en", "url": "https://stackoverflow.com/questions/125262", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How does Perl 6 evaluate truthiness? In reading about Perl 6, I see a feature being trumpeted about, where you no longer have to do: return "0 but true"; ...but can instead do: return 0 but True; If that's the case, how does truth work in Perl 6? In Perl 5, it was pretty simple: 0, "", and undef are false, everyth...
{ "language": "en", "url": "https://stackoverflow.com/questions/125265", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: Chaining Static Methods in PHP? Is it possible to chain static methods together using a static class? Say I wanted to do something like this: $value = TestClass::toValue(5)::add(3)::subtract(2)::add(8)::result(); . . . and obviously I would want $value to be assigned the number 14. Is this possible? Update: It does...
{ "language": "en", "url": "https://stackoverflow.com/questions/125268", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "62" }
Q: How would you handle users who don't read dialog boxes? A recent article on Ars Technica discusses a recent study performed by the Psychology Department of North Carolina State University, that showed users have a tendency to do whatever it takes to get rid of a dialog box to get back to their task at hand. Most of...
{ "language": "en", "url": "https://stackoverflow.com/questions/125269", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: What's the easiest way to commit and push a single file while leaving other modifications alone? I'm relatively new to Mercurial and my team is trying it out right now as a replacement for Subversion. How can I commit and push a single file out to another repository while leaving other modifications in my working ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125272", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "72" }
Q: How do I remove the file suffix and path portion from a path string in Bash? Given a string file path such as /foo/fizzbuzz.bar, how would I use bash to extract just the fizzbuzz portion of said string? A: Here's how to do it with the # and % operators in Bash. $ x="/foo/fizzbuzz.bar" $ y=${x%.bar} $ echo ${y##*/} ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125281", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "497" }
Q: How can I upload a photo to a server with the iPhone? I'm writing an iPhone app that takes a photo and then uploads it to a server. How do I upload a photo to a server with Cocoa? I suppose I use NSUrl somewhere. Thanks! A: Hope following code snippet will work for you. I have used NSDateFormatter and NSDate to g...
{ "language": "en", "url": "https://stackoverflow.com/questions/125306", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "74" }
Q: How can I associate a scriptable Mozilla plugin instance with its NObject? I'm running into a problem associating an invoked method in a plugin I'm writing with the appropriate plugin instance. The documentation at http://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Scripting_plugins doesn't give enough infor...
{ "language": "en", "url": "https://stackoverflow.com/questions/125308", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to launch from Eclipse in Low priority under Windows? I'm running programs from Eclipse (on Windows) that eat a lot of CPU time. To avoid bogging down my whole machine, I set the priority to Low with the Task Manager. However, this is a cumbersome manual process. Is there a way Eclipse can set this priority auto...
{ "language": "en", "url": "https://stackoverflow.com/questions/125313", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Selenium Remote Control HTML Source Extraction in Internet Explorer Selenium Remote Control has a method of "get_html_source", which returns the source of the current page as a string. AFAIK, this method works in all cases in Firefox and Safari. But when it's invoked in Internet Explorer, it returns an incorrect sou...
{ "language": "en", "url": "https://stackoverflow.com/questions/125314", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Should 'using' directives be inside or outside the namespace in C#? I have been running StyleCop over some C# code, and it keeps reporting that my using directives should be inside the namespace. Is there a technical reason for putting the using directives inside instead of outside the namespace? A: As Jeppe Stig N...
{ "language": "en", "url": "https://stackoverflow.com/questions/125319", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2361" }
Q: How to implement simple threading with a fixed number of worker threads I'm looking for the simplest, most straightforward way to implement the following: * *The main program instantiates worker threads to do a task. *Only n tasks can be running at once. *When n is reached, no more workers are started until the...
{ "language": "en", "url": "https://stackoverflow.com/questions/125333", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "50" }
Q: How do you do Impersonation in .NET? Is there a simple out of the box way to impersonate a user in .NET? So far I've been using this class from code project for all my impersonation requirements. Is there a better way to do it by using .NET Framework? I have a user credential set, (username, password, domain name) w...
{ "language": "en", "url": "https://stackoverflow.com/questions/125341", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "151" }
Q: Plugins wont work with vb.net express What won't plugins wont work with vb c# studio express? A: The Express editions do not support Visual Studio Addins. A: Microsoft doesn't want to allow users to replace all the Standard+ functionality in Visual Studio when using the Express editions, as that would be akin to s...
{ "language": "en", "url": "https://stackoverflow.com/questions/125352", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Any clever ways of handling the context in a web app? In Java, web apps are bundled in to WARs. By default, many servlet containers will use the WAR name as the context name for the application. Thus myapp.war gets deployed to http://example.com/myapp. The problem is that the webapp considers its "root" to be, well,...
{ "language": "en", "url": "https://stackoverflow.com/questions/125359", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "39" }
Q: Dynamic type languages versus static type languages What are the advantages and limitations of dynamic type languages compared to static type languages? See also: whats with the love of dynamic languages (a far more argumentative thread...) A: Well, both are very, very very very misunderstood and also two completel...
{ "language": "en", "url": "https://stackoverflow.com/questions/125367", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "207" }
Q: Adding a web reference to a DLL which is GACed I come across this problem when i am writing an event handler in SharePoint. My event handler has a web reference. When i create this web reference, the URL of the web service will be added in the .config file of the assembly. If i have to change the web reference URL i...
{ "language": "en", "url": "https://stackoverflow.com/questions/125369", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Is it possible to define a Java ClassLoader that returns completely different classes to the one's requested? I've tried this, but get a ClassNotFoundException when calling: Class.forName("com.AClass", false, mySpecialLoader) A: The ClassLoader will have to call defineClass to get the Class. According to the Java...
{ "language": "en", "url": "https://stackoverflow.com/questions/125377", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Best way to access the runtime configuration of a maven plugin from a custom mojo? I am writing a custom maven2 MOJO. I need to access the runtime configuration of another plugin, from this MOJO. What is the best way to do this? A: You can get a list of plugins currently been used in the build using the following s...
{ "language": "en", "url": "https://stackoverflow.com/questions/125389", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: Interrupts and exceptions I've seen several question on here about exceptions, and some of them hint at interrupts as exceptions, but none make the connection clear. * *What is an interrupt? *What is an exception? (please explain what exceptions are for each language you know, as there are some differences) *Wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/125394", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: How can I dynamically switch web service addresses in .NET without a recompile? I have code that references a web service, and I'd like the address of that web service to be dynamic (read from a database, config file, etc.) so that it is easily changed. One major use of this will be to deploy to multiple environmen...
{ "language": "en", "url": "https://stackoverflow.com/questions/125399", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "72" }
Q: Generic LINQ query predicate? Not sure if this is possible or if I'm expressing correctly what I'm looking for, but I have the following piece of code in my library repeatedly and would like to practice some DRY. I have set of SQL Server tables that I'm querying based on a simple user-supplied search field ala Goog...
{ "language": "en", "url": "https://stackoverflow.com/questions/125400", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: How do you remotely update Java applications? We've got a Java server application that runs on a number of computers, all connected to the Internet, some behind firewalls. We need to remotely update the JAR files and startup scripts from a central site, with no noticeable interruption to the app itself. The process ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125409", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: PHP and Dreamweaver Integration This is an issue I've run into with a website I'm designing. I'm using a template based design for the site, so the information on the page is thrown inside the template when the page is accessed. The information shown changes based on the page attribute passed in as a GET request. So...
{ "language": "en", "url": "https://stackoverflow.com/questions/125427", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Protecting cells in Excel but allow these to be modified by VBA script I am using Excel where certain fields are allowed for user input and other cells are to be protected. I have used Tools Protect sheet, however after doing this I am not able to change the values in the VBA script. I need to restrict the sheet to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125449", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "68" }
Q: Implementation example for Repository pattern with Linq to Sql and C# I am looking for a Repository pattern implementation example/resource that follows domain driven design principles for my ASP.net MVC application. Does anyone have a good example or learning resource that can be shared? A: It's not an uncontrover...
{ "language": "en", "url": "https://stackoverflow.com/questions/125453", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: What is the T-SQL syntax to connect to another SQL Server? If I need to copy a stored procedure (SP) from one SQL Server to another I right click on the SP in SSMS and select Script Stored Procedure as > CREATE to > New Query Editor Window. I then change the connection by right clicking on that window and selecting ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125457", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "61" }
Q: GPU programming on Xbox 360 I'm looking for some insight into XNA on Xbox 360, mainly if its possible to run vector-based float mathematics on its GPU? If there's a way, can you point me into the right direction? A: I don't claim to be an expert on this, but hopefully this can point you in a helpful direction. Is i...
{ "language": "en", "url": "https://stackoverflow.com/questions/125462", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Bad OO design problem - I need some general functionality in Java but don't know how to implement it I'm developping a small UML Class editor in Java, mainly a personal project, it might end up on SourceForge if I find the time to create a project on it. The project is quite advanced : I can create classes, move the...
{ "language": "en", "url": "https://stackoverflow.com/questions/125463", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: mobile page: dynamically created image sporadic loading i have a page for a small mobile site that has an image that has its src value set via a getImage.aspx method, wherein an image is dynamically built and returned to the image tag. Most of the time it works great. However, there are moments where the image just ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125465", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Using glibc, why does my gethostbyname fail after I/DHCP has changed the DNS server? If our server (running on a device) starts before a DHCP lease had been acquired then it can never connect using a hostname. If that happens it can find hosts by IP address but not by DNS. I initially thought that the Curl DNS cache...
{ "language": "en", "url": "https://stackoverflow.com/questions/125466", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Best Way to Conditional Redirect? Using Rails v2.1, lets say you have an action for a controller that is accessible from more than one location. For example, within the Rails app, you have a link to edit a user from two different views, one on the users index view, and another from another view (lets say from the n...
{ "language": "en", "url": "https://stackoverflow.com/questions/125467", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to make SVN only update files but not add new ones I have a repository of files which are unrelated to each other but are common to multiple projects. Each project might only need a subset of these files. For example: /myRepo: /jquery.js /jquery.form.js /jquery.ui.js Project A requires jquery.js and...
{ "language": "en", "url": "https://stackoverflow.com/questions/125468", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Need to create a dynamic ConfigurationSection that also holds the type I need to create a configuration section, that is able to store key-value pairs in an app.config file and the key-value pairs can be added runtime regardless of their type. It is also important that the value keeps its original type. I need to ex...
{ "language": "en", "url": "https://stackoverflow.com/questions/125470", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I wire users with their respective folders in ASP.NET? When userA uploads a file, his files will be uploaded to folderA, when userB, to folderB, and so on. Roles/Profiles in ASP.NET. Folders will be pre-existing. Anyone? A: You'll probably want to hand-code that. There's nothing intrinsic to ASP.NET for man...
{ "language": "en", "url": "https://stackoverflow.com/questions/125473", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Rails Check box on MySql stored as a null or zero On my rails app I have a list of items (like a task list) and for each item there is a couple of check box to set parameters. When I submit the form, the checked box are stored as zero and the unchecked as null on DB. the question is: Is there a way to configure it?...
{ "language": "en", "url": "https://stackoverflow.com/questions/125496", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to change "3 errors prohibited this foobar from being saved" validation message in Rails? In my rails app I use the validation helpers in my active record objects and they are great. When there is a problem I see the standard "3 errors prohibited this foobar from being saved" on my web page along with the indivi...
{ "language": "en", "url": "https://stackoverflow.com/questions/125512", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Managed language for scientific computing software Scientific computing is algorithm intensive and can also be data intensive. It often needs to use a lot of memory to run analysis and release it before continuing with the next. Sometime it also uses memory pool to recycle memory for each analysis. Managed language ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125516", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Grouping Activerecord query by a child attribute Is it possible to use an attribute of a child to group a query? Post.find(:all, :include => [ :authors, :comments ], :group=>'authors.city') does not work. However, I am able to use author.city as part of the conditions. A: The solution is to force the necessary j...
{ "language": "en", "url": "https://stackoverflow.com/questions/125523", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Why can't I change the value of a segment register? (MASM) I decided to teach myself assembly language. I have realized that my program will not compile if I attempt to change the value of any segment register. Every article that I have found says that I can indeed change the value of at least 4 segment registers, s...
{ "language": "en", "url": "https://stackoverflow.com/questions/125532", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: WPF DataBinding with simple arithmetic operation? I want to add a constant value onto an incoming bound integer. In fact I have several places where I want to bind to the same source value but add different constants. So the ideal solution would be something like this... <TextBox Canvas.Top="{Binding ElementName=myS...
{ "language": "en", "url": "https://stackoverflow.com/questions/125536", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Deploy multiple instance of reporting services or connect to multiple versions of DLLs Is there any way in SSRS2008 to deploy multiple instances of the ReportServer running separate code sets? I'm developing a very specific deployment of reporting services where I have a number of custom extensions plugged in. But,...
{ "language": "en", "url": "https://stackoverflow.com/questions/125540", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I show data in the header of a multipage SSRS 2005 report? This question was very helpful, however I have a list control in my report, and when the report grows over 1 page, data in the header only shows up on the last page of the report. Apparently, hidden textboxes have to be on every page of the report fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/125541", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What algorithm for a tic-tac-toe game can I use to determine the "best move" for the AI? In a tic-tac-toe implementation I guess that the challenging part is to determine the best move to be played by the machine. What are the algorithms that can pursued? I'm looking into implementations from simple to complex. How ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125557", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "64" }
Q: SQL Job Status I am actually working on SP in SQL 2005. Using SP i am creating a job and am scheduling it for a particular time. These jobs take atleast 5 to 10 min to complete as the database is very huge. But I am not aware of how to check the status of the Job. I want to know if it has got completed successfully ...
{ "language": "en", "url": "https://stackoverflow.com/questions/125570", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: .NET ODBC Connection Pooling I open a connection like this: Using conn as New OdbcConnection(connectionString) conn.Open() //do stuff End Using If connection pooling is enabled, the connection is not physically closed but released to the pool and will get reused. If it is disabled, it will be physically clo...
{ "language": "en", "url": "https://stackoverflow.com/questions/125577", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What are the advantages of using the C++ Boost libraries? So, I've been reading through and it appears that the Boost libraries get used a lot in practice (not at my shop, though). Why is this? and what makes it so wonderful? A: It adds libraries that allow for a more modern approach to C++ programming. In my expe...
{ "language": "en", "url": "https://stackoverflow.com/questions/125580", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "135" }