diff --git "a/documents/stackoverflow_test.jsonl" "b/documents/stackoverflow_test.jsonl" new file mode 100644--- /dev/null +++ "b/documents/stackoverflow_test.jsonl" @@ -0,0 +1,400 @@ +{"qid":"stackoverflow_Query_1040","query":"How can you customize the numbers in an ordered list? | How can I left-align the numbers in an ordered list?\n\n\n\n```\n1. an item\n\/\/ skip some items for brevity \n9. another item\n10. notice the 1 is under the 9, and the item contents also line up\n\n```\n\nChange the character after the number in an ordered list?\n\n\n\n```\n1) an item\n\n```\n\nAlso is there a CSS solution to change from numbers to alphabetic\/roman lists instead of using the type attribute on the ol element.\n\n\nI am mostly interested in answers that work on Firefox 3.\n\n\n","answer_pids":["stackoverflow_Passage_3654","stackoverflow_Passage_3656","stackoverflow_Passage_5170","stackoverflow_Passage_7986","stackoverflow_Passage_11790","stackoverflow_Passage_11791","stackoverflow_Passage_11801","stackoverflow_Passage_11802","stackoverflow_Passage_11804","stackoverflow_Passage_11817","stackoverflow_Passage_12262","stackoverflow_Passage_127902","stackoverflow_Passage_129230","stackoverflow_Passage_422754","stackoverflow_Passage_628462","stackoverflow_Passage_847364","stackoverflow_Passage_1016668"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_116","query":"How to use a mutex in Visual Basic | I have imported the `kernel32` library. So, I have the `createMutex` function available but I am not quite sure of the various parameters and return values.\n\n\nThis is classic Visual Basic, not Visual Basic.NET but I can probably work with either language in the form of an answer.\n\n\n","answer_pids":["stackoverflow_Passage_281","stackoverflow_Passage_283","stackoverflow_Passage_1027","stackoverflow_Passage_10250"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_322","query":"'Best' Diff Algorithm | I need to implement a Diff algorithm in VB.NET to find the changes between two different versions of a piece of text. I've had a scout around the web and have found a couple of different algorithms.\n\n\nDoes anybody here know of a 'best' algorithm that I could implement?\n\n\n","answer_pids":["stackoverflow_Passage_946","stackoverflow_Passage_947","stackoverflow_Passage_948","stackoverflow_Passage_3145"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1087","query":"What is good server performance monitoring software for Windows? | I'm looking for some software to monitor a single server for performance alerts. Preferably free and with a reasonable default configuration.\n\n\nEdit: To clarify, I would like to run this software on a Windows machine and monitor a remote Windows server for CPU\/memory\/etc. usage alerts (not a single application).\n\n\nEdit: I suppose its not necessary that this software be run remotely, I would also settle for something that ran on the server and emailed me if there was an alert. It seems like Windows performance logs and alerts might be used for this purpose somehow but it was not immediately obvious to me.\n\n\nEdit: Found a neat tool on the coding horror blog, not as useful for remote monitoring but very useful for things you would worry about as a server admin: \n\n\n","answer_pids":["stackoverflow_Passage_3842","stackoverflow_Passage_3849","stackoverflow_Passage_6325","stackoverflow_Passage_7891","stackoverflow_Passage_10380","stackoverflow_Passage_10978","stackoverflow_Passage_11270","stackoverflow_Passage_11279"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1029","query":"ASP.NET Web Site or Web Project | When creating a new ASP.NET project in Visual Studio should I chose create: website or project? \n\n\nI understand that web application project was the way to do it back in the day with VS 2003 but is it still applicable today? What are some of the caveats using one over the other?\n\n\n","answer_pids":["stackoverflow_Passage_3613","stackoverflow_Passage_8275","stackoverflow_Passage_12181"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_976","query":"Multithreading Design Best Practice | Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario:\n\n\n1. I start each request to the web service on a new Thread. The number of simultaneous threads is controlled by some external parameter (or dynamically adjusted somehow).\n2. I create smaller batches (let's say of 10 records each) and launch each batch on a separate thread (so taking our example, 10 threads).\n\n\nWhich is a better approach, and why do you think so?\n\n\n","answer_pids":["stackoverflow_Passage_3398","stackoverflow_Passage_3411","stackoverflow_Passage_3414","stackoverflow_Passage_3485","stackoverflow_Passage_8227"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1196","query":"What is your experience using the TIBCO General Interface? | It looks interesting and I've played around with it some --- but the development IDE in a web browser seems to be nightmare eventually.\n\n\nDoes anyone have experience using it and what are your thoughts?\n\n\n","answer_pids":["stackoverflow_Passage_4351","stackoverflow_Passage_5757","stackoverflow_Passage_9051","stackoverflow_Passage_10288","stackoverflow_Passage_13080","stackoverflow_Passage_106851"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_102","query":"How do I most elegantly express left join with aggregate SQL as LINQ query | SQL:\n\n\n\n```\nSELECT\n u.id,\n u.name,\n isnull(MAX(h.dateCol), '1900-01-01') dateColWithDefault\nFROM universe u\nLEFT JOIN history h \n ON u.id=h.id \n AND h.dateCol\n\n```\n\nI need a way on the server-side to get the value `\"\/wEPDwUJODU0Njc5MD...==\"`\n\n\nTo clarify, I need this value when the page is being rendered, not on PostBack. e.g. I need to know the ViewState value that is being *sent* to the client, not the ViewState I'm getting back from them.\n\n\n","answer_pids":["stackoverflow_Passage_303","stackoverflow_Passage_309","stackoverflow_Passage_572","stackoverflow_Passage_1073"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_445","query":"SQL Server 2005 and 2008 on same developer machine? | Has anyone tried installing SQL Server 2008 Developer on a machine that already has 2005 Developer installed?\n\n\nI am unsure if I should do this, and I need to keep 2005 on this machine for the foreseeable future in order to test our application easily. Since I sometimes need to take backup files of databases and make available for other people in the company I cannot just replace 2005 with 2008 as I suspect (but do not know) that the databases aren't 100% backwards compatible.\n\n\nWhat kind of issues would arise? Do I need to install the new version with an instance name, will that work? Can I use a different port number to distinguish them?\n\n\nI found this entry on technet: \n\n\nIt doesn't say more than just *yes you can do this* and I kinda suspected that this was doable anyway, but I need to know if there are anything I need to know before I start installing.\n\n\nAnyone?\n\n\n","answer_pids":["stackoverflow_Passage_1376","stackoverflow_Passage_1379","stackoverflow_Passage_1792","stackoverflow_Passage_1802","stackoverflow_Passage_4546","stackoverflow_Passage_12222","stackoverflow_Passage_12480","stackoverflow_Passage_12552"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_607","query":"How do I make event callbacks into my win forms thread safe? | When you subscribe to an event on an object from within a form, you are essentially handing over control of your callback method to the event source. You have no idea whether that event source will choose to trigger the event on a different thread.\n\n\nThe problem is that when the callback is invoked, you cannot assume that you can make update controls on your form because sometimes those controls will throw an exception if the event callback was called on a thread different than the thread the form was run on.\n\n\n","answer_pids":["stackoverflow_Passage_1926","stackoverflow_Passage_1930","stackoverflow_Passage_1935","stackoverflow_Passage_6205","stackoverflow_Passage_8868","stackoverflow_Passage_11524","stackoverflow_Passage_187839"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_388","query":"T-Sql Remove Decimal Point From Money Data Type | Given the constraint of only using T-Sql in Sql Server 2005, is there a better way to remove the decimal point from a money datatype than a conversion to a varchar (here implicitly) and then a replace of the decimal point?\n\n\nHere is what I have currently.\n\n\n\n```\nSELECT REPLACE(1.23, '.', ''), REPLACE(19.99, '.', '')\n\n```\n\nWhich returns the desired 123 and 1999, but I was wondering if there was a better way. Any thoughts?\n\n\n","answer_pids":["stackoverflow_Passage_1187","stackoverflow_Passage_1189","stackoverflow_Passage_1213","stackoverflow_Passage_1823","stackoverflow_Passage_3896","stackoverflow_Passage_12268"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_317","query":"Best ways to teach a beginner to program? | **Original Question**\n\n\nI am currently engaged in teaching my brother to program. He is a total beginner, but very smart. (And he actually wants to learn). I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized. (*But the answers to this post have helped a lot.*)\n\n\nWhat can I do better to teach him effectively? Is there a logical order that I can use to run through concept by concept? Are there complexities I should avoid till later?\n\n\nThe language we are working with is [Python](http:\/\/www.python.org), but advice in any language is welcome.\n\n\n\n\n---\n\n\n**How to Help**\n\n\nIf you have good ones please add the following in your answer:\n\n\n* Beginner Exercises and Project Ideas\n* Resources for teaching beginners\n* Screencasts \/ blog posts \/ free e-books\n* Print books that are good for beginners\n\n\nPlease describe the resource *with a link to it* so I can take a look. I want everyone to know that I have definitely been using some of these ideas. Your submissions will be aggregated in this post.\n\n\n\n\n---\n\n\n**Online Resources** for teaching beginners:\n\n\n* [A Gentle Introduction to Programming Using Python](http:\/\/ocw.mit.edu\/OcwWeb\/Electrical-Engineering-and-Computer-Science\/6-189January--IAP--2008\/CourseHome\/)\n* [How to Think Like a Computer Scientist](http:\/\/openbookproject.net\/thinkcs\/python\/english2e\/index.html)\n* [Alice: a 3d program for beginners](http:\/\/www.alice.org\/)\n* [Scratch (A system to develop programming skills)](http:\/\/scratch.mit.edu\/)\n* [How To Design Programs](http:\/\/www.htdp.org\/)\n* [Structure and Interpretation of Computer Programs](http:\/\/mitpress.mit.edu\/sicp\/full-text\/book\/book.html)\n* [Learn To Program](http:\/\/pine.fm\/LearnToProgram\/)\n* [Robert Read's How To Be a Programmer](http:\/\/samizdat.mines.edu\/howto\/HowToBeAProgrammer.html)\n* [Microsoft XNA](http:\/\/creators.xna.com\/)\n* [Spawning the Next Generation of Hackers](http:\/\/vodpod.com\/watch\/914464-inspirational-oscon-keynote)\n* [*COMP1917 Higher Computing* lectures by Richard Buckland](http:\/\/deimos3.apple.com\/WebObjects\/Core.woa\/Browse\/unsw.edu.au.1504975442.01504975444) (requires iTunes)\n* [Dive into Python](http:\/\/diveintopython.net\/)\n* [Python Wikibook](http:\/\/en.wikibooks.org\/wiki\/Programming:Python)\n* [Project Euler](http:\/\/projecteuler.net\/) - sample problems (mostly mathematical)\n* [pygame](http:\/\/www.pygame.org\/) - an easy python library for creating games\n* [Invent Your Own Computer Games With Python](http:\/\/inventwithpython.com\/IYOCGwP_book1.pdf)\n* [Foundations of Programming](http:\/\/codebetter.com\/blogs\/karlseguin\/archive\/2008\/06\/24\/foundations-of-programming-ebook.aspx) for a next step beyond basics.\n* [Squeak by Example](http:\/\/www.iam.unibe.ch\/~scg\/SBE\/)\n* [Snake Wrangling For Kids](http:\/\/www.briggs.net.nz\/log\/writing\/snake-wrangling-for-kids\/) (It's not just for kids!)\n\n\n\n\n---\n\n\n**Recommended Print Books** for teaching beginners\n\n\n* [Accelerated C++](http:\/\/www.acceleratedcpp.com\/)\n* [Python Programming for the Absolute Beginner](https:\/\/rads.stackoverflow.com\/amzn\/click\/com\/1598631128)\n* [Code by Charles Petzold](https:\/\/rads.stackoverflow.com\/amzn\/click\/com\/0735611319)\n* [Python Programming: An Introduction to Computer Science 2nd Edition](https:\/\/rads.stackoverflow.com\/amzn\/click\/com\/1590282418)\n\n\n","answer_pids":["stackoverflow_Passage_921","stackoverflow_Passage_923","stackoverflow_Passage_924","stackoverflow_Passage_925","stackoverflow_Passage_927","stackoverflow_Passage_930","stackoverflow_Passage_932","stackoverflow_Passage_934","stackoverflow_Passage_936","stackoverflow_Passage_942","stackoverflow_Passage_983","stackoverflow_Passage_1109","stackoverflow_Passage_1124","stackoverflow_Passage_1351","stackoverflow_Passage_1352","stackoverflow_Passage_1369","stackoverflow_Passage_1381","stackoverflow_Passage_1641","stackoverflow_Passage_2020","stackoverflow_Passage_2027","stackoverflow_Passage_2078","stackoverflow_Passage_2091","stackoverflow_Passage_2150","stackoverflow_Passage_2373","stackoverflow_Passage_2452","stackoverflow_Passage_2455","stackoverflow_Passage_2465","stackoverflow_Passage_3143","stackoverflow_Passage_3167","stackoverflow_Passage_3523","stackoverflow_Passage_3805","stackoverflow_Passage_4445","stackoverflow_Passage_4543","stackoverflow_Passage_5191","stackoverflow_Passage_5632","stackoverflow_Passage_5797","stackoverflow_Passage_6841","stackoverflow_Passage_6872","stackoverflow_Passage_7736","stackoverflow_Passage_7737","stackoverflow_Passage_7774","stackoverflow_Passage_7854","stackoverflow_Passage_7943","stackoverflow_Passage_8180","stackoverflow_Passage_8284","stackoverflow_Passage_8395","stackoverflow_Passage_8630","stackoverflow_Passage_8910","stackoverflow_Passage_9256","stackoverflow_Passage_9282","stackoverflow_Passage_9406","stackoverflow_Passage_9410","stackoverflow_Passage_9469","stackoverflow_Passage_9550","stackoverflow_Passage_9553","stackoverflow_Passage_9556","stackoverflow_Passage_9622","stackoverflow_Passage_9731","stackoverflow_Passage_9930","stackoverflow_Passage_9943","stackoverflow_Passage_10458","stackoverflow_Passage_10459","stackoverflow_Passage_10536","stackoverflow_Passage_10560","stackoverflow_Passage_10561","stackoverflow_Passage_10890","stackoverflow_Passage_11006","stackoverflow_Passage_11256","stackoverflow_Passage_11409","stackoverflow_Passage_11410","stackoverflow_Passage_11875","stackoverflow_Passage_11934","stackoverflow_Passage_12019","stackoverflow_Passage_12464","stackoverflow_Passage_12559","stackoverflow_Passage_12560","stackoverflow_Passage_12636","stackoverflow_Passage_12957","stackoverflow_Passage_13195","stackoverflow_Passage_13241","stackoverflow_Passage_13257","stackoverflow_Passage_24507","stackoverflow_Passage_34883","stackoverflow_Passage_39562","stackoverflow_Passage_73956","stackoverflow_Passage_78569"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_996","query":"Is there a \"Set\" data structure in .Net? | Ideally, I'm looking for a templated logical Set class. It would have all of the standard set operations such as Union, Intersection, Etc., and collapse duplicated items.\n\n\nI ended up creating my own set class based on the C# Dictionary<>- just using the Keys.\n\n\n","answer_pids":["stackoverflow_Passage_3471","stackoverflow_Passage_3472","stackoverflow_Passage_3479","stackoverflow_Passage_3490","stackoverflow_Passage_11038","stackoverflow_Passage_983151"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1471","query":"IE7 HTML\/CSS margin-bottom bug | Here is the scenario: \n\n\nI have a table with a margin-bottom of 19px. Below that I have a form that contains some fieldsets. One of them is floated right. The problem is that the margin-bottom is not getting the full 19px in IE7. I've gone through all of the IE7 css\/margin\/float bugs that I can think of and have tried remedies but have been unsuccessful. I have been googling for a while now and cannot find anything that is helping out. \n\n\nHere is what I have tried. \n\n\n1. Wrapping the form or fieldset in an unstyled div. No apparent change.\n2. Nixing the margin-bottom on the table and instead wrapping that with a div and giving it a padding-bottom of 19px. No apparent change.\n3. Nixing the margin-bottom on the table and adding a div with a fixed height of 19px. No apparent change.\n4. Putting a clear between the table and the fieldset.\n\n\nI know there are some others that I am forgetting, but those are the things I have tried out recently. This happens to each fieldset. \n\n\n\n\n---\n\n\nI am using a reset style sheet and have a xhtml transitional doctype. \n\n\n**Edit:** I also have the IE7 web developer toolbar and Firebug. The style information for both browsers says that it has a margin-bottom: 19px; but it clearly is not for IE7.\n\n\n","answer_pids":["stackoverflow_Passage_5429","stackoverflow_Passage_5430","stackoverflow_Passage_5451","stackoverflow_Passage_6995","stackoverflow_Passage_65206","stackoverflow_Passage_243228"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1355","query":"How do I make Powershell run a batch file and then stay open? | For example; with the old command prompt it would be:\n\n\n\n```\ncmd.exe \/k mybatchfile.bat\n\n```\n\n","answer_pids":["stackoverflow_Passage_4975","stackoverflow_Passage_8794","stackoverflow_Passage_58616","stackoverflow_Passage_389326"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1138","query":"sn.exe fails with Access Denied error message | I get an Access is Denied error message when I use the strong name tool to create a new key to sign a .NET assembly. This works just fine on a Windows XP machine but it does not work on my Vista machine.\n\n\n\n```\nPS C:\\users\\brian\\Dev\\Projects\\BELib\\BELib> sn -k keypair.snk\n\nMicrosoft (R) .NET Framework Strong Name Utility Version 3.5.21022.8\nCopyright (c) Microsoft Corporation. All rights reserved.\n\nFailed to generate a strong name key pair -- Access is denied.\n\n```\n\nWhat causes this problem and how can I fix it?\n\n\n\n\n---\n\n\n\n> \n> Are you running your PowerShell or\n> Command Prompt as an Administrator? I\n> found this to be the first place to\n> look until you get used to User Access\n> Control or by turning User Access\n> Control off.\n> \n> \n> \n\n\nYes I have tried running PS and the regular command prompt as administrator. The same error message comes up.\n\n\n","answer_pids":["stackoverflow_Passage_4016","stackoverflow_Passage_4019","stackoverflow_Passage_4038","stackoverflow_Passage_8439","stackoverflow_Passage_11923","stackoverflow_Passage_12891"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1604","query":"OpenID authentication in ASP.NET? | I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrate OpenID with an ASP.NET site?\n\n\n","answer_pids":["stackoverflow_Passage_5988","stackoverflow_Passage_5990","stackoverflow_Passage_5991","stackoverflow_Passage_5993","stackoverflow_Passage_6002","stackoverflow_Passage_9110","stackoverflow_Passage_9348"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1496","query":"Best way to structure a repository in Subversion for Visual Studio projects? | I have a few C# `.dll` projects which are common to many applications. Currently, I have one big repository. I have each DLL stored as a separate project within the repository and every application project stored as a project within the same repository.\n\n\nI recently switched to Subversion for source control and I fear that I did not do a good job of structuring the repository. I would like to hear what others are doing.\n\n\n","answer_pids":["stackoverflow_Passage_5515","stackoverflow_Passage_5516","stackoverflow_Passage_5519","stackoverflow_Passage_5538","stackoverflow_Passage_5708","stackoverflow_Passage_7123","stackoverflow_Passage_8993"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1426","query":"PDF generation from XHTML in a LAMP environment | Can anyone recommend a good server-side PDF generation tool that would work in a Linux environment. I want easy as possible, pass it a XHTML file (with images) and have it generate a PDF from the **rendered** source.\n\n\nI don't have a massive budget, but anything under $1000 should be alright.\n\n\nAndrew\n\n\n","answer_pids":["stackoverflow_Passage_5235","stackoverflow_Passage_5328","stackoverflow_Passage_5487","stackoverflow_Passage_6615","stackoverflow_Passage_6623","stackoverflow_Passage_10578","stackoverflow_Passage_10584","stackoverflow_Passage_10585","stackoverflow_Passage_11184"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1739","query":"Modifying Cruise Control.NET | We are investigating using CruiseControl.NET as both a Continues Integration build provider, as well as automating the first part of our deployment process.\n\n\nHas anyone modified CruiseControl.NET's dashboard to add custom login and user roles (IE, Separate out access to forcing a build to only certain individuals on a per project basis?\n\n\nThe dashboard is a .NET App, but I believe it uses the nVelocity view engine instead of web forms, which I don't have experience with.\n\n\nCan you mix nVelocity and Webforms,or do I need to spend a day learning something new =)\n\n\n","answer_pids":["stackoverflow_Passage_6850","stackoverflow_Passage_6876","stackoverflow_Passage_9322"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_584","query":"User access log to SQL Server | I need to get a log of user access to our `SQL Server` so I can track **average** and **peak concurrency usage**. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the application level.\n\n\nI'm currently working on `SQL Server 2000`, but will moving to `SQL Server 2005` shortly, so solutions for both are greatly appreciated.\n\n\n","answer_pids":["stackoverflow_Passage_1810","stackoverflow_Passage_1811","stackoverflow_Passage_5908"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_931","query":"Is accessing a variable in C# an atomic operation? | I've been raised to believe that if multiple threads can access a variable, then all reads from and writes to that variable must be protected by synchronization code, such as a \"lock\" statement, because the processor might switch to another thread halfway through a write.\n\n\nHowever, I was looking through System.Web.Security.Membership using Reflector and found code like this:\n\n\n\n```\npublic static class Membership\n{\n private static bool s_Initialized = false;\n private static object s_lock = new object();\n private static MembershipProvider s_Provider;\n\n public static MembershipProvider Provider\n {\n get\n {\n Initialize();\n return s_Provider;\n }\n }\n\n private static void Initialize()\n {\n if (s_Initialized)\n return;\n\n lock(s_lock)\n {\n if (s_Initialized)\n return;\n\n \/\/ Perform initialization...\n s_Initialized = true;\n }\n }\n}\n\n```\n\nWhy is the s\\_Initialized field read outside of the lock? Couldn't another thread be trying to write to it at the same time? **Are reads and writes of variables atomic?** \n\n\n","answer_pids":["stackoverflow_Passage_3195","stackoverflow_Passage_3197","stackoverflow_Passage_3200","stackoverflow_Passage_3201","stackoverflow_Passage_3206","stackoverflow_Passage_3207","stackoverflow_Passage_3209","stackoverflow_Passage_3210","stackoverflow_Passage_3237","stackoverflow_Passage_3240","stackoverflow_Passage_3344","stackoverflow_Passage_4149","stackoverflow_Passage_8106","stackoverflow_Passage_10021","stackoverflow_Passage_219418","stackoverflow_Passage_283758"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1607","query":"How do you use back-references to PCREs in PHP? | I read this [PHP RegEx page](http:\/\/us.php.net\/manual\/en\/regexp.reference.php), but either I'm missing something, misreading something, or it doesn't work the way they say. I'm guessing it's one of the first two.\n\n\n\n```\n$str = preg_replace(\"([|]\\d*)\", \"\\1;\", $str);\n\n```\n\n","answer_pids":["stackoverflow_Passage_6019","stackoverflow_Passage_9117"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1605","query":"how to get locale information on a GWT application | In GWT I have to specify what locales are supported in my application. The code get compiled in various files, one for each locale (beside other versions), but I have to give my clients one only URL. This URL is supposed to be a page that should be displayed according to the locale preferred by the browser.\nI dont't want to have an HTTP parameter for the locale since I want to forse the locale preferred by the browser.\nHow can this be coded in GWT?\n\n\nShould I try to to this using apache rewrite rules? I thied it, but I think I cannot access such parameter easely in a rewrite rule.\n\n\nThanks a lot,\nGiuseppe\n\n\n","answer_pids":["stackoverflow_Passage_6013","stackoverflow_Passage_9059","stackoverflow_Passage_12638","stackoverflow_Passage_36988","stackoverflow_Passage_284253"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_543","query":"Does it still make sense to learn low level WinAPI programming? | Does it make sense, having all of the C#-managed-bliss, to go back to Petzold's Programming Windows and try to produce code w\/ pure WinAPI?\n\n\nWhat can be learn from it? Isn't it just too outdated to be useful?\n\n\n","answer_pids":["stackoverflow_Passage_1679","stackoverflow_Passage_1680","stackoverflow_Passage_1681","stackoverflow_Passage_1683","stackoverflow_Passage_1684","stackoverflow_Passage_1685","stackoverflow_Passage_1688","stackoverflow_Passage_1696","stackoverflow_Passage_1698","stackoverflow_Passage_1897","stackoverflow_Passage_2173","stackoverflow_Passage_5523","stackoverflow_Passage_7204","stackoverflow_Passage_9710","stackoverflow_Passage_10491","stackoverflow_Passage_10733","stackoverflow_Passage_10734","stackoverflow_Passage_12358","stackoverflow_Passage_12429","stackoverflow_Passage_12430","stackoverflow_Passage_12499","stackoverflow_Passage_13401","stackoverflow_Passage_175533"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_799","query":"Mod-Rewrite loading files behind the DocumentRoot | I'm using `.htaccess` and `mod_rewrite` to point to files that reside behind the DocumentRoot. My folder structure looks like this:\n\n\n\n```\nhome\/\n webroot\/\n other_files\/\n\n```\n\nI have a `.htaccess` file in webroot with the following content:\n\n\n\n```\n\nRewriteEngine on\nRewriteRule ^(.*)$ \/home\/other_files\/$1\n\n```\n\nIf I try to access I receive the following error: \n\n\n\n> \n> The requested URL \/home\/other\\_files\/file.html was not found on this server. \n> \n> \n> \n\n\nIs it even possible to load files that are behind the DocumentRoot? If so, can someone point me in the right direction?\n\n\n","answer_pids":["stackoverflow_Passage_2699","stackoverflow_Passage_3034","stackoverflow_Passage_7836","stackoverflow_Passage_642861"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_4","query":"Determine a user's timezone | Is there a standard way for a web server to be able to determine a user's timezone within a web page? \n\n\nPerhaps from an HTTP header or part of the `user-agent` string?\n\n\n","answer_pids":["stackoverflow_Passage_6","stackoverflow_Passage_37","stackoverflow_Passage_223","stackoverflow_Passage_227","stackoverflow_Passage_8765","stackoverflow_Passage_12887","stackoverflow_Passage_13386","stackoverflow_Passage_18723","stackoverflow_Passage_62210","stackoverflow_Passage_65007","stackoverflow_Passage_103960","stackoverflow_Passage_130390","stackoverflow_Passage_146813","stackoverflow_Passage_186676","stackoverflow_Passage_208101","stackoverflow_Passage_210883","stackoverflow_Passage_219061","stackoverflow_Passage_223850","stackoverflow_Passage_262176","stackoverflow_Passage_443139","stackoverflow_Passage_505982","stackoverflow_Passage_508035","stackoverflow_Passage_778750","stackoverflow_Passage_818863"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_776","query":"How do you get a custom id to render using HtmlHelper in MVC | Using [preview 4](http:\/\/www.codeplex.com\/aspnet) of [ASP.NET MVC](http:\/\/asp.net\/mvc) \nCode like:\n\n\n\n```\n<%= Html.CheckBox( \"myCheckBox\", \"Click Here\", \"True\", false ) %>\n\n```\n\nonly outputs:\n\n\n\n```\n\n\n```\n\nThere is a `name` there for the form post back but no `id` for javascript or labels :-(\n\n\nI was hoping that changing it to:\n\n\n\n```\nHtml.CheckBox( \"myCheckBox\", \"Click Here\", \n \"True\", false, new { id=\"myCheckBox\" } )\n\n```\n\nwould work - but instead I get an exception:\n\n\n\n```\nSystem.ArgumentException: An item with the same key has already been added.\n\n```\n\nAs if there was already an id somewhere in a collection somewhere - I'm stumped!\n\n\nThe full exception for anyone interested follows (hey - wouldn't it be nice to attach files in here):\n\n\n\n```\nSystem.ArgumentException: An item with the same key has already been added. \n at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)\n at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)\n at System.Web.Routing.RouteValueDictionary.Add(String key, Object value)\n at System.Web.Mvc.TagBuilder2.CreateInputTag(HtmlInputType inputType, String name, RouteValueDictionary attributes)\n at System.Web.Mvc.CheckBoxBuilder.CheckBox(String htmlName, RouteValueDictionary htmlAttributes)\n at System.Web.Mvc.CheckBoxBuilder.CheckBox(String htmlName, String text, String value, Boolean isChecked, RouteValueDictionary htmlAttributes)\n at System.Web.Mvc.CheckBoxExtensions.CheckBox(HtmlHelper helper, String htmlName, String text, String value, Boolean isChecked, Object htmlAttributes)\n at ASP.views_account_termsandconditions_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\\dev\\myProject\\Views\\Account\\Edit.ascx:line 108\n```\n\n","answer_pids":["stackoverflow_Passage_2599","stackoverflow_Passage_2634","stackoverflow_Passage_7802"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_337","query":"Timer-based event triggers | I am currently working on a project with specific requirements. A brief overview of these are as follows: \n\n\n* Data is retrieved from external webservices\n* Data is stored in SQL 2005\n* Data is manipulated via a web GUI\n* The windows service that communicates with the web services has no coupling with our internal web UI, except via the database.\n* Communication with the web services needs to be both time-based, and triggered via user intervention on the web UI.\n\n\nThe current (pre-pre-production) model for web service communication triggering is via a database table that stores trigger requests generated from the manual intervention. I do not really want to have multiple trigger mechanisms, but would like to be able to populate the database table with triggers based upon the time of the call. As I see it there are two ways to accomplish this.\n\n\n1) Adapt the trigger table to store two extra parameters. One being \"Is this time-based or manually added?\" and a nullable field to store the timing details (exact format to be determined). If it is a manaully created trigger, mark it as processed when the trigger has been fired, but not if it is a timed trigger. \n\n*or* \n\n2) Create a second windows service that creates the triggers on-the-fly at timed intervals.\n\n\nThe second option seems like a fudge to me, but the management of option 1 could easily turn into a programming nightmare (how do you know if the last poll of the table returned the event that needs to fire, and how do you then stop it re-triggering on the next poll)\n\n\nI'd appreciate it if anyone could spare a few minutes to help me decide which route (one of these two, or possibly a third, unlisted one) to take.\n\n\n","answer_pids":["stackoverflow_Passage_985","stackoverflow_Passage_987","stackoverflow_Passage_1548","stackoverflow_Passage_5100"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1904","query":"How do I redirect a user to a custom 404 page in ASP.NET MVC instead of throwing an exception? | I want to be able to capture the exception that is thrown when a user requests a non-existent controller and re-direct it to a 404 page. How can I do this?\n\n\nFor example, the user requests `http:\/\/www.nosite.com\/paeges\/1` (*should be* `\/pages\/`). How do I make it so they get re-directed to the 404 rather than the exception screen?\n\n\n","answer_pids":["stackoverflow_Passage_7247","stackoverflow_Passage_7250","stackoverflow_Passage_7251","stackoverflow_Passage_9442"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1867","query":"Click an image, get coordinates | I have a standard HTML image tag with an image in it, 100 by 100 pixels in size. I want people to be able to click the image and for that to pass the X and Y that they click into a function.\n\n\nThe coordinates need to be relative to the image top and left.\n\n\n","answer_pids":["stackoverflow_Passage_7091","stackoverflow_Passage_12553","stackoverflow_Passage_922253"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_437","query":"How to easily consume a web service from PHP | Is there available any tool for PHP which can be used to generate code for consuming a [web service](http:\/\/en.wikipedia.org\/wiki\/Web_service) based on its [WSDL](http:\/\/en.wikipedia.org\/wiki\/Web_Services_Description_Language)? Something comparable to clicking \"Add Web Reference\" in Visual Studio or the Eclipse plugin which does the same thing for Java.\n\n\n","answer_pids":["stackoverflow_Passage_1364","stackoverflow_Passage_3262","stackoverflow_Passage_4307","stackoverflow_Passage_7945","stackoverflow_Passage_8560","stackoverflow_Passage_641595","stackoverflow_Passage_732164"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_985","query":"Whats the best way of finding ALL your memory when developing on the Compact Framework? | I've used the CF [Remote Performance Monitor](http:\/\/blogs.msdn.com\/stevenpr\/archive\/2006\/04\/17\/577636.aspx), however this seems to only track memory initialised in the managed world as opposed to the unmanaged world. Well, I can only presume this as the numbers listed in the profiler are way short of the maximum allowed (32mb on CE 5). Profiling a particular app with the RPM showed me that the total usage of all the caches only manages to get to about 12mb and then slowly shrinks as (I assume) something unmanaged starts to claim more memory.\nThe memory slider in System also shows that the device is very short on memory. If I kill the process the slider shows all the memory coming back. So it must (?) be this managed process that is swallowing the memory.\n\n\nIs there any simple(ish?) fashion how one can track unmanaged memory usage in some way that might enable me to match it up with the corresponding P\/Invoke calls?\n\n\n**EDIT: To all you re-taggers it isn't .NET**, tagging the question like this confuses things. It's .NETCF \/ Compact Framework. I know they appear to be similar but they're different because .NET rocks whereas CF is basically just a wrapper around NotImplementedException.\n\n\n","answer_pids":["stackoverflow_Passage_3431","stackoverflow_Passage_3800","stackoverflow_Passage_8200","stackoverflow_Passage_10764"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1928","query":"Is there an easy way to create ordinals in C#? | Is there an easy way in C# to create [Ordinals](http:\/\/en.wikipedia.org\/wiki\/Ordinal_numbers_%28linguistics%29) for a number? For example:\n\n\n* 1 returns 1st\n* 2 returns 2nd\n* 3 returns 3rd\n* ...etc\n\n\nCan this be done through `String.Format()` or are there any functions available to do this?\n\n\n","answer_pids":["stackoverflow_Passage_7335","stackoverflow_Passage_7339","stackoverflow_Passage_8434","stackoverflow_Passage_9466","stackoverflow_Passage_10556","stackoverflow_Passage_10595","stackoverflow_Passage_11977","stackoverflow_Passage_309578","stackoverflow_Passage_400766","stackoverflow_Passage_429408","stackoverflow_Passage_509973","stackoverflow_Passage_516901","stackoverflow_Passage_519897","stackoverflow_Passage_541372","stackoverflow_Passage_728440","stackoverflow_Passage_782491","stackoverflow_Passage_851265","stackoverflow_Passage_865446","stackoverflow_Passage_1016550","stackoverflow_Passage_1016615","stackoverflow_Passage_1016620","stackoverflow_Passage_1016703"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_832","query":"User Control Property Designer Properties | For a C# UserControl on Windows Mobile (though please answer if you know it for full Windows...it might work) how do you change what shows up in the Designer Properties window for one of the Control's public Properties. For example:\n\n\n\n```\nprivate Color blah = Color.Black;\n\npublic Color Blah\n{\n get { return this.blah; }\n set { this.blah = value; }\n}\n\n```\n\nThis shows up for the control, but it's in the \"Misc\" category and has no description or default value. I've tried using the settings in System.ComponentModel like \"DesignerCategory\", such as:\n\n\n\n```\n[DesignerCategory(\"Custom\")]\n\n```\n\nBut says this is only valid for class declarations... could've sworn it was the System.ComponentModel items I used before...\n\n\n### Update:\n\n\n@John said:\n\n\n\n> \n> DesignerCatogy is used to say if the\n> class is a form, component etc.\n> \n> \n> Try this:\n> \n> \n> [Category(\"Custom\")]\n> \n> \n> \n\n\nIs there a particular namespace I need to use in order to get those?\nI've tried those exactly and the compiler doesn't recognize them.\n\n\nIn .NETCF all I seem to have available from System.ComponentModel is:\n\n\n\n```\nDataObject,\nDataObjectMethod,\nDefaultValue,\nDesignerCategory,\nDesignTimeVisible,\nEditorBrowsable\n\n```\n\nThe only one it doesn't scream at is EditorBrowsable\n\n\n","answer_pids":["stackoverflow_Passage_2802","stackoverflow_Passage_2806","stackoverflow_Passage_7878","stackoverflow_Passage_12641"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_340","query":"Can I have a method returning IEnumerator and use it in a foreach loop? | I need to set the height of every textbox on my form, some of which are nested within other controls. I thought I could do something like this:\n\n\n\n```\nprivate static IEnumerator FindTextBoxes(Control rootControl)\n{\n foreach (Control control in rootControl.Controls)\n {\n if (control.Controls.Count > 0)\n {\n \/\/ Recursively search for any TextBoxes within each child control\n foreach (TextBox textBox in FindTextBoxes(control))\n {\n yield return textBox;\n }\n }\n\n TextBox textBox2 = control as TextBox;\n if (textBox2 != null)\n {\n yield return textBox2;\n }\n }\n}\n\n```\n\nUsing it like this:\n\n\n\n```\nforeach(TextBox textBox in FindTextBoxes(this))\n{\n textBox.Height = height;\n}\n\n```\n\nBut of course the compiler spits its dummy, because *foreach* expects an **IEnumerable** rather than an **IEnumerator**.\n\n\nIs there a way to do this without having to create a separate class with a **GetEnumerator()** method?\n\n\n","answer_pids":["stackoverflow_Passage_1003","stackoverflow_Passage_1007","stackoverflow_Passage_1009","stackoverflow_Passage_2008","stackoverflow_Passage_3315","stackoverflow_Passage_91420"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_484","query":"What point should someone decide to switch Database Systems | When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc\n\n\n","answer_pids":["stackoverflow_Passage_1485","stackoverflow_Passage_1511","stackoverflow_Passage_1523","stackoverflow_Passage_4907"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1543","query":"Convert a string to an enum in C# | What's the best way to convert a string to an enumeration value in C#?\n\n\nI have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value (which will be in the form of a string) and convert it to the corresponding enumeration value.\n\n\nIn an ideal world, I could do something like this:\n\n\n\n```\nStatusEnum MyStatus = StatusEnum.Parse(\"Active\");\n\n```\n\nbut that isn't valid code.\n\n\n","answer_pids":["stackoverflow_Passage_5709","stackoverflow_Passage_5710","stackoverflow_Passage_5712","stackoverflow_Passage_5714","stackoverflow_Passage_5723","stackoverflow_Passage_8959","stackoverflow_Passage_9039","stackoverflow_Passage_219269","stackoverflow_Passage_375953","stackoverflow_Passage_396187","stackoverflow_Passage_423277","stackoverflow_Passage_538803","stackoverflow_Passage_614876","stackoverflow_Passage_633205","stackoverflow_Passage_650215","stackoverflow_Passage_677267","stackoverflow_Passage_749744","stackoverflow_Passage_786132","stackoverflow_Passage_803973","stackoverflow_Passage_829489","stackoverflow_Passage_1016432","stackoverflow_Passage_1016541","stackoverflow_Passage_1016542","stackoverflow_Passage_1016629","stackoverflow_Passage_1016657","stackoverflow_Passage_1016715"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1979","query":"Do you use AOP (Aspect Oriented Programming) in production software? | [AOP](http:\/\/en.wikipedia.org\/wiki\/Aspect-oriented_programming) is an interesting programming paradigm in my opinion. However, there haven't been discussions about it yet here on stackoverflow (at least I couldn't find them). What do you think about it in general? Do you use AOP in your projects? Or do you think it's rather a niche technology that won't be around for a long time or won't make it into the mainstream (like OOP did, at least in theory ;))? \n\n\nIf you do use AOP then please let us know which tools you use as well. Thanks!\n\n\n","answer_pids":["stackoverflow_Passage_7554","stackoverflow_Passage_7559","stackoverflow_Passage_7581","stackoverflow_Passage_9533","stackoverflow_Passage_9777","stackoverflow_Passage_10428","stackoverflow_Passage_10692","stackoverflow_Passage_10783","stackoverflow_Passage_11103","stackoverflow_Passage_11104","stackoverflow_Passage_11284","stackoverflow_Passage_980102"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_30","query":"How would you access Object properties from within an object method? | What is the \"purist\" or \"correct\" way to access an object's properties from within an object method that is not a getter\/setter method?\n\n\nI know that from outside of the object you should use a getter\/setter, but from within would you just do:\n\n\nJava:\n\n\n\n```\nString property = this.property;\n\n```\n\nPHP:\n\n\n\n```\n$property = $this->property;\n\n```\n\nor would you do:\n\n\nJava:\n\n\n\n```\nString property = this.getProperty();\n\n```\n\nPHP:\n\n\n\n```\n$property = $this->getProperty();\n\n```\n\nForgive me if my Java is a little off, it's been a year since I programmed in Java...\n\n\n**EDIT:**\n\n\nIt seems people are assuming I am talking about private or protected variables\/properties only. When I learned OO I was taught to use getters\/setters for every single property even if it was public (and actually I was told never to make any variable\/property public). So, I may be starting off from a false assumption from the get go. It appears that people answering this question are maybe saying that you should have public properties and that those don't need getters and setters, which goes against what I was taught, and what I was talking about, although maybe that needs to be discussed as well. That's probably a good topic for a different question though...\n\n\n","answer_pids":["stackoverflow_Passage_46","stackoverflow_Passage_47","stackoverflow_Passage_50","stackoverflow_Passage_52","stackoverflow_Passage_53","stackoverflow_Passage_69","stackoverflow_Passage_127","stackoverflow_Passage_1055","stackoverflow_Passage_5251","stackoverflow_Passage_5257","stackoverflow_Passage_7742","stackoverflow_Passage_7745","stackoverflow_Passage_9757","stackoverflow_Passage_10435","stackoverflow_Passage_10679","stackoverflow_Passage_10680","stackoverflow_Passage_10841","stackoverflow_Passage_13030","stackoverflow_Passage_80351"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1107","query":"Good Resources for Relational Database Design | I'm looking for a book\/site\/tutorial on best practices for relational database design, tuning for performance etc. It turns out this kind of resource is a bit difficult to find; there's a lot of \"here's normalization, here's ER diagrams, have at it,\" but not much in the way of real examples. Anyone have any ideas?\n\n\n","answer_pids":["stackoverflow_Passage_3909","stackoverflow_Passage_3922","stackoverflow_Passage_3924","stackoverflow_Passage_8402","stackoverflow_Passage_11868"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1335","query":"What's a Good Database ERD Tool for Linux? | I've recently switched to Linux on my work machine and, new to the Linux desktop environment, I'd like to find a decent ERD tool for database design. Booting back into my Windows partition every time I need to create a diagram is going to get unpleasant quickly. I looked at Dia, but didn't see any DB tools - only UML, networking, etc.\n\n\nAnyone have any recommendations? For what it's worth, I'm using Ubuntu (Hardy Heron).\n\n\nThanks.\n\n\n","answer_pids":["stackoverflow_Passage_4891","stackoverflow_Passage_4896","stackoverflow_Passage_5104","stackoverflow_Passage_7641","stackoverflow_Passage_8858","stackoverflow_Passage_9849","stackoverflow_Passage_9853","stackoverflow_Passage_10487","stackoverflow_Passage_11316","stackoverflow_Passage_11957","stackoverflow_Passage_12751","stackoverflow_Passage_13017","stackoverflow_Passage_218619"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_103","query":"Editing database records by multiple users | I have designed database tables (normalised, on an MS SQL server) and created a standalone windows front end for an application that will be used by a handful of users to add and edit information. We will add a web interface to allow searching accross our production area at a later date.\n\n\nI am concerned that if two users start editing the same record then the last to commit the update would be the 'winner' and important information may be lost. A number of solutions come to mind but I'm not sure if I am going to create a bigger headache.\n\n\n1. Do nothing and hope that two users are never going to be editing the same record at the same time. *- Might never happed but what if it does?*\n2. Editing routine could store a copy of the original data as well as the updates and then compare when the user has finished editing. If they differ show user and comfirm update *- Would require two copies of data to be stored.*\n3. Add last updated DATETIME column and check it matches when we update, if not then show differences. *- requires new column in each of the relevant tables.*\n4. Create an editing table that registers when users start editing a record that will be checked and prevent other users from editing same record. *- would require carful thought of program flow to prevent deadlocks and records becoming locked if a user crashes out of the program.*\n\n\nAre there any better solutions or should I go for one of these?\n\n\n","answer_pids":["stackoverflow_Passage_234","stackoverflow_Passage_272","stackoverflow_Passage_459","stackoverflow_Passage_837","stackoverflow_Passage_3463","stackoverflow_Passage_10835","stackoverflow_Passage_10839","stackoverflow_Passage_85856","stackoverflow_Passage_757726"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_200","query":"Are Multiple DataContext classes ever appropriate? | In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary to create [DataContext](http:\/\/msdn.microsoft.com\/en-us\/library\/system.data.linq.datacontext.aspx) [classes](http:\/\/dotnetslackers.com\/articles\/csharp\/InsideTheLINQToSQLDataContextClass.aspx) (which is usually done using the designer in VS 2008). From the UI perspective, the DataContext is a design of the sections of your database that you would like to expose to through LinqToSql and is integral in setting up the ORM features of LinqToSql.\n\n\nMy question is: I am setting up a project that uses a large database where all tables are interconnected in some way through Foreign Keys. My first inclination is to make one huge DataContext class that models the entire database. That way I could in theory (though I don't know if this would be needed in practice) use the Foreign Key connections that are generated through LinqToSql to easily go between related objects in my code, insert related objects, etc.\n\n\nHowever, after giving it some thought, I am now thinking that it may make more sense to create multiple DataContext classes, each one relating to a specific namespace or logical interrelated section within my database. My main concern is that instantiating and disposing one huge DataContext class all the time for individual operations that relate to specific areas of the Database would be impose an unnecessary imposition on application resources. Additionally, it is easier to create and manage smaller DataContext files than one big one. The thing that I would lose is that there would be some distant sections of the database that would not be navigable through LinqToSql (even though a chain of relationships connects them in the actual database). Additionally, there would be some table classes that would exist in more than one DataContext.\n\n\nAny thoughts or experience on whether multiple DataContexts (corresponding to DB namespaces) are appropriate in place of (or in addition to) one very large DataContext class (corresponding to the whole DB)?\n\n\n","answer_pids":["stackoverflow_Passage_568","stackoverflow_Passage_860","stackoverflow_Passage_1610","stackoverflow_Passage_5309","stackoverflow_Passage_8314","stackoverflow_Passage_476497"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1127","query":"In .NET, will empty method calls be optimized out? | Given an empty method body, will the JIT optimize out the call (I know the C# compiler won't). How would I go about finding out? What tools should I be using and where should I be looking?\n\n\nSince I'm sure it'll be asked, the reason for the empty method is a preprocessor directive.\n\n\n\n\n---\n\n\n@Chris:\nMakes sense, but it could optimize out calls to the method. So the method would still exist, but static calls to it could be removed (or at least inlined...)\n\n\n@Jon:\nThat just tells me the language compiler doesn't do anything. I think what I need to do is run my dll through ngen and look at the assembly.\n\n\n","answer_pids":["stackoverflow_Passage_3977","stackoverflow_Passage_3978","stackoverflow_Passage_3979","stackoverflow_Passage_4100"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_907","query":"Access a SQL Server 2005 Express Edition from a network computer | How do you access a SQL Server 2005 Express Edition from a application in a network computer?\n\n\nThe access I need is both from application (Linq-to-SQL and ODBC) and from Management Studio\n\n\n","answer_pids":["stackoverflow_Passage_3104","stackoverflow_Passage_3285","stackoverflow_Passage_8022"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_154","query":"What is a better file copy alternative than the Windows default? | I need to copy hundreds of gigs of random files around on my computer and am pretty leery of using the vanilla file copy built into Windows.\n\n\nI don't want it to hang on a \"Are you sure?\", \"Are you really sure?\", \"Even zip files?\", \"Surely not read-only files too!\" loop as soon as I step away.\n\n\nI don't want it to work for hours and then stop unexpectedly: \"Someone once opened this file and so I won't copy it!\" and then cancel the whole copy or just quit with no indication of what was done and what work remains.\n\n\nWhat file management programs do you have experience with? Which do you recommend?\n\n\nThis question is related to my other question: [How can I use an old PATA hard disk drive on my newer SATA-only computer?](https:\/\/stackoverflow.com\/questions\/225\/how-can-i-use-an-old-pata-hard-disk-drive-on-my-newer-sata-only-computer)\n\n\n","answer_pids":["stackoverflow_Passage_373","stackoverflow_Passage_376","stackoverflow_Passage_377","stackoverflow_Passage_379","stackoverflow_Passage_381","stackoverflow_Passage_383","stackoverflow_Passage_388","stackoverflow_Passage_395","stackoverflow_Passage_584","stackoverflow_Passage_585","stackoverflow_Passage_586","stackoverflow_Passage_1150","stackoverflow_Passage_1159","stackoverflow_Passage_1338","stackoverflow_Passage_11070","stackoverflow_Passage_11246","stackoverflow_Passage_11247","stackoverflow_Passage_11321","stackoverflow_Passage_11914","stackoverflow_Passage_13414","stackoverflow_Passage_26858","stackoverflow_Passage_26861","stackoverflow_Passage_56968"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_511","query":"Best strategy to write hooks for subversion in Windows | What is the best approach to write **hooks** for **Subversion** in **Windows**? As far as I know, only executable files can be used. So what is the best choice? \n\n\n* Plain batch files (very limited but perhaps OK for very simple solutions)\n* Dedicated compiled executable applications (sledgehammer to crack a nutshell?)\n* Some other hybrid choice (like a batch file running a Powershell script)\n\n\n","answer_pids":["stackoverflow_Passage_1558","stackoverflow_Passage_1974","stackoverflow_Passage_4766","stackoverflow_Passage_5946","stackoverflow_Passage_12534","stackoverflow_Passage_13021","stackoverflow_Passage_13027"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_947","query":"Mootools: Drag & Drop problems | I've asked this question to the forums on the Mootools website and one person said that my class selection was corrupted before an admin came along and changed my post status to invalid. Needless to say this did not help much. I then posted to a google group for Mootools with no response. My question is why doesn't the 'enter', 'leave', 'drop' events fire for my '.drop' elements? The events for the .drag elements are working.\n\n\n\n```\nUntitled Page<\/title>\n<script type=\"text\/javascript\" src=\"\/SDI\/includes\/mootools-1.2.js\"><\/script>\n<script type=\"text\/javascript\" src=\"\/SDI\/includes\/mootools-1.2-more.js\"><\/script>\n<script type=\"text\/javascript\" charset=\"utf-8\">\n window.addEvent('domready', function() {\n var fx = [];\n $$('#draggables div').each(function(drag){\n new Drag.Move(drag, {\n droppables: $$('#droppables div'),\n onDrop: function(element, droppable){\n if(!droppable) {\n }\n else {\n element.setStyle('background-color', '#1d1d20');\n }\n element.dispose();\n },\n onEnter: function(element, droppable){\n element.setStyle('background-color', '#ffffff');\n },\n onLeave: function(element, droppable){\n element.setStyle('background-color', '#000000');\n }\n });\n });\n\n $$('#droppables div').each(function(drop, index){\n drop.addEvents({\n 'enter': function(el, obj){\n drop.setStyle('background-color', '#78ba91');\n },\n 'leave': function(el, obj){\n drop.setStyle('background-color', '#1d1d20');\n },\n 'drop': function(el, obj){\n el.remove();\n }\n });\n });\n });\n<\/script>\n\n<form id=\"form1\" runat=\"server\">\n<div>\n <div id=\"draggables\">\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n <div class=\"drag\"><\/div>\n<\/div>\n\n<div id=\"droppables\">\n <div class=\"drop\"><\/div>\n <div class=\"drop\"><\/div>\n <div class=\"drop\"><\/div>\n <div class=\"drop\"><\/div>\n <div class=\"drop\"><\/div>\n <div class=\"drop\"><\/div>\n<\/div>\n\n<\/div>\n<\/form>\n\n```\n\n","answer_pids":["stackoverflow_Passage_4438","stackoverflow_Passage_8609","stackoverflow_Passage_167621"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1700","query":"Tracking Useful Information | What do the clever programmers here do to keep track of handy programming tricks and useful information they pick up over their many years of experience? Things like useful compiler arguments, IDE short-cuts, clever code snippets, etc.\n\n\nI sometimes find myself frustrated when looking up something that I used to know a year or two ago. My IE favorites probably represent a good chunk of the Internet in the late 1990s, so clearly that isn't effective (at least for me). Or am I just getting old?\n\n\nSo.. what do you do?\n\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\n\n\n","answer_pids":["stackoverflow_Passage_6435","stackoverflow_Passage_6436","stackoverflow_Passage_6437","stackoverflow_Passage_6440","stackoverflow_Passage_6442","stackoverflow_Passage_6444","stackoverflow_Passage_6457","stackoverflow_Passage_6460","stackoverflow_Passage_6473","stackoverflow_Passage_6487","stackoverflow_Passage_9793","stackoverflow_Passage_13319"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_375","query":"Best way to get InnerXml of an XElement? | What's the best way to get the contents of the mixed `body` element in the code below? The element might contain either XHTML or text, but I just want its contents in string form. The `XmlElement` type has the `InnerXml` property which is exactly what I'm after.\n\n\nThe code as written *almost* does what I want, but includes the surrounding `<body>`...`<\/body>` element, which I don't want.\n\n\n\n```\nXDocument doc = XDocument.Load(new StreamReader(s));\nvar templates = from t in doc.Descendants(\"template\")\n where t.Attribute(\"name\").Value == templateName\n select new\n {\n Subject = t.Element(\"subject\").Value,\n Body = t.Element(\"body\").ToString()\n };\n\n```\n\n","answer_pids":["stackoverflow_Passage_1144","stackoverflow_Passage_1146","stackoverflow_Passage_1186","stackoverflow_Passage_6071","stackoverflow_Passage_12021","stackoverflow_Passage_12022","stackoverflow_Passage_12801","stackoverflow_Passage_12811","stackoverflow_Passage_12837","stackoverflow_Passage_13189","stackoverflow_Passage_13415","stackoverflow_Passage_13563","stackoverflow_Passage_262979","stackoverflow_Passage_422615","stackoverflow_Passage_518155","stackoverflow_Passage_1016445"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1823","query":"Using Lucene to search for email addresses | I want to use Lucene (in particular, Lucene.NET) to search for email address domains.\n\n\nE.g. I want to search for \"@gmail.com\" to find all emails sent to a gmail address.\n\n\nRunning a Lucene query for \"\\*@gmail.com\" results in an error, asterisks cannot be at the start of queries. Running a query for \"@gmail.com\" doesn't return any matches, because \"foo@gmail.com\" is seen as a whole word, and you cannot search for just parts of a word.\n\n\nHow can I do this?\n\n\n","answer_pids":["stackoverflow_Passage_7446","stackoverflow_Passage_7859","stackoverflow_Passage_9505","stackoverflow_Passage_10266","stackoverflow_Passage_10448"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_287","query":"Paging SQL Server 2005 Results | How do I page results in SQL Server 2005?\n\n\nI tried it in SQL Server 2000, but there was no reliable way to do this. I'm now wondering if SQL Server 2005 has any built in method?\n\n\nWhat I mean by paging is, for example, if I list users by their username, I want to be able to only return the first 10 records, then the next 10 records and so on.\n\n\nAny help would be much appreciated.\n\n\n","answer_pids":["stackoverflow_Passage_821","stackoverflow_Passage_825","stackoverflow_Passage_2842","stackoverflow_Passage_3272","stackoverflow_Passage_3832","stackoverflow_Passage_10030","stackoverflow_Passage_12110"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_918","query":"Replicating load related crashes in non-production environments | We're running a custom application on our intranet and we have found a problem after upgrading it recently where IIS hangs with 100% CPU usage, requiring a reset.\n\n\nRather than subject users to the hangs, we've rolled back to the previous release while we determine a solution. The first step is to reproduce the problem -- but we can't. \n\n\nHere's some background:\n\n\nProd has a single virtualized (vmware) web server with two CPUs and 2 GB of RAM. The database server has 4GB, and 2 CPUs as well. It's also on VMWare, but separate physical hardware.\n\n\nDuring normal usage the application runs fine. The w3wp.exe process normally uses betwen 5-20% CPU and around 200MB of RAM. CPU and RAM fluctuate slightly under normal use, but nothing unusual.\n\n\nHowever, when we start running into problems, the RAM climbs dramatically and the CPU pegs at 98% (or as much as it can get). The site becomes unresponsive, necessitating a IIS restart. Resetting the app pool does nothing in this situation, a full IIS restart is required.\n\n\nIt does not happen during the night (no usage). It happens more when the site is under load, but it has also happened under non-peak periods.\n\n\nFirst step to solving this problem is reproducing it. To simulate the load, we starting using JMeter to simulate usage. Our load script is based on actual usage around the time of the crash. Using JMeter, we can ramp the usage up quite high (2-3 times the load during the crash) but the site behaves fine. CPU is up high, and the site does become sluggish, but memory usage is reasonable and nothing is hanging.\n\n\nDoes anyone have any tips on how to reproduce a problem like this in a non-production environment? We'd really like to reproduce the error, determine a solution, then test again to make sure we've resolved it. During the process we've found a number of small things that we've improved that might solve the problem, but I'd really feel a lot more confident if we could reproduce the problem and test the improved version.\n\n\nAny tools, techniques or theories much appreciated!\n\n\n","answer_pids":["stackoverflow_Passage_3144","stackoverflow_Passage_3145","stackoverflow_Passage_3154"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1935","query":"Does the Microsoft Report Viewer Redistributable 2008 really require .NET Framework version 3.5? | I'm packaging up a .NET 2.0 based web app for deployment through a Windows Installer based package. Our app uses Report Viewer 2008 and I'm including the Microsoft Report Viewer Redistributable 2008 installer. When I check the [download page for Report Viewer 2008](http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=cc96c246-61e5-4d9e-bb5f-416d75a1b9ef&DisplayLang=en \"Microsoft Report Viewer Redistributable 2008 Download\"), it lists .NET 3.5 as a requirement. \n\n\nIs having .Net 3.5 installed really needed Report Viewer 2008? We targeted .Net 2.0 for our app, there isn't anything in our code that would use the 3.0 or 3.5 Frameworks.\n\n\nWe are in the middle of testing and everything seems to be working with out 3.5, but I don't want to miss an edge condition and cause an error for a customer because he was missing a prerequisite run time package.\n\n\n","answer_pids":["stackoverflow_Passage_7364","stackoverflow_Passage_7369","stackoverflow_Passage_8462","stackoverflow_Passage_8467","stackoverflow_Passage_9477","stackoverflow_Passage_10588"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1685","query":"Email queueing in php | What is the most proper way to sending email of minimal 1000 or more in PHP? Any reliable email queuing technique that is capable to handle that?\n\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\n\n\n","answer_pids":["stackoverflow_Passage_6362","stackoverflow_Passage_6369","stackoverflow_Passage_6384","stackoverflow_Passage_6386","stackoverflow_Passage_6394","stackoverflow_Passage_7773","stackoverflow_Passage_9192","stackoverflow_Passage_1016650"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_392","query":"How do I know which SQL Server 2005 index recommendations to implement, if any? | We're in the process of upgrading one of our SQL Server instances from 2000 to 2005. I installed the performance dashboard (<http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyId=1d3a4a0d-7e0c-4730-8204-e419218c1efc&displaylang=en>) for access to some high level reporting. One of the reports shows missing (recommended) indexes. I think it's based on some system view that is maintained by the query optimizer.\n\n\nMy question is what is the best way to determine when to take an index recommendation. I know that it doesn't make sense to apply all of the optimizer's suggestions. I see a lot of advice that basically says to try the index and to keep it if performance improves and to drop it if performances degrades or stays the same. I wondering if there is a better way to make the decision and what best practices exist on this subject.\n\n\n","answer_pids":["stackoverflow_Passage_1215","stackoverflow_Passage_1216","stackoverflow_Passage_1808","stackoverflow_Passage_5901"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_509","query":"How do you set up Python scripts to work in Apache 2.0? | I tried to follow a couple of googled up tutorials on setting up mod\\_python, but failed every time. Do you have a good, step-by step, rock-solid howto?\n\n\nMy dev box is OS X, production - Centos.\n\n\n","answer_pids":["stackoverflow_Passage_1556","stackoverflow_Passage_1567","stackoverflow_Passage_1568","stackoverflow_Passage_276632"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_223","query":"What's the best way to implement BDD\/TDD in .NET 2.0? | I'm looking to add a testing suite to my application, however I can't move to the newer testing frameworks for .NET 3.5. \n\n\nDoes anyone have a suggestion about good testing frameworks to use?\n\n\n","answer_pids":["stackoverflow_Passage_608","stackoverflow_Passage_611","stackoverflow_Passage_614","stackoverflow_Passage_1028","stackoverflow_Passage_1034","stackoverflow_Passage_3442","stackoverflow_Passage_9449","stackoverflow_Passage_9716","stackoverflow_Passage_10761","stackoverflow_Passage_10985","stackoverflow_Passage_11067","stackoverflow_Passage_12377","stackoverflow_Passage_12378"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1639","query":"Should I *always* favour implictly typed local variables in C# 3.0? | [Resharper](http:\/\/resharper.blogspot.com\/2008\/03\/varification-using-implicitly-typed.html) certainly thinks so, and out of the box it will nag you to convert\n\n\n\n```\nDooberry dooberry = new Dooberry();\n\n```\n\nto\n\n\n\n```\nvar dooberry = new Dooberry();\n\n```\n\nIs that really considered the best style?\n\n\n","answer_pids":["stackoverflow_Passage_6142","stackoverflow_Passage_6143","stackoverflow_Passage_6144","stackoverflow_Passage_6145","stackoverflow_Passage_6146","stackoverflow_Passage_6156","stackoverflow_Passage_6164","stackoverflow_Passage_6232","stackoverflow_Passage_6253","stackoverflow_Passage_6559","stackoverflow_Passage_9145","stackoverflow_Passage_10555","stackoverflow_Passage_12023"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_694","query":"Automatically check bounced emails via POP3? | Can anyone recommend software or a .NET library that will check for bounced emails and the reason for the bounce? I get bounced emails into a pop3 account that I can read then.\n\n\nI need it to keep my user database clean from invalid email addresses and want to automate this (mark user as invalid email).\n\n\n","answer_pids":["stackoverflow_Passage_2285","stackoverflow_Passage_2357","stackoverflow_Passage_2364","stackoverflow_Passage_2410","stackoverflow_Passage_7493","stackoverflow_Passage_11705"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1491","query":"Is there anyway to disable the client-side validation for dojo date text box? | In my example below I'm using a `dijit.form.DateTextBox`:\n\n\n\n```\n<input type=\"text\" name=\"startDate\" dojoType=\"dijit.form.DateTextBox\" constraints=\"{datePattern:'MM\/dd\/yyyy'}\" value='<c:out value=\"${sessionScope.adminMessageForm.startDate}\"\/>' \/>\n\n```\n\nSo for example, if the user starts to enter \"asdf\" into the date the field turns yellow and a popup error message appears saying `The value entered is not valid.`. Even if I remove the `constraints=\"{datePattern:'MM\/dd\/yyyy'}\"` it still validates. \n\n\nWithout going into details as to why, I would like to be able keep the dojoType and still prevent validation in particular circumstances.\n\n\n","answer_pids":["stackoverflow_Passage_5495","stackoverflow_Passage_5535","stackoverflow_Passage_8996","stackoverflow_Passage_9728"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_824","query":"How can I empty the recycle bin for all users from a Windows service application in c# | I'm looking for a c# snippet which I can insert in a Windows service. The code must empty the recycle bin for all users on the computer.\n\n\nI have previously tried using `SHEmptyRecycleBin` (ref <http:\/\/www.codeproject.com\/KB\/cs\/Empty_Recycle_Bin.aspx>) however the code doesn't work when ran from a windows service as the service is running with local system privileges.\n\n\n","answer_pids":["stackoverflow_Passage_2796","stackoverflow_Passage_2831","stackoverflow_Passage_2833"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_124","query":"Easy-to-Use Regular Expression Support in C++? | I'm looking for a robust, easy-to-use, regular expression evaluator for native C++, either platform-independent or Windows-specific.\n\n\nRequirements:\n\n\n* Can't use Boost or ACE regex libraries (unfortunately)\n* Can't use .NET Regex (or any managed code)\n\n\nThe main requirement is that it should be standalone and open.\n\n\n","answer_pids":["stackoverflow_Passage_293","stackoverflow_Passage_297","stackoverflow_Passage_333","stackoverflow_Passage_441","stackoverflow_Passage_2265","stackoverflow_Passage_2390","stackoverflow_Passage_2407","stackoverflow_Passage_10117","stackoverflow_Passage_328093","stackoverflow_Passage_677696","stackoverflow_Passage_732809"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_201","query":"CPU throttling in C++ | I was just wondering if there is an elegant way to set the maximum CPU load for a particular thread doing intensive calculations.\n\n\nRight now I have located the most time-consuming loop in the thread (it does only compression) and use `GetTickCount()` and `Sleep()` with hardcoded values. It makes sure that the loop continues for a certain period and then sleeps for a certain minimum time. It more or less does the job, i.e. guarantees that the thread will not use more than 50% of CPU.\n\n\nHowever, behavior is dependent on the number of CPU cores (huge disadvantage) and simply ugly (smaller disadvantage).\n\n\nAny ideas?\n\n\n","answer_pids":["stackoverflow_Passage_546","stackoverflow_Passage_554","stackoverflow_Passage_9371","stackoverflow_Passage_9391","stackoverflow_Passage_10475","stackoverflow_Passage_942498"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1323","query":"Can you explain closures (as they relate to Python)? | I've been reading a lot about closures and I think I understand them, but without clouding the picture for myself and others, I am hoping someone can explain closures as succinctly and clearly as possible. I'm looking for a simple explanation that might help me understand where and why I would want to use them.\n\n\n","answer_pids":["stackoverflow_Passage_4820","stackoverflow_Passage_4827","stackoverflow_Passage_4831","stackoverflow_Passage_7905","stackoverflow_Passage_10410","stackoverflow_Passage_10749","stackoverflow_Passage_11358","stackoverflow_Passage_11761","stackoverflow_Passage_364988","stackoverflow_Passage_487241","stackoverflow_Passage_646751","stackoverflow_Passage_940554","stackoverflow_Passage_976122","stackoverflow_Passage_983839"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1338","query":"How would you go about evaluating a programmer? | A few weeks ago, I was assigned to evaluate all our programmers. I'm very uncomfortable with this since I was the one who taught everyone the shop's programming language (they all got out of college not knowing the language and as luck would have it, I'm very proficient with it.). On the evaluation, I was very biased on their performance (perfect scores).\n\n\nI'm glad that our programming shop doesn't require an average performance level but I heard horror stories of shops which do require an average level.\n\n\nMy question are as follows: \n\n\n1. As a programmer, what evaluation questions would you like to see?\n2. As a manager, what evaluation questions would you like to see?\n3. As the evaluator, how can you prevent bias in your evaluation?\n4. I would love to remove the evaluation test. Is there any advantages to having an evaluation test? Any disadvantage?\n\n\n","answer_pids":["stackoverflow_Passage_4894","stackoverflow_Passage_4897","stackoverflow_Passage_4898","stackoverflow_Passage_4903","stackoverflow_Passage_8775"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1379","query":"Software to use when designing classes | What software do you use when designing classes and their relationship, or just pen and paper?\n\n\n","answer_pids":["stackoverflow_Passage_5030","stackoverflow_Passage_5031","stackoverflow_Passage_5033","stackoverflow_Passage_5034","stackoverflow_Passage_5037","stackoverflow_Passage_5039","stackoverflow_Passage_5041","stackoverflow_Passage_5044","stackoverflow_Passage_5046","stackoverflow_Passage_5047","stackoverflow_Passage_5057","stackoverflow_Passage_5095"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_110","query":"Internationalization in your projects | How have you implemented Internationalization (i18n) in actual projects you've worked on?\n\n\nI took an interest in making software cross-cultural after I read the famous post by Joel, [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)](http:\/\/www.joelonsoftware.com\/articles\/Unicode.html). However, I have yet to able to take advantage of this in a real project, besides making sure I used Unicode strings where possible. But making all your strings Unicode and ensuring you understand what encoding everything you work with is in is just the tip of the i18n iceberg.\n\n\nEverything I have worked on to date has been for use by a controlled set of US English speaking people, or i18n just wasn't something we had time to work on before pushing the project live. So I am looking for any tips or war stories people have about making software more localized in real world projects.\n\n\n","answer_pids":["stackoverflow_Passage_257","stackoverflow_Passage_262","stackoverflow_Passage_365","stackoverflow_Passage_418","stackoverflow_Passage_9644","stackoverflow_Passage_10413","stackoverflow_Passage_10565","stackoverflow_Passage_10936","stackoverflow_Passage_11043","stackoverflow_Passage_11641","stackoverflow_Passage_11642"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1933","query":"Broken chart images in Crystal Reports in web application | I have a collection of crystal reports that contains charts. They look fine locally and when printed, but when viewing them through a web application using a `CrystalReportViewer` the charts dispay as broken images. \n\n\nViewing the properties of the broken image show the url as `...CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_8d12a01f-b336-4b8b-b0c7-83d9571d87e4.png`. \n\n\nI have tried adding\n\n\n\n```\n<httpHandlers>\n <add verb=\"GET\" path=\"CrystalImageHandler.aspx\" \n type=\"CrystalDecisions.Web.CrystalImageHandler,CrystalDecisions.Web,\n Version=Version=10.5.3700.0, Culture=neutral,\n PublicKeyToken=692fbea5521e1304\"\/>\n<\/httpHandlers>\n\n```\n\nto the `web.config` as suggested via a google search but that has not resolved my issue.\n\n\n","answer_pids":["stackoverflow_Passage_7541"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_956","query":"Generic iterator | I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list.\n\n\nThe custom list defines an iterator;\n\n\n\n```\nclass Iterator: public std::iterator<std::forward_iterator_tag, T> {\n \/\/ ...\n}\n\nIterator begin() {\n return (Iterator(root));\n}\n\nIterator end() {\n return (Iterator(NULL));\n}\n\n```\n\nwith the appropriate operators overloaded. \n\n\nIdeally, I would like to do this;\n\n\n\n```\nclass Foo {\npublic:\n Foo() {\n std::list<int> x;\n std::vector<int> y;\n custom_list<int> z;\n\n iter = x.begin(); \/\/ OR\n iter = y.begin(); \/\/ OR\n iter = z.begin();\n\n \/\/ ...\n };\nprivate:\n std::iterator<int> iter;\n};\n\n```\n\nBut obviously these are all iterators of different types. I can assume all the containers are of the same type however.\n\n\nIs there an elegant way to solve this problem?\n\n\n","answer_pids":["stackoverflow_Passage_3309","stackoverflow_Passage_3660","stackoverflow_Passage_8136","stackoverflow_Passage_10675"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_841","query":"Find out which colours are in use when using the MFC Feature pack in Office 2007 style | I'm updating some of our legacy C++ code to use the \"MFC feature pack\" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to give our application a more modern appearance. This gives us gradient filled window titles, status bars etc, and the use of the ribbon toolbars.\n\n\nHowever, our application contains some owner drawn controls, and I'd like to update these to match the color scheme used by the feature pack. Ideally I'd like to know the light and shaded toolbar colors that are currently in use.\n\n\nI've had a hunt around the documentation and web and have not yet found anything. Does anyone know how to find this information out?\n\n\n[Edit]\n\n\nIn particular we need to find out which colors are being used at runtime. You can change the appearance of your application at runtime using the new static function CMFCVisualManager::SetDefaultManager.\n\n\nThe following msdn page shows you what kind of styles are available, in particular the Office2007 look:\n[link to msdn](http:\/\/msdn.microsoft.com\/en-us\/library\/cc137831.aspx)\n\n\n","answer_pids":["stackoverflow_Passage_2845","stackoverflow_Passage_2849","stackoverflow_Passage_2864","stackoverflow_Passage_3202","stackoverflow_Passage_3217","stackoverflow_Passage_3220","stackoverflow_Passage_4123","stackoverflow_Passage_5218","stackoverflow_Passage_7901","stackoverflow_Passage_11050"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_867","query":"How do I get dbmail to process items from the queue for SQL Server 2005? | When I use the sp\\_send\\_dbmail stored procedure, I get a message saying that my mail was queued. However, it never seems to get delivered. I can see them in the queue if I run this SQL:\n\n\n\n```\nSELECT * FROM msdb..sysmail_allitems WHERE sent_status = 'unsent'\n\n```\n\nThis SQL returns a 1:\n\n\n\n```\nSELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb'\n\n```\n\nThis stored procedure returns STARTED:\n\n\n\n```\nmsdb.dbo.sysmail_help_status_sp\n\n```\n\nThe appropriate accounts and profiles have been set up and the mail was functioning at one point. There are no errors in msdb.dbo.sysmail\\_event\\_log. \n\n\n","answer_pids":["stackoverflow_Passage_3016","stackoverflow_Passage_3275","stackoverflow_Passage_8123","stackoverflow_Passage_73981"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_725","query":"Can I use JavaScript to create a client side email? | I want to create a client side mail creator web page. I know the problems of using the mailto action in an html form (not standard, no default mail appication set on the client). But the web page isn't very important, and they don't care very much.\n\n\nThe mail created by the mailto action has the syntax:\n\n\n\n> \n> subject: undefined subject \n> \n> body:\n> \n> \n> param1=value1 \n> \n> param2=value2 \n> \n> . \n> \n> . \n> \n> . \n> \n> paramn=valuen \n> \n> \n> \n\n\nCan I use JavaScript to format the mail like this?\n\n\n\n> \n> Subject:XXXXX\n> \n> \n> Body:\n> Value1;Value2;Value3...ValueN\n> \n> \n> \n\n\n","answer_pids":["stackoverflow_Passage_2402","stackoverflow_Passage_2408","stackoverflow_Passage_2413","stackoverflow_Passage_2422","stackoverflow_Passage_7623","stackoverflow_Passage_555974"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_882","query":"FogBugz compared to OnTime | Has anyone used both FogBugz and Axosoft's OnTime and care to offer an opinion? AxoSoft has a big [feature comparison chart](http:\/\/web.archive.org\/web\/20090522134148\/http:\/\/www.axosoft.com:80\/products\/ontime_competition.aspx) but I'm also interested in more subjective thoughts on things like ease of use and stability.\n\n\n","answer_pids":["stackoverflow_Passage_2992","stackoverflow_Passage_2995","stackoverflow_Passage_2999","stackoverflow_Passage_10745","stackoverflow_Passage_11049","stackoverflow_Passage_26431","stackoverflow_Passage_37858","stackoverflow_Passage_65603"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1349","query":"Using GLUT with Visual C++ Express Edition | What are the basic steps to compile an OpenGL application using *GLUT (OpenGL Utility Toolkit)* under Visual C++ Express Edition?\n\n\n","answer_pids":["stackoverflow_Passage_4955","stackoverflow_Passage_8785","stackoverflow_Passage_10567"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1945","query":"Associating source and search keywords with account creation | As a part of the signup process for my online application, I'm thinking of tracking the source and\/or search keywords used to get to my site. This would allow me to see what advertising is working and from where with a somewhat finer grain than Google Analytics would.\n\n\nI assume I could set some kind of cookie with this information when people get to my site, but I'm not sure how I would go about getting it. Is it even possible?\n\n\nI'm using Rails, but a language-independent solution (or even just pointers to where to find this information) would be appreciated!\n\n\n","answer_pids":["stackoverflow_Passage_7391","stackoverflow_Passage_9484"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_193","query":"Wiggling the mouse | OK. This is a bit of a vanity app, but I had a situation today at work where I was in a training class and the machine was set to lock every 10 minutes. Well, if the trainers got excited about talking - as opposed to changing slides - the machine would lock up.\n\n\nI'd like to write a teeny app that has nothing but a taskbar icon that does nothing but move the mouse by 1 pixel every 4 minutes. \n\n\nI can do that in 3 ways with Delphi (my strong language) but I'm moving to C# for work and I'd like to know the path of least resistance there.\n\n\n","answer_pids":["stackoverflow_Passage_518","stackoverflow_Passage_519","stackoverflow_Passage_1842","stackoverflow_Passage_4833","stackoverflow_Passage_132977"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_389","query":"Is this a good way to determine OS Architecture? | Since the WMI class Win32\\_OperatingSystem only includes OSArchitecture in Windows Vista, I quickly wrote up a method using the registry to try and determine whether or not the current system is a 32 or 64bit system.\n\n\n\n```\nprivate Boolean is64BitOperatingSystem()\n{\n RegistryKey localEnvironment = Registry.LocalMachine.OpenSubKey(\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\");\n String processorArchitecture = (String) localEnvironment.GetValue(\"PROCESSOR_ARCHITECTURE\");\n\n if (processorArchitecture.Equals(\"x86\")) {\n return false;\n }\n else {\n return true;\n }\n}\n\n```\n\nIt's worked out pretty well for us so far, but I'm not sure how much I like looking through the registry. Is this a pretty standard practice or is there a better method?\n\n\n**Edit**: Wow, that code looks a lot prettier in the preview. I'll consider linking to a pastebin or something, next time.\n\n\n","answer_pids":["stackoverflow_Passage_1191","stackoverflow_Passage_1192","stackoverflow_Passage_1197","stackoverflow_Passage_1198","stackoverflow_Passage_3910"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_833","query":"How to use XPath in Python? | What are the libraries that support XPath? Is there a full implementation? How is the library used? Where is its website?\n\n\n","answer_pids":["stackoverflow_Passage_2805","stackoverflow_Passage_2998","stackoverflow_Passage_3636","stackoverflow_Passage_8219","stackoverflow_Passage_12848","stackoverflow_Passage_13039","stackoverflow_Passage_14452","stackoverflow_Passage_14453","stackoverflow_Passage_248466","stackoverflow_Passage_666380","stackoverflow_Passage_938118"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1653","query":"What's your top feature request for Silverlight? | I'll take away the obvious one here: mic and webcam support. Other than that, if you ran the Silverlight team, what would your highest priority be for Silverlight v.Next?\n\n\nDisclaimer: If we get some good responses, I'll pass them along to folks I know on the Silverlight team.\n\n\n**UPDATE**: The best place to report Silverlight feature requests now is the UserVoice site: [http:\/\/silverlight.uservoice.com\/](http:\/\/silverlight.uservoice.com\/pages\/4325-feature-suggestions)\n\n\n","answer_pids":["stackoverflow_Passage_6191","stackoverflow_Passage_6192","stackoverflow_Passage_6195","stackoverflow_Passage_6265","stackoverflow_Passage_6306","stackoverflow_Passage_7969","stackoverflow_Passage_7971","stackoverflow_Passage_8644","stackoverflow_Passage_8649","stackoverflow_Passage_8655","stackoverflow_Passage_9160","stackoverflow_Passage_10264","stackoverflow_Passage_11478","stackoverflow_Passage_11496","stackoverflow_Passage_11497","stackoverflow_Passage_11498","stackoverflow_Passage_11568","stackoverflow_Passage_11570","stackoverflow_Passage_12072","stackoverflow_Passage_12074","stackoverflow_Passage_12075","stackoverflow_Passage_12203","stackoverflow_Passage_12204","stackoverflow_Passage_12427","stackoverflow_Passage_12492","stackoverflow_Passage_12702"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1691","query":"Why does Guid.ToString() reverse the byte order? | We're storing some Guid's in a MS SQL database. There's some legacy code that does `Guid.ToString()` and then passes them in to a `varchar(64)` and there's some newer code that passes them in using a unique identifier parameter. When you look at the results using MS SQL Management studio they look different. The byte order of the first three blocks is reversed but the last one remains the same. Why?\n\n\n","answer_pids":["stackoverflow_Passage_6477","stackoverflow_Passage_9223"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1606","query":"What's the best way to implement field validation using ASP.NET MVC? | I am building a public website using ASP.NET, as part of the deliverable I need to do an Admin Site for data entry of the stuff shown in the public site, I was wondering what techniques or procedures are people using to validate entries using ASP.NET MVC.\n\n\n","answer_pids":["stackoverflow_Passage_8037","stackoverflow_Passage_9732","stackoverflow_Passage_11280","stackoverflow_Passage_12392"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_497","query":".NET Remoting Speed and VPNs | I'm working on a project which uses .NET Remoting for communication between the client application and an object server. For development, the client, server, and MSSQL database are all running on my local development machine. \n\n\nWhen I'm working at the office, the responsiveness is just fine. \n\n\nHowever, when I work from home the speed is ***significantly*** slower. If I disconnect from the VPN, it speeds up (I believe, but maybe that's just wishful thinking). If I turn off my wireless connection completely it immediately speeds up to full throttle.\n\n\nMy assumption is that the remoting traffic is being routed through some point that is slowing everything down, albeit my home router and\/or the VPN.\n\n\nDoes anyone have any ideas of how to force the remoting traffic to remain completely localized?\n\n\n","answer_pids":["stackoverflow_Passage_1780","stackoverflow_Passage_3082","stackoverflow_Passage_10558","stackoverflow_Passage_12778"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_968","query":"Where is TFS work item help text displayed? | I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access. \n\n\n**Where is this information displayed?**\n\n\n","answer_pids":["stackoverflow_Passage_3371","stackoverflow_Passage_8174"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1180","query":"VS2008 SP1 crashes when debugging an XSLT file | I'm using VS2008 SP1 - don't know if this would have happened before I applied SP1 as I never tried it before yesterday. I attempted to debug a fairly simple XSLT file using VS2008 SP1 and got this crash from VS2008 SP1:\n\n\n\n\n---\n\n\nMicrosoft Visual Studio\n-----------------------\n\n\nUnexpected error encountered. It is recommended that you restart the application as soon as possible.\n\n\nError: Unspecified error\n\n\nFile: vsee\\pkgs\\vssprovider\\sccprj.cpp\n\n\n","answer_pids":["stackoverflow_Passage_10493","stackoverflow_Passage_12379","stackoverflow_Passage_12856","stackoverflow_Passage_13244"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1169","query":"Creating Visual Studio templates under the \"Windows\" category. | I have created a template for Visual Studio 2008 and it currently shows up under File->New Project->Visual C#. However, it is only really specific to Visual C#\/Windows but I can't work out how to get it to show up under the \"Windows\" category and not the more general \"Visual C#\".\n\n\n","answer_pids":["stackoverflow_Passage_4181","stackoverflow_Passage_4264","stackoverflow_Passage_8547"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1481","query":"Is Single Responsibility Principle a rule of OOP? | An [answer](https:\/\/stackoverflow.com\/questions\/15241\/does-anyone-have-any-real-world-experience-of-csla#15357) to a Stack Overflow question stated that a particular framework violated a plain and simple OOP rule: Single Responsibility Principle (SRP).\n\n\n**Is the Single Responsibility Principle *really* a rule of OOP?**\n\n\nMy understanding of the definition of Object Orientated Programming is \"a paradigm where objects and their behaviour are used to create software\". This includes the following techniques: Encapsulation, Polymorphism & Inheritance.\n\n\nNow don't get me wrong - I believe SRP to be the key to most good OO designs, but I feel there are cases where this principle can and should be broken (just like database normalization rules). I aggressively push the benefits of SRP, and the great majority of my code follows this principle. \n\n\n*But, is it a rule, and thus implies that it shouldn't be broken?*\n\n\n","answer_pids":["stackoverflow_Passage_5467","stackoverflow_Passage_5480","stackoverflow_Passage_5493","stackoverflow_Passage_8963","stackoverflow_Passage_9292","stackoverflow_Passage_11464","stackoverflow_Passage_11466"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_270","query":"Shell scripting input redirection oddities | Can anyone explain this behavior?\nRunning:\n\n\n\n```\n#!\/bin\/sh\necho \"hello world\" | read var1 var2\necho $var1\necho $var2\n\n```\n\nresults in nothing being ouput, while:\n\n\n\n```\n#!\/bin\/sh\necho \"hello world\" > test.file\nread var1 var2 < test.file\necho $var1\necho $var2\n\n```\n\nproduces the expected output:\n\n\n\n```\nhello\nworld\n\n```\n\nShouldn't the pipe do in one step what the redirection to test.file did in the second example? I tried the same code with both the dash and bash shells and got the same behavior from both of them.\n\n\n","answer_pids":["stackoverflow_Passage_782","stackoverflow_Passage_789","stackoverflow_Passage_4231","stackoverflow_Passage_9749","stackoverflow_Passage_10162","stackoverflow_Passage_10185","stackoverflow_Passage_10437","stackoverflow_Passage_11958","stackoverflow_Passage_207014","stackoverflow_Passage_435742"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1737","query":"Best traffic \/ performance \/ usage monitoring module? | Are there any open source (or I guess commercial) packages that you can plug into your site for monitoring purposes? I'd like something that we can hook up to our ASP.NET site and use to provide reporting on things like:\n\n\n* performance over time\n* current load\n* page traffic\n* SQL performance\n* PU time monitoring\n\n\nIdeally in c# :)\n\n\nWith some sexy graphs.\n\n\n**Edit**: I'd also be happy with a package that I can feed statistics and views of data to, and it would analyse trends, spot abnormal behaviour (e.g. \"no one has logged in for the last hour. is this Ok?\", \"high traffic levels detected\", \"low number of API calls detected\") and generally be very useful indeed. Does such a thing exist?\n\n\nAt my last office we had a big screen which showed us loads and loads of performance counters over a couple of time ranges, and we could spot weird stuff happening, but the data was not stored and there was no way to report on it. Its a package for doing this that I'm after.\n\n\n","answer_pids":["stackoverflow_Passage_6560","stackoverflow_Passage_6562","stackoverflow_Passage_6606","stackoverflow_Passage_6612","stackoverflow_Passage_7107","stackoverflow_Passage_10498","stackoverflow_Passage_13206","stackoverflow_Passage_35958","stackoverflow_Passage_61763"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_438","query":"CSV string handling | Typical way of creating a [CSV](http:\/\/en.wikipedia.org\/wiki\/Comma-separated_values) string (pseudocode):\n\n\n1. Create a CSV container object (like a StringBuilder in C#).\n2. Loop through the strings you want to add appending a comma after each one.\n3. After the loop, remove that last superfluous comma.\n\n\nCode sample:\n\n\n\n```\npublic string ReturnAsCSV(ContactList contactList)\n{\n StringBuilder sb = new StringBuilder();\n foreach (Contact c in contactList)\n {\n sb.Append(c.Name + \",\");\n }\n\n sb.Remove(sb.Length - 1, 1);\n \/\/sb.Replace(\",\", \"\", sb.Length - 1, 1)\n\n return sb.ToString();\n}\n\n```\n\nI like the idea of adding the comma by checking if the container is empty, but doesn't that mean more processing as it needs to check the length of the string on each occurrence?\n\n\nI feel that there should be an easier\/cleaner\/more efficient way of removing that last comma. Any ideas?\n\n\n","answer_pids":["stackoverflow_Passage_1356","stackoverflow_Passage_1357","stackoverflow_Passage_1358","stackoverflow_Passage_1361","stackoverflow_Passage_1368","stackoverflow_Passage_1372","stackoverflow_Passage_1396","stackoverflow_Passage_1403","stackoverflow_Passage_2103","stackoverflow_Passage_4440","stackoverflow_Passage_6228","stackoverflow_Passage_6246","stackoverflow_Passage_196799","stackoverflow_Passage_196811"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_994","query":"Send messages to program through command line | I have this program, we'll call it Host. Host does all kinds of good stuff, but it needs to be able to accept input through the command line **while it's running**. This means it has to somehow send its other process data and then quit. For example, I need to be able to do this:\n\n\n\n```\n.\/Host --blahblah 3 6 3 5\n\n```\n\nThis should somehow end up calling some function in Host called\n\n\n\n```\nhandleBlahBlah(int x1, int y1, int x2, int y2){\n \/\/do some more sweet stuff\n}\n\n```\n\nHost is a C program, and does not need to support multiple instances.\n\n\nAn example of this is Amarok music player. With Amarok running and playing, you can type \"amarok --pause\" and it will pause the music.\n\n\nI need to be able to do this in Linux or Windows. Preferably Linux.\n\n\nWhat is the cleanest way to implement this?\n\n\n","answer_pids":["stackoverflow_Passage_3467","stackoverflow_Passage_3469","stackoverflow_Passage_3470","stackoverflow_Passage_4990","stackoverflow_Passage_13417","stackoverflow_Passage_13561"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1370","query":"Regex and unicode | I have a script that parses the filenames of TV episodes (show.name.s01e02.avi for example), grabs the episode name (from the www.thetvdb.com API) and automatically renames them into something nicer (Show Name - [01x02].avi)\n\n\nThe script works fine, that is until you try and use it on files that have Unicode show-names (something I never really thought about, since all the files I have are English, so mostly pretty-much all fall within `[a-zA-Z0-9'\\-]`)\n\n\nHow can I allow the regular expressions to match accented characters and the likes? Currently the regex's config section looks like..\n\n\n\n```\nconfig['valid_filename_chars'] = \"\"\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@\u00a3$%^&*()_+=-[]{}\"'.,<>`~? \"\"\"\nconfig['valid_filename_chars_regex'] = re.escape(config['valid_filename_chars'])\n\nconfig['name_parse'] = [\n # foo_[s01]_[e01]\n re.compile('''^([%s]+?)[ \\._\\-]\\[[Ss]([0-9]+?)\\]_\\[[Ee]([0-9]+?)\\]?[^\\\\\/]*$'''% (config['valid_filename_chars_regex'])),\n # foo.1x09*\n re.compile('''^([%s]+?)[ \\._\\-]\\[?([0-9]+)x([0-9]+)[^\\\\\/]*$''' % (config['valid_filename_chars_regex'])),\n # foo.s01.e01, foo.s01_e01\n re.compile('''^([%s]+?)[ \\._\\-][Ss]([0-9]+)[\\.\\- ]?[Ee]([0-9]+)[^\\\\\/]*$''' % (config['valid_filename_chars_regex'])),\n # foo.103*\n re.compile('''^([%s]+)[ \\._\\-]([0-9]{1})([0-9]{2})[\\._ -][^\\\\\/]*$''' % (config['valid_filename_chars_regex'])),\n # foo.0103*\n re.compile('''^([%s]+)[ \\._\\-]([0-9]{2})([0-9]{2,3})[\\._ -][^\\\\\/]*$''' % (config['valid_filename_chars_regex'])),\n]\n\n```\n\n","answer_pids":["stackoverflow_Passage_5005","stackoverflow_Passage_5008","stackoverflow_Passage_5023","stackoverflow_Passage_8816","stackoverflow_Passage_62868"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_570","query":"Inheritance in database? | Is there any way to use inheritance in database (Specifically in SQL Server 2005)?\n\n\nSuppose I have few field like **CreatedOn**, **CreatedBy** which I want to add on all of my entities. I looking for an alternative way instead of adding these fields to every table.\n\n\n","answer_pids":["stackoverflow_Passage_1765","stackoverflow_Passage_1766","stackoverflow_Passage_1770","stackoverflow_Passage_1776","stackoverflow_Passage_1862","stackoverflow_Passage_5806","stackoverflow_Passage_6462","stackoverflow_Passage_9923","stackoverflow_Passage_10312","stackoverflow_Passage_10316"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_487","query":"Is this really widening vs autoboxing? | I saw this in [an answer to another question](https:\/\/stackoverflow.com\/a\/4384\/697449), in reference to shortcomings of the Java spec:\n\n\n\n> \n> There are more shortcomings and this is a subtle topic. Check [this](http:\/\/kiranthakkar.blogspot.com\/2007\/05\/method-overloading-with-new-features-of.html) out:\n> \n> \n> \n> ```\n> public class methodOverloading{\n> public static void hello(Integer x){\n> System.out.println(\"Integer\");\n> }\n> \n> public static void hello(long x){\n> System.out.println(\"long\");\n> }\n> \n> public static void main(String[] args){\n> int i = 5;\n> hello(i);\n> }\n> }\n> \n> ```\n> \n> Here \"long\" would be printed (haven't checked it myself), because the compiler chooses widening over auto-boxing. Be careful when using auto-boxing or don't use it at all!\n> \n> \n> \n\n\n*Are we sure that this is actually an example of widening instead of autoboxing, or is it something else entirely?*\n\n\nOn my initial scanning, I would agree with the statement that the output would be \"long\" on the basis of `i` being declared as a primitive and not an object. However, if you changed\n\n\n\n```\nhello(long x)\n\n```\n\nto\n\n\n\n```\nhello(Long x)\n\n```\n\nthe output would print \"Integer\"\n\n\nWhat's really going on here? I know nothing about the compilers\/bytecode interpreters for java...\n\n\n","answer_pids":["stackoverflow_Passage_1493","stackoverflow_Passage_1542","stackoverflow_Passage_1566","stackoverflow_Passage_5090"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1052","query":"IKVM and Licensing | I have been looking into IKVMing Apache's FOP project to use with our .NET app. It's a commercial product, and looking into licensing, IKVM runs into some sticky areas because of its use of GNU Classpath. From what I've seen, no one can say for sure if this stuff can be used in a commercial product. Has anyone used IKVM, or an IKVM'd product, in a commercial product? Here's what I've found so far:\n\n\n[IKVM license page](https:\/\/web.archive.org\/web\/20040202014857\/http:\/\/weblog.ikvm.net:80\/story.aspx\/license), which notes that one dll contains code from other projects, their license [GPLv2 + Classpath Exception](https:\/\/openjdk.java.net\/legal\/gplv2+ce.html)\n\n\n[Saxon for .NET](http:\/\/saxon.sourceforge.net\/) is generated with IKVM, but released under the Apache license...\n\n\nAnyone have experience with this?\n\n\n","answer_pids":["stackoverflow_Passage_4108","stackoverflow_Passage_5959","stackoverflow_Passage_9104","stackoverflow_Passage_13091"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1711","query":"Select ..... where .... OR | Is there a way to select data where any one of multiple conditions occur on the same field?\n\n\nExample: I would typically write a statement such as:\n\n\n\n```\nselect * from TABLE where field = 1 or field = 2 or field = 3\n\n```\n\nIs there a way to instead say something like:\n\n\n\n```\nselect * from TABLE where field = 1 || 2 || 3\n\n```\n\nAny help is appreciated.\n\n\n","answer_pids":["stackoverflow_Passage_6479","stackoverflow_Passage_6480","stackoverflow_Passage_6481","stackoverflow_Passage_6482","stackoverflow_Passage_6483","stackoverflow_Passage_6488","stackoverflow_Passage_9224","stackoverflow_Passage_1016483"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_676","query":"What is the best way to draw skinnable \"buttons\" in a video game? | I'm looking for ideas on how to draw a skinnable \"button\" in a game application. If I use a fixed sprite non-vector image for the button background, then I can't size the button easily. If I write code to draw a resizable button (like Windows buttons are drawn), then the programmer has to get involved -- and it makes skinning difficult. Another option is to break the button into 9 smaller images (3x3) and stretch them all -- kindof like rounded corners are done in HTML. \n\n\nIs there another \"easier\" way? What's the best approach?\n\n\n","answer_pids":["stackoverflow_Passage_2287","stackoverflow_Passage_8552","stackoverflow_Passage_10011","stackoverflow_Passage_12417"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_64","query":"Programmatically launch IE Mobile favorites screen | Is there any way to launch IE Mobile's \"Favorites\" screen directly by\nspecifying any command line parameter?\n\n\n","answer_pids":["stackoverflow_Passage_410","stackoverflow_Passage_8243","stackoverflow_Passage_50559"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_138","query":"How to make subdomain user accounts in a webapp | I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is `customusername.seework.com`.\n\n\nWhat is required on the `DNS` end to allow these to be created dynamically and be available instantly. \n\n\nAnd how do you recommend dealing with this in the logic of the site? `Htaccess` rule to lookup the subdomain in the `DB`?\n\n\n","answer_pids":["stackoverflow_Passage_334","stackoverflow_Passage_335","stackoverflow_Passage_341","stackoverflow_Passage_1231","stackoverflow_Passage_12761"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_468","query":"Why should I learn Lisp? | I really feel that I should learn [Lisp](http:\/\/en.wikipedia.org\/wiki\/Lisp_(programming_language)) and there are plenty of good resources out there to help me do it.\n\n\nI'm not put off by the complicated syntax, but where in \"traditional commercial programming\" would I find places it would make sense to use it instead of a procedural language.\n\n\nIs there a commercial killer-app out there that's been written in Lisp ?\n\n\n","answer_pids":["stackoverflow_Passage_1454","stackoverflow_Passage_1455","stackoverflow_Passage_1456","stackoverflow_Passage_1458","stackoverflow_Passage_1459","stackoverflow_Passage_1462","stackoverflow_Passage_2809","stackoverflow_Passage_2842","stackoverflow_Passage_2846","stackoverflow_Passage_2898","stackoverflow_Passage_2908","stackoverflow_Passage_4754","stackoverflow_Passage_6391","stackoverflow_Passage_6430","stackoverflow_Passage_8197","stackoverflow_Passage_8198","stackoverflow_Passage_8199","stackoverflow_Passage_8207","stackoverflow_Passage_8803","stackoverflow_Passage_9798","stackoverflow_Passage_9801","stackoverflow_Passage_9928","stackoverflow_Passage_10696","stackoverflow_Passage_10873","stackoverflow_Passage_11474","stackoverflow_Passage_11480","stackoverflow_Passage_11488","stackoverflow_Passage_11554","stackoverflow_Passage_13224","stackoverflow_Passage_97885"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_120","query":"How do I fix 'Unprocessed view path found' error with ExceptionNotifier plugin in rails 2.1? | After upgrading a rails 1.2 website to 2.1, the [ExceptionNotifier plugin](http:\/\/agilewebdevelopment.com\/plugins\/exception_notifier) no longer works, complaining about this error:\n\n\n\n> \n> ActionView::TemplateFinder::InvalidViewPath: Unprocessed view path\n> found:\n> \"\/path\/to\/appname\/vendor\/plugins\/exception\\_notification\/lib\/..\/views\".\n> Set your view paths with #append\\_view\\_path, #prepend\\_view\\_path, or #view\\_paths=.\n> \n> \n> \n\n\nWhat causes it and how do I fix it?\n\n\n","answer_pids":["stackoverflow_Passage_282","stackoverflow_Passage_10909","stackoverflow_Passage_11504"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1292","query":"Productivity gains of using CASE tools for development | I was using a CASE called [MAGIC](http:\/\/www.magicsoftware.com\/) for a system I'm developing, I've never used this kind of tool before and at first sight I liked, a month later I had a lot of the application generated, I felt very productive and ... I would say ... satisfied.\n\n\nIn some way a felt uncomfortable, cause, there is no code and everything I was used to, but in the other hand I could speed up my developing. The fact is that eventually I returned to use C# because I find it more flexible to develop, I can make unit testing, use CVS, I have access to more resources and basically I had \"all the control\". I felt that this tool didn't give me confidence and I thought that later in the project I could not manage it due to its forced established rules of development. And also a lot of things like sending emails, using my own controls, and other things had their complication, it seemed that at some point it was not going to be as easy as initially I thought and as initially the product claims. This reminds me a very nice article called \"[No Silver Bullet](http:\/\/www.virtualschool.edu\/mon\/SoftwareEngineering\/BrooksNoSilverBullet.html)\".\n\n\nThis CASE had its advantages but on the other hand it doesn't have resources you can consult and actually the license and certification are very expensive. For me another dissapointing thing is that because of its simplistic approach for development I felt scared on first hand cause of my unexperience on these kind of tools and second cause I thought that if I continued using it maybe it would have turned to be a complex monster that I could not manage later in the project.\n\n\nI think it's good to use these kind of solutions to speed up things but I wonder, why aren't these programs as popular as VS.Net, J2EE, Ruby, Python, etc. if they claim to enhance productivity better than the tools I've pointed?\n\n\n","answer_pids":["stackoverflow_Passage_4749","stackoverflow_Passage_4750","stackoverflow_Passage_4858","stackoverflow_Passage_6498","stackoverflow_Passage_8710"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1449","query":"Building Standalone Applications in JavaScript | With the increased power of JavaScript frameworks like YUI, JQuery, and Prototype, and debugging tools like Firebug, doing an application entirely in browser-side JavaScript looks like a great way to make simple applications like puzzle games and specialized calculators.\n\n\nIs there any downside to this other than exposing your source code? How should you handle data storage for this kind of program?\n\n\nEdit: yes, Gears and cookies can be used for local storage, but you can't easily get access to files and other objects the user already has around. You also can't save data to a file for a user without having them invoke some browser feature like printing to PDF or saving page as a file.\n\n\n","answer_pids":["stackoverflow_Passage_5333","stackoverflow_Passage_5341","stackoverflow_Passage_5347","stackoverflow_Passage_5349","stackoverflow_Passage_5359","stackoverflow_Passage_5368","stackoverflow_Passage_5380","stackoverflow_Passage_5395","stackoverflow_Passage_5911","stackoverflow_Passage_8932","stackoverflow_Passage_9034","stackoverflow_Passage_10157","stackoverflow_Passage_11236","stackoverflow_Passage_12864","stackoverflow_Passage_13167"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_145","query":"Catching SQL Injection and other Malicious Web Requests | I am looking for a tool that can detect malicious requests (such as obvious SQL injection gets or posts) and will immediately ban the IP address of the requester\/add to a blacklist. I am aware that in an ideal world our code should be able to handle such requests and treat them accordingly, but there is a lot of value in such a tool even when the site is safe from these kinds of attacks, as it can lead to saving bandwidth, preventing bloat of analytics, etc.\n\n\nIdeally, I'm looking for a cross-platform (`LAMP\/.NET`) solution that sits at a higher level than the technology stack; perhaps at the web-server or hardware level. I'm not sure if this exists, though.\n\n\nEither way, I'd like to hear the community's feedback so that I can see what my options might be with regard to implementation and approach.\n\n\n","answer_pids":["stackoverflow_Passage_366","stackoverflow_Passage_372","stackoverflow_Passage_375","stackoverflow_Passage_378","stackoverflow_Passage_389","stackoverflow_Passage_719","stackoverflow_Passage_9980","stackoverflow_Passage_489505"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_14","query":"Best way to allow plugins for a PHP application | I am starting a new web application in PHP and this time around I want to create something that people can extend by using a plugin interface. \n\n\nHow does one go about writing 'hooks' into their code so that plugins can attach to specific events?\n\n\n","answer_pids":["stackoverflow_Passage_24","stackoverflow_Passage_25","stackoverflow_Passage_54","stackoverflow_Passage_77","stackoverflow_Passage_10309","stackoverflow_Passage_10314","stackoverflow_Passage_10722","stackoverflow_Passage_12306","stackoverflow_Passage_305351"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1966","query":"Executing JavaScript from Flex: Is this javascript function dangerous? | I have a flex application that needs the ability to generate and execute JavaScript. When I say this, I mean I need to execute raw JavaScript that I create in my Flex application (not just an existing JavaScript method)\n\n\nI am currently doing this by exposing the following JavaScript method:\n\n\n\n```\nfunction doScript(js){ eval(js);}\n\n```\n\nI can then do something like this in Flex (note: I am doing something more substantial then an alert box in the real Flex app):\n\n\n\n```\nExternalInterface.call(\"doScript\",\"alert('foo'));\n\n```\n\nMy question is does this impose any security risk, I am assuming it's not since the Flex and JasvaScript all run client side...\n\n\nIs there a better way to do this?\n\n\n","answer_pids":["stackoverflow_Passage_7476","stackoverflow_Passage_7499","stackoverflow_Passage_7505","stackoverflow_Passage_7532","stackoverflow_Passage_9525","stackoverflow_Passage_9795","stackoverflow_Passage_799362"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1205","query":"Why was the Profile provider not built into Web Apps? | If you create an ASP.NET web file project you have direct access to the Profile information in the web.config file. If you convert that to a Web App and have been using ProfileCommon etc. then you have to jump through a whole bunch of hoops to get your web app to work.\n\n\nWhy wasn't the Profile provider built into the ASP.NET web app projects like it was with the web file projects?\n\n\n","answer_pids":["stackoverflow_Passage_4314","stackoverflow_Passage_8564","stackoverflow_Passage_11991"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_471","query":"MOSS SSP Issue - Failed database logons from deleted SSP | We've been having some issues with a SharePoint instance in a test\nenvironment. Thankfully this is not production ;) The problems started\nwhen the disk with the SQL Server databases and search index ran out\nof space. Following this, the search service would not run and search\nsettings in the SSP were not accessible. Reclaiming the disk space did\nnot resolve the issue. So rather than restoring the VM, we decided to\ntry to fix the issue.\n\n\nWe created a new SSP and changed the association of all services to\nthe new SSP. The old SSP and it's databases were then deleted. Search\nresults for PDF files are no longer appearing, but the search works\nfine otherwise. MySites also works OK.\n\n\nFollowing the implementation of this change, these problems occur:\n\n\n\n> \n> 1) An audit failure message started appearing in the application event log, for 'DOMAIN\\SPMOSSSvc' which is the MOSS farm account.\n> \n> \n> \n\n\n\n```\nEvent Type: Failure Audit\nEvent Source: MSSQLSERVER\nEvent Category: (4)\nEvent ID: 18456\nDate: 8\/5\/2008\nTime: 3:55:19 PM\nUser: DOMAIN\\SPMOSSSvc\nComputer: dastest01\nDescription:\nLogin failed for user 'DOMAIN\\SPMOSSSvc'. [CLIENT: <local machine>]\n\n```\n\n\n> \n> 2) SQL Server profiler is showing queries from SharePoint that reference the old\n> (deleted) SSP database.\n> \n> \n> \n\n\nSo...\n\n\n* Where would these references to DOMAIN\\SPMOSSSvc and the old SSP\ndatabase exist?\n* Is there a way to 'completely' remove the SSP from the server, and\nre-create? The option to delete was not available (greyed out) when a\nsingle SSP is in place.\n\n\n","answer_pids":["stackoverflow_Passage_1666","stackoverflow_Passage_2248","stackoverflow_Passage_10429","stackoverflow_Passage_11025"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1134","query":"Inheritance and Polymorphism - Ease of use vs Purity | In a project our team is using object lists to perform mass operations on sets of data that should all be processed in a similar way. In particular, different objects would ideally act the same, which would be very easily achieved with polymorphism. The problem I have with it is that inheritance implies the *is a* relationship, rather than the *has a* relationship. For example, several objects *have a* damage counter, but to make this easy to use in an object list, polymorphism could be used - except that would imply an *is a* relationship which wouldn't be true. (A person *is not a* damage counter.)\n\n\nThe only solution I can think of is to have a member of the class return the proper object type when implicitly casted instead of relying on inheritance. Would it be better to forgo the *is a* \/ *has a* ideal in exchange for ease of programming?\n\n\nEdit:\nTo be more specific, I am using C++, so using polymorphism would allow the different objects to \"act the same\" in the sense that the derived classes could reside within a single list and be operated upon by a virtual function of the base class. The use of an interface (or imitating them via inheritance) seems like a solution I would be willing to use.\n\n\n","answer_pids":["stackoverflow_Passage_4000","stackoverflow_Passage_4001","stackoverflow_Passage_4002","stackoverflow_Passage_4003","stackoverflow_Passage_4005","stackoverflow_Passage_4006","stackoverflow_Passage_4011","stackoverflow_Passage_4037","stackoverflow_Passage_8448","stackoverflow_Passage_9941","stackoverflow_Passage_13026"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1204","query":"Windows\/C++: How do I determine the share name associated with a shared drive? | Let's say I have a drive such as **C:\\**, and I want to find out if it's shared and what it's share name (e.g. **C$**) is.\n\n\nTo find out if it's shared, I can use [NetShareCheck](https:\/\/learn.microsoft.com\/en-us\/windows\/desktop\/api\/Lmshare\/nf-lmshare-netsharecheck).\n\n\nHow do I then map the drive to its share name? I thought that [NetShareGetInfo](https:\/\/learn.microsoft.com\/en-us\/windows\/desktop\/api\/Lmshare\/nf-lmshare-netsharegetinfo) would do it, but it looks like that takes the share name, not the local drive name, as an input.\n\n\n","answer_pids":["stackoverflow_Passage_4312","stackoverflow_Passage_4329","stackoverflow_Passage_4458","stackoverflow_Passage_8563"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_43","query":"Upgrading SQL Server 6.5 | Yes, I know. The existence of a running copy of `SQL Server 6.5` in 2008 is absurd.\n\n\nThat stipulated, what is the best way to migrate from `6.5` to `2005`? Is there any direct path? Most of the documentation I've found deals with upgrading `6.5` to `7`.\n\n\nShould I forget about the native `SQL Server` upgrade utilities, script out all of the objects and data, and try to recreate from scratch?\n\n\nI was going to attempt the upgrade this weekend, but server issues pushed it back till next. So, any ideas would be welcomed during the course of the week.\n\n\n*Update. This is how I ended up doing it:*\n\n\n* Back up the database in question and Master on `6.5`.\n* Execute `SQL Server 2000`'s `instcat.sql` against `6.5`'s Master. This allows `SQL Server 2000`'s OLEDB provider to connect to `6.5`.\n* Use `SQL Server 2000`'s standalone `\"Import and Export Data\"` to create a DTS package, using `OLEDB` to connect to 6.5. This successfully copied all `6.5`'s tables to a new `2005` database (also using `OLEDB`).\n* Use `6.5`'s Enterprise Manager to script out all of the database's indexes and triggers to a .sql file.\n* Execute that .sql file against the new copy of the database, in 2005's Management Studio.\n* Use 6.5's Enterprise Manager to script out all of the stored procedures.\n* Execute that `.sql` file against the `2005` database. Several dozen sprocs had issues making them incompatible with `2005`. Mainly `non-ANSI joins` and `quoted identifier issues`.\n* Corrected all of those issues and re-executed the `.sql` file.\n* Recreated the `6.5`'s logins in `2005` and gave them appropriate permissions.\n\n\nThere was a bit of rinse\/repeat when correcting the stored procedures (there were hundreds of them to correct), but the upgrade went great otherwise.\n\n\nBeing able to use Management Studio instead of `Query Analyzer` and `Enterprise Manager 6.5` is such an amazing difference. A few report queries that took 20-30 seconds on the `6.5 database` are now running in 1-2 seconds, without any modification, new indexes, or anything. I didn't expect that kind of immediate improvement.\n\n\n","answer_pids":["stackoverflow_Passage_74","stackoverflow_Passage_197","stackoverflow_Passage_254","stackoverflow_Passage_258","stackoverflow_Passage_269"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_692","query":"User authentication on Resin webserver | I'm currently tasked with replacing an `Apache` + `Resin` Java web server with a `Resin-only` configuration.\n\n\nCurrently in our apache setup, we use .htaccess and a small user database to provide passwording at a directory level.\n\n\nDoes anyone know the equivalent setup when using just `Resin` as the web server?\n\n\n","answer_pids":["stackoverflow_Passage_2281","stackoverflow_Passage_7229"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_131","query":"Ensuring that Exceptions are always caught | Exceptions in C++ don't need to be caught (no compile time errors) by the calling function. So it's up to the developer's judgment whether to catch them using try\/catch (unlike in Java).\n\n\nIs there a way one can ensure that the exceptions thrown are always caught using try\/catch by the calling function?\n\n\n","answer_pids":["stackoverflow_Passage_312","stackoverflow_Passage_412","stackoverflow_Passage_415","stackoverflow_Passage_423","stackoverflow_Passage_533","stackoverflow_Passage_1108","stackoverflow_Passage_10671","stackoverflow_Passage_732815"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_460","query":"How do you create your own moniker (URL Protocol) on Windows systems? | How do you create your own custom moniker (or URL Protocol) on Windows systems?\n\n\nExamples:\n\n\n* http:\n* mailto:\n* service:\n\n\n","answer_pids":["stackoverflow_Passage_1421","stackoverflow_Passage_1424","stackoverflow_Passage_4649","stackoverflow_Passage_8975"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_507","query":"Upload form does not work in Firefox 3 with Mac OS X? | Today, I ran into this weird problem with a user using Mac OS X. This user always had a failed upload. The form uses a regular \"input type=file\". The user could upload using any browser except Firefox 3 on his Mac. Only this particular user was seeing this error.\n\n\nObviously, the problem is only with this one particular user.\n\n\n","answer_pids":["stackoverflow_Passage_1540","stackoverflow_Passage_1546","stackoverflow_Passage_5088"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_247","query":"Auto Generate Database Diagram MySQL | I'm tired of opening Dia and creating a database diagram at the beginning of every project. Is there a tool out there that will let me select specific tables and then create a database diagram for me based on a MySQL database? Preferably it would allow me to edit the diagram afterward since none of the foreign keys are set...\n\n\nHere is what I am picturing diagram-wise (please excuse the horrible data design, I didn't design it. Let's focus on the diagram concept and not on the actual data it represents for this example ;) ):\n\n\n![diagram](https:\/\/i.stack.imgur.com\/lxvlR.jpg)\n[see full size diagram](https:\/\/i.stack.imgur.com\/ZnN2O.png)\n\n\n","answer_pids":["stackoverflow_Passage_672","stackoverflow_Passage_673","stackoverflow_Passage_684","stackoverflow_Passage_2494","stackoverflow_Passage_10568","stackoverflow_Passage_12530","stackoverflow_Passage_12752","stackoverflow_Passage_56616","stackoverflow_Passage_57532","stackoverflow_Passage_154235","stackoverflow_Passage_188484","stackoverflow_Passage_219666","stackoverflow_Passage_451564","stackoverflow_Passage_484797","stackoverflow_Passage_506132"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_924","query":"Visual Studio 2008 Window layout annoyance | I'm having a weird issue with Visual Studio 2008. Every time I fire it up, the solution explorer is about an inch wide. It's like it can't remember it's layout settings.\n\n\nEvery un-docked window is in the position I place it. But if I dock a window, it's position is saved, but it's size will be reset to very-narrow (around an inch) when I load.\n\n\nI've never come across this before and it's pretty annoying. Any ideas?\n\n\nThe things I've tried:\n\n\n* Saving, then reloading settings via Import\/Export.\n* Resetting all environment settings via Import\/Export.\n* Window -> Reset Window layout.\n* Comination of rebooting after changing the above.\n* Installed SP1. No improvement\n\n\nnone of which changed the behaviour of docked windows. (Also, definitely no other instances running..)\n\n\nI do run two monitors, but I've had this setup on three different workstations and this is the first time I've come across it.\n\n\n","answer_pids":["stackoverflow_Passage_3169","stackoverflow_Passage_3172","stackoverflow_Passage_3177","stackoverflow_Passage_8071"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1059","query":"How big would such a database be? | I'm trying to figure out how big a certain database would be (it hasn't been created yet). I know how many rows and what the tables will be. Is there a feature in Oracle that will tell me the size of such a theoretical database? Is there a known math formula I can use? I know there is a feature to determine the size of an existing database, but I want to know how big it will be before I create it. \n\n\n","answer_pids":["stackoverflow_Passage_3720","stackoverflow_Passage_3740","stackoverflow_Passage_3741","stackoverflow_Passage_3766","stackoverflow_Passage_4866","stackoverflow_Passage_8320"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_897","query":"C# 3.0 auto-properties \u2014 useful or not? | *Note: This was posted when I was starting out C#. With 2014 knowledge, I can truly say that auto-properties are among the best things that ever happened to the C# language.*\n\n\nI am used to create my properties in C# using a private and a public field:\n\n\n\n```\nprivate string title;\npublic string Title\n{\n get { return title; }\n set { title = value; }\n}\n\n```\n\nNow, with [.NET](http:\/\/en.wikipedia.org\/wiki\/.NET_Framework) 3.0, we got auto-properties:\n\n\n\n```\npublic string Title { get; set; }\n\n```\n\nI know this is more a philosophical\/subjective questions, but is there any reason to use these auto-properties except from saving five lines of code for each field? My personal gripe is that those properties are hiding stuff from me, and I am not a big fan of black magic.\n\n\nIn fact, the hidden private field does not even show up in the debugger, which is OK given the fact that the get\/set functions do nothing. But when I want to actually implement some getter\/setter logic, I have to use the private\/public pair anyway.\n\n\nI see the benefit that I save a lot of code (one vs six lines) without losing the ability to change the getter\/setter logic later, but then again I can already do that by simply declaring a public field \"Public string Title\" without the need of the { get; set; } block, thus even saving more code.\n\n\nSo, what am I missing here? Why would anyone actually want to use auto-properties?\n\n\n","answer_pids":["stackoverflow_Passage_3067","stackoverflow_Passage_3068","stackoverflow_Passage_3069","stackoverflow_Passage_3070","stackoverflow_Passage_3085","stackoverflow_Passage_3107","stackoverflow_Passage_3150","stackoverflow_Passage_4863","stackoverflow_Passage_4865","stackoverflow_Passage_4875","stackoverflow_Passage_7148","stackoverflow_Passage_8007","stackoverflow_Passage_8422","stackoverflow_Passage_8772","stackoverflow_Passage_9440","stackoverflow_Passage_10959","stackoverflow_Passage_11532","stackoverflow_Passage_11533"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_764","query":"Printing from a .NET Service | I am working on a project right now that involves receiving a message from another application, formatting the contents of that message, and sending it to a printer. The technology of choice is C# windows service. The output could be called a report, I suppose, but a reporting engine is not necessary. A simple templating engine, like StringTemplate, or even XSLT outputting HTML would be fine. The problem I'm having is finding a free way to print this kind of output from a service. Since it *seems* that it will work, I'm working on a prototype using Microsoft's RDLC, populating a local report and then rendering it as an image to a memory stream, which I will then print. Issues with that are:\n\n\n* Multi-page printing will be a big headache.\n* Still have to use PrintDocument to print the memory stream, which is unsupported in a Windows Service (though it may work - haven't gotten that far with the prototype yet)\n* If the data coming across changes, I have to change the dataset and the class that the data is being deserialized into. bad bad bad.\n\n\nHas anyone had to do anything remotely like this? Any advice? I already posted a question about printing HTML without user input, and after wasting about 3 days on that, I have come to the conclusion that it cannot be done, at least not with any freely available tool.\n\n\nAll help is appreciated.\n\n\nEDIT: We are on version 2.0 of the .NET framework.\n\n\n","answer_pids":["stackoverflow_Passage_2554","stackoverflow_Passage_2578","stackoverflow_Passage_2582","stackoverflow_Passage_2606","stackoverflow_Passage_2627","stackoverflow_Passage_7766","stackoverflow_Passage_10942","stackoverflow_Passage_10944","stackoverflow_Passage_10945","stackoverflow_Passage_11146","stackoverflow_Passage_12483","stackoverflow_Passage_12639"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1970","query":"List of macOS text editors and code editors | I searched for this and found [Maudite's](https:\/\/stackoverflow.com\/users\/1632\/maudite) question about [text editors](https:\/\/stackoverflow.com\/questions\/14155\/text-editors#14203) but they were all for Windows.\n\n\nAs you have no doubt guessed, I am trying to find out if there are any text\/code editors for the Mac besides what I know of. I'll edit my post to include editors listed.\n\n\n### Free\n\n\n1. [Textwrangler](http:\/\/www.barebones.com\/products\/textwrangler\/)\n2. [Xcode](https:\/\/developer.apple.com\/xcode\/)\n3. [Mac Vim](https:\/\/github.com\/macvim-dev\/macvim)\n4. [Aquamacs](http:\/\/aquamacs.org\/) and closer to the original [EMacs](http:\/\/homepage.mac.com\/zenitani\/emacs-e.html)\n5. [JEdit](http:\/\/www.jedit.org\/)\n6. [Editra](http:\/\/editra.org\/)\n7. [Eclipse](https:\/\/www.eclipse.org\/)\n8. [NetBeans](https:\/\/netbeans.org\/kb\/articles\/mac.html)\n9. [Kod](http:\/\/kodapp.com\/)\n10. [TextMate2](https:\/\/github.com\/textmate\/textmate#readme) - GPL\n11. [Brackets](http:\/\/brackets.io\/)\n12. [Atom.io](https:\/\/atom.io\/)\n\n\n### Commercial\n\n\n1. [Textmate](https:\/\/macromates.com\/)\n2. [BBEdit](http:\/\/www.barebones.com\/products\/bbedit\/)\n3. [SubEthaEdit](http:\/\/www.codingmonkeys.de\/subethaedit\/)\n4. [Coda](http:\/\/www.panic.com\/coda\/)\n5. [Sublime Text 2](http:\/\/www.sublimetext.com\/2)\n6. [Smultron](http:\/\/smultron.sourceforge.net\/)\n7. [WebStorm](http:\/\/www.jetbrains.com\/webstorm\/)\n8. [Peppermint](http:\/\/osxpeppermint.com)\n\n\n### Articles related to the subject\n\n\n1. [Faceoff, which is the best text editor ever?](http:\/\/mac360.com\/index.php\/mac360\/comments\/faceoff_which_is_the_best_text_editor_ever\/)\n2. [Maceditors.com, mac editors features compared](http:\/\/maceditors.com)\n\n\nThank you everybody that has added suggestions.\n\n\n","answer_pids":["stackoverflow_Passage_7478","stackoverflow_Passage_7483","stackoverflow_Passage_7484","stackoverflow_Passage_7486","stackoverflow_Passage_7487","stackoverflow_Passage_7488","stackoverflow_Passage_7489","stackoverflow_Passage_7490","stackoverflow_Passage_7491","stackoverflow_Passage_7495","stackoverflow_Passage_7498","stackoverflow_Passage_7536","stackoverflow_Passage_7590","stackoverflow_Passage_7600","stackoverflow_Passage_8517","stackoverflow_Passage_8678","stackoverflow_Passage_9510","stackoverflow_Passage_9806","stackoverflow_Passage_9811","stackoverflow_Passage_9829","stackoverflow_Passage_10140","stackoverflow_Passage_10148","stackoverflow_Passage_10150","stackoverflow_Passage_10151","stackoverflow_Passage_11082","stackoverflow_Passage_11311","stackoverflow_Passage_11581","stackoverflow_Passage_11596","stackoverflow_Passage_11748","stackoverflow_Passage_12001","stackoverflow_Passage_13212","stackoverflow_Passage_22611","stackoverflow_Passage_22612","stackoverflow_Passage_32983","stackoverflow_Passage_42084","stackoverflow_Passage_44406","stackoverflow_Passage_98897","stackoverflow_Passage_109438","stackoverflow_Passage_141808","stackoverflow_Passage_164433"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1375","query":"Why are there so few modal-editors that aren't vi*? | Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems to use the emacs shortcuts (`ctrl`+`w` to delete back a word and so on)\n\n\n","answer_pids":["stackoverflow_Passage_5020","stackoverflow_Passage_5021","stackoverflow_Passage_5060","stackoverflow_Passage_5078","stackoverflow_Passage_5374","stackoverflow_Passage_8437","stackoverflow_Passage_8835","stackoverflow_Passage_11590","stackoverflow_Passage_11595","stackoverflow_Passage_11864","stackoverflow_Passage_13273","stackoverflow_Passage_13413","stackoverflow_Passage_349839","stackoverflow_Passage_482512","stackoverflow_Passage_1016575"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1839","query":"How to make a tree in C++? | How do I make a tree data structure in C++ that uses iterators instead of pointers? I couldn't find anything in the STL that can do this. What I would like to do is to be able to create and manipulate trees like this:\n\n\n\n```\n#include <iostream>\n#include <tree>\nusing namespace std;\n\nint main()\n{\n tree<int> myTree;\n\n tree<int>::iterator i = myTree.root();\n *i = 42;\n\n tree<int>::iterator j = i.add_child();\n *j = 777;\n j = j.parent();\n\n if (i == myTree.root() && i == j) cout << \"i and j are both pointing to the root\\n\";\n\n return 0;\n}\n\n```\n\n\n\n---\n\n\nThank you, tree.hh seems to be just what I was looking for.\n\n\n\n> \n> If this is for gaining the benefit of\n> a data-structure holding arbitrary\n> index types, optimized for searching\n> and good at insertion then consider\n> using a map.\n> \n> \n> A map is an associative container that\n> has performance guarantees identical\n> to those of a tree: logarithmic\n> searching, logarithmic insertion,\n> logarithmic deletion, linear space.\n> Internally they are often implemented\n> as red-black trees, although that is\n> not a guarantee. Still, as an STL user\n> all you should care about is the\n> performance guarantees of the STL\n> algorithms and data-structures.\n> Whether they're implemented as trees\n> or little green men shouldn't matter\n> to you.\n> \n> \n> \n\n\nI'm not sure if a map is what I need, but thanks for the info. I will remember to use maps whenever possible instead of implementing trees.\n\n\n","answer_pids":["stackoverflow_Passage_6982","stackoverflow_Passage_6993","stackoverflow_Passage_9355"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_638","query":"PHP4 to PHP5 Migration | What are some good steps to follow for a smooth migration from PHP4 to PHP5. What are some types of code that are likely to break?\n\n\n","answer_pids":["stackoverflow_Passage_2048","stackoverflow_Passage_2051","stackoverflow_Passage_2056","stackoverflow_Passage_6611","stackoverflow_Passage_7438"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1460","query":"Setting an ASP.NET Master Page at runtime | I'm working on a site which needs to be able to support two or more looks, changable at runtime. I'd hoped to be able to handle the change with a CSS switch, but it looks like I'll need to use a different masterpage for each design.\n\n\nSo, what's the best way to set the masterpage at runtime? Page.MasterPageFile can only be set in the Page.OnPreInit event. It looks like the solutions are to make all my pages inherit from a common base which handles the PreInit event, or to use an HttpModule which does that.\n\n\nAny advice?\n\n\n","answer_pids":["stackoverflow_Passage_5381","stackoverflow_Passage_5384","stackoverflow_Passage_5385","stackoverflow_Passage_5401","stackoverflow_Passage_8935","stackoverflow_Passage_11919","stackoverflow_Passage_356222"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_411","query":"Graph serialization | I'm looking for a simple algorithm to 'serialize' a directed graph. In particular I've got a set of files with interdependencies on their execution order, and I want to find the correct order at compile time. I know it must be a fairly common thing to do - compilers do it all the time - but my google-fu has been weak today. What's the 'go-to' algorithm for this?\n\n\n","answer_pids":["stackoverflow_Passage_1259","stackoverflow_Passage_1262","stackoverflow_Passage_1390","stackoverflow_Passage_4576","stackoverflow_Passage_11760"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1412","query":"How best to use File Version and Assembly Version? | In .NET there are two version numbers available when building a project, File Version and Assembly Version. How are you using these numbers? Keeping them the same? Auto-incrementing one, but manually changing the other?\n\n\nAlso what about the `AssemblyInformationalVersion` attribute?\n\n\nI'd found this support Microsoft Knowledge Base (KB) article that provided some help: [How to use Assembly Version and Assembly File Version](http:\/\/support.microsoft.com\/kb\/556041).\n\n\n","answer_pids":["stackoverflow_Passage_5182","stackoverflow_Passage_5190","stackoverflow_Passage_5206","stackoverflow_Passage_5207","stackoverflow_Passage_5248","stackoverflow_Passage_8885","stackoverflow_Passage_12841","stackoverflow_Passage_12842"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1937","query":"Audio player on Windows Mobile | I'm trying to develop specialized audio player for windows mobile devices (Professional ones). And I've ran into the problem an once.\n\n\nThere no compressed audio APIs on WM or I was unable to found house in documentation. Yes there are WM6 Sound API but it cannot even pause playback or seek to specified position. There are allways Windows Media Player on WM device but I've not found it APIs documentation.\n\n\nSo the question is: \n\nIs there simple way to play, pause, forward, rewind, getting playback position and getting audio file length on *compressed* audio of several popular formats? Any library? platform APIs? Anything? \n\n\n","answer_pids":["stackoverflow_Passage_7690","stackoverflow_Passage_8055","stackoverflow_Passage_9737"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1546","query":"C# Include Derived Control in Toolbox | This is in reference to my other question [Auto Clearing Textbox](https:\/\/stackoverflow.com\/questions\/16110\/c-auto-clearing-winform-textbox). \n\nIf I choose to derive a new TextBox control from TextBox instead of implement a user control just containing my Textbox, how would I include that in the toolbox.\n\n\n","answer_pids":["stackoverflow_Passage_5715","stackoverflow_Passage_5724","stackoverflow_Passage_9041"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1910","query":"Being as DRY as possible in a Ruby on Rails App | I'm currently using the awesome attachment-fu plugin for a Rails app, but as a novice developer, I've never encountered a scenario like the one I've found myself in.\n\n\nEssentially, I'm using the attachment-fu plugin on two levels.\n\n\n1. Is for user avatars in the user class.\n2. Is to allow file attachments (***PDFs***, etc) in a messaging system.\n\n\nMy question is what the best use practice would be in these situations to remain ***DRY***, clear, and consistent.\n\n\nClearly it would make no sense to define and execute the plugin in both classes, but there's something deeply strange to me (possibly unfounded) about just going ahead and setting it all up in the godly Application class.\n\n\nIs there something in between, or is the parent class the way to go?\n\n\nThanks!\n\n\n","answer_pids":["stackoverflow_Passage_7262","stackoverflow_Passage_7272","stackoverflow_Passage_9452","stackoverflow_Passage_10164","stackoverflow_Passage_10168","stackoverflow_Passage_10205","stackoverflow_Passage_11758"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_433","query":"How do I retrieve my MySQL username and password? | I lost my MySQL username and password. How do I retrieve it?\n\n\n","answer_pids":["stackoverflow_Passage_1333","stackoverflow_Passage_1345","stackoverflow_Passage_4375","stackoverflow_Passage_124363","stackoverflow_Passage_536111","stackoverflow_Passage_604737","stackoverflow_Passage_662177","stackoverflow_Passage_690844","stackoverflow_Passage_922678","stackoverflow_Passage_963624","stackoverflow_Passage_1016618"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_866","query":"Calling Table-Valued SQL Functions From .NET | Scalar-valued functions can be called from .NET as follows:\n\n\n\n```\nSqlCommand cmd = new SqlCommand(\"testFunction\", sqlConn); \/\/testFunction is scalar\ncmd.CommandType = CommandType.StoredProcedure; \ncmd.Parameters.Add(\"retVal\", SqlDbType.Int);\ncmd.Parameters[\"retVal\"].Direction = ParameterDirection.ReturnValue;\ncmd.ExecuteScalar();\nint aFunctionResult = (int)cmd.Parameters[\"retVal\"].Value;\n\n```\n\nI also know that table-valued functions can be called in a similar fashion, for example: \n\n\n\n```\nString query = \"select * from testFunction(param1,...)\"; \/\/testFunction is table-valued\nSqlCommand cmd = new SqlCommand(query, sqlConn);\nSqlDataAdapter adapter = new SqlDataAdapter(cmd);\nadapter.Fill(tbl);\n\n```\n\nMy question is, can table-valued functions be called as stored procedures, like scalar-valued functions can? (e.g., replicate my first code snippet with a table-valued function being called and getting the returned table through a ReturnValue parameter).\n\n\n","answer_pids":["stackoverflow_Passage_2924","stackoverflow_Passage_7949"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1242","query":"If you have a Java application that is consuming CPU when it isn't doing anything, how do you determine what it is doing? | I am calling a vendor's Java API, and on some servers it appears that the JVM goes into a low priority polling loop after logging into the API (CPU at 100% usage). The same app on other servers does not exhibit this behavior. This happens on WebSphere and Tomcat. The environment is tricky to set up so it is difficult to try to do something like profiling within Eclipse.\n\n\nIs there a way to profile (or some other method of inspecting) an existing Java app running in Tomcat to find out what methods are being executed while it's in this spinwait kind of state? The app is only executing one method when it gets in this state (vendor's method). Vendor can't replicate the behavior (of course).\n\n\n\n\n---\n\n\nUpdate: \n\n\nUsing JConsole I was able to determine who was running and what they were doing. It took me a few hours to then figure out why it was doing it. The problem ended up being that the vendor's API jar that was being used did not match exactly to the the database configuration that it was using. It was defaulting to having tracing and performance monitoring enabled on the servers that had the slight mis-match in configuration. I used a different jar and all is well.\n\n\nSo thanks, Joshua, for your answer. JConsole was extremely easy to setup and use to monitor an existing application. \n\n\n@Cringe - I did some experimenting with some of the options you suggested. I had some problems with getting JProfiler set up, it looks good (but pricey). Going forward I went ahead and added the Eclipse Profiler plugin and I'll be looking over the different open source profilers to compare functionality.\n\n\n","answer_pids":["stackoverflow_Passage_4460","stackoverflow_Passage_4485","stackoverflow_Passage_4570","stackoverflow_Passage_5994","stackoverflow_Passage_7152","stackoverflow_Passage_7189","stackoverflow_Passage_7908","stackoverflow_Passage_8618","stackoverflow_Passage_10802"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1080","query":"How to parse XML using vba | I work in VBA, and want to parse a string eg\n\n\n\n```\n<PointN xsi:type='typens:PointN' \nxmlns:xsi='http:\/\/www.w3.org\/2001\/XMLSchema-instance' \nxmlns:xs='http:\/\/www.w3.org\/2001\/XMLSchema'>\n <X>24.365<\/X>\n <Y>78.63<\/Y>\n<\/PointN>\n\n```\n\nand get the X & Y values into two separate integer variables.\n\n\nI'm a newbie when it comes to XML, since I'm stuck in VB6 and VBA, because of the field I work in.\n\n\nHow do I do this?\n\n\n","answer_pids":["stackoverflow_Passage_3822","stackoverflow_Passage_3841","stackoverflow_Passage_8356","stackoverflow_Passage_13335","stackoverflow_Passage_68475","stackoverflow_Passage_545320","stackoverflow_Passage_549378","stackoverflow_Passage_654238","stackoverflow_Passage_805913"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1851","query":"Detecting audio silence in WAV files using C# | I'm tasked with building a .NET client app to detect silence in a WAV files.\n\n\nIs this possible with the built-in Windows APIs? Or alternately, any good libraries out there to help with this?\n\n\n","answer_pids":["stackoverflow_Passage_7036","stackoverflow_Passage_7041","stackoverflow_Passage_7048","stackoverflow_Passage_8483","stackoverflow_Passage_9373","stackoverflow_Passage_12789","stackoverflow_Passage_419720","stackoverflow_Passage_904019","stackoverflow_Passage_1016670"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_338","query":"Mapping values from two array in Ruby | I'm wondering if there's a way to do what I can do below with Python, in Ruby:\n\n\n\n```\nsum = reduce(lambda x, y: x + y, map(lambda x, y: x * y, weights, data))\n\n```\n\nI have two arrays of equal sizes with the weights and data but I can't seem to find a function similar to map in Ruby, reduce I have working.\n\n\n","answer_pids":["stackoverflow_Passage_1002","stackoverflow_Passage_1004","stackoverflow_Passage_1292","stackoverflow_Passage_1293","stackoverflow_Passage_4269","stackoverflow_Passage_53063","stackoverflow_Passage_409361"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1125","query":"Browse for a directory in C# | How can I present a control to the user that allows him\/her to select a directory?\n\n\nThere doesn't seem to be any native .net controls which do this?\n\n\n","answer_pids":["stackoverflow_Passage_3971","stackoverflow_Passage_3975","stackoverflow_Passage_3980","stackoverflow_Passage_8426","stackoverflow_Passage_113871","stackoverflow_Passage_668365","stackoverflow_Passage_978336"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_973","query":"How to return a page of results from SQL? | Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results.\n\n\nWhat's a good algorithm to implement this pattern without bringing the entire table to the client and then filtering the data on the client. How do you bring just the records you want to display to the user?\n\n\nDoes LINQ simplify the solution?\n\n\n","answer_pids":["stackoverflow_Passage_3375","stackoverflow_Passage_3376","stackoverflow_Passage_3387","stackoverflow_Passage_3404","stackoverflow_Passage_4398","stackoverflow_Passage_4407","stackoverflow_Passage_8178","stackoverflow_Passage_9686","stackoverflow_Passage_379804"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1351","query":"How to load plugins in .NET? | I'd like to provide some way of creating dynamically loadable plugins in my software.\nTypical way to do this is using the [LoadLibrary](http:\/\/msdn.microsoft.com\/en-us\/library\/ms684175(VS.85).aspx) WinAPI function to load a dll and calling [GetProcAddress](http:\/\/msdn.microsoft.com\/en-us\/library\/ms683212(VS.85).aspx) to get an pointer to a function inside that dll.\n\n\nMy question is how do I dynamically load a plugin in C#\/.Net application?\n\n\n","answer_pids":["stackoverflow_Passage_4963","stackoverflow_Passage_4964","stackoverflow_Passage_4970","stackoverflow_Passage_4974","stackoverflow_Passage_5289","stackoverflow_Passage_8789","stackoverflow_Passage_9614","stackoverflow_Passage_263478","stackoverflow_Passage_1016645"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_262","query":"How do I split a delimited string so I can access individual items? | Using SQL Server, how do I split a string so I can access item x?\n\n\nTake a string \"Hello John Smith\". How can I split the string by space and access the item at index 1 which should return \"John\"?\n\n\n","answer_pids":["stackoverflow_Passage_728","stackoverflow_Passage_735","stackoverflow_Passage_740","stackoverflow_Passage_742","stackoverflow_Passage_744","stackoverflow_Passage_754","stackoverflow_Passage_2656","stackoverflow_Passage_11231","stackoverflow_Passage_127126","stackoverflow_Passage_204743","stackoverflow_Passage_270099","stackoverflow_Passage_272411","stackoverflow_Passage_284492","stackoverflow_Passage_289652","stackoverflow_Passage_328190","stackoverflow_Passage_349719","stackoverflow_Passage_383415","stackoverflow_Passage_386689","stackoverflow_Passage_412525","stackoverflow_Passage_441333","stackoverflow_Passage_459080","stackoverflow_Passage_498997","stackoverflow_Passage_501435","stackoverflow_Passage_528578","stackoverflow_Passage_538291","stackoverflow_Passage_542804","stackoverflow_Passage_549542","stackoverflow_Passage_561154","stackoverflow_Passage_655082","stackoverflow_Passage_658166","stackoverflow_Passage_685556","stackoverflow_Passage_755811","stackoverflow_Passage_757599","stackoverflow_Passage_795393","stackoverflow_Passage_904395","stackoverflow_Passage_942147","stackoverflow_Passage_967745","stackoverflow_Passage_972204","stackoverflow_Passage_979264","stackoverflow_Passage_1014359","stackoverflow_Passage_1016426","stackoverflow_Passage_1016533","stackoverflow_Passage_1016622","stackoverflow_Passage_1016673"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_257","query":"What's the best online payment processing solution? | Should be available to non-U.S. companies, easy to setup, reliable, cheap, customizable, etc. What are your experiences?\n\n\n","answer_pids":["stackoverflow_Passage_703","stackoverflow_Passage_706","stackoverflow_Passage_708","stackoverflow_Passage_710","stackoverflow_Passage_718","stackoverflow_Passage_720","stackoverflow_Passage_722","stackoverflow_Passage_749","stackoverflow_Passage_10456","stackoverflow_Passage_10490","stackoverflow_Passage_11063","stackoverflow_Passage_12279","stackoverflow_Passage_12472","stackoverflow_Passage_12473"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1568","query":"How do you configure VS2008 to only open one webserver in a solution with multiple projects? | Starting with 2005, VS started this behavior of when starting debugging session it spawns up a webserver for every project in a solution. I have a solution with 15 projects so it takes a while and is a waste of resources. Is there a way to configure it differently besides just using IIS?\n\n\n","answer_pids":["stackoverflow_Passage_5823","stackoverflow_Passage_5825","stackoverflow_Passage_9071","stackoverflow_Passage_12806","stackoverflow_Passage_12941","stackoverflow_Passage_55795"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1090","query":"How to host a WPF form in a MFC application | I'm looking for any resources on hosting a WPF form within an existing MFC application. Can anyone point me in the right direction on how to do this?\n\n\n","answer_pids":["stackoverflow_Passage_3853","stackoverflow_Passage_8369"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1557","query":"Fonts on the Web | The collection of fonts available to a web developer is depressingly limited. I remember reading long ago about TrueDoc, as a way of shipping fonts alongside a website - but it seems to have languished. Has anybody used this, or something similar? Is it supported by enough browsers? Am I missing a good solution?\n\n\nNote that a responsible web developer does not use fonts that are only available on Windows (and *especially* ones that are only available on Vista), nor do they use a technology that isn't supported by at least the majority of browsers.\n\n\n\n\n---\n\n\n**Update:** As several people have pointed out, there's nothing wrong with providing a list of fallback fonts for people who don't have the specific font you use. I do in fact always do this, and didn't mean to suggest that this was wrong.\n\n\nWhile my question was badly phrased, what I meant was that a designer should not make too many assumptions about what the client will have available. You should plan for how all users will see your site, not just for people using your own preferred setup.\n\n\n","answer_pids":["stackoverflow_Passage_5767","stackoverflow_Passage_5769","stackoverflow_Passage_5770","stackoverflow_Passage_5854","stackoverflow_Passage_5893","stackoverflow_Passage_5897","stackoverflow_Passage_6577","stackoverflow_Passage_6616","stackoverflow_Passage_8264","stackoverflow_Passage_9056","stackoverflow_Passage_138494"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_141","query":"Regex: To pull out a sub-string between two tags in a string | I have a file in the following format:\n\n\n\n```\n\nData Data\nData\n[Start]\nData I want\n[End]\nData\n\n```\n\nI'd like to grab the `Data I want` from between the `[Start]` and `[End]` tags using a Regex. Can anyone show me how this might be done?\n\n\n","answer_pids":["stackoverflow_Passage_345","stackoverflow_Passage_347","stackoverflow_Passage_349","stackoverflow_Passage_1242","stackoverflow_Passage_6740","stackoverflow_Passage_9786","stackoverflow_Passage_12208","stackoverflow_Passage_232055","stackoverflow_Passage_355912","stackoverflow_Passage_507392"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1671","query":"Privatizing a BlogEngine.Net Installation | I have a blogengine.net install that requires privatization.\n\n\nI'm doing research work at the moment, but I have to keep my blog\/journal private until certain conditions are met.\n\n\nHow can I privatize my blogEngine.net install so that readers must log in to read my posts?\n\n\n","answer_pids":["stackoverflow_Passage_6273","stackoverflow_Passage_9500","stackoverflow_Passage_10906","stackoverflow_Passage_11147","stackoverflow_Passage_11704","stackoverflow_Passage_142083"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_995","query":"HowTo Disable WebBrowser 'Click Sound' in your app only | The 'click sound' in question is actually a system wide preference, so I only want it to be disabled when my application has focus and then re-enable when the application closes\/loses focus.\n\n\nOriginally, I wanted to ask this question here on stackoverflow, but I was not yet in the beta. So, after googling for the answer and finding only a little bit of information on it I came up with the following and decided to post it here now that I'm in the beta.\n\n\n\n```\nusing System;\nusing Microsoft.Win32;\n\nnamespace HowTo\n{\n class WebClickSound\n {\n \/\/\/ <summary>\n \/\/\/ Enables or disables the web browser navigating click sound.\n \/\/\/ <\/summary>\n public static bool Enabled\n {\n get\n {\n RegistryKey key = Registry.CurrentUser.OpenSubKey(@\"AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current\");\n string keyValue = (string)key.GetValue(null);\n return String.IsNullOrEmpty(keyValue) == false && keyValue != \"\\\"\\\"\";\n }\n set\n {\n string keyValue;\n\n if (value)\n {\n keyValue = \"%SystemRoot%\\\\Media\\\\\";\n if (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor > 0)\n {\n \/\/ XP\n keyValue += \"Windows XP Start.wav\";\n }\n else if (Environment.OSVersion.Version.Major == 6)\n {\n \/\/ Vista\n keyValue += \"Windows Navigation Start.wav\";\n }\n else\n {\n \/\/ Don't know the file name so I won't be able to re-enable it\n return;\n }\n }\n else\n {\n keyValue = \"\\\"\\\"\";\n }\n\n \/\/ Open and set the key that points to the file\n RegistryKey key = Registry.CurrentUser.OpenSubKey(@\"AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current\", true);\n key.SetValue(null, keyValue, RegistryValueKind.ExpandString);\n isEnabled = value;\n }\n }\n }\n}\n\n```\n\nThen in the main form we use the above code in these 3 events: \n\n\n* Activated\n* Deactivated\n* FormClosing\n\n\n\n```\nprivate void Form1_Activated(object sender, EventArgs e)\n{\n \/\/ Disable the sound when the program has focus\n WebClickSound.Enabled = false;\n}\n\nprivate void Form1_Deactivate(object sender, EventArgs e)\n{\n \/\/ Enable the sound when the program is out of focus\n WebClickSound.Enabled = true;\n}\n\nprivate void Form1_FormClosing(object sender, FormClosingEventArgs e)\n{\n \/\/ Enable the sound on app exit\n WebClickSound.Enabled = true;\n}\n\n```\n\n\nThe one problem I see currently is if the program crashes they won't have the click sound until they re-launch my application, but they wouldn't know to do that.\n\n\nWhat do you guys think? Is this a good solution? What improvements can be made?\n\n\n","answer_pids":["stackoverflow_Passage_3475","stackoverflow_Passage_3477","stackoverflow_Passage_8223","stackoverflow_Passage_39715","stackoverflow_Passage_41433","stackoverflow_Passage_341253"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1498","query":"Using Visual Studio to develop for C++ for Unix | Does anyone have battle stories to share trying to use Visual Studio to develop applications for Unix? And I'm not talking using .NET with a Mono or Wine virtual platform running beneath.\n\n\nOur company has about 20 developers all running Windows XP\/Vista and developing primarily for Linux & Solaris. Until recently we all logged into a main Linux server and modified\/built code the good old fashioned way: Emacs, Vi, dtpad - take your pick. Then someone said, \"hey - we're living in the Dark Ages, we should be using an IDE\".\n\n\nSo we tried out a few and decided that Visual Studio was the only one that would meet our performance needs (yes, I'm sure that IDE X is a very nice IDE, but we chose VS).\n\n\nThe problem is, how do you setup your environment to have the files available locally to VS, but also available to a build server? We settled with writing a Visual Studio plugin - it writes our files locally and to the build server whenever we hit \"Save\" and we have a bit fat \"sync\" button that we can push when our files change on the server side (for when we update to the latest files from our source control server). \n\n\nThe plugin also uses Visual Studio's external build system feature that ultimately just ssh's into the build server and calls our local \"make\" utility (which is Boost Build v2 - has great dependency checking, but is *really* slow to start as a result i.e. 30-60 seconds to begin). The results are piped back into Visual Studio so the developer can click on the error and be taken to the appropriate line of code (quite slick actually). The build server uses GCC and cross-compiles all of our Solaris builds.\n\n\nBut even after we've done all this, I can't help but sigh whenever I start to write code in Visual Studio. I click a file, start typing, and VS chugs to catch up with me.\n\n\nIs there anything more annoying than having to stop and wait for your tools? Are the benefits worth the frustration?\n\n\nThoughts, stories, help?\n\n\n","answer_pids":["stackoverflow_Passage_5517","stackoverflow_Passage_5530","stackoverflow_Passage_5533","stackoverflow_Passage_5541","stackoverflow_Passage_5762","stackoverflow_Passage_11092","stackoverflow_Passage_11093","stackoverflow_Passage_11359","stackoverflow_Passage_11361","stackoverflow_Passage_12062","stackoverflow_Passage_12644","stackoverflow_Passage_13042","stackoverflow_Passage_507865"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_175","query":"What is the best way to copy a database? | When I want to make a copy of a database, I always create a new empty database, and then restore a backup of the existing database into it. However, I'm wondering if this is really the least error-prone, least complicated, and most efficient way to do this?\n\n\n","answer_pids":["stackoverflow_Passage_457","stackoverflow_Passage_465","stackoverflow_Passage_502","stackoverflow_Passage_507","stackoverflow_Passage_1792","stackoverflow_Passage_11871"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1931","query":"Is there a way to make a constructor only visible to a parent class in C#? | I have a collection of classes that inherit from an abstract class I created. I'd like to use the abstract class as a factory for creating instances of concrete implementations of my abstract class. \n\n\nIs there any way to hide a constructor from all code except a parent class.\n\n\nI'd like to do this basically\n\n\n\n```\npublic abstract class AbstractClass\n{\n public static AbstractClass MakeAbstractClass(string args)\n {\n if (args == \"a\")\n return new ConcreteClassA();\n if (args == \"b\")\n return new ConcreteClassB();\n }\n}\n\npublic class ConcreteClassA : AbstractClass\n{\n}\n\npublic class ConcreteClassB : AbstractClass\n{\n}\n\n```\n\nBut I want to prevent anyone from directly instantiating the 2 concrete classes. I want to ensure that only the MakeAbstractClass() method can instantiate the base classes. Is there any way to do this?\n\n\n**UPDATE** \n\nI don't need to access any specific methods of ConcreteClassA or B from outside of the Abstract class. I only need the public methods my Abstract class provides. I don't really need to prevent the Concrete classes from being instantiated, I'm just trying to avoid it since they provide no new public interfaces, just different implementations of some very specific things internal to the abstract class.\n\n\nTo me, the simplest solution is to [make child classes as samjudson mentioned](https:\/\/stackoverflow.com\/questions\/20185\/is-there-a-way-to-make-a-constructor-only-visible-to-a-parent-class-in-c#20200). I'd like to avoid this however since it would make my abstract class' file a lot bigger than I'd like it to be. I'd rather keep classes split out over a few files for organization.\n\n\nI guess there's no easy solution to this...\n\n\n","answer_pids":["stackoverflow_Passage_7348","stackoverflow_Passage_7349","stackoverflow_Passage_7360","stackoverflow_Passage_7374","stackoverflow_Passage_7378","stackoverflow_Passage_7386","stackoverflow_Passage_7399","stackoverflow_Passage_7931","stackoverflow_Passage_9471","stackoverflow_Passage_9640"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1863","query":"Content Management system recommendations | Management is thinking of changing out Content Management Systems. What do you use\/recommend?\n\n\n1. What UCM solution is your company using?\n2. How big is your company?\n3. Are you happy with the implementation?\n\n\nCurrent setup:\n\n\n1. The company I work for uses `Oracle ECM` (formerly Stellent UCM).\n2. We have somewhere over 10,000 employees across Australia, New\nZealand and Indonesia.\n3. It works! Having worked with the system for a while now. I can see\nwhere the initial implementation went wrong. Its 3 years later and\nit is *Rewrite Time!* (Three year itch?)\n\n\n","answer_pids":["stackoverflow_Passage_7087","stackoverflow_Passage_7093","stackoverflow_Passage_8085","stackoverflow_Passage_9745","stackoverflow_Passage_10683","stackoverflow_Passage_10685","stackoverflow_Passage_10686","stackoverflow_Passage_11012","stackoverflow_Passage_11013","stackoverflow_Passage_11014","stackoverflow_Passage_11401","stackoverflow_Passage_11402","stackoverflow_Passage_43152","stackoverflow_Passage_53097"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_493","query":"What are good regular expressions? | I have worked for 5 years mainly in java desktop applications accessing Oracle databases and I have never used regular expressions. Now I enter Stack Overflow and I see a lot of questions about them; I feel like I missed something. \n\n\nFor what do you use regular expressions?\n\n\nP.S. sorry for my bad english\n\n\n","answer_pids":["stackoverflow_Passage_1500","stackoverflow_Passage_1501","stackoverflow_Passage_1505","stackoverflow_Passage_1509","stackoverflow_Passage_4971","stackoverflow_Passage_5445","stackoverflow_Passage_5446","stackoverflow_Passage_8061","stackoverflow_Passage_8063","stackoverflow_Passage_12692"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_118","query":"How do you get sudo access for a file inside the vi text editor? | Often while editing config files, I'll open one with vi and then when I go to save it realize that I didn't type\n\n\n\n```\nsudo vi filename\n\n```\n\nIs there any way to give vi sudo privileges to save the file? I seem to recall seeing something about this while looking up some stuff about vi a while ago, but now I can't find it.\n\n\n","answer_pids":["stackoverflow_Passage_276","stackoverflow_Passage_277","stackoverflow_Passage_298","stackoverflow_Passage_852","stackoverflow_Passage_2973","stackoverflow_Passage_8864","stackoverflow_Passage_10247","stackoverflow_Passage_10664","stackoverflow_Passage_12025","stackoverflow_Passage_13055","stackoverflow_Passage_234377"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_490","query":"LINQ to SQL strings to enums | LINQ to SQL allows table mappings to automatically convert back and forth to Enums by specifying the type for the column - this works for strings or integers.\n\n\nIs there a way to make the conversion case insensitive or add a custom mapping class or extenstion method into the mix so that I can specify what the string should look like in more detail.\n\n\nReasons for doing so might be in order to supply a nicer naming convention inside some new funky C# code in a system where the data schema is already set (and is being relied upon by some legacy apps) so the actual text in the database can't be changed.\n\n\n","answer_pids":["stackoverflow_Passage_1547","stackoverflow_Passage_5097"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_629","query":"Faster way to find duplicates conditioned by time | In a machine with AIX without `PERL` I need to filter records that will be considered duplicated if they have the same id and if they were registered between a period of four hours. \n\n\nI implemented this filter using `AWK` and work pretty well but I need a solution much faster: \n\n\n\n```\n\n# Generar lista de Duplicados\nawk 'BEGIN {\nFS=\",\" \n}\n\/OK\/ { \n old[$8] = f[$8];\n f[$8] = mktime($4, $3, $2, $5, $6, $7); \n x[$8]++;\n}\n\/OK\/ && x[$8]>1 && f[$8]-old[$8] \n\nAny suggestions? Are there ways to improve the environment (preloading the file or someting like that)? \n\n\n\nThe input file is already sorted.\n\n\n\nWith the corrections suggested by [jj33](https:\/\/stackoverflow.com\/questions\/6475\/faster-way-to-find-duplicates-conditioned-by-time#6869) I made a new version with better treatment of dates, still maintaining a low profile for incorporating more operations: \n\n\n\n\nawk 'BEGIN {\n FS=\",\"; \n SECSPERMINUTE=60;\n SECSPERHOUR=3600;\n SECSPERDAY=86400;\n split(\"0 31 59 90 120 151 181 212 243 273 304 334\", DAYSTOMONTH, \" \");\n split(\"0 366 731 1096 1461 1827 2192 2557 2922 3288 3653 4018 4383 4749 5114 5479 5844 6210 6575 6940 7305\", DAYSTOYEAR, \" \");\n}\n\/OK\/ { \n old[$8] = f[$8];\n f[$8] = mktime($4, $3, $2, $5, $6, $7); \n x[$8]++;\n}\n\/OK\/ && x[$8]>1 && f[$8]-old[$8] 2 ) && ( ((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0) ) ) {\n d2m = d2m + 1;\n }\n d2y = DAYSTOYEAR[ y - 1999 ];\n return ss + (mm*SECSPERMINUTE) + (hh*SECSPEROUR) + (d*SECSPERDAY) + (d2m*SECSPERDAY) + (d2y*SECSPERDAY);\n}\n'\n\n```\n\n","answer_pids":["stackoverflow_Passage_2145","stackoverflow_Passage_2165","stackoverflow_Passage_2212","stackoverflow_Passage_2273","stackoverflow_Passage_2468","stackoverflow_Passage_10910"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1939","query":"ILMerge and Web Resources | We're attemtping to merge our DLL's into one for deployment, thus ILMerge. Almost everything seems to work great. We have a couple web controls that use `ClientScript.RegisterClientScriptResource` and these are 404-ing after the merge (These worked before the merge).\n\n\nFor example one of our controls would look like\n\n\n\n```\nnamespace Company.WebControls\n{\n public class ControlA: CompositeControl, INamingContainer\n {\n protected override void OnPreRender(EventArgs e)\n {\n base.OnPreRender(e);\n this.Page.ClientScript.RegisterClientScriptResource(typeof(ControlA), \"Company.WebControls.ControlA.js\"); \n } \n }\n}\n\n```\n\nIt would be located in Project WebControls, assembly Company.WebControls. Underneath would be ControlA.cs and ControlA.js. ControlA.js is marked as an embedded resource. In the AssemblyInfo.cs I include the following:\n\n\n\n```\n[assembly: System.Web.UI.WebResource(\"Company.WebControls.ControlA.js\", \"application\/x-javascript\")]\n\n```\n\nAfter this is merged into CompanyA.dll, what is the proper way to reference this web resource? The ILMerge command line is as follows (from the bin directory after the build): `\"C:\\Program Files\\Microsoft\\ILMerge\\ILMerge.exe\" \/keyfile:..\/..\/CompanySK.snk \/wildcards:True \/copyattrs:True \/out:Company.dll Company.*.dll`\n\n\n","answer_pids":["stackoverflow_Passage_7422","stackoverflow_Passage_9497","stackoverflow_Passage_292025"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1703","query":"Default Internet connection on Dual LAN Workstation | I know this is not programming directly, but it's regarding a development workstation I'm setting up.\n\n\nI've got a Windows Server 2003 machine that needs to be on two LAN segments at the same time. One of them is a 10.17.x.x LAN and the other is 10.16.x.x\n\n\nThe problem is that I don't want to be using up the bandwidth on the 10.16.x.x network for internet traffic, etc (this network is basically only for internal stuff, though it does have internet access) so I would like the system to use the 10.17.x.x connection for anything that is external to the LAN (and for anything on 10.17.x.x of course, and to only use the 10.16.x.x connection for things that are on *that* specific LAN.\n\n\nI've tried looking into the windows \"route\" command but it's fairly confusing and won't seem to let me delete routes tha tI believe are interfering with what I want it to do. Is there a better way of doing this? Any good software for segmenting your LAN access?\n\n\n","answer_pids":["stackoverflow_Passage_6451","stackoverflow_Passage_6453","stackoverflow_Passage_9218"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_743","query":"Capture MouseDown event for .NET TextBox | Is there any way to capture the MouseDown even from the .NET 2.0 TextBox control?\nI know the inherited Control class has the event, but it's not exposed in TextBox.\nIs there a way to override the event handler?\n\n\nI also tried the OpenNETCF TextBox2 control which does have the MouseDown event exposed, but no matter what I do, it doesn't fire the handler.\n\n\nAny suggestions?\n\n\n\n\n---\n\n\n\n> \n> What kind of crazy mobile device do\n> you have that has a mouse? :)\n> \n> \n> \n\n\nYes, windows mobile does not have an actual mouse, but you are mistaken that Windows Mobile .NET do not support the Mouse events. A click or move on the screen is still considered a \"Mouse\" event. It was done this way so that code could port over from full Windows easily. And this is not a Windows Mobile specific issue. The TextBox control on Windows does not have native mouse events either. I just happened to be using Windows Mobile in this case.\n\n\nEdit: And on a side note...as Windows Mobile is built of the WindowsCE core which is often used for embedded desktop systems and Slim Terminal Services clients or \"WinTerms\" it has support for a hardware mouse and has for a long time. Most devices just don't have the ports to plug one in.\n\n\n\n\n---\n\n\n\n> \n> According to the .Net Framework, the\n> MouseDown Event Handler on a TextBox\n> is supported. What happens when you\n> try to run the code?\n> \n> \n> \n\n\nActually, that's only there because it inherits it from \"Control\", as does *every* other Form control. It is, however, overridden (and changed to private I believe) in the TextBox class. So it will not show up in IntelliSense in Visual Studio.\n\n\nHowever, you actually can write the code:\n\n\n\n```\ntextBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.textBox1_MouseDown);\n\n```\n\nand it will compile and run just fine, the only problem is that textBox1\\_MouseDown() will not be fired when you tap the TextBox control. I assume this is because of the Event being overridden internally. I don't even want to change what's happening on the event internally, I just want to add my own event handler to that event so I can fire some custom code as you could with any other event.\n\n\n","answer_pids":["stackoverflow_Passage_2488","stackoverflow_Passage_2492","stackoverflow_Passage_2498","stackoverflow_Passage_7692","stackoverflow_Passage_10469","stackoverflow_Passage_12584"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_229","query":"How to filter and combine 2 datasets in C# | I am building a web page to show a customer what software they purchased and to give them a link to download said software. Unfortunately, the data on what was purchased and the download information are in separate databases so I can't just take care of it with joins in an SQL query.\n\n\nThe common item is SKU. I'll be pulling a list of SKUs from the customer purchases database and on the download table is a comma delineated list of SKUs associated with that download. My intention, at the moment, is to create from this one datatable to populate a `GridView`.\n\n\nAny suggestions on how to do this efficiently would be appreciated. If it helps, I can pretty easily pull back the data as a `DataSet` or a `DataReader`, if either one would be better for this purpose.\n\n\n","answer_pids":["stackoverflow_Passage_621","stackoverflow_Passage_631","stackoverflow_Passage_635"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_39","query":"Annotating YouTube videos programmatically | I want to be able to display a normal YouTube video with overlaid annotations, consisting of coloured rectangles for each frame. The only requirement is that this should be done programmatically. \n\n\nYouTube has annotations now, but require you to use their front end to create them by hand. I want to be able to generate them. What's the best way of doing this?\n\n\nSome ideas:\n\n\n\n> \n> 1. Build your own Flash player (ew?)\n> 2. Somehow draw over the YouTube Flash player. Will this work?\n> 3. Reverse engineer & hijack YouTube's annotation system. Either messing with the local files or redirecting its attempt to download\n> the annotations. (using Greasemonkey? Firefox plugin?)\n> \n> \n> \n\n\nIdea that doesn't count: \n\n\n\n> \n> download the video\n> \n> \n> \n\n\n","answer_pids":["stackoverflow_Passage_2256","stackoverflow_Passage_9854","stackoverflow_Passage_10507"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1000","query":"Unit test execution speed (how many tests per second?) | What kind of execution rate do you aim for with your unit tests (# test per second)? How long is too long for an individual unit test? \n\n\nI'd be interested in knowing if people have any specific thresholds for determining whether their tests are too slow, or is it just when the friction of a long running test suite gets the better of you? \n\n\nFinally, when you do decide the tests need to run faster, what techniques do you use to speed up your tests?\n\n\n*Note: integration tests are obviously a different matter again. We are strictly talking unit tests that need to be run as frequently as possible.*\n\n\n\n\n---\n\n\n**Response roundup:** Thanks for the great responses so far. Most advice seems to be don't worry about the speed -- concentrate on quality and just selectively run them if they are too slow. Answers with specific numbers have included aiming for <10ms up to 0.5 and 1 second per test, or just keeping the entire suite of commonly run tests under 10 seconds. \n\n\nNot sure whether it's right to mark one as an \"accepted answer\" when they're all helpful :)\n\n\n","answer_pids":["stackoverflow_Passage_3488","stackoverflow_Passage_3489","stackoverflow_Passage_3491","stackoverflow_Passage_3494","stackoverflow_Passage_3498","stackoverflow_Passage_3582","stackoverflow_Passage_8231","stackoverflow_Passage_11428","stackoverflow_Passage_11433","stackoverflow_Passage_11457","stackoverflow_Passage_109652"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_663","query":"Developing addins for World of Warcraft - Getting started? | As a long time World of Warcraft player, and a passionate developer I have decided that I would like to combine the two and set about developing some addins. Not only to improve my gameplay experience but as a great opportunity to learn something new.\n\n\nDoes anyone have any advice on how to go about starting out?\n\n\nIs there an IDE one can use? How does one go about testing? Are there any ready made libraries available? Or would I get a better learning experience by ignoring the libraries and building from scratch? How do I oneshot Hogger?\n\n\nWould love to hear your advice, experiences and views.\n\n\n","answer_pids":["stackoverflow_Passage_2162","stackoverflow_Passage_2169","stackoverflow_Passage_6857","stackoverflow_Passage_9023","stackoverflow_Passage_9670"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1226","query":"How is the HTML on this site so clean? | I work with C# at work but dislike how with webforms it spews out a lot of JavaScript not including the many lines for viewstate that it creates.\n\n\nThat's why I like coding with PHP as I have full control.\n\n\nBut I was just wondering how this sites HTML is so clean and elegant?\n\n\nDoes using MVC have something to do with it? I see that JQuery is used but surely you still use asp:required validators? If you do, where is all the hideous code that it normally produces?\n\n\nAnd if they arent using required field validators, why not? Surely it's quicker to develop in than using JQuery?\n\n\nOne of the main reasons I code my personal sites in PHP was due to the more elegant HTML that it produces but if I can produce code like this site then I will go full time .net!\n\n\n","answer_pids":["stackoverflow_Passage_4388","stackoverflow_Passage_4391","stackoverflow_Passage_4396","stackoverflow_Passage_4397","stackoverflow_Passage_8596"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1","query":"Why did the width collapse in the percentage width child element in an absolutely positioned parent on Internet Explorer 7? | I have an absolutely positioned `div` containing several children, one of which is a relatively positioned `div`. When I use a `percentage-based width` on the child `div`, it collapses to `0 width` on IE7, but not on Firefox or Safari.\n\n\nIf I use `pixel width`, it works. If the parent is relatively positioned, the percentage width on the child works.\n\n\n1. Is there something I'm missing here?\n2. Is there an easy fix for this besides the `pixel-based width` on the child?\n3. Is there an area of the CSS specification that covers this?\n\n\n","answer_pids":["stackoverflow_Passage_8","stackoverflow_Passage_31","stackoverflow_Passage_544","stackoverflow_Passage_9198","stackoverflow_Passage_12219","stackoverflow_Passage_25327","stackoverflow_Passage_1016424"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1086","query":"XPATHS and Default Namespaces | What is the story behind XPath and support for namespaces? Did XPath as a specification precede namespaces? If I have a document where elements have been given a default namespace: \n\n\n\n```\n<foo xmlns=\"uri\" \/>\n\n```\n\nIt appears as though some of the XPath processor libraries won't recognize `\/\/foo` because of the namespace whereas others will. The option my team has thought about is to add a namespace prefix using regular expressions to the XPath (you can add a namespace prefix via XmlNameTable) but this seems brittle since XPath is such a flexible language when it comes to node tests.\n\n\nIs there a standard that applies to this?\n\n\nMy approach is a bit hackish but it seems to work fine; I remove the `xmlns` declaration with a search\/replace and then apply XPath.\n\n\n\n```\nstring readyForXpath = Regex.Replace(xmldocument, \"xmlns=\\\".+\\\"\", String.Empty );\n\n```\n\nIs that a fair approach or has anyone solved this differently?\n\n\n","answer_pids":["stackoverflow_Passage_3831","stackoverflow_Passage_3834","stackoverflow_Passage_5781","stackoverflow_Passage_10793","stackoverflow_Passage_11398","stackoverflow_Passage_960471"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1594","query":"Validation Patterns for Custom XML Documents | I have a web application that generates a medium sized XML dataset to be consumed by a third party. \n\nI thought it would be a good idea to provide some form of schema document for the XML that I generate so I pasted the XML into Visual Studio and got it to generate an XSD. \n\nThe annoying thing is that my XML doesn't validate to the XSD that was generated!\n\n\nIs it better to roll your own XSD? \n\nWhat about different schema docs like DTDs, Relax NG, or Schematron? \n\n\nThe key is that I would like to be able to validate my document using C#. \n\n\nWhat are your XML validation strategies?\n\n\n","answer_pids":["stackoverflow_Passage_5948","stackoverflow_Passage_5985"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1104","query":"Clearing Page Cache in ASP.NET | For my blog I am wanting to use the Output Cache to save a cached version of a perticular post for around 10 minutes, and thats fine...\n\n\n\n```\n<%@OutputCache Duration=\"600\" VaryByParam=\"*\" %>\n\n```\n\nHowever, if someone posts a comment, I want to clear the cache so that the page is refreshed and the comment can be seen.\n\n\nHow do I do this in ASP.Net C#?\n\n\n","answer_pids":["stackoverflow_Passage_3905","stackoverflow_Passage_3911","stackoverflow_Passage_3921","stackoverflow_Passage_8405","stackoverflow_Passage_11688","stackoverflow_Passage_12982","stackoverflow_Passage_13377","stackoverflow_Passage_43309","stackoverflow_Passage_85250"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_330","query":"Convert integers to written numbers | Is there an efficient method of converting an integer into the written numbers, for example:\n\n\n\n```\nstring Written = IntegerToWritten(21);\n\n```\n\nwould return \"Twenty One\".\n\n\nIs there any way of doing this that doesn't involve a massive look-up table?\n\n\n","answer_pids":["stackoverflow_Passage_967","stackoverflow_Passage_973","stackoverflow_Passage_981","stackoverflow_Passage_3266","stackoverflow_Passage_131224","stackoverflow_Passage_213350","stackoverflow_Passage_550425","stackoverflow_Passage_600885","stackoverflow_Passage_628530","stackoverflow_Passage_675887","stackoverflow_Passage_787285","stackoverflow_Passage_872915"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1561","query":"How to get only directory name from SaveFileDialog.FileName | What would be the easiest way to separate the directory name from the file name when dealing with `SaveFileDialog.FileName` in C#?\n\n\n","answer_pids":["stackoverflow_Passage_5791","stackoverflow_Passage_5792","stackoverflow_Passage_5793","stackoverflow_Passage_5794","stackoverflow_Passage_9062"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_765","query":"Center text output from Graphics.DrawString() | I'm using the .NETCF (Windows Mobile) `Graphics` class and the `DrawString()` method to render a single character to the screen.\n\n\nThe problem is that I can't seem to get it centred properly. No matter what I set for the Y coordinate of the location of the string render, it always comes out lower than that and the larger the text size the greater the Y offset.\n\n\nFor example, at text size 12, the offset is about 4, but at 32 the offset is about 10.\n\n\nI want the character to vertically take up most of the rectangle it's being drawn in and be centred horizontally. Here's my basic code. `this` is referencing the user control it's being drawn in.\n\n\n\n```\nGraphics g = this.CreateGraphics();\n\nfloat padx = ((float)this.Size.Width) * (0.05F);\nfloat pady = ((float)this.Size.Height) * (0.05F);\n\nfloat width = ((float)this.Size.Width) - 2 * padx;\nfloat height = ((float)this.Size.Height) - 2 * pady;\n\nfloat emSize = height;\n\ng.DrawString(letter, new Font(FontFamily.GenericSansSerif, emSize, FontStyle.Regular),\n new SolidBrush(Color.Black), padx, pady);\n\n```\n\nYes, I know there is the label control that I could use instead and set the centring with that, but I actually do need to do this manually with the `Graphics` class.\n\n\n","answer_pids":["stackoverflow_Passage_2556","stackoverflow_Passage_2558","stackoverflow_Passage_2569","stackoverflow_Passage_2580","stackoverflow_Passage_7763","stackoverflow_Passage_8111","stackoverflow_Passage_11020"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1828","query":"How do I do an Upsert Into Table? | I have a view that has a list of jobs in it, with data like who they're assigned to and the stage they are in. I need to write a stored procedure that returns how many jobs each person has at each stage.\n\n\nSo far I have this (simplified):\n\n\n\n```\nDECLARE @ResultTable table \n(\n StaffName nvarchar(100),\n Stage1Count int,\n Stage2Count int\n)\n\nINSERT INTO @ResultTable (StaffName, Stage1Count)\n SELECT StaffName, COUNT(*) FROM ViewJob\n WHERE InStage1 = 1\n GROUP BY StaffName\n\nINSERT INTO @ResultTable (StaffName, Stage2Count)\n SELECT StaffName, COUNT(*) FROM ViewJob\n WHERE InStage2 = 1\n GROUP BY StaffName\n\n```\n\nThe problem with that is that the rows don't combine. So if a staff member has jobs in stage1 and stage2 there's two rows in @ResultTable. What I would really like to do is to update the row if one exists for the staff member and insert a new row if one doesn't exist.\n\n\nDoes anyone know how to do this, or can suggest a different approach?\nI would really like to avoid using cursors to iterate on the list of users (but that's my fall back option).\n\n\nI'm using SQL Server 2005.\n\n\n**Edit: @Lee:** Unfortunately the InStage1 = 1 was a simplification. It's really more like WHERE DateStarted IS NOT NULL and DateFinished IS NULL.\n\n\n**Edit: @BCS:** I like the idea of doing an insert of all the staff first so I just have to do an update every time. But I'm struggling to get those UPDATE statements correct.\n\n\n","answer_pids":["stackoverflow_Passage_6943","stackoverflow_Passage_6944","stackoverflow_Passage_6945","stackoverflow_Passage_6948","stackoverflow_Passage_6951","stackoverflow_Passage_6977","stackoverflow_Passage_9344"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1972","query":"Image UriSource and Data Binding | I'm trying to bind a list of custom objects to a WPF Image like this:\n\n\n\n```\n<Image>\n <Image.Source>\n <BitmapImage UriSource=\"{Binding Path=ImagePath}\" \/>\n <\/Image.Source>\n<\/Image>\n\n```\n\nBut it doesn't work. This is the error I'm getting:\n\n\n*\"Property 'UriSource' or property 'StreamSource' must be set.\"*\n\n\nWhat am I missing?\n\n\n","answer_pids":["stackoverflow_Passage_7515","stackoverflow_Passage_7534","stackoverflow_Passage_7573","stackoverflow_Passage_9536","stackoverflow_Passage_12228","stackoverflow_Passage_257019","stackoverflow_Passage_376975"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1892","query":"Huge Web App With Memory Leak in IE 6 | I have a huge web app that is having issues with memory leak in IE 6.\n\n\nFixing a memory leak in a 5 line code sample that demonstrates the problem is easy. \n\n\nBut if I have a very huge application, where should a start from?\n\n\n","answer_pids":["stackoverflow_Passage_7195","stackoverflow_Passage_7198","stackoverflow_Passage_9425","stackoverflow_Passage_157963"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1788","query":"Why do we need entity objects? | I really need to see some honest, thoughtful debate on the merits of the currently accepted ***enterprise application*** design paradigm.\n\n\nI am not convinced that entity objects should exist.\n\n\nBy entity objects I mean the typical things we tend to build for our applications, like \"Person\", \"Account\", \"Order\", etc.\n\n\nMy current design philosophy is this:\n\n\n* All database access must be accomplished via stored procedures.\n* Whenever you need data, call a stored procedure and iterate over a SqlDataReader or the rows in a DataTable\n\n\n(Note: I have also built enterprise applications with Java EE, java folks please substitute the equvalent for my .NET examples)\n\n\nI am not anti-OO. I write lots of classes for different purposes, just not entities. I will admit that a large portion of the classes I write are static helper classes.\n\n\nI am not building toys. I'm talking about large, high volume transactional applications deployed across multiple machines. Web applications, windows services, web services, b2b interaction, you name it.\n\n\nI have used OR Mappers. I have written a few. I have used the Java EE stack, CSLA, and a few other equivalents. I have not only used them but actively developed and maintained these applications in production environments.\n\n\nI have come to the battle-tested conclusion that entity objects are getting in our way, and our lives would be *so* much easier without them.\n\n\nConsider this simple example: you get a support call about a certain page in your application that is not working correctly, maybe one of the fields is not being persisted like it should be. With my model, the developer assigned to find the problem opens *exactly 3 files*. An ASPX, an ASPX.CS and a SQL file with the stored procedure. The problem, which might be a missing parameter to the stored procedure call, takes minutes to solve. But with any entity model, you will invariably fire up the debugger, start stepping through code, and you may end up with 15-20 files open in Visual Studio. By the time you step down to the bottom of the stack, you forgot where you started. We can only keep so many things in our heads at one time. Software is incredibly complex without adding any unnecessary layers.\n\n\nDevelopment complexity and troubleshooting are just one side of my gripe.\n\n\nNow let's talk about scalability.\n\n\nDo developers realize that each and every time they write or modify any code that interacts with the database, they need to do a throrough analysis of the exact impact on the database? And not just the development copy, I mean a mimic of production, so you can see that the additional column you now require for your object just invalidated the current query plan and a report that was running in 1 second will now take 2 minutes, just because you added a single column to the select list? And it turns out that the index you now require is so big that the DBA is going to have to modify the physical layout of your files?\n\n\nIf you let people get too far away from the physical data store with an abstraction, they will create havoc with an application that needs to scale.\n\n\nI am not a zealot. I can be convinced if I am wrong, and maybe I am, since there is such a strong push towards Linq to Sql, ADO.NET EF, Hibernate, Java EE, etc. Please think through your responses, if I am missing something I really want to know what it is, and why I should change my thinking.\n\n\n***[Edit]***\n\n\nIt looks like this question is suddenly active again, so now that we have the new comment feature I have commented directly on several answers. Thanks for the replies, I think this is a healthy discussion.\n\n\nI probably should have been more clear that I am talking about enterprise applications. I really can't comment on, say, a game that's running on someone's desktop, or a mobile app.\n\n\nOne thing I have to put up here at the top in response to several similar answers: orthogonality and separation of concerns often get cited as reasons to go entity\/ORM. Stored procedures, to me, are the best example of separation of concerns that I can think of. If you disallow all other access to the database, other than via stored procedures, you could in theory redesign your entire data model and not break any code, so long as you maintained the inputs and outputs of the stored procedures. They are a perfect example of programming by contract (just so long as you avoid \"select \\*\" and document the result sets).\n\n\nAsk someone who's been in the industry for a long time and has worked with long-lived applications: how many application and UI layers have come and gone while a database has lived on? How hard is it to tune and refactor a database when there are 4 or 5 different persistence layers generating SQL to get at the data? You can't change anything! ORMs or any code that generates SQL ***lock your database in stone***.\n\n\n","answer_pids":["stackoverflow_Passage_6760","stackoverflow_Passage_6801","stackoverflow_Passage_6805","stackoverflow_Passage_6808","stackoverflow_Passage_6814","stackoverflow_Passage_6819","stackoverflow_Passage_6831","stackoverflow_Passage_6832","stackoverflow_Passage_6835","stackoverflow_Passage_6843","stackoverflow_Passage_6846","stackoverflow_Passage_6854","stackoverflow_Passage_6856","stackoverflow_Passage_7712","stackoverflow_Passage_7714","stackoverflow_Passage_9702","stackoverflow_Passage_9703","stackoverflow_Passage_9705","stackoverflow_Passage_9706","stackoverflow_Passage_9707","stackoverflow_Passage_10503","stackoverflow_Passage_11149","stackoverflow_Passage_11150","stackoverflow_Passage_11312","stackoverflow_Passage_11331","stackoverflow_Passage_11364","stackoverflow_Passage_11365","stackoverflow_Passage_11510","stackoverflow_Passage_11512","stackoverflow_Passage_11586","stackoverflow_Passage_11653","stackoverflow_Passage_11654","stackoverflow_Passage_11955","stackoverflow_Passage_12096","stackoverflow_Passage_12144","stackoverflow_Passage_12656","stackoverflow_Passage_12716","stackoverflow_Passage_13443","stackoverflow_Passage_185159","stackoverflow_Passage_433336","stackoverflow_Passage_748340"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1308","query":"Resources on wordpress theme-development | What are the best resources for Wordpress theme-development? I am currently in the phase of starting my own blog, and don't want to use one of the many free themes. I already have a theme for my website, so I want to read about best-practices. \n\n\nAny advice on how to get started would be very welcome :)\n\n\n\n\n---\n\n\nI have now created my theme (wohoo!), and thought I should summarize the best resources I found. Lets see..\n\n\n**Resources:**\n\n\n* [ThemeTation's three-part guide to create a wordpress-theme from scratch](http:\/\/themetation.com\/2008\/07\/14\/how-to-create-wordpress-themes-from-scratch-part-1\/)\n* [Nettuts.com's guide: How to Create a Wordpress Theme from Scratch](https:\/\/code.tutsplus.com\/articles\/how-to-create-a-wordpress-theme-from-scratch--net-706) \n\nDidn't actually use this, it's a quite new article, but anyway - it's great. It will get a follow-up in the next few days too..\n* [Wordpress.org's own guide on templates](http:\/\/codex.wordpress.org\/Theme_Development) \n\nDefinatly a must-read for everyone new to wordpress-designing..\n* [\"The loop\"](http:\/\/codex.wordpress.org\/The_Loop) \n\nEssential knowledge, also a must-read\n* [Directory of all the template tags](http:\/\/codex.wordpress.org\/Template_Tags) \n\nUsed by wordpress to actually output blog-content..\n\n\n**Inspiration:**\n\n\n* Smashing Magazine's lists: [first](http:\/\/www.smashingmagazine.com\/2008\/01\/08\/100-excellent-free-high-quality-wordpress-themes\/), [one more](http:\/\/www.smashingmagazine.com\/2007\/02\/09\/83-beautiful-wordpress-themes-you-probably-havent-seen\/), [yet another one](http:\/\/www.smashingmagazine.com\/2008\/08\/25\/30-free-high-quality-wordpress-themes\/)\n* [Wordpress.org's theme-directory](http:\/\/wordpress.org\/extend\/themes\/)\n\n\n","answer_pids":["stackoverflow_Passage_4761","stackoverflow_Passage_4762","stackoverflow_Passage_4765","stackoverflow_Passage_4776","stackoverflow_Passage_8715","stackoverflow_Passage_12037","stackoverflow_Passage_12542","stackoverflow_Passage_12544","stackoverflow_Passage_12550","stackoverflow_Passage_13092","stackoverflow_Passage_13467","stackoverflow_Passage_42320"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1723","query":"Automating WSDL.exe in a Custom Build | I have a web application written in C# that consumes several internal web services. We have a development tier, a testing tier, and a production tier. Also, we use the `WSDL.exe` command to generate a `Proxies.cs` file for a given tier's web services.\n\n\nWhen we are ready to deploy our code up the stack from development to test or test to production, we need to run the `WSDL.exe` command to point to the appropriate version of the web services.\n\n\nIs there a generally accepted way to automate this?\n\n\n","answer_pids":["stackoverflow_Passage_6546","stackoverflow_Passage_7970","stackoverflow_Passage_9241"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_611","query":"E-mail Notifications | In a .net system I'm building, there is a need for automated e-mail notifications. These should be editable by an admin. What's the easiest way to do this? SQL table and WYSIWIG for editing?\n\n\n\n\n---\n\n\nThe queue is a great idea. I've been throwing around that type of process for awhile with my old company.\n\n\n","answer_pids":["stackoverflow_Passage_1936","stackoverflow_Passage_1937","stackoverflow_Passage_1944","stackoverflow_Passage_2395","stackoverflow_Passage_2397","stackoverflow_Passage_6207"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1280","query":"Python version of PHP's stripslashes | I wrote a piece of code to convert PHP's striplashes into valid Python [backslash] escapes:\n\n\n\n```\ncleaned = stringwithslashes\ncleaned = cleaned.replace('\\\\n', '\\n')\ncleaned = cleaned.replace('\\\\r', '\\n')\ncleaned = cleaned.replace('\\\\', '')\n\n```\n\nHow can I condense it? \n\n\n","answer_pids":["stackoverflow_Passage_4652","stackoverflow_Passage_4709","stackoverflow_Passage_4718","stackoverflow_Passage_4722","stackoverflow_Passage_427111"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1782","query":"Best practice for integrating TDD with web application development? | Unit testing and ASP.NET web applications are an ambiguous point in my group. More often than not, good testing practices fall through the cracks and web applications end up going live for several years with no tests. \n\n\nThe cause of this pain point generally revolves around the hassle of writing UI automation mid-development. \n\n\nHow do you or your organization integrate best TDD practices with web application development?\n\n\n","answer_pids":["stackoverflow_Passage_6741","stackoverflow_Passage_6746","stackoverflow_Passage_6798","stackoverflow_Passage_8445","stackoverflow_Passage_9315","stackoverflow_Passage_10797","stackoverflow_Passage_11160","stackoverflow_Passage_12722"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_217","query":"LINQ on the .NET 2.0 Runtime | Can a LINQ enabled app run on a machine that only has the .NET 2.0 runtime installed?\n\n\nIn theory, LINQ is nothing more than syntactic sugar, and the resulting IL code should look the same as it would have in .NET 2.0.\n\n\nHow can I write LINQ without using the .NET 3.5 libraries? Will it run on .NET 2.0?\n\n\n","answer_pids":["stackoverflow_Passage_589","stackoverflow_Passage_590","stackoverflow_Passage_591","stackoverflow_Passage_592","stackoverflow_Passage_2146","stackoverflow_Passage_10991","stackoverflow_Passage_11640","stackoverflow_Passage_12264","stackoverflow_Passage_54872"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1039","query":"How to encourage someone to learn programming? | I have a friend that has a little bit of a holiday coming up and they want ideas on what they should do during the holiday, I plan to suggest programming to them, what are the pros and cons that I need to mention?\n\n\nI'll add to the list below as people reply, I apologise if I duplicate any entries.\n\n\n**Pros I have so far**\n\n\n1. Minimal money requirement (they already have a computer)\n2. Will help them to think in new ways\n3. (Rob Cooper) Great challenge, every day really is a fresh challenge in some way, shape or form. Not many jobs can truly offer that.\n4. (Rob Cooper) I like the way it makes me think.. I look at EVERYTHING more logically as my skills improve.. This helps with general living as well as programming.\n5. (Rob Cooper) Money is\/can be pretty good.\n6. (Rob Cooper) Its a pretty portable trade.. With collaboration tech as it is, you can pretty much work anywhere in the world so long as you have an Internet connection.\n7. (Rob Cooper) It's an exciting industry to work in, theres massive amounts of tech to work and play with!\n8. (Quarrelsome) Jetpacks. Programming is Technology and the more time we spend with technology the closer we get to having Jetpacks. (*Teifion: This is a really cool analogy!*)\n9. (Saj) Profitable way of Exercising Brain Muscles.\n10. (Saj) It makes you look brilliant to some audience.\n11. (Saj) Makes you tech-smart.\n12. (Saj) Makes you eligible to the future world.\n13. (Saj) It's easy, fun, not in a math way..\n14. (kiwiBastard) If the person likes problem solving then programming is no better example.\n15. (kiwiBastard) Brilliant sense of achivement when you can interact with something you have designed and coded\n16. (kiwiBastard) Great way to meet chicks\/chaps - erm, maybe not that one (*Teifion: I dunno where you do programming but I want to come visit some time*)\n17. (epatel) Learning how to program is like learning spell casting at Hogwarts . The computer will be your servant forever...\n\n\n**Cons I have so far**\n\n\n1. Can be frustrating when it's not working\n2. Not physical exercise\n3. (Rob Cooper) There are a lot of people doing it just for the money. They have no love for the craft and just appear lazy, annoying and sometimes it can really grind my gears seeing an industry and workforce I enjoy so much being diluted with crap. Which can often reflect badly on all of us.\n4. (Rob Cooper) Not so sure about the initial cost.. Yeah you can get started with Java or something at low cost, but for me, locally, the vast demand is for .NET developers, which can be costly getting up and running with. However, this is rapidly\/has not becoming the case with the amount of work put in by MS with releasing pretty damn good Express editions of their main development product line.\n5. (Rob Cooper) Its a lifelong career.. I truly feel you never really become a \"master\" by nature of the industry, you stop for 1-2 years. You're behind the times.. Some people do not like the pace.\n6. (Rob Cooper) Some geeks can be hard to work with.. While I think the general geek movement is really changing for the better, you will always have the classic \"I am more intelligent than you\" geeks that can really just be a pain in the ass for all!\n7. (Saj) Can cause virtual damage.\n8. (Saj) Can make one throw their computer away.\n9. (Saj) Can make one only virtually available to the world.\n\n\n","answer_pids":["stackoverflow_Passage_3647","stackoverflow_Passage_3649","stackoverflow_Passage_3650","stackoverflow_Passage_3651","stackoverflow_Passage_3661","stackoverflow_Passage_3820","stackoverflow_Passage_3826","stackoverflow_Passage_3829","stackoverflow_Passage_8289"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_365","query":"Can you access the windows registry from Adobe Air? | (y\/N)\n\n\nEdit: Read-only access is fine.\n\n\n","answer_pids":["stackoverflow_Passage_1494","stackoverflow_Passage_1497","stackoverflow_Passage_1585","stackoverflow_Passage_1591","stackoverflow_Passage_5559","stackoverflow_Passage_12317","stackoverflow_Passage_85695","stackoverflow_Passage_378517"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1560","query":"How to redirect siteA to siteB with A or CNAME records | I have 2 hosts and I would like to point a subdomain on host one to a subdomain on host two:\n\n\n\n```\nsubdomain.hostone.com --> subdomain.hosttwo.com\n\n```\n\nI added a CNAME record to host one that points to subdomain.hosttwo.com but all I get is a '**400 Bad Request**' Error.\n\n\nCan anyone see what I'm doing wrong?\n\n\n","answer_pids":["stackoverflow_Passage_5786","stackoverflow_Passage_5788","stackoverflow_Passage_5789","stackoverflow_Passage_5795","stackoverflow_Passage_5796","stackoverflow_Passage_5950","stackoverflow_Passage_9061","stackoverflow_Passage_33039"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1025","query":"Best way to store a database password in a startup script \/ config file? | So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time.\n\n\nWhat's the best way to store the name\/password for these applications, in terms of\n\n\n* security, e.g. perhaps we don't want sysadmins to know the database password\n* maintainability, e.g. making the configuration easy to change when the password changes, etc.\n\n\nboth windows and linux solutions appreciated!\n\n\n","answer_pids":["stackoverflow_Passage_3587","stackoverflow_Passage_3589","stackoverflow_Passage_3597","stackoverflow_Passage_3598","stackoverflow_Passage_3604","stackoverflow_Passage_3622","stackoverflow_Passage_8279","stackoverflow_Passage_13387"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_539","query":"Telligent's Community Server | The company I work for is wanting to add blog functionality to our website and they were looking to spend an awful amount of money to have some crap being built on top of a CMS they purchased (sitecore). I pointed them to Telligent's Community Server and we had a sales like meeting today to get the Marketing folks on board. \nMy question is if anyone has had issues working with Community Server, skinning it and extending it? \n\nI wanted to explain a bit why I am thinking Community Server, the company is wanting multiple blogs with multiple authors. I want to be out of the admin part of this as much as possible and didn't think there were too many engines that having multiple blogs didn't mean db work. I also like the other functionality that Community Server provides and think the company will find it useful, particularly the media section as right now we have some really shotty way of dealing with whitepapers and stuff.\n\n\nedit: We are actually using the Sitecore blog module for a single blog on our intranet (which is actually what the CMS is serving). Some reasoning for why I don't like it for our public site are they are on different servers, it doesn't support multiple authors, there is no built in syndication, it is a little flimsy feeling to me from looking at the source and I personally think the other features of Community Server make its price tag worth it.\n\n\nanother edit: Need to stick to .net software that run on sql server in my company's case, but I don't mind seeing recommendations for others. ExpressionEngine looks promising, will try it out on my personal box.\n\n\n","answer_pids":["stackoverflow_Passage_1661","stackoverflow_Passage_1662","stackoverflow_Passage_1670","stackoverflow_Passage_1676","stackoverflow_Passage_5461","stackoverflow_Passage_8684","stackoverflow_Passage_10381","stackoverflow_Passage_11238","stackoverflow_Passage_11530"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1473","query":"Which scripting language to support in an existing codebase? | I'm looking at adding scripting functionality to an existing codebase and am weighing up the pros\/cons of various packages. Lua is probably the most obvious choice, but I was wondering if people have any other suggestions based on their experience.\n\n\nScripts will be triggered upon certain events and may stay resident for a period of time. For example upon startup a script may define several options which the program presents to the user as a number of buttons. Upon selecting one of these buttons the program will notify the script where further events may occur.\n\n\nThese are the only real requirements;\n\n\n1. Must be a cross-platform library that is compilable from source\n2. Scripts must be able to call registered code-side functions\n3. Code must be able to call script-side functions\n4. Be used within a C\/C++ codebase.\n\n\n","answer_pids":["stackoverflow_Passage_5432","stackoverflow_Passage_5435","stackoverflow_Passage_5475","stackoverflow_Passage_5476","stackoverflow_Passage_5548","stackoverflow_Passage_5553","stackoverflow_Passage_7682","stackoverflow_Passage_8967","stackoverflow_Passage_10388","stackoverflow_Passage_10687"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1793","query":"How to display \"12 minutes ago\" etc in a PHP webpage? | Can anyone tell me how I can display a status message like \"12 seconds ago\" or \"5 minutes ago\" etc in a web page?\n\n\n","answer_pids":["stackoverflow_Passage_6773","stackoverflow_Passage_9307","stackoverflow_Passage_307607","stackoverflow_Passage_460552"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1478","query":"SQL Server 2008 vs 2005 Linq integration | Linq To SQL or Entity framework both integrate nicely with SQL Server 2005.\n\n\nThe SQL Server 2008 spec sheet promises even better integration - but I can't see it.\n\n\nWhat are some examples of what you can do Linq-wise when talking to a 2008 server that you can't when talking to SQL Server 2005?\n\n\n","answer_pids":["stackoverflow_Passage_5466","stackoverflow_Passage_5472","stackoverflow_Passage_10820","stackoverflow_Passage_10821","stackoverflow_Passage_17019"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_6","query":"Filling a DataSet or a DataTable from a LINQ query result set | How do you expose a LINQ query as an ASMX web service?\n \n\nUsually, from the business tier, I can return a typed `DataSet` or a `DataTable` which can be serialized for transport over ASMX.\n\n\nHow can I do the same for a LINQ query? \n\nIs there a way to populate a typed `DataSet` or a `DataTable` via a LINQ query?\n\n\n\n```\npublic static MyDataTable CallMySproc()\n{\n string conn = \"...\";\n\n MyDatabaseDataContext db = new MyDatabaseDataContext(conn);\n MyDataTable dt = new MyDataTable();\n\n \/\/ execute a sproc via LINQ\n var query = from dr\n in db.MySproc().AsEnumerable\n select dr;\n\n \/\/ copy LINQ query resultset into a DataTable -this does not work ! \n dt = query.CopyToDataTable();\n \n return dt;\n}\n\n```\n\nHow could I put the result set of a LINQ query into a `DataSet` or a `DataTable`?\n \n\nAlternatively, can the LINQ query be serializable so that I can expose it as an ASMX web service?\n\n\n","answer_pids":["stackoverflow_Passage_29","stackoverflow_Passage_1777","stackoverflow_Passage_4244","stackoverflow_Passage_4250","stackoverflow_Passage_8540","stackoverflow_Passage_11870","stackoverflow_Passage_974167","stackoverflow_Passage_1016556"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_929","query":"WPF: How to style or disable the default ContextMenu of a TextBox | Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background.\n\n\nI know this works well:\n\n\n\n```\n<Page xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\n\n xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\">\n\n <TextBox ContextMenu=\"{x:Null}\"\/>\n\n<\/Page>\n\n```\n\nBut this doesn't work:\n\n\n\n```\n<Page xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\n xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\">\n\n<Page.Resources>\n\n <Style x:Key=\"{x:Type TextBox}\" TargetType=\"{x:Type TextBox}\">\n <Setter Property=\"ContextMenu\" Value=\"{x:Null}\"\/>\n<\/Style>\n<\/Page.Resources>\n\n <TextBox\/>\n<\/Page> \n\n```\n\nDoes anyone know how to style or disable the default ContextMenu for all TextBoxes in WPF?\n\n\n","answer_pids":["stackoverflow_Passage_3271","stackoverflow_Passage_3276","stackoverflow_Passage_3286","stackoverflow_Passage_13209","stackoverflow_Passage_13566","stackoverflow_Passage_36295","stackoverflow_Passage_1016465"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_323","query":"What are the best practices for using Extension Methods in .Net? | I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a [point](http:\/\/blog.gadodia.net\/extension-methods-in-vbnet-and-c\/)).\n\n\nSo, what do you think are the best practices for employing Extension Methods?\n\n\nShould development teams create a library of extension methods and deploy them across various projects?\n\n\nShould there be a collection of common extension methods in the form of an open source project?\n\n\n*Update: have decided to create an organization wide extension methods library*\n\n\n","answer_pids":["stackoverflow_Passage_949","stackoverflow_Passage_951","stackoverflow_Passage_1409","stackoverflow_Passage_1755","stackoverflow_Passage_4564","stackoverflow_Passage_337869"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_890","query":"How print Flex components in FireFox3? | Thanks to FireFox's buggy implementation of ActiveX components (it really should take an image of them when printing) Flex components (in our case charts) don't print in FX.\n\n\nThey print fine in IE7, even IE6.\n\n\nWe need these charts to print, but they also have dynamic content. I don't really want to draw them again as images when the user prints - the Flex component should do it.\n\n\nWe've found a [potential workaround](http:\/\/www.anychart.com\/blog\/2007\/09\/23\/solving-problem-with-printing-flash-content-in-firefox-browser\/), but unfortunately it doesn't work in FireFox3 (in FireFox2 it sort-of works, but not well enough).\n\n\nAnyone know a workaround?\n\n\n","answer_pids":["stackoverflow_Passage_5813","stackoverflow_Passage_8217","stackoverflow_Passage_9068"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_601","query":"How do you handle huge if-conditions? | It's something that's bugged me in every language I've used, I have an if statement but the conditional part has so many checks that I have to split it over multiple lines, use a nested if statement or just accept that it's ugly and move on with my life.\n\n\nAre there any other methods that you've found that might be of use to me and anybody else that's hit the same problem?\n\n\nExample, all on one line:\n\n\n\n```\nif (var1 = true && var2 = true && var2 = true && var3 = true && var4 = true && var5 = true && var6 = true)\n{\n\n```\n\nExample, multi-line:\n\n\n\n```\nif (var1 = true && var2 = true && var2 = true\n && var3 = true && var4 = true && var5 = true\n && var6 = true)\n{\n\n```\n\nExample-nested:\n\n\n\n```\nif (var1 = true && var2 = true && var2 = true && var3 = true)\n{\n if (var4 = true && var5 = true && var6 = true)\n {\n\n```\n\n","answer_pids":["stackoverflow_Passage_1893","stackoverflow_Passage_1894","stackoverflow_Passage_1895","stackoverflow_Passage_1896","stackoverflow_Passage_1898","stackoverflow_Passage_1900","stackoverflow_Passage_1903","stackoverflow_Passage_1905","stackoverflow_Passage_1907","stackoverflow_Passage_1908","stackoverflow_Passage_1909","stackoverflow_Passage_1912","stackoverflow_Passage_1918","stackoverflow_Passage_1924","stackoverflow_Passage_1928","stackoverflow_Passage_4908","stackoverflow_Passage_4918","stackoverflow_Passage_4946","stackoverflow_Passage_6134","stackoverflow_Passage_11058","stackoverflow_Passage_13336","stackoverflow_Passage_860781"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1997","query":"Find broken symlinks with Python | If I call `os.stat()` on a broken `symlink`, python throws an `OSError` exception. This makes it useful for finding them. However, there are a few other reasons that `os.stat()` might throw a similar exception. Is there a more precise way of detecting broken `symlinks` with Python under Linux?\n\n\n","answer_pids":["stackoverflow_Passage_7608","stackoverflow_Passage_7610","stackoverflow_Passage_7612","stackoverflow_Passage_7615","stackoverflow_Passage_8148","stackoverflow_Passage_9771","stackoverflow_Passage_613759","stackoverflow_Passage_794088"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1954","query":"JavaScript Profiler in IE | Does anyone know a tool for Profiling JavaScript in IE?\n\n\nList available:\n\n\n* [IE8](http:\/\/blogs.msdn.com\/ie\/archive\/2008\/09\/11\/introducing-the-ie8-developer-tools-jscript-profiler.aspx) (Internet Explorer 8 only)\n* [JavaScript Profiler](http:\/\/www.whitefrost.com\/documents\/html\/technical\/dhtml\/jsprof.html)\n* [YUI!](http:\/\/developer.yahoo.com\/yui\/profiler\/)\n\n\n","answer_pids":["stackoverflow_Passage_7424","stackoverflow_Passage_7426","stackoverflow_Passage_7725","stackoverflow_Passage_8038","stackoverflow_Passage_8527","stackoverflow_Passage_13157","stackoverflow_Passage_13279"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1312","query":"How can I permanently enable line numbers in IntelliJ? | How can I permanently enable line numbers in IntelliJ IDEA?\n\n\n","answer_pids":["stackoverflow_Passage_12292","stackoverflow_Passage_105200","stackoverflow_Passage_128639","stackoverflow_Passage_137656","stackoverflow_Passage_310147","stackoverflow_Passage_347472","stackoverflow_Passage_373253","stackoverflow_Passage_531955","stackoverflow_Passage_538338","stackoverflow_Passage_541213","stackoverflow_Passage_564568","stackoverflow_Passage_583534","stackoverflow_Passage_619161","stackoverflow_Passage_645497","stackoverflow_Passage_684956","stackoverflow_Passage_686218","stackoverflow_Passage_698046","stackoverflow_Passage_736451","stackoverflow_Passage_980460","stackoverflow_Passage_1016606","stackoverflow_Passage_1016696"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1574","query":"String output: format or concat in C#? | Let's say that you want to output or concat strings. Which of the following styles do you prefer?\n\n\n* `var p = new { FirstName = \"Bill\", LastName = \"Gates\" };`\n* `Console.WriteLine(\"{0} {1}\", p.FirstName, p.LastName);`\n* `Console.WriteLine(p.FirstName + \" \" + p.LastName);`\n\n\nDo you rather use format or do you simply concat strings? What is your favorite? Is one of these hurting your eyes?\n\n\nDo you have any rational arguments to use one and not the other?\n\n\nI'd go for the second one.\n\n\n","answer_pids":["stackoverflow_Passage_5841","stackoverflow_Passage_5842","stackoverflow_Passage_5843","stackoverflow_Passage_5844","stackoverflow_Passage_5848","stackoverflow_Passage_5850","stackoverflow_Passage_5853","stackoverflow_Passage_5855","stackoverflow_Passage_5857","stackoverflow_Passage_5863","stackoverflow_Passage_5868","stackoverflow_Passage_6012","stackoverflow_Passage_6357","stackoverflow_Passage_6360","stackoverflow_Passage_6513","stackoverflow_Passage_6632","stackoverflow_Passage_6651","stackoverflow_Passage_6686","stackoverflow_Passage_7951","stackoverflow_Passage_7954","stackoverflow_Passage_9269","stackoverflow_Passage_10590","stackoverflow_Passage_10591","stackoverflow_Passage_10592","stackoverflow_Passage_12221","stackoverflow_Passage_12336","stackoverflow_Passage_12452","stackoverflow_Passage_12896","stackoverflow_Passage_245146","stackoverflow_Passage_599450","stackoverflow_Passage_629738","stackoverflow_Passage_631059"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1897","query":"PHP with SQL Server 2005+ | Currently we have a hybrid ASP\/PHP setup connecting to a SQL Server 2005 database. But all the query work is done on the client side, I'd like to move some of this to PHP. \n\n\nWhat driver and\/or connection string is needed to connect to Sql Svr and what is the syntax to use in PHP?\n\n\n\n\n---\n\n\nUpdate: OK so I was definitely trying to avoid using anything to do with copying DLLs etc. I'll look into the [SQL2K5PHP](http:\/\/www.codeplex.com\/SQL2K5PHP) driver (thanks Vincent). @jcarrascal for the sake of clarity, by \"client side\" I mean our application is an internal web app that runs as an [HTA](http:\/\/msdn.microsoft.com\/en-us\/library\/ms536471.aspx), with all queries done via javascript calls to an ASP which actually submits the DB request.\n\n\n","answer_pids":["stackoverflow_Passage_7213","stackoverflow_Passage_7215","stackoverflow_Passage_7440","stackoverflow_Passage_9501"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1537","query":"How do I convert a file path to a URL in ASP.NET | Basically I have some code to check a specific directory to see if an image is there and if so I want to assign a URL to the image to an ImageControl.\n\n\n\n```\nif (System.IO.Directory.Exists(photosLocation))\n{\n string[] files = System.IO.Directory.GetFiles(photosLocation, \"*.jpg\");\n if (files.Length > 0)\n {\n \/\/ TODO: return the url of the first file found;\n }\n}\n\n```\n\n","answer_pids":["stackoverflow_Passage_5677","stackoverflow_Passage_5678","stackoverflow_Passage_5681","stackoverflow_Passage_5682","stackoverflow_Passage_5747","stackoverflow_Passage_9033","stackoverflow_Passage_95571","stackoverflow_Passage_145448","stackoverflow_Passage_235017","stackoverflow_Passage_239624","stackoverflow_Passage_247305"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1099","query":"What are the list of Resharper like plugins for VS I should consider? | My license for Whole Tomatoes Visual AssistX is about to expire and I'm not really planning on renewing it. I use it for spell checking but that's about it. The refactoring abilities have been a little disappointing. Before I just jump into Resharper though what are your thoughts on other possible plugins?\n\n\n","answer_pids":["stackoverflow_Passage_3879","stackoverflow_Passage_3882","stackoverflow_Passage_3899","stackoverflow_Passage_3925","stackoverflow_Passage_8387","stackoverflow_Passage_8568","stackoverflow_Passage_11745"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1396","query":"Editing User Profile w\/ Forms Authentication | We're using Forms Authentication in SharePoint. When the account is created, the administrator can add some information, like name and address. But the required fields are username and email address.\n\n\nWhen a user goes to their profile page, all the fields are blank and they are unable to edit them. I have read a number of articles discussing how to import profiles from another data store, or to sync profiles. This doesn't work for us, because we don't have another data store where these profiles are stored. \n\n\nWill I just have to recreate the edit profile page and build a custom profile editor? Is this information exposed via SharePoint API? I don't think directly editing the database is a good solution.\n\n\n","answer_pids":["stackoverflow_Passage_5137","stackoverflow_Passage_8869"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_234","query":"Tracking state using ASP.NET AJAX \/ ICallbackEventHandler | I have a problem with maintaining state in an ASP.NET AJAX page. Short version: I need some way to update the page ViewState after an async callback has been made, to reflect any state changes the server made during the async call. \n\n\nThis seems to be a common problem, but I will describe my scenario to help explain:\n\n\nI have a grid-like control which has some JavaScript enhancements - namely, the ability to drag and drop columns and rows. When a column or row is dropped into a new position, an AJAX method is invoked to notify the control server-side and fire a corresponding server-side event (\"OnColumnMoved\" or \"OnRowMoved\").\n\n\nASP.NET AJAX calls, by default, send the entire page as the request. That way the page goes through a complete lifecycle, viewstate is persisted and the state of the control is restored before the RaiseCallbackEvent method is invoked.\n\n\nHowever, since the AJAX call does not update the page, the ViewState reflects the *original* state of the control, even after the column or row has been moved. So the second time a client-side action occurs, the AJAX request goes to the server and the page & control are built back up again to reflect the *first* state of the control, not the state after the first column or row was moved.\n\n\nThis problem extends to many implications. For example if we have a client-side\/AJAX action to add a new item to the grid, and then a row is dragged, the grid is built server-side with one less item than on the client-side.\n\n\nAnd finally & most seriously for my specific example, the actual data source object we are acting upon is stored in the page ViewState. That was a design decision to allow keeping a stateful copy of the manipulated data which can either be committed to DB after many manipulations or discarded if the user backs out. That is very difficult to change.\n\n\nSo, again, I need a way for the page ViewState to be updated on callback after the AJAX method is fired.\n\n\n","answer_pids":["stackoverflow_Passage_645","stackoverflow_Passage_653","stackoverflow_Passage_1486","stackoverflow_Passage_1712","stackoverflow_Passage_1720","stackoverflow_Passage_4909"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1476","query":"What's the best UML diagramming tool? | I'm trying to choose a tool for creating UML diagrams of all flavours. Usability is a major criteria for me, but I'd still take more power with a steeper learning curve and be happy. Free (as in beer) would be nice, but I'd be willing to pay if the tool's worth it. What should I be using?\n\n\n","answer_pids":["stackoverflow_Passage_5440","stackoverflow_Passage_5450","stackoverflow_Passage_5455","stackoverflow_Passage_5465","stackoverflow_Passage_5477","stackoverflow_Passage_7640","stackoverflow_Passage_7644","stackoverflow_Passage_7981","stackoverflow_Passage_7984","stackoverflow_Passage_7985","stackoverflow_Passage_8215","stackoverflow_Passage_8216","stackoverflow_Passage_9813","stackoverflow_Passage_9819","stackoverflow_Passage_9823","stackoverflow_Passage_9826","stackoverflow_Passage_10762","stackoverflow_Passage_10891","stackoverflow_Passage_11123","stackoverflow_Passage_11163","stackoverflow_Passage_11502","stackoverflow_Passage_11663","stackoverflow_Passage_11715","stackoverflow_Passage_11788","stackoverflow_Passage_12226","stackoverflow_Passage_12266","stackoverflow_Passage_12391","stackoverflow_Passage_12913","stackoverflow_Passage_13096","stackoverflow_Passage_13112","stackoverflow_Passage_13114","stackoverflow_Passage_13184","stackoverflow_Passage_13185","stackoverflow_Passage_13199","stackoverflow_Passage_13221","stackoverflow_Passage_13347","stackoverflow_Passage_13447","stackoverflow_Passage_13485","stackoverflow_Passage_13486","stackoverflow_Passage_13493","stackoverflow_Passage_23683","stackoverflow_Passage_34581","stackoverflow_Passage_35054","stackoverflow_Passage_35069","stackoverflow_Passage_42409","stackoverflow_Passage_46057","stackoverflow_Passage_58736","stackoverflow_Passage_58747","stackoverflow_Passage_67397","stackoverflow_Passage_96636","stackoverflow_Passage_163330"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1824","query":"How to check set of files conform to a naming scheme | I have a bunch of files (TV episodes, although that is fairly arbitrary) that I want to check match a specific naming\/organisation scheme..\n\n\nCurrently: I have three arrays of regex, one for valid filenames, one for files missing an episode name, and one for valid paths.\n\n\nThen, I loop though each valid-filename regex, if it matches, append it to a \"valid\" dict, if not, do the same with the missing-ep-name regexs, if it matches this I append it to an \"invalid\" dict with an error code (2:'missing epsiode name'), if it matches neither, it gets added to invalid with the 'malformed name' error code.\n\n\nThe current code can be found [here](http:\/\/github.com\/dbr\/checktveps\/tree\/8a6dc68ad61e684c8d8f0ca1dc37a22d1c51aa82\/2checkTvEps.py)\n\n\nI want to add a rule that checks for the presence of a folder.jpg file in each directory, but to add this would make the code substantially more messy in it's current state.. \n\n\nHow could I write this system in a more expandable way?\n\n\nThe rules it needs to check would be..\n\n\n* File is in the format `Show Name - [01x23] - Episode Name.avi` or `Show Name - [01xSpecial02] - Special Name.avi` or `Show Name - [01xExtra01] - Extra Name.avi`\n* If filename is in the format `Show Name - [01x23].avi` display it a 'missing episode name' section of the output\n* The path should be in the format `Show Name\/season 2\/the_file.avi` (where season 2 should be the correct season number in the filename)\n* each `Show Name\/season 1\/` folder should contain \"folder.jpg\"\n\n\n.any ideas? While I'm trying to check TV episodes, this concept\/code should be able to apply to many things..\n\n\nThe only thought I had was a list of dicts in the format:\n\n\n\n```\nchecker = [\n{\n 'name':'valid files',\n 'type':'file',\n 'function':check_valid(), # runs check_valid() on all files\n 'status':0 # if it returns True, this is the status the file gets\n}\n\n```\n\n","answer_pids":["stackoverflow_Passage_7055","stackoverflow_Passage_7678","stackoverflow_Passage_9574"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_23","query":"Is gettimeofday() guaranteed to be of microsecond resolution? | I am porting a game, that was originally written for the Win32 API, to Linux (well, porting the OS X port of the Win32 port to Linux).\n\n\nI have implemented `QueryPerformanceCounter` by giving the uSeconds since the process start up: \n\n\n\n```\nBOOL QueryPerformanceCounter(LARGE_INTEGER* performanceCount)\n{\n gettimeofday(¤tTimeVal, NULL);\n performanceCount->QuadPart = (currentTimeVal.tv_sec - startTimeVal.tv_sec);\n performanceCount->QuadPart *= (1000 * 1000);\n performanceCount->QuadPart += (currentTimeVal.tv_usec - startTimeVal.tv_usec);\n\n return true;\n}\n\n```\n\nThis, coupled with `QueryPerformanceFrequency()` giving a constant 1000000 as the frequency, works well **on my machine**, giving me a 64-bit variable that contains `uSeconds` since the program's start-up.\n\n\nSo *is this portable?* I don't want to discover it works differently if the kernel was compiled in a certain way or anything like that. I am fine with it being non-portable to something other than Linux, however.\n\n\n","answer_pids":["stackoverflow_Passage_34","stackoverflow_Passage_35","stackoverflow_Passage_36","stackoverflow_Passage_98","stackoverflow_Passage_115","stackoverflow_Passage_138","stackoverflow_Passage_263","stackoverflow_Passage_360","stackoverflow_Passage_5197","stackoverflow_Passage_5202","stackoverflow_Passage_196709"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1762","query":"TCL development: debug environment | I like a bit of TiVo hacking in spare time - TiVo uses a Linux variant and [TCL](http:\/\/wiki.tcl.tk\/299). I'd like to write TCL scripts on my Windows laptop, test them and then FTP them over to my TiVo.\n\n\nCan I have a recommendation for a TCL debugging environment for Windows, please?\n\n\n","answer_pids":["stackoverflow_Passage_7938","stackoverflow_Passage_10156","stackoverflow_Passage_11683","stackoverflow_Passage_11755","stackoverflow_Passage_13033","stackoverflow_Passage_104398","stackoverflow_Passage_111744"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1133","query":"Singletons: good design or a crutch? | Singletons are a hotly debated design pattern, so I am interested in what the Stack Overflow community thought about them.\n\n\nPlease provide reasons for your opinions, not just \"Singletons are for lazy programmers!\"\n\n\nHere is a fairly good article on the issue, although it is against the use of Singletons:\n[scientificninja.com: performant-singletons](http:\/\/web.archive.org\/web\/20090303174418\/http:\/\/scientificninja.com\/advice\/performant-singletons).\n\n\nDoes anyone have any other good articles on them? Maybe in support of Singletons?\n\n\n","answer_pids":["stackoverflow_Passage_3996","stackoverflow_Passage_4010","stackoverflow_Passage_4017","stackoverflow_Passage_4024","stackoverflow_Passage_4026","stackoverflow_Passage_4028","stackoverflow_Passage_4036","stackoverflow_Passage_4063","stackoverflow_Passage_7939","stackoverflow_Passage_8315","stackoverflow_Passage_8423","stackoverflow_Passage_9835","stackoverflow_Passage_9839","stackoverflow_Passage_9841","stackoverflow_Passage_9946","stackoverflow_Passage_10317","stackoverflow_Passage_10587","stackoverflow_Passage_11897","stackoverflow_Passage_11898","stackoverflow_Passage_11899","stackoverflow_Passage_11909","stackoverflow_Passage_12671","stackoverflow_Passage_12787"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_514","query":"SQL Server Management Studio alternatives to browse\/edit tables and run queries | I was wondering if there are any alternatives to Microsoft's SQL Server Management Studio?\n\n\nNot there's anything wrong with SSMS, but sometimes it just seem too big an application where all I want todo is browse\/edit tables and run queries.\n\n\n","answer_pids":["stackoverflow_Passage_1570","stackoverflow_Passage_1578","stackoverflow_Passage_1594","stackoverflow_Passage_1669","stackoverflow_Passage_5269","stackoverflow_Passage_11575","stackoverflow_Passage_11576","stackoverflow_Passage_11577","stackoverflow_Passage_13130","stackoverflow_Passage_53108","stackoverflow_Passage_114586","stackoverflow_Passage_159691","stackoverflow_Passage_187699"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1083","query":"Passing more parameters in C function pointers | Let's say I'm creating a chess program. I have a function\n\n\n\n```\nvoid foreachMove( void (*action)(chess_move*), chess_game* game); \n\n```\n\nwhich will call the function pointer action on each valid move. This is all well and good, but what if I need to pass more parameters to the action function? For example:\n\n\n\n```\nchess_move getNextMove(chess_game* game, int depth){\n \/\/for each valid move, determine how good the move is\n foreachMove(moveHandler, game);\n}\n\nvoid moveHandler(chess_move* move){\n \/\/uh oh, now I need the variables \"game\" and \"depth\" from the above function\n}\n\n```\n\nRedefining the function pointer is not the optimal solution. The foreachMove function is versatile and many different places in the code reference it. It doesn't make sense for each one of those references to have to update their function to include parameters that they don't need.\n\n\nHow can I pass extra parameters to a function that I'm calling through a pointer?\n\n\n","answer_pids":["stackoverflow_Passage_3825","stackoverflow_Passage_3833","stackoverflow_Passage_3836","stackoverflow_Passage_3837","stackoverflow_Passage_3856","stackoverflow_Passage_3866","stackoverflow_Passage_3929","stackoverflow_Passage_10006","stackoverflow_Passage_299428"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_958","query":"What do you look for from a User Group? | I'm in the process of starting a User Group in my area related to .NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway.\n\n\nWhat would you, as a member of a user community, look for in order to keep you coming back month to month?\n\n\n","answer_pids":["stackoverflow_Passage_3313","stackoverflow_Passage_3315","stackoverflow_Passage_3323","stackoverflow_Passage_8151"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1220","query":"Best way to custom edit records in ASP.NET? | I'm coming from a Rails background and doing some work on a ASP.NET project (not ASP MVC). Newbie question: what's the easiest way to make a custom editor for a table of records?\n\n\nFor example: I have a bunch of data rows and want to change the \"category\" field on each -- maybe a dropdown, maybe a link, maybe the user types it in.\n\n\nIn Rails, I'd iterate over the rows to build a table, and would have a form for each row. The form would have an input box or dropdown, and submit the data to a controller like \"\/item\/edit\/15?category=foo\" where 15 was the itemID and the new category was \"foo\".\n\n\nI'm new to the ASP.NET model and am not sure of the \"right\" way to do this -- just the simplest way to get back the new data & save it off. Would I make a custom control and append it to each row? Any help appreciated.\n\n\n","answer_pids":["stackoverflow_Passage_4366","stackoverflow_Passage_4367","stackoverflow_Passage_4425","stackoverflow_Passage_8584"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_781","query":"Test Distribution | At my work we are running a group of tests that consist of about 3,000 separate test cases. Previously we were running this entire test suite on one machine, which took about 24-72 hours to complete the entire test run. We now have created our own system for grouping and distributing the tests among about three separate machines and the tests are prioritized so that the core tests get run first for more immediate results and the extra tests run when there is an available machine.\n\n\nI am curious if anyone has found a good way to distribute their tests among several machines to reduce total test time for a complete run and what tools were used to achieve that. I've done some research and it looks like TestNG is [moving in this direction](http:\/\/beust.com\/weblog\/archives\/000362.html), but it looks like it is still under quite a bit of development. \n\n\nWe don't plan on rewriting any of our tests, but as we add new tests and test new products or add-ons I'd like to be able to deal with the fact that we are working with very large numbers of tests. On the other hand, if we can find a tool that would help distribute our Junit `3.x` tests even in a very basic fashion, that *would* be helpful since we wouldn't have to maintain our own tooling to do that.\n\n\n","answer_pids":["stackoverflow_Passage_2612","stackoverflow_Passage_2629","stackoverflow_Passage_3112","stackoverflow_Passage_7785"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_788","query":"Creating Redundancy for a Subversion Repository? | What is the best way to create redundant subversion repositories?\n\n\nI have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the best way to proceed.\n\n\nI am thinking that post-commit scripts could be used to propagate changes, but I am not sure if this is the best way to go, anyone have any input\n\n\n","answer_pids":["stackoverflow_Passage_2647","stackoverflow_Passage_2648","stackoverflow_Passage_3072","stackoverflow_Passage_7811"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_130","query":"Object Oriented Bayesian Spam Filtering? | I was wondering if there is any good and clean object-oriented programming (OOP) implementation of Bayesian filtering for spam and text classification? This is just for learning purposes.\n\n\n","answer_pids":["stackoverflow_Passage_307","stackoverflow_Passage_310","stackoverflow_Passage_320","stackoverflow_Passage_8890","stackoverflow_Passage_9158","stackoverflow_Passage_10389","stackoverflow_Passage_12196"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1221","query":"Load an XmlNodeList into an XmlDocument without looping? | I originally asked this question on [RefactorMyCode](http:\/\/refactormycode.com\/codes\/36-load-xmlnodelist-into-an-xmldocument), but got no responses there... \n\n\nBasically I'm just try to load an `XmlNodeList` into an `XmlDocument` and I was wondering if there's a more efficient method than looping.\n\n\n\n```\nPrivate Function GetPreviousMonthsXml(ByVal months As Integer, ByVal startDate As Date, ByVal xDoc As XmlDocument, ByVal path As String, ByVal nodeName As String) As XmlDocument\n '' build xpath string with list of months to return\n Dim xp As New StringBuilder(\"\/\/\")\n xp.Append(nodeName)\n xp.Append(\"[\")\n For i As Integer = 0 To (months - 1)\n '' get year and month portion of date for datestring\n xp.Append(\"starts-with(@Id, '\")\n xp.Append(startDate.AddMonths(-i).ToString(\"yyyy-MM\"))\n If i < (months - 1) Then\n xp.Append(\"') or \")\n Else\n xp.Append(\"')]\")\n End If\n Next\n\n '' *** This is the block that needs to be refactored ***\n '' import nodelist into an xmldocument\n Dim xnl As XmlNodeList = xDoc.SelectNodes(xp.ToString())\n Dim returnXDoc As New XmlDocument(xDoc.NameTable)\n returnXDoc = xDoc.Clone()\n Dim nodeParents As XmlNodeList = returnXDoc.SelectNodes(path)\n For Each nodeParent As XmlNode In nodeParents\n For Each nodeToDelete As XmlNode In nodeParent.SelectNodes(nodeName)\n nodeParent.RemoveChild(nodeToDelete)\n Next\n Next\n\n For Each node As XmlNode In xnl\n Dim newNode As XmlNode = returnXDoc.ImportNode(node, True)\n returnXDoc.DocumentElement.SelectSingleNode(\"\/\/\" & node.ParentNode.Name & \"[@Id='\" & newNode.Attributes(\"Id\").Value.Split(\"-\")(0) & \"']\").AppendChild(newNode)\n Next\n\n '' *** end ***\n Return returnXDoc\nEnd Function\n\n```\n\n","answer_pids":["stackoverflow_Passage_5775","stackoverflow_Passage_9058"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1982","query":"Linq to SQL - Underlying Column Length | I've been using Linq to SQL for some time now and I find it to be really helpful and easy to use. With other ORM tools I've used in the past, the entity object filled from the database normally has a property indicating the length of the underlying data column in the database. This is helpful in databinding situations where you can set the MaxLength property on a textbox, for example, to limit the length of input entered by the user.\n\n\nI cannot find a way using Linq to SQL to obtain the length of an underlying data column. Does anyone know of a way to do this? Help please.\n\n\n","answer_pids":["stackoverflow_Passage_7557","stackoverflow_Passage_7666","stackoverflow_Passage_9532","stackoverflow_Passage_12668"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1393","query":"How do I avoid using cursors in Sybase (T-SQL)? | Imagine the scene, you're updating some legacy Sybase code and come across a cursor. The stored procedure builds up a result set in a #temporary table which is all ready to be returned except that one of columns isn't terribly human readable, it's an alphanumeric code.\n\n\nWhat we need to do, is figure out the possible distinct values of this code, call another stored procedure to cross reference these discrete values and then update the result set with the newly deciphered values:\n\n\n\n```\ndeclare c_lookup_codes for\nselect distinct lookup_code\nfrom #workinprogress\n\nwhile(1=1)\nbegin\n fetch c_lookup_codes into @lookup_code\n\n if @@sqlstatus<>0\n begin\n break\n end\n\n exec proc_code_xref @lookup_code @xref_code OUTPUT\n\n update #workinprogress\n set xref = @xref_code\n where lookup_code = @lookup_code\nend\n\n```\n\nNow then, whilst this may give some folks palpitations, it does work. My question is, how best would one avoid this kind of thing?\n\n\n\\_NB: for the purposes of this example you can also imagine that the result set is in the region of 500k rows and that there are 100 distinct values of look\\_up\\_code and finally, that it is not possible to have a table with the xref values in as the logic in proc\\_code\\_xref is too arcane.\\_\n\n\n","answer_pids":["stackoverflow_Passage_5134","stackoverflow_Passage_5151","stackoverflow_Passage_8875","stackoverflow_Passage_12365"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1622","query":"VS 2008 - ctrl-tab behavior | As you may know, in `VS 2008` `ctrl`+`tab` brings up a nifty navigator window with a thumbnail of each file. I love it, but there is one tiny thing that is annoying to me about this feature: *the window stays around after releasing the `ctrl` key*. When doing an `alt`+`tab` in windows, you can hit tab to get to the item you want (while still holding down the `alt` key), and then when you find what you want, *lifting up* on the `alt` key selects that item.\n\n\nI wish `VS 2008` would do the same. For me, when I lift off of `ctrl`, the window is still there. I have to hit `enter` to actually select the item. I find this annoying.\n\n\nDoes anyone know how to make `VS 2008` dismiss the window on the *release* of the `ctrl` key?\n\n\n","answer_pids":["stackoverflow_Passage_6083","stackoverflow_Passage_6182","stackoverflow_Passage_9159","stackoverflow_Passage_12800","stackoverflow_Passage_13062","stackoverflow_Passage_25559","stackoverflow_Passage_38526","stackoverflow_Passage_43550","stackoverflow_Passage_45997","stackoverflow_Passage_84632","stackoverflow_Passage_997784"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_327","query":"Absolute path back to web-relative path | If I have managed to locate and verify the existence of a file using Server.MapPath and I now want to send the user directly to that file, what is the **fastest** way to convert that absolute path back into a relative web path?\n\n\n","answer_pids":["stackoverflow_Passage_956","stackoverflow_Passage_969","stackoverflow_Passage_3217","stackoverflow_Passage_55485","stackoverflow_Passage_179521","stackoverflow_Passage_612067","stackoverflow_Passage_1016464"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1285","query":"How do you keep two related, but separate, systems in sync with each other? | My current development project has two aspects to it. First, there is a public website where external users can submit and update information for various purposes. This information is then saved to a local SQL Server at the colo facility.\n\n\nThe second aspect is an internal application which employees use to manage those same records (conceptually) and provide status updates, approvals, etc. This application is hosted within the corporate firewall with its own local SQL Server database.\n\n\nThe two networks are connected by a hardware VPN solution, which is decent, but obviously not the speediest thing in the world.\n\n\nThe two databases are similar, and share many of the same tables, but they are not 100% the same. Many of the tables on both sides are very specific to either the internal or external application.\n\n\nSo the question is: when a user updates their information or submits a record on the public website, how do you transfer that data to the internal application's database so it can be managed by the internal staff? And vice versa... how do you push updates made by the staff back out to the website?\n\n\nIt is worth mentioning that the more \"real time\" these updates occur, the better. Not that it has to be instant, just reasonably quick.\n\n\nSo far, I have thought about using the following types of approaches:\n\n\n1. Bi-directional replication\n2. Web service interfaces on both sides with code to sync the changes as they are made (in real time).\n3. Web service interfaces on both sides with code to asynchronously sync the changes (using a queueing mechanism).\n\n\nAny advice? Has anyone run into this problem before? Did you come up with a solution that worked well for you?\n\n\n","answer_pids":["stackoverflow_Passage_4671","stackoverflow_Passage_4675","stackoverflow_Passage_7154","stackoverflow_Passage_8694","stackoverflow_Passage_8980","stackoverflow_Passage_10180"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_313","query":"What is Inversion of Control? | Inversion of Control (IoC) can be quite confusing when it is first encountered.\n\n\n1. What is it?\n2. Which problem does it solve?\n3. When is it appropriate to use and when not?\n\n\n","answer_pids":["stackoverflow_Passage_917","stackoverflow_Passage_926","stackoverflow_Passage_929","stackoverflow_Passage_944","stackoverflow_Passage_1226","stackoverflow_Passage_3139","stackoverflow_Passage_10438","stackoverflow_Passage_10439","stackoverflow_Passage_10444","stackoverflow_Passage_13051","stackoverflow_Passage_13090","stackoverflow_Passage_13516","stackoverflow_Passage_43387","stackoverflow_Passage_228497","stackoverflow_Passage_281651","stackoverflow_Passage_285457","stackoverflow_Passage_366891","stackoverflow_Passage_366904","stackoverflow_Passage_510070","stackoverflow_Passage_528066","stackoverflow_Passage_585843","stackoverflow_Passage_595736","stackoverflow_Passage_621030","stackoverflow_Passage_660229","stackoverflow_Passage_686233","stackoverflow_Passage_742629","stackoverflow_Passage_832491","stackoverflow_Passage_913305","stackoverflow_Passage_924369","stackoverflow_Passage_937896","stackoverflow_Passage_940228","stackoverflow_Passage_1016493","stackoverflow_Passage_1016505","stackoverflow_Passage_1016526","stackoverflow_Passage_1016534","stackoverflow_Passage_1016578","stackoverflow_Passage_1016582","stackoverflow_Passage_1016649"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_224","query":"How can I unit test Flex applications from within the IDE or a build script? | I'm currently working on an application with a frontend written in Adobe Flex 3. I'm aware of [FlexUnit](http:\/\/code.google.com\/p\/as3flexunitlib\/) but what I'd really like is a unit test runner for Ant\/NAnt and a runner that integrates with the Flex Builder IDE (AKA Eclipse). Does one exist? \n\n\nAlso, are there any other resources on how to do Flex development \"the right way\" besides the [Cairngorm microarchitecture](http:\/\/labs.adobe.com\/wiki\/index.php\/Cairngorm) example?\n\n\n","answer_pids":["stackoverflow_Passage_2820","stackoverflow_Passage_2830","stackoverflow_Passage_3388","stackoverflow_Passage_7893","stackoverflow_Passage_10508"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1763","query":"I would like some tips for debugging WCF Web Service exceptions | I've created a WCF service and when I browse to the endpoint I get the following fault:\n\n\n\n```\n<s:Envelope xmlns:s=\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\">\n <s:Body>\n <s:Fault>\n <faultcode \n xmlns:a=\"http:\/\/schemas.microsoft.com\/ws\/2005\/05\/addressing\/none\">\n a:ActionNotSupported\n <\/faultcode> \n <faultstring xml:lang=\"en-GB\">\n The message with Action '' cannot be processed at the receiver,\n due to a ContractFilter mismatch at the EndpointDispatcher. \n This may be because of either a contract mismatch (mismatched\n Actions between sender and receiver) or a binding\/security\n mismatch between the sender and the receiver. Check that sender\n and receiver have the same contract and the same binding\n (including security requirements, e.g. Message, Transport, None).\n <\/faultstring> \n <\/s:Fault>\n <\/s:Body>\n<\/s:Envelope>\n\n```\n\nI've fixed the problem but didn't enjoy the experience! Does anyone have any tips or tools for debugging problems like this?\n\n\n","answer_pids":["stackoverflow_Passage_6654","stackoverflow_Passage_9272"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_96","query":"Python and MySQL | I can get Python to work with Postgresql but I cannot get it to work with MySQL. The main problem is that on the shared hosting account I have I do not have the ability to install things such as Django or PySQL, I generally fail when installing them on my computer so maybe it's good I can't install on the host.\n\n\nI found [bpgsql](http:\/\/barryp.org\/software\/bpgsql\/) really good because it does not require an install, it's a single file that I can look at, read and then call the functions of. Does anybody know of something like this for MySQL?\n\n\n","answer_pids":["stackoverflow_Passage_216","stackoverflow_Passage_226","stackoverflow_Passage_458","stackoverflow_Passage_1618","stackoverflow_Passage_2655","stackoverflow_Passage_45453","stackoverflow_Passage_653402"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1547","query":"What's the best way to get started with OSGI? | What makes a module\/service\/bit of application functionality a particularly good candidate for an OSGi module? \n\n\nI'm interested in using [OSGi](http:\/\/en.wikipedia.org\/wiki\/OSGi) in my applications. We're a Java shop and we use Spring pretty extensively, so I'm leaning toward using [Spring Dynamic Modules for OSGi(tm) Service Platforms](http:\/\/www.springframework.org\/osgi). I'm looking for a good way to incorporate a little bit of OSGi into an application as a trial. Has anyone here used this or a similar OSGi technology? Are there any pitfalls? \n\n\n@Nicolas - Thanks, I've seen that one. It's a good tutorial, but I'm looking more for ideas on how to do my first \"real\" OSGi bundle, as opposed to a Hello World example.\n\n\n@david - Thanks for the link! Ideally, with a greenfield app, I'd design the whole thing to be dynamic. What I'm looking for right now, though, is to introduce it in a small piece of an existing application. Assuming I can pick any piece of the app, what are some factors to consider that would make that piece better or worse as an OSGi guinea pig?\n\n\n","answer_pids":["stackoverflow_Passage_5829","stackoverflow_Passage_6035","stackoverflow_Passage_6140","stackoverflow_Passage_9123","stackoverflow_Passage_9356","stackoverflow_Passage_10767","stackoverflow_Passage_10816","stackoverflow_Passage_68954","stackoverflow_Passage_340784"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_186","query":"What is the single most influential book every programmer should read? | If you could go back in time and tell yourself to read a specific book at the beginning of your career as a developer, which book would it be?\n\n\nI expect this list to be varied and to cover a wide range of things.\n\n\n**To search:** Use the search box in the upper-right corner. To search the answers of the current question, use `inquestion:this`. For example:\n\n\n\n```\ninquestion:this \"Code Complete\"\n\n```\n\n","answer_pids":["stackoverflow_Passage_489","stackoverflow_Passage_505","stackoverflow_Passage_717","stackoverflow_Passage_2661","stackoverflow_Passage_7632","stackoverflow_Passage_7635","stackoverflow_Passage_7638","stackoverflow_Passage_7642","stackoverflow_Passage_7645","stackoverflow_Passage_7650","stackoverflow_Passage_7652","stackoverflow_Passage_7653","stackoverflow_Passage_7663","stackoverflow_Passage_7664","stackoverflow_Passage_7667","stackoverflow_Passage_7671","stackoverflow_Passage_7672","stackoverflow_Passage_8102","stackoverflow_Passage_8104","stackoverflow_Passage_8309","stackoverflow_Passage_8310","stackoverflow_Passage_8311","stackoverflow_Passage_8317","stackoverflow_Passage_8461","stackoverflow_Passage_8595","stackoverflow_Passage_8629","stackoverflow_Passage_8895","stackoverflow_Passage_8922","stackoverflow_Passage_8978","stackoverflow_Passage_9182","stackoverflow_Passage_9409","stackoverflow_Passage_9438","stackoverflow_Passage_9486","stackoverflow_Passage_9492","stackoverflow_Passage_9623","stackoverflow_Passage_9643","stackoverflow_Passage_9671","stackoverflow_Passage_9701","stackoverflow_Passage_9738","stackoverflow_Passage_9848","stackoverflow_Passage_9870","stackoverflow_Passage_9903","stackoverflow_Passage_9912","stackoverflow_Passage_9970","stackoverflow_Passage_9971","stackoverflow_Passage_9973","stackoverflow_Passage_9974","stackoverflow_Passage_9976","stackoverflow_Passage_9977","stackoverflow_Passage_9978","stackoverflow_Passage_9979","stackoverflow_Passage_9983","stackoverflow_Passage_9984","stackoverflow_Passage_9986","stackoverflow_Passage_9987","stackoverflow_Passage_9989","stackoverflow_Passage_9990","stackoverflow_Passage_9992","stackoverflow_Passage_9995","stackoverflow_Passage_9996","stackoverflow_Passage_9999","stackoverflow_Passage_10003","stackoverflow_Passage_10004","stackoverflow_Passage_10012","stackoverflow_Passage_10014","stackoverflow_Passage_10019","stackoverflow_Passage_10020","stackoverflow_Passage_10022","stackoverflow_Passage_10029","stackoverflow_Passage_10034","stackoverflow_Passage_10035","stackoverflow_Passage_10037","stackoverflow_Passage_10039","stackoverflow_Passage_10042","stackoverflow_Passage_10048","stackoverflow_Passage_10051","stackoverflow_Passage_10052","stackoverflow_Passage_10056","stackoverflow_Passage_10057","stackoverflow_Passage_10058","stackoverflow_Passage_10059","stackoverflow_Passage_10063","stackoverflow_Passage_10064","stackoverflow_Passage_10065","stackoverflow_Passage_10068","stackoverflow_Passage_10070","stackoverflow_Passage_10075","stackoverflow_Passage_10076","stackoverflow_Passage_10082","stackoverflow_Passage_10084","stackoverflow_Passage_10090","stackoverflow_Passage_10100","stackoverflow_Passage_10119","stackoverflow_Passage_10121","stackoverflow_Passage_10127","stackoverflow_Passage_10132","stackoverflow_Passage_10138","stackoverflow_Passage_10139","stackoverflow_Passage_10154","stackoverflow_Passage_10172","stackoverflow_Passage_10173","stackoverflow_Passage_10179","stackoverflow_Passage_10183","stackoverflow_Passage_10194","stackoverflow_Passage_10206","stackoverflow_Passage_10218","stackoverflow_Passage_10219","stackoverflow_Passage_10220","stackoverflow_Passage_10224","stackoverflow_Passage_10228","stackoverflow_Passage_10230","stackoverflow_Passage_10235","stackoverflow_Passage_10237","stackoverflow_Passage_10238","stackoverflow_Passage_10239","stackoverflow_Passage_10241","stackoverflow_Passage_10251","stackoverflow_Passage_10252","stackoverflow_Passage_10255","stackoverflow_Passage_10265","stackoverflow_Passage_10270","stackoverflow_Passage_10306","stackoverflow_Passage_10313","stackoverflow_Passage_10350","stackoverflow_Passage_10359","stackoverflow_Passage_10529","stackoverflow_Passage_10533","stackoverflow_Passage_10541","stackoverflow_Passage_10550","stackoverflow_Passage_10553","stackoverflow_Passage_10618","stackoverflow_Passage_10697","stackoverflow_Passage_10882","stackoverflow_Passage_10964","stackoverflow_Passage_11041","stackoverflow_Passage_11112","stackoverflow_Passage_11113","stackoverflow_Passage_11223","stackoverflow_Passage_11255","stackoverflow_Passage_11306","stackoverflow_Passage_11376","stackoverflow_Passage_11391","stackoverflow_Passage_11419","stackoverflow_Passage_11424","stackoverflow_Passage_11505","stackoverflow_Passage_11538","stackoverflow_Passage_11589","stackoverflow_Passage_11608","stackoverflow_Passage_11610","stackoverflow_Passage_11620","stackoverflow_Passage_11681","stackoverflow_Passage_11682","stackoverflow_Passage_11724","stackoverflow_Passage_11729","stackoverflow_Passage_11730","stackoverflow_Passage_11754","stackoverflow_Passage_11896","stackoverflow_Passage_11954","stackoverflow_Passage_11990","stackoverflow_Passage_11997","stackoverflow_Passage_12027","stackoverflow_Passage_12148","stackoverflow_Passage_12149","stackoverflow_Passage_12150","stackoverflow_Passage_12295","stackoverflow_Passage_12316","stackoverflow_Passage_12334","stackoverflow_Passage_12338","stackoverflow_Passage_12353","stackoverflow_Passage_12428","stackoverflow_Passage_12484","stackoverflow_Passage_12518","stackoverflow_Passage_12519","stackoverflow_Passage_12564","stackoverflow_Passage_12570","stackoverflow_Passage_12609","stackoverflow_Passage_12623","stackoverflow_Passage_12628","stackoverflow_Passage_12697","stackoverflow_Passage_12699","stackoverflow_Passage_12788","stackoverflow_Passage_12828","stackoverflow_Passage_12830","stackoverflow_Passage_12831","stackoverflow_Passage_12870","stackoverflow_Passage_12882","stackoverflow_Passage_12883","stackoverflow_Passage_12911","stackoverflow_Passage_12939","stackoverflow_Passage_12942","stackoverflow_Passage_12976","stackoverflow_Passage_13068","stackoverflow_Passage_13072","stackoverflow_Passage_13077","stackoverflow_Passage_13078","stackoverflow_Passage_13125","stackoverflow_Passage_13126","stackoverflow_Passage_13145","stackoverflow_Passage_13153","stackoverflow_Passage_13322","stackoverflow_Passage_13393","stackoverflow_Passage_13394","stackoverflow_Passage_13529","stackoverflow_Passage_13532","stackoverflow_Passage_13547","stackoverflow_Passage_13556","stackoverflow_Passage_14872","stackoverflow_Passage_25569","stackoverflow_Passage_26968","stackoverflow_Passage_30716","stackoverflow_Passage_31547","stackoverflow_Passage_35028","stackoverflow_Passage_42309","stackoverflow_Passage_42384"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1010","query":"Small modification to an XML document using StAX | I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again.\n\n\nI have intended to use a StAX parser (`javax.xml.stream.XMLStreamReader`) to read in each event, see if it was one I wanted to change, and then pass it straight on to the StAX writer (`javax.xml.stream.XMLStreamReader`) if no changes were required.\n\n\nUnfortunately, that doesn't look to be so simple - The writer has no way to take an event type and a parser object, only methods like `writeAttribute` and `writeStartElement`. Obviously I could write a big switch statement with a case for every possible type of element which can occur in an XML document, and just write it back out again, but it seems like a lot of trouble for something which seems like it should be simple.\n\n\nIs there something I'm missing that makes it easy to write out a very similar XML document to the one you read in with StAX?\n\n\n","answer_pids":["stackoverflow_Passage_3565","stackoverflow_Passage_3580","stackoverflow_Passage_8260","stackoverflow_Passage_13558"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1043","query":"How to set up a DB2 linked server on a 64-bit SQL Server 2005? | I need to create a linked server to a DB2 database on a mainframe. Has anyone done this successfully on a 64-bit version of SQL Server 2005? If so, which provider and settings were used?\n\n\nIt's important that the linked server work whether we are using a Windows authenticated account to login to SQL Server or a SQL Server login. It's also important that both the 4-part name and `OPENQUERY` query methods are functional. We have one set up on a SQL Server 2000 machine that works well, but it uses a provider that's not available for 64-bit SS 2005.\n\n\n","answer_pids":["stackoverflow_Passage_7689","stackoverflow_Passage_7693","stackoverflow_Passage_7780","stackoverflow_Passage_9583"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_283","query":"How should I translate from screen space coordinates to image space coordinates in a WinForms PictureBox? | I have an application that displays an image inside of a Windows Forms `PictureBox` control. The `SizeMode` of the control is set to `Zoom` so that the image contained in the `PictureBox` will be displayed in an aspect-correct way regardless of the dimensions of the `PictureBox`.\n\n\nThis is great for the visual appearance of the application because you can size the window however you want and the image will always be displayed using its best fit. Unfortunately, I also need to handle mouse click events on the picture box and need to be able to translate from screen-space coordinates to image-space coordinates.\n\n\nIt looks like it's easy to translate from screen space to control space, but I don't see any obvious way to translate from control space to image space (i.e. the pixel coordinate in the source image that has been scaled in the picture box).\n\n\nIs there an easy way to do this, or should I just duplicate the scaling math that they're using internally to position the image and do the translation myself?\n\n\n","answer_pids":["stackoverflow_Passage_805","stackoverflow_Passage_915","stackoverflow_Passage_2807"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1879","query":"How to patch on Windows? | Given a (source) patch file, what's the easiest way to apply this patch on the source files under Windows?\n\n\nA GUI tool where I can visually compare the unchanged-changed source lines would be great.\n\n\n","answer_pids":["stackoverflow_Passage_7146","stackoverflow_Passage_7147","stackoverflow_Passage_9407","stackoverflow_Passage_123824","stackoverflow_Passage_572323"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_741","query":"How do I enable MSDTC on SQL Server? | Is this even a valid question? I have a .NET Windows app that is using MSTDC and it is throwing an exception:\n\n\n\n> \n> System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for\n> network access in the security configuration for MSDTC using the Component Services Administrative tool ---> System.Runtime.InteropServices.COMException (0x8004D024): The transaction manager has disabled its support for remote\/network\n> transactions. (Exception from HRESULT: 0x8004D024) at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32\n> propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier,\n> Guid& transactionIdentifier, OletxTransactionIsolationLevel&\n> isolationLevel, ITransactionShim& transactionShim)....\n> \n> \n> \n\n\nI followed [the Kbalertz guide to enable MSDTC](https:\/\/support.microsoft.com\/en-us\/kb\/883960) on the PC on which the app is installed, but the error still occurs. \n\n\nI was wondering if this was a database issue? If so, how can I resolve it?\n\n\n","answer_pids":["stackoverflow_Passage_2446","stackoverflow_Passage_2449","stackoverflow_Passage_2651","stackoverflow_Passage_11776","stackoverflow_Passage_471181","stackoverflow_Passage_536494","stackoverflow_Passage_1016574"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_817","query":"Watch for change in ip address status | Is there a way to watch for changes in the ip-address much the same as it is possible to watch for changes to files using the FileSystemWatcher? I'm connecting to a machine via tcp\/ip but it takes a while until it gives me an ip-address. I would like to dim out the connect button until I have a valid ip-address.\n\n\n","answer_pids":["stackoverflow_Passage_2760","stackoverflow_Passage_7856"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1195","query":"How do you convert the number you get from datepart to the name of the day? | Is there a quick one-liner to call datepart in Sql Server and get back the name of the day instead of just the number?\n\n\n\n```\nselect datepart(dw, getdate());\n\n```\n\nThis will return 1-7, with Sunday being 1. I would like 'Sunday' instead of 1.\n\n\n","answer_pids":["stackoverflow_Passage_4286","stackoverflow_Passage_4287","stackoverflow_Passage_4288","stackoverflow_Passage_4289","stackoverflow_Passage_8556"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1838","query":"Is there a way to check to see if the user is currently idle? | There is some documentation on the internet that shows that Windows changes the behavior of the NotifyIcon.BalloonTipShown command if the user is currently idle and this is [detected by checking for keyboard and mouse events](http:\/\/forums.microsoft.com\/MSDN\/ShowPost.aspx?PostID=343411&SiteID=1). I am currently working on an application that spends most of its time in the system tray, but pop-ups up multiple balloon tips from time to time and I would like to prevent the user from missing any of them if they are currently away from the system. Since any currently displayed balloon tips are destroyed if a new one is displayed, I want to hold off on displaying them if the user is away.\n\n\nAs such, is there any way to check to see if the user is currently idle if the application is minimized to the system tray?\n\n\n","answer_pids":["stackoverflow_Passage_6972","stackoverflow_Passage_6973","stackoverflow_Passage_7263","stackoverflow_Passage_9350"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_877","query":"grep: show lines surrounding each match | How do I `grep` and show the preceding and following 5 lines surrounding each matched line?\n\n\n","answer_pids":["stackoverflow_Passage_2958","stackoverflow_Passage_2959","stackoverflow_Passage_2963","stackoverflow_Passage_2977","stackoverflow_Passage_7964","stackoverflow_Passage_371777","stackoverflow_Passage_945156","stackoverflow_Passage_974132","stackoverflow_Passage_974135","stackoverflow_Passage_1016474","stackoverflow_Passage_1016507","stackoverflow_Passage_1016636","stackoverflow_Passage_1016698"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1197","query":"What do the different brackets in Ruby mean? | In Ruby, what's the difference between `{}` and `[]`?\n\n\n`{}` seems to be used for both code blocks and hashes.\n\n\nAre `[]` only for arrays?\n\n\nThe documention isn't very clear.\n\n\n","answer_pids":["stackoverflow_Passage_4302","stackoverflow_Passage_4315","stackoverflow_Passage_4845","stackoverflow_Passage_8747","stackoverflow_Passage_10229","stackoverflow_Passage_12069","stackoverflow_Passage_12769"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1529","query":"How to insert\/replace XML tag in XmlDocument? | I have a `XmlDocument` in java, created with the `Weblogic XmlDocument` parser.\n\n\nI want to replace the content of a tag in this `XMLDocument` with my own data, or insert the tag if it isn't there.\n\n\n\n```\n<customdata>\n <tag1 \/>\n <tag2>mfkdslmlfkm<\/tag2>\n <location \/>\n <tag3 \/>\n<\/customdata>\n\n```\n\nFor example I want to insert a URL in the location tag:\n\n\n\n```\n<location>http:\/\/something<\/location>\n\n```\n\nbut otherwise leave the XML as is.\n\n\nCurrently I use a `XMLCursor`:\n\n\n\n```\n XmlObject xmlobj = XmlObject.Factory.parse(a.getCustomData(), options);\n XmlCursor xmlcur = xmlobj.newCursor();\n\n while (xmlcur.hasNextToken()) {\n boolean found = false;\n if (xmlcur.isStart() && \"schema-location\".equals(xmlcur.getName().toString())) {\n xmlcur.setTextValue(\"http:\/\/replaced\");\n System.out.println(\"replaced\");\n found = true;\n } else if (xmlcur.isStart() && \"customdata\".equals(xmlcur.getName().toString())) {\n xmlcur.push();\n } else if (xmlcur.isEnddoc()) {\n if (!found) {\n xmlcur.pop();\n xmlcur.toEndToken();\n xmlcur.insertElementWithText(\"schema-location\", \"http:\/\/inserted\");\n System.out.println(\"inserted\");\n }\n\n }\n xmlcur.toNextToken();\n }\n\n```\n\nI tried to find a \"quick\" `xquery` way to do this since the `XmlDocument` has an `execQuery` method, but didn't find it very easy. \n\n\nDo anyone have a better way than this? It seems a bit elaborate.\n\n\n","answer_pids":["stackoverflow_Passage_5654","stackoverflow_Passage_5658","stackoverflow_Passage_5672","stackoverflow_Passage_5816","stackoverflow_Passage_9031"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_538","query":"Accessing a CONST attribute of series of Classes | This is how I wanted to do it which would work in PHP 5.3.0+\n\n\n\n```\n<?php\n class MyClass\n {\n const CONSTANT = 'Const var'; \n }\n\n $classname = 'MyClass';\n echo $classname::CONSTANT; \/\/ As of PHP 5.3.0\n?>\n\n```\n\nBut I'm restricted to using PHP 5.2.6. Can anyone think of a simple way to simulate this behavior without instantiating the class?\n\n\n","answer_pids":["stackoverflow_Passage_1664","stackoverflow_Passage_7142","stackoverflow_Passage_9403"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1103","query":"How can I improve performance when adding InDesign XMLElements via AppleScript? | I have an AppleScript program which creates XML tags and elements within an Adobe InDesign document. The data is in tables, and tagging each cell takes .5 seconds. The entire script takes several hours to complete.\n\n\nI can post the inner loop code, but I'm not sure if SO is supposed to be generic or specific. I'll let the mob decide.\n\n\n[edit]\nThe code builds a list (prior to this loop) which contains one item per row in the table. There is also a list containing one string for each column in the table. For each cell, the program creates an XML element and an XML tag by concatenating the items in the [row]\/[column] positions of the two lists. It also associates the text in that cell to the newly-created element.\n\n\nI'm completely new to AppleScript so some of this code is crudely modified from Adobe's samples. If the code is atrocious I won't be offended.\n\n\nHere's the code:\n\n\n\n```\nrepeat with columnNumber from COL_START to COL_END\n\n select text of cell ((columnNumber as string) & \":\" & (rowNumber as string)) of ThisTable\n\n tell activeDocument\n\n set thisXmlTag to make XML tag with properties {name:item rowNumber of symbolList & \"_\" & item columnNumber of my histLabelList}\n\n tell rootXmlElement\n\n set thisXmlElement to make XML element with properties {markup tag:thisXmlTag}\n\n end tell\n\n set contents of thisXmlElement to (selection as string)\n\n end tell\n\nend repeat\n\n```\n\nEDIT: I've rephrased the question to better reflect the correct answer.\n\n\n","answer_pids":["stackoverflow_Passage_3891","stackoverflow_Passage_3892","stackoverflow_Passage_8263","stackoverflow_Passage_9567","stackoverflow_Passage_11195","stackoverflow_Passage_11728"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1973","query":"How to write stored procedure output directly to a file on an FTP without using local or temp files? | I want to get the results of a stored procedure and place them into a CSV file onto an FTP location.\n\n\nThe catch though is that I cannot create a local\/temporary file that I can then FTP over.\n\n\nThe approach I was taking was to use an SSIS package to create a temporary file and then have a FTP Task within the pack to FTP the file over, but our DBA's do not allow temporary files to be created on any servers.\n\n\n[in reply to Yaakov Ellis](https:\/\/stackoverflow.com\/questions\/20587\/execute-stored-procedure-sql-2005-and-place-results-into-a-csv-file-on-a-ftp-lo#20596)\n-----------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\nI think we will need to convince the DBA's to let me use at least a share on a server that they do not operate, or ask them how they would do it.\n\n\n[in reply to Kev](https:\/\/stackoverflow.com\/questions\/20587\/execute-stored-procedure-sql-2005-and-place-results-into-a-csv-file-on-a-ftp-lo#20689)\n--------------------------------------------------------------------------------------------------------------------------------------------------\n\n\nI like the idea of the CLR integration, but I don't think our DBA's even know what that is *lol* and they would probably not allow it either. But I will probably be able to do this within a Script Task in an SSIS package that can be scheduled.\n\n\n","answer_pids":["stackoverflow_Passage_7504","stackoverflow_Passage_7506","stackoverflow_Passage_7555","stackoverflow_Passage_8878","stackoverflow_Passage_10549","stackoverflow_Passage_93878","stackoverflow_Passage_223698"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1525","query":"Refactoring away labeled loops | After I was convinced that labeled breaks\/continues are a total \"nono\" over [here](https:\/\/stackoverflow.com\/questions\/15481\/java-coding-standard-best-practices-labeled-brakecontinue#15501), I need help to remove the label out of my code.\n\n\nI have a square matrix and a vector that has the same length. The vector has already some values in it an depending on the values in the matrix the vector is changed in the loop.\n\n\nI hope, the code-fragment is basically understandable\u2026 \n\n\n\n```\nvectorLoop:\nfor( int idx = 0; idx < vectorLength; idx++) {\n if( conditionAtVectorPosition( v, idx ) ) continue vectorLoop;\n\n matrixLoop:\n for( rowIdx = 0; rowIdx < n; rowIdx++ ) {\n if( anotherConditionAtVector( v, rowIdx ) ) continue matrixLoop;\n if( conditionAtMatrixRowCol( m, rowIdx, idx ) ) continue vectorLoop;\n }\n setValueInVector( v, idx );\n} \n\n```\n\nPlease convince me, that there is a more readable\/better version without the labels.\n\n\n","answer_pids":["stackoverflow_Passage_5610","stackoverflow_Passage_5615","stackoverflow_Passage_5616","stackoverflow_Passage_5633","stackoverflow_Passage_5634","stackoverflow_Passage_5636","stackoverflow_Passage_5649","stackoverflow_Passage_5663","stackoverflow_Passage_5670","stackoverflow_Passage_5685","stackoverflow_Passage_5887","stackoverflow_Passage_6279","stackoverflow_Passage_9028"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_505","query":"Bigger than a char but smaller than a blob | Char's are great because they are fixed size and thus make for a faster table. They are however limited to 255 characters. I want to hold 500 characters but a blob is variable length and that's not what I want.\n\n\nIs there some way to have a fixed length field of 500 characters in MySQL or am I going to have to use 2 char fields?\n\n\n","answer_pids":["stackoverflow_Passage_1537","stackoverflow_Passage_1554","stackoverflow_Passage_5078","stackoverflow_Passage_9230"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1991","query":"XRef Relationships in dbml | So I have a database schema like this:\n\n\n**Users** \n\n UserId\n\n\n**RoleUserXRef** \n\n RoleUserId \n\n RoleId \n\n UserId \n\n\n\n**Roles** \n\n\n\nWith foreign keys defined between User & RoleUserXRef and RoleUserXRef & Role. Basically, I have a one to many relationship between users and roles.\n\n\nHow would I model this in dbml, such that the generated User class has a list of Roles that the user has assigned to them?\n\n\n","answer_pids":["stackoverflow_Passage_7589","stackoverflow_Passage_9545"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_542","query":"Alternative Hostname for an IIS web site for internal access only | I'm using IIS in Windows 2003 Server for a SharePoint intranet. \nExternal incoming requests will be using the host header `portal.mycompany.com` and be forced to use SSL.\n\n\nI was wondering if there's a way to set up an alternate host header such as \n`http:\/\/internalportal\/` \nwhich only accepts requests from the internal network, but doesn't force the users to use SSL.\n\n\nAny recommendations for how to set this up?\n\n\n","answer_pids":["stackoverflow_Passage_1677","stackoverflow_Passage_1697","stackoverflow_Passage_4275","stackoverflow_Passage_8551"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_292","query":"How to render a control to look like ComboBox with Visual Styles enabled? | I have a control that is modelled on a **ComboBox**. I want to render the control so that the control **border** looks like that of a standard **Windows ComboBox**. Specifically, I have followed the MSDN documentation and all the rendering of the control is correct except for rendering when the control is disabled.\n\n\nJust to be clear, this is for a system with **Visual Styles** enabled. Also, all parts of the control render properly except the border around a disabled control, which does not match the disabled **ComboBox border** colour.\n\n\nI am using the **VisualStyleRenderer** class. MSDN suggests using the `VisualStyleElement.TextBox` element for the **TextBox** part of the **ComboBox** control but a standard disabled **TextBox** and a standard disabled **ComboBox** draw slightly differently (one has a light grey border, the other a light blue border).\n\n\nHow can I get correct rendering of the control in a disabled state?\n\n\n","answer_pids":["stackoverflow_Passage_4583","stackoverflow_Passage_4603"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_939","query":"How to extend project properties page? | Is it possible to add a custom tab to a project properties page in the Visual Studio 2008?\nWhat I want to do is to be able to add a custom tab to properties page for the projects created from default project templates (WPF Application, WPF custom controls library, etc).\n\n\n","answer_pids":["stackoverflow_Passage_7738","stackoverflow_Passage_9604","stackoverflow_Passage_1016653"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1316","query":"SoapException: Root element is missing occurs when .NET web service called from Flex | I have a .net web application that has a Flex application embedded within a page. This flex application calls a .net webservice. I can trace the execution proccess through the debugger and all looks great until I get the response:\n\n\n\n```\n\n\n\nsoap:ReceiverSystem.Web.Services.Protocols.SoapException: Server was unable to process request\n\n. ---> System.Xml.XmlException: Root element is missing.\n\n at System.Xml.XmlTextReaderImpl.Throw(Exception e)\n\n at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)\n\n at System.Xml.XmlTextReaderImpl.ParseDocumentContent()\n\n at System.Xml.XmlTextReaderImpl.Read()\n\n at System.Xml.XmlTextReader.Read()\n\n at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()\n\n at System.Xml.XmlReader.MoveToContent()\n\n at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent()\n\n at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement()\n\n at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()\n\n at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)\n\n at System.Web.Services.Protocols.SoapServerProtocol.Initialize()\n\n at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest\n\n request, HttpResponse response, Boolean& abortProcessing)\n\n --- End of inner exception stack trace ---\n\n\n```\n\nThe call from flex looks good, the execution through the webservice is good, but this is the response I capture via wireshark, what is going on here?\n\n\nI have tried several web methods, from \"Hello World\" to paramatized methods...all comeback with the same response...\n\n\nI thought it may have something to do with encoding with the \"--->\", but I'm unsure how to control what .net renders as the response.\n\n\n","answer_pids":["stackoverflow_Passage_5411","stackoverflow_Passage_10169","stackoverflow_Passage_10771"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1811","query":"SQL 2008 Dialect Support for NHibernate | Is anyone working on or know if there exists a SQL 2k8 Dialect for NHibernate? \n\n\n","answer_pids":["stackoverflow_Passage_6859","stackoverflow_Passage_9325","stackoverflow_Passage_12350"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_810","query":"Lucene exact ordering | I've had this long term issue in not quite understanding how to implement a decent Lucene sort or ranking. Say I have a list of cities and their populations. If someone searches \"new\" or \"london\" I want the list of prefix matches ordered by population, and I have that working with a prefix search and an sort by field reversed, where there is a population field, IE New Mexico, New York; or London, Londonderry.\n\n\nHowever I also always want the exact matching name to be at the top. So in the case of \"London\" the list should show \"London, London, Londonderry\" where the first London is in the UK and the second London is in Connecticut, even if Londonderry has a higher population than London CT.\n\n\nDoes anyone have a single query solution?\n\n\n","answer_pids":["stackoverflow_Passage_2725","stackoverflow_Passage_8842","stackoverflow_Passage_10240","stackoverflow_Passage_12652"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1022","query":"Asynchronous Remoting calls | We have a remoting singleton server running in a separate windows service (let's call her RemotingService). The clients of the RemotingService are ASP.NET instances (many many).\n\n\nCurrently, the clients remoting call RemotingService and blocks while the RemotingService call is serviced. However, the remoting service is getting complicated enough (with more RPC calls and complex algorithms) that the asp.net worker threads are blocked for a significantly long time (4-5 seconds).\n\n\nAccording to [this msdn article](http:\/\/msdn.microsoft.com\/en-us\/magazine\/cc164128.aspx), doing this will not scale well because an asp.net worker thread is blocked for each remoting RPC. It advises switching to async handlers to free up asp.net worker threads.\n\n\n\n> \n> The purpose of an asynchronous handler\n> is to free up an ASP.NET thread pool\n> thread to service additional requests\n> while the handler is processing the\n> original request.\n> \n> \n> \n\n\nThis seems fine, except the remoting call still takes up a thread from the thread pool.\nIs this the same thread pool as the asp.net worker threads? \n\n\n**How should I go about turning my remoting singleton server into an async system such that I free up my asp.net worker threads?**\n\n\nI've probably missed out some important information, please let me know if there is anything else you need to know to answer the question.\n\n\n","answer_pids":["stackoverflow_Passage_3581","stackoverflow_Passage_8261"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1342","query":"Enabling OpenGL in wxWidgets | I installed the wxWidgets source code, compiled it and am linking the libraries thus obtained with my application code. Now I need to use OpenGL in my wxWidgets application. How do I enable this?\n\n\n","answer_pids":["stackoverflow_Passage_4905","stackoverflow_Passage_8778","stackoverflow_Passage_9985","stackoverflow_Passage_10813","stackoverflow_Passage_475737"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_435","query":"Where can I get the Windows Workflow \"wca.exe\" application? | I am walking through the MS Press Windows Workflow Step-by-Step book and in chapter 8 it mentions a tool with the filename \"wca.exe\". This is supposed to be able to generate workflow communication helper classes based on an interface you provide it. I can't find that file. I thought it would be in the latest .NET 3.5 SDK, but I just downloaded and fully installed, and it's not there. Also, some MSDN forum posts had links posted that just go to 404s. So, where can I find wca.exe?\n\n\n","answer_pids":["stackoverflow_Passage_1353","stackoverflow_Passage_1354","stackoverflow_Passage_4426"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_644","query":"Making code work with register_globals turned off | I have inherited some legacy PHP code what was written back when it was standard practice to use [`register_globals`](http:\/\/php.net\/register_globals) (As of PHP 4.2.0, this directive defaults to off, released 22. Apr 2002).\n\n\nWe know now that it is bad for security to have it enabled. The problem is how do I find all the places in the code where I need to use `$_GET` or `$_POST`? My only thought was to set the error reporting to warn about uninitialized variables and then test each part of the site. Is there an easier way? Will I have to test each code path in the site or will PHP give a warning on a file basis?\n\n\n","answer_pids":["stackoverflow_Passage_2081","stackoverflow_Passage_2090","stackoverflow_Passage_2340","stackoverflow_Passage_4782","stackoverflow_Passage_6688"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1470","query":"Is there a method for handling errors from COM objects in RDML? | Is there a method for handling errors from COM objects in RDML? For instance, when calling Word VBA methods like `PasteSpecial`, an error is returned and the LANSA application crashes. I cannot find anything in the documentation to allow handling of these errors.\n\n\nActually, error handling in general is a weak-point for LANSA and RDML, but that's another topic.\n\n\n","answer_pids":["stackoverflow_Passage_11445","stackoverflow_Passage_12850"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1794","query":"GUI Automation testing - Window handle questions | Our company is currently writing a GUI automation testing tool for compact framework applications. We have initially searched many tools but none of them was right for us. \n\n\nBy using the tool you can record test-cases and group them together to test-suites. For every test-suite there is generated an application, which launches the application-under-test and simulates user-input.\n\n\nIn general the tool works fine, but as we are using **window handles** for simulation user input, you can't do very many things. For example it is impossible for us to get the name of a control (we just get the caption). \n\n\nAnother problem using window handles is checking for a change. At the moment we simulate a click on a control and depending on the result we know if the application has gone to the next step.\n\n\nIs there any other (simpler) way for doing such things (for example the message queue or anything else)?\n\n\n","answer_pids":["stackoverflow_Passage_6777","stackoverflow_Passage_6790","stackoverflow_Passage_8098","stackoverflow_Passage_9309","stackoverflow_Passage_11373","stackoverflow_Passage_11375"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1161","query":"What is the worst database accident that happened to you in production? | For example: Updating all rows of the customer table because you forgot to add the where clause.\n\n\n1. What was it like, realizing it and reporting it to your coworkers or customers?\n2. What were the lessons learned?\n\n\n","answer_pids":["stackoverflow_Passage_4130","stackoverflow_Passage_4131","stackoverflow_Passage_4132","stackoverflow_Passage_4134","stackoverflow_Passage_4135","stackoverflow_Passage_4153","stackoverflow_Passage_4156","stackoverflow_Passage_4175","stackoverflow_Passage_4185","stackoverflow_Passage_4226","stackoverflow_Passage_4233","stackoverflow_Passage_4294","stackoverflow_Passage_7718","stackoverflow_Passage_8826","stackoverflow_Passage_10678","stackoverflow_Passage_11452","stackoverflow_Passage_11454","stackoverflow_Passage_11455"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_432","query":"How to include PHP files that require an absolute path? | I have a directory structure like the following;\n\n\n\n> \n> script.php\n> \n> \n> inc\/include1.php \n> \n> inc\/include2.php\n> \n> \n> objects\/object1.php \n> \n> objects\/object2.php\n> \n> \n> soap\/soap.php\n> \n> \n> \n\n\nNow, I use those objects in both `script.php` and `\/soap\/soap.php`, I could move them, but I want the directory structure like that for a specific reason. When executing `script.php` the include path is `inc\/include.php` and when executing `\/soap\/soap.php` it's `..\/inc`, absolute paths work, `\/mnt\/webdev\/[project name]\/inc\/include1.php...` But it's an ugly solution if I ever want to move the directory to a different location.\n\n\nSo is there a way to use relative paths, or a way to programmatically generate the `\"\/mnt\/webdev\/[project name]\/\"`?\n\n\n","answer_pids":["stackoverflow_Passage_1334","stackoverflow_Passage_1337","stackoverflow_Passage_1339","stackoverflow_Passage_1346","stackoverflow_Passage_1572","stackoverflow_Passage_2004","stackoverflow_Passage_4384","stackoverflow_Passage_9617","stackoverflow_Passage_10390","stackoverflow_Passage_151241","stackoverflow_Passage_583281","stackoverflow_Passage_982934"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_135","query":"How do I index a database column | Hopefully, I can get answers for each database server.\n\n\nFor an outline of how indexing works check out: [How does database indexing work?](https:\/\/stackoverflow.com\/questions\/1108\/how-does-database-indexing-work)\n\n\n","answer_pids":["stackoverflow_Passage_325","stackoverflow_Passage_1156","stackoverflow_Passage_3267","stackoverflow_Passage_145134","stackoverflow_Passage_193124","stackoverflow_Passage_603547","stackoverflow_Passage_821384","stackoverflow_Passage_990256","stackoverflow_Passage_991095","stackoverflow_Passage_1016580"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_548","query":"Document or RPC based web services | My gut feel is that document based web services are preferred in practice - is this other peoples experience? Are they easier to support? (I noted that SharePoint uses Any for the \"document type\" in its WSDL interface, I guess that makes it Document based). \n\n\nAlso - are people offering both WSDL and Rest type services now for the same functionality? WSDL is popular for code generation, but for front ends like PHP and Rails they seem to prefer rest.\n\n\n","answer_pids":["stackoverflow_Passage_1879","stackoverflow_Passage_2950","stackoverflow_Passage_6094","stackoverflow_Passage_9301"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_821","query":"Best format for displaying rendered time on a webpage | I've started to add the time taken to render a page to the footer of our internal web applications. Currently it appears like this\n\n\n\n> \n> Rendered in 0.062 seconds\n> \n> \n> \n\n\nOccasionally I get rendered times like this\n\n\n\n> \n> Rendered in 0.000 seconds\n> \n> \n> \n\n\nCurrently it's only meant to be a guide for users to judge whether a page is quick to load or not, allowing them to quickly inform us if a page is taking 17 seconds rather than the usual 0.5. My question is what format should the time be in? At which point should I switch to a statement such as\n\n\n\n> \n> Rendered in less than a second\n> \n> \n> \n\n\nI like seeing the tenths of a second but the second example above is of no use to anyone, in fact it just highlights the limits of the calculation I use to find the render time. I'd rather not let the users see that at all! Any answers welcome, including whether anything should be included on the page.\n\n\n","answer_pids":["stackoverflow_Passage_2773","stackoverflow_Passage_2775","stackoverflow_Passage_2785","stackoverflow_Passage_3614","stackoverflow_Passage_7869"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_646","query":"Preferred way to use favicons? | I was trying to add a favicon to a website earlier and looked for a better way to implement this than to dump a `favicon.ico` file in the root of the website.\n\n\nI found this nice little guide: [How to Add a Favicon](http:\/\/www.w3.org\/2005\/10\/howto-favicon). However, the preferred method did not work in IE (7) and the second method is the old fashioned way (which I resigned myself to use).\n\n\nIs there a third method that works across all the most popular browsers?\n\n\n","answer_pids":["stackoverflow_Passage_2064","stackoverflow_Passage_2065","stackoverflow_Passage_2066","stackoverflow_Passage_2089","stackoverflow_Passage_2188","stackoverflow_Passage_6639","stackoverflow_Passage_1016616"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1648","query":"What are real life applications of yield? | I know what `yield` does, and I've seen a few examples, but I can't think of real life applications, have you used it to solve some specific problem?\n\n\n(Ideally some problem that cannot be solved some other way)\n\n\n","answer_pids":["stackoverflow_Passage_6167","stackoverflow_Passage_6174","stackoverflow_Passage_6186","stackoverflow_Passage_6187","stackoverflow_Passage_6196","stackoverflow_Passage_12829","stackoverflow_Passage_13412","stackoverflow_Passage_395519"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1981","query":"ASP\/VBScript - Int() vs CInt() | What is the difference in ASP\/VBScript between `Int()` and `CInt()`?\n\n\n","answer_pids":["stackoverflow_Passage_7548","stackoverflow_Passage_8039","stackoverflow_Passage_9529","stackoverflow_Passage_11569","stackoverflow_Passage_35252"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1683","query":"Non Public Members for C# Interfaces | In C#, when you implement an interface, all members are implicitly public. Wouldn't it be better if we could specify the accessibility modifier (`protected`, `internal`, except `private` of course), or should we just use an abstract class instead?\n\n\n","answer_pids":["stackoverflow_Passage_6344","stackoverflow_Passage_6345","stackoverflow_Passage_6346","stackoverflow_Passage_6349","stackoverflow_Passage_6353","stackoverflow_Passage_6358","stackoverflow_Passage_11262","stackoverflow_Passage_227697","stackoverflow_Passage_841866"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_469","query":"Learning Regular Expressions | I don't really understand regular expressions. Can you explain them to me in an easy-to-follow manner? If there are any online tools or books, could you also link to them?\n\n\n","answer_pids":["stackoverflow_Passage_13287"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_114","query":"String literals and escape characters in postgresql | Attempting to insert an escape character into a table results in a warning. \n\n\nFor example:\n\n\n\n```\ncreate table EscapeTest (text varchar(50));\n\ninsert into EscapeTest (text) values ('This is the first part \\n And this is the second');\n\n```\n\nProduces the warning:\n\n\n\n```\nWARNING: nonstandard use of escape in a string literal\n\n```\n\n(*Using PSQL 8.2*)\n\n\nAnyone know how to get around this?\n\n\n","answer_pids":["stackoverflow_Passage_264","stackoverflow_Passage_268","stackoverflow_Passage_937","stackoverflow_Passage_9967","stackoverflow_Passage_10495","stackoverflow_Passage_13106"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1589","query":"VS.NET Application Diagrams | Have you used VS.NET Architect Edition's Application and System diagrams to start designing a solution?\n\n\nIf so, did you find it useful?\nDid the \"automatic implementation\" feature work ok?\n\n\n","answer_pids":["stackoverflow_Passage_7417","stackoverflow_Passage_7889","stackoverflow_Passage_8343","stackoverflow_Passage_9684"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1573","query":"Parse usable Street Address, City, State, Zip from a string | Problem: I have an address field from an Access database which has been converted to SQL Server 2005. This field has everything all in one field. I need to parse out the address's individual sections into their appropriate fields in a normalized table. I need to do this for approximately 4,000 records, and it needs to be repeatable.\n\n\nAssumptions:\n\n\n1. Assume an address in the US (for now)\n2. assume that the input string will sometimes contain an addressee (the person being addressed) and\/or a second street address (i.e. Suite B)\n3. states may be abbreviated\n4. zip code could be standard 5 digits or zip+4\n5. there are typos in some instances\n\n\nUPDATE: In response to the questions posed, standards were not universally followed; I need need to store the individual values, not just geocode and errors means typo (corrected above)\n\n\nSample Data:\n\n\n* A. P. Croll & Son 2299 Lewes-Georgetown Hwy, Georgetown, DE 19947\n* 11522 Shawnee Road, Greenwood DE 19950\n* 144 Kings Highway, S.W. Dover, DE 19901\n* Intergrated Const. Services 2 Penns Way Suite 405 New Castle, DE 19720\n* Humes Realty 33 Bridle Ridge Court, Lewes, DE 19958\n* Nichols Excavation 2742 Pulaski Hwy Newark, DE 19711\n* 2284 Bryn Zion Road, Smyrna, DE 19904\n* VEI Dover Crossroads, LLC 1500 Serpentine Road, Suite 100 Baltimore MD 21\n* 580 North Dupont Highway Dover, DE 19901\n* P.O. Box 778 Dover, DE 19903\n\n\n","answer_pids":["stackoverflow_Passage_5836","stackoverflow_Passage_5837","stackoverflow_Passage_5845","stackoverflow_Passage_5846","stackoverflow_Passage_5852","stackoverflow_Passage_5864","stackoverflow_Passage_5866","stackoverflow_Passage_5894","stackoverflow_Passage_5896","stackoverflow_Passage_5917","stackoverflow_Passage_6037","stackoverflow_Passage_6075","stackoverflow_Passage_9077","stackoverflow_Passage_12213","stackoverflow_Passage_13076","stackoverflow_Passage_19094","stackoverflow_Passage_21520","stackoverflow_Passage_44309","stackoverflow_Passage_117229","stackoverflow_Passage_137077","stackoverflow_Passage_232800","stackoverflow_Passage_311958","stackoverflow_Passage_382521","stackoverflow_Passage_514068","stackoverflow_Passage_540351"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1726","query":"How to generate a core dump in Linux on a segmentation fault? | I have a process in Linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails?\n\n\n","answer_pids":["stackoverflow_Passage_6522","stackoverflow_Passage_6570","stackoverflow_Passage_6669","stackoverflow_Passage_9236","stackoverflow_Passage_13048","stackoverflow_Passage_150287","stackoverflow_Passage_236585","stackoverflow_Passage_274857","stackoverflow_Passage_641292","stackoverflow_Passage_706498","stackoverflow_Passage_1015599","stackoverflow_Passage_1016480","stackoverflow_Passage_1016619"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_664","query":"How to wait for thread complete before continuing? | I have some code for starting a thread on the .NET CF 2.0:\n\n\n\n```\nThreadStart tStart = new ThreadStart(MyMethod);\nThread t = new Thread(tStart);\nt.Start();\n\n```\n\nIf I call this inside a loop the items completely out of order. How do introduce a wait after `t.Start()`, so that the work on the thread completes before the code continues? Will BeginInvoke\/EndInvoke be a better option for this than manually creating threads?\n\n\n","answer_pids":["stackoverflow_Passage_2182","stackoverflow_Passage_2243","stackoverflow_Passage_6476","stackoverflow_Passage_7095"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1402","query":"Can a proxy server cache SSL GETs? If not, would response body encryption suffice? | Can a (||any) proxy server cache content that is requested by a client over https? As the proxy server can't see the querystring, or the http headers, I reckon they can't.\n\n\nI'm considering a desktop application, run by a number of people behind their companies proxy. This application may access services across the internet and I'd like to take advantage of the in-built internet caching infrastructure for 'reads'. If the caching proxy servers can't cache SSL delivered content, would simply encrypting the content of a response be a viable option?\n\n\nI am considering all GET requests that we wish to be cachable be requested over http with the body encrypted using asymmetric encryption, where each client has the decryption key. Anytime we wish to perform a GET that is not cachable, or a POST operation, it will be performed over SSL.\n\n\n","answer_pids":["stackoverflow_Passage_5141","stackoverflow_Passage_7879","stackoverflow_Passage_7881","stackoverflow_Passage_8871","stackoverflow_Passage_13354"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_449","query":"What was the <XMP> tag used for? | Does anyone remember the `XMP` tag?\n\n\nWhat was it used for and why was it deprecated?\n\n\n","answer_pids":["stackoverflow_Passage_1380","stackoverflow_Passage_4548","stackoverflow_Passage_56206","stackoverflow_Passage_129745","stackoverflow_Passage_145327","stackoverflow_Passage_197597","stackoverflow_Passage_256158","stackoverflow_Passage_742425","stackoverflow_Passage_901693"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1140","query":"RSS Feeds in ASP.NET MVC | How would you reccommend handling RSS Feeds in ASP.NET MVC? Using a third party library? Using the RSS stuff in the BCL? Just making an RSS view that renders the XML? Or something completely different?\n\n\n","answer_pids":["stackoverflow_Passage_4030","stackoverflow_Passage_4070","stackoverflow_Passage_4746","stackoverflow_Passage_8444","stackoverflow_Passage_11714","stackoverflow_Passage_300764"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1409","query":"UrlEncode through a console application? | Normally I would just use:\n\n\n\n```\nHttpContext.Current.Server.UrlEncode(\"url\");\n\n```\n\nBut since this is a console application, `HttpContext.Current` is always going to be `null`.\n\n\nIs there another method that does the same thing that I could use?\n\n\n","answer_pids":["stackoverflow_Passage_5166","stackoverflow_Passage_5168","stackoverflow_Passage_5171","stackoverflow_Passage_5173","stackoverflow_Passage_5174","stackoverflow_Passage_11630","stackoverflow_Passage_12013","stackoverflow_Passage_25516","stackoverflow_Passage_144164","stackoverflow_Passage_316400","stackoverflow_Passage_693734","stackoverflow_Passage_764301","stackoverflow_Passage_956025"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1310","query":"In Cocoa do you prefer NSInteger or int, and why? | `NSInteger`\/`NSUInteger` are Cocoa-defined replacements for the regular built-in types.\n\n\nIs there any benefit to using the NS\\* types over the built-ins? Which do you prefer and why? Are `NSInteger` and `int` the same width on 32-bit \/ 64-bit platforms?\n\n\n","answer_pids":["stackoverflow_Passage_4770","stackoverflow_Passage_4775","stackoverflow_Passage_4788","stackoverflow_Passage_8721","stackoverflow_Passage_11037","stackoverflow_Passage_174069"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_552","query":"Debugging: IE6 + SSL + AJAX + post form = 404 error | **The Setting:** \n\nThe program in question tries to post form data via an AJAX call to a target procedure contained in the same package as the caller. This is done for a site that uses a secure connection (HTTPS). The technology used here is [PLSQL](http:\/\/www.orafaq.com\/wiki\/PL\/SQL_FAQ) and the [DOJO](http:\/\/dojotoolkit.org\/) JavaScript library. The development tool is [basically a text editor](http:\/\/www.allroundautomations.nl\/plsqldev.html).\n\n\n**Code Snippet:** \n\n\n\n```\n> function testPost() { \n>> dojo.xhrPost( { \n url: ''dr_tm_w_0120.test_post'', \n form: ''orgForm'', \n load: testPostXHRCallback, \n error: testPostXHRError \n }); \n } \n\n> function testPostXHRCallback(data,ioArgs) { \n>> alert(''post callback''); \n try{ \n dojo.byId(\"messageDiv\").innerHTML = data; \n } \n catch(ex){ \n if(ex.name == \"TypeError\") \n { \n alert(\"A type error occurred.\"); \n } \n } \n return data; \n } \n> \nfunction testPostXHRError(data, ioArgs) { \n>> alert(data); \n alert(''Error when retrieving data from the server!''); \n return data; \n } \n\n```\n\n**The Problem:** \n\nWhen using IE6 (which the entire user-base uses), the response sent back from the server is a 404 error. \n\n\n**Observations:** \n\nThe program works fine in Firefox. \n\nThe calling procedure cannot target any procedures within the same package. \n\nThe calling procedure can target outside sites (both http, https). \n\nThe other AJAX calls in the package that are not posts of form data work fine. \n\nI've searched the *internets* and consulted with senior-skilled team members and haven't discovered anything that satisfactorily addresses the issue. \n\n\\*Tried [Q&A](http:\/\/dojotoolkit.org\/forum\/dojo-core-dojo-0-9\/dojo-core-support\/xhrpost-firefox-fine-ie-not-so-much) over at Dojo support forums. \n\n\n**The Questions:** \n\nWhat troubleshooting techniques do you recommend? \n\nWhat troubleshooting tools do you recommend for HTTPS analyzing? \n\nAny hypotheses on what the issue might be? \n\nAny ideas for workarounds that aren't total (bad) hacks?\n\n\n**Ed. The Solution** \n\nlomaxx, thx for the [fiddler](http:\/\/www.orafaq.com\/wiki\/PL\/SQL_FAQ) tip. you have no idea how awesome it was to get that and use it as a debugging tool. after starting it up this is what i found and how i fixed it (at least in the short term):\n\n\n\n```\n> ef Fri, 8 Aug 2008 14:01:26 GMT dr_tm_w_0120.test_post: SIGNATURE (parameter names) MISMATCH VARIABLES IN FORM NOT IN PROCEDURE: SO1_DISPLAYED_,PO1_DISPLAYED_,RWA2_DISPLAYED_,DD1_DISPLAYED_ NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM: 0\n\n```\n\nAfter seeing that message from the server, I kicked around Fiddler a bit more to see what else I could learn from it. Found that there's a WebForms tab that shows the values in the web form. Wouldn't you know it, the \"`xxx_DISPLAYED_`\" fields above were in it. \n\n\nI don't really understand yet why these fields exist, because I didn't create them explicitly in the web `PLSQL` code. But I do understand now that the target procedure has to include them as parameters to work correctly. Again, this is only in the case of `IE6` for me, as Firefox worked fine.\n\n\nWell, that the short term answer and hack to fix it. Hopefully, a little more work in this area will lead to a better understanding of the fundamentals going on here. \n\n\n","answer_pids":["stackoverflow_Passage_1708","stackoverflow_Passage_5622"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_777","query":"Pylons error - 'MySQL server has gone away' | I'm using Pylons (a python framework) to serve a simple web application, but it seems to die from time to time, with this in the error log: `(2006, 'MySQL server has gone away')`\n\n\nI did a bit of checking, and saw that this was because the connections to MySQL were not being renewed. This shouldn't be a problem though, because the `sqlalchemy.pool_recycle` in the config file should automatically keep it alive. The default was `3600`, but I dialed it back to `1800` because of this problem. It helped a bit, but `3600` *should* be fine according to the docs. The errors still happen semi-regularly. I don't want to lower it too much though and DOS my own database :).\n\n\nMaybe something in my MySQL config is goofy? Not sure where to look exactly.\n\n\nOther relevant details:\n\n\n\n```\n Python 2.5\n Pylons: 0.9.6.2 (w\/ sql_alchemy)\n MySQL: 5.0.51\n\n```\n\n","answer_pids":["stackoverflow_Passage_5393","stackoverflow_Passage_9340","stackoverflow_Passage_10460"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_946","query":"Calculate DateTime Weeks into Rows | I am currently writing a small calendar in ASP.Net C#. Currently to produce the rows of the weeks I do the following for loop:\n\n\n\n```\nvar iWeeks = 6;\nfor (int w = 0; w < iWeeks; w++) {\n\n```\n\nThis works fine, however, some month will only have 5 weeks and in some rare cases, 4.\n\n\nHow can I calculate the number of rows that will be required for a particular month?\n\n\nThis is an example of what I am creating:\n\n\n![enter image description here](https:\/\/i.stack.imgur.com\/NkxN7.png)\n\n\nAs you can see for the above month, there are only 5 rows required, however. Take the this month (August 2008) which started on a Saturday and ends on a Monday on the 6th Week\/Row.\n\n\n***Image found on google***\n\n\n\n\n---\n\n\nThis is an example of what I am creating:\n\n\n![enter image description here](https:\/\/i.stack.imgur.com\/NkxN7.png)\n\n\nAs you can see for the above month, there are only 5 rows required, however. Take the this month (August 2008) which started on a Saturday and ends on a Monday on the 6th Week\/Row.\n\n\n***Image found on google***\n\n\n","answer_pids":["stackoverflow_Passage_3245","stackoverflow_Passage_3247","stackoverflow_Passage_3250","stackoverflow_Passage_3251","stackoverflow_Passage_3252","stackoverflow_Passage_3255","stackoverflow_Passage_3257","stackoverflow_Passage_3264","stackoverflow_Passage_3266","stackoverflow_Passage_8117"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_334","query":"Displaying ad content from Respose.WriteFile()\/ Response.ContentType | How would one display any add content from a \"dynamic\" aspx page? Currently I am working on using the System.Web.HttpResponse \"Page.Response\" to write a file that is stored on a web server to a web request.\n\n\nThis would allow people to hit a url to the type <http:\/\/www.foo.com?Image=test.jpg> and have the image display in their browser. So as you may know this revolves around the use of Response.ContentType.\n\n\nBy using \n\n\n\n```\nResponse.ContentType = \"application\/octet-stream\";\n\n```\n\nI am able to display images of type gif\/jpeg\/png (all i have tested so far), bit trying to display .swf or .ico files gives me a nice little error.\n\n\nusing\n\n\n\n```\nResponse.ContentType = \"application\/x-shockwave-flash\";\n\n```\n\nI can get flash files to play, but then the images are messed.\n\n\nSo how do i **easily** choose the contenttype?\n\n\n","answer_pids":["stackoverflow_Passage_975","stackoverflow_Passage_5063","stackoverflow_Passage_6295","stackoverflow_Passage_8839","stackoverflow_Passage_911377"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1993","query":"Call Project Server Interface web method from an msi installer | I'm using a Visual Studio web setup project to install an application that extends the functionality of Project Server. I want to call a method from the PSI ( Project Server Interface ) from one of the custom actions of my setup project, but every time a get a \"401 Unauthorized access\" error. What should I do to be able to access the PSI? The same code, when used from a Console Application, works without any issues.\n\n\n","answer_pids":["stackoverflow_Passage_7827","stackoverflow_Passage_8990","stackoverflow_Passage_9650"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1493","query":"Choosing a new development machine | I'm not sure how this question will be recieved here but lets give it a shot...\n\n\nIt's time for me to get a new dev PC. What's the best choice these days?\n\n\nI typically have 2-3 Visual Studios open along with mail and all that stuff. Ideally I would imagine 2+ GB of RAM would be nice as my current XP box is dying. =)\n\n\nI hopped on the Dell site (my days of building PC's are behind me. I just need something that gets the job done.) and started browsing around only to be confused from all the processor choices. What does a typical dev box need these days? Duo? Quad?\n\n\nIs it worth going to 64 bit Vista as well?\n\n\nIt's been a while since I got a new machine so I'm just looking for some guidance.\n\n\nThanks\n\n\n","answer_pids":["stackoverflow_Passage_5502","stackoverflow_Passage_5503","stackoverflow_Passage_5505","stackoverflow_Passage_5510","stackoverflow_Passage_5542","stackoverflow_Passage_5550","stackoverflow_Passage_9888","stackoverflow_Passage_9897"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1093","query":"ASP.NET Proxy Application | Let me try to explain what I need. I have a server that is visible from the internet. What I need is to create a ASP.NET application that get the request of a web Site and send to a internal server, then it gets the response and publish the the info. For the client this should be totally transparent.\n\n\nFor different reasons I cannot redirect the port to the internal server. What I can do but no know how - maybe the answer is there - is to create a new Web Site that its host in the other server.\n\n\n","answer_pids":["stackoverflow_Passage_3864","stackoverflow_Passage_3883","stackoverflow_Passage_8374"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_350","query":"SQL Client for Mac OS X that works with MS SQL Server | How can I connect to a remote SQL server using Mac OS X? I don't really need a GUI, but it would be nice to have for the color coding and resultset grid. I'd rather not have to use a VM.\n\n\nIs there a SQL client for Mac OS X that works with MS SQL Server?\n\n\n","answer_pids":["stackoverflow_Passage_1039","stackoverflow_Passage_1072","stackoverflow_Passage_1073","stackoverflow_Passage_1076","stackoverflow_Passage_7775","stackoverflow_Passage_8664","stackoverflow_Passage_8665","stackoverflow_Passage_10116","stackoverflow_Passage_11395","stackoverflow_Passage_12161","stackoverflow_Passage_12162","stackoverflow_Passage_12163","stackoverflow_Passage_12164","stackoverflow_Passage_12165","stackoverflow_Passage_12170","stackoverflow_Passage_12175","stackoverflow_Passage_12180","stackoverflow_Passage_12528","stackoverflow_Passage_12963","stackoverflow_Passage_13208","stackoverflow_Passage_13501","stackoverflow_Passage_20796","stackoverflow_Passage_25208","stackoverflow_Passage_36484","stackoverflow_Passage_96068","stackoverflow_Passage_175607"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1300","query":"GUI system development resources? | Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C\/C++?\n\n\nCurrently my biggest influence is [3DBuzz.com](http:\/\/www.3dbuzz.com)'s [C++\/OpenGL VTMs](http:\/\/www.3dbuzz.com\/xcart\/product.php?productid=30&cat=12&page=1) (Video Training Modules). While they are very good, they cover a large area of graphics programming, so only skim the surface of GUI programming.\n\n\nThis question does relate to \"[How do I make a GUI?](https:\/\/stackoverflow.com\/questions\/7489\/how-do-i-make-a-gui)\", where there is also a rough outline of my current structure.\n\n\nAny response would be appreciated.\n\n\n**Edit:**\nI've just read some of the answers and spotted that I've missed some points. I had to type the question twice as I caught the wrong button and lost it.\n\n\nI missed two important points, first: This will be used cross platform including homebrew on a Sony PSP. Second: I want to create a GUI system not use an existing one.\n\n\n**Edit 2:** I think some of you are missing the point, I don't what to **use** an existing GUI system I want to build one.\n\n\nQt in it's current form is not portable to the PSP, never mind the overkill of such a task.\n\n\nThat said I've decided to create an IM-GUI, and have started to prototype the code.\n\n\n","answer_pids":["stackoverflow_Passage_4723","stackoverflow_Passage_4726","stackoverflow_Passage_4729","stackoverflow_Passage_5022","stackoverflow_Passage_5096","stackoverflow_Passage_5667","stackoverflow_Passage_5675","stackoverflow_Passage_5745","stackoverflow_Passage_5957","stackoverflow_Passage_8702"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1247","query":"How to setup site-wide variables in php? | I want to define something like this in *php*:\n\n\n\n```\n$EL = \"\\n<br \/>\\n\";\n\n```\n\nand then use that variable as an \"endline\" marker all over my site, like this:\n\n\n\n```\necho \"Blah blah blah{$EL}\";\n\n```\n\nHow do I define $EL once (in only 1 file), include it on every page on my site, and *not* have to reference it using the (strangely backwards) `global $EL;` statement in every page function?\n\n\n","answer_pids":["stackoverflow_Passage_4482","stackoverflow_Passage_4483","stackoverflow_Passage_4484","stackoverflow_Passage_4499","stackoverflow_Passage_4505","stackoverflow_Passage_4512","stackoverflow_Passage_8624","stackoverflow_Passage_9618","stackoverflow_Passage_9633","stackoverflow_Passage_35940","stackoverflow_Passage_1016659","stackoverflow_Passage_1016754"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_146","query":"Limit size of Queue<T> in .NET? | I have a Queue<T> object that I have initialised to a capacity of 2, but obviously that is just the capacity and it keeps expanding as I add items. Is there already an object that automatically dequeues an item when the limit is reached, or is the best solution to create my own inherited class?\n\n\n","answer_pids":["stackoverflow_Passage_361","stackoverflow_Passage_362","stackoverflow_Passage_363","stackoverflow_Passage_1304","stackoverflow_Passage_11214","stackoverflow_Passage_125678","stackoverflow_Passage_142646","stackoverflow_Passage_983101","stackoverflow_Passage_1016711"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1327","query":"In Cocoa do I need to remove an Object from receiving KVO notifications when deallocating it? | When I've registered an object **foo** to receive KVO notifications from another object **bar** (using addObserver:...), if I then deallocate **foo** do I need to send a `removeObserver:forKeyPath:` message to **bar** in -dealloc?\n\n\n","answer_pids":["stackoverflow_Passage_4877","stackoverflow_Passage_8691","stackoverflow_Passage_8760","stackoverflow_Passage_9847"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1399","query":"Multiple choice on WinForms | What's the best way of implementing a multiple choice option in Windows Forms? I want to enforce a single selection from a list, starting with a default value.\n\n\nIt seems like a ComboBox would be a good choice, but is there a way to specify a non-blank default value? \n\nI could just set it in the code at some appropriate initialisation point, but I feel like I'm missing something.\n\n\n","answer_pids":["stackoverflow_Passage_5115","stackoverflow_Passage_5117","stackoverflow_Passage_5123","stackoverflow_Passage_5125","stackoverflow_Passage_5155","stackoverflow_Passage_8866"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1437","query":"How do you set your LAMP testing server? | I am using xampp on Windows, but I would like to use something closer to my server setup.\n\n\n[Federico Cargnelutti tutorial](http:\/\/phpimpact.wordpress.com\/2008\/05\/24\/virtual-appliances-lamp-development-made-easy\/) explains how to setup LAMP VMWARE appliance; it is a great introduction to VMware appliances, but one of the commands was not working and it doesn't describe how to change the keyboard layout and the timezone.\n\n\nps: the commands are easy to find but I don't want to look for them each time I reinstall the server. I am using this question as a reminder.\n\n\n","answer_pids":["stackoverflow_Passage_5286","stackoverflow_Passage_5291","stackoverflow_Passage_5539","stackoverflow_Passage_8386","stackoverflow_Passage_8997","stackoverflow_Passage_11348"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_546","query":"Is there a real benefit of using J#? | I just saw a [comment of suggesting J#](https:\/\/stackoverflow.com\/questions\/5516\/what-happened-to-all-of-the-java-developers-how-can-i-get-started-in-net#5522), and it made me wonder... is there a real, beneficial use of J# over Java? So, my feeling is that the only reason you would even consider using J# is that management has decreed that the company should jump on the Java bandwagon... and the .NET bandwagon. If you use J#, you are effectively losing the biggest benefit of picking Java... rich cross platform support. Sure there is Mono, but it's not as richly supported or as full featured right? I remember hearing Forms are not fully (perhaps at all) supported.\n\n\nI'm not trying to bash .NET here, I'm just saying, if you are going to go the Microsoft route, why not just use C#? If you are going to go the Java route, why would J# enter the picture?\n\n\nI'm hoping to find some real world cases here, so please especially respond if you've ACTUALLY used J# in a REAL project, and why.\n\n\n","answer_pids":["stackoverflow_Passage_1687","stackoverflow_Passage_1689","stackoverflow_Passage_1690","stackoverflow_Passage_1714","stackoverflow_Passage_2386","stackoverflow_Passage_5531","stackoverflow_Passage_6006","stackoverflow_Passage_8313","stackoverflow_Passage_9730"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1372","query":"When should a multi-module project to split into separate repository trees? | Currently we have a project with a standard subversion repository layout of:\n\n\n.\/trunk \n\n.\/branches \n\n.\/tags\n\n\nHowever, as we're moving down the road of OSGi and a modular project, we've ended up with:\n\n\n.\/trunk\/bundle\/main \n\n.\/trunk\/bundle\/modulea \n\n.\/trunk\/bundle\/moduleb\n.\/tags\/bundle\/main-1.0.0 \n\n.\/tags\/bundle\/main-1.0.1 \n\n.\/tags\/bundle\/modulea-1.0.0\n\n\nThe 'build' is still quite monolithic in that it builds all modules in sequence, though I'm starting to wonder if we should refactor the build\/repository to something more like:\n\n\n.\/bundle\/main\/trunk \n\n.\/bundle\/main\/tags\/main-1.0.0 \n\n.\/bundle\/main\/tags\/main-1.0.1 \n\n.\/bundle\/modulea\/trunk \n\n.\/bundle\/modulea\/tags\/modulea-1.0.0 \n\n\nIn this pattern I would imagine each module building itself, and storing its binary in a repository (maven, ivy, or another path of the subversion repository itself).\n\n\nAre there guidelines or 'best-practices' over project layouts once one goes modular?\n\n\n","answer_pids":["stackoverflow_Passage_5026","stackoverflow_Passage_5032","stackoverflow_Passage_6343","stackoverflow_Passage_8826","stackoverflow_Passage_11959"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_429","query":"High availability | Is there anyway to configure a WCF service with a failover endpoint if the primary endpoint dies? Kind of like being able to specify a failover server in a SQL cluster.\n\n\nSpecifically I am using the TCP\/IP binding for speed, but on the rare occurrence that the machine is not available I would like to redirect traffic to the failover server. Not too bothered about losing messages. I'd just prefer not to write the code to handle re-routing.\n\n\n","answer_pids":["stackoverflow_Passage_1326","stackoverflow_Passage_4514","stackoverflow_Passage_8635","stackoverflow_Passage_10295","stackoverflow_Passage_394828"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_727","query":"Where can I find some good WS-Security introductions and tutorials? | Can anyone point me to some decent introductions to WS-Security?\n\n\nI'm looking for tutorials or something that provide a fairly gentle introduction to the subject, though I don't mind if it assumes basic knowledge of web services and SOAP. Most of the stuff I've seen so far is very technical and you need a lot of complex, detailed background knowledge to understand it properly.\n\n\nWe have to implement a web service in PHP and one or more clients in .NET, so resources covering both would be much appreciated.\n\n\n","answer_pids":["stackoverflow_Passage_2405","stackoverflow_Passage_4236","stackoverflow_Passage_11501","stackoverflow_Passage_12217"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_758","query":"Remove Quotes and Commas from a String in MySQL | I'm importing some data from a `CSV` file, and numbers that are larger than `1000` get turned into `1,100` etc. \n\n\nWhat's a good way to remove both the quotes and the comma from this so I can put it into an `int` field?\n\n\n**Edit:** \n\n\nThe data is actually already in a MySQL table, so I need to be able to this using SQL. Sorry for the mixup.\n\n\n","answer_pids":["stackoverflow_Passage_2529","stackoverflow_Passage_2536","stackoverflow_Passage_2549","stackoverflow_Passage_2553","stackoverflow_Passage_2570","stackoverflow_Passage_2583","stackoverflow_Passage_2587","stackoverflow_Passage_2605","stackoverflow_Passage_7767"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_333","query":"C\/C++ library for reading MIDI signals from a USB MIDI device | I want to write C\/C++ programs that take input from a MIDI device. \n\n\nThe MIDI device connects to my PC using a USB connector. \n\n\nI'm looking for a (C\/C++ implemented) library that I can use to read the MIDI signals from the MIDI device through the USB port.\n\n\nI'm happy manipulating the MIDI data once I get it, I just don't want to have to implement the code for its capture.\n\n\nI'm planning on writing my code using the Bloodshed Dev-C++ IDE on Windows XP.\n\n\n","answer_pids":["stackoverflow_Passage_1125","stackoverflow_Passage_8336","stackoverflow_Passage_12200","stackoverflow_Passage_12726"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_747","query":"What is the value-binding syntax in xaml? | I'm getting all learned up about binding in WPF. I'm having a lot of trouble debugging the parse errors in my xaml, though. Can somebody pretty please tell me what's wrong with this little piece? :\n\n\n\n```\n<Border Name=\"TrackBackground\"\n Margin=\"0\"\n CornerRadius=\"2\" \n Grid.Row=\"1\"\n Grid.Column=\"1\"\n Background=\"BlanchedAlmond\"\n BorderThickness=\"1\"\n Height=\"{TemplateBinding Height}\">\n\n <Canvas Name=\"PART_Track\" Background=\"DarkSalmon\" Grid.Row=\"1\" Grid.Column=\"1\">\n <Thumb Name=\"ThumbKnob\" Height=\"{Binding ElementName=Part_Track, Path=Height, Mode=OneWay}\" \/>\n <\/Canvas>\n<\/Border>\n\n```\n\nIt's the databinding that breaks. I get an `InvalidAttributeValue` exception for ThumbKnob.Height when I try to run this. I know I must be missing something fundamental. So fill me in, stackers, and my gratitude will be boundless.\n\n\n\n\n---\n\n\nChanging the ElementName didn't help. There must me something else I'm not getting.\n\n\nI should mention that I'm testing this in Silverlight. The exact message I'm getting out of Internet Explorer is:\n\n\n`XamlParseException: Invalid attribute value for property Height.`\n\n\nThis whole thing is inside a ControlTemplate. I'm making a slider control just to teach myself the concepts.\n\n\n","answer_pids":["stackoverflow_Passage_2476","stackoverflow_Passage_2482","stackoverflow_Passage_2490","stackoverflow_Passage_2500","stackoverflow_Passage_2703","stackoverflow_Passage_2811","stackoverflow_Passage_7838","stackoverflow_Passage_13110"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1708","query":"best practice for releasing Microsoft dll's in setup | I'm working on a setup which *wants to include the Microsoft.Web.Services3 (WSE 3.0) DLL*. However, I typically do not like including Microsoft DLL's in our installs except by way of Microsoft's redistributables. There is both a developer and a redist install package available from Microsoft.\n\n\nSo, as a best practice, should I include the single DLL in my install or refer them to one of the WSE 3.0 installs (assuming they do not already have it installed)?\n\n\n","answer_pids":["stackoverflow_Passage_6463","stackoverflow_Passage_6464","stackoverflow_Passage_6466","stackoverflow_Passage_6467","stackoverflow_Passage_6506","stackoverflow_Passage_9221"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1301","query":"Validate Enum Values | I need to validate an integer to know if is a valid enum value.\n\n\nWhat is the best way to do this in C#?\n\n\n","answer_pids":["stackoverflow_Passage_4735","stackoverflow_Passage_4742","stackoverflow_Passage_45270","stackoverflow_Passage_136521","stackoverflow_Passage_296880","stackoverflow_Passage_367510","stackoverflow_Passage_429868","stackoverflow_Passage_537387","stackoverflow_Passage_756941","stackoverflow_Passage_1016506","stackoverflow_Passage_1016560","stackoverflow_Passage_1016641"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_928","query":"Playing wave file ends immediately (C++, Windows) | I have got the following situation. On a machine there is a **Fritz ISDN** card. There is a process that is responsible for playing a certain wave file on this device's wave out (**ISDN** connection is made at startup and made persistent). The scenario is easy, whenever needed the process calls `waveOutWrite()` on the previously opened wave device (everything initialized without any problems of course) and a callback function waits for `MM_WOM_DONE` msg to know that the playback has been finished. \n\n\nSince a few days however (nothing changed neither in the process nor the machine) the `MM_WOM_DONE` message has been coming immediately after calling `waveOutWrite()` even though the wave lasts a couple of seconds. Again no error is reported, it looks like the file was played but had zero length (which is not the case). I am also sure that `waveOutReset()` was not called by my process (it would also trigger sending the mentioned message). I have already used to have some strange problems in the past that where solved simply by reinstalling **TAPI** drivers. This time for some reason it is problematic for me to perform that once again and I am trying more analytical approach :). Any suggestions what might cause such a behavior? Maybe something on the other end of the **ISDN** line?\n\n\n","answer_pids":["stackoverflow_Passage_3748","stackoverflow_Passage_5052","stackoverflow_Passage_10689"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1953","query":"SQL Server 2005 - Export table programmatically (run a .sql file to rebuild it) | I have a database with a table Customers that have some data \n \n\nI have another database in the office that everything is the same, but my table Customers is empty \n \n\nHow can I create a sql file in SQL Server 2005 (T-SQL) that takes everything on the table Customers from the first database, creates a, let's say, buildcustomers.sql, I zip that file, copy it across the network, execute it in my SQL Server and voila! my table Customers is full \n\n \n\nHow can I do the same for a whole database?\n\n\n","answer_pids":["stackoverflow_Passage_7419","stackoverflow_Passage_11185","stackoverflow_Passage_11186","stackoverflow_Passage_12489","stackoverflow_Passage_335615","stackoverflow_Passage_336302","stackoverflow_Passage_480797"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1946","query":"How to stop an animation in C# \/ WPF? | I have something like this:\n\n\n\n```\n\nbarProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation(\n barProgress.Value, dNextProgressValue,\n new Duration(TimeSpan.FromSeconds(dDuration)));\n\n```\n\nNow, how would you stop that animation (the `DoubleAnimation`)? The reason I want to do this, is because I would like to start new animations (this seems to work, but it's hard to tell) and eventually stop the last animation...\n\n\n","answer_pids":["stackoverflow_Passage_7394","stackoverflow_Passage_7492","stackoverflow_Passage_8833","stackoverflow_Passage_9488","stackoverflow_Passage_11602","stackoverflow_Passage_12443","stackoverflow_Passage_156033","stackoverflow_Passage_347264","stackoverflow_Passage_661541"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_206","query":"Pass by reference or pass by value? | When learning a new programming language, one of the possible roadblocks you might encounter is the question whether the language is, by default, *pass-by-value or pass-by-reference*.\n\n\nSo here is my question to all of you, in your favorite language, *how* is it actually done? And what are the *possible pitfalls*?\n\n\nYour favorite language can, of course, be anything you have ever played with: [popular](http:\/\/www.ruby-lang.org\/en\/), [obscure](http:\/\/www.devtopics.com\/a-obscure-programming-language-of-the-month\/), [esoteric](http:\/\/en.wikipedia.org\/wiki\/Brainfuck), [new](http:\/\/www.nvidia.com\/object\/cuda_get.html), [old](http:\/\/en.wikipedia.org\/wiki\/FORTRAN)...\n\n\n","answer_pids":["stackoverflow_Passage_561","stackoverflow_Passage_562","stackoverflow_Passage_569","stackoverflow_Passage_699","stackoverflow_Passage_1233","stackoverflow_Passage_2356","stackoverflow_Passage_7935","stackoverflow_Passage_12867","stackoverflow_Passage_42189","stackoverflow_Passage_172324","stackoverflow_Passage_172397"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1774","query":"Best practise to authorize all users for just one page | What is the best way to authorize all users to one single page in a asp.net website.\n\n\nFor except the login page and one other page, I deny all users from viewing pages in the website. \n\n\nHow do you make this page accessible to all users?\n\n\n","answer_pids":["stackoverflow_Passage_6687","stackoverflow_Passage_6691","stackoverflow_Passage_9281"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1977","query":"why are downloads sometimes tagged md5, sha1 and other hash indicators? | I've seen this all over the place: \n\n\n\n> \n> Download here! SHA1 =\n> 8e1ed2ce9e7e473d38a9dc7824a384a9ac34d7d0\n> \n> \n> \n\n\nWhat does it mean? How does a hash come into play as far as downloads and... What use can I make of it? Is this a legacy item where you used to have to verify some checksum after you downloaded the whole file?\n\n\n","answer_pids":["stackoverflow_Passage_7526","stackoverflow_Passage_7528","stackoverflow_Passage_7529","stackoverflow_Passage_7530","stackoverflow_Passage_7531","stackoverflow_Passage_7538","stackoverflow_Passage_7544","stackoverflow_Passage_9524"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1751","query":"Creation Date of Compiled Executable (VC++ 2005) | The creation date of an executable linked in VS2005 is not set to the real creation-date of the `.exe` file. Only a complete re-build will set the current date, a re-link will not do it. Obviously the file is set to some date, which is taken from one of the project-files. \n\n\nSo: is there a way to force the linker to set the creation-date to the real link-date?\n\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\n\n\n","answer_pids":["stackoverflow_Passage_6624","stackoverflow_Passage_6626","stackoverflow_Passage_6661","stackoverflow_Passage_10884"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_163","query":"What is the best way to handle multiple permission types? | I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET \/ VB.NET with SQL Server 2000.\n\n\n**Scenario**\n\n\nI want to offer a dynamic permission system that can work on different parameters. Let's say that I want to give either a department or just a specific person access to an application. And pretend that we have a number of applications that keeps growing.\n\n\nIn the past, I have chosen one of the following two ways that I know to do this.\n\n\n1. Use a single permission table with special columns that are used for\ndetermining a how to apply the parameters. The special columns in\nthis example are `TypeID` and `TypeAuxID`. The SQL would look something\nlike this.\n\n\n\n```\nSELECT COUNT(PermissionID)\nFROM application_permissions\nWHERE\n(TypeID = 1 AND TypeAuxID = @UserID) OR\n(TypeID = 2 AND TypeAuxID = @DepartmentID)\nAND ApplicationID = 1\n\n```\n2. Use a mapping table for each type of permission, then joining them\nall together.\n\n\n\n```\nSELECT COUNT(perm.PermissionID)\nFROM application_permissions perm\nLEFT JOIN application_UserPermissions emp\nON perm.ApplicationID = emp.ApplicationID\nLEFT JOIN application_DepartmentPermissions dept\nON perm.ApplicationID = dept.ApplicationID\nWHERE q.SectionID=@SectionID\n AND (emp.UserID=@UserID OR dept.DeptID=@DeptID OR\n (emp.UserID IS NULL AND dept.DeptID IS NULL)) AND ApplicationID = 1\nORDER BY q.QID ASC\n\n```\n\n\n**My Thoughts**\n\n\nI hope that the examples make sense. I cobbled them together.\n\n\nThe first example requires less work, but neither of them feel like the best answer. Is there a better way to handle this?\n\n\n","answer_pids":["stackoverflow_Passage_417","stackoverflow_Passage_421","stackoverflow_Passage_424","stackoverflow_Passage_428","stackoverflow_Passage_1304","stackoverflow_Passage_1476"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_592","query":"How do I get rid of the \"multiple describeType entries\" warning? | Does anyone know why when using BindingUtils on the selectedItem property of a ComboBox you get the following warning? Any ideas how to resolve the issue?\n\n\nThe binding still works properly, but it would be nice to get rid of the warning.\n\n\n\n```\nwarning: multiple describeType entries for 'selectedItem' on type 'mx.controls::ComboBox':\n<accessor name=\"selectedItem\" access=\"readwrite\" type=\"Object\" declaredBy=\"mx.controls::ComboBase\">\n <metadata name=\"Bindable\">\n <arg key=\"\" value=\"valueCommit\"\/>\n <\/metadata>\n\n```\n\n","answer_pids":["stackoverflow_Passage_4951","stackoverflow_Passage_11609"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1583","query":"How can I deploy artifacts from a Maven build to the SourceForge File Release System? | I am using SourceForge for some Open Source projects and I want to automate the deployment of releases to the SourceForge File Release System. I use Maven for my builds and the standard SFTP deployment mechanism doesn't seem to work unless you do some manual preparation work. I have come across some old postings on other forums suggesting that the only approach is to write a Wagon specifically for SourceForge.\n\n\nHas anybody had any recent experience with this?\n\n\n","answer_pids":["stackoverflow_Passage_6439","stackoverflow_Passage_9381","stackoverflow_Passage_10968","stackoverflow_Passage_12703","stackoverflow_Passage_13060","stackoverflow_Passage_13128","stackoverflow_Passage_13129","stackoverflow_Passage_13211","stackoverflow_Passage_28037","stackoverflow_Passage_35200"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_466","query":"Automating VMWare or VirtualPC | I'm currently experimenting with build script, and since I have an ASP.net Web Part under source control, my build script should do that at the end:\n\n\n1. Grab the \"naked\" Windows 2003 IIS VMWare or Virtual PC Image from the Network\n2. Boot it up\n3. Copy the Files from the Build Folder to the Server\n4. Install it\n5. Do whatever else is needed\n\n\nI have never tried automating a Virtual Machine, but I saw that both VMWare and Virtual Server offer automation facilities. While I cannot use Virtual Server (Windows XP Home :-(), Virtual PC works.\n\n\nDoes anyone here have experience with either VMWare Server or Virtual PC 2007 SP1 in terms of automation?\n\n\nWhich one is better suited (I run windows, so the Platform-independence of VMWare does not count) and easier to automate?\n\n\n","answer_pids":["stackoverflow_Passage_1449","stackoverflow_Passage_1692","stackoverflow_Passage_4705","stackoverflow_Passage_10599","stackoverflow_Passage_12351","stackoverflow_Passage_12439"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1354","query":"GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT errors | I'm using [FBO](http:\/\/en.wikipedia.org\/wiki\/Framebuffer_Object)s in my OpenGL code and I'm seeing compilation errors on `GL\\_FRAMEBUFFER\\_INCOMPLETE\\_DUPLICATE\\_ATTACHMENT\\_EXT`. What's the cause of this and how do I fix it?\n\n\n","answer_pids":["stackoverflow_Passage_4968","stackoverflow_Passage_8792"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_93","query":"Format string to title case | How do I format a string to [title case](http:\/\/www.grammar-monster.com\/lessons\/capital_letters_title_case.htm)?\n\n\n","answer_pids":["stackoverflow_Passage_202","stackoverflow_Passage_203","stackoverflow_Passage_205","stackoverflow_Passage_206","stackoverflow_Passage_214","stackoverflow_Passage_222","stackoverflow_Passage_451","stackoverflow_Passage_9948","stackoverflow_Passage_10804","stackoverflow_Passage_10806","stackoverflow_Passage_12925","stackoverflow_Passage_13424","stackoverflow_Passage_13425","stackoverflow_Passage_13426","stackoverflow_Passage_54276","stackoverflow_Passage_247226","stackoverflow_Passage_706445","stackoverflow_Passage_937783","stackoverflow_Passage_1016621"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_142","query":"Asynchronous multi-direction server-client communication over the same open socket? | I have a client-server app where the client is on a Windows Mobile 6 device, written in C++ and the server is on full Windows and written in C#.\n\n\nOriginally, I only needed it to send messages from the client to the server, with the server only ever sending back an acknowledgment that it received the message. Now, I would like to update it so that the server can actually send a message to the client to request data. As I currently have it set up so the client is only in receive mode after it sends data to the server, this doesn't allow for the server to send a request at any time. I would have to wait for client data. My first thought would be to create another thread on the client with a separate open socket, listening for server requests...just like the server already has with respect to the client. Is there a way, within the same thread and using the same socket, for all the servers to send requests at any time?\n\n\nCan you use something to the effect of `WaitForMultipleObjects()` and pass it a receive buffer and an event that tells it there is data to be sent?\n\n\n","answer_pids":["stackoverflow_Passage_357","stackoverflow_Passage_541","stackoverflow_Passage_1274","stackoverflow_Passage_2426","stackoverflow_Passage_4736"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1442","query":"How do I do a string replacement in a PowerShell function? | How do I convert function input parameters to the right type?\n\n\nI want to return a string that has part of the URL passed into it removed.\n\n\n**This works, but it uses a hard-coded string:**\n\n\n\n```\nfunction CleanUrl($input)\n{\n $x = \"http:\/\/google.com\".Replace(\"http:\/\/\", \"\")\n return $x\n}\n\n$SiteName = CleanUrl($HostHeader)\necho $SiteName\n\n```\n\n**This fails:**\n\n\n\n```\nfunction CleanUrl($input)\n{\n $x = $input.Replace(\"http:\/\/\", \"\")\n return $x\n}\n\nMethod invocation failed because [System.Array+SZArrayEnumerator] doesn't contain a method named 'Replace'.\nAt M:\\PowerShell\\test.ps1:13 char:21\n+ $x = $input.Replace( <<<< \"http:\/\/\", \"\")\n\n```\n\n","answer_pids":["stackoverflow_Passage_5298","stackoverflow_Passage_5311","stackoverflow_Passage_5332","stackoverflow_Passage_8923","stackoverflow_Passage_9905"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_393","query":"Programmatically talking to a Serial Port in OS X or Linux | I have a Prolite LED sign that I like to set up to show scrolling search queries from a apache logs and other fun statistics. The problem is, my G5 does not have a serial port, so I have to use a usb to serial dongle. It shows up as \/dev\/cu.usbserial and \/dev\/tty.usbserial . \n\n\nWhen i do this everything seems to be hunky-dory:\n\n\n\n```\nstty -f \/dev\/cu.usbserial\nspeed 9600 baud;\nlflags: -icanon -isig -iexten -echo\niflags: -icrnl -ixon -ixany -imaxbel -brkint\noflags: -opost -onlcr -oxtabs\ncflags: cs8 -parenb\n\n```\n\nEverything also works when I use the [serial port tool](http:\/\/www.versiontracker.com\/dyn\/moreinfo\/macosx\/24024) to talk to it.\n\n\nIf I run this piece of code while the above mentioned serial port tool, everthing also works. But as soon as I disconnect the tool the connection gets lost. \n\n\n\n```\n#!\/usr\/bin\/python\n\nimport serial\n\nser = serial.Serial('\/dev\/cu.usbserial', 9600, timeout=10) \nser.write(\"<ID01><PA> \\r\\n\") \nread_chars = ser.read(20)\nprint read_chars\n\nser.close()\n\n```\n\nSo the question is, what magicks do I need to perform to start talking to the serial port without the serial port tool? Is that a permissions problem? Also, what's the difference between \/dev\/cu.usbserial and \/dev\/tty.usbserial?\n\n\n\n\n---\n\n\nNope, no serial numbers. The thing is, the problem persists even with sudo-running the python script, and the only thing that makes it go through if I open the connection in the gui tool that I mentioned.\n\n\n","answer_pids":["stackoverflow_Passage_1246","stackoverflow_Passage_1254"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1182","query":"How to attach a ChangeEvent handler to an inherited dependency property? | How would you attach a propertychanged callback to a property that is inherited? Like such:\n\n\n\n```\nclass A {\n DependencyProperty prop;\n}\n\nclass B : A {\n \/\/...\n prop.AddListener(PropertyChangeCallback);\n}\n\n```\n\n","answer_pids":["stackoverflow_Passage_4240","stackoverflow_Passage_4331","stackoverflow_Passage_8538","stackoverflow_Passage_11288"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_740","query":"Merge Sort a Linked List | I was recently brushing up on some fundamentals and found merge sorting a linked list to be a pretty good challenge. If you have a good implementation then show it off here.\n\n\n","answer_pids":["stackoverflow_Passage_2491","stackoverflow_Passage_9200","stackoverflow_Passage_13440","stackoverflow_Passage_13441","stackoverflow_Passage_89217","stackoverflow_Passage_127966","stackoverflow_Passage_202892","stackoverflow_Passage_202983","stackoverflow_Passage_350510","stackoverflow_Passage_544511","stackoverflow_Passage_670008","stackoverflow_Passage_671819","stackoverflow_Passage_867106","stackoverflow_Passage_1012393","stackoverflow_Passage_1016467","stackoverflow_Passage_1016472","stackoverflow_Passage_1016540","stackoverflow_Passage_1016663","stackoverflow_Passage_1016737"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1764","query":"How would I get started writing my own firewall? | There is previous little on the google on this subject other than people asking this very same question.\n\n\nHow would I get started writing my own firewall?\n\n\nI'm looking to write one for the windows platform but I would also be interested in this information for other operating systems too.\n\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\u00ad\n\n\n","answer_pids":["stackoverflow_Passage_6666","stackoverflow_Passage_6668","stackoverflow_Passage_9274","stackoverflow_Passage_11449"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1813","query":"Can I access ASP.NET Development server in an intranet? | Im testing an ASP.NEt site. When I execute it, it starts the ASP.NET Development Server and opens up a page.\n\n\nNow I want to test it in the intranet I have. \n\n\n1. Can I use this server or I need to configure IIS in this machine?\n2. Do I need to configure something for it to work?\n\n\nI've changed the localhost to the correct IP and I opened up the firewall.\n\n\nThanks\n\n\n","answer_pids":["stackoverflow_Passage_6864","stackoverflow_Passage_6866","stackoverflow_Passage_6873","stackoverflow_Passage_13511","stackoverflow_Passage_13544","stackoverflow_Passage_70094","stackoverflow_Passage_78229","stackoverflow_Passage_108279","stackoverflow_Passage_184059","stackoverflow_Passage_214846","stackoverflow_Passage_249613"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1266","query":"How can I refactor HTML markup out of my property files? | I've recently inherited a internationalized and text-heavy Struts 1.1 web application. Many of the JSP files look like:\n\n\n\n```\n<p>\n <bean:message key=\"alert\" \/>\n<\/p>\n\n```\n\nand the properties files look like:\n\n\n\n```\nmessages.properties\nalert=Please update your <a href=\"\/address.do\">address<\/a> and <a href=\"\/contact.do\">contact information<\/a>.\n\n```\n\nwith the appropriate translations in N other languages (messages\\_fr.properties, etc).\n\n\nProblems:\n\n\n1. ***DRY violation*** - I have N references to my Struts action URLs instead of 1, which makes refactoring action URLs error-prone.\n2. ***Mixed concerns*** - My application's markup is now in more than just my JSP files, making it difficult for a web specialist to tweak the markup (using CSS, etc).\n3. ***Post-translation markup*** - Anytime I receive newly-translated text, I must decide what to surround with the `<a>...<\/a>` markup. Easy for English but less so for unfamiliar languages.\n\n\nI've considered adding placeholders in the messages file, like:\n\n\n\n```\nalert=Please update your {0} and {1}.\n\n```\n\nbut then the words \"address\" and \"contact information\" would somehow need to be localized, wrapped with markup, and passed to my message tag - and I can't see an easy way to do it.\n\n\nWhat can I do to improve this?\n\n\n","answer_pids":["stackoverflow_Passage_4562","stackoverflow_Passage_4563","stackoverflow_Passage_4598","stackoverflow_Passage_4609","stackoverflow_Passage_8680"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1287","query":"Browser Sync across many machines | Everyone remembers google browser sync right? I thought it was great. Unfortunately Google decided not to upgrade the service to Firefox 3.0. Mozilla is developing a replacement for google browser sync which will be a part of the Weave project. I have tried using Weave and found it to be very very slow or totally inoperable. Granted they are in a early development phase right now so I can not really complain. \n\n\nThis specific problem of browser sync got me to thinking though. What do all of you think of Mozilla or someone making a server\/client package that we, the users, could run on your 'main' machine? Now you just have to know your own IP or have some way to announce it to your client browsers at work or wherever.\n\n\nThere are several problems I can think of with this: non static IPs, Opening up ports on your local comp etc. It just seems that Mozilla does not want to handle this traffic created by many people syncing their browsers. There is not a way for them to monetize this traffic since all the data uploaded must be encrypted. \n\n\n","answer_pids":["stackoverflow_Passage_4684","stackoverflow_Passage_4688","stackoverflow_Passage_4690","stackoverflow_Passage_4707","stackoverflow_Passage_8696"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1698","query":"When should assertions stay in production code? | There's a [discussion](http:\/\/groups.google.com\/group\/comp.lang.c++.moderated\/browse_thread\/thread\/8e0235d58c8635c2 \"assertions: does it matter that they are disabled in production?\") going on over at comp.lang.c++.moderated about whether or not assertions, which in C++ only exist in debug builds by default, should be kept in production code or not.\n\n\nObviously, each project is unique, so my question here is **not** so much **whether** assertions should be kept, **but in which cases** this is recommendable\/not a good idea.\n\n\nBy assertion, I mean:\n\n\n* A run-time check that tests a condition which, when false, reveals a bug in the software.\n* A mechanism by which the program is halted (maybe after really minimal clean-up work).\n\n\nI'm not necessarily talking about C or C++.\n\n\nMy own opinion is that if you're the programmer, but don't own the data (which is the case with most commercial desktop applications), you should keep them on, because a failing asssertion shows a bug, and you should not go on with a bug, with the risk of corrupting the user's data. This forces you to test strongly before you ship, and makes bugs more visible, thus easier to spot and fix.\n\n\nWhat's your opinion\/experience?\n\n\nSee related question [here](https:\/\/stackoverflow.com\/questions\/419406\/are-assertions-good)\n\n\n\n\n---\n\n\n**Responses and Updates**\n\n\n\n> \n> An assertion is error, pure and simple and therefore should be handled like one.\n> Since an error should be handled in release mode then you don't really need assertions.\n> \n> \n> \n\n\nThat's why I prefer the word \"bug\" when talking about assertions. It makes things much clearer. To me, the word \"error\" is too vague. A missing file is an error, not a bug, and the program should deal with it. Trying to dereference a null pointer is a bug, and the program should acknowledge that something smells like bad cheese.\n\n\nHence, you should test the pointer with an assertion, but the presence of the file with normal error-handling code.\n\n\n\n\n---\n\n\nSlight off-topic, but an important point in the discussion.\n\n\nAs a heads-up, if your assertions break into the debugger when they fail, why not. But there are plenty of reasons a file could not exist that are completely outside of the control of your code: read\/write rights, disk full, USB device unplugged, etc. Since you don't have control over it, I feel assertions are not the right way to deal with that.\n\n\n\n\n---\n\n\nYes, I have Code Complete, and must say I strongly disagree with that particular advice.\n\n\nSay your custom memory allocator screws up, and zeroes a chunk of memory that is still used by some other object. I happens to zero a pointer that this object dereferences regularly, and one of the invariants is that this pointer is never null, and you have a couple of assertions to make sure it stays that way. What do you do if the pointer suddenly is null. You just if() around it, hoping that it works?\n\n\nRemember, we're talking about product code here, so there's no breaking into the debugger and inspecting the local state. This is a real bug on the user's machine.\n\n\n","answer_pids":["stackoverflow_Passage_6416","stackoverflow_Passage_6424","stackoverflow_Passage_6426","stackoverflow_Passage_6427","stackoverflow_Passage_6431","stackoverflow_Passage_6465","stackoverflow_Passage_6468","stackoverflow_Passage_6484","stackoverflow_Passage_11467","stackoverflow_Passage_11696","stackoverflow_Passage_13372","stackoverflow_Passage_239584","stackoverflow_Passage_365472","stackoverflow_Passage_404117","stackoverflow_Passage_414338","stackoverflow_Passage_511303","stackoverflow_Passage_1016644"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_600","query":"What is the best way to store connection string in .NET DLLs? | The application my team is currently developing has a DLL that is used to perform all database access. The application can not use a trusted connection because the database is behind a firewall and the domain server is not. So it appears that the connection string needs to have a DB username and password. The DLL currently has the database connection string hard coded, but I don't want to do this when we launch as the assembly can be disassembled and the username and password would be right there in the open.\n\n\nOne of the requirements is that the password needs to be changed once every few months, so we would need to roll that out to our internal user base.\n\n\nIs there a way to store the password encrypted in such a way we can easily distribute to the entire user base without storing it in the assembly?\n\n\nUPDATE: Thanks to everyone who's answered. I'll try to answer some of the questions back to me... The data DLL is used by both ASP.NET WebForms and VB.NET WinForms. I understand that Applications can have their own config files, but I haven't seen anything on config files for DLLs. Unfortunately, I can't get to the Jon Galloway post at work so I can't judge if that will work. From a development standpoint, we don't want to use web services inhouse, but may be providing them to third parties sometime next year. I don't think impersonation will work because we can't authenticate the user through the firewall. As a user (or former user) can be an attacker, we're keeping it from everyone!\n\n\n","answer_pids":["stackoverflow_Passage_1886","stackoverflow_Passage_1889","stackoverflow_Passage_1911","stackoverflow_Passage_1916","stackoverflow_Passage_1920","stackoverflow_Passage_1929","stackoverflow_Passage_6111","stackoverflow_Passage_8047","stackoverflow_Passage_12105"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1130","query":"How do you impersonate an Active Directory user in Powershell? | I'm trying to run powershell commands through a web interface (ASP.NET\/C#) in order to create mailboxes\/etc on Exchange 2007. When I run the page using Visual Studio (Cassini), the page loads up correctly. However, when I run it on IIS (v5.1), I get the error \"unknown user name or bad password\". The biggest problem that I noticed was that Powershell was logged in as ASPNET instead of my Active Directory Account. How do I force my Powershell session to be authenticated with another Active Directory Account?\n\n\nBasically, the script that I have so far looks something like this:\n\n\n\n```\nRunspaceConfiguration rc = RunspaceConfiguration.Create();\nPSSnapInException snapEx = null;\nrc.AddPSSnapIn(\"Microsoft.Exchange.Management.PowerShell.Admin\", out snapEx);\n\nRunspace runspace = RunspaceFactory.CreateRunspace(rc);\nrunspace.Open();\n\nPipeline pipeline = runspace.CreatePipeline();\nusing (pipeline)\n{\n pipeline.Commands.AddScript(\"Get-Mailbox -identity 'user.name'\");\n pipeline.Commands.Add(\"Out-String\");\n\n Collection<PSObject> results = pipeline.Invoke();\n\n if (pipeline.Error != null && pipeline.Error.Count > 0)\n {\n foreach (object item in pipeline.Error.ReadToEnd())\n resultString += \"Error: \" + item.ToString() + \"\\n\";\n }\n\n runspace.Close();\n\n foreach (PSObject obj in results)\n resultString += obj.ToString();\n}\n\nreturn resultString;\n\n```\n\n","answer_pids":["stackoverflow_Passage_3986","stackoverflow_Passage_4291","stackoverflow_Passage_11731","stackoverflow_Passage_12171","stackoverflow_Passage_12738"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_161","query":"Bandwith throttling in IIS 6 by IP Address | I am writing an application that downloads large files in the background. All clients are logged in locally, or through a VPN. When they are logged in locally, I do not want to throttle downloads. However, I would like to limit downloads to 10 KBps when the user is connected via VPN. I can differentiate between these users by IP Address range.\n\n\nSince this is an AIR Application, I figure I will throttle via server-side since I can do it from either the server itself (IIS 6) or the web service (asp.net \/ C#). \n\n\nThrottling through IIS 6 seems to work fine, but it seems like it has to be done across the entire web site. Is there anyway to do this via IP? Or will I have to rig this up in .NET?\n\n\n","answer_pids":["stackoverflow_Passage_8176","stackoverflow_Passage_9789"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_775","query":"How do I find the high water mark (for sessions) on Oracle 9i | How can I find the high water mark (the historical maximum number of concurrent users) in an **oracle database (9i)**.\n\n\n","answer_pids":["stackoverflow_Passage_2594","stackoverflow_Passage_2598","stackoverflow_Passage_7775"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1888","query":"Trigger without a transaction? | Is it possible to create a trigger that will not be in a transaction? \n\n\nI want to update data on a linked server with a trigger but due to firewall issues we can't create a distributed transaction between the two servers.\n\n\n","answer_pids":["stackoverflow_Passage_7187","stackoverflow_Passage_8417","stackoverflow_Passage_9926"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_255","query":"What are the best solutions for flash charts and graphs? | I'm aware of [FusionCharts](http:\/\/www.fusioncharts.com\/), are there other good solutions, or APIs, for creating charts in Adobe Flash?\n\n\n","answer_pids":["stackoverflow_Passage_697","stackoverflow_Passage_700","stackoverflow_Passage_705","stackoverflow_Passage_709","stackoverflow_Passage_711","stackoverflow_Passage_2563","stackoverflow_Passage_8270","stackoverflow_Passage_10670","stackoverflow_Passage_10868","stackoverflow_Passage_14582","stackoverflow_Passage_128372"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1098","query":"Variable Bindings in WPF | I\u2019m creating a UserControl for a rich TreeView (one that has context menus for renaming nodes, adding child nodes, etc.). I want to be able to use this control to manage or navigate any hierarchical data structures I will create. I currently have it working for any data structure that implements the following interface (the interface need not actually be implemented, however, only the presence of these members is required):\n\n\n\n```\ninterface ITreeItem\n{\n string Header { get; set; }\n IEnumerable Children { get; }\n}\n\n```\n\nThen in my UserControl, I use templates to bind my tree to the data structure, like so:\n\n\n\n```\n<TextBlock x:Name=\"HeaderTextBlock\" Text=\"{Binding Path=Header}\" \/>\n\n```\n\nWhat I would like to do is define the name of each of these members in my RichTreeView, allowing it to adapt to a range of different data structures, like so:\n\n\n\n```\nclass MyItem\n{\n string Name { get; set; }\n ObservableCollection<MyItem> Items;\n}\n\n<uc:RichTreeView ItemSource={Binding Source={StaticResource MyItemsProvider}} \n HeaderProperty=\"Name\" ChildrenProperty=\"Items\" \/>\n\n```\n\nIs there any way to expose the Path of a binding inside a UserControl as a public property of that UserControl? Is there some other way to go about solving this problem?\n\n\n","answer_pids":["stackoverflow_Passage_4129","stackoverflow_Passage_8493"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_940","query":"C#.Net case-insensitive string | Why does C#.Net allow the declaration of the string object to be case-insensitive?\n\n\n\n```\nString sHello = \"Hello\";\nstring sHello = \"Hello\";\n\n```\n\nBoth the lower-case and upper-case S of the word String are acceptable and this seems to be the only object that allows this.\n\n\nCan anyone explain why?\n\n\n","answer_pids":["stackoverflow_Passage_3219","stackoverflow_Passage_3221","stackoverflow_Passage_3223","stackoverflow_Passage_3224","stackoverflow_Passage_3225","stackoverflow_Passage_3227","stackoverflow_Passage_3386","stackoverflow_Passage_8099"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1494","query":"What are the correct stencils for object relational diagramming in visio? | All of my Visio experience is with LAN\/WAN documentation. I recently had a desire to visualize the relationship between [objects](http:\/\/nagios.sourceforge.net\/docs\/3_0\/objectdefinitions.html) in the [Nagios](http:\/\/www.nagios.org\/) configuration and I realized I didn't know how to do it properly and moved on to something more important. I was reading the responses to [this thread](https:\/\/stackoverflow.com\/questions\/15446\/documenting-program-archetecture) and realized this is something software developers must do a lot.\n\n\nSo this is probably a soft-pitch question, but what is the proper method for documenting object relationships in Visio? Is there a better template to use? What stencil collection is the proper stencil in?\n\n\nIn my probably naive view I imagine an object being a large box with a single \"reception\" connector and containing multiple smaller boxes, each of which represents an object member and having its own connector. So, each object member field would connect out to the \"reception\" connector on the object of the member's type. In and of itself those objects are fairly easy to build. The problem I ran into is that the connector lines didn't respect the objects and ran over the top of them, making an awful, unusable mess.\n\n\nThanks for any pointers.\n\n\n","answer_pids":["stackoverflow_Passage_5508","stackoverflow_Passage_10886"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_88","query":"Connect PHP to IBM i (AS\/400) | I've got an upcoming project wherein I will need to connect our website (`PHP5\/Apache 1.3\/OpenBSD 4.1`) to our back-end system running on an iSeries with OS400 V5R3 so that I can access some tables stored there. I've done some checking around but am running into some roadblocks.\n\n\nFrom what I've seen the DB2 extensions and DB2 software from IBM only run under Linux. I've tried compiling the extensions with all the software from IBM and even tried their precompiled ibm\\_db2 extension with no luck. IBM only supports Linux so I turned on the Linux emulation in the kernel but that didn't seem to help anything.\n\n\nIf anyone has run across getting everything to run natively under OpenBSD that would be great, but what I think I may have to do is setting up a second server running CentOS with DB2 installed (most likely via ZendCore for IBM since it seems to do all this for me) and the driver so that I can set up a small transaction server that I can post against and get a JSON representation of the DB2 data that I need.\n\n\nDoes the second option seem overkill or does anyone else have any better ideas?\n\n\n","answer_pids":["stackoverflow_Passage_190","stackoverflow_Passage_232","stackoverflow_Passage_703","stackoverflow_Passage_6141","stackoverflow_Passage_8027","stackoverflow_Passage_8040","stackoverflow_Passage_8435","stackoverflow_Passage_10632","stackoverflow_Passage_10853"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1652","query":"Implementing permissions in PHP | I've tried to do this several times with no luck. After reading [this post](https:\/\/stackoverflow.com\/questions\/1451\/what-is-the-best-way-to-handle-multiple-permission-types#1477), it made me interested in doing this again. So can anyone tell me why the following doesn't work?\n\n\n\n```\n<?php\n\n$guest = 1;\n$editor = 2;\n$admin = 4;\n\n$user = $editor;\n\nif( $user == ($editor | $admin) ) {\n echo \"Test\"; \n}\n\n?>\n\n```\n\n","answer_pids":["stackoverflow_Passage_6175","stackoverflow_Passage_6177","stackoverflow_Passage_6179","stackoverflow_Passage_6184","stackoverflow_Passage_6185","stackoverflow_Passage_6193","stackoverflow_Passage_6197","stackoverflow_Passage_6256","stackoverflow_Passage_8101","stackoverflow_Passage_8103","stackoverflow_Passage_9156"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_541","query":"How to specify javascript to run when ModalPopupExtender is shown | The ASP.NET AJAX **ModalPopupExtender** has `OnCancelScript` and `OnOkScript` properties, but it doesn't seem to have an `OnShowScript` property. I'd like to specify a javascript function to run each time the popup is shown.\n\n\nIn past situations, I set the `TargetControlID` to a dummy control and provide my own control that first does some JS code and then uses the JS methods to show the popup. But in this case, I am showing the popup from both client and server side code.\n\n\nAnyone know of a way to do this?\n\n\nBTW, I needed this because I have a textbox in the modal that I want to make a TinyMCE editor. But the TinyMCE init script doesn't work on invisible textboxes, so I had to find a way to run it at the time the modal was shown\n\n\n","answer_pids":["stackoverflow_Passage_1668","stackoverflow_Passage_1671","stackoverflow_Passage_1674","stackoverflow_Passage_5499","stackoverflow_Passage_13050","stackoverflow_Passage_13147","stackoverflow_Passage_158186","stackoverflow_Passage_300371","stackoverflow_Passage_300765"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1236","query":"Arrays of Arrays in Java | This is a nasty one for me... I'm a PHP guy working in Java on a JSP project. I know how to do what I'm attempting through too much code and a complete lack of finesse. \n\n\nI'd prefer to do it right. Here is the situation:\n\n\nI'm writing a small display to show customers what days they can water their lawns based on their watering group (ABCDE) and what time of year it is. Our seasons look like this:\nSummer (5-1 to 8-31) \nSpring (3-1 to 4-30) \nFall (9-1 to 10-31)\nWinter (11-1 to 2-28) \n\n\nAn example might be:\n\n\nIf I'm in group A, here would be my allowed times:\nWinter: Mondays only\nSpring: Tues, Thurs, Sat\nSummer: Any Day\nFall: Tues, Thurs, Sat\n\n\nIf I was writing this in PHP I would use arrays like this:\n\n\n\n```\n\/\/M=Monday,t=Tuesday,T=Thursday.... etc\n$schedule[\"A\"][\"Winter\"]='M';\n$schedule[\"A\"][\"Spring\"]='tTS';\n$schedule[\"A\"][\"Summer\"]='Any';\n$schedule[\"A\"][\"Fall\"]='tTS';\n$schedule[\"B\"][\"Winter\"]='t';\n\n```\n\nI COULD make the days arrays (array(\"Tuesday\",\"Thursday\",\"Saturday\")) etc, but it is not necessary for what I'm really trying to accomplish.\n\n\nI will also need to setup arrays to determine what season I'm in:\n\n\n\n```\n$seasons[\"Summer\"][\"start\"]=0501;\n$seasons[\"Summer\"][\"end\"]=0801;\n\n```\n\nCan anyone suggest a really cool way to do this? I will have today's date and the group letter. I will need to get out of my function a day (M) or a series of days (tTS), (Any).\n\n\n","answer_pids":["stackoverflow_Passage_4429","stackoverflow_Passage_4431","stackoverflow_Passage_4435","stackoverflow_Passage_4442","stackoverflow_Passage_4444","stackoverflow_Passage_4446","stackoverflow_Passage_4450","stackoverflow_Passage_4457","stackoverflow_Passage_4477","stackoverflow_Passage_4489","stackoverflow_Passage_4516","stackoverflow_Passage_8604","stackoverflow_Passage_950561"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_704","query":"How do you test\/change untested and untestable code? | Lately I had to change some code on older systems where not all of the code has unit tests. \n\nBefore making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard. \n\nObviously, I wanted to refactor the code to make it easier to test, write the tests and then change it. \n\nIs this the way you'd do it? Or would you spend a lot of time writing the hard-to-write tests that would be mostly removed after the refactoring will be completed?\n\n\n","answer_pids":["stackoverflow_Passage_2307","stackoverflow_Passage_2317","stackoverflow_Passage_2329","stackoverflow_Passage_7290","stackoverflow_Passage_8783"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1735","query":"Prevent WebBrowser control from swallowing exceptions | I'm using the `System.Windows.Forms.WebBrowser`, to make a view a-la Visual Studio Start Page. However, it seems the control is catching and handling all exceptions by silently sinking them! No need to tell this is a very unfortunate behaviour.\n\n\n\n```\nvoid webBrowserNavigating(object sender, WebBrowserNavigatingEventArgs e)\n{\n \/\/ WebBrowser.Navigating event handler\n throw new Exception(\"OMG!\");\n}\n\n```\n\nThe code above will cancel navigation and swallow the exception.\n\n\n\n```\nvoid webBrowserNavigating(object sender, WebBrowserNavigatingEventArgs e)\n{\n \/\/ WebBrowser.Navigating event handler\n try\n {\n e.Cancel = true;\n if (actions.ContainsKey(e.Url.ToString()))\n {\n actions[e.Url.ToString()].Invoke(e.Url, webBrowser.Document);\n }\n }\n catch (Exception exception)\n {\n MessageBox.Show(exception.ToString());\n }\n}\n\n```\n\nSo, what I do (above) is catch all exceptions and pop a box, this is better than silently failing but still clearly far from ideal. I'd like it to redirect the exception through the normal application failure path so that it ultimately becomes unhandled, or handled by the application from the root.\n\n\nIs there any way to tell the `WebBrowser` control to stop sinking the exceptions and just forward them the natural and expected way? Or is there some hacky way to throw an exception through native boundaries?\n\n\n","answer_pids":["stackoverflow_Passage_6573","stackoverflow_Passage_12731","stackoverflow_Passage_13246","stackoverflow_Passage_1016735"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_735","query":"Windows C++: How can I redirect stderr for calls to fprintf? | I am wrapping existing C++ code from a **BSD** project in our own custom wrapper and I want to integrate it to our code with as few changes as possible. This code uses `fprintf` to print to **stderr** in order to log \/ report errors.\n\n\nI want to redirect this to an alternative place within the same process. On **Unix** I have done this with a `socketpair` and a `thread`: one end of the socket is where I send **stderr** (via a call to `dup2`) and the other end is monitored in a thread, where I can then process the output.\n\n\nThis does not work on **Windows** though because a socket is not the same as a file handle.\n\n\nAll documents I have found on the web show how to redirect output from a child process, which is not what I want. How can I redirect **stderr** within the same process getting a callback of some sort when output is written? (and before you say so, I've tried `SetStdHandle` but cannot find any way to make this work)...\n\n\n","answer_pids":["stackoverflow_Passage_2435","stackoverflow_Passage_2441","stackoverflow_Passage_7637","stackoverflow_Passage_9935"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_198","query":"How to map a latitude\/longitude to a distorted map? | I have a bunch of latitude\/longitude pairs that map to known x\/y coordinates on a (geographically distorted) map.\n\n\nThen I have one more latitude\/longitude pair. I want to plot it on the map as best is possible. How do I go about doing this?\n\n\nAt first I decided to create a system of linear equations for the three nearest lat\/long points and compute a transformation from these, but this doesn't work well at all. Since that's a linear system, I can't use more nearby points either.\n\n\nYou can't assume North is up: all you have is the existing lat\/long->x\/y mappings.\n\n\nEDIT: it's not a Mercator projection, or anything like that. It's arbitrarily distorted for readability (think subway map). I want to use only the nearest 5 to 10 mappings so that distortion on other parts of the map doesn't affect the mapping I'm trying to compute.\n\n\nFurther, the entire map is in a very small geographical area so there's no need to worry about the globe--flat-earth assumptions are good enough.\n\n\n","answer_pids":["stackoverflow_Passage_538","stackoverflow_Passage_539","stackoverflow_Passage_543","stackoverflow_Passage_671","stackoverflow_Passage_1944"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_778","query":"MySQL replication: if I don't specify any databases, will log_bin log EVERYTHING? | I'm setting up replication for a server which runs a bunch of databases (one per client) and plan on adding more all the time, on my.cnf, Instead of having:\n\n\n\n```\nbinlog-do-db = databasename 1\nbinlog-do-db = databasename 2\nbinlog-do-db = databasename 3\n...\nbinlog-do-db = databasename n\n\n```\n\ncan I rather just have \n\n\n\n```\nbinlog-ignore-db = mysql\nbinlog-ignore-db = informationschema\n\n```\n\n(and no database to log specified) and assume that everything else is logged?\n\n\nEDIT: actually if I remove all my binlog-do-db entries, it seemingly logs everything (as you see the binary log file change position when you move the database), but on the slave server, nothing gets picked up! (perhaps, this is the case to use replicate-do-db? this would kill the idea; i guess I cant have MySQL automagically detect which databases to replicate).\n\n\n","answer_pids":["stackoverflow_Passage_2603","stackoverflow_Passage_7776"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_189","query":".NET unit testing packages | I am getting back into a bit more .NET after a few-years of not using it full-time and am wondering what the good unit testing packages are these days.\n\n\nI'm familiar with NUnit (a few years ago) and have played briefly around with [IronRuby](https:\/\/en.wikipedia.org\/wiki\/IronRuby), with the goal of getting something like [RSpec](https:\/\/en.wikipedia.org\/wiki\/RSpec) going, but I don't know much beyond that.\n\n\nI realize I could google for this and call it a day, but I believe I'm likely to get a better and more informed response from asking a question here :-)\n\n\nSuggestions?\n\n\n","answer_pids":["stackoverflow_Passage_499","stackoverflow_Passage_513","stackoverflow_Passage_514","stackoverflow_Passage_815","stackoverflow_Passage_1102","stackoverflow_Passage_1214","stackoverflow_Passage_1820","stackoverflow_Passage_3757","stackoverflow_Passage_3761","stackoverflow_Passage_8491","stackoverflow_Passage_11068","stackoverflow_Passage_12503"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1989","query":"SQL Reporting Services viewer for webpage - can you move the View Report button? | Using the viewer control for display of SQL Reporting Services reports on web page (Microsoft.ReportViewer.WebForms), can you move the View Report button? It defaults to the very right side of the report, which means you have to scroll all the way across before the button is visible. Not a problem for reports that fit the window width, but on very wide reports that is quickly an issue.\n\n\n","answer_pids":["stackoverflow_Passage_7584","stackoverflow_Passage_12267","stackoverflow_Passage_12763","stackoverflow_Passage_12912","stackoverflow_Passage_536369","stackoverflow_Passage_1016441"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_689","query":"Alpha blending sprites in Nintendo DS Homebrew | I'm trying to alpha blend sprites and backgrounds with [devkitPro](http:\/\/www.devkitpro.org\/) (including libnds, libarm, etc).\n\n\nDoes anyone know how to do this?\n\n\n","answer_pids":["stackoverflow_Passage_2532","stackoverflow_Passage_3505","stackoverflow_Passage_10625","stackoverflow_Passage_11229"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1563","query":"Should DB layer members be static or instance? | I've seen projects where the classes in the DB layer have just static functions in them and other projects where those classes need to be instantiated to get access to the member functions. \n\n\n\n> \n> Which is \"better\" and why?\n> \n> \n> \n\n\n","answer_pids":["stackoverflow_Passage_5805","stackoverflow_Passage_5808","stackoverflow_Passage_5811","stackoverflow_Passage_5812","stackoverflow_Passage_5955","stackoverflow_Passage_8807"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_440","query":"Domain Specific Language resources | I was just listening to some older .Net Rocks! episodes, and I [found #329 on DSLs](http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=D91887EA-5128-4BB1-B861-1DC1F9564941&displaylang=en) to be interesting. My problem is that I can't find any good online resources for people trying to learn this technology. I get the basics of the creating new designers, but the MS docs on the T4 engine used by the DSL tools and then how to integrate the templates with the DSL models are lacking.\n\n\nDoes anyone know of some good introductory resources for the MS DSL tools?\n\n\n","answer_pids":["stackoverflow_Passage_1363","stackoverflow_Passage_2225","stackoverflow_Passage_2229","stackoverflow_Passage_7064","stackoverflow_Passage_8823","stackoverflow_Passage_9758","stackoverflow_Passage_9759","stackoverflow_Passage_9760","stackoverflow_Passage_9960","stackoverflow_Passage_10176","stackoverflow_Passage_10766","stackoverflow_Passage_12355","stackoverflow_Passage_100359"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_318","query":"How can I create Debian install packages in Windows for a Visual Studio project? | I'm developing some cross platform software targeting Mono under Visual Studio and would like to be able to build the installers for Windows and Linux (Ubuntu specifically) with a single button click. I figure I could do it by calling cygwin from a post-build event, but I was hoping for at best a Visual Studio plugin or at worst a more Windows-native way of doing it. It seems like the package format is fairly simple and this must be a common need.\n\n\nedit: Re-asked question under other account due to duplicate login issue.\n\n\n","answer_pids":["stackoverflow_Passage_933","stackoverflow_Passage_3118","stackoverflow_Passage_3127","stackoverflow_Passage_10036","stackoverflow_Passage_411438","stackoverflow_Passage_1016422"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1963","query":".NET - Excel ListObject autosizing on databind | I'm developing an Excel 2007 add-in using Visual Studio Tools for Office (2008). I have one sheet with several ListObjects on it, which are being bound to datatables on startup. When they are bound, they autosize correctly.\n\n\nThe problem comes when they are re-bound. I have a custom button on the ribbon bar which goes back out to the database and retrieves different information based on some criteria that the user inputs. This new data comes back and is re-bound to the ListObjects - however, this time they are not resized and I get an exception:\n\n\n\n> \n> ListObject cannot be bound because it\n> cannot be resized to fit the data. The\n> ListObject failed to add new rows.\n> This can be caused because of\n> inability to move objects below of the\n> list object.\n> \n> \n> \n> > \n> > Inner exception: \"Insert method of Range class failed\" \n> > \n> > Reason: Microsoft.Office.Tools.Excel.FailureReason.CouldNotResizeListObject\n> > \n> > \n> > \n> \n> \n> \n\n\nI was not able to find anything very meaningful on this error on Google or MSDN. I have been trying to figure this out for a while, but to no avail.\n\n\nBasic code structure:\n\n\n\n```\n\/\/at startup\nDataTable tbl = \/\/get from database\nlistObj1.SetDataBinding(tbl);\nDataTable tbl2 = \/\/get from database\nlistObj2.SetDataBinding(tbl2); \n\n\/\/in buttonClick event handler\nDataTable tbl = \/\/get different info from database\n\/\/have tried with and without unbinding old source\nlistObj1.SetDataBinding(tbl); <-- exception here\nDataTable tbl2 = \/\/get different info from database\nlistObj2.SetDataBinding(tbl2);\n\n```\n\nNote that this exception occurs even when the ListObject is shrinking, and not only when it grows.\n\n\n","answer_pids":["stackoverflow_Passage_7877","stackoverflow_Passage_8124","stackoverflow_Passage_9765","stackoverflow_Passage_12020"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_696","query":"Anyone know a good workaround for the lack of an enum generic constraint? | What I want to do is something like this: I have enums with combined flagged values.\n\n\n\n```\npublic static class EnumExtension\n{\n public static bool IsSet<T>( this T input, T matchTo ) \n where T:enum \/\/the constraint I want that doesn't exist in C#3\n { \n return (input & matchTo) != 0;\n }\n}\n\n```\n\nSo then I could do:\n\n\n\n```\nMyEnum tester = MyEnum.FlagA | MyEnum.FlagB\n\nif( tester.IsSet( MyEnum.FlagA ) )\n \/\/act on flag a\n\n```\n\nUnfortunately, C#'s generic where constraints have no enum restriction, only class and struct. C# doesn't see enums as structs (even though they are value types) so I can't add extension types like this.\n\n\nDoes anyone know a workaround?\n\n\n","answer_pids":["stackoverflow_Passage_2328","stackoverflow_Passage_4683","stackoverflow_Passage_12531","stackoverflow_Passage_12676","stackoverflow_Passage_12685","stackoverflow_Passage_12686","stackoverflow_Passage_12859","stackoverflow_Passage_13187","stackoverflow_Passage_204856","stackoverflow_Passage_712920","stackoverflow_Passage_813194","stackoverflow_Passage_983604","stackoverflow_Passage_985790"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_865","query":"Accessing iSight programmatically? | Is it possible to access the iSight camera on a macbook programmatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages be used as well? \n\n\n","answer_pids":["stackoverflow_Passage_2919","stackoverflow_Passage_2981","stackoverflow_Passage_3310","stackoverflow_Passage_3577","stackoverflow_Passage_3752","stackoverflow_Passage_11367","stackoverflow_Passage_13064"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1429","query":"How to Disable Alt + F4 closing form? | What is the best way to disable `Alt` + `F4` in a c# win form to prevent the user from closing the form?\n\n\nI am using a form as a popup dialog to display a progress bar and I do not want the user to be able to close it.\n\n\n","answer_pids":["stackoverflow_Passage_5245","stackoverflow_Passage_5249","stackoverflow_Passage_5260","stackoverflow_Passage_5382","stackoverflow_Passage_5386","stackoverflow_Passage_8902","stackoverflow_Passage_9502","stackoverflow_Passage_11703","stackoverflow_Passage_285606","stackoverflow_Passage_748562","stackoverflow_Passage_928389","stackoverflow_Passage_989608"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_326","query":"Actionscript 3 - Fastest way to parse yyyy-mm-dd hh:mm:ss to a Date object? | I have been trying to find a really fast way to parse yyyy-mm-dd [hh:mm:ss] into a Date object. Here are the 3 ways I have tried doing it and the times it takes each method to parse 50,000 date time strings.\n\n\nDoes anyone know any faster ways of doing this or tips to speed up the methods?\n\n\n\n```\ncastMethod1 takes 3673 ms \ncastMethod2 takes 3812 ms \ncastMethod3 takes 3931 ms\n\n```\n\nCode:\n\n\n\n```\nprivate function castMethod1(dateString:String):Date {\n if ( dateString == null ) {\n return null;\n }\n\n var year:int = int(dateString.substr(0,4));\n var month:int = int(dateString.substr(5,2))-1;\n var day:int = int(dateString.substr(8,2));\n\n if ( year == 0 && month == 0 && day == 0 ) {\n return null;\n }\n\n if ( dateString.length == 10 ) {\n return new Date(year, month, day);\n }\n\n var hour:int = int(dateString.substr(11,2));\n var minute:int = int(dateString.substr(14,2));\n var second:int = int(dateString.substr(17,2));\n\n return new Date(year, month, day, hour, minute, second);\n}\n\n```\n\n-\n\n\n\n```\nprivate function castMethod2(dateString:String):Date {\n if ( dateString == null ) {\n return null;\n }\n\n if ( dateString.indexOf(\"0000-00-00\") != -1 ) {\n return null;\n }\n\n dateString = dateString.split(\"-\").join(\"\/\");\n\n return new Date(Date.parse( dateString ));\n}\n\n```\n\n-\n\n\n\n```\nprivate function castMethod3(dateString:String):Date {\n if ( dateString == null ) {\n return null;\n }\n\n var mainParts:Array = dateString.split(\" \");\n var dateParts:Array = mainParts[0].split(\"-\");\n\n if ( Number(dateParts[0])+Number(dateParts[1])+Number(dateParts[2]) == 0 ) {\n return null;\n }\n\n return new Date( Date.parse( dateParts.join(\"\/\")+(mainParts[1]?\" \"+mainParts[1]:\" \") ) );\n}\n\n```\n\n\n\n---\n\n\nNo, Date.parse will not handle dashes by default. And I need to return null for date time strings like `\"0000-00-00\"`.\n\n\n","answer_pids":["stackoverflow_Passage_957","stackoverflow_Passage_959","stackoverflow_Passage_3289","stackoverflow_Passage_3321","stackoverflow_Passage_8149","stackoverflow_Passage_13434","stackoverflow_Passage_97962","stackoverflow_Passage_391630"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1650","query":"How do you spawn another process in C? | How do you run an external program and pass it command line parameters using C? If you have to use operating system API, include a solution for Windows, Mac, and Linux.\n\n\n","answer_pids":["stackoverflow_Passage_6170","stackoverflow_Passage_6171","stackoverflow_Passage_6198","stackoverflow_Passage_6230","stackoverflow_Passage_7579","stackoverflow_Passage_11626","stackoverflow_Passage_11627","stackoverflow_Passage_261050"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1554","query":"Best Way To Determine If .NET 3.5 Is Installed | I need to programatically determine whether .NET 3.5 is installed. I thought it would be easy:\n\n\n\n```\n<% Response.Write(Environment.Version.ToString()); %>\n\n```\n\nWhich returns \"2.0.50727.1434\" so no such luck...\n\n\nIn my research I have that there are some rather obscure registry keys I can look at but I'm not sure if that is the route to go. Does anyone have any suggestions?\n\n\n","answer_pids":["stackoverflow_Passage_5746","stackoverflow_Passage_5752","stackoverflow_Passage_5760","stackoverflow_Passage_5783","stackoverflow_Passage_5787","stackoverflow_Passage_5798","stackoverflow_Passage_8652","stackoverflow_Passage_9052","stackoverflow_Passage_12434","stackoverflow_Passage_12794"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_13","query":"Reliable timer in a console application | I am aware that in [.NET](http:\/\/en.wikipedia.org\/wiki\/.NET_Framework) there are three timer types (see *[Comparing the Timer Classes in the .NET Framework Class Library](http:\/\/msdn.microsoft.com\/en-us\/magazine\/cc164015.aspx)*). I have chosen a threaded timer as the other types can drift if the main thread is busy, and I need this to be reliable.\n\n\nThe way this timer works in the control of the timer is put on another thread so it can always tick along with the work begin completed on the parent thread when it is not busy.\n\n\nThe issue with this timer in a console application is that while the timer is ticking along on another thread the main thread is not doing anything to the application closes.\n\n\nI tried adding a `while true` loop, but then the main thread is too busy when the timer does go off.\n\n\n","answer_pids":["stackoverflow_Passage_10","stackoverflow_Passage_11","stackoverflow_Passage_45"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1780","query":"Exact age calculation | \n> \n> **Possible Duplicate:** \n> \n> [How do I calculate someone's age in C#?](https:\/\/stackoverflow.com\/questions\/9\/how-do-i-calculate-someones-age-in-c) \n> \n> \n> \n\n\nMaybe this could be silly but and I don't have issues with my age but sometimes it is good to calculate the exact age of someone, I have introduced my birthdate in my profile (01\/12\/1975) \"dd\/mm\/yyyy\" and it calculated 33 and I'm 32 actually still, isn't it better to calculate the exact age? \n\n\nMaybe\n\n\n\n```\nDateTime dt1 = DateTime.Now;\nTimeSpan dt2;\ndt2 = dt1.Subtract(new DateTime(1975, 12, 01));\ndouble year = dt2.TotalDays \/ 365;\n\n```\n\nThe result of year is 32.77405678074\n\n\nCould this code be OK?\n\n\n","answer_pids":["stackoverflow_Passage_6736","stackoverflow_Passage_6738","stackoverflow_Passage_6778","stackoverflow_Passage_9311","stackoverflow_Passage_186450"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1657","query":"What tools do you use to develop C++ applications on Linux? | I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind. \n\nWhat tools do other people use? Is there anything out there for Linux that rivals the slickness of Microsoft Visual Studio?\n\n\n","answer_pids":["stackoverflow_Passage_6200","stackoverflow_Passage_6205","stackoverflow_Passage_6207","stackoverflow_Passage_6226","stackoverflow_Passage_6239","stackoverflow_Passage_6310","stackoverflow_Passage_8659","stackoverflow_Passage_11465","stackoverflow_Passage_11547","stackoverflow_Passage_11548","stackoverflow_Passage_11549","stackoverflow_Passage_11550","stackoverflow_Passage_11561","stackoverflow_Passage_11903","stackoverflow_Passage_11904","stackoverflow_Passage_11905","stackoverflow_Passage_11906","stackoverflow_Passage_11956","stackoverflow_Passage_12967","stackoverflow_Passage_12968","stackoverflow_Passage_12969","stackoverflow_Passage_12970","stackoverflow_Passage_19602","stackoverflow_Passage_55096"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_569","query":"IsNothing versus Is Nothing | Does anyone here use VB.NET and have a strong preference for or against using `IsNothing` as opposed to `Is Nothing` (for example, `If IsNothing(anObject)` or `If anObject Is Nothing...`)? If so, why?\n\n\nEDIT: If you think they're both equally acceptable, do you think it's best to pick one and stick with it, or is it OK to mix them?\n\n\n","answer_pids":["stackoverflow_Passage_1764","stackoverflow_Passage_1767","stackoverflow_Passage_1779","stackoverflow_Passage_1799","stackoverflow_Passage_1803","stackoverflow_Passage_2493","stackoverflow_Passage_5831","stackoverflow_Passage_480846","stackoverflow_Passage_708001"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1206","query":"Designing a Calendar system like Google Calendar | I have to create something similiar to Google Calendar, so I created an events table that contains all the events for a user.\n\n\nThe hard part is handling re-occurring events, the row in the events table has an event\\_type field that tells you what kind of event it is, since an event can be for a single date only, OR a re-occuring event every x days.\n\n\n**The main design challenge is handling re-occurring events.**\n\n\nWhen a user views the calendar, using the month's view, how can I display all the events for the given month? The query is going to be tricky, so I thought it would be easier to create another table and create a row for each and every event, including the re-occuring events.\n\n\nWhat do you guys think?\n\n\n","answer_pids":["stackoverflow_Passage_4318","stackoverflow_Passage_4319","stackoverflow_Passage_4320","stackoverflow_Passage_4322","stackoverflow_Passage_4323","stackoverflow_Passage_4325","stackoverflow_Passage_4327","stackoverflow_Passage_4346","stackoverflow_Passage_4387","stackoverflow_Passage_4399","stackoverflow_Passage_4408","stackoverflow_Passage_4473","stackoverflow_Passage_4478","stackoverflow_Passage_7872","stackoverflow_Passage_11462","stackoverflow_Passage_11818"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_919","query":"C# 2.0 code consuming assemblies compiled with C# 3.0 | This should be fine seeing as the CLR hasn't actually changed?\n\n\nThe boxes running the C# 2.0 code **have** had .NET 3.5 rolled out.\n\n\nThe background is that we have a windows service (.NET 2.0 exe built with VS2005, deployed to ~150 servers) that dynamically loads assemblies (almost like plug-ins) to complete various work items asked of it. Whenever we roll out a new version of the bus logic, we just drop the assemblies on an FTP server and the windows service knows how to check for, grab and store the latest versions. New assemblies are now built using VS2008 and targetting .NET 2.0, we know that works ok. However we'd like to start taking advantage of C# 3.0 language features such as LINQ and targetting the assemblies against .NET 3.5 without having to build and deploy a new version of the windows service.\n\n\n","answer_pids":["stackoverflow_Passage_3148","stackoverflow_Passage_3155","stackoverflow_Passage_3159","stackoverflow_Passage_8057"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_451","query":"How to setup Quality of Service? | I'm talking about <http:\/\/en.wikipedia.org\/wiki\/Quality_of_service>. With streaming stackoverflow podcasts and downloading the lastest updates to ubuntu, I would like to have QoS working so I can use stackoverflow without my http connections timing out or taking forever.\n\n\nI'm using an iConnect 624 ADSL modem which has QoS built-in but I can't seem to get it to work. Is it even possible to control the downstream (ie. from ISP to your modem)?\n\n\n","answer_pids":["stackoverflow_Passage_1385","stackoverflow_Passage_11931"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_859","query":"Generic type checking | **Is there a way to enforce\/limit the types that are passed to primitives?** *(bool, int, string, etc.)*\n\n\nNow, I know you can limit the generic type parameter to a type or interface implementation via the *where* clause. However, this doesn't fit the bill for primitives (AFAIK) because they do not all have a common ground (apart from *object* before someone says! :P).\n\n\nSo, my current thoughts are to just grit my teeth and do a big *switch* statement and throw an *ArgumentException* on failure.\n\n\n\n\n---\n\n\n**EDIT 1:**\n\n\nJust to clarify:\n\n\nThe code definition should be like this:\n\n\n\n```\npublic class MyClass<GenericType> ....\n\n```\n\nAnd instantiation:\n\n\n\n```\nMyClass<bool> = new MyClass<bool>(); \/\/ Legal\nMyClass<string> = new MyClass<string>(); \/\/ Legal\nMyClass<DataSet> = new MyClass<DataSet>(); \/\/ Illegal\nMyClass<RobsFunkyHat> = new MyClass<RobsFunkyHat>(); \/\/ Illegal (but looks awesome!)\n\n```\n\n\n\n---\n\n\n**EDIT 2**\n\n\n@Jon Limjap - Good point, and something I was already considering. I'm sure there is a generic method that can be used to determine if the type is of a value or reference type.\n\n\nThis could be useful in instantly removing a lot of the objects I don't want to deal with (but then you need to worry about the structs that are used such as *Size* ). Interesting problem no? :)\n\n\nHere it is:\n\n\n\n```\nwhere T: struct\n\n```\n\nTaken from [MSDN](http:\/\/msdn.microsoft.com\/en-us\/library\/d5x73970.aspx).\n\n\n\n\n---\n\n\nI'm curious. Could this be done in .NET 3.x using extension methods? Create an interface, and implement the interface in the extension methods (which would probably be cleaner than a bit fat switch). Plus if you then need to later extend to any lightweight custom types, they can also implement the same interface, with no changes required to the base code.\n\n\nWhat do you guys think?\n\n\nThe sad news is I am working in Framework 2!! :D\n\n\n\n\n---\n\n\n**EDIT 3**\n\n\nThis was so simple following on from [Jon Limjaps Pointer](https:\/\/stackoverflow.com\/questions\/8941\/generic-type-checking#8956).. So simple I almost want to cry, but it's great because the code works like a charm!\n\n\nSo here is what I did (you'll laugh!):\n\n\nCode added to the generic class\n-------------------------------\n\n\n\n```\nbool TypeValid()\n{\n \/\/ Get the TypeCode from the Primitive Type\n TypeCode code = Type.GetTypeCode(typeof(PrimitiveDataType));\n\n \/\/ All of the TypeCode Enumeration refer Primitive Types\n \/\/ with the exception of Object and Empty (Null).\n \/\/ Since I am willing to allow Null Types (at this time)\n \/\/ all we need to check for is Object!\n switch (code)\n {\n case TypeCode.Object:\n return false;\n default:\n return true;\n }\n}\n\n```\n\nThen a little utility method to check the type and throw an exception,\n\n\n\n```\nprivate void EnforcePrimitiveType()\n{\n if (!TypeValid())\n throw new InvalidOperationException(\n \"Unable to Instantiate SimpleMetadata based on the Generic Type of '\" + typeof(PrimitiveDataType).Name + \n \"' - this Class is Designed to Work with Primitive Data Types Only.\");\n}\n\n```\n\nAll that then needs to be done is to call *EnforcePrimitiveType()* in the classes constructors. Job done! :-)\n\n\nThe only downside, it only throws an exception at runtime (obviously) rather than design time. But that's no big deal and could be picked up with utilities like [FxCop](http:\/\/en.wikipedia.org\/wiki\/FxCop) (which we don't use at work).\n\n\nSpecial thanks to Jon Limjap on this one!\n\n\n","answer_pids":["stackoverflow_Passage_2904","stackoverflow_Passage_2905","stackoverflow_Passage_2907","stackoverflow_Passage_2920","stackoverflow_Passage_7940","stackoverflow_Passage_9925","stackoverflow_Passage_11129","stackoverflow_Passage_12040","stackoverflow_Passage_207460"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1985","query":"Version detection with Silverlight | How can I efficiently and effectively detect the version and, for that matter, any available information about the instance of [Silverlight](http:\/\/silverlight.net\/) currently running on the browser?\n\n\n","answer_pids":["stackoverflow_Passage_7569","stackoverflow_Passage_7575","stackoverflow_Passage_8147","stackoverflow_Passage_9770","stackoverflow_Passage_12145","stackoverflow_Passage_12709","stackoverflow_Passage_199436"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1436","query":"Visual Studio Error: The \"GenerateResource\" task failed unexpectedly | When building a VS 2008 solution with 19 projects I sometimes get:\n\n\n\n```\nThe \"GenerateResource\" task failed unexpectedly.\nSystem.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.\n at System.IO.MemoryStream.set_Capacity(Int32 value)\n at System.IO.MemoryStream.EnsureCapacity(Int32 value)\n at System.IO.MemoryStream.WriteByte(Byte value)\n at System.IO.BinaryWriter.Write(Byte value)\n at System.Resources.ResourceWriter.Write7BitEncodedInt(BinaryWriter store, Int32 value)\n at System.Resources.ResourceWriter.Generate()\n at System.Resources.ResourceWriter.Dispose(Boolean disposing)\n at System.Resources.ResourceWriter.Close()\n at Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(IResourceWriter writer)\n at Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(String filename)\n at Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile(String inFile, String outFile)\n at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, ArrayList inputs, ArrayList outputs, Boolean sourcePath, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass)\n at Microsoft.Build.Tasks.GenerateResource.Execute()\n at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) C:\\Windows\\Microsoft.NET\\Framework\\v3.5\n\n```\n\nUsually happens after VS has been running for about 4 hours; the only way to get VS to compile properly is to close out VS, and start it again.\n\n\nI'm on a machine with 3GB Ram. TaskManager shows the devenv.exe working set to be 578060K, and the entire memory allocation for the machine is 1.78GB. It should have more than enough ram to generate the resources.\n\n\n","answer_pids":["stackoverflow_Passage_5292","stackoverflow_Passage_5294","stackoverflow_Passage_5297","stackoverflow_Passage_8913","stackoverflow_Passage_45393","stackoverflow_Passage_138211","stackoverflow_Passage_678157","stackoverflow_Passage_678551","stackoverflow_Passage_1016446"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1330","query":"Best method of Textfile Parsing in C#? | I want to parse a config file sorta thing, like so:\n\n\n\n```\n[KEY:Value] \n [SUBKEY:SubValue]\n\n```\n\nNow I started with a `StreamReader`, converting lines into character arrays, when I figured there's gotta be a better way. So I ask you, humble reader, to help me.\n\n\nOne restriction is that it has to work in a Linux\/Mono environment (1.2.6 to be exact). I don't have the latest 2.0 release (of Mono), so try to restrict language features to C# 2.0 or C# 1.0.\n\n\n","answer_pids":["stackoverflow_Passage_4856","stackoverflow_Passage_4857","stackoverflow_Passage_4860","stackoverflow_Passage_4862","stackoverflow_Passage_4878","stackoverflow_Passage_4961","stackoverflow_Passage_4966","stackoverflow_Passage_8301","stackoverflow_Passage_8754"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1466","query":"Aging Data Structure in C# | I want a data structure that will allow querying *how many items in last **X** minutes*. An item may just be a simple identifier or a more complex data structure, preferably the timestamp of the item will be in the item, rather than stored outside (as a hash or similar, wouldn't want to have problems with multiple items having same timestamp).\n\n\nSo far it seems that with LINQ I could easily filter items with timestamp greater than a given time and aggregate a count. Though I'm hesitant to try to work .NET 3.5 specific stuff into my production environment yet. Are there any other suggestions for a similar data structure?\n\n\nThe other part that I'm interested in is *aging* old data out, If I'm only going to be asking for counts of items less than 6 hours ago I would like anything older than that to be removed from my data structure because this may be a long-running program.\n\n\n","answer_pids":["stackoverflow_Passage_5416","stackoverflow_Passage_5635","stackoverflow_Passage_9024","stackoverflow_Passage_13270"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_407","query":"How do I use Java to read from a file that is actively being written to? | I have an application that writes information to file. This information is used post-execution to determine pass\/failure\/correctness of the application. I'd like to be able to read the file as it is being written so that I can do these pass\/failure\/correctness checks in real time.\n\n\nI assume it is possible to do this, but what are the gotcha's involved when using Java? If the reading catches up to the writing, will it just wait for more writes up until the file is closed, or will the read throw an exception at this point? If the latter, what do I do then? \n\n\nMy intuition is currently pushing me towards BufferedStreams. Is this the way to go?\n\n\n","answer_pids":["stackoverflow_Passage_1264","stackoverflow_Passage_1269","stackoverflow_Passage_1367","stackoverflow_Passage_8925","stackoverflow_Passage_10826","stackoverflow_Passage_11421","stackoverflow_Passage_567664","stackoverflow_Passage_647956","stackoverflow_Passage_649292","stackoverflow_Passage_683492"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1149","query":"How do you do system integration? | I curious to how different people solve integration of systems. I have a feeling that the last years more and more work has gone into integrating systems and that this kind of work need will increase as well.\n\n\nI wondering if you solve it developing your own small services that are then connected or if you use some sort of product (WebSphere, BizTalk, [Mule](http:\/\/mule.mulesource.org\/display\/MULE\/Home) etc). I'd also think it'd be interesting to know how these kind of solutions are managed and maintained (how do you solve security, instrumentation etc, etc), what kind of problems have you experienced with your solution and so on.\n\n\n","answer_pids":["stackoverflow_Passage_4086","stackoverflow_Passage_4224","stackoverflow_Passage_8467","stackoverflow_Passage_9254","stackoverflow_Passage_11273","stackoverflow_Passage_11635"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_54","query":"PHP Session Security | What are some guidelines for maintaining responsible session security with PHP? There's information all over the web and it's about time it all landed in one place!\n\n\n","answer_pids":["stackoverflow_Passage_99","stackoverflow_Passage_100","stackoverflow_Passage_102","stackoverflow_Passage_183","stackoverflow_Passage_456","stackoverflow_Passage_1212","stackoverflow_Passage_2044","stackoverflow_Passage_2359","stackoverflow_Passage_5242","stackoverflow_Passage_7482","stackoverflow_Passage_11970","stackoverflow_Passage_13238","stackoverflow_Passage_92762","stackoverflow_Passage_116613"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1232","query":"C# Database Access: DBNull vs null | We have our own ORM we use here, and provide strongly typed wrappers for all of our db tables. We also allow weakly typed ad-hoc SQL to be executed, but these queries still go through the same class for getting values out of a data reader.\n\n\nIn tweaking that class to work with Oracle, we've come across an interesting question. Is it better to use DBNull.Value, or null? Are there any benefits to using DBNull.Value? It seems more \"correct\" to use null, since we've separated ourselves from the DB world, but there are implications (you can't just blindly `ToString()` when a value is null for example) so its definitely something we need to make a conscious decision about.\n\n\n","answer_pids":["stackoverflow_Passage_4414","stackoverflow_Passage_4417","stackoverflow_Passage_4447","stackoverflow_Passage_4476","stackoverflow_Passage_8613"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1034","query":"Compare a date string to datetime in SQL Server? | In SQL Server I have a `DATETIME` column which includes a time element.\n\n\nExample: \n\n\n\n```\n'14 AUG 2008 14:23:019'\n\n```\n\nWhat is the **best** method to only select the records for a particular day, ignoring the time part?\n\n\nExample: (Not safe, as it does not match the time part and returns no rows)\n\n\n\n```\nDECLARE @p_date DATETIME\nSET @p_date = CONVERT( DATETIME, '14 AUG 2008', 106 )\n\nSELECT *\nFROM table1\nWHERE column_datetime = @p_date\n\n```\n\n*Note: Given this site is also about jotting down notes and techniques you pick up and then forget, I'm going to post my own answer to this question as DATETIME stuff in MSSQL is probably the topic I lookup most in SQLBOL.*\n\n\n\n\n---\n\n\n**Update** Clarified example to be more specific.\n\n\n\n\n---\n\n\n**Edit** Sorry, But I've had to down-mod WRONG answers (answers that return wrong results).\n\n\n@Jorrit: `WHERE (date>'20080813' AND date<'20080815')` will return the 13th and the 14th.\n\n\n@wearejimbo: *Close, but no cigar!* badge awarded to you. You missed out records written at 14\/08\/2008 23:59:001 to 23:59:999 (i.e. Less than 1 second before midnight.)\n\n\n","answer_pids":["stackoverflow_Passage_3625","stackoverflow_Passage_3626","stackoverflow_Passage_3628","stackoverflow_Passage_3629","stackoverflow_Passage_3630","stackoverflow_Passage_3631","stackoverflow_Passage_3632","stackoverflow_Passage_3634","stackoverflow_Passage_5098","stackoverflow_Passage_8282","stackoverflow_Passage_13099","stackoverflow_Passage_13100","stackoverflow_Passage_13101","stackoverflow_Passage_13228","stackoverflow_Passage_34482","stackoverflow_Passage_147208","stackoverflow_Passage_156103","stackoverflow_Passage_599875","stackoverflow_Passage_708489"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_476","query":"String.indexOf function in C | Is there a C library function that will return the index of a character in a string?\n\n\nSo far, all I've found are functions like strstr that will return the found char \\*, not it's location in the original string.\n\n\n","answer_pids":["stackoverflow_Passage_1469","stackoverflow_Passage_1470","stackoverflow_Passage_1471","stackoverflow_Passage_1472","stackoverflow_Passage_1473","stackoverflow_Passage_4837","stackoverflow_Passage_701558","stackoverflow_Passage_945910"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_447","query":"Simple MOLAP solution | To analyze lots of text logs I did some hackery that looks like this:\n\n\n1. Locally import logs into Access\n2. Reprocess Cube link to previous mdb in Analisis Service 2000 (yes it is 2k)\n3. Use Excel to visualize Cube (it is not big - up to milions raw entries)\n\n\nMy hackery is a succes and more people are demanding an access to my Tool. As you see I see more automating and easier deployment.\n\n\nDo you now some tools\/libraries that would give me the same but with easier deployment?\nKind of **embedded OLAP** service?\n\n\n**Edit:** I heard of Mondrian but we don't do much with Java. Have you seen something similiar done for .Net\/Win32 ? Comercial is also OK.\n\n\n","answer_pids":["stackoverflow_Passage_1393","stackoverflow_Passage_1397","stackoverflow_Passage_10501","stackoverflow_Passage_11044","stackoverflow_Passage_11106"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_191","query":"Federated (Synced) Subversion servers? | Is it possible to create \"federated\" Subversion servers?\nAs in one server at location A and another at location B that sync up their local versions of the repository automatically. That way when someone at either location interacts with the repository they are accessing their respective local server and therefore has faster response times.\n\n\n","answer_pids":["stackoverflow_Passage_508","stackoverflow_Passage_511","stackoverflow_Passage_557","stackoverflow_Passage_2016","stackoverflow_Passage_10970","stackoverflow_Passage_1016688"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_61","query":"Lucene Score results | In Lucene if you had multiple indexes that covered only one partition each. Why does the same search on different indexes return results with different scores? The results from different servers match exactly. \n\n\ni.e. if I searched for :\n\n\n* Name - John Smith\n* DOB - 11\/11\/1934\n\n\n**Partition 0** would return a score of 0.345\n\n\n**Partition 1** would return a score of 0.337\n\n\nBoth match exactly on name and DOB.\n\n\n","answer_pids":["stackoverflow_Passage_119","stackoverflow_Passage_120","stackoverflow_Passage_150"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_65","query":"Implementation of \"Remember me\" in a Rails application | My Rails-app has a sign in box with a \"remember me\" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. \n\n\nBut sessions are implemented in Rails as session cookies, which are not persistent. I can *make* them persistent:\n\n\n\n```\nclass ApplicationController < ActionController::Base\n before_filter :update_session_expiration_date\n\n private\n\n def update_session_expiration_date\n options = ActionController::Base.session_options\n unless options[:session_expires]\n options[:session_expires] = 1.year.from_now\n end\n end\nend\n\n```\n\nBut that seems like a hack, which is surprising for such common functionality. Is there any better way?\n\n\n**Edit**\n\n\nGareth's answer is pretty good, but I would still like an answer from someone familiar with Rails 2 (because of it's unique `CookieSessionStore`).\n\n\n","answer_pids":["stackoverflow_Passage_131","stackoverflow_Passage_1219","stackoverflow_Passage_8946","stackoverflow_Passage_10143","stackoverflow_Passage_10267","stackoverflow_Passage_10517","stackoverflow_Passage_10861","stackoverflow_Passage_42665"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_864","query":"What OSS project should I look at if I need to do Spring friendly WorkFlow? | We need to add WorkFlow to our Spring managed application. Does anyone have any useful experience in using any of the myriad of OSS Work Flow solutions? Which one is best? Which one integrates with Spring best? Which ones should we avoid?\n\n\n","answer_pids":["stackoverflow_Passage_3110","stackoverflow_Passage_3199","stackoverflow_Passage_6458","stackoverflow_Passage_8029","stackoverflow_Passage_10960","stackoverflow_Passage_11700"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1209","query":"What is the easiest way to parse an INI File in C++? | I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?\n\n\n","answer_pids":["stackoverflow_Passage_4330","stackoverflow_Passage_4348","stackoverflow_Passage_4352","stackoverflow_Passage_7885","stackoverflow_Passage_8574","stackoverflow_Passage_10603","stackoverflow_Passage_11593","stackoverflow_Passage_12974","stackoverflow_Passage_33750","stackoverflow_Passage_291338","stackoverflow_Passage_349641","stackoverflow_Passage_559634","stackoverflow_Passage_944334","stackoverflow_Passage_1016523"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_178","query":"How can I modify .xfdl files? (Update #1) | The `.XFDL` file extension identifies `XFDL` Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.\n\n\nI know how to view XFDL files using a file viewer I found [here](http:\/\/web.archive.org\/web\/20170903022252\/http:\/\/www.e-publishing.af.mil:80\/viewerdownload.asp). I can also modify and save these files by doing File:Save\/Save As. I'd like, however, to modify these files on the fly. Any suggestions? Is this even possible?\n\n\nUpdate #1: I have now successfully decoded and unziped a `.xfdl` into an XML file which I can then edit. Now, I am looking for a way to re-encode the modified XML file back into base64-gzip (using Ruby or the command line)\n\n\n","answer_pids":["stackoverflow_Passage_463","stackoverflow_Passage_466","stackoverflow_Passage_1018","stackoverflow_Passage_1627"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1116","query":"How can I get Unicode characters to display properly for the tooltip for the IMG ALT in IE7? | I've got some Japanese in the ALT attribute, but the tooltip is showing me the ugly block characters in the tooltip. The rest of the content on the page renders correctly. So far, it seems to be limited to the tooltips.\n\n\n","answer_pids":["stackoverflow_Passage_3943","stackoverflow_Passage_3945","stackoverflow_Passage_3950","stackoverflow_Passage_3964","stackoverflow_Passage_6107","stackoverflow_Passage_8416","stackoverflow_Passage_10171"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1827","query":"What is the difference between oracle's 'yy' and 'rr' date mask? | Example:\n\n\n\n```\nselect ename from emp where hiredate = todate('01\/05\/81','dd\/mm\/yy')\n\n```\n\nand \n\n\n\n```\nselect ename from emp where hiredate = todate('01\/05\/81','dd\/mm\/rr')\n\n```\n\nreturn different results\n\n\n","answer_pids":["stackoverflow_Passage_6928","stackoverflow_Passage_6929","stackoverflow_Passage_6980","stackoverflow_Passage_9339","stackoverflow_Passage_12421","stackoverflow_Passage_68274","stackoverflow_Passage_680569"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1516","query":"How do you use #define? | I'm wondering about instances when it makes sent to use #define and #if statements. I've known about it for a while, but never incorporated it into my way of coding. How exactly does this affect the compilation?\n\n\n\n> \n> Is #define the only thing that determines if the code is included when compiled? If I have #define DEBUGme as a custom symbol, the only way to exclude it from compile is to remove this #define statement?\n> \n> \n> \n\n\n","answer_pids":["stackoverflow_Passage_5572","stackoverflow_Passage_5576","stackoverflow_Passage_5577","stackoverflow_Passage_5578","stackoverflow_Passage_5584","stackoverflow_Passage_5586","stackoverflow_Passage_5666","stackoverflow_Passage_5671","stackoverflow_Passage_9006"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1385","query":"Has anyone used NUnitLite with any success? | I've recently started work on the Compact Framework and I was wondering if anyone had some recommendations for unit testing beyond what's in VS 2008. MSTest is *ok*, but debugging the tests is a nightmare and the test runner is *so* slow.\n\n\nI see that NUnitLite on codeplex is an option, but it doesn't look very active; it's also in the roadmap for NUnit 3.0, but who knows when that will come out. Has anyone had any success with it?\n\n\n","answer_pids":["stackoverflow_Passage_5073","stackoverflow_Passage_9513","stackoverflow_Passage_10519"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_209","query":"Can a Windows dll retrieve its own filename? | A Windows process created from an exe file has access to the command string which invoked it, including its file's path and filename. eg. `C:\\MyApp\\MyApp.exe --help`.\n\n\nBut this is not so for a dll invoked via `LoadLibrary`. Does anyone know of a way for a function loaded via dll to find out what its path and filename is?\n\n\nSpecifically I'm interested in a Delphi solution, but I suspect that the answer would be pretty much the same for any language.\n\n\n","answer_pids":["stackoverflow_Passage_565","stackoverflow_Passage_2043"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1508","query":"Runtime Configuration in .Net (specifically the EntLib) | I'm looking for a way to configure a DB connection at runtime; specifically using the Enterprise Library. I see that there's a \\*.Data.Configuration (or something close to this ... don't recall off the top of my head) assembly but am finding not much on the interwebs. Complicating matters is the fact that the API help is broken on Vista.\n\n\nNow, I found this work-around:\n\n\n\n```\nConfiguration cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);\nConnectionStringSettings connection = new ConnectionStringSettings();\nconnection.Name = \"Runtime Connection\";\nconnection.ProviderName = \"System.Data.OleDb\";\nconnection.ConnectionString = \"myconstring\";\ncfg.ConnectionStrings.ConnectionStrings.Add(connection);\ncfg.Save(ConfigurationSaveMode.Modified);\n\nConfigurationManager.RefreshSection(\"connectionStrings\");\nvar runtimeCon = DatabaseFactory.CreateDatabase(\"Runtime Connection\");\n\n```\n\nAnd although it gives me what I want, it permanently edits the App.config. Sure I can go back and delete the changes, but I'd rather not go through this hassle.\n\n\n","answer_pids":["stackoverflow_Passage_5549","stackoverflow_Passage_5555","stackoverflow_Passage_5815"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_285","query":"SQL Server 2005 For XML Explicit - Need help formatting | I have a table with a structure like the following:\n\n\n\n\n---\n\n\n\n\n\n| LocationID | AccountNumber |\n| --- | --- |\n| long-guid-here | 12345 |\n| long-guid-here | 54321 |\n\n\n\nTo pass into another stored procedure, I need the XML to look like this:\n\n\n\n```\n<root> \n <clientID>12345<\/clientID>\n <clientID>54321<\/clientID>\n<\/root>\n\n```\n\nThe best I've been able to do so far was getting it like this:\n\n\n\n```\n<root clientID=\"10705\"\/>\n\n```\n\nI'm using this SQL statement:\n\n\n\n```\nSELECT\n 1 as tag,\n null as parent,\n AccountNumber as 'root!1!clientID'\nFROM\n Location.LocationMDAccount\nWHERE\n locationid = 'long-guid-here'\nFOR XML EXPLICIT\n\n```\n\nSo far, I've looked at the documentation on [the MSDN page](http:\/\/msdn.microsoft.com\/en-us\/library\/ms345137.aspx), but I've not come out with the desired results.\n\n\n\n\n---\n\n\n@KG,\n\n\nYours gave me this output actually:\n\n\n\n```\n<root>\n <Location.LocationMDAccount>\n <clientId>10705<\/clientId>\n <\/Location.LocationMDAccount>\n<\/root>\n\n```\n\nI'm going to stick with the `FOR XML EXPLICIT` from Chris Leon for now.\n\n\n","answer_pids":["stackoverflow_Passage_814","stackoverflow_Passage_816","stackoverflow_Passage_817","stackoverflow_Passage_2824","stackoverflow_Passage_4689","stackoverflow_Passage_121348"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_457","query":"Upgrade to ASP.NET 3.x | I am currently aware that ASP.NET 2.0 is out and about and that there are 3.x versions of the .Net Framework.\n\n\nIs it possible to upgrade my ASP.NET web server to version 3.x of the .Net Framework?\n\n\n\n\n---\n\n\nI have tried this, however, when selecting which version of the .Net framwork to use in IIS (the ASP.NET Tab), only version 1.1 and 2.0 show.\n\n\nIs there a work around?\n\n\n","answer_pids":["stackoverflow_Passage_1417","stackoverflow_Passage_1418","stackoverflow_Passage_1419","stackoverflow_Passage_1420","stackoverflow_Passage_4551","stackoverflow_Passage_4552","stackoverflow_Passage_4648"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_501","query":"Locking a SQL Server Database with PHP | I'm wanting extra security for a particular point in my web app. So I want to lock the database (SQL Server 2005). Any suggestions or is this even necessary with SQL Server?\n\n\n**Edit on question:**\n\n\nThe query is failing silently with no errors messages logged, and does not occur inside of a transaction.\n\n\n**Final Solution:**\n\n\nI never was able to solve the problem, however what I wound up doing was switching to MySQL and using a transactional level query here. This was not the main or even a primary reason to switch. I had been having problems with SQL Server and it allowed me to have our CMS and various other tools all running on the same database. Previous we had a SQL Server and a MySQL database running to run our site. The port was a bit on the time consuming however in the long run I feel it will work much better for the site and the business.\n\n\n","answer_pids":["stackoverflow_Passage_1524","stackoverflow_Passage_5030","stackoverflow_Passage_11526"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_563","query":"Better windows command line shells | Is there a better windows command line shell other than `cmd` which has better copy paste between Windows' windows and console windows?\n\n\n","answer_pids":["stackoverflow_Passage_1738","stackoverflow_Passage_1739","stackoverflow_Passage_1769","stackoverflow_Passage_1774","stackoverflow_Passage_1790","stackoverflow_Passage_5817","stackoverflow_Passage_8814","stackoverflow_Passage_9324","stackoverflow_Passage_12687","stackoverflow_Passage_13193","stackoverflow_Passage_40698","stackoverflow_Passage_69559","stackoverflow_Passage_152515","stackoverflow_Passage_152538","stackoverflow_Passage_224751","stackoverflow_Passage_271567"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1518","query":"Minimize javascript HTTP calls from AjaxControlToolkit controls? | I love the ease that the ASP.NET Ajax control Toolkit provides to ASP.NET developers. However, I've not found it to be a scalable solution at all. I have a page with 2 date input fields. By putting a TextBox and an CalendarExtendar control attached to it for each date field, I get several (11, in fact) external Javascript calls to \/ScriptResource.axd?d=xxxx\n\n\nIs there any way to control this? Why does it suck so much? What's a better Ajax toolkit for .NET that can provide equal (or better) set of functionality that is more scalable, straight forward and completely customizable? NOT looking to reinvent the wheel here.\n\n\n","answer_pids":["stackoverflow_Passage_5599","stackoverflow_Passage_5623","stackoverflow_Passage_9016"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_51","query":"Best Practice: Collaborative Environment, Bin Directory, SVN | What are the best practices for checking in BIN directories in a collaborative development environment using SVN? Should project level references be excluded from checkin? Is it easier to just add all bin directories?\n\n\nI develop a lot of DotNetNuke sites and it seems that in a multi-developer environment, it's always a huge task to get the environment setup correctly.\n\n\nThe ultimate goal (of course) is to have a new developer checkout the trunk from SVN, restore the DNN database and have it all just 'work'...\n\n\n","answer_pids":["stackoverflow_Passage_87","stackoverflow_Passage_88","stackoverflow_Passage_143","stackoverflow_Passage_266","stackoverflow_Passage_3462","stackoverflow_Passage_9683"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_228","query":"ASP.NET URL Rewriting | How do I rewrite a URL in ASP.NET?\n\n\nI would like users to be able to go to\n\n\n\n```\nhttp:\/\/www.website.com\/users\/smith\n\n```\n\ninstead of\n\n\n\n```\nhttp:\/\/www.website.com\/?user=smith\n\n```\n\n","answer_pids":["stackoverflow_Passage_618","stackoverflow_Passage_2267","stackoverflow_Passage_2485","stackoverflow_Passage_21581"],"dataset":"stackoverflow"} +{"qid":"stackoverflow_Query_1309","query":"How to schedule a batch process in asp.net | I want to run a weekly batch process in an asp.net page. How can that be done?\n\n\nThanks\n\n\n","answer_pids":["stackoverflow_Passage_4767","stackoverflow_Passage_4771","stackoverflow_Passage_8719","stackoverflow_Passage_12708"],"dataset":"stackoverflow"}