text
stringlengths
8
267k
meta
dict
Q: Managing web services in FlexBuilder - How does the manager work? In FlexBuilder 3, there are two items under the 'Data' menu to import and manage web services. After importing a webservice, I can update it with the manage option. However, the webservices seems to disappear after they are imported. The manager does ...
{ "language": "en", "url": "https://stackoverflow.com/questions/43877", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Crop MP3 to first 30 seconds Original Question I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first n seconds of the track. Now, I know I could just "chop the stream" at n seconds (calculat...
{ "language": "en", "url": "https://stackoverflow.com/questions/43890", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "116" }
Q: SQL Server 2005 Temporary Tables In a stored procedure, when is #Temptable created in SQL Server 2005? When creating the query execution plan or when executing the stored procedure? if (@x = 1) begin select 1 as Text into #Temptable end else begin select 2 as Text into #Temptable end...
{ "language": "en", "url": "https://stackoverflow.com/questions/43903", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Resources for building a Visual Studio plug-in? I'd like to build a pretty simple plug-in for Visual Studio, but I don't really know how this has to be done. Is this doable in (non-managed) C++? I'd like to know what resources you'd recommend me. A: DevExpress has a free plug-in called DXCore which provides some ...
{ "language": "en", "url": "https://stackoverflow.com/questions/43908", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Can jQuery select by CSS rule, not class? A .container can contain many .components, and .components themselves can contain .containers (which in turn can contain .components etc. etc.) Given code like this: $(".container .component").each(function(){ $(".container", this).css('border', '1px solid #f00'); }); Wha...
{ "language": "en", "url": "https://stackoverflow.com/questions/43926", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: Targeting multiple versions of .net framework Suppose I have some code that would, in theory, compile against any version of the .net framework. Think "Hello World", if you like. If I actually compile the code, though, I'll get an executable that runs against one particular version. Is there any way to arrange thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/43939", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Custom Aggregate Functions in MS SQL Server? How can I create a custom aggregate function in MS SQL Server? An example would help a lot. A: SQL Server 2000 doesn't officially support custom aggregate functions. However, I recently needed that functionality as well, and I found this article enlightening: http://web...
{ "language": "en", "url": "https://stackoverflow.com/questions/43940", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: What is the best way of adding in regularly used blocks of code when marking up in TextMate? Caveat: I'm relatively new to coding as well as TextMate, so apologies if there is an obvious answer I'm missing here. I do a lot of HTML/CSS markup, there are certain patterns that I use a lot, for example, forms, navigatio...
{ "language": "en", "url": "https://stackoverflow.com/questions/43947", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Changing the default title of confirm() in JavaScript? Is it possible to modify the title of the message box the confirm() function opens in JavaScript? I could create a modal popup box, but I would like to do this as minimalistic as possible. I would like to do something like this: confirm("This is the content of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/43955", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "84" }
Q: COTS Workshop Registration System Does anyone have any experience with any COTS systems for managing workshops and the associated registrations, courses, communications, etc.? We have a home-built Perl system that is about 8 years old and is currently embedded as an iframe in a SharePoint portal site (externally fac...
{ "language": "en", "url": "https://stackoverflow.com/questions/43960", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: Configuring sendmail behind a firewall I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed...
{ "language": "en", "url": "https://stackoverflow.com/questions/43970", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Dynamic robots.txt Let's say I have a web site for hosting community generated content that targets a very specific set of users. Now, let's say in the interest of fostering a better community I have an off-topic area where community members can post or talk about anything they want, regardless of the site's main t...
{ "language": "en", "url": "https://stackoverflow.com/questions/43971", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: How to safely embed any flash file (swf)? I want to allow my users to embed their own Flash animations in their posts. Usually the actual file is hosted on some free image hosting site. I wouldn't actually load the flash unless the user clicked a button to play (so that nothing auto-plays on page load). I know pe...
{ "language": "en", "url": "https://stackoverflow.com/questions/43992", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Why is branching and merging easier in Mercurial than in Subversion? Handling multiple merges onto branches in Subversion or CVS is just one of those things that has to be experienced. It is inordinately easier to keep track of branches and merges in Mercurial (and probably any other distributed system) but I don't ...
{ "language": "en", "url": "https://stackoverflow.com/questions/43995", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "93" }
Q: Propagation of Oracle Transactions Between C++ and Java We have an existing C++ application that we are going to gradually replace with a new Java-based system. Until we have completely reimplemented everything in Java we expect the C++ and Java to have to communicate with each other (RMI, SOAP, messaging, etc - we...
{ "language": "en", "url": "https://stackoverflow.com/questions/44005", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: ncover with nunit2 task in NAnt Is there any chance to get this work? I want my tests to be run by nunit2 task in NAnt. In addition I want to run NCover without running tests again. A: I figured it out. You change the path of the NUnit launcher to that of TeamCity's own. Here is an example: <mkdir dir="${build...
{ "language": "en", "url": "https://stackoverflow.com/questions/44007", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: An easy way to diff log files, ignoring the time stamps? I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help me out? A: Depending on the shell you are using, you can turn the approach @Blair s...
{ "language": "en", "url": "https://stackoverflow.com/questions/44019", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "53" }
Q: How can I get the definition (body) of a trigger in SQL Server? Unable to find a SQL diff tool that meets my needs, I am writing my own. Between the INFORMATION_SCHEMA and sys tables, I have a mostly-complete working version. But one thing I can't find in the metadata is the definition of a trigger, you know, the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44034", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: Truncate (not round) decimal places in SQL Server I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding. For example: declare @value decimal(18,2) set @value = 123.456 This will automatically round @value to be 123.46, which is good in most cases. However, for this...
{ "language": "en", "url": "https://stackoverflow.com/questions/44046", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "222" }
Q: Best way to rotate Apache log files I've got an Apache server that has one access log file that is topping 600MB. This makes it really hard to search the file or parse it. What software or modules for Apache are available that will make a daily copy of my access file to make it more manageable? A: Have you looked ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44048", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "69" }
Q: Pass functions in F# Is it possible to pass a reference to a function to another function in F#? Specifically, I'd like to pass lambda functions like foo(fun x -> x ** 3) More specifically, I need to know how I would refer to the passed function in a function that I wrote myself. A: Yes, it is possible. The manual...
{ "language": "en", "url": "https://stackoverflow.com/questions/44066", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: ASP.NET Merge: Virtual path 'obal.asax' is not allowed I am doing a Web Deployment of my website and I have the merge assemblies property set to true. For some reason I get the following error. aspnet_merge : error occurred: An error occurred when merging assemblies: The relative virtual path 'Global.asax' is not...
{ "language": "en", "url": "https://stackoverflow.com/questions/44076", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Strip all HTML tags except links I am trying to write a regular expression to strip all HTML with the exception of links (the <a href and </a> tags respectively. It does not have to be 100% secure (I am not worried about injection attacks or anything as I am parsing content that has already been approved and publish...
{ "language": "en", "url": "https://stackoverflow.com/questions/44078", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: Does Microsoft ASP.NET Ajax Cause DOM Object Leaks? We've been using "Drip" to try and identify why pages with UpdatePanels in them tend to use a lot of client-side memory. With a page with a regular postback, we are seeing 0 leaks detected by Drip. However, when we add an update panel to the mix, every single DOM...
{ "language": "en", "url": "https://stackoverflow.com/questions/44080", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I document a module in Python? That's it. If you want to document a function or a class, you put a string just after the definition. For instance: def foo(): """This function does nothing.""" pass But what about a module? How can I document what a file.py does? A: Add your docstring as the first sta...
{ "language": "en", "url": "https://stackoverflow.com/questions/44084", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "80" }
Q: IE6 and XML prolog With an XML prolog like ? xml version="1.0" encoding="iso-8859-1"? > and a Doctype like !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> I can get my page to render as expected. However, in IE7 the same page does not render cor...
{ "language": "en", "url": "https://stackoverflow.com/questions/44087", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How To Extract SFTP SSH Key From Key Cache in FileZilla FTP Client I have connected to a server via SFTP using FileZilla and accepted adding the server's SSH key to the key cache in FileZilla. How can I extract this cached key to a keyfile so that may use it through other SFTP applications that require a keyfile b...
{ "language": "en", "url": "https://stackoverflow.com/questions/44089", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Best way to use a property to reference a Key-Value pair in a dictionary This is a fairly trivial matter, but I'm curious to hear people's opinions on it. If I have a Dictionary which I'm access through properties, which of these formats would you prefer for the property? /// <summary> /// This class's FirstProperty...
{ "language": "en", "url": "https://stackoverflow.com/questions/44100", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: invisible watermarks in images How do you insert invisible watermarks in images for copyright purposes? I'm looking for a python library. What algorithm do you use? What about performance and efficiency? A: You might want to look into Steganography; that is hiding data inside of images. There are forms that won't g...
{ "language": "en", "url": "https://stackoverflow.com/questions/44101", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: NT authentication login I am working on a site where users can login to get more private information. My client has another site else where that uses nt authentication for accessing it. What they want to do is have a button on the site I am working on under the private area that will send them to the nt authenticat...
{ "language": "en", "url": "https://stackoverflow.com/questions/44102", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Extending the User model with custom fields in Django What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes). I've already seen a few ways to do it, but can't decide on which...
{ "language": "en", "url": "https://stackoverflow.com/questions/44109", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "534" }
Q: SQL Server Alter Computed Column Does anyone know of a way to alter a computed column without dropping the column in SQL Server. I want to stop using the column as a computed column and start storing data directly in the column, but would like to retain the current values. Is this even possible? A: If you need to m...
{ "language": "en", "url": "https://stackoverflow.com/questions/44118", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How do I hide the input caret in a System.Windows.Forms.TextBox? I need to display a variable-length message and allow the text to be selectable. I have made the TextBox ReadOnly which does not allow the text to be edited, but the input caret is still shown. The blinking input caret is confusing. How do I hide it? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44131", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Project design / FS layout for large django projects What is the best way to layout a large django project? The tutorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/necessary betwe...
{ "language": "en", "url": "https://stackoverflow.com/questions/44135", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "44" }
Q: Publishing Flash video streaming What options do I have to publish Flash video from webcams other than Adobe's Flash Media Server and Red5? I would prefer a solution in .NET, Python or PHP but can't find anything. A: Besides another commercial product, like Wowza Media Server, you could go with a CDN (Content Deliv...
{ "language": "en", "url": "https://stackoverflow.com/questions/44143", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Hudson can't build my Maven 2 project because it says artifacts are missing from the repository? (they aren't) I'm using Hudson and Maven 2 for my automated build/CI. I can build fine with maven from the command line, but when I run the same goal with Hudson, the build fails complaining of missing artifacts. I'm r...
{ "language": "en", "url": "https://stackoverflow.com/questions/44144", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Database sharding and Rails What's the best way to deal with a sharded database in Rails? Should the sharding be handled at the application layer, the active record layer, the database driver layer, a proxy layer, or something else altogether? What are the pros and cons of each? A: I assume with shards we're talk...
{ "language": "en", "url": "https://stackoverflow.com/questions/44145", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Can you use reflection to find the name of the currently executing method? Like the title says: Can reflection give you the name of the currently executing method. I'm inclined to guess not, because of the Heisenberg problem. How do you call a method that will tell you the current method without changing what the c...
{ "language": "en", "url": "https://stackoverflow.com/questions/44153", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "216" }
Q: Real-time wmv video encoding in C# How to encode video on the fly and send it trough the network from C#? Can't find a suitable library. I need to encode in WMV and don't mind if the actual encoding is made in C++ as long as the library has a .NET assembly available. Thanks A: I'm aware of ffmpeg, but it is native ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44161", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Searching subversion history (full text) Is there a way to perform a full text search of a subversion repository, including all the history? For example, I've written a feature that I used somewhere, but then it wasn't needed, so I svn rm'd the files, but now I need to find it again to use it for something else. The...
{ "language": "en", "url": "https://stackoverflow.com/questions/44176", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "144" }
Q: Connecting private IPs A friend of mine told me there was a way to connect two private IPs without using a proxy server. The idea was that both computers connected to a public server and some how the server joined the private connections and won't use any more bandwidth. Is this true? How's this technique named? A:...
{ "language": "en", "url": "https://stackoverflow.com/questions/44177", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: SQL: Select like column from two tables I have a database with two tables (Table1 and Table2). They both have a common column [ColumnA] which is an nvarchar. How can I select this column from both tables and return it as a single column in my result set? So I'm looking for something like: ColumnA in Table1: a b c ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44181", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Looking for a simple JavaScript example that updates DOM I am looking for a simple JavaScript example that updates DOM. Any suggestions? A: Here is a short pure-javascript example. Assume you have a div with the id "maincontent". var newnode = document.createTextNode('Here is some text.'); document.getElementById('...
{ "language": "en", "url": "https://stackoverflow.com/questions/44190", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How do I best generate a CSV (comma-delimited text file) for download with ASP.NET? This is what I've got. It works. But, is there a simpler or better way? One an ASPX page, I've got the download link... <asp:HyperLink ID="HyperLinkDownload" runat="server" NavigateUrl="~/Download.aspx">Download as CSV file</asp:Hype...
{ "language": "en", "url": "https://stackoverflow.com/questions/44194", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Direct TCP/IP connections in P2P apps From a Joel's post on Copilot: Direct Connect! We’ve always done everything we can to make sure that Fog Creek Copilot can connect in any networking situation, no matter what firewalls or NATs are in place. To make this happen, both parties make outbound connecti...
{ "language": "en", "url": "https://stackoverflow.com/questions/44205", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What are good alternative data formats to XML? XML, granted, is very useful, but can be quite verbose. What alternatives are there and are they specialised for any particular purpose? Library support to interrogate the contents easily is a big plus point. A: Don't forget about YAML! JSON seems to have better suppor...
{ "language": "en", "url": "https://stackoverflow.com/questions/44207", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Difference between foreach and for loops over an IEnumerable class in C# I have been told that there is a performance difference between the following code blocks. foreach (Entity e in entityList) { .... } and for (int i=0; i<entityList.Count; i++) { Entity e = (Entity)entityList[i]; ... } where List<Entit...
{ "language": "en", "url": "https://stackoverflow.com/questions/44220", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: How to start learning JAVA for use with Oracle RDBMS? I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avoid? Is JDevelop...
{ "language": "en", "url": "https://stackoverflow.com/questions/44224", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How Can I Monitor Which Window Currently Has Keyboard Focus Is there a way to track which window currently has keyboard focus. I could handle WM_SETFOCUS for every window but I'm wondering if there's an alternative, simpler method (i.e. a single message handler somewhere). I could use OnIdle() in MFC and call GetFoc...
{ "language": "en", "url": "https://stackoverflow.com/questions/44241", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: What is the best practice for estimating required time for development of the SDLC phases? As a project manager, you are required to organize time so that the project meets a deadline. Is there some sort of equations to use for estimating how long the development will take? let's say the database time = sql storedpr...
{ "language": "en", "url": "https://stackoverflow.com/questions/44247", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Can .NET check other running programs command line parameters? We've got an interesting case where we are trying to determine how different instances of our app were launched. Is there any way for .NET to be able to query another running instance and get the command line parameters passed to that instance? I've not ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44260", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: cmd defaults to F: drive When I open cmd on my laptop it is defaulting to the F: drive. This is troubling me does anyone know how it got that way or how to get it back to where it opens to the C: drive by default? A: Use the command C: To change to the drive C. It would of course work for any drive letter. A: ht...
{ "language": "en", "url": "https://stackoverflow.com/questions/44261", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Order an Array like another Array in C# What is the best algorithm to take array like below: A {0,1,2,3} I expected to order it like array below: B {3,1,0,2} Any ideas? A: So if you have two arrays and they hold the same data just in different order then just do this: A = B I suspect that is not your situation so ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44270", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Given that I have a hash of id(key) and countries(values) sorted alphabetically, what is the best way to bubble up an entry to the top of the stack? This is a php example, but an algorithm for any language would do. What I specifically want to do is bubble up the United States and Canada to the top of the list. Here...
{ "language": "en", "url": "https://stackoverflow.com/questions/44272", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Database Patterns Does anyone know of papers/books/etc. that document patterns for databases? For example, one common rule of thumb is that every table should have a primary key and that the key should be devoid of information content. So I was wondering if anyone had written a book or published papers regarding d...
{ "language": "en", "url": "https://stackoverflow.com/questions/44281", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: Program for working with large CSV Files Are there any good programs for dealing with reading large CSV files? Some of the datafiles I deal with are in the 1 GB range. They have too many lines for Excel to even deal with. Using Access can be a little slow, as you have to actually import them into a database to work...
{ "language": "en", "url": "https://stackoverflow.com/questions/44286", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Differences in string compare methods in C# Comparing string in C# is pretty simple. In fact there are several ways to do it. I have listed some in the block below. What I am curious about are the differences between them and when one should be used over the others? Should one be avoided at all costs? Are there...
{ "language": "en", "url": "https://stackoverflow.com/questions/44288", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "281" }
Q: Enabled Brigded Network in Vmware Server I have the vmware server with this error, anyone knows how to fix it?VMware Server Error http://soporte.cardinalsystems.com.ar/errorvmwareserver.jpg A: In the Network Connections on the host PC, you might try repairing the connections that are created by VMWare. Something l...
{ "language": "en", "url": "https://stackoverflow.com/questions/44294", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Strong Validation in WPF I have a databound TextBox in my application like so: (The type of Height is decimal?) <TextBox Text="{Binding Height, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, Converter={StaticResource NullConverter}}" /> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44298", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: preferred way to implement visitor pattern in dynamic languages? As an exercise for myself, I was translating a sample program into various languages. Starting in C#, I had a visitor-pattern interface like so: interface Visitor { void Accept(Bedroom x); void Accept(Bathroom x); void Acc...
{ "language": "en", "url": "https://stackoverflow.com/questions/44337", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Unit testing with network-reliant code I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems. SNMP, WMI, that sort of thing. With most classes I can mock up objects to test them, but how do you deal with unit testing a real system? For example, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44338", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: What are the best keyboard macros for programming in windows? I like putting shortcuts of the form "g - google.lnk" in my start menu so google is two keystrokes away. Win, g. My eight or so most frequent applications go there. I also make links to my solution files I am always opening "x - Popular Project.lnk" Are t...
{ "language": "en", "url": "https://stackoverflow.com/questions/44350", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Iterate over subclasses of a given class in a given module In Python, given a module X and a class Y, how can I iterate or generate a list of all subclasses of Y that exist in module X? A: Can I suggest that neither of the answers from Chris AtLee and zacherates fulfill the requirements? I think this modification t...
{ "language": "en", "url": "https://stackoverflow.com/questions/44352", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: How do I get the current location of an iframe? I have built a basic data entry application allowing users to browse external content in iframe and enter data quickly from the same page. One of the data variables is the URL. Ideally I would like to be able to load the iframes current url into a textbox with javascri...
{ "language": "en", "url": "https://stackoverflow.com/questions/44359", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "51" }
Q: How can I avoid global state? So, I was reading the Google testing blog, and it says that global state is bad and makes it hard to write tests. I believe it--my code is difficult to test right now. So how do I avoid global state? The biggest things I use global state (as I understand it) for is managing key pieces...
{ "language": "en", "url": "https://stackoverflow.com/questions/44364", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: BLOB Storage - 100+ GB, MySQL, SQLite, or PostgreSQL + Python I have an idea for a simple application which will monitor a group of folders, index any files it finds. A gui will allow me quickly tag new files and move them into a single database for storage and also provide an easy mechanism for querying the db by t...
{ "language": "en", "url": "https://stackoverflow.com/questions/44372", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Add alternating row color to SQL Server Reporting services report How do you shade alternating rows in a SQL Server Reporting Services report? Edit: There are a bunch of good answers listed below--from quick and simple to complex and comprehensive. Alas, I can choose only one... A: Using IIF(RowNumber...) can lead...
{ "language": "en", "url": "https://stackoverflow.com/questions/44376", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "147" }
Q: Reading Email using Pop3 in C# I am looking for a method of reading emails using Pop3 in C# 2.0. Currently, I am using code found in CodeProject. However, this solution is less than ideal. The biggest problem is that it doesn't support emails written in unicode. A: My open source application BugTracker.NET includes...
{ "language": "en", "url": "https://stackoverflow.com/questions/44383", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "75" }
Q: How do I prevent replay attacks? This is related to another question I asked. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I somehow need to know who they are, and I need to know they're logged in! I t...
{ "language": "en", "url": "https://stackoverflow.com/questions/44391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: WPF - Load Font from Stream? I have a MemoryStream with the contents of a Font File (.ttf) and I would like to be able to create a FontFamily WPF object from that stream WITHOUT writing the contents of the stream to disk. I know this is possible with a System.Drawing.FontFamily but I cannot find out how to do it wit...
{ "language": "en", "url": "https://stackoverflow.com/questions/44394", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the .project and .classpath files for Eclip...
{ "language": "en", "url": "https://stackoverflow.com/questions/44396", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "54" }
Q: catching button clicks in javascript without server interaction I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when the user clicks ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44401", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: C# .Net 3.5 Code to replace a file extension using LINQ I've written this very simple function to replace a file extension using LINQ in C#.NET 3.5 however I have a feeling that there's a more elegant way to do this. (I'm not committed to using LINQ here - just looking for a more elegant approach.) Ideas? privat...
{ "language": "en", "url": "https://stackoverflow.com/questions/44404", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do you generate a random number in C#? I would like to generate a random floating point number between 2 values. What is the best way to do this in C#? A: The only thing I'd add to Eric's response is an explanation; I feel that knowledge of why code works is better than knowing what code works. The explanation...
{ "language": "en", "url": "https://stackoverflow.com/questions/44408", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "33" }
Q: Outlook Email via a Webpage I have a web application developed with ASP.net and C# that is running on my companies' intranet. Because all the users for this application are all using Microsoft Outlook without exception, I would like for the the application to open up an Outlook message on the client-side. I under...
{ "language": "en", "url": "https://stackoverflow.com/questions/44421", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Why does a button control need to be clicked twice? I've got a web application working using VB and Ajax. I'm using updatepanels to avoid the irritating "flicker" on postbacks to the server. I would like to have a button control defined within the updatepanel itself (tried moving it outside and got some catastrophi...
{ "language": "en", "url": "https://stackoverflow.com/questions/44453", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What can cause .NET assembly registration to fail? We've seen an issue where one of our installers (msi) returns the error code 2908, which is used to indicate that an assembly failed to register. Later in the installation, we get the following (sanitized) error: MyAssemblyName, version="1.0.1.1", culture="neutr...
{ "language": "en", "url": "https://stackoverflow.com/questions/44467", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What's the best way to insert/update/delete multiple records in a database from an application? Given a small set of entities (say, 10 or fewer) to insert, delete, or update in an application, what is the best way to perform the necessary database operations? Should multiple queries be issued, one for each entity to...
{ "language": "en", "url": "https://stackoverflow.com/questions/44469", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I get the ClickOnce Publish version to match the AssemblyInfo.cs File version? Every time I publish the application in ClickOnce I get get it to update the revision number by one. Is there a way to get this change automatically to change the version number in AssemblyInfo.cs file (all our error reporting look...
{ "language": "en", "url": "https://stackoverflow.com/questions/44470", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: Compressing a TIF file I'm trying to convert a multipage color tiff file to a c# CompressionCCITT3 tiff in C#. I realize that I need to make sure that all pixels are 1 bit. I have not found a useful example of this online. A: You need this conversion as CCITT3 and CCITT4 don't support color (if I remember right). ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44476", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is it possible to craft a glob that matches files in the current directory and all subdirectories? For this directory structure: . |-- README.txt |-- firstlevel.rb `-- lib |-- models | |-- foo | | `-- fourthlevel.rb | `-- thirdlevel.rb `-- secondlevel.rb 3 directories, 5 files The glob ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44481", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Arbitrary Naming Convention (Business Objects) Ok, do you do Business.Name or Business.BusinessName SubCategory.ID or SubCategory.SubCategoryID What about in your database? Why? I'm torn with both. Would love there to be a "right answer" A: The only "right" answer is to be consistent. Decide upfront which one you ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44485", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is there a way to generate WMI code/classes? How do you generate C# classes for accessing WMI? A: To generate strongly typed WMI classes, use the Management Strongly typed class generator (MgmtClassGen.exe). It's usually in C:\Program Files\Microsoft Visual Studio X\SDK\vX\Bin. The parameters are at MSDN and they...
{ "language": "en", "url": "https://stackoverflow.com/questions/44504", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Single Sign On across multiple domains Our company has multiple domains set up with one website hosted on each of the domains. At this time, each domain has its own authentication which is done via cookies. When someone logged on to one domain needs to access anything from the other, the user needs to log in again ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44509", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "113" }
Q: JavaFX video encoding On JavaFX's Wikipedia In May 2008 (...) Sun Also announced a multi-year agreement with On2 Technologies to bring comprehensive video capabilities to the JavaFX product family using the company's TrueMotion Video codec. Do you know if it will include encoding capabilities for Webca...
{ "language": "en", "url": "https://stackoverflow.com/questions/44516", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Tools to convert asp.net dynamic site into static site Are there any tools that will spider an asp.net website and create a static site? A: http://www.httrack.com/ Have used for this purpose a few times, may need to do a little tidying up of urls, and some css linked images might not make it, depends on how good a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44517", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to ensure that the same thread is used to execute code in IIS? We have a third party dll that is used in our web service hosted in IIS6. The problem is that once this dll is loaded into memory, the exception AccessViolationException gets thrown if a thread different then the one that created it tries to execute ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44522", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is the best way to send html/image email? Do you attach the images? Use absolute urls? How do you best avoid getting flagged as spam? A: You attach the emails then reference them in your HTML like so: <img src="cid:imagefilename.jpg" /> Outlook, at least, recognizes this as a reference to an attached image...
{ "language": "en", "url": "https://stackoverflow.com/questions/44532", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Algorithm / pseudo-code to create paging links? Can someome provide code or pseudo-code for how the paging links on StackOverflow are generated? I keep racking my brain but can't think of a decent way to build the dynamic links that always show the 2 pages around the current, plus the first and last. Example: 1 ... ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44542", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: What’s your logging philosophy? As Jeff Atwood asked: "What’s your logging philosophy? Should all code be littered with .logthis() and .logthat() calls? Or do you inject logging after the fact somehow?" A: I think always, always, always add logging when there is an exception, including the message and full stack tr...
{ "language": "en", "url": "https://stackoverflow.com/questions/44554", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: How do I simultaneously work on version 1.1 and version 2.0? The situation: We're out of beta and version 1.0 has been released to several customer sites. Team A is already busy working on version 1.1 that will have incremental bugfixes and usability tweaks, while another team works on version 2.0 with large-scale c...
{ "language": "en", "url": "https://stackoverflow.com/questions/44566", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Octal number literals: When? Why? Ever? I have never used octal numbers in my code nor come across any code that used it (hexadecimal and bit twiddling notwithstanding). I started programming in C/C++ about 1994 so maybe I'm too young for this? Does older code use octal? C includes support for these by prepending a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44569", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "51" }
Q: How to convince a company to switch their Source Control My current place of employment is currently in a transition, new ownership has taken over, things are finally getting standardized and proper guidelines are being enforced. But we are still using VSS, there really isn't any reason for using it other then tha...
{ "language": "en", "url": "https://stackoverflow.com/questions/44588", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: .NET Development on a Mac Tips I have just got a MacBook Pro and have been using it (+Fusion) to develop on for about a month now. The purpose of this question is similar to Hidden Features of C#; to become a how-to of tips and trick for windows development on a mac. I should clarify that I am aware of boot camp bu...
{ "language": "en", "url": "https://stackoverflow.com/questions/44601", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: Adding more information to TestResult.xml file from NUnit I would like to be able to add a "message" to a unit test, such that it actually appears within the TestResult.xml file generated by NUnit. For example, this is currently generated: <results> <test-case name="MyNamespace.Tests.MyTest" executed="True" suc...
{ "language": "en", "url": "https://stackoverflow.com/questions/44617", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How Do I Test Rails Logging In from the Console? I was having a heck of a time figuring out how to login and logout using response objects from Rails. The standard blogs were ok, but I finally diagnosed it, and I wanted to record it here. app.get '/' assert_response :success app.get '/auth_only_url' assert_response ...
{ "language": "en", "url": "https://stackoverflow.com/questions/44619", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: version control practice In my current job the supervisor's practice is to only check in production ready code. Most recently the project I was on involved work by 3 different developers with some file overlap. This meant manually integrating changes despite the fact that some changes took a day and then it was do...
{ "language": "en", "url": "https://stackoverflow.com/questions/44630", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to start using ndepend? I recently downloaded ndepend and ran an analysis on an open source project I participate in. I did not now where to look next - a bit of visual and information overload and it turned out I don't even know where to start. Can anyone suggest starting points? * *What information should I...
{ "language": "en", "url": "https://stackoverflow.com/questions/44637", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Identifying ASP.NET web service references At my day job we have load balanced web servers which talk to load balanced app servers via web services (and lately WCF). At any given time, we have 4-6 different teams that have the ability to add new web sites or services or consume existing services. We probably have ab...
{ "language": "en", "url": "https://stackoverflow.com/questions/44644", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is there a good method in C# for throwing an exception on a given thread The code that I want to write is like this: void MethodOnThreadA() { for (;;) { // Do stuff if (ErrorConditionMet) ThrowOnThread(threadB, new MyException(...)); } } void MethodOnThreadB() { try {...
{ "language": "en", "url": "https://stackoverflow.com/questions/44656", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }