text
string
meta
dict
Q: Using "friend"-declarations for unit testing. Bad idea? [Of course, the question is not restricted to a specific "friend" implementation, feel free though to point out implementation specifics if relevant] Reading through the unanswered questions, I stumbled upon the InternalsVisibleTo attribute: Specifies that typ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261177", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Can one convert a MySQL connection to a PDO connection? I work on a app which has only one way to get a working DB connection: a function that returns a MySQL connection resource. Is there any way for me to convert that MySQL connection to a PDO MySQL connection? I don't have access to the MySQL server in any other ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261186", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: conditional formatting in rails partials I am rendering a rails partial and I want to alternate the background color when it renders the partial. I know that is not super clear so here is an example of what I want to do: Row One grey Background Row Two yellow background Row Three grey Background Row Four y...
{ "language": "en", "url": "https://stackoverflow.com/questions/261190", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Change in behavior for TStringStream.ReadString in D2009? I noticed today that in D2009 (with update 1), TStringStream.ReadString does not move the Position in the Stream anymore like it used to do up to D2007. So, looping on MyStringStream.ReadString(10) would always read the 1st 10 chars of the stream instead of m...
{ "language": "en", "url": "https://stackoverflow.com/questions/261201", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Forms based security and uploading asp.net web site I've written a little web site in my effort to learn vb.net and asp.net, fairly happy with it so rented some space and uploaded it, it was written using asp.net express edition 2008 and sql server express .... I've uploaded it and I've found that it was written in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261202", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Can I serialize map of STL in MFC using CArchive? I need to write the content of a map (key is ID of int, value is of self-defined struct) into a file, and load it from the file later on. Can I do it in MFC with CArchive? Thank you! A: In MFC, I believe it's easiest to first serialize the size of the map, and then ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261215", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Class Variables in Javascript I'm having a bit of trouble trying to get class variables to work in javascript. I thought that I understood the prototype inheritance model, but obviously not. I assumed that since prototypes will be shared between objects then so will their variables. This is why this bit of code ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261219", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: How do I use CSS in Django? I am creating my application using Django, and am wondering how I can make Django use my CSS file? What settings do I need to do to make Django see the css file? NB: On a local machine A: The official django docs didn't help me. Hope the blog post "Django: How to serve static files" help...
{ "language": "en", "url": "https://stackoverflow.com/questions/261223", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "113" }
Q: Userland autoboxing? Is it possible to implement autoboxing for your own classes? To illustrate my example, this is what I might want to write: Foo foo = "lolcat"; And this is what Java would do (as per my own definitions, somewhere, somehow), under the hood: Foo foo = new Foo(); foo.setLolcat("lolcat"); So, is th...
{ "language": "en", "url": "https://stackoverflow.com/questions/261230", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Help me write a binary search for boundary values (extracting sub lists) Let's say I have an array of lots of values (C++ syntax, sorry): vector<double> x(100000); This array is sorted such that x[n] > x[n-1]. I would like a function to retrieve an array of all values in the range [a, b] (that's inclusive). Some in...
{ "language": "en", "url": "https://stackoverflow.com/questions/261234", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there a planned release date for Entity Framework 2.0? I am currently looking at different ORM solutions for a project that is planned for this spring. Entity Framework is one of the products I am looking closer at, but EF 2.0 would be quite a lot more interesting. Has there been any indications to when version 2...
{ "language": "en", "url": "https://stackoverflow.com/questions/261235", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Creating an IIS 6.0 Application Pool using Powershell How do I create an Application Pool on IIS 6.0 using a PowerShell script? This is what I have come up with so far ... $appPool = [wmiclass] "root\MicrosoftIISv2:IIsApplicationPool" Thanks A: Thought I might share the script I came up with. Thanks to goes to Ste...
{ "language": "en", "url": "https://stackoverflow.com/questions/261237", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to insert the symbol 'Infinite' in Excel programmatically? How can I create the "Infinite" symbol in an excel sheet programmatically? Preferably from Java...but other tips are also welcome. Thx. A: The "Infinity Symbol" character is in codepoint 0x221E in unicode. The VBA code to do it would be this: ActiveShee...
{ "language": "en", "url": "https://stackoverflow.com/questions/261246", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Making SVN's externals definitions fool-proof? I have a set of applications that all rely on a cross-platform library (in-house development), and everything is stored in subversion. Now, this library is part of every app and as such a copy of it has to be in each app's working directory. In order to be able to go b...
{ "language": "en", "url": "https://stackoverflow.com/questions/261254", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: "There is no disk in the drive" in an application that doesn't require it Our application is written in C++ and used on Windows XP. On some client machines with only a C: drive, an error pop ups when the application starts: There is no disk in the drive. Please insert a disk into drive "D" If they hit "Continue" o...
{ "language": "en", "url": "https://stackoverflow.com/questions/261265", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Compare two consecutive elements in std::list I'd like to compare two consecutive elements in a std::list while iterating through the list. What is the proper way to access element i+1 while my iterator is at element i? Thanks Cobe A: The simplest way would be to hold two iterators (since you'll have to stop at the...
{ "language": "en", "url": "https://stackoverflow.com/questions/261271", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How do I use MSTest without Visual Studio? Does MSTest have standalone GUI similar to nUnit that lets me use it and run test without visual studio? What is the official site for MSTest where I can learn more about how to use it? A: Use Gallio as your test runner... then its not so much of a drama when you enventual...
{ "language": "en", "url": "https://stackoverflow.com/questions/261290", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "52" }
Q: WinSNMP v1traps I'm using WinSNMP in c++ to send snmp traps. For backwards compatibility I’m required to send v1 snmp traps. WinSNMP works with v2 traps but is capable of converting those v2 traps to v1 when sending the trap. I use SnmpSetTranslateMode(SNMPAPI_UNTRANSLATED_V1) in order to do that. I also added the s...
{ "language": "en", "url": "https://stackoverflow.com/questions/261294", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Batch closes prematurely on a for /f command I have a batch file (in windows XP, with command extension activated) with the following line: for /f %%s in ('type version.txt') do set VERSION=%%s On some computer, it works just fine (as illustrated by this SO question), but on other it kills cmd (the console window j...
{ "language": "en", "url": "https://stackoverflow.com/questions/261296", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How do I reference an unsigned assembly from a VSTO Word Doc project? I created a new project in VS2008. Project type Visual C# > Office > 2007 > Word 2007 Document Added some code.. got Word to do a few jumps through some custom hoops.. all fine. Now I need to reference another assembly (CopyLocal as false) which...
{ "language": "en", "url": "https://stackoverflow.com/questions/261301", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: what is the difference between re-entrant function and recursive function in C? In C I know about the recursive function but I heard about the re-entrant function.What is that? And whats the difference between them? A: Here is it: * *A reentrant function can be called simultaneously by multiple threads provided...
{ "language": "en", "url": "https://stackoverflow.com/questions/261311", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: MS-Access reports shows design view upon execution I have created a report in MS Access report and write some VBA code to retrive data and show the report in MS-Word format. But while generate the report on runtime, the report first show or flash the report design view for few seconds and the report will get genera...
{ "language": "en", "url": "https://stackoverflow.com/questions/261316", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is the (single) best online source for learning OpenOffice.org scripting API I am using OpenOffice.org for most of my not so very frequent Office Suite needs and most of the time it is more than adequate replacement for it's commercial alternative. Where it falls short though is the scripting API. I am yet to f...
{ "language": "en", "url": "https://stackoverflow.com/questions/261318", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Is it wrong to use auto_ptr with new char[n] If I declare a temporary auto deleted character buffer using std::auto_ptr<char> buffer(new char[n]); then the buffer is automatically deleted when the buffer goes out of scope. I would assume that the buffer is deleted using delete. However the buffer was created using ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261336", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: What is the best way to insert HTML via PHP? Talking from a 'best practice' point of view, what do you think is the best way to insert HTML using PHP. For the moment I use one of the following methods (mostly the latter), but I'm curious to know which you think is best. <?php if($a){ ?> [SOME MARKUP] <?php } e...
{ "language": "en", "url": "https://stackoverflow.com/questions/261338", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: Get full request url, including parameters in controller How do I get the complete request URL (including query string) in my controller? Is it a matter of concatenating my URL and form parameters or is there a better way. I checked this question, but it seems not to be applicable to MVC. Correct me if I'm wrong. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261345", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "39" }
Q: How can I access the ServletContext from within a JAX-WS web service? I want to share an object between my servlets and my webservice (JAX-WS) by storing it as a servlet context attribute. But how can I retrieve the servlet context from a web service? A: The servlet context is made available by JAX-WS via the messa...
{ "language": "en", "url": "https://stackoverflow.com/questions/261348", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "41" }
Q: MDI Parent Menu and Child Menu I am using VB.Net on Winforms Development developing an MDI application. In my Parent form, I have a menu strip. In my child forms, I also have a menu strip attached to each form, which invokes a different set of command when accessed. Is it possible then that in an MDI form, the chi...
{ "language": "en", "url": "https://stackoverflow.com/questions/261350", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Browser back button restores empty fields I have a web page x.php (in a password protected area of my web site) which has a form and a button which uses the POST method to send the form data and opens x.php#abc. This works pretty well. However, if the users decides to navigate back in Internet Explorer 7, all the fi...
{ "language": "en", "url": "https://stackoverflow.com/questions/261351", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: COM, VARIANT containing BSTR. Who allocates? OK, so I couldn't really think of an apropos title that summarizes this. The IPrintPipelinePropertyBag interface has the method AddProperty which aptly enough "adds a property to a property bag." http://msdn.microsoft.com/en-us/library/aa506384.aspx AddProperty( [in, s...
{ "language": "en", "url": "https://stackoverflow.com/questions/261357", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How to update HTML "select" box dynamically in IE I've got an HTML "select" element which I'm updating dynamically with code something like this: var selector = document.getElementById('selectorId'); for (var i = 0; i < data.length; ++i) { var opt = document.createElement('option'); opt.value = data[i].id; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261362", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I use 'Order By' to sort on a property of an inherited type in LINQ-to-SQL? I have a fairly standard inheritance situation in my current LINQ-to-SQL project. I have a base class called 'Party' and classes called 'Individual' and 'Organisation' which inherit from it. What I want to achieve seems (and probably ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261366", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Find the number of s in a without using id or name How do you calculate the number of <td> elements in a particular <tr>? I didn't specify id or name to access directly, we have to use the document.getElementsByTagName concept. A: You can use something like the following: var rowIndex = 0; // rowindex, in this cas...
{ "language": "en", "url": "https://stackoverflow.com/questions/261368", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Efficient method to enumerate cells in an Excel workbook using c# What is the most efficient way to enumerate every cell in every sheet in a workbook? The method below seems to work reasonably for a workbook with ~130,000 cells. On my machine it took ~26 seconds to open the file and ~5 seconds to enumerate the cells...
{ "language": "en", "url": "https://stackoverflow.com/questions/261374", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Simple MySQL INSERT error No doubt I'm missing something really simple here but I just can't see the problem with this query which is producing the following error: SQL query: INSERT INTO ads( ad_id, author, ad_date, category, title, description, condition, price, fullname, telephone, email, status, pho...
{ "language": "en", "url": "https://stackoverflow.com/questions/261375", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: LNK2001 error when compiling apps referencing STLport-5.1.4 with VC++ 2008 I apologize in advance for the long post... I used to be able to build our VC++ solutions (we're on VS 2008) when we listed the STLPort include and library directories under VS Menu > Tools > Options > VC++ Directories > Directories for Inclu...
{ "language": "en", "url": "https://stackoverflow.com/questions/261377", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Preventing a feature from being upgraded I have a tool which automatically creates InstallShield installers (InstallScript, not MSI), and my main problem at the moment is that when upgrading an installation, I need a way to prevent features from being upgraded. During the installation, I want to check the version of...
{ "language": "en", "url": "https://stackoverflow.com/questions/261378", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to put an image (say, PNG) on a graphics in Flex 3? I'm new to Flex, and I'm trying to write a simple application. I have a file with an image and I want to display this image on a Graphics. How do I do this? I tried [Embed]-ding it and adding as a child to the component owning the Graphics', but I'm getting a "...
{ "language": "en", "url": "https://stackoverflow.com/questions/261386", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is the best practice for using "get" in method names? I've noticed in many places in Java (C# included), that many "getter" methods are prefixed with "get" while many other aren't. I never noticed any kind of pattern Sun seems to be following. What are some guidelines or rules for using "get" in getter method n...
{ "language": "en", "url": "https://stackoverflow.com/questions/261387", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Is there an SVN:externals equivalent in TFS2005? Does anybody know if there is an SVN:externals property equivalent in TFS2005? Definition of an SVN External property Sometimes it is useful to construct a working copy that is made out of a number of different checkouts. For example, you may want different subdirecto...
{ "language": "en", "url": "https://stackoverflow.com/questions/261392", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Accessing another database with dynamic name in SQL Server There are two databases in SQL Server 2005: One called "A" and another one called "A_2". "A" is a variable name to be entered by the user, the "_2" prefix for the second database is always known. (So databases could be "MyDB" and "MyDB_2", etc) How to access...
{ "language": "en", "url": "https://stackoverflow.com/questions/261405", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Mapping multi-Level inheritance in Hibernate Currently I have a structure like this: A | +--B | +--C It's mapped with one table per subclass using joined tables. For historic reasons I also use a discriminator, so the current situation is as described in Section 9.1.3 of the Hibernate manual. Question: How do I ext...
{ "language": "en", "url": "https://stackoverflow.com/questions/261407", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: What Ubuntu/Debian packages do I need to build with Java+OpenGL? I want to use JOGL (for Clojure, not Java). There seems to be quite a combination of alternatives for JDKs and OpenGL bindings, and I don't want to use a scatter gun approach and clog up my machine installing too much cruft. Please help me get started!...
{ "language": "en", "url": "https://stackoverflow.com/questions/261408", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What registers to save in the ARM C calling convention? It's been a while since I last coded arm assembler and I'm a little rusty on the details. If I call a C function from arm, I only have to worry about saving r0-r3 and lr, right? If the C function uses any other registers, is it responsible for saving those on ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261419", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "65" }
Q: start specific iis 6.0 website via script I've googled around and can't find a clear answer. I simply want to start some of my iis 6.0 websites via a script that will be run on start up. anyone got any tips for that? A: Well, I've googled around, and this is what I've found. Snippet : cd \inetpub\adminscripts C...
{ "language": "en", "url": "https://stackoverflow.com/questions/261420", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: VisualStudio: How to save the obj folder somewhere else Does anyone know how to tell VS(2008) where to save the obj folder when building the solution? We have it save the bin folder to another path in order to keep the source file folders small (ie. emailable), but can't find any way to tell it to do the same with o...
{ "language": "en", "url": "https://stackoverflow.com/questions/261422", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "61" }
Q: Event handling in ASP.net How can we handel key pressed event in asp.net A: Presumably you mean from the website itself. ASP.NET has no support for this, you will need to capture the keypress with javascript and then send it to ASP.NET via ajax or lightweight callbacks. A: You have to handle this client side, in J...
{ "language": "en", "url": "https://stackoverflow.com/questions/261423", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Best way to stop a JTree selection change from happening? I have a dialog where each entry in a JTree has its corresponding options in a different panel, which is updated when the selection changes. If options for one of the entries is set to an invalid state, when the user attempts to change to a different entry in...
{ "language": "en", "url": "https://stackoverflow.com/questions/261424", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Entry point for Java applications: main(), init(), or run()? So far I've been using public void run() {} methods to execute my code in Java. When/why might one want to use main() or init() instead of run()? A: This is a peculiar question because it's not supposed to be a matter of choice. When you launch the JVM, y...
{ "language": "en", "url": "https://stackoverflow.com/questions/261428", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "44" }
Q: Detect whether adobe reader is installed using VB code I want to detect whether adobe reader is installed using VB6. Also if detected that it's not installed, what would be the best solution? A: There are crude ways (checking for files on Program files directory), but I'd recommend you declare full-registry functio...
{ "language": "en", "url": "https://stackoverflow.com/questions/261430", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to find the length of unsigned char* in C I have a variable unsigned char* data = MyFunction(); how to find the length of data? A: You will have to pass the length of the data back from MyFunction. Also, make sure you know who allocates the memory and who has to deallocate it. There are various patterns for t...
{ "language": "en", "url": "https://stackoverflow.com/questions/261431", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Swing Matisse GUI - cannot add custom made bean to "Other components" I made a custom ValueObject class with properties (getters/setters) and I need this class for data binding of elements on form. So I want to drag it to "other components" on matisse editor so I can bind it - and nothing happens.... Any similar exp...
{ "language": "en", "url": "https://stackoverflow.com/questions/261434", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Insert/Update on SQL Server 2005 without using Stored Procedures I'm trying to do the classic Insert/Update scenario where I need to update existing rows in a database or insert them if they are not there. I've found a previous question on the subject, but it deals with stored procedures, which I'm not using. I'd l...
{ "language": "en", "url": "https://stackoverflow.com/questions/261449", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Using backticks around field names After reading a couple of answers and comments on some SQL questions here, and also hearing that a friend of mine works at a place which has a policy which bans them, I'm wondering if there's anything wrong with using backticks around field names in MySQL. That is: SELECT `id`, `na...
{ "language": "en", "url": "https://stackoverflow.com/questions/261455", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "180" }
Q: WCF behind load balancer - how to setup We have a couple of web servers using load balancer. Machines are running IIS6 on port 81. Externally, site is accessable using port 80. External name and name of the machine are different. We're getting System.ServiceModel.EndpointNotFoundException: The message with To '<url...
{ "language": "en", "url": "https://stackoverflow.com/questions/261463", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What's the best way to perform system tasks from Ruby on Rails? I am building a small system administration web application (think Web-Min, but in RoR) and I need to be able to access system parameters from my Ruby code. For instance, I want to allow the user to change the hostname, time zone, or network config of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261490", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to build Python C extension modules with autotools Most of the documentation available for building Python extension modules uses distutils, but I would like to achieve this by using the appropriate python autoconf & automake macros instead. I'd like to know if there is an open source project out there that does...
{ "language": "en", "url": "https://stackoverflow.com/questions/261500", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to find all open/active connections in DB2 (8.x) I'm currently working with Db2 Enterprise Server V 8.2 with FixPak 10 And I want to retrieve list of all the open active connections with an instance. In Oracle there is a utility program called "Top Session" which does the similar task. Is there any equivalent in...
{ "language": "en", "url": "https://stackoverflow.com/questions/261512", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Batch file script to remove special characters from filenames (Windows) I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does,...
{ "language": "en", "url": "https://stackoverflow.com/questions/261515", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Reusing object files in Visual Studio 2005 Here's the situation: I have one VS2005 solution with two projects: MyDll (DLL), MyDllUnitTest (console EXE). In MyDll I have a class called MyClass which is internal to the DLL and should not be exported. I want to test it in MyDllUnitTest, so I added a test suite class ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/261518", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is the command to match brackets in Emacs? What is the command to match brackets in Emacs (the equivalent of the % command in Vim)? A: See show-paren-mode as described in 5.27 How do I show which parenthesis matches the one I'm looking at? A: C-M-f, or M-x forward-sexp, goes forward to the closing brace, or t...
{ "language": "en", "url": "https://stackoverflow.com/questions/261522", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "45" }
Q: How does Visual Studio's source control integration work with Perforce? We're using Perforce and Visual Studio. Whenever we create a branch, some projects will not be bound to source control unless we use "Open from Source Control", but other projects work regardless. From my investigations, I know some of the thing...
{ "language": "en", "url": "https://stackoverflow.com/questions/261525", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "72" }
Q: Storing images on web server. How many copies? What size? My web application allows users to upload images of items they are planning on selling. I'm trying to find a good compromise between having the images large enough and detailed enough for buyers to get an idea of the condition of the item and having the imag...
{ "language": "en", "url": "https://stackoverflow.com/questions/261528", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can't upload changes to ASP.NET - publish function doesn't upload changes I have developed an asp.net application and when using the publish tool in Visual Studio 2008, my changes don't get uploaded to the server (ie new css files). I made a thread about this on asp.net and was told to clear my local settings folder...
{ "language": "en", "url": "https://stackoverflow.com/questions/261531", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: PHP SimpleXML, CodeIgniter and Apache with Suhosin I have an application I am writing in PHP5, using the CodeIgniter framework. I have it running on both Windows (using Xampp) and Ubuntu (using standard Apache, PHP, MySQL stack). I have a form, that takes XML, parses it (using simpleXML) and posts the results into a...
{ "language": "en", "url": "https://stackoverflow.com/questions/261534", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Get the metabase path for an IIS entry (Installation stopped because the specified path is not a valid web application) I'm by no means a sysadmin so please correct me if I'm wrong. I want to run aspnet_regiis.exe -s. This requires the metabase path of my website. How do I find this metabase path? A: Just run aspne...
{ "language": "en", "url": "https://stackoverflow.com/questions/261535", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: HTTP Status 504 I'm getting the following error when my win32 (c#) app is calling web services. The request failed with HTTP status 504: Gateway timeout server response timeout. I understand 'I think' that this is because the upstream request does not get a response in a timely fashion. But my question is this? Ho...
{ "language": "en", "url": "https://stackoverflow.com/questions/261536", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "78" }
Q: Does WCF suppress first-chance exceptions? I've got a WCF service that uses a LinqToSql DataContext to fetch some information out of a database. The return type of the operation is IEnumerable<DomainObject>, and I have a helper method that converts from the Table-derived LINQ object to a WCF data contract like so: [...
{ "language": "en", "url": "https://stackoverflow.com/questions/261539", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to drop a validation set in included module? Is there a way to drop a validation that was set in Rails plugin (or included module)? Let's say I have some model with module included in it: class User < ActiveRecord::Base include SomeModuleWithValidations # How to cancel validates_presence_of :something here? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261543", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Asp:RadioButtonList still posts back to server even when client validation fails? This query is related to this one I asked yesterday. I have a radio button list on my asp.net page defined as follows: <asp:RadioButtonList ID="rdlSortBy" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" AutoPostBack...
{ "language": "en", "url": "https://stackoverflow.com/questions/261547", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Share .obj files between different configurations My goal is to integrate testing into my development environment (as post-build step). I don't want to interfere with the DLLs that are generated in debug and release, so i plan to create new configurations for the project. But i don't want to compile every source fil...
{ "language": "en", "url": "https://stackoverflow.com/questions/261548", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: how to insert value into a cell in Excel sheet using asp.net How to insert data into a particular cell in a Excel Work sheet in Asp.net A: I think you need to provide a little more information.. Off the top of my head, you could approach this a number of different ways : 1) MS Office Automation - Using javascript ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261554", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: What do I need to read to understand how git works? I would like to understand the way git works from a architects point of view. How are files stored, how are versions kept and how do changes happen (branches, merges, etc.)? I am not searching for information how to use it. (I already found a lot of pages with tuto...
{ "language": "en", "url": "https://stackoverflow.com/questions/261557", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "101" }
Q: Higher color depth for MFC toolbar icons? I was wondering how to make a toolbar in MFC that used 24bit or 256 colour bitmaps rather than the horrible 16 colour ones. Can anyone point me in the direction of some simple code? Thanks A: The reason this happens is that the MFC CToolbar class uses an image list internal...
{ "language": "en", "url": "https://stackoverflow.com/questions/261559", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: IPC with Message Passing I'm looking for suggestions on possible IPC mechanisms that I can implement in my self-made OS for an AVR32 board. My current choice is implementing the massage passing mechanism described in the books written by Tanenbaum. Is this a good choice? Are there easier way to implement IPC? Than...
{ "language": "en", "url": "https://stackoverflow.com/questions/261560", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Using SendMessage or PostMessage for control-to-host-app communication in C#? Found this article and a similar question was aked on stackoverflow.com as well http://www.codeproject.com/KB/miscctrl/AppControl.aspx I figured a way to communicate between the control and the exe that it is hosting would be to use the li...
{ "language": "en", "url": "https://stackoverflow.com/questions/261561", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Function parameters: Copy or pointer? I'm kind of new to C++ and have some questions, this is one of them. Is there ANY reason when you are using a function that takes in one or several parameters, parameters of which you know will always be stored in a variable before the function call, to pass a copy of the variab...
{ "language": "en", "url": "https://stackoverflow.com/questions/261567", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: jQuery Controlling Single DIVs With the Same Class (Siblings?) I am building a FAQ module for my site and I want to be able to control single elements on the page even though they all have the same class. I believe this comes under siblings which I am not yet familiar with. Basically I want the user to be able to cl...
{ "language": "en", "url": "https://stackoverflow.com/questions/261572", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Best algorithm for detecting cycles in a directed graph Is there an efficient algorithm for detecting cycles within a directed graph? I have a directed graph representing a schedule of jobs that need to be executed, a job being a node and a dependency being an edge. I need to detect the error case of a cycle within ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261573", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "449" }
Q: Overflow when calculating a const in VBA This declaration causes an overflow in VBA: Const OVERFLOWS As Long = 10 * 60 * 60 whereas setting the value directly is fine: Const COMPILES_OK As Long = 36000 How do you persuade VBA to treat literal integers as longs? Thanks A: http://support.microsoft.com/kb/191713 is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261580", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How to get the values of the radiobuttonlist which will be selected in nested datalist to use it in multi insert later using c# asp.net 2 How to get the values of the radiobuttonlist which will be selected in nested datalist to use it in multi insert later. I want to get all the values of the controls of the radiobu...
{ "language": "en", "url": "https://stackoverflow.com/questions/261586", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Should I rewrite my DSP routines in C/C++ or I'm good with C# unsafe pointers? I'm currently writing a C# application that does a lot of digital signal processing, which involves a lot of small fine-tuned memory xfer operations. I wrote these routines using unsafe pointers and they seem to perform much better than I...
{ "language": "en", "url": "https://stackoverflow.com/questions/261591", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Finer granularity of SQL Exceptions? In C# Is there a way of getting a finer granularity with SQL exceptions? I'm aware that an aweful lot can go wrong but I want to deal with certain cases differently and parsing the Error message doesn't seem to be very elegant. Also Are the error messages created by the framework...
{ "language": "en", "url": "https://stackoverflow.com/questions/261594", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Why can I use a function before it's defined in JavaScript? This code always works, even in different browsers: function fooCheck() { alert(internalFoo()); // We are using internalFoo() here... return internalFoo(); // And here, even though it has not been defined... function internalFoo() { return true; } /...
{ "language": "en", "url": "https://stackoverflow.com/questions/261599", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "199" }
Q: Hide a form's taskbar button without using WS_EX_TOOLWIN I need to hide a Windows form from the taskbar but I can't use WS_EX_TOOLWINDOW because I need the system menu and min/max buttons on the form's title bar. If I switch the form to a tool window at runtime the form skinning is stuffed up. From searching on the...
{ "language": "en", "url": "https://stackoverflow.com/questions/261601", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Java Binding Vs Manually Defining Classes I have a XML schema that I will need to create Java classes for. It is not a particularly large schema, I'd say it will result in around 20 classes. I am trying to weigh up whether to use an automatic binding program (like the one supplied in JAXB or JiBX) or whether to manu...
{ "language": "en", "url": "https://stackoverflow.com/questions/261603", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Native GTK# on Windows? How would I compile the latest version of GTK# for Windows without using cygwin? Any and All help would be appreciated. A: Well, if you have to have a more recent version, Medsphere provide a newer version, and building instructions and there is a load of information here. Sounds like some p...
{ "language": "en", "url": "https://stackoverflow.com/questions/261611", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: ColdFusion Server Monitoring - Not Working I am trying to launch the ColdFusion Server Monitor on a Windows Server 2003 (Web Edition) machine running ColdFusion 8 (ver. 8,0,0,176276). It is running in stand-alone configuration. The pop-up window launches as http://www.mydomain.com/CFIDE/administrator/monitor/launch...
{ "language": "en", "url": "https://stackoverflow.com/questions/261614", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Replace Unavailable Images via CSS? Is it possible to replace the standard broken image via CSS or using another technique? All my images are the same size and my have transparency. I've tried to wrap all images with a div's background: <div class="no_broken"> <img src="http://www.web.com/found.gif"/> </div> <div...
{ "language": "en", "url": "https://stackoverflow.com/questions/261622", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Ehcache and Java I am using ehCache to store larges amount of data. This cache is accessed about 3 times every second and must be kept up to date. I have a thread that runs which retrieves all the data i need for the cache from the database every minute into a different cache(different cachemanager also). What i wan...
{ "language": "en", "url": "https://stackoverflow.com/questions/261625", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I obtain File Version info from a C++ exe in C#? I need to get the File version information from an exe file originally written in C++ from a C# program. Using Assembly.LoadFile(fullpath).GetName().Version results in a BadImageFormatException. Can anyone help? Cheers, Dan A: Add a using System.Diagnostics, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261629", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I protect Python code from being read by users? I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file. If we distribute the .py files or even .pyc files it will be easy to (dec...
{ "language": "en", "url": "https://stackoverflow.com/questions/261638", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "758" }
Q: What's the best way to manage a lot of text in code (and also support translations)? I'm developing an application which has a lot of text and also different modules which can be included or not in every build. For each saved project we generate automatically a report with all the details (i.e. description of algori...
{ "language": "en", "url": "https://stackoverflow.com/questions/261648", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Converting a list of tuples into a dict I have a list of tuples like this: [ ('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('c', 1), ] I want to iterate through this keying by the first item, so, for example, I could print something like this: a 1 2 3 b 1 2 c 1 How would I go about doing this without keeping a...
{ "language": "en", "url": "https://stackoverflow.com/questions/261655", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "43" }
Q: How do I set an image for some but not all nodes in a TreeView? I have a TreeView windows forms control with an ImageList, and I want some of the nodes to display images, but the others to not have images. I don't want a blank space where the image should be. I don't want an image that looks like the lines that the...
{ "language": "en", "url": "https://stackoverflow.com/questions/261660", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: Can we define implicit conversions of enums in c#? Is it possible to define an implicit conversion of enums in c#? something that could achieve this? public enum MyEnum { one = 1, two = 2 } MyEnum number = MyEnum.one; long i = number; If not, why not? A: You cannot declare implicit conversions on enum types, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261663", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "148" }
Q: How to convert EJB3 annotations to ejb-jar.xml file configuration? I am looking for a tool which would create ejb-jar.xml configuration file from annotated EJB3 classes. Something like XDoclet, but for annotations, not tags in comments. A: I don't know if such a tool exists, but Java does come with a nice set of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/261668", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to specify a relative path for the jsUnit-ant-script? JsUnit provides an ant-script with the target 'standalone_test'. This target uses the property url to identify the HTML-site, that executes the tests. These site is checked in, so that everyone should be able after a checkout to execute this tests. This works...
{ "language": "en", "url": "https://stackoverflow.com/questions/261679", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What is the meaning of the term "thread-safe"? Does it mean that two threads can't change the underlying data simultaneously? Or does it mean that the given code segment will run with predictable results when multiple threads are executing that code segment? A: Don't confuse thread safety with determinism. Thread-...
{ "language": "en", "url": "https://stackoverflow.com/questions/261683", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "453" }
Q: Expression inference during inheritance I have the following code: using System; using System.Linq; using System.Linq.Expressions; public class Program { public static void Main() { Descendant d = new Descendant(); d.TestMethod(); } } public class Base { protected void FigureItOut<T...
{ "language": "en", "url": "https://stackoverflow.com/questions/261709", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }