text
stringlengths
8
267k
meta
dict
Q: How does string.unpack work in Ruby? Can someone explain why how the result for the following unpack is computed? "aaa".unpack('h2H2') #=> ["16", "61"] In binary, 'a' = 0110 0001. I'm not sure how the 'h2' can become 16 (0001 0000) or 'H2' can become 61 (0011 1101). A: Not 16 - it is showing 1 and t...
{ "language": "en", "url": "https://stackoverflow.com/questions/131811", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How do you calculate accumulative time in C#? I want to calculate the time span between 2 times which I saved in a database. So literally I want to know the length of time between the 2 values. 14:10:20 - 10:05:15 = 02:05:05 So the result would be 02:05:05. How would I be able to achieve this using C#? 14:10:20 is t...
{ "language": "en", "url": "https://stackoverflow.com/questions/131812", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is putting thread on hold optimal? Application has an auxiliary thread. This thread is not meant to run all the time, but main process can call it very often. So, my question is, what is more optimal in terms of CPU performance: suspend thread when it is not being used or keep it alive and use WaitForSingleObject fu...
{ "language": "en", "url": "https://stackoverflow.com/questions/131818", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: JSP pagination without retrieving the whole result set? I need to display the log entries from a database. Of course the log data is huge, so I have to show the results on several pages, and that **without** getting **all** the log data at once, but as the user navigates through the pages. I know about DisplayTag an...
{ "language": "en", "url": "https://stackoverflow.com/questions/131840", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: how do I find the angle of rotation of the major axis of an ellipse given its bounding rectangle? I have an ellipse centered at (0,0) and the bounding rectangle is x = [-5,5], y = [-6,6]. The ellipse intersects the rectangle at (-5,3),(-2.5,6),(2.5,-6),and (5,-3) I know nothing else about the ellipse, but the only t...
{ "language": "en", "url": "https://stackoverflow.com/questions/131847", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Best way to go about serializing and deserializing an object without losing its listeners? I have a serializiable object with listeners registered. Currently the list of listeners is stored in the object as transient. When the object is serialized and then deserialized, obviously the listeners are no longer register...
{ "language": "en", "url": "https://stackoverflow.com/questions/131866", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Are there naming conventions for ASP.NET web application directory structures? Currently I am developing a site with about seven partial classes, a few icons, three pages and an App_Themes folder. I was interested to know, is there an industry standard directory structure for anything larger than a small project? Fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/131868", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Algorithm for implementing C# yield statement I'd love to figure it out myself but I was wondering roughly what's the algorithm for converting a function with yield statements into a state machine for an enumerator? For example how does C# turn this: IEnumerator<string> strings(IEnumerable<string> args) { IEnumerat...
{ "language": "en", "url": "https://stackoverflow.com/questions/131871", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "32" }
Q: What are possible reasons for java.io.IOException: "The filename, directory name, or volume label syntax is incorrect" I am trying to copy a file using the following code: File targetFile = new File(targetPath + File.separator + filename); ... targetFile.createNewFile(); fileInputStream = new FileInputStream(fileToC...
{ "language": "en", "url": "https://stackoverflow.com/questions/131901", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: What are the security concerns of evaluating user code? I am wondering what security concerns there are to implementing a PHP evaluator like this: <?php eval($_POST['codeInput']); %> This is in the context of making a PHP sandbox so sanitising against DB input etc. isn't a massive issue. Users destroying the server...
{ "language": "en", "url": "https://stackoverflow.com/questions/131902", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Creating a local mailbox for NIS account What is the way of creating a local mailbox for a user that have a NIS account, but doesn't have any local one? A: I solved the issue by creating a local account with exactly the same login name, UID and GID that it has in NIS. This way a mail box is created for the user and...
{ "language": "en", "url": "https://stackoverflow.com/questions/131915", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Recommendations for a good C#/ .NET based lexical analyser Can anyone recommend a good .NET based lexical analyser, preferably written in C#? A: Download the Visual Studio SDK; it includes a managed parser/lexer generator. (Edit: It was written on my university campus, apparantly :D) A: ANTLR has a C# target A: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/131920", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Why do my hot-deployed files disappear sometimes? (I think Apache eats them) Here's my situation: * *Windows Server *Apache *CruiseControl The last step of my CruiseControl deploy scripts copies the build to Apache's htdocs folder, in a "demos" folder (I believe this is referred to as a "hot deploy"?) All is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/131923", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I read a time value and then insert it into a TimeSpan variable How do I read a time value and then insert it into a TimeSpan variables? A: If I understand you correctly you're trying to get some user input in the form of "08:00" and want to store the time in a timespan variable? So.. something like this? st...
{ "language": "en", "url": "https://stackoverflow.com/questions/131944", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Keyboard shortcut to paste clipboard content into command prompt window (Win XP) Is there a keyboard shortcut for pasting the content of the clipboard into a command prompt window on Windows XP (instead of using the right mouse button)? The typical Shift+Insert does not seem to work here. A: Here's a free tool that...
{ "language": "en", "url": "https://stackoverflow.com/questions/131955", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "305" }
Q: What are the benefits of dependency injection containers? I understand benefits of dependency injection itself. Let's take Spring for instance. I also understand benefits of other Spring featureslike AOP, helpers of different kinds, etc. I'm just wondering, what are the benefits of XML configuration such as: <bean i...
{ "language": "en", "url": "https://stackoverflow.com/questions/131975", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "105" }
Q: Which program in Visual Studio lets me look into DLLs to see its API? See the question. I want to see the methods and classes offered by a DLLs library. A: * *ILSpy is an open-source tool which allows you to browse an assembly's packages and classes and also to decompile code. *Another free-of-charge tool is JetB...
{ "language": "en", "url": "https://stackoverflow.com/questions/131985", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "56" }
Q: How do I get a list of all subdomains of a domain? I want to find out all the subdomains of a given domain. I found a hint which tells me to dig the authoritative Nameserver with the following option: dig @ns1.foo.example example.com axfr But this never works. Has anyone a better idea/approach A: You can only do t...
{ "language": "en", "url": "https://stackoverflow.com/questions/131989", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "273" }
Q: How do you treat the deployment of configuration files on different systems in Subversion? Subversion is a great way to update our web applications on our servers. With a simple svn update all changed files get... well, changed. Except for the omnipresent configuration files such as config.php which hold the databas...
{ "language": "en", "url": "https://stackoverflow.com/questions/131993", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Deployment of custom content type, forms, cqwp, and xsl Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this. Now, I would like to do 2 things. First, I'd like to...
{ "language": "en", "url": "https://stackoverflow.com/questions/132030", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Send To/Mail Recipient from WSH I am trying to implement in windows scripting host the same function as windows Send To/Mail Recipient does. Did not find anything usefull on google except steps to instantiate Outlook.Application and directly calling its methods. I need to go the same path as windows do, as there is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132038", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to send Email through a C++ program? How can I send an email from C++? Is there a good cross-platform (MS Windows, Linux etc) library that I can use? I'm using GCC (cygwin on MS Windows). A: Check out C-Client * *Apache license *Very established library ( makers of Pine email reader, UW-IMAP Server, etc. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132039", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: image archive VS image strip i've noticed that plenty of games / applications (very common on mobile builds) pack numerous images into an image strip. I figured that the advantages in this are making the program more tidy (file system - wise) and reducing (un)installation time. During the runtime of the application...
{ "language": "en", "url": "https://stackoverflow.com/questions/132040", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Servlet for serving static content I deploy a webapp on two different containers (Tomcat and Jetty), but their default servlets for serving the static content have a different way of handling the URL structure I want to use (details). I am therefore looking to include a small servlet in the webapp to serve its own s...
{ "language": "en", "url": "https://stackoverflow.com/questions/132052", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "151" }
Q: Showing the stack trace from a running Python application I have this Python application that gets stuck from time to time and I can't find out where. Is there any way to signal Python interpreter to show you the exact code that's running? Some kind of on-the-fly stacktrace? Related questions: * *Print current c...
{ "language": "en", "url": "https://stackoverflow.com/questions/132058", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "386" }
Q: How do I check that I removed required data only? I have a really big database (running on PostgreSQL) containing a lot of tables with sophisticated relations between them (foreign keys, on delete cascade and so on). I need remove some data from a number of tables, but I'm not sure what amount of data will be really...
{ "language": "en", "url": "https://stackoverflow.com/questions/132070", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is your favourite MATLAB/Octave programming trick? I think everyone would agree that the MATLAB language is not pretty, or particularly consistent. But nevermind! We still have to use it to get things done. What are your favourite tricks for making things easier? Let's have one per answer so people can vote the...
{ "language": "en", "url": "https://stackoverflow.com/questions/132092", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "73" }
Q: How to Google for --depend? The latest makefiles we've received from a third party vendor contain rules with --depend on the end of build rules, so I thought I would look it up on Google, but try as I might, I can't persuade it to display any pages with exactly the characters --depend I've tried surrounding it with ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132105", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Does Windows XP support TLS1.1 with AES256? Is TLS 1.1 support included in Windows XP SP3? A: No TLS 1.1 support is included only in Windows Vista.
{ "language": "en", "url": "https://stackoverflow.com/questions/132113", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Heisenbug: WinApi program crashes on some computers Please help! I'm really at my wits' end. My program is a little personal notes manager (google for "cintanotes"). On some computers (and of course I own none of them) it crashes with an unhandled exception just after start. Nothing special about these computers co...
{ "language": "en", "url": "https://stackoverflow.com/questions/132116", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How to get the real request URL in Struts with Tiles? When you're using Tiles with Struts and do... request.getRequestURL() ...you get the URL to e.g. /WEB-INF/jsp/layout/newLayout.jsp instead of the real URL that was entered/clicked by the user, something like /context/action.do. In newer Struts versions, 1.3.x an...
{ "language": "en", "url": "https://stackoverflow.com/questions/132118", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: What makes a pthread defunct? i'm working with a multi-threaded program (using pthreads) that currently create a background thread (PTHREAD_DETACHED) and then invokes pthread_exit(0). My problem is that the process is then listed as "defunct" and curiously do not seems to "really exists" in /proc (which defeats my d...
{ "language": "en", "url": "https://stackoverflow.com/questions/132121", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is it worth investing time in learning Visual Studio Macro System (usage-creation)? I have used Visual Studio for a long time, but one feature I have never used is the macro system. I saw a post where someone mentioned he used macros (no elaboration) so I was wondering is it really worth the time investing in learni...
{ "language": "en", "url": "https://stackoverflow.com/questions/132128", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: XML namespace problem in Visual Studio generated service reference I'm connecting to a web service hosted by a third-party provider. I've added a service reference in my project to the web service, VS has generated all the references and classes needed. I'm connecting with this piece of code (client name and methods...
{ "language": "en", "url": "https://stackoverflow.com/questions/132131", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: User Interface - Dropdown What is the best way to design an interface so that very long drop down values that get trucated due to size limits do not create a very bad user experience. My question is for web applications. Could you please send your suggestions. Thanks. A: One option is to use 'type-ahead' with postb...
{ "language": "en", "url": "https://stackoverflow.com/questions/132132", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: PHP - Security what is best way? What is the best way to secure an intranet website developed using PHP from outside attacks? A: If it is on an internal network, why is it even possible to get to the app from the outside? Firewall rules should be in place at the very least. A: That's a stunningly thought-provokin...
{ "language": "en", "url": "https://stackoverflow.com/questions/132134", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: IE6 displaying components in a hidden div (when they should be hidden!) Does anyone know if IE6 ever misrenders pages with hidden divs? We currently have several divs which we display in the same space on the page, only showing one at a time and hiding all others. The problem is that the hidden divs components (spec...
{ "language": "en", "url": "https://stackoverflow.com/questions/132136", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Asp.net hosting provider with build capabilities and source control Can you suggest an asp.net 3.5 hosting provider with continuous integration (cctray – nant builds) and source control facilities (svn)? My requirement would be something like this: * *I checkin to a svn branch (say trunk) on the hosting provi...
{ "language": "en", "url": "https://stackoverflow.com/questions/132139", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Loop termination conditions These for-loops are among the first basic examples of formal correctness proofs of algorithms. They have different but equivalent termination conditions: 1 for ( int i = 0; i != N; ++i ) 2 for ( int i = 0; i < N; ++i ) The difference becomes clear in the postconditions: * *The fi...
{ "language": "en", "url": "https://stackoverflow.com/questions/132164", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Vista Serial programmatically How do I obtain the serial number of the installed Vista system? Also is there a tool that does the same thing so I can verify MY results? A: A quick list of tools: http://pcsupport.about.com/od/productkeysactivation/tp/topkeyfinder.htm http://magicaljellybean.com/keyfinder/ http://tec...
{ "language": "en", "url": "https://stackoverflow.com/questions/132166", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to write an AssertTags test in SimpleTest with regex? I wish to test a function that will generate lorem ipsum text, but it does so within html tags. So I cant know in advance the textual content, but i know the html structure. That is what I want to test. And maybe that the length of the texts are within certai...
{ "language": "en", "url": "https://stackoverflow.com/questions/132186", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: PHP: Storing 'objects' inside the $_SESSION I just figured out that I can actually store objects in the $_SESSION and I find it quite cool because when I jump to another page I still have my object. Now before I start using this approach I would like to find out if it is really such a good idea or if there are poten...
{ "language": "en", "url": "https://stackoverflow.com/questions/132194", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "193" }
Q: What is the best operating system for a server? What would you suggest would be the best operating system for a web server? If possible, please enumerate the advantages and disadvantages if there are any... A: Use an operating system you have an administrator account for. A mainstream flavour of Linux is a great ch...
{ "language": "en", "url": "https://stackoverflow.com/questions/132195", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Distributed Processing: C++ equivalent of JTA I'm developing a mission-critical solution where data integrity is paramount and performance a close second. If data gets stuffed up, it's gonna be cata$trophic. So, I'm looking for the C/C++ version of JTA (Java Transaction API). Does anyone know of any C or C++ librari...
{ "language": "en", "url": "https://stackoverflow.com/questions/132210", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Dealing with command line arguments and Spring When I'm writing a Spring command line application which parses command line arguments, how do I pass them to Spring? Would I want to have my main() structured so that it first parses the command line args and then inits Spring? Even so, how would it pass the object hol...
{ "language": "en", "url": "https://stackoverflow.com/questions/132231", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "39" }
Q: What to use for XML parsing / reading in PHP4 Unfortunatly I have to work in a older web application on a PHP4 server; It now needs to parse a lot of XML for calling webservices (custom protocol, no SOAP/REST); Under PHP5 I would use SimpleXML but that isn't available; There is Dom XML in PHP4, but it isn't default ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132233", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Hidden features of C I know there is a standard behind all C compiler implementations, so there should be no hidden features. Despite that, I am sure all C developers have hidden/secret tricks they use all the time. A: C compilers implement one of several standards. However, having a standard does not mean that al...
{ "language": "en", "url": "https://stackoverflow.com/questions/132241", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "141" }
Q: Does a memory leak at unload of a DLL cause a leak in the host process? Consider this case: dll = LoadDLL() dll->do() ... void do() { char *a = malloc(1024); } ... UnloadDLL(dll); At this point, will the 1k allocated in the call to malloc() be available to the host process again? The DLL is statically linking...
{ "language": "en", "url": "https://stackoverflow.com/questions/132242", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Is there any way to use an extension method in an object initializer block in C# The simple demo below captures what I am trying to do. In the real program, I have to use the object initialiser block since it is reading a list in a LINQ to SQL select expression, and there is a value that that I want to read off the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132245", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: WPF animation of items between layouts? I have two different ways of displaying items in a WPF application. The first uses a WrapPanel and the second a vertical StackPanel. I can switch between the two ways of displaying my items by switching the host panel between the two types. This does work but you get an instan...
{ "language": "en", "url": "https://stackoverflow.com/questions/132251", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: When exactly plugin.xml files from dependencies of my plugin are loaded? I vahe eclipse rcp app. In my plugin A I use 3rd party plugin B. In plugin B there is plugin.xml with some extensions. In my plugin A I have added some extensions to extensions defined in plugin B, and it works. Now I tried to overwrite some va...
{ "language": "en", "url": "https://stackoverflow.com/questions/132263", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: A better Eclipse browser? Does anybody know of a free web browser plugin for eclipse that is better than the built-in browser? I searched but couldn't find anything. I know Tasktop has one, but it's not free... A: It was (in 2010): https://marketplace.eclipse.org/content/eclipse-advanced-browser now is integrated w...
{ "language": "en", "url": "https://stackoverflow.com/questions/132265", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: fatal error C1900: Il mismatch between 'P1' version '20060201' and 'P2' version '20050411' I compile my project with VIsual Studio 2005 Express Edition, and get this linking error. Can anyone suggest how to solve that? A: I downloaded VS2005 Service Pack 1 from Microsoft, installed it and it fixed the problem. A: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132270", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Active Directory: Retrieve User information I've got a web application that is running against Windows Authentication using our Active Directory. I've got a new requirement to pull some personal information through from the Active Directory entry. What would be the easiest way to get access to this information? A...
{ "language": "en", "url": "https://stackoverflow.com/questions/132277", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Are there any tips/tricks about using Subsonic with Asp.Net MVC Framework? Is there anyone using Subsonic with asp.net mvc framework? If so, can you tell us something about your experience. Are there tips and tricks that can be shared? A: If you're planning on doing database first design, and you don't need any map...
{ "language": "en", "url": "https://stackoverflow.com/questions/132280", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Is there a standard way to authenticate applications to your web API? I'm looking at building a simple web app that will expose an API that lets third-party (well, written by me, but that's not the point) apps query for and modify user-specific data stored on the site. Obviously I don't want to allow apps to be able...
{ "language": "en", "url": "https://stackoverflow.com/questions/132282", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: SVNkit cannot create SVNRepoitory I am trying to run a diff on two svn urls using SVNkit. The problem is that I get the error when diff.doDiff is called. org.tmatesoft.svn.core.SVNException: svn: Unable to create SVNRepository object for 'http://svn.codehaus.org/jruby/trunk/jruby/src/org/jruby/Finalizable.java...
{ "language": "en", "url": "https://stackoverflow.com/questions/132293", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Last Resource Optimization I'm writing a Resource Adaptor which does not support two phase commit. I know there is an optimization technique called: "Last Resource Optimization". On JBoss your XAResource class should implement LastResource in order to have the optimization. My question is: how this can be done in We...
{ "language": "en", "url": "https://stackoverflow.com/questions/132295", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there an easy way, to Port a Win32 App in Delphi 2009 to .NET? We want migrate from Delphi 7.0 to Delphi 2009, to stay up with a modern IDE and current technology. Our target platform is .NET. What is best way, to achieve this goal? A: Remember that D2009 is a win32 version, and not .net. I suppose you want to m...
{ "language": "en", "url": "https://stackoverflow.com/questions/132299", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Linked Server Performance and options At work we have two servers, one is running an application a lot of people use which has an SQL Server 2000 back end. I have been free to query this for a long time but can't add anything to it such as stored procedures or extra tables. This has lead to us having a second SQL S...
{ "language": "en", "url": "https://stackoverflow.com/questions/132305", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How do I correct the character encoding of a file? I have an ANSI encoded text file that should not have been encoded as ANSI as there were accented characters that ANSI does not support. I would rather work with UTF-8. Can the data be decoded correctly or is it lost in transcoding? What tools could I use? Here is a...
{ "language": "en", "url": "https://stackoverflow.com/questions/132318", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "61" }
Q: Storing objects for locating by x,y coordinates I'm trying to determine a fast way of storing a set of objects, each of which have an x and y coordinate value, such that I can quickly retrieve all objects within a certain rectangle or circle. For small sets of objects (~100) the naive approach of simply storing them...
{ "language": "en", "url": "https://stackoverflow.com/questions/132319", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Obtain an index into a vector using Iterators When iterating over elements of a vector it is preferred to use iterators instead of an index (see Why use iterators instead of array indices?). std::vector<T> vec; std::vector<T>::iterator it; for ( it = vec.begin(); it != vec.end(); ++it ) { // do work } However, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132323", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: With Apache HttpClient, why isn't my connection timeout working? My implementation of httpclient occasionally throws an exception when calling doGetConnection(). However, I have the following timeout set _moHttpClient.setHttpConnectionFactoryTimeout(30000); it looks almost like my timeout is not being picked up. Is...
{ "language": "en", "url": "https://stackoverflow.com/questions/132326", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Full text search engine example in F#? Are there any good examples (websites or books) around of how to build a full text search engine in F#? A: Do you want to write this yourself? Or do you simply need the functionality? If you need the functionality, an embedded/in-memory database with Full Text Search support...
{ "language": "en", "url": "https://stackoverflow.com/questions/132329", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: maximum size for xml files whats your rule of thumb for maximum size for xml files. What if I ask maximum no of records, and one record have 10 values for instance? Another condition is we are loading it from web. A: This may be not the thing you want to hear, but... If you're thinking about the size of your XML fi...
{ "language": "en", "url": "https://stackoverflow.com/questions/132330", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Testing form inputs in PHPUnit What's the best way to test $_GET and $_POST inputs in PHPUnit? I have a class that sanitises input and want to check that it works correctly when processing bogus data. Is there an easy way to set up the form variables in PHPUnit or should I just pass off the validation to a secondar...
{ "language": "en", "url": "https://stackoverflow.com/questions/132342", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Double generic constraint on class in Java: extends ConcreteClass & I Is there a way to define a generic constraint in Java which would be analogous to the following C# generic constratint ? class Class1<I,T> where I : Interface1, Class2 : I I'm trying to do it like this: class Class1<I extends Interface1, T extend...
{ "language": "en", "url": "https://stackoverflow.com/questions/132353", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How to read file content into istringstream? In order to improve performance reading from a file, I'm trying to read the entire content of a big (several MB) file into memory and then use a istringstream to access the information. My question is, which is the best way to read this information and "import it" into th...
{ "language": "en", "url": "https://stackoverflow.com/questions/132358", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "43" }
Q: How can Google be so fast? What are the technologies and programming decisions that make Google able to serve a query so fast? Every time I search something (one of the several times per day) it always amazes me how they serve the results in near or less than 1 second time. What sort of configuration and algorithms...
{ "language": "en", "url": "https://stackoverflow.com/questions/132359", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "89" }
Q: Invert Regex Matches How would I invert .NET regex matches? I want to extract only the matched text, e.g. I want to extract all IMG tags from an HTML file, but only the image tags. A: That has nothing to do with inverting the Regexp. Just search for the relevant Text and put it in a group. A: I'm with David H.: I...
{ "language": "en", "url": "https://stackoverflow.com/questions/132367", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to gain SSL load balancing? I have to deploy my ASP.NET application into two seperated IIS servers. My application works over HTTPS/TLS. My ASP code has to handle client SSL certificate and it means I can't use simple forward load balancers, because I will never get such certificate from nginx or Apache Load Bal...
{ "language": "en", "url": "https://stackoverflow.com/questions/132383", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: php - proc_open (or other function that works) I need to do some command lines through a browser. What I need to do in a command-line would be: $login <login name> <password> $passwd <old password> <new password> <retype new password> So, how can I do this using the proc_open function? Or should I use another funct...
{ "language": "en", "url": "https://stackoverflow.com/questions/132384", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Passing timestamp parameters in SQLAnalyzer to debug stored procedures Hi I'm trying to debug a stored procedure through SQL Analyzer and one of the parameters is a timestamp datatype. If I wanted to pass 0x00000001410039E2 through as a parameter how would i do this? When I pass 0x00000001410039E2 I get a string tru...
{ "language": "en", "url": "https://stackoverflow.com/questions/132390", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Get back the output of os.execute in Lua When I do an "os.execute" in Lua, a console quickly pops up, executes the command, then closes down. But is there some way of getting back the console output only using the standard Lua libraries? A: If you have io.popen, then this is what I use: function os.capture(cmd, ra...
{ "language": "en", "url": "https://stackoverflow.com/questions/132397", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "52" }
Q: Free alternative to RegexBuddy Are there any good alternatives that support writing regexps in different flavors and allow you to test them? A: Here's a list of the Regex tools mentioned across the threads: Regulator Expresso .NET Regular Expression Designer Regex-Coach larsolavtorvik online tool Regex Pal Regular ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132405", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "40" }
Q: JAXB 2 in an Oracle 10g Webapp I have a web application that uses JAXB 2. When deployed on an Oracle 10g Application Server, I get errors as soon as I try to marshal an XML file. It turns out that Oracle includes JAXB 1 in a jar sneakily renamed "xml.jar". How I can force my webapp to use the version of the jaxb...
{ "language": "en", "url": "https://stackoverflow.com/questions/132409", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Translate algorithmic C to Python I would like to translate some C code to Python code or bytecode. The C code in question is what i'd call purely algorithmic: platform independent, no I/O, just algorithms and in-memory data structures. An example would be a regular expression library. Translation tool would process...
{ "language": "en", "url": "https://stackoverflow.com/questions/132411", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Java utility to validate string against NMTOKEN I have some application code which generates XML documents, which are then validated against an XML Schema. The schema makes use of NMTOKEN types, and occasionally, the generated XML contains string values which are illegal NMTOKENs (e.g. they contain spaces or weird p...
{ "language": "en", "url": "https://stackoverflow.com/questions/132432", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I get user informations from a session id in ASP.NET? In an asp.net application, i would like to use a webservice to return the username associated with the session id passed as a parameter. We're currently using InProc session store. Is it possible to do this ? Edit: what i'm trying to do is get information ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132437", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is Java the best language for Mobile App Devlopment? I was wondering what are the benefits of using anything else but Java for Mobile Application Development. A: I do think that yes, Java is the most common language for devices, with two exceptions: * *Windows mobile applications, that are frequently built in C+...
{ "language": "en", "url": "https://stackoverflow.com/questions/132440", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Workaround for Spring/Hibernate due to non-standard behaviour of UNIQUE constraint in MS SQL There is a UNIQUE database constraint on an index which doesn't allow more than one record having identical columns. There is a piece of code, managed by Hibernate (v2.1.8), doing two DAO getHibernateTemplate().save( theObj...
{ "language": "en", "url": "https://stackoverflow.com/questions/132444", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Direct casting vs 'as' operator? Consider the following code: void Handler(object o, EventArgs e) { // I swear o is a string string s = (string)o; // 1 //-OR- string s = o as string; // 2 // -OR- string s = o.ToString(); // 3 } What is the difference between the three types of casting (okay, the 3...
{ "language": "en", "url": "https://stackoverflow.com/questions/132445", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "839" }
Q: Wrong number of arguments error with TestMailer I'm running a strange problem sending emails. I'm getting this exception: ArgumentError (wrong number of arguments (1 for 0)): /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:642:in `initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/li...
{ "language": "en", "url": "https://stackoverflow.com/questions/132449", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Keyword highlighting on selection in Visual Studio 2008 A little while ago I managed to get Visual Studio 2008 (C++) into a state where, if I would select a keyword (or any symbol for that matter), by either double clicking on it or highlighting it, all other instances of that symbol within the current file would be...
{ "language": "en", "url": "https://stackoverflow.com/questions/132452", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Is it possible to upload entire folders in ASP.NET? The file upload control in asp.net does not allow me to select a folder and enables me to select only the files. Is there any way in which I can select a folder (obviously without using the file upload control). Why I want to select the folder is basically to store...
{ "language": "en", "url": "https://stackoverflow.com/questions/132465", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to perform string Diffs in Java? I need to perform Diffs between Java strings. I would like to be able to rebuild a string using the original string and diff versions. Has anyone done this in Java? What library do you use? String a1; // This can be a long text String a2; // ej. above text with spelling correctio...
{ "language": "en", "url": "https://stackoverflow.com/questions/132478", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "57" }
Q: Regex to remove conditional comments I want a regex which can match conditional comments in a HTML source page so I can remove only those. I want to preserve the regular comments. I would also like to avoid using the .*? notation if possible. The text is foo <!--[if IE]> <style type="text/css"> ul.menu ul li{ ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132488", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Designing for change I'm pretty sure most of us are familiar with the concept of a project's requirements changing after it starts, this becomes more and more of an issue the less the client knows about how things work and the closer you work with them. How then can I design a system (specifically a website but gene...
{ "language": "en", "url": "https://stackoverflow.com/questions/132489", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Best Practice: Potentially huge Winform grid? I am writing an application in VB.NET 2008 that manages software deployment and I want to display a "deployment overview" grid. The grid will be populated with the names of each application (top row) and the name of each workstation (1st column). The remaining cells will...
{ "language": "en", "url": "https://stackoverflow.com/questions/132496", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Webservices client and ssl I have a Java client that calls a web service at the moment using the Http protocol. When i try to use the Https protocol i keep getting this error java.io.IOException: DerInputStream.getLength(): lengthTag=127, too big. Any ideas what could be up? Thanks Damien A: Due to american export ...
{ "language": "en", "url": "https://stackoverflow.com/questions/132498", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I sort a list of integers using only one additional integer variable? How to sort list of values using only one variable? A: A solution in C: #include <stdio.h> int main() { int list[]={4,7,2,4,1,10,3}; int n; // the one int variable startsort: for (n=0; n< sizeof(list)/sizeof(int)-1; ++n)...
{ "language": "en", "url": "https://stackoverflow.com/questions/132501", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to reformat multi-line comments in Eclipse PDT? In Eclipse PDT, Ctrl-Shift-F reformats code. However, it doesn't modify comments at all. Is there some way to reformat ragged multi-line comments to 80 characters per line (or whatever)? i.e. convert // We took a breezy excursion and // gathered Jonquils from th...
{ "language": "en", "url": "https://stackoverflow.com/questions/132504", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Given a date range (start and end dates), how can I count the days, excluding specified days of the week in .Net? I'm creating a UI that allows the user the select a date range, and tick or un-tick the days of the week that apply within the date range. The date range controls are DateTimePickers, and the Days of the...
{ "language": "en", "url": "https://stackoverflow.com/questions/132507", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: .NET Configuration (app.config/web.config/settings.settings) I have a .NET application which has different configuration files for Debug and Release builds. E.g. the debug app.config file points to a development SQL Server which has debugging enabled and the release target points to the live SQL Server. There are al...
{ "language": "en", "url": "https://stackoverflow.com/questions/132544", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "164" }
Q: How to debug multithreaded midlet app in EclipseMe? When debugging multithreaded midlet in the EclipseMe, the breakpoints work for me only in the main thread but not I other threads. Any ideas? A: A wild guess, have you tried putting Thread.sleep() in the main thread and see whether the debugger enters the other th...
{ "language": "en", "url": "https://stackoverflow.com/questions/132563", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What's the difference between an element and a node in XML? I'm working in Java with XML and I'm wondering; what's the difference between an element and a node? A: A node is the base class for both elements and attributes (and basically all other XML representations too). A: Element is the only kind of node that c...
{ "language": "en", "url": "https://stackoverflow.com/questions/132564", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "400" }
Q: "Son of Suckerfish" CSS Menu - sub menus not closing in IE7 Despite my most convincing cries to the contrary, I was recently forced to implement a horizontal drop-down navigation system, so I opted for the friendliest one I could find - Son of Suckerfish. I tested in various browsers on my machine and all appeared t...
{ "language": "en", "url": "https://stackoverflow.com/questions/132566", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Installing mysql problem Running OS X Leopard an MacBook Pro from Jan. 2008. I used to run mysql server from a package but then rails started putting a warning that I should install mysql from gem: gem install mysql It did not work, I got the following error message: Building native extensions. This could take a wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/132585", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: IE6 + IE7 on a clean XP install We need to test a website in both IE6 and IE7. We've had bugs appear running on actual windows machines that aren't visible under vmware (?!), so we have an actual windows laptop to do this - but only one. Is it possible to install IE6 and IE7 side-by-side in such a way that they abso...
{ "language": "en", "url": "https://stackoverflow.com/questions/132588", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }