text
stringlengths
8
267k
meta
dict
Q: Proper way of cancelling accept and closing a Python processing/multiprocessing Listener connection (I'm using the pyprocessing module in this example, but replacing processing with multiprocessing should probably work if you run python 2.6 or use the multiprocessing backport) I currently have a program that listens...
{ "language": "en", "url": "https://stackoverflow.com/questions/357656", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Use XSL to generate dynamic XSL that is executed within the same script? I want to dynamically create variables with dynamic names for later use in my transform, but to do this I'd need to dynamically generate XSL and then run it in the same script. This is just a rough pseudo code example of what I'm looking for. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357672", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How can I determine how much memory my .NET program is using? It seems to be often said that Task Manager does not provide an accurate indication of how much memory is in use by a process. If this is indeed the case, what's the easiest way to find these things out? I'd like to know: * *Total Memory in use (whethe...
{ "language": "en", "url": "https://stackoverflow.com/questions/357675", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: DataPower XA35 - processing rule - Route Action Our processing rule includes two Tranform actions, and a Validate, and Results actions. We want to add another action between the two transform actions to do the following: The new action will use an XSLT to evaluate an expression. If there is a match, skip the rest of...
{ "language": "en", "url": "https://stackoverflow.com/questions/357678", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: UISearchBar Animation It's common to see a UISearchBar in an application, that upon a click, will enlarge and animate into view with a keyboard. I'm curious, is this something the iPhone SDK provides for free, or is the Animation code more than likely written by the developer? I use a UISearchBar in several controll...
{ "language": "en", "url": "https://stackoverflow.com/questions/357684", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: What's a good way to debug unit tests written with multiple [Row] attributes? When I run the following test in Gallio's Icarus it passes, but when I step into it using TestDriven.NET (Test With->Debugger), it fails because the parameters are not set according to the Row attributes. I was expecting that the method wo...
{ "language": "en", "url": "https://stackoverflow.com/questions/357690", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Caching always loading files in PHP In my index.php file I always load some classes used later. From profiler it states it sometimes can take about 20% of entire code. Is there any improvement that can make this process faster? I would try to make this list of classes shorter, but app is very big and checking all de...
{ "language": "en", "url": "https://stackoverflow.com/questions/357691", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do you specify the access specifier on an ANTLR v3 generated parser or lexer? Using ANTLR v3 and the CSharp2 language specifier, is there any way to indicate that you want the generated lexer or parser to be internal versus the default of public? The namespace is specified with: @lexer::namespace {My.Namespace} ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357695", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I track a repeating calendar event in C# / SQL Server? I'd like to display a repeating event on a date/time display in an app. This date time display can take the form of a calendar, but it could also just be a list of upcoming events. What is the best way to handle tracking this event that can repeat? Fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/357704", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Heatmap Tools For Web Apps I have a client that want to have a web app I'm building for them display heat maps of the data. I haven't worked with heat maps at all and I was wondering if anyone knew of some good tools for generating them. Thanks. A: Heat maps are often used in place of a more conventional term: kern...
{ "language": "en", "url": "https://stackoverflow.com/questions/357721", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Grails Database Connection Problem When Deployed I can successfully run my Grails application in Jetty. It succeeds in connecting to my MsSql database and everything is fine. When I deploy that same application in Tomcat 6 on the same machine, I receive the following error on startup in the Tomcat log: Caused by: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357732", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How do I combine a Combo Box with a Tree in Swing? For my application, I want a Combo Box that displays its elements when dropped down as a Tree. Problem is, I'm not versed well enough in Swing to know how to go about doing this. At least without ending up writing a new widget from scratch, or something to that ef...
{ "language": "en", "url": "https://stackoverflow.com/questions/357739", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Replacing a word with another word zero or more times in javascript using regular expressions I have a word : [lesserthen] , that I need to replace with < zero or more times in a string. I'm using the String.replace method to do so. But the word is only replaced one time in the string, I need to be replaced more the...
{ "language": "en", "url": "https://stackoverflow.com/questions/357740", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: getJSON call working on IE 7 but not Firefox 3 I have a web application that uses the current version of JQuery that needs to get some JSON objects back from a REST web service. I'm using the following call to $.getJSON: $.getJSON("http://localhost:17245/Service.svc/?format=json", function(data) {alert(data.id);}); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357752", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Can I traverse symlinked directories in Ruby with a "**" glob? In Ruby, Dir.glob("**/*.rb") (for instance) doesn't traverse symlinked directories. Is it possible to get the ** to traverse symlinks? I'm using two gems which find files this way, but I need them to see files within a symlinked directory. A: Jonathan'...
{ "language": "en", "url": "https://stackoverflow.com/questions/357754", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: Managing shared binary dependencies for multiple solutions Ok we have a number of solutions all with a lot of shared binaries: what we do is the following. In a shared drive we have this following layout where there is a directory for every binary dependency and a sub directory for every version BinaryDep1 ---------...
{ "language": "en", "url": "https://stackoverflow.com/questions/357766", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I use the "Publish" function in Visual Studio 2008 without erasing the contents of the target folder? When I use Build->Publish Web Site in Visual Studio 2008, most of the time it compiles the site, and then simply asks me "All files in the target folder will be deleted. Continue?" (or something to that effe...
{ "language": "en", "url": "https://stackoverflow.com/questions/357769", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Affine Transformations vs Keyframing This may be a silly question to a graphics guru (which I am not), but what's the difference between affine transformations and keyframing? I'm reading about the former in the iPhone cookbook, and she states that 'Affine transforms enable you to change an object's geometry by mapp...
{ "language": "en", "url": "https://stackoverflow.com/questions/357775", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is the recommended way to use Vim folding for Python code I am interested in enabling code folding in Vim for Python code. I have noticed multiple ways to do so. Does anyone have a preferred way to do Python code folding in Vim? I.e, * *Do you have a particular Vim plugin that you use and like? *Do you use...
{ "language": "en", "url": "https://stackoverflow.com/questions/357785", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "126" }
Q: C# Round Value of a Textbox I have a small calculator that I am creating in C# (Sharp Develop). The user enters two values and the code returns the third. I am having trouble rounding the third value once it is returned. I have been through a couple of forums and the msdn site and I understand the code that is poste...
{ "language": "en", "url": "https://stackoverflow.com/questions/357790", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Automated-build version number with WiX, Inno Setup, and VS2008 Basically what I need is an automated way to update the product version number in WiX (3.0 with Votive etc), and then get that version number into an Inno Setup "bootstrapper" I pretty much have the process mostly automated, however version numbers stil...
{ "language": "en", "url": "https://stackoverflow.com/questions/357803", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: string replace on escape characters Today I found out that putting strings in a resource file will cause them to be treated as literals, i.e putting "Text for first line \n Text for second line" will cause the escape character itself to become escaped, and so what's stored is "Text for first line \n Text for second ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357804", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: A small question about python's variable scope I am a beginner of python and have a question, very confusing for me. If I define a function first but within the function I have to use a variable which is defined in another function below, can I do it like this? Or how can I import the return things of another functi...
{ "language": "en", "url": "https://stackoverflow.com/questions/357810", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Remembering a quote from Alan Kay Alan Kay was quoted several years ago to the effect that there had been only three new things in software in the preceding 20 years (effectively the lifespan of PCs). One of them was Spreadsheets. Does anyone remember the other two? Who is Alan Kay? (a few may ask.) His work at Xero...
{ "language": "en", "url": "https://stackoverflow.com/questions/357813", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "38" }
Q: When is it best to use Regular Expressions over basic string splitting / substring'ing? It seems that the choice to use string parsing vs. regular expressions comes up on a regular basis for me anytime a situation arises that I need part of a string, information about said string, etc. The reason that this comes up ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357814", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Menu indentation after full screen Using the JW player, streaming flv via rtmp. I am also using the snell.swf skin. When I click on full screen, then return to normal I am seeing the menu for the currently playing item indent. Any ideas what is causing this? Also sometimes seeing menu items highlighted which are not...
{ "language": "en", "url": "https://stackoverflow.com/questions/357819", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Automatically generating handling of issues This is more an observation than a real question: MS-Access (and VBA in general) is desperately missing a tool where error handling code can be generated automatically, and where the line number can be displayed when an error occurs. Did you find a solution? What is it? I ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357822", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: iPhone: What is the best way to use both OpenGL and the native user interface in an application? I'm pretty new to the iPhone platform, so I'm wondering what the best way to switch between OpenGL rendering and a UIView might be? Any comments much appreciated! A: There's no need to switch modes at all. OpenGL ES re...
{ "language": "en", "url": "https://stackoverflow.com/questions/357823", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to automatically align python variable assignment lines in vim I would like to automatically align lines of python variable assignments in vim. For example I would like to change this: a = 1 banana = 2 into this a = 1 banana = 2 automatically in vim. Is there a way to do this? A: You are probably looking...
{ "language": "en", "url": "https://stackoverflow.com/questions/357824", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Flash / Actionscript CPU profiler Have you found such a tool and used it successfully? A: Adobe have recently released a new profiling tool for Flash called Adobe Scout: http://gaming.adobe.com/technologies/scout/ It's a massive improvement on the old Flash Builder profiler - it gives you a detailed breakdown of CP...
{ "language": "en", "url": "https://stackoverflow.com/questions/357825", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Handling PermGen errors in ant bpelc task I've been hitting a java.lang.OutOfMemoryError: PermGen error when compiling a project with ant under Linux with jdk 1.5.0_11. the same project compiles under windows without problem. Usually this relates to the MaxPermSize allocated to the JVM. Irakli Nadareishvili has one ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357827", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Retain Windows Error Reporting Dumps from Hung Application An application is hanging occasionally, and I would like to see the dump at the time to figure it out. I had written an application that the user can run to automatically create a dump that I can look at. However I can't seem to get the users to remember to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357828", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: ASP.NET Compile behavior changes depending on page content? I've been struggling with some issues relating to referencing child controls within a FormView. Another developer wrote an ASPX page that is compiling and working and in that code, he references child controls within a FormView directly as properties of th...
{ "language": "en", "url": "https://stackoverflow.com/questions/357839", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I do a regexp search against a Mandarin string? How do I do a regexp search against a Mandarin string? A: No different that against any other string; of course it requires a language and a regexp library that correctly uses unicode for its strings and doesn't assume that a string is just a byte array interpr...
{ "language": "en", "url": "https://stackoverflow.com/questions/357845", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: In Java: How to zip file from byte[] array? My application is receiving email through SMTP server. There are one or more attachments in the email and email attachment return as byte[] (using sun javamail api). I am trying to zip the attachment files on the fly without writing them to disk first. What is/are possible...
{ "language": "en", "url": "https://stackoverflow.com/questions/357851", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "62" }
Q: Why do IE and Firefox render the same image differently, how can I prevent it? On the left you will notice the google logo rendered by IE, I drew a black line at the top and bottom of the G which extends into the FF windows which rendered the same exact logo yet the FF version renders the image larger. There is NO ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357860", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: DataReader with duplicate column names What is the best way of handling trying to get data from a DataReader that has more than one column with the same name? Because of the amount of work involved and because we don't want to lose support from a vendor by changing the stored procedures we are using to retrieve the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357864", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is T-SQL's CASE normal ("lazy") evaluation? Is T-SQL's CASE lazy evaluation? A: Yes, it evaluates the WHENs in order until it finds one that is true, and doesn't evaluate the remaining WHENs.
{ "language": "en", "url": "https://stackoverflow.com/questions/357866", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Design Pattern for Components that depend on each other We are building a "configurator" application for conveyors. Basically user comes in and picks a model, then start picking the parts they want. Some components have dependencies on other components. E.g. if I pick Part A, then I am required to select 1 or more P...
{ "language": "en", "url": "https://stackoverflow.com/questions/357885", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: GWT - What's a good GUI editor for GWT in Intellij IDEA? The one that ships with IDEA is nothing more than a GWT project creation tool. Is there a better plugin? Is there a standalone GUI editor for GWT? A: To answer your question directly, there is no such thing as a Intellij IDEA GUI WYSIWYG editor for GWT for ...
{ "language": "en", "url": "https://stackoverflow.com/questions/357886", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: An editor for a data object in swing, what is the easiest way? I have a java object with several members. I want to create a small, quick and dirty editor that allows me to set the value of the members in an easy way. I've created a Panel that contains a TextField for every member. I have a setValues() method tha...
{ "language": "en", "url": "https://stackoverflow.com/questions/357896", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to reload a 3rd party DLL that crashes often I'm using a 3rd party DLL written in unmanaged C++ that controls some hardware we have. Unfortunately this DLL crashes now and then and I've been tasked to make it "reload" automagically. I'm not too sure about how to proceed to get best results. My project uses C++.N...
{ "language": "en", "url": "https://stackoverflow.com/questions/357898", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to specify source and destination FTP directories in script task? I am creating a script on the fly to ftp some files from a remote computer. I create a file which is then called from the command line with ftp -s:filename proxy where filename is the file I just created. The file has code similar to the follow...
{ "language": "en", "url": "https://stackoverflow.com/questions/357903", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Rebinding on Postback Based on Selected DropDown Value Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView ID="MyFormView" runat="server" DataSourceID="MyXmlDataSource"> <ItemTemplate> <h1><%# XPath("SomeNode")%></h1> <asp:Label ID="MyLabel" runat="...
{ "language": "en", "url": "https://stackoverflow.com/questions/357908", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Manage configuration files with WiX I have an application with several files that contain configuration parameters and other data that changes as the user uses the application. These files can change with newer versions of my software, but the user can also modify them (or they may be changed by the application its...
{ "language": "en", "url": "https://stackoverflow.com/questions/357911", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to analyse a HTTP dump? I have a file that apparently contains some sort of dump of a keep-alive HTTP conversation, i.e. multiple GET requests and responses including headers, containing an HTML page and some images. However, there is some binary junk in between - maybe it's a dump on the TCP or even IP level (I...
{ "language": "en", "url": "https://stackoverflow.com/questions/357920", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Using a Regex to find specifically formatted fields In an application I'm developing, someone thought it would be ok idea to include commas in the values of a csv file. So what I'm trying to do select these values and then strip the commas out of these values. But the Regex I've built won't match to anything. The...
{ "language": "en", "url": "https://stackoverflow.com/questions/357923", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is it important to unit test a constructor? Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper wrapper; public SystemInfo(IMapinfoWrapper mapinfoWrapper) { this.wrapper = mapinfoWrapper; } Do I need to write a unit test for this construtor? I don't have any getters for the wr...
{ "language": "en", "url": "https://stackoverflow.com/questions/357929", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "94" }
Q: Example of using AuthType Digest to authenticate a user once across sub-domains? I have a domain that will be accessed by a small, private group of people. So I want to control access via authentication. The domain has a collection of applications installed that each have their own sub-domain. Eg: domain.com, app1.d...
{ "language": "en", "url": "https://stackoverflow.com/questions/357939", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How can I attach a .NET delegate to an mshtml event? I'm working on an extension (BHO) for Internet Explorer, and having trouble attaching a .NET delegate to the mshtml objects to catch DOM events. I've tried using the events published by the IHTMLElementEvents2_Event, ... interfaces, and that works, but only if I s...
{ "language": "en", "url": "https://stackoverflow.com/questions/357949", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How go I get a reference to a cell in an array knowing only its value? I have a column array with the following values in my sheet: 11, 15, 5, 7, 2. I want to get a reference to the cell which contains the value 15. How would I go about doing this? Thanks A: If your array is A2:A13 here is a formula that will get y...
{ "language": "en", "url": "https://stackoverflow.com/questions/357953", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Should I use SQL Reporting Services 2008 for my reporting engine? I would like to use SQL Reporting Services 2008 to generate my reports, but I want to use my own UI for specifying the report type, columns, parameters and everything. I want to be able to take these criteria, and then kick off an asynchronous reques...
{ "language": "en", "url": "https://stackoverflow.com/questions/357955", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Explanation of “tying the knot” In reading Haskell-related stuff I sometimes come across the expression “tying the knot”, I think I understand what it does, but not how. So, are there any good, basic, and simple to understand explanations of this concept? A: Tying the knot is a solution to the problem of circular d...
{ "language": "en", "url": "https://stackoverflow.com/questions/357956", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "48" }
Q: std::ifstream::open() not working I am developing a prototype for a game, and certain gameplay rules are to be defined in an ini file so that the game designers can tweak the game parameters without requiring help from me in addition to a re-compile. This is what I'm doing currently: std::ifstream stream; stream.ope...
{ "language": "en", "url": "https://stackoverflow.com/questions/357963", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Problem with Python implementation of Conway's Game of Life I am working on Conway's Game of Life currently and have gotten stuck. My code doesn't work. When I run my code in GUI, it says: [[0 0 0 0] [0 1 1 0] [0 1 0 0] [0 0 0 0]] Traceback (most recent call last): File "C:\Users\Documents\Physics\Python\Mai...
{ "language": "en", "url": "https://stackoverflow.com/questions/357968", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Combining CSS properties I am trying to combine some of my CSS and it is kind of an easy questions but I am kind of having some trouble, i have this code: h2.post-title, h2.post-title a{ display:block; background-color:#000; padding:3px; color:#ffffff; text-decoration:none; text-transform:upp...
{ "language": "en", "url": "https://stackoverflow.com/questions/357969", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Does Python have something like anonymous inner classes of Java? In Java you can define a new class inline using anonymous inner classes. This is useful when you need to rewrite only a single method of the class. Suppose that you want create a subclass of OptionParser that overrides only a single method (for example...
{ "language": "en", "url": "https://stackoverflow.com/questions/357997", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "48" }
Q: Function like SetFileLength() in C Library for Linux Is there a function in the C Library under Linux which can set the length of a file? Under Windows I know there is a SetFileLength() function. If there is not, what is the best way of shortening a file without deleting and rewriting it? A: You can use the truncat...
{ "language": "en", "url": "https://stackoverflow.com/questions/358003", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Porting JDBCRealm from tomcat to OC4J I'm porting a servlet from Tomcat 5.5 to OC4J 10.1.3.1. In Tomcat we set up a JDBCRealm for authentication and authorization. This was configured via the $TOMCAT_HOME/conf/server.xml. Is there a similar mechanism in OC4J? Where do I start looking for it? How do I define it? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358004", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Instantiate DataContract in javascript when using WCF service with ScriptService I have a simple WCF service that I'm exposing using a .svc. The service has some related DataContract classes that are used with the ServiceContracts. When calling a method that gets some data, the json that comes back has all the prope...
{ "language": "en", "url": "https://stackoverflow.com/questions/358011", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Stop arrow keys from scrolling through tabs on TabControl C# Winform I need to keep the arrow keys from being able to scroll through my various tabs. Anyone know of a way to do this? A: I fixed the problem with the following code string tempstring = e.KeyValue.ToString(); if (tempstring == "37" || tempstring == "38...
{ "language": "en", "url": "https://stackoverflow.com/questions/358025", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: In C# how could I listen to a COM (Serial) Port that is already open? I am using a program that talks to my COMM port, but I have made another program that I want to "sniff" the comm port messages and perform it's own actions against those messages in addition. Is this possible in .NET c#? A: There are third party...
{ "language": "en", "url": "https://stackoverflow.com/questions/358037", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Is there a pattern for using XML for no-overhead object serialization? In the same way that you can use JSON in javascript? At least the static properties? Or maybe even for hash-table streaming? Is it oversimplistic about hoping to find something like Object.Serialize(stream) where stream is a file, overrideable ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358038", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What kind of ruby method call is Array(x) What is the meaning, and where is the Ruby documentation for the syntax of: Array(phrases) which I found browsing the Rails source here: # File actionpack/lib/action_view/helpers/text_helper.rb, line 109 ... 119: match = Array(phrases).map { |p| Regexp.escape(p) ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358039", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Java change and move non-standard XML file I am using a third party application and would like to change one of its files. The file is stored in XML but with an invalid doctype. When I try to read use a it errors out becuase the doctype contains "file:///ReportWiz.dtd" (as shown, with quotes) and I get an exception ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358048", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: C# ANTLR grammar? I'm looking for turn-key ANTLR grammar for C# that generates a usable Abstract Syntax Tree (AST) and is either back-end language agnostic or targets C#, C, C++ or D. It doesn't need to support error reporting. P.S. I'm not willing to do hardly any fix-up as the alternative is not very hard. A: Thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/358052", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Working With SQL Server Developer Edition I just bought Visual Studio 2008 Professional and it came with SQL Server 2005 Developer Edition. I'm used to using SQL Server 2005 at work, but the Developer edition doesn't seem to come with Server Management Studio, so I'm at a bit of a loss. A few questions: * *What...
{ "language": "en", "url": "https://stackoverflow.com/questions/358069", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to detect when the height of your page changes? I have a javascript heavy app which has widgets like autocomplete dropdowns and tabs and so forth. Sometimes when dropdowns appear and disappear, or when you switch between tabs, it changes the height of the document. This can cause annoyances if the scrollbar appe...
{ "language": "en", "url": "https://stackoverflow.com/questions/358072", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Casting null as an object? I came across this code today AsyncInvoke(OnTimeMessageTimer, (object)null, (ElapsedEventArgs)null); Is there anything wrong with it or no? A: it probably needs the cast to resolve overloads A: Sometimes, you need to to this when the method is overloaded... to tell the compiler which on...
{ "language": "en", "url": "https://stackoverflow.com/questions/358079", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "26" }
Q: VB.NET Creating Classes, What is Public Class MyClass(Of Type)? I'm still learning ASP.NET and I often see code like this throughout parts of our framework: Public MustInherit Class DBFileManager(Of F As IDBFile, FC As IDBFileContent, FT As IDBFileThumb) Can anybody tell me what this means? Much thanks! A: Its a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358091", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: SQL CASE Statement Is the following possible in SQL Server 2000? CREATE FUNCTION getItemType (@code varchar(18)) RETURNS int AS BEGIN Declare @Type tinyint Select @Type = case len(@code) WHEN 12,14,17 THEN 1 WHEN 13,15,18 THEN 2 WHEN 8,10 THEN 3 ELSE 0 END RETURN (@Type) END Thanks. A: This should do it: CREATE ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358092", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I bind to just one IP address with VisualSVN Server? I've installed VisualSVN on my Windows Server 2008. I have several IP addresses on this server, but I want VisualSVN to only bind to one of them. By default it binds to all available addresses. How can I make VisualSVN only handle requests on one IP addr...
{ "language": "en", "url": "https://stackoverflow.com/questions/358095", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What happens when you select a non-existing file for upload in an HTML form? On Internet Explorer, the standard HTML file upload form also allows for direct input of the file name (instead of using the file selector dialog). This makes it possible to enter non-existing files. On other browsers (which do not let you ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358120", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Java bytecode specification Is there a nice place for learning the JVM bytecode instruction set. The specification perhaps and maybe some tutorials? I ask because I would like to design a toy language and a compiler for it that generates JVM bytecode. Thanks for your knowledge and perhaps googling. A: The book Pro...
{ "language": "en", "url": "https://stackoverflow.com/questions/358121", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "35" }
Q: Java app performance counters viewed in Perfmon I have a Java app running on Tomcat, and I would like to monitor counters using Windows Performance Monitor. Is this possible using a JMX adapter for the Java MBeans or by some other means? A: The following tutorial might be of use: http://www.developer.com/java/ent/...
{ "language": "en", "url": "https://stackoverflow.com/questions/358129", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Does ODP.net close a ref cursor when the connection closes? I haven't been able to find this explicitly stated anywhere yet, but a bunch of examples I've found online follow what I've been doing. I have a C# class which uses ODP.net to connect to an Oracle DB and run a procedure that's in a package. My package has...
{ "language": "en", "url": "https://stackoverflow.com/questions/358135", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Remove duplicate items with minimal auxiliary memory? What is the most efficient way to remove duplicate items from an array under the constraint that axillary memory usage must be to a minimum, preferably small enough to not even require any heap allocations? Sorting seems like the obvious choice, but this is clea...
{ "language": "en", "url": "https://stackoverflow.com/questions/358136", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: I think this is some kind of encoding problem I have two computers. Both running WinXP SP2 (I don't really know ho similar they are beyond that). I am running MS Visual C# 2008 express edition on both and that's what I'm currently using to program. I made an application that loads in an XML file and displays the c...
{ "language": "en", "url": "https://stackoverflow.com/questions/358147", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Binding gridviews to viewstate until being able to write to database I recently began working on a project which has many gridviews on a single page. During creation of a new record, the user needs to be able to add/remove/edit these gridviews and then save to the database at the end. The problem with this obviously...
{ "language": "en", "url": "https://stackoverflow.com/questions/358151", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Moq tests using ExpectSet() with It.Is() aren't behaving as... expected I've isolated the behaviour into the following test case. I'd be grateful to anyone who can tell me how to expect/verify a property set for a List<T> property - it appears there's something going on inside It.Is<T>(predicate) that isn't making a...
{ "language": "en", "url": "https://stackoverflow.com/questions/358160", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to create a custom "confirm" & pause js execution until user clicks button? Ok, I'm doing a bunch of RIA/AJAX stuff and need to create a "pretty", custom confirm box which is a DIV (not the built-in javascript confirm). I'm having trouble determining how to accomplish a pause in execution to give the user a chan...
{ "language": "en", "url": "https://stackoverflow.com/questions/358168", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Need help setting up scaffolding for this situation I asked a question earlier, and got an excellent response, but, being a newbie to Rails and still getting the basics down, I need someone to show me how to set up some scaffolding for the situation that Hates_ was nice enough to outline for me. I've set up my appli...
{ "language": "en", "url": "https://stackoverflow.com/questions/358178", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How would I dynamically add a new XML node based on the values of other nodes? Background: I have an old web CMS that stored content in XML files, one XML file per page. I am in the process of importing content from that CMS into a new one, and I know I'm going to need to massage the existing XML in order for the im...
{ "language": "en", "url": "https://stackoverflow.com/questions/358185", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Can I use chart modules with wxpython? Is it possible to use any chart modules with wxpython? And are there any good ones out there? I'm thinking of the likes of PyCha (http://www.lorenzogil.com/projects/pycha/) or any equivalent. Many modules seem to require PyCairo, but I can't figure out if I can use those with m...
{ "language": "en", "url": "https://stackoverflow.com/questions/358189", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Easiest way to split string into Key / value What's the best way to extract the key and value from a string like this: var myString = 'A1234=B1234'; I originally had something like this: myString.split('='); And that works fine, BUT an equal (=) sign could be used as a key or value within the string plus the strin...
{ "language": "en", "url": "https://stackoverflow.com/questions/358195", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: C# "internal" access modifier when doing unit testing I'm trying to figure out if I should start using more of internal access modifier. I know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project. This makes me ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358196", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "626" }
Q: iPhone: How to get current milliseconds? What is the best way to get the current system time milliseconds? A: // Timestamp after converting to milliseconds. NSString * timeInMS = [NSString stringWithFormat:@"%lld", [@(floor([date timeIntervalSince1970] * 1000)) longLongValue]]; A: I needed a NSNumber object cont...
{ "language": "en", "url": "https://stackoverflow.com/questions/358207", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "251" }
Q: Can't Rebind FormView Control on Postback Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView ID="MyFormView" runat="server" DataSourceID="MyXmlDataSource"> <ItemTemplate> <h1><%# XPath("SomeNode")%></h1> <asp:Label ID="MyLabel" runat="server" Assoc...
{ "language": "en", "url": "https://stackoverflow.com/questions/358209", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Best practices to test Asp.net MVC applications Whats the best practice to test an Asp.net MVC application? A: Choose your testing framework - I recommend xUnit.net. Decouple your classes using interfaces and use constructor injection in your controllers to satisfy dependencies. In your tests, pass mocks to your co...
{ "language": "en", "url": "https://stackoverflow.com/questions/358210", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Mocking Database call Asp.net MVC application How can I mock the database calls to make my application logic been tested without database? A: Use the repository pattern and mock it in your tests using a mocking framework such as MoQ. Edit: check out this article by Stephen Walther on MoQ. A: Repository pattern wit...
{ "language": "en", "url": "https://stackoverflow.com/questions/358213", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Have you come across any reason for three levels of indirection? Just flicking through one of my favourite books (Ellen Ullman's The Bug) and there is a small bit where one programmer confronts another over three levels of indirection: ***object_array = ***winarray; I get the idea of double indirection - a way of p...
{ "language": "en", "url": "https://stackoverflow.com/questions/358220", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: log4j with timestamp per log entry this is my log output INFO main digestemails - process inbox INFO main digestemails - checking for emails in c:\development\DCMail\email\KN-Source INFO main digestemails - digesting 003d01c95a7b_3446880_0202fea9@xxxx.com.eml INFO main digestemails - extracting attachments INFO main...
{ "language": "en", "url": "https://stackoverflow.com/questions/358225", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "61" }
Q: jQuery: Can I do $('.superset').$('.within') instead of $('.within', $('.superset'))? Can jQuery be extended so that I can use the above syntax? I can't figure out how to prototype whatever it is $() returns, so that I can call $().$() Thanks. A: you can use find() eg: $('.superset').find('.within'); or much simple...
{ "language": "en", "url": "https://stackoverflow.com/questions/358230", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Space-Efficient Data Structure for Storing a Word List? Is there anything better than a Trie for this situation? * *Storing a list of ~100k English words *Needs to use minimal memory *Lookups need to be reasonable, but don't have to be lightning fast I'm working with Java, so my first attempt was to just use ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358240", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Does anyone know how to listen to build events from an already running cctray process, in C#? I have made a C# application and I am trying to figure out if I can tap into build events of cctray (cruise control tray)? I don't want to re-invent the wheel, I just want to know when my builds fail or succeed (on a client...
{ "language": "en", "url": "https://stackoverflow.com/questions/358251", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: ASP.NET MVC Upgrade to Beta: IControllerFactory is defined in an assembly that is not referenced I'm currently in the process of updating a site from preview 2 of ASP.NET MVC to the Beta release. I'm down to my last compile error with no solution in site after an exhaustive search. I have some code in Global.asax.cs...
{ "language": "en", "url": "https://stackoverflow.com/questions/358260", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Is it possible to redirect post data? I have a website where all requests are redirected silently (via .htaccess) to index.php and then PHP is used to show the correct page (by parsing the REQUEST_URI). I was wondering if it's possible to submit POST data to a fake address too? I've currently got my form like so... ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358263", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "62" }
Q: How do I catch events from an SSIS package loaded in C#? I have an SSIS package that executes several tasks. I manually added an event handler inside Business Intelligence Studio 2005 at the package level for the OnExecStatusChanged event. My question is, how can I add a handler for this event inside C#? I have load...
{ "language": "en", "url": "https://stackoverflow.com/questions/358273", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Moving tables with a certain prefix to a new database I have a bunch of tables in a sql server database (all with a certain prefix, e.g. ABC_table1), and I want to move ALL tables with this prefix to another database. Is there a way in which this can be done? I am using SQL Server 2k5. Thanks A: Figure out the uid ...
{ "language": "en", "url": "https://stackoverflow.com/questions/358278", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: In a stored procedure, how can I get the name of the sproc in SQL Server 2005? I want to dynamically get the name of the current stored procedure inside itself for logging purposes. A: Try this: OBJECT_NAME(@@PROCID)
{ "language": "en", "url": "https://stackoverflow.com/questions/358285", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }