qid
stringlengths
13
35
query
stringlengths
12
186k
answer_pids
sequencelengths
1
214
dataset
stringclasses
12 values
stackoverflow_Query_1312
How can I permanently enable line numbers in IntelliJ? | How can I permanently enable line numbers in IntelliJ IDEA?
[ "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" ]
stackoverflow
stackoverflow_Query_1574
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? * `var p = new { FirstName = "Bill", LastName = "Gates" };` * `Console.WriteLine("{0} {1}", p.FirstName, p.LastName);` * `Console.WriteLine(p.FirstName + " " + p.LastName);` Do you rather use format or do you simply concat strings? What is your favorite? Is one of these hurting your eyes? Do you have any rational arguments to use one and not the other? I'd go for the second one.
[ "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" ]
stackoverflow
stackoverflow_Query_1897
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. What driver and/or connection string is needed to connect to Sql Svr and what is the syntax to use in PHP? --- Update: 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.
[ "stackoverflow_Passage_7213", "stackoverflow_Passage_7215", "stackoverflow_Passage_7440", "stackoverflow_Passage_9501" ]
stackoverflow
stackoverflow_Query_1537
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. ``` if (System.IO.Directory.Exists(photosLocation)) { string[] files = System.IO.Directory.GetFiles(photosLocation, "*.jpg"); if (files.Length > 0) { // TODO: return the url of the first file found; } } ```
[ "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" ]
stackoverflow
stackoverflow_Query_1099
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?
[ "stackoverflow_Passage_3879", "stackoverflow_Passage_3882", "stackoverflow_Passage_3899", "stackoverflow_Passage_3925", "stackoverflow_Passage_8387", "stackoverflow_Passage_8568", "stackoverflow_Passage_11745" ]
stackoverflow
stackoverflow_Query_1396
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. When 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. Will 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.
[ "stackoverflow_Passage_5137", "stackoverflow_Passage_8869" ]
stackoverflow
stackoverflow_Query_234
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. This seems to be a common problem, but I will describe my scenario to help explain: I 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"). ASP.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. However, 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. This 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. And 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. So, again, I need a way for the page ViewState to be updated on callback after the AJAX method is fired.
[ "stackoverflow_Passage_645", "stackoverflow_Passage_653", "stackoverflow_Passage_1486", "stackoverflow_Passage_1712", "stackoverflow_Passage_1720", "stackoverflow_Passage_4909" ]
stackoverflow
stackoverflow_Query_1476
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?
[ "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" ]
stackoverflow
stackoverflow_Query_1824
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.. Currently: I have three arrays of regex, one for valid filenames, one for files missing an episode name, and one for valid paths. Then, 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. The current code can be found [here](http://github.com/dbr/checktveps/tree/8a6dc68ad61e684c8d8f0ca1dc37a22d1c51aa82/2checkTvEps.py) I 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.. How could I write this system in a more expandable way? The rules it needs to check would be.. * 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` * If filename is in the format `Show Name - [01x23].avi` display it a 'missing episode name' section of the output * 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) * each `Show Name/season 1/` folder should contain "folder.jpg" .any ideas? While I'm trying to check TV episodes, this concept/code should be able to apply to many things.. The only thought I had was a list of dicts in the format: ``` checker = [ { 'name':'valid files', 'type':'file', 'function':check_valid(), # runs check_valid() on all files 'status':0 # if it returns True, this is the status the file gets } ```
[ "stackoverflow_Passage_7055", "stackoverflow_Passage_7678", "stackoverflow_Passage_9574" ]
stackoverflow
stackoverflow_Query_23
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). I have implemented `QueryPerformanceCounter` by giving the uSeconds since the process start up: ``` BOOL QueryPerformanceCounter(LARGE_INTEGER* performanceCount) { gettimeofday(&currentTimeVal, NULL); performanceCount->QuadPart = (currentTimeVal.tv_sec - startTimeVal.tv_sec); performanceCount->QuadPart *= (1000 * 1000); performanceCount->QuadPart += (currentTimeVal.tv_usec - startTimeVal.tv_usec); return true; } ``` This, 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. So *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.
[ "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" ]
stackoverflow
stackoverflow_Query_1762
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. Can I have a recommendation for a TCL debugging environment for Windows, please?
[ "stackoverflow_Passage_7938", "stackoverflow_Passage_10156", "stackoverflow_Passage_11683", "stackoverflow_Passage_11755", "stackoverflow_Passage_13033", "stackoverflow_Passage_104398", "stackoverflow_Passage_111744" ]
stackoverflow
stackoverflow_Query_1133
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. Please provide reasons for your opinions, not just "Singletons are for lazy programmers!" Here is a fairly good article on the issue, although it is against the use of Singletons: [scientificninja.com: performant-singletons](http://web.archive.org/web/20090303174418/http://scientificninja.com/advice/performant-singletons). Does anyone have any other good articles on them? Maybe in support of Singletons?
[ "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" ]
stackoverflow
stackoverflow_Query_514
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? Not 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.
[ "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" ]
stackoverflow
stackoverflow_Query_1083
Passing more parameters in C function pointers | Let's say I'm creating a chess program. I have a function ``` void foreachMove( void (*action)(chess_move*), chess_game* game); ``` which 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: ``` chess_move getNextMove(chess_game* game, int depth){ //for each valid move, determine how good the move is foreachMove(moveHandler, game); } void moveHandler(chess_move* move){ //uh oh, now I need the variables "game" and "depth" from the above function } ``` Redefining 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. How can I pass extra parameters to a function that I'm calling through a pointer?
[ "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" ]
stackoverflow
stackoverflow_Query_958
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. What would you, as a member of a user community, look for in order to keep you coming back month to month?
[ "stackoverflow_Passage_3313", "stackoverflow_Passage_3315", "stackoverflow_Passage_3323", "stackoverflow_Passage_8151" ]
stackoverflow
stackoverflow_Query_1220
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? For 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. In 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". I'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.
[ "stackoverflow_Passage_4366", "stackoverflow_Passage_4367", "stackoverflow_Passage_4425", "stackoverflow_Passage_8584" ]
stackoverflow
stackoverflow_Query_781
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. I 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. We 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.
[ "stackoverflow_Passage_2612", "stackoverflow_Passage_2629", "stackoverflow_Passage_3112", "stackoverflow_Passage_7785" ]
stackoverflow
stackoverflow_Query_788
Creating Redundancy for a Subversion Repository? | What is the best way to create redundant subversion repositories? I 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. I 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
[ "stackoverflow_Passage_2647", "stackoverflow_Passage_2648", "stackoverflow_Passage_3072", "stackoverflow_Passage_7811" ]
stackoverflow
stackoverflow_Query_130
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.
[ "stackoverflow_Passage_307", "stackoverflow_Passage_310", "stackoverflow_Passage_320", "stackoverflow_Passage_8890", "stackoverflow_Passage_9158", "stackoverflow_Passage_10389", "stackoverflow_Passage_12196" ]
stackoverflow
stackoverflow_Query_1221
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... Basically I'm just try to load an `XmlNodeList` into an `XmlDocument` and I was wondering if there's a more efficient method than looping. ``` Private Function GetPreviousMonthsXml(ByVal months As Integer, ByVal startDate As Date, ByVal xDoc As XmlDocument, ByVal path As String, ByVal nodeName As String) As XmlDocument '' build xpath string with list of months to return Dim xp As New StringBuilder("//") xp.Append(nodeName) xp.Append("[") For i As Integer = 0 To (months - 1) '' get year and month portion of date for datestring xp.Append("starts-with(@Id, '") xp.Append(startDate.AddMonths(-i).ToString("yyyy-MM")) If i < (months - 1) Then xp.Append("') or ") Else xp.Append("')]") End If Next '' *** This is the block that needs to be refactored *** '' import nodelist into an xmldocument Dim xnl As XmlNodeList = xDoc.SelectNodes(xp.ToString()) Dim returnXDoc As New XmlDocument(xDoc.NameTable) returnXDoc = xDoc.Clone() Dim nodeParents As XmlNodeList = returnXDoc.SelectNodes(path) For Each nodeParent As XmlNode In nodeParents For Each nodeToDelete As XmlNode In nodeParent.SelectNodes(nodeName) nodeParent.RemoveChild(nodeToDelete) Next Next For Each node As XmlNode In xnl Dim newNode As XmlNode = returnXDoc.ImportNode(node, True) returnXDoc.DocumentElement.SelectSingleNode("//" & node.ParentNode.Name & "[@Id='" & newNode.Attributes("Id").Value.Split("-")(0) & "']").AppendChild(newNode) Next '' *** end *** Return returnXDoc End Function ```
[ "stackoverflow_Passage_5775", "stackoverflow_Passage_9058" ]
stackoverflow
stackoverflow_Query_1982
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. I 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.
[ "stackoverflow_Passage_7557", "stackoverflow_Passage_7666", "stackoverflow_Passage_9532", "stackoverflow_Passage_12668" ]
stackoverflow
stackoverflow_Query_1393
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. What 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: ``` declare c_lookup_codes for select distinct lookup_code from #workinprogress while(1=1) begin fetch c_lookup_codes into @lookup_code if @@sqlstatus<>0 begin break end exec proc_code_xref @lookup_code @xref_code OUTPUT update #workinprogress set xref = @xref_code where lookup_code = @lookup_code end ``` Now then, whilst this may give some folks palpitations, it does work. My question is, how best would one avoid this kind of thing? \_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.\_
[ "stackoverflow_Passage_5134", "stackoverflow_Passage_5151", "stackoverflow_Passage_8875", "stackoverflow_Passage_12365" ]
stackoverflow
stackoverflow_Query_1622
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. I 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. Does anyone know how to make `VS 2008` dismiss the window on the *release* of the `ctrl` key?
[ "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" ]
stackoverflow
stackoverflow_Query_327
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?
[ "stackoverflow_Passage_956", "stackoverflow_Passage_969", "stackoverflow_Passage_3217", "stackoverflow_Passage_55485", "stackoverflow_Passage_179521", "stackoverflow_Passage_612067", "stackoverflow_Passage_1016464" ]
stackoverflow
stackoverflow_Query_1285
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. The 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. The two networks are connected by a hardware VPN solution, which is decent, but obviously not the speediest thing in the world. The 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. So 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? It is worth mentioning that the more "real time" these updates occur, the better. Not that it has to be instant, just reasonably quick. So far, I have thought about using the following types of approaches: 1. Bi-directional replication 2. Web service interfaces on both sides with code to sync the changes as they are made (in real time). 3. Web service interfaces on both sides with code to asynchronously sync the changes (using a queueing mechanism). Any advice? Has anyone run into this problem before? Did you come up with a solution that worked well for you?
[ "stackoverflow_Passage_4671", "stackoverflow_Passage_4675", "stackoverflow_Passage_7154", "stackoverflow_Passage_8694", "stackoverflow_Passage_8980", "stackoverflow_Passage_10180" ]
stackoverflow
stackoverflow_Query_313
What is Inversion of Control? | Inversion of Control (IoC) can be quite confusing when it is first encountered. 1. What is it? 2. Which problem does it solve? 3. When is it appropriate to use and when not?
[ "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" ]
stackoverflow
stackoverflow_Query_224
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? Also, 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?
[ "stackoverflow_Passage_2820", "stackoverflow_Passage_2830", "stackoverflow_Passage_3388", "stackoverflow_Passage_7893", "stackoverflow_Passage_10508" ]
stackoverflow
stackoverflow_Query_1763
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: ``` <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none"> a:ActionNotSupported </faultcode> <faultstring xml:lang="en-GB"> The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None). </faultstring> </s:Fault> </s:Body> </s:Envelope> ``` I've fixed the problem but didn't enjoy the experience! Does anyone have any tips or tools for debugging problems like this?
[ "stackoverflow_Passage_6654", "stackoverflow_Passage_9272" ]
stackoverflow
stackoverflow_Query_96
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. I 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?
[ "stackoverflow_Passage_216", "stackoverflow_Passage_226", "stackoverflow_Passage_458", "stackoverflow_Passage_1618", "stackoverflow_Passage_2655", "stackoverflow_Passage_45453", "stackoverflow_Passage_653402" ]
stackoverflow
stackoverflow_Query_1547
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? I'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? @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. @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?
[ "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" ]
stackoverflow
stackoverflow_Query_186
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? I expect this list to be varied and to cover a wide range of things. **To search:** Use the search box in the upper-right corner. To search the answers of the current question, use `inquestion:this`. For example: ``` inquestion:this "Code Complete" ```
[ "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" ]
stackoverflow
stackoverflow_Query_1010
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. I 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. Unfortunately, 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. Is 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?
[ "stackoverflow_Passage_3565", "stackoverflow_Passage_3580", "stackoverflow_Passage_8260", "stackoverflow_Passage_13558" ]
stackoverflow
stackoverflow_Query_1043
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? It'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.
[ "stackoverflow_Passage_7689", "stackoverflow_Passage_7693", "stackoverflow_Passage_7780", "stackoverflow_Passage_9583" ]
stackoverflow
stackoverflow_Query_283
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`. This 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. It 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). Is 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?
[ "stackoverflow_Passage_805", "stackoverflow_Passage_915", "stackoverflow_Passage_2807" ]
stackoverflow
stackoverflow_Query_1879
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? A GUI tool where I can visually compare the unchanged-changed source lines would be great.
[ "stackoverflow_Passage_7146", "stackoverflow_Passage_7147", "stackoverflow_Passage_9407", "stackoverflow_Passage_123824", "stackoverflow_Passage_572323" ]
stackoverflow
stackoverflow_Query_741
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: > > System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for > 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 > transactions. (Exception from HRESULT: 0x8004D024) at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 > propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, > Guid& transactionIdentifier, OletxTransactionIsolationLevel& > isolationLevel, ITransactionShim& transactionShim).... > > > I 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. I was wondering if this was a database issue? If so, how can I resolve it?
[ "stackoverflow_Passage_2446", "stackoverflow_Passage_2449", "stackoverflow_Passage_2651", "stackoverflow_Passage_11776", "stackoverflow_Passage_471181", "stackoverflow_Passage_536494", "stackoverflow_Passage_1016574" ]
stackoverflow
stackoverflow_Query_817
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.
[ "stackoverflow_Passage_2760", "stackoverflow_Passage_7856" ]
stackoverflow
stackoverflow_Query_1195
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? ``` select datepart(dw, getdate()); ``` This will return 1-7, with Sunday being 1. I would like 'Sunday' instead of 1.
[ "stackoverflow_Passage_4286", "stackoverflow_Passage_4287", "stackoverflow_Passage_4288", "stackoverflow_Passage_4289", "stackoverflow_Passage_8556" ]
stackoverflow
stackoverflow_Query_1838
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. As such, is there any way to check to see if the user is currently idle if the application is minimized to the system tray?
[ "stackoverflow_Passage_6972", "stackoverflow_Passage_6973", "stackoverflow_Passage_7263", "stackoverflow_Passage_9350" ]
stackoverflow
stackoverflow_Query_877
grep: show lines surrounding each match | How do I `grep` and show the preceding and following 5 lines surrounding each matched line?
[ "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" ]
stackoverflow
stackoverflow_Query_1197
What do the different brackets in Ruby mean? | In Ruby, what's the difference between `{}` and `[]`? `{}` seems to be used for both code blocks and hashes. Are `[]` only for arrays? The documention isn't very clear.
[ "stackoverflow_Passage_4302", "stackoverflow_Passage_4315", "stackoverflow_Passage_4845", "stackoverflow_Passage_8747", "stackoverflow_Passage_10229", "stackoverflow_Passage_12069", "stackoverflow_Passage_12769" ]
stackoverflow
stackoverflow_Query_1529
How to insert/replace XML tag in XmlDocument? | I have a `XmlDocument` in java, created with the `Weblogic XmlDocument` parser. I want to replace the content of a tag in this `XMLDocument` with my own data, or insert the tag if it isn't there. ``` <customdata> <tag1 /> <tag2>mfkdslmlfkm</tag2> <location /> <tag3 /> </customdata> ``` For example I want to insert a URL in the location tag: ``` <location>http://something</location> ``` but otherwise leave the XML as is. Currently I use a `XMLCursor`: ``` XmlObject xmlobj = XmlObject.Factory.parse(a.getCustomData(), options); XmlCursor xmlcur = xmlobj.newCursor(); while (xmlcur.hasNextToken()) { boolean found = false; if (xmlcur.isStart() && "schema-location".equals(xmlcur.getName().toString())) { xmlcur.setTextValue("http://replaced"); System.out.println("replaced"); found = true; } else if (xmlcur.isStart() && "customdata".equals(xmlcur.getName().toString())) { xmlcur.push(); } else if (xmlcur.isEnddoc()) { if (!found) { xmlcur.pop(); xmlcur.toEndToken(); xmlcur.insertElementWithText("schema-location", "http://inserted"); System.out.println("inserted"); } } xmlcur.toNextToken(); } ``` I tried to find a "quick" `xquery` way to do this since the `XmlDocument` has an `execQuery` method, but didn't find it very easy. Do anyone have a better way than this? It seems a bit elaborate.
[ "stackoverflow_Passage_5654", "stackoverflow_Passage_5658", "stackoverflow_Passage_5672", "stackoverflow_Passage_5816", "stackoverflow_Passage_9031" ]
stackoverflow
stackoverflow_Query_538
Accessing a CONST attribute of series of Classes | This is how I wanted to do it which would work in PHP 5.3.0+ ``` <?php class MyClass { const CONSTANT = 'Const var'; } $classname = 'MyClass'; echo $classname::CONSTANT; // As of PHP 5.3.0 ?> ``` But I'm restricted to using PHP 5.2.6. Can anyone think of a simple way to simulate this behavior without instantiating the class?
[ "stackoverflow_Passage_1664", "stackoverflow_Passage_7142", "stackoverflow_Passage_9403" ]
stackoverflow
stackoverflow_Query_1103
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. I 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. [edit] The 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. I'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. Here's the code: ``` repeat with columnNumber from COL_START to COL_END select text of cell ((columnNumber as string) & ":" & (rowNumber as string)) of ThisTable tell activeDocument set thisXmlTag to make XML tag with properties {name:item rowNumber of symbolList & "_" & item columnNumber of my histLabelList} tell rootXmlElement set thisXmlElement to make XML element with properties {markup tag:thisXmlTag} end tell set contents of thisXmlElement to (selection as string) end tell end repeat ``` EDIT: I've rephrased the question to better reflect the correct answer.
[ "stackoverflow_Passage_3891", "stackoverflow_Passage_3892", "stackoverflow_Passage_8263", "stackoverflow_Passage_9567", "stackoverflow_Passage_11195", "stackoverflow_Passage_11728" ]
stackoverflow
stackoverflow_Query_1973
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. The catch though is that I cannot create a local/temporary file that I can then FTP over. The 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. [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) ----------------------------------------------------------------------------------------------------------------------------------------------------------- I 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. [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) -------------------------------------------------------------------------------------------------------------------------------------------------- I 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.
[ "stackoverflow_Passage_7504", "stackoverflow_Passage_7506", "stackoverflow_Passage_7555", "stackoverflow_Passage_8878", "stackoverflow_Passage_10549", "stackoverflow_Passage_93878", "stackoverflow_Passage_223698" ]
stackoverflow
stackoverflow_Query_1525
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. I 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. I hope, the code-fragment is basically understandable… ``` vectorLoop: for( int idx = 0; idx < vectorLength; idx++) { if( conditionAtVectorPosition( v, idx ) ) continue vectorLoop; matrixLoop: for( rowIdx = 0; rowIdx < n; rowIdx++ ) { if( anotherConditionAtVector( v, rowIdx ) ) continue matrixLoop; if( conditionAtMatrixRowCol( m, rowIdx, idx ) ) continue vectorLoop; } setValueInVector( v, idx ); } ``` Please convince me, that there is a more readable/better version without the labels.
[ "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" ]
stackoverflow
stackoverflow_Query_505
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. Is 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?
[ "stackoverflow_Passage_1537", "stackoverflow_Passage_1554", "stackoverflow_Passage_5078", "stackoverflow_Passage_9230" ]
stackoverflow
stackoverflow_Query_1991
XRef Relationships in dbml | So I have a database schema like this: **Users** UserId **RoleUserXRef** RoleUserId RoleId UserId **Roles** With foreign keys defined between User & RoleUserXRef and RoleUserXRef & Role. Basically, I have a one to many relationship between users and roles. How would I model this in dbml, such that the generated User class has a list of Roles that the user has assigned to them?
[ "stackoverflow_Passage_7589", "stackoverflow_Passage_9545" ]
stackoverflow
stackoverflow_Query_542
Alternative Hostname for an IIS web site for internal access only | I'm using IIS in Windows 2003 Server for a SharePoint intranet. External incoming requests will be using the host header `portal.mycompany.com` and be forced to use SSL. I was wondering if there's a way to set up an alternate host header such as `http://internalportal/` which only accepts requests from the internal network, but doesn't force the users to use SSL. Any recommendations for how to set this up?
[ "stackoverflow_Passage_1677", "stackoverflow_Passage_1697", "stackoverflow_Passage_4275", "stackoverflow_Passage_8551" ]
stackoverflow
stackoverflow_Query_292
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. Just 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. I 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). How can I get correct rendering of the control in a disabled state?
[ "stackoverflow_Passage_4583", "stackoverflow_Passage_4603" ]
stackoverflow
stackoverflow_Query_939
How to extend project properties page? | Is it possible to add a custom tab to a project properties page in the Visual Studio 2008? What 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).
[ "stackoverflow_Passage_7738", "stackoverflow_Passage_9604", "stackoverflow_Passage_1016653" ]
stackoverflow
stackoverflow_Query_1316
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: ``` soap:ReceiverSystem.Web.Services.Protocols.SoapException: Server was unable to process request . ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read() at System.Xml.XmlReader.MoveToContent() at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent() at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement() at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) --- End of inner exception stack trace --- ``` The 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? I have tried several web methods, from "Hello World" to paramatized methods...all comeback with the same response... I thought it may have something to do with encoding with the "---&gt", but I'm unsure how to control what .net renders as the response.
[ "stackoverflow_Passage_5411", "stackoverflow_Passage_10169", "stackoverflow_Passage_10771" ]
stackoverflow
stackoverflow_Query_1811
SQL 2008 Dialect Support for NHibernate | Is anyone working on or know if there exists a SQL 2k8 Dialect for NHibernate?
[ "stackoverflow_Passage_6859", "stackoverflow_Passage_9325", "stackoverflow_Passage_12350" ]
stackoverflow
stackoverflow_Query_810
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. However 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. Does anyone have a single query solution?
[ "stackoverflow_Passage_2725", "stackoverflow_Passage_8842", "stackoverflow_Passage_10240", "stackoverflow_Passage_12652" ]
stackoverflow
stackoverflow_Query_1022
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). Currently, 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). According 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. > > The purpose of an asynchronous handler > is to free up an ASP.NET thread pool > thread to service additional requests > while the handler is processing the > original request. > > > This seems fine, except the remoting call still takes up a thread from the thread pool. Is this the same thread pool as the asp.net worker threads? **How should I go about turning my remoting singleton server into an async system such that I free up my asp.net worker threads?** I've probably missed out some important information, please let me know if there is anything else you need to know to answer the question.
[ "stackoverflow_Passage_3581", "stackoverflow_Passage_8261" ]
stackoverflow
stackoverflow_Query_1342
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?
[ "stackoverflow_Passage_4905", "stackoverflow_Passage_8778", "stackoverflow_Passage_9985", "stackoverflow_Passage_10813", "stackoverflow_Passage_475737" ]
stackoverflow
stackoverflow_Query_435
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?
[ "stackoverflow_Passage_1353", "stackoverflow_Passage_1354", "stackoverflow_Passage_4426" ]
stackoverflow
stackoverflow_Query_644
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). We 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?
[ "stackoverflow_Passage_2081", "stackoverflow_Passage_2090", "stackoverflow_Passage_2340", "stackoverflow_Passage_4782", "stackoverflow_Passage_6688" ]
stackoverflow
stackoverflow_Query_1470
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. Actually, error handling in general is a weak-point for LANSA and RDML, but that's another topic.
[ "stackoverflow_Passage_11445", "stackoverflow_Passage_12850" ]
stackoverflow
stackoverflow_Query_1794
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. By 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. In 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). Another 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. Is there any other (simpler) way for doing such things (for example the message queue or anything else)?
[ "stackoverflow_Passage_6777", "stackoverflow_Passage_6790", "stackoverflow_Passage_8098", "stackoverflow_Passage_9309", "stackoverflow_Passage_11373", "stackoverflow_Passage_11375" ]
stackoverflow
stackoverflow_Query_1161
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. 1. What was it like, realizing it and reporting it to your coworkers or customers? 2. What were the lessons learned?
[ "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" ]
stackoverflow
stackoverflow_Query_432
How to include PHP files that require an absolute path? | I have a directory structure like the following; > > script.php > > > inc/include1.php > > inc/include2.php > > > objects/object1.php > > objects/object2.php > > > soap/soap.php > > > Now, 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. So is there a way to use relative paths, or a way to programmatically generate the `"/mnt/webdev/[project name]/"`?
[ "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" ]
stackoverflow
stackoverflow_Query_135
How do I index a database column | Hopefully, I can get answers for each database server. For an outline of how indexing works check out: [How does database indexing work?](https://stackoverflow.com/questions/1108/how-does-database-indexing-work)
[ "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" ]
stackoverflow
stackoverflow_Query_548
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). Also - 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.
[ "stackoverflow_Passage_1879", "stackoverflow_Passage_2950", "stackoverflow_Passage_6094", "stackoverflow_Passage_9301" ]
stackoverflow
stackoverflow_Query_821
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 > > Rendered in 0.062 seconds > > > Occasionally I get rendered times like this > > Rendered in 0.000 seconds > > > Currently 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 > > Rendered in less than a second > > > I 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.
[ "stackoverflow_Passage_2773", "stackoverflow_Passage_2775", "stackoverflow_Passage_2785", "stackoverflow_Passage_3614", "stackoverflow_Passage_7869" ]
stackoverflow
stackoverflow_Query_646
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. I 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). Is there a third method that works across all the most popular browsers?
[ "stackoverflow_Passage_2064", "stackoverflow_Passage_2065", "stackoverflow_Passage_2066", "stackoverflow_Passage_2089", "stackoverflow_Passage_2188", "stackoverflow_Passage_6639", "stackoverflow_Passage_1016616" ]
stackoverflow
stackoverflow_Query_1648
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? (Ideally some problem that cannot be solved some other way)
[ "stackoverflow_Passage_6167", "stackoverflow_Passage_6174", "stackoverflow_Passage_6186", "stackoverflow_Passage_6187", "stackoverflow_Passage_6196", "stackoverflow_Passage_12829", "stackoverflow_Passage_13412", "stackoverflow_Passage_395519" ]
stackoverflow
stackoverflow_Query_1981
ASP/VBScript - Int() vs CInt() | What is the difference in ASP/VBScript between `Int()` and `CInt()`?
[ "stackoverflow_Passage_7548", "stackoverflow_Passage_8039", "stackoverflow_Passage_9529", "stackoverflow_Passage_11569", "stackoverflow_Passage_35252" ]
stackoverflow
stackoverflow_Query_1683
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?
[ "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" ]
stackoverflow
stackoverflow_Query_469
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?
[ "stackoverflow_Passage_13287" ]
stackoverflow
stackoverflow_Query_114
String literals and escape characters in postgresql | Attempting to insert an escape character into a table results in a warning. For example: ``` create table EscapeTest (text varchar(50)); insert into EscapeTest (text) values ('This is the first part \n And this is the second'); ``` Produces the warning: ``` WARNING: nonstandard use of escape in a string literal ``` (*Using PSQL 8.2*) Anyone know how to get around this?
[ "stackoverflow_Passage_264", "stackoverflow_Passage_268", "stackoverflow_Passage_937", "stackoverflow_Passage_9967", "stackoverflow_Passage_10495", "stackoverflow_Passage_13106" ]
stackoverflow
stackoverflow_Query_1589
VS.NET Application Diagrams | Have you used VS.NET Architect Edition's Application and System diagrams to start designing a solution? If so, did you find it useful? Did the "automatic implementation" feature work ok?
[ "stackoverflow_Passage_7417", "stackoverflow_Passage_7889", "stackoverflow_Passage_8343", "stackoverflow_Passage_9684" ]
stackoverflow
stackoverflow_Query_1573
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. Assumptions: 1. Assume an address in the US (for now) 2. assume that the input string will sometimes contain an addressee (the person being addressed) and/or a second street address (i.e. Suite B) 3. states may be abbreviated 4. zip code could be standard 5 digits or zip+4 5. there are typos in some instances UPDATE: 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) Sample Data: * A. P. Croll & Son 2299 Lewes-Georgetown Hwy, Georgetown, DE 19947 * 11522 Shawnee Road, Greenwood DE 19950 * 144 Kings Highway, S.W. Dover, DE 19901 * Intergrated Const. Services 2 Penns Way Suite 405 New Castle, DE 19720 * Humes Realty 33 Bridle Ridge Court, Lewes, DE 19958 * Nichols Excavation 2742 Pulaski Hwy Newark, DE 19711 * 2284 Bryn Zion Road, Smyrna, DE 19904 * VEI Dover Crossroads, LLC 1500 Serpentine Road, Suite 100 Baltimore MD 21 * 580 North Dupont Highway Dover, DE 19901 * P.O. Box 778 Dover, DE 19903
[ "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" ]
stackoverflow
stackoverflow_Query_1726
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?
[ "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" ]
stackoverflow
stackoverflow_Query_664
How to wait for thread complete before continuing? | I have some code for starting a thread on the .NET CF 2.0: ``` ThreadStart tStart = new ThreadStart(MyMethod); Thread t = new Thread(tStart); t.Start(); ``` If 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?
[ "stackoverflow_Passage_2182", "stackoverflow_Passage_2243", "stackoverflow_Passage_6476", "stackoverflow_Passage_7095" ]
stackoverflow
stackoverflow_Query_1402
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. I'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? I 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.
[ "stackoverflow_Passage_5141", "stackoverflow_Passage_7879", "stackoverflow_Passage_7881", "stackoverflow_Passage_8871", "stackoverflow_Passage_13354" ]
stackoverflow
stackoverflow_Query_449
What was the <XMP> tag used for? | Does anyone remember the `XMP` tag? What was it used for and why was it deprecated?
[ "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" ]
stackoverflow
stackoverflow_Query_1140
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?
[ "stackoverflow_Passage_4030", "stackoverflow_Passage_4070", "stackoverflow_Passage_4746", "stackoverflow_Passage_8444", "stackoverflow_Passage_11714", "stackoverflow_Passage_300764" ]
stackoverflow
stackoverflow_Query_1409
UrlEncode through a console application? | Normally I would just use: ``` HttpContext.Current.Server.UrlEncode("url"); ``` But since this is a console application, `HttpContext.Current` is always going to be `null`. Is there another method that does the same thing that I could use?
[ "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" ]
stackoverflow
stackoverflow_Query_1310
In Cocoa do you prefer NSInteger or int, and why? | `NSInteger`/`NSUInteger` are Cocoa-defined replacements for the regular built-in types. Is 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?
[ "stackoverflow_Passage_4770", "stackoverflow_Passage_4775", "stackoverflow_Passage_4788", "stackoverflow_Passage_8721", "stackoverflow_Passage_11037", "stackoverflow_Passage_174069" ]
stackoverflow
stackoverflow_Query_552
Debugging: IE6 + SSL + AJAX + post form = 404 error | **The Setting:** The 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). **Code Snippet:** ``` > function testPost() { >> dojo.xhrPost( { url: ''dr_tm_w_0120.test_post'', form: ''orgForm'', load: testPostXHRCallback, error: testPostXHRError }); } > function testPostXHRCallback(data,ioArgs) { >> alert(''post callback''); try{ dojo.byId("messageDiv").innerHTML = data; } catch(ex){ if(ex.name == "TypeError") { alert("A type error occurred."); } } return data; } > function testPostXHRError(data, ioArgs) { >> alert(data); alert(''Error when retrieving data from the server!''); return data; } ``` **The Problem:** When using IE6 (which the entire user-base uses), the response sent back from the server is a 404 error. **Observations:** The program works fine in Firefox. The calling procedure cannot target any procedures within the same package. The calling procedure can target outside sites (both http, https). The other AJAX calls in the package that are not posts of form data work fine. I've searched the *internets* and consulted with senior-skilled team members and haven't discovered anything that satisfactorily addresses the issue. \*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. **The Questions:** What troubleshooting techniques do you recommend? What troubleshooting tools do you recommend for HTTPS analyzing? Any hypotheses on what the issue might be? Any ideas for workarounds that aren't total (bad) hacks? **Ed. The Solution** lomaxx, 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): ``` > 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 ``` After 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. I 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. Well, 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.
[ "stackoverflow_Passage_1708", "stackoverflow_Passage_5622" ]
stackoverflow
stackoverflow_Query_777
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')` I 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 :). Maybe something in my MySQL config is goofy? Not sure where to look exactly. Other relevant details: ``` Python 2.5 Pylons: 0.9.6.2 (w/ sql_alchemy) MySQL: 5.0.51 ```
[ "stackoverflow_Passage_5393", "stackoverflow_Passage_9340", "stackoverflow_Passage_10460" ]
stackoverflow
stackoverflow_Query_946
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: ``` var iWeeks = 6; for (int w = 0; w < iWeeks; w++) { ``` This works fine, however, some month will only have 5 weeks and in some rare cases, 4. How can I calculate the number of rows that will be required for a particular month? This is an example of what I am creating: ![enter image description here](https://i.stack.imgur.com/NkxN7.png) As 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. ***Image found on google*** --- This is an example of what I am creating: ![enter image description here](https://i.stack.imgur.com/NkxN7.png) As 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. ***Image found on google***
[ "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" ]
stackoverflow
stackoverflow_Query_334
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. This 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. By using ``` Response.ContentType = "application/octet-stream"; ``` I 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. using ``` Response.ContentType = "application/x-shockwave-flash"; ``` I can get flash files to play, but then the images are messed. So how do i **easily** choose the contenttype?
[ "stackoverflow_Passage_975", "stackoverflow_Passage_5063", "stackoverflow_Passage_6295", "stackoverflow_Passage_8839", "stackoverflow_Passage_911377" ]
stackoverflow
stackoverflow_Query_1993
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.
[ "stackoverflow_Passage_7827", "stackoverflow_Passage_8990", "stackoverflow_Passage_9650" ]
stackoverflow
stackoverflow_Query_1493
Choosing a new development machine | I'm not sure how this question will be recieved here but lets give it a shot... It's time for me to get a new dev PC. What's the best choice these days? I 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. =) I 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? Is it worth going to 64 bit Vista as well? It's been a while since I got a new machine so I'm just looking for some guidance. Thanks
[ "stackoverflow_Passage_5502", "stackoverflow_Passage_5503", "stackoverflow_Passage_5505", "stackoverflow_Passage_5510", "stackoverflow_Passage_5542", "stackoverflow_Passage_5550", "stackoverflow_Passage_9888", "stackoverflow_Passage_9897" ]
stackoverflow
stackoverflow_Query_1093
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. For 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.
[ "stackoverflow_Passage_3864", "stackoverflow_Passage_3883", "stackoverflow_Passage_8374" ]
stackoverflow
stackoverflow_Query_350
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. Is there a SQL client for Mac OS X that works with MS SQL Server?
[ "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" ]
stackoverflow
stackoverflow_Query_1300
GUI system development resources? | Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++? Currently 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. This 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. Any response would be appreciated. **Edit:** I'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. I 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. **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. Qt in it's current form is not portable to the PSP, never mind the overkill of such a task. That said I've decided to create an IM-GUI, and have started to prototype the code.
[ "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" ]
stackoverflow
stackoverflow_Query_1247
How to setup site-wide variables in php? | I want to define something like this in *php*: ``` $EL = "\n<br />\n"; ``` and then use that variable as an "endline" marker all over my site, like this: ``` echo "Blah blah blah{$EL}"; ``` How 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?
[ "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" ]
stackoverflow
stackoverflow_Query_146
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?
[ "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" ]
stackoverflow
stackoverflow_Query_1327
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?
[ "stackoverflow_Passage_4877", "stackoverflow_Passage_8691", "stackoverflow_Passage_8760", "stackoverflow_Passage_9847" ]
stackoverflow
stackoverflow_Query_1399
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. It seems like a ComboBox would be a good choice, but is there a way to specify a non-blank default value? I could just set it in the code at some appropriate initialisation point, but I feel like I'm missing something.
[ "stackoverflow_Passage_5115", "stackoverflow_Passage_5117", "stackoverflow_Passage_5123", "stackoverflow_Passage_5125", "stackoverflow_Passage_5155", "stackoverflow_Passage_8866" ]
stackoverflow
stackoverflow_Query_1437
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. [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. ps: 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.
[ "stackoverflow_Passage_5286", "stackoverflow_Passage_5291", "stackoverflow_Passage_5539", "stackoverflow_Passage_8386", "stackoverflow_Passage_8997", "stackoverflow_Passage_11348" ]
stackoverflow
stackoverflow_Query_546
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. I'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? I'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.
[ "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" ]
stackoverflow
stackoverflow_Query_1372
When should a multi-module project to split into separate repository trees? | Currently we have a project with a standard subversion repository layout of: ./trunk ./branches ./tags However, as we're moving down the road of OSGi and a modular project, we've ended up with: ./trunk/bundle/main ./trunk/bundle/modulea ./trunk/bundle/moduleb ./tags/bundle/main-1.0.0 ./tags/bundle/main-1.0.1 ./tags/bundle/modulea-1.0.0 The '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: ./bundle/main/trunk ./bundle/main/tags/main-1.0.0 ./bundle/main/tags/main-1.0.1 ./bundle/modulea/trunk ./bundle/modulea/tags/modulea-1.0.0 In 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). Are there guidelines or 'best-practices' over project layouts once one goes modular?
[ "stackoverflow_Passage_5026", "stackoverflow_Passage_5032", "stackoverflow_Passage_6343", "stackoverflow_Passage_8826", "stackoverflow_Passage_11959" ]
stackoverflow
stackoverflow_Query_429
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. Specifically 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.
[ "stackoverflow_Passage_1326", "stackoverflow_Passage_4514", "stackoverflow_Passage_8635", "stackoverflow_Passage_10295", "stackoverflow_Passage_394828" ]
stackoverflow
stackoverflow_Query_727
Where can I find some good WS-Security introductions and tutorials? | Can anyone point me to some decent introductions to WS-Security? I'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. We have to implement a web service in PHP and one or more clients in .NET, so resources covering both would be much appreciated.
[ "stackoverflow_Passage_2405", "stackoverflow_Passage_4236", "stackoverflow_Passage_11501", "stackoverflow_Passage_12217" ]
stackoverflow
stackoverflow_Query_758
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. What's a good way to remove both the quotes and the comma from this so I can put it into an `int` field? **Edit:** The data is actually already in a MySQL table, so I need to be able to this using SQL. Sorry for the mixup.
[ "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" ]
stackoverflow
stackoverflow_Query_333
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. The MIDI device connects to my PC using a USB connector. I'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. I'm happy manipulating the MIDI data once I get it, I just don't want to have to implement the code for its capture. I'm planning on writing my code using the Bloodshed Dev-C++ IDE on Windows XP.
[ "stackoverflow_Passage_1125", "stackoverflow_Passage_8336", "stackoverflow_Passage_12200", "stackoverflow_Passage_12726" ]
stackoverflow