text
stringlengths
8
267k
meta
dict
Q: WCF - How to accept long strings as parameters I have a simple web service, it takes 2 parameters one is a simple xml security token, the other is usually a long xml string. It works with short strings but longer strings give a 400 error message. maxMessageLength did nothing to allow for longer strings. A: After th...
{ "language": "en", "url": "https://stackoverflow.com/questions/135745", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to keep from duplicating path variable in csh It is typical to have something like this in your cshrc file for setting the path: set path = ( . $otherpath $path ) but, the path gets duplicated when you source your cshrc file multiple times, how do you prevent the duplication? EDIT: This is one unclean way of do...
{ "language": "en", "url": "https://stackoverflow.com/questions/135754", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How can I find the version of an installed Perl module? How do you find the version of an installed Perl module? This is in an answer down at the bottom, but I figure it important enough to live up here. With these suggestions, I create a function in my .bashrc function perlmodver { perl -M$1 -e 'print "Version...
{ "language": "en", "url": "https://stackoverflow.com/questions/135755", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "64" }
Q: Why Can't I Inherit IO.Directory? Why can't I create a class in VB.NET that inherits System.IO.Directory? According to Lutz Roeder, it is not declared as NotInheritable! I want to create a utility class that adds functionality to the Directory class. For instance, I want to add a Directory.Move function. Please ad...
{ "language": "en", "url": "https://stackoverflow.com/questions/135759", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Silverlight 2 and the MVP Pattern Any ideas on how i get MVP working with Silverlight? How Do I get around the fact there is no load event raised? This the view I have: public partial class Person: IPersonView { public event RoutedEventHandler Loaded; public Person() { n...
{ "language": "en", "url": "https://stackoverflow.com/questions/135775", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: A StringToken Parser which gives Google Search style "Did you mean:" Suggestions Seeking a method to: Take whitespace separated tokens in a String; return a suggested Word ie: Google Search can take "fonetic wrd nterpreterr", and atop of the result page it shows "Did you mean: phonetic word interpreter" A solution ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135777", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Generic logging of function parameters in exception handling A lot of my C# code follows this pattern: void foo(string param1, string param2, string param3) { try { // do something... } catch(Exception ex) { LogError(String.Format("Error in foo(param1={0}, param2={1}, param3={2})...
{ "language": "en", "url": "https://stackoverflow.com/questions/135782", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "32" }
Q: TDD. When you can move on? When doing TDD, how to tell "that's enough tests for this class / feature"? I.e. when could you tell that you completed testing all edge cases? A: Kent Beck's advice is to write tests until fear turns into boredom. That is, until you're no longer afraid that anything will break, assuming...
{ "language": "en", "url": "https://stackoverflow.com/questions/135789", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Determining the port a Visual Studio Web App runs on I've been using the macro from this blog entry for attaching the Visual Studio debugger to an already running instance of the Web Application I'm currently working on. However, if I have more than one instance of the Visual Studio web server running it's pot luck ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135799", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is the best way to get a cookie by name in JavaScript? I am using prototype and I can't find any built in extensions to set or retrieve cookies. After googling for a little bit, I see a few different ways to go about it. I was wondering what you think is the best approach for getting a cookie in JavaScript? A:...
{ "language": "en", "url": "https://stackoverflow.com/questions/135801", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Put a process in a sandbox where it can do least harm I'm looking for the concept to spawn a process such that: * *it has only access to certain libraries/APIs *it cannot acess the file system or only specific parts *it can do least harm should malicious code run in it This concept is known as sandbox or jail. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135802", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: DragDrop registration did not succeed System.InvalidOperationException: DragDrop registration did not succeed. ---> System.Threading.ThreadStateException: What does this exception mean? I get it at this line trying to add a panel to a panel at runtime... splitReport.Panel1.Controls.Add(ChartPanel); Working in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135803", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: For tabular data, what renders faster, CSS or ? I am looking for some stats on current browsers for how long it takes to render a table using plain HTML versus a hacked-up CSS puritan method that avoids using actual TABLE, TR, TD etc. tags. I am not looking for what's proper, only for what's faster, particularly on ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135826", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Application specific metadata in SOAP header Do you think its a good idea to put our application specific metadata in the SOAP header? E.g. In our organization, we want to track each message as it passes through various services, I want to track service path (just like TCP) to know which all services processed the m...
{ "language": "en", "url": "https://stackoverflow.com/questions/135832", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Python: SWIG vs ctypes In python, under what circumstances is SWIG a better choice than ctypes for calling entry points in shared libraries? Let's assume you don't already have the SWIG interface file(s). What are the performance metrics of the two? A: I have a rich experience of using swig. SWIG claims that it is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135834", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "63" }
Q: Limiting the number of records from mysqldump? I am trying to load a small sample of records from a large database into a test database. How do you tell mysqldump to only give you n records out of 8 million? Thanks A: mysqldump can be given a SQL query to execute, from which it will take the data for the dump. You ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135835", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "159" }
Q: Marking A Class Static in VB.NET As just stated in a recent question and answer, you can't inherit from a static class. How does one enforce the rules that go along with static classes inside VB.NET? Since the framework is compatible between C# and VB it would make sense that there would be a way to mark a class s...
{ "language": "en", "url": "https://stackoverflow.com/questions/135841", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "94" }
Q: Are booleans as method arguments unacceptable? A colleague of mine states that booleans as method arguments are not acceptable. They shall be replaced by enumerations. At first I did not see any benefit, but he gave me an example. What's easier to understand? file.writeData( data, true ); Or enum WriteMode { Appe...
{ "language": "en", "url": "https://stackoverflow.com/questions/135845", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "124" }
Q: How do I serve a script with apache instead of running it? I'm trying to host a python script using an apache web server, but the server tries to run the script instead of just offering it for download. I do not have direct access to server, and adding the line AddType text/plain .py to .htaccess in the root folder...
{ "language": "en", "url": "https://stackoverflow.com/questions/135849", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Zooming an element and its contents-- an alternative to CSS3's zoom property? Is there a cross-browser method to emulate CSS3's zoom property? I know how to zoom images and text separately, but cannot seem to keep everything aligned. One solution might be to read the computed styles of the element and its children,...
{ "language": "en", "url": "https://stackoverflow.com/questions/135894", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: where can I find a description of *all* MIPS instructions Does anyone know of a web site where I can find a list of 32-bit MIPS instructions/opcodes, with the following features: * *Clearly distinguishes between real opcodes and assembly-language macros (pseudo-instructions) *Describes the instruction behavior in...
{ "language": "en", "url": "https://stackoverflow.com/questions/135896", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: What is the method for converting radians to degrees? I run into this occasionally and always forget how to do it. One of those things that pop up ever so often. Also, what's the formula to convert angles expressed in radians to degrees and back again? A: In javascript you can do it this way radians = degrees * (Ma...
{ "language": "en", "url": "https://stackoverflow.com/questions/135909", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "174" }
Q: java.net.SocketException: Software caused connection abort: recv failed I haven't been able to find an adequate answer to what exactly the following error means: java.net.SocketException: Software caused connection abort: recv failed Notes: * *This error is infrequent and unpredictable; although getting this err...
{ "language": "en", "url": "https://stackoverflow.com/questions/135919", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "92" }
Q: Can you have just a comment in a block of your SQL if-statement? I'd like to just put in a comment in the block of my if-statement, but I get an error when I try. I want to be more like Steve McConnell. declare @ConstraintName varchar(255) set @ConstraintName = 'PK_Whatever' IF LEFT(@ConstraintName, 2) = 'PK' BEGIN...
{ "language": "en", "url": "https://stackoverflow.com/questions/135929", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Strategy for storing an string of unspecified length in Sql Server? So a column will hold some text that beforehand I won't know how long the length of this string can be. Realistically 95% of the time, it will probably be between 100-500 chars, but there can be that one case where it will 10000 chars long. I have n...
{ "language": "en", "url": "https://stackoverflow.com/questions/135933", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I pInvoke the function SHCameraCapture (camera dialog) from Aygshell.dll from WinMO6 I need to show a camera capture dialog in a compact framework 3.7 application by pinvoking SHCameraCapture from the dll Aygshell.dll. I cannont use the managed object CameraCaptureDialog because of limitations with the techn...
{ "language": "en", "url": "https://stackoverflow.com/questions/135934", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Flash: Listen to all events of a type with one eventlistener It's not a matter of life or death but I wonder if this could be possible: I got a couple of events from one type of custom event (FormEvent) now I got a FormListener that listens to all those events and handles them according to the event type. Instead of...
{ "language": "en", "url": "https://stackoverflow.com/questions/135938", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Encrypting Source Code I work on relatively sensitive code that we wouldn't want falling into the wrong hands. Up until now, all the code has been keep in house so it hasn't been an issue. I am moving to working from home a day or two a week and we want to secure the code on my laptop. We have looked at a few altern...
{ "language": "en", "url": "https://stackoverflow.com/questions/135943", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Can PHP's SQL Server driver return SQL return codes? Stored procs in SQL Server sometimes finish with a return code, as opposed to a recordset of data. I've seen ASP code that's able to get this return code, but I can't figure out how to get this code with PHP's mssql driver. mssql_get_last_message() always returns...
{ "language": "en", "url": "https://stackoverflow.com/questions/135944", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to convert Cardinal numbers into Ordinal ones Is there an easy way to convert the number 1, 2, 3, ... to "1st", "2nd", "3rd", ..., and in such a way that I can give the function a language and have it return me the correct form for the language I'm targeting? Either standard C++ (stl or boost OK), MFC or ATL, wi...
{ "language": "en", "url": "https://stackoverflow.com/questions/135946", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Is there a tool to discover if the same class exists in multiple jars in the classpath? If you have two jars in your classpath that contain different versions of the same class, the classpath order becomes critical. I am looking for a tool that can detect and flag such potential conflicts in a given classpath or set...
{ "language": "en", "url": "https://stackoverflow.com/questions/135971", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: Is it possible to define a Ruby singleton method using a block? So, I want to define a singleton method for an object, but I want to do it using a closure. For example, def define_say(obj, msg) def obj.say puts msg end end o = Object.new define_say o, "hello world!" o.say This doesn't work because defining...
{ "language": "en", "url": "https://stackoverflow.com/questions/135995", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Comet and jQuery I've done some research into server push with javascript and have found the general consensus to be that what I'm looking for lies in the "Comet" design pattern. Are there any good implementations of this pattern built on top of jQuery? If not, are there any good implementations of this pattern at a...
{ "language": "en", "url": "https://stackoverflow.com/questions/136012", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "114" }
Q: Quickbooks 2005 Web Integration A customer of ours has Quickbooks 2005 and is looking to have their web data (orders, customers, tax) sent as it is collected from the web in a format that can be imported into Quickbooks 2005 Pro. Does anyone have any experience with this? If so, what was your experience, and what...
{ "language": "en", "url": "https://stackoverflow.com/questions/136026", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Assembly.Load and Environment.CurrentDirectory I realize there is a somewhat related thread on this here: Loading assemblies and its dependencies But I am modifying something and this doesn't exactly apply. string path = Path.GetDirectoryName( pathOfAssembly ); Environment.CurrentDirectory = path; Assembly.Load(P...
{ "language": "en", "url": "https://stackoverflow.com/questions/136028", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I get PHP's (deployment) simplicity but Perl's power? I despise the PHP language, and I'm quite certain that I'm not alone. But the great thing about PHP is the way that mod_php takes and hides the gory details of integrating with the apache runtime, and achieves CGI-like request isolation and decent perfor...
{ "language": "en", "url": "https://stackoverflow.com/questions/136033", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Pass and return custom array object in ibatis and oracle in java I've looked around for a good example of this, but I haven't run into one yet. I want to pass a custom string array from java to oracle and back, using the IBATIS framework. Does anyone have a good link to an example? I'm calling stored procs from I...
{ "language": "en", "url": "https://stackoverflow.com/questions/136034", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Catch multiple exceptions at once? It is discouraged to simply catch System.Exception. Instead, only the "known" exceptions should be caught. Now, this sometimes leads to unnecessary repetitive code, for example: try { WebId = new Guid(queryString["web"]); } catch (FormatException) { WebId = Guid.Empty; } ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/136035", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2507" }
Q: Prevent visual studio creating browse info (.ncb) files Is there a way to prevent VS2008 creating browse info file files for C++ projects. I rarely use the class browser and it isn't worth the time it takes to recreate it after every build, especially since it runs even if the build failed. EDIT - it's also needed f...
{ "language": "en", "url": "https://stackoverflow.com/questions/136050", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How do I format a String in an email so Outlook will print the line breaks? I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers ar...
{ "language": "en", "url": "https://stackoverflow.com/questions/136052", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "81" }
Q: How to check if a file has the win2003 "blocked" option on it How do I check from within my NSIS installer if my installer has the blocked option in preferences on it. Even if you know of a way to check this without NSIS, please let me know so I can script it myself. See this question to find out more info about t...
{ "language": "en", "url": "https://stackoverflow.com/questions/136065", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I profile a Perl web app? I am working on a web app that uses Perl and I need to look into speeding up portions of the app. I thought I'd start profiling the particular calls for the portion I wish to investigate. I've done some searching on profiling Perl code, but unfortunately most of what I find says t...
{ "language": "en", "url": "https://stackoverflow.com/questions/136067", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Python web development - with or without a framework I am planning on porting a PHP application over to Python. The application is mostly about data collection and processing. The main application runs as a stand alone command line application. There is a web interface to the application which is basically a very...
{ "language": "en", "url": "https://stackoverflow.com/questions/136069", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Difference between @staticmethod and @classmethod What is the difference between a method decorated with @staticmethod and one decorated with @classmethod? A: Here is a short article on this question @staticmethod function is nothing more than a function defined inside a class. It is callable without instantiating...
{ "language": "en", "url": "https://stackoverflow.com/questions/136097", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4504" }
Q: Grails 1.0.3 console reports 'premature end of file' Browsing to a dynamic web page built using Grails version 1.0.3 the console log shows the following errors for each page request: [Fatal Error] :-1:-1: Premature end of file. How do I stop this error from appearing for each request? A: The log entry occurs when ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136098", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Why won't Visual Studio 2005 generate an Xml Serialization assembly? Why isn't Visual Studio 2005 generating a serialization setting when I set the project setting "Generate Serialization Assembly" to "On"? A: It turns out that Dev Studio only honors this setting for Web Services. For non-web services you can get t...
{ "language": "en", "url": "https://stackoverflow.com/questions/136104", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Windows Forms: How do you change the font color for a disabled label I am trying to set the disabled font characteristics for a Label Control. I can set all of the Font characteristics (size, bold, etc), but the color is overridden by the default windows behavior which seems to be one of these two colors: * *If ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136129", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Better Way of Manipulating RichText in C#? I need to create and copy to the clipboard some RichText with standard "formatting" like bold/italics, indents and the like. The way I'm doing it now seems kind of inelegant... I'm creating a RichTextBox item and applying my formatting through that like so: RichTextBox rtb...
{ "language": "en", "url": "https://stackoverflow.com/questions/136132", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: ASP.NET Custom Controls - Rendering Image from a Pool of Images at Design Time I have been working on a ImageRotator control and finished weeding out any oddities with it tonight, and it works great. However, there is one thing that is bugging me with it. It doesn't display anything at design time (I just get the im...
{ "language": "en", "url": "https://stackoverflow.com/questions/136135", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Regular expression to test whether a string consists of a valid real number in base 10 Examples: "1" yes "-1" yes "- 3" no "1.2" yes "1.2.3" no "7e4" no (though in some cases you may want to allow scientific notation) ".123" yes "123." yes "." no "-.5" yes "007" yes "00" yes A: This allo...
{ "language": "en", "url": "https://stackoverflow.com/questions/136146", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Visual Studio 2008 Properties Window SLOW Even after all the hotfixes and updates that are supposed to fix this, my properties window in Visual Studio 2008 is still SLOW! What happens is a click on a table cell or something similar in the web editor, and regardless of the size of the page I'm working on, it takes a...
{ "language": "en", "url": "https://stackoverflow.com/questions/136165", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Get last n lines of a file, similar to tail I'm writing a log file viewer for a web application and for that I want to paginate through the lines of the log file. The items in the file are line based with the newest item at the bottom. So I need a tail() method that can read n lines from the bottom and support an o...
{ "language": "en", "url": "https://stackoverflow.com/questions/136168", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "202" }
Q: How do I use a common log4net reference in assemblies loaded at runtime? I have a single-threaded application that loads several assemblies at runtime using the following: objDLL = Assembly.LoadFrom(strDLLs[i]); I would like the assemblies loaded in this manner to use the same log4net.ILog reference as the rest of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136172", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Fastest small datastore on Windows My app keeps track of the state of about 1000 objects. Those objects are read from and written to a persistent store (serialized) in no particular order. Right now the app uses the registry to store each object's state. This is nice because: * *It is simple *It is very fast...
{ "language": "en", "url": "https://stackoverflow.com/questions/136175", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How should I use git diff for long lines? I'm running git-diff on a file, but the change is at the end of a long line. If I use cursor keys to move right, it loses colour-coding—and worse the lines don't line up—making it harder to track the change. Is there a way to prevent that problem or to simply make the lines ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136178", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "255" }
Q: What is the best approach to centralzing error messages in an application? All throughout an application wherever error messages (or other user messages) are used I typically hard-code a string. Obviosly this can be really bad (especially when you may have to come back and localize an app). What is the best approach...
{ "language": "en", "url": "https://stackoverflow.com/questions/136190", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I make this "Use of uninitialized value" warning go away? Let's say I want to write a regular expression to change all <abc>, <def>, and <ghi> tags into <xyz> tags.. and I also want to change their closing tags to </xyz>. This seems like a reasonable regex (ignore the backticks; StackOverflow has trouble with...
{ "language": "en", "url": "https://stackoverflow.com/questions/136191", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Trying to set/get a JavaScript variable in an ActiveX WebBrowser from C# We have a windows application that contains an ActiveX WebBrowser control. As part of the regular operation of this application modifications are made to the pages that are displayed by the ActiveX WebBrowser control. Part of these modification...
{ "language": "en", "url": "https://stackoverflow.com/questions/136195", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What's the point of Perl's map? Not really getting the point of the map function. Can anyone explain with examples its use? Are there any performance benefits to using this instead of a loop or is it just sugar? A: The map function is an idea from the functional programming paradigm. In functional programming, fun...
{ "language": "en", "url": "https://stackoverflow.com/questions/136204", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "34" }
Q: How can I write an SNMP agent or SNMP extension agent DLL in C# I need to write an SNMP agent for my application. I read the CodeProject article on how to write an SNMP extension agent DLL using win32, but would like to know if it is possible to do it with managed code. Also, is it possible to write my own SNMP agen...
{ "language": "en", "url": "https://stackoverflow.com/questions/136206", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: How do you manage your custom modules? I write tons of python scripts, and I find myself reusing lots code that I've written for other projects. My solution has been to make sure the code is separated into logical modules/packages (this one's a given). I then make them setuptools-aware and publish them on PyPI. This...
{ "language": "en", "url": "https://stackoverflow.com/questions/136207", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Silverlight Security- Sensitive Data Silverlight works on client side so putting any sensitive data like connection strings, passwords etc. in the code seems not to be a good thing. I want to build whole web app in Silverlight doing lots of authorization and database quering things. How to make it safe? Any tips&tri...
{ "language": "en", "url": "https://stackoverflow.com/questions/136219", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: redirect STDERR in tcsh from .aliases in tcsh I'm trying to redirect STDERR from a command from my .aliases file. I found that I can redirect STDERR from the command line like this. . . $ (xemacs > /dev/tty) >& /dev/null . . . but when I put this in my .aliases file I get an alias loop. . . $ cat .aliases alias xem...
{ "language": "en", "url": "https://stackoverflow.com/questions/136233", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Parsing a raw email message that may be in html or various strange encodings and converting it to plain text, the way, say, pine might display it The reason I want to do this is to make it easy to parse out instructions that are emailed to a bot, the kind of thing majordomo might do to parse commands like subscribin...
{ "language": "en", "url": "https://stackoverflow.com/questions/136235", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Visual Studios Link.exe error: "extra operand" Our build process uses Visual Studios 2003 link.exe for linking. On one machine we're seeing the following error: _X86_Win32/Debug/Intermediate/OurApp.exe LINK: extra operand `/subsystem:windows' Try `LINK --help' for more information It appears to be using the same v...
{ "language": "en", "url": "https://stackoverflow.com/questions/136237", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Trouble when adding a lot of Controls to a .NET Windows Form (C#) I have a Windows Form app written in C#. Its job is to send messages to a list of users. While those messages are being sent, I'd like to display status of the operation for each user. What I am doing (for each user) is creating a Label control and ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136238", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why should you remove unnecessary C# using directives? For example, I rarely need: using System.Text; but it's always there by default. I assume the application will use more memory if your code contains unnecessary using directives. But is there anything else I should be aware of? Also, does it make any difference...
{ "language": "en", "url": "https://stackoverflow.com/questions/136278", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "230" }
Q: Ajax autocomplete extender populated from SQL OK, first let me state that I have never used this control and this is also my first attempt at using a web service. My dilemma is as follows. I need to query a database to get back a certain column and use that for my autocomplete. Obviously I don't want the query to ru...
{ "language": "en", "url": "https://stackoverflow.com/questions/136284", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: PHP/MySQL update a news record in a database problem I have this PHP code that I am trying to use to let a user edit a news record in a form and then when they hit the submit button, it will update the record in a database. The problem is that everything works but the record is not actually updated in the database. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136288", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What's required for a clean uninstall of Visual Studio 2005 Due to continuing crash problems, I'm about to uninstall and reinstall my copy of Visual Studio 2005. I know that just running the uninstaller leaves a lot of resources and settings on my machine and would like to be able to reinstall from a pristine state....
{ "language": "en", "url": "https://stackoverflow.com/questions/136298", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to configure Tomcat JULI logging to roll log files? I have a several webapps which use java.util.logging. Tomcat 5.5 is configured to use the Juli logger so that each webapp has its own log file. The problem is that Juli does not have properties for maximum file size and file count. Using Juli the files will ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136300", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: How do you refresh maven dependencies from eclipse? We recently started using maven for dependency management. Our team uses eclipse as it's IDE. Is there an easy way to get eclipse to refresh the maven dependencies without running mvn eclipse:eclipse? The dependencies are up to date in the local maven repository, b...
{ "language": "en", "url": "https://stackoverflow.com/questions/136308", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Is this a crazy way to handle multi Validation types with IDataError and WPF? We are using the standard method for our controls to report broken BO rules. This is done via the interface IDataError in our BO’s and in XAML the control is bound to the BO’s property etc. This approach works OK. But we need to show 2 typ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136336", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Does a definitive list of design patterns exist? Where did the idea of design patterns come from, who decided what is and isn't a pattern and gave them their names? Is there an official organisation that defines them, or do they exist through some community consensus? A: Short answer: No. Long answer: Since if som...
{ "language": "en", "url": "https://stackoverflow.com/questions/136337", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "46" }
Q: Adding referenced Eclipse projects to Maven dependencies Right now, I have two Eclipse projects - they both use Maven 2 for all their jar-dependency goodness. Inside Eclipse, I have project Foo included in project Bar's build path, so that I can use Foo's classes from project Bar. This works really well in Eclipse ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136362", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "25" }
Q: How can I leverage an ORM for a database whose schema is unknown until runtime? I am trying to leverage ORM given the following requirements: 1) Using .NET Framework (latest Framework is okay) 2) Must be able to use Sybase, Oracle, MSSQL interchangeably 3) The schema is mostly static, BUT there are dynamic parts. I ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136366", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Reversing an RSS feed This could be weird, Have you ever come across a blog which you wanted to read in the chronological order? And that blog could be old, with several hundred posts. When i add this feed to my feed reader, say googlereader, the latest feed comes on top and as i scroll down further, the older posts...
{ "language": "en", "url": "https://stackoverflow.com/questions/136401", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Flex - Avoid click event on container when enclosed component is clicked I have a Flex application where I'm using a Canvas to contain several other components. On that Canvas there is a Button which is used to invoke a particular flow through the system. Clicking anywhere else on the Canvas should cause cause a d...
{ "language": "en", "url": "https://stackoverflow.com/questions/136413", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Get integer value of the current year in Java I need to determine the current year in Java as an integer. I could just use java.util.Date(), but it is deprecated. A: For Java 8 onwards: int year = Year.now().getValue(); For older version of Java: int year = Calendar.getInstance().get(Calendar.YEAR); A: Use the f...
{ "language": "en", "url": "https://stackoverflow.com/questions/136419", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "365" }
Q: Don't wait for the process to exit I have a PHP script that is called from a cron job every minute. This script takes some info from the database and then calls another PHP script using the System function (passing it some parameters). That means that I can start up to 10 scripts from this "main" one. And what I wou...
{ "language": "en", "url": "https://stackoverflow.com/questions/136429", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Compressing HTTP request with LWP, Apache, and mod_deflate I have a client/server system that performs communication using XML transferred using HTTP requests and responses with the client using Perl's LWP and the server running Perl's CGI.pm through Apache. In addition the stream is encrypted using SSL with certif...
{ "language": "en", "url": "https://stackoverflow.com/questions/136432", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Any way to make a WPF textblock selectable? How to allow TextBlock's text to be selectable? I tried to get it to work by displaying the text using a read-only TextBox styled to look like a textblock but this will not work in my case because a TextBox does not have inlines. In other words, how to make it selectable? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136435", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "257" }
Q: How do I run a series of processes in C# and keep their environment settings? I am developing an auto-builder that will run a series of steps in our build process and build our target application. We used to use a batch file which set up a bunch of environment variables or called tools that setup environment variabl...
{ "language": "en", "url": "https://stackoverflow.com/questions/136436", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Why doesn't IE7 copy blocks to the clipboard correctly? We've noticed that IE7 has an odd behavor with code blocks posted on Stack Overflow. For example, this little code block: public PageSizer(string href, int index) { HRef = href; PageIndex = index; } Copy and pasted from IE7, ends up like this: pub...
{ "language": "en", "url": "https://stackoverflow.com/questions/136443", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "37" }
Q: How do I send an ARP packet from a C program? I'm working on an embedded linux system in C, I'm looking for the source code to the equivalet of SendARP in Windows. Any pointers? A: Take a look at arping. The quick and dirty way of sending an arp would be to do: foo = system("/somepath/arping somehost"); But a loo...
{ "language": "en", "url": "https://stackoverflow.com/questions/136444", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Probability problem - Duplicates when choosing from large basket I need to explain to the client why dupes are showing up between 2 supposedly different exams. It's been 20 years since Prob and Stats. I have a generated Multiple choice exam. There are 192 questions in the database, 100 are chosen at random (no dupe...
{ "language": "en", "url": "https://stackoverflow.com/questions/136456", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Change the URL in the browser without loading the new page using JavaScript How would I have a JavaScript action that may have some effects on the current page but would also change the URL in the browser so if the user hits reload or bookmark, then the new URL is used? It would also be nice if the back button wou...
{ "language": "en", "url": "https://stackoverflow.com/questions/136458", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "303" }
Q: DRY way of re-raising same set of exceptions in multiple places short: Is there a way in Ruby to DRY-ify this: def entry_point_one begin do_something rescue MySyntaxErrorOne, MySyntaxErrorTwo, MySyntaxErrorEtc => syn_err raise syn_err.exception(syn_err.message) end end def entry_point_two begin ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136467", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: best way to pick a random subset from a collection? I have a set of objects in a Vector from which I'd like to select a random subset (e.g. 100 items coming back; pick 5 randomly). In my first (very hasty) pass I did an extremely simple and perhaps overly clever solution: Vector itemsVector = getItems(); Collection...
{ "language": "en", "url": "https://stackoverflow.com/questions/136474", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "70" }
Q: Something Good & Something Bad about SharePoint I'm trying to wrap my head around SharePoint. Why is it good? Why is it bad? At a glance it appears to offer some incredible collaboration tools. However, the cost looks astronomical and it seems to be rigid & difficult to customize. To those who've worked with Shar...
{ "language": "en", "url": "https://stackoverflow.com/questions/136483", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Copy&paste from Office 2007 into I want to copy and paste text from a Office 2007 document (docx) into a textarea. On Window, using Firefox 3, there is additional jiberish that gets put into the field: ...Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Normal 0 false false false EN-US X...
{ "language": "en", "url": "https://stackoverflow.com/questions/136485", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Does XSLT have a Split() function? I have a string in a node and I'd like to split the string on '?' and return the last item in the array. For example, in the block below: <a> <xsl:attribute name="href"> /newpage.aspx?<xsl:value-of select="someNode"/> </xsl:attribute> Link text </a> I'd like to...
{ "language": "en", "url": "https://stackoverflow.com/questions/136500", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "43" }
Q: Searching for UUIDs in text with regex I'm searching for UUIDs in blocks of text using a regex. Currently I'm relying on the assumption that all UUIDs will follow a patttern of 8-4-4-4-12 hexadecimal digits. Can anyone think of a use case where this assumption would be invalid and would cause me to miss some UUIDs? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136505", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "354" }
Q: Java VNC Applet Does any one know of an opensource Java VNC server, that can be run from a web page, so requiring no installation on the server end, possibley applet based. A: A signed Java applet (or application) can use the Robot class to get screenshots of the current window and use this for remote control. It ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136518", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Using .NET's Reflection.Emit to generate an interface I need to generate a new interface at run-time with all the same members as an existing interface, except that I will be putting different attributes on some of the methods (some of the attribute parameters are not known until run-time). How can it be achieved? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136528", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Possible to retrieve IDENTITY column value on insert using SqlCommandBuilder (without using Stored Proc)? FYI: I am running on dotnet 3.5 SP1 I am trying to retrieve the value of an identity column into my dataset after performing an update (using a SqlDataAdapter and SqlCommandBuilder). After performing SqlDataAdap...
{ "language": "en", "url": "https://stackoverflow.com/questions/136536", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: Determining if a folder is shared in .NET Is there a way through the .net framework to determine if a folder is shared or not? Neither Diretory, DirectoryInfo or FileAttributes seem to have any corresponding field. One thing I forgot to mention was that I want to be checking for network shares. But I'll investigate...
{ "language": "en", "url": "https://stackoverflow.com/questions/136539", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Pro/con: Initializing a variable in a conditional statement In C++ you can initialize a variable in an if statement, like so: if (CThing* pThing = GetThing()) { } Why would one consider this bad or good style? What are the benefits and disadvantages? Personally i like this style because it limits the scope of the p...
{ "language": "en", "url": "https://stackoverflow.com/questions/136548", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Timeout doesn't work with '-re' flag in expect script I'm trying to get an expect script to work, and when I use the -re flag (to invoke regular expression parsing), the 'timeout' keyword seems to no longer work. When the following script is run, I get the message 'timed out at step 1', then 'starting step 2' and th...
{ "language": "en", "url": "https://stackoverflow.com/questions/136554", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to have a Label inherite a Composite's GC in SWT I'm writing an app and our designers want to use gradients for some of the backgrounds on a few of our composites. I wrote the following code: composite.addListener (SWT.Paint, new Listener () { public void handleEvent (Event e) { GC gc = e.gc; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/136580", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }