text
stringlengths
8
267k
meta
dict
Q: Why is the GUID structure declared the way it is? In rpc.h, the GUID structure is declared as follows: typedef struct _GUID { DWORD Data1; WORD Data2; WORD Data3; BYTE Data[8]; } GUID; I understand Data1, Data2, and Data3. They define the first, second, and third sets of hex digits when writin...
{ "language": "en", "url": "https://stackoverflow.com/questions/276524", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Get object's DataContext If I have the LINQ objects: public class SampleDataContext : DataContext { public Table<Customer> Customers { get { return this.GetTable<Customer>(); } } public SampleDataContext( string connectionString ) : base( connectionString ) { } } [Table( Name="dbo.tblCustomers" )] public cl...
{ "language": "en", "url": "https://stackoverflow.com/questions/276531", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How to run a console application with command line parameters in Visual C++ 6.0? I've got a console application that compiles and executes fine with Visual C++ 6.0, except that it will then only get as far as telling me about missing command line parameters. There doesn't seem to be anywhere obvious to enter these. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276543", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: Extract words out of a text file Let's say you have a text file like this one: http://www.gutenberg.org/files/17921/17921-8.txt Does anyone has a good algorithm, or open-source code, to extract words from a text file? How to get all the words, while avoiding special characters, and keeping things like "it's", etc......
{ "language": "en", "url": "https://stackoverflow.com/questions/276546", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Setting variables by name in Java I'm looking to implement something in Java along the lines of: class Foo{ private int lorem; // private int ipsum; public setAttribute(String attr, int val){ //sets attribute based on name } public static void main(String [] args){ Foo f = new Foo(); f.setAttribut...
{ "language": "en", "url": "https://stackoverflow.com/questions/276555", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Using windows DLLs in a portable app I have built a windows C++ application that I'd like to port to linux. The main reasons to do this is ease of system maintenance for our IT staff. Apart from the one windows machine that runs this application we're a linux only operation. The reason this application was built in-...
{ "language": "en", "url": "https://stackoverflow.com/questions/276562", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Can Visual Studio Automatically Expand Text with a Code Snippet? In Delphi if I type "if" and space it automatically inserts the code snippet with an if statement block defined. I know in Visual Studio I can insert a snippet, but I have to either right-click and select "insert snippet", or hit CTRL-K followed by CTR...
{ "language": "en", "url": "https://stackoverflow.com/questions/276563", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: .Net Remoting to WCF Challenge! I am trying to migrate my .net remoting code to wcf but I'm finding it difficult. Can someone help me migrate this simple Remoting based program below to use WCF? The program implements a simple publisher/subscriber pattern where we have a single TemperatureProviderProgram that publi...
{ "language": "en", "url": "https://stackoverflow.com/questions/276575", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Preventing Duplicate Inserts Into SQL With PHP I'm going to running thousands of queries into SQL and I need to prevent the duplication of field 'domain'. Never had to do this before and any help would be appreciated. A: You probably want to create a "UNIQUE" constraint on the field "Domain" - this constraint will ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276580", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Mysterious Mongrel Rails crash Running Mongrel 1.1.5 on Rails 2.1.2 using PostgreSQL 8.3 via ruby-pg 0.7.9 on OS X 10.4 server... Added restful_authentication and exception_notification, the latter of which appears to be doing me no good when Mongrel simply dies with "Illegal instruction" every time I select /RESOUR...
{ "language": "en", "url": "https://stackoverflow.com/questions/276581", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Enumeration extension methods In vs2008, is it possible to write an extension methods which would apply to any enumeration. I know you can write extension methods against a specific enumeration, but I want to be able to every enumeration using a single extension method. Is this possible? A: Here's another example -...
{ "language": "en", "url": "https://stackoverflow.com/questions/276585", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "54" }
Q: Tracking Java versions using Google Analytics I am tracking the Java versions being used by web visitors: http://cowwoc.blogspot.com/2008/12/tracking-java-versions-using-google.html Unfortunately, the integration level is skin deep. I would like Google Analytics to tell me what percentage of visitors ran what versio...
{ "language": "en", "url": "https://stackoverflow.com/questions/276587", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Easiest way to convert CArchive to use SQL database for serialization? I have an existing application that uses CArchive to serialize a object structure to a file. I am wondering if can replace the usage of CArchive with some custom class to write to a database the same way that things are serialized. Before I go ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276595", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Can Emacs support projects? Can Emacs support the concept of projects? That would be where several configuration options varies depending on what project you are working on. A: Yes, please look to the EDE package from CEDET library A: Check out the project-local-variables plugin. I haven't used it personally, but ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276601", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: PHP Get URL Contents And Search For String In php I need to get the contents of a url (source) search for a string "maybe baby love you" and if it does not contain this then do x. A: Just read the contents of the page as you would read a file. PHP does the connection stuff for you. Then just look for the string via...
{ "language": "en", "url": "https://stackoverflow.com/questions/276602", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Partially missing gridlines on log-scale charts in Excel 2007 I'm using Excel 2007 to create a log-scale chart of numbers (specifically the Zimbabwean dollar exchange rate) over time. I'm using an x-y scatterplot and noticing one odd quirk. The range of y values (numbers) spans a factor of about 10^30. On every char...
{ "language": "en", "url": "https://stackoverflow.com/questions/276605", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Level of database rebuilding in a daily build routine I am in the process of designing a daily build routine for my project. We are using Flex 3 and SQL Server 2005. I am unsure to what degree I should be rebuilding the database on a daily build. Should I be dropping all tables and stored procedures and adding th...
{ "language": "en", "url": "https://stackoverflow.com/questions/276610", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Checking if something was malloced Given a pointer to some variable.. is there a way to check whether it was statically or dynamically allocated?? A: The ACE library does this all over the place. You may be able to check how they do it. In general you probably shouldn't need to do this in the first place though.....
{ "language": "en", "url": "https://stackoverflow.com/questions/276612", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How to develop *real life* oop skills? I've been studying OOP for quite a while now and I have a good grasp of the theory. I read the Head First book on OOP and, while it reinforced a lot of the theory, I found the case studies to be somewhat trivial. I find that I'm applying OOP principles to my code each day, but...
{ "language": "en", "url": "https://stackoverflow.com/questions/276620", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Book/Resource about setting up load balancing and fail over for Servlet based Java web application We're creating a web system using Java and Servlet technology (actually Wicket for the presentation layer) and we need our system to be available nearly always as our customers will be quite dependent on it. This has l...
{ "language": "en", "url": "https://stackoverflow.com/questions/276623", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: C#: Is there a shortcut to detect if mouse is still hovering on top of Label on MouseHover event? C#: Is there a shortcut to detect if mouse is still hovering on top of Label on MouseHover event? Just curious if there's a bool to check, if not to get mathematical then :(. A: I think math is the only route to determ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276642", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I record AMR audio format on the iPhone? A voice recorder doesn't need uncompressed Linear PCM audio. Compressed AMR would do fine. The iPhone framework built for recording audio is simple enough, but the only examples I've found for setting up the audio format (which come from Apple) use LinearPCM. I've ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276644", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: How to find a locally available UDP port with unix Sockets API I have an application where I have potentially many processes must send a message to one process. I figured the most expedient way to do this would be to just send a UDP datagram. When opening a socket, I need to specify which port to listen to. As I j...
{ "language": "en", "url": "https://stackoverflow.com/questions/276647", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Global Variable Access Solution Ideas I have an initialization class that preloads content into a variable (probably a list or array). There will only be one instance of this initialization class but there will be many classes that need to access the preloaded content. The problem is not many of them are related an...
{ "language": "en", "url": "https://stackoverflow.com/questions/276654", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Can you achieve a case insensitive 'unique' constraint in Sqlite3 (with Django)? So let's say I'm using Python 2.5's built-in default sqlite3 and I have a Django model class with the following code: class SomeEntity(models.Model): some_field = models.CharField(max_length=50, db_index=True, unique=True) I've got...
{ "language": "en", "url": "https://stackoverflow.com/questions/276656", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Number of lines of code in a lifetime One of the companies required from its prospective employee to give the number of lines of code written in the life time in a certain programming language like Java, or C#. Since, most of us have a number of years of experience in different projects in multiple languages and we ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276657", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: How can I override the OnBeforeUnload dialog and replace it with my own? I need to warn users about unsaved changes before they leave a page (a pretty common problem). window.onbeforeunload = handler This works but it raises a default dialog with an irritating standard message that wraps my own text. I need to eith...
{ "language": "en", "url": "https://stackoverflow.com/questions/276660", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "382" }
Q: The best way to process lists of email addresses I have got 3 text files (A, B and C), each with several hundred email addresses. I want to merge list A and list B into a single file, ignoring differences in case and white space. Then I want to remove all emails in the new list that are in list C, again ignoring dif...
{ "language": "en", "url": "https://stackoverflow.com/questions/276666", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Beginners introduction to unit testing in Visual Studio 2008 I'm a self-taught developer and my experience is all in small applications that I've developed. I'm currently working on an application that I've made public, and I've realized that I need to start doing good unit testing to catch regressions and generally...
{ "language": "en", "url": "https://stackoverflow.com/questions/276677", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: WinForms: What is the proper way to change the font style (underline) from a Label at runtime? C#: What is the proper way to change the font style (underline) from a Label at runtime? So far I understand that if you want to change font related properties at runtime from a label, mainly all font properties, you would...
{ "language": "en", "url": "https://stackoverflow.com/questions/276678", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to import a python file in python script more than once Is it possible to import a python file more than once in a python script because i run a loop back to my driver file in a function by using the import command but it only works once? thanks edit: Resolved myself thanks A: You most probably should not use i...
{ "language": "en", "url": "https://stackoverflow.com/questions/276679", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can you change the height/width of an ASP.NET control from a Javascript function? What is the best way to change the height and width of an ASP.NET control from a client-side Javascript function? Thanks, Jeff A: You can use the controls .ClientID and some javascript and change it that way. You can do it through CSS...
{ "language": "en", "url": "https://stackoverflow.com/questions/276693", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What are bitwise operators? I'm someone who writes code just for fun and haven't really delved into it in either an academic or professional setting, so stuff like these bitwise operators really escapes me. I was reading an article about JavaScript, which apparently supports bitwise operations. I keep seeing this op...
{ "language": "en", "url": "https://stackoverflow.com/questions/276706", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "135" }
Q: Design pattern for memcached data caching It's easy to wrap optional memcached caching around your existing database queries. For example: Old (DB-only): function getX x = get from db return x end New (DB with memcache): function getX x = get from memcache if found return x endif x =...
{ "language": "en", "url": "https://stackoverflow.com/questions/276709", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Anyone have any impressions, hints, tutorials from developing for Google Android devices? I have a T-Mobile G1 and I'm going to download the developer SDK and see if I can create a few simple apps for my phone. If you've done similar development, please answer below and tell me about your experience. Please share ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276719", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Dos and don'ts of using files I am preparing a lecture on files for the more junior students in programming class. One of the points I want to elaborate are good practices with files. What are the thing to keep in mind when using files in any programming language? A: * *Files can be considered to contain a set of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276729", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: CSS ul li image to align with text I have a CSS like this ul { list-style-image:url(images/bulletArrow.gif); } ul li { background: url(images/hr.gif) no-repeat left bottom; padding: 5px 0 7px 0; } But the bullet image doesn't align properly in IE (it's fine in Firefox). I already have a background imag...
{ "language": "en", "url": "https://stackoverflow.com/questions/276732", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Normalizing an existing MS Access Database I have one large access database that I need to normalize into five tables and a lookup table. I understand the theory behind normalization and have already sketched out the look of the tables but I am lost on how to transform my table to get the database normalized. The ta...
{ "language": "en", "url": "https://stackoverflow.com/questions/276737", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Is it possible to get a list of added or deleted files from Subversion? I want to retrieve a list of the files that has been added or deleted from our Subversion repository over, for example, the last month. I'd prefer to have the file names, and not just a count. Is this possible from the Subversion command line, o...
{ "language": "en", "url": "https://stackoverflow.com/questions/276740", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Consuming REST API with Adobe Air Can Someone show me a good example of one Adobe Air App (using Javascript) consuming a REST API? A: If you're planning to build the functionality using Javascript - as opposed to Flex - then AFAIK you don't need to examples that are AIR-specific; the JS code can and should be the s...
{ "language": "en", "url": "https://stackoverflow.com/questions/276754", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Professional #include contents I need to create an API that will allow my customer's developers to use a proprietary C module that will be released as a library (think .lib or .so -- not source). I'd like to make the header as developer-friendly as possible (so I won't need to be), following best practices and provi...
{ "language": "en", "url": "https://stackoverflow.com/questions/276757", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Parsing Integers out of a string in SQL I have a fairly large database with with a column that has strings that are for the most part really just ints, e.g. "1234" or "345". However some of them have strings prepended to them (of varying length), so e.g. "a123" or "abc123". Is there a smart way to create a new colu...
{ "language": "en", "url": "https://stackoverflow.com/questions/276758", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Exposing a C++ API to Python I'm currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Python interpreter in our program. The alternatives I tried were: * *Boost.Python I liked the cleaner API produced ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276761", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "42" }
Q: ASP.NET MVC routes I need help with this route map routes.MapRoute("Blog_Archive", "Blog/Archive/{year}/{month}/{day}", new { controller = "Blog", action = "archive", year = "", month = "", ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276766", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: How to expose std::vector as a Python list using SWIG? I'm trying to expose this function to Python using SWIG: std::vector<int> get_match_stats(); And I want SWIG to generate wrapping code for Python so I can see it as a list of integers. Adding this to the .i file: %include "typemaps.i" %include "std_vector.i" ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276769", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Making an Image Greyscale with GD Library My mission is to create a little app where you can upload a picture, and the app will turn it into ASCII art. I'm sure these exist already but I want to prove that I can do it myself. This would involve taking an image, making it greyscale and then matching each pixel with a...
{ "language": "en", "url": "https://stackoverflow.com/questions/276780", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How would I express this Scheme function more clearly? (define (repeated f n) if (= n 0) f ((compose repeated f) (lambda (x) (- n 1)))) I wrote this function, but how would I express this more clearly, using simple recursion with repeated? I'm sorry, I forgot to define my compose function. (define (compose...
{ "language": "en", "url": "https://stackoverflow.com/questions/276790", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do you upgrade a SQL Express Database to SQL Server Workgroup or Standard? I have a website that was originally developed using a SQL Express database in the App_Data folder. Now I need to take upgrade it, without loosing any data, to SQL Server 2005 Workgroup or Standard. Is there a guide on how to properly up...
{ "language": "en", "url": "https://stackoverflow.com/questions/276791", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Are there any free Team Foundation Servers we can host projects on? are there any free Team Foundation Server sites we can use for our private development? Please don't say CodePlex (which I love) because that means the code is all opensource. Lastly, I also understand that some people might raise the issue of havin...
{ "language": "en", "url": "https://stackoverflow.com/questions/276802", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: return 0 implicit The last week on the ACM ICPC Mexico competition, I missed a "return 0" on a C++ program. For this reason we got punished with 20 minutes. I had read that the standard does not oblige us to write it at the end of a main function. It is implicit, isn't it? How can I prove it? We were using a Fedora...
{ "language": "en", "url": "https://stackoverflow.com/questions/276807", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: How to populate a WPF grid based on a 2-dimensional array I have a 2-dimensional array of objects and I basically want to databind each one to a cell in a WPF grid. Currently I have this working but I am doing most of it procedurally. I create the correct number of row and column definitions, then I loop through t...
{ "language": "en", "url": "https://stackoverflow.com/questions/276808", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "57" }
Q: ASP.NET MVC and Ajax From what I've read about ASP.NET MVC, it appears it requires posting to work, is there any working example (With source available) of a ASP.NET MVC website that has no postbacks with the help of Ajax? (I checked the related questions earlier but couldn't find what I was looking for) Thanks in a...
{ "language": "en", "url": "https://stackoverflow.com/questions/276810", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is red/green testing? I believe I already know the answer, but I am not 100% sure, so just a quick question: What does Red/Green Testing actually mean? I understand it as "Write your tests first, so that they all fail (= all red), then write your code and watch how each test turns green, and when all are green,...
{ "language": "en", "url": "https://stackoverflow.com/questions/276813", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: How do I safely restart TortoiseSVN? It's not obvious to me.. A: The background process that watches your file system for SVN related files and folders is TSVNCache.exe. You can kill that process and start it again, or just reboot your machine :) A: If you do kill TSVNCache, you don't need to manually restart it, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276816", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: String Padding in C I wrote this function that's supposed to do StringPadRight("Hello", 10, "0") -> "Hello00000". char *StringPadRight(char *string, int padded_len, char *pad) { int len = (int) strlen(string); if (len >= padded_len) { return string; } int i; for (i = 0; i < padded_len - l...
{ "language": "en", "url": "https://stackoverflow.com/questions/276827", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "98" }
Q: What can I use for good quality code coverage for C#/.NET? I wonder what options there are for .NET (or C# specifically) code coverage, especially in the lower priced segment? I am not looking for recommendations, but for a comparison of products based on facts. I know the following: * *NCover * *Seems to be v...
{ "language": "en", "url": "https://stackoverflow.com/questions/276829", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "414" }
Q: How does a 7- or 35-pass erase work? Why would one use these methods? How and why do 7- and 35-pass erases work? Shouldn't a simple rewrite with all zeroes be enough? A: A single pass with zeros doesn't completely erase magnetic artifacts from a disk. It's still possible to recover the data from the drive. A 7-pass...
{ "language": "en", "url": "https://stackoverflow.com/questions/276832", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Pausing after debugging command line application in Visual Studio Is there a way short of writing a seperate batch file or adding a system call to pause or getch or a breakpoint right before the end of the main function to keep a command window open after a command line application has finished running? Put differen...
{ "language": "en", "url": "https://stackoverflow.com/questions/276843", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Slow performance of AddString in MFC I've got a dialog with several largeish combo boxes in it (maybe several hundred items apiece). There's a noticeable delay at construction while these are populated (confirmed that it's them by profiling). My initial thought was that sorting was killing it's performance, but disa...
{ "language": "en", "url": "https://stackoverflow.com/questions/276847", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Should an object ever have a property thats result is based on business logic? Or should they always be a function when business logic is invloved ? Example: Order.RequiresPayment property or function ? There are business rules as for when it is true or not IS there a pattern that may determine this? A: When in do...
{ "language": "en", "url": "https://stackoverflow.com/questions/276853", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Loops in Makefile I have a lot of assignments where I have to continually update a Makefile as I add more subsequently numbered C programs. Is there a way to do this with a loop which iterates over the values 1.1, 1.2, 1.3, etc.? all: 1.1 1.2 1.3 1.4 1.5 1.6 1.7. 1.8 1.9 1.1: 1.1.o gcc -o 1.1 $(FLAGS) 1.1.o 1....
{ "language": "en", "url": "https://stackoverflow.com/questions/276856", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How can I dynamically hide a button from a view? I would like to dynamically hide a button in one of my views depending on a certain condition. I tried adding some code to the view controller's -viewWillAppear method, to make the button hidden before displaying the actual view, but I still don't know how to do that....
{ "language": "en", "url": "https://stackoverflow.com/questions/276861", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: How to Make ASP.NET MVC Recognize IHttpAsyncHandler from IRouteHandler.GetHttpHandler()? In this question & answer, I found one way to make ASP.NET MVC support asynchronous processing. However, I cannot make it work. Basically, the idea is to create a new implementation of IRouteHandler which has only one method Get...
{ "language": "en", "url": "https://stackoverflow.com/questions/276867", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: First "programs" in a non-web environment I'm starting to re-skill myself in Desktop applications. I've been doing Web applications for a few years now. I've got come decent C# books that I am going through, but they are more like language references. What I would like is a list/site/book with practical exercises, p...
{ "language": "en", "url": "https://stackoverflow.com/questions/276872", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I get CheckBox to maintain checked state across postback in ASP.NET MVC? I have an ASP.NET MVC project with a form. In the Action method that handles the POST verb I have a custom IModelBinder implementation that is binding the form data to my model instance. If there are errors I am using bindingContext.Mo...
{ "language": "en", "url": "https://stackoverflow.com/questions/276874", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Learning C# after C++ In a progression of languages, I have been learning C and C++. Now I would like to learn C#. I know there are some drastic differences between them - such as the removal of pointers and garbage collection. However, I don't know many of the differences between the two. What are the major diff...
{ "language": "en", "url": "https://stackoverflow.com/questions/276884", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "26" }
Q: How to drop/discard a Request in ASP.NET? I'm trying to figure out how to drop/discard a request, I'm basically trying to implement a blocked list of IPs in my app to block spammers and I don't want to return any response (just ignore the request), is this possible in ASP.NET? Edit: Some of the answers suggest that ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276891", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How would I make a control that flashes/fades on a mouse click? (Windows) When a user clicks in certain places in my control, I want to change the color of some rows and columns in my grid, then fade it back to the normal color, within say 500ms or so. I haven't decided whether to use Winforms or WPF yet, so advice...
{ "language": "en", "url": "https://stackoverflow.com/questions/276905", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Does CompositeWPF support multiple windows/shells? I'm looking at using CompositeWPF (http://www.codeplex.com/CompositeWPF) - aka Prism, to build an application I am working on. The application isn't a traditional LOB application, however it does present data and state information to the user. One thing which I am u...
{ "language": "en", "url": "https://stackoverflow.com/questions/276906", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Starting iPhone app development in Linux? I've heard that you need to get a Mac if you want to develop iPhone apps. Is this true? Is it possible to develop iPhone apps using Linux? If yes, what do I need and where do I download the necessary tools? A: The only way I know of doing development in Linux for the iPhon...
{ "language": "en", "url": "https://stackoverflow.com/questions/276907", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "548" }
Q: Coming up with a topology for a public facing SharePoint website I'm currently planning the migration of a Microsoft Content Management Server (MCMS) website to a SharePoint 2007 publishing site. The top-level site is a public facing, anonymously-accessible website. It will contain two areas which need to be protect...
{ "language": "en", "url": "https://stackoverflow.com/questions/276908", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to test if an array contains a pair of numbers whose product is odd? How can I write a function that takes an array of integers and returns true if their exists a pair of numbers whose product is odd? What are the properties of odd integers? And of course, how do you write this function in Java? Also, maybe a sh...
{ "language": "en", "url": "https://stackoverflow.com/questions/276909", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Click Once - All Users How to I configure click-once to install apps for all users. On another forum I got to 'use MSI' - thanks - but how. Also, the first installing user may not be admin - which may be a problem. And I want all users to trigger an update check. No local storage, it's a WPF client to a WCF service....
{ "language": "en", "url": "https://stackoverflow.com/questions/276916", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Is there a port of memcache to .Net? I am interested if there is a port for the server implementation. A: There is no official support for windows builds. Check this link: https://github.com/memcached/memcached/wiki/Install For the clients, check this link: https://github.com/memcached/memcached/wiki/Clients Hope t...
{ "language": "en", "url": "https://stackoverflow.com/questions/276924", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "25" }
Q: Can I concatenate multiple MySQL rows into one field? Using MySQL, I can do something like: SELECT hobbies FROM peoples_hobbies WHERE person_id = 5; My Output: shopping fishing coding but instead I just want 1 row, 1 col: Expected Output: shopping, fishing, coding The reason is that I'm selecting multiple values ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276927", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1451" }
Q: Are there good Grails sample applications from which to learn? Besides the sample applications featured in the books Beginning Groovy and Grails and The Definitive Guide to Grails, are there any applications out there written in Grails that are good examples from which to learn best practices? Such as real applicati...
{ "language": "en", "url": "https://stackoverflow.com/questions/276928", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "26" }
Q: Importing which library? recently I downloaded this open source project and I am trying to compile it. However, one of the line is giving me an error. "import com.sun.org.apache.xpath.internal.functions.WrongNumberArgsException;" Seems that i am missing a library.... is there a way to know WHICH library do I need? I...
{ "language": "en", "url": "https://stackoverflow.com/questions/276931", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Updating a tooltip in Silverlight 2 I have a control in Silverlight 2 that changes state during the application. When its state changes, I want to update the tooltip that goes with it. I'm using the ToolTipService: ToolTipService.SetToolTip(ent.LayoutRoot, "FooBar"); which works fine the first time I set a tooltip...
{ "language": "en", "url": "https://stackoverflow.com/questions/276947", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Can Scanner in Java read text from a dialog box Scanner can only get input from system console? not be able to get from any dialog window? Thanks. A: A Scanner can read text from any object which implements the Readable interface. That includes BufferedReader, CharArrayReader, CharBuffer, FileReader, FilterReader...
{ "language": "en", "url": "https://stackoverflow.com/questions/276955", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: The difference between Free Software and Open Source Software For quite a while, I thought that Free Software was Open Source Software. I've found out that this view is incorrect, and that Open Source Software is not necessarily Free Software. I honestly can't see any differences. What am I missing here? What are...
{ "language": "en", "url": "https://stackoverflow.com/questions/276957", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: How to keep a VMWare VM's clock in sync? I have noticed that our VMWare VMs often have the incorrect time on them. No matter how many times I reset the time they keep on desyncing. Has anyone else noticed this? What do other people do to keep their VM time in sync? Edit: These are CLI linux VMs btw.. A: according t...
{ "language": "en", "url": "https://stackoverflow.com/questions/276965", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "52" }
Q: 3D scene file format & viewer I am looking for a cross-platform solution for saving and viewing 3D scenes (visualizations of engineering simulation models and results) but there (still) doesn't seem to be much out there. I looked into this almost 10 years ago and settled on VRML then (and started the project that ev...
{ "language": "en", "url": "https://stackoverflow.com/questions/276976", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: List of de facto standard keyboard shortcuts for Windows apps? Let's say I'm developing a new desktop application for Windows. Is there a list somewhere that I can consult (either from Microsoft or a 3rd party) of keyboard shortcuts that all Windows applications should support? (Note: When I say "all Windows applic...
{ "language": "en", "url": "https://stackoverflow.com/questions/276977", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: ListView FocusedItem Becomes NULL When the program runs, there is a series of ListView forms. We populated one of them with items (as strings) and we check whether the state of selection has changed. Once it's changed, we grab the text of the selected item using FocusedItem.Text. The first time works just fine but w...
{ "language": "en", "url": "https://stackoverflow.com/questions/276986", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Label Validating Event Not Firing I wish to use the Validating event on a label in VB.Net (Visual Studio 2005, .Net Runtime 2.0). I have two text boxes side by side. These are for a %/% split allocation, such as 80/20, 50/50, etc. So, I have validation on each box to ensure that their values are >= 0 and <= 100. It ...
{ "language": "en", "url": "https://stackoverflow.com/questions/276987", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Detect another host with the same MAC address How can I detect if another host is using the same MAC address as the current host, e.g. because the other host is spoofing? I'm working in an embedded environment, so looking for answers on a protocol level, rather than “use such and such a tool”. Edit: RARP does not so...
{ "language": "en", "url": "https://stackoverflow.com/questions/276990", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: WPF Custom Routed event question How do you get two unrelated controls to raise the same custom event? All examples I have seen so far have an event defined within a single control, should I be taking a different approach? Eg. I'd like to raise a custom bubbling event from an OnFocus handler for a button and a text...
{ "language": "en", "url": "https://stackoverflow.com/questions/277001", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to use JProgressBar? I need to load a bunch of words (about 70,000) from a text file, add it to a hashtable (using soundex as a key) and sort the values. While doing all these I want to show a progress bar using JProgressBar. Articles such as this and this, only gives a non-real example (a while loop). Can anyon...
{ "language": "en", "url": "https://stackoverflow.com/questions/277007", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: What are the benefits to marking a field as `readonly` in C#? What are the benefits of having a member variable declared as read only? Is it just protecting against someone changing its value during the lifecycle of the class or does using this keyword result in any speed or efficiency improvements? A: There are n...
{ "language": "en", "url": "https://stackoverflow.com/questions/277010", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "371" }
Q: Poor Safari Rendering I'm having major rendering issues in Safari with the web application I'm working on. Most of the design is done with divs using absolute positioning. This renders fine on Internet Explorer, Firefox, Chrome, Opera, Netscape, and konqueror. In Safari, it's just a jumbled mess. Does Safari la...
{ "language": "en", "url": "https://stackoverflow.com/questions/277016", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: call a Method with parameters got from generic Method I have a class storing the name of a WS method to call and the type and value of the only parameter that service receives (it will be a collection of parameters but lets keep it simple for the example): public class MethodCall { public string Method { get; set;...
{ "language": "en", "url": "https://stackoverflow.com/questions/277018", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: High Performance BPEL engine? I am evaluating BPEL engine for our high performance telecom application but performance seem to be very poor. We have evaluated Apache Ode, SunBPEL engine, Active BPEL etc. Do you know any faster BPEL engine implementation or BPEL implementation in C/C++ ? A: I believe your performan...
{ "language": "en", "url": "https://stackoverflow.com/questions/277022", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Ideas for an extensible (addins/plugins) WCF service host? I'm looking for suggestions about how can I build an extensible WCF server (with dynamically loaded services), preferably using System.Addins or MEF. The server should host any WCF service (contained in DLL assemblies, loaded in runtime) that implements a mi...
{ "language": "en", "url": "https://stackoverflow.com/questions/277028", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Combining multiple git repositories Let's say I've got a setup that look something like phd/code/ phd/figures/ phd/thesis/ For historical reasons, these all have their own git repositories. But I'd like to combine them into a single one to simplify things a little. For example, right now I might make two sets of ch...
{ "language": "en", "url": "https://stackoverflow.com/questions/277029", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "214" }
Q: Best way to show data entry errors I have created a VB.Net lending application for a cooperative that caters to widows. The application tracks the members' loans and payments, and is also used as an accounting system. In my first release, the users felt that showing a messagebox every time an error occurs is very an...
{ "language": "en", "url": "https://stackoverflow.com/questions/277031", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Successful sites using Asp.NET and the Facebook API Are there any sites out there that have been built with asp.net and facebook api? I am looking for some ideas and inspiration for doing some social networking web programming. I did find some asp.net/facebook blog entries but still could not find any site that has ...
{ "language": "en", "url": "https://stackoverflow.com/questions/277034", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How can I catch and handle a signal in Perl? Is there any way to trap an error and exit gracefully from Perl? I am working on a script which might fail due to a SIG event from the OS or other applications running on my server. I wish to trap this event, display the error and exit after closing all files and other at...
{ "language": "en", "url": "https://stackoverflow.com/questions/277043", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Do I need to store the salt with bcrypt? bCrypt's javadoc has this code for how to encrypt a password: String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); To check whether a plaintext password matches one that has been hashed previously, use the checkpw method: if (BCrypt.checkpw(candidate_password, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/277044", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "200" }
Q: FileChooser to select a directory, not a file My code processes all the files in a folder on a Windows box. I want to offer the user (who happens to also be me) the option to select the folder to be processed, using the standard File Chooser dialog. I am trying to use the GetOpenFileName function to make this happen...
{ "language": "en", "url": "https://stackoverflow.com/questions/277053", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Remove HTML Tags from an NSString on the iPhone There are a couple of different ways to remove HTML tags from an NSString in Cocoa. One way is to render the string into an NSAttributedString and then grab the rendered text. Another way is to use NSXMLDocument's -objectByApplyingXSLTString method to apply an XSLT tra...
{ "language": "en", "url": "https://stackoverflow.com/questions/277055", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "108" }