text
stringlengths
8
267k
meta
dict
Q: CSS not being applied on non authenticated ASP.NET page When developing (works fine live) the pages for our website don't pick up the correct CSS until the user has authenticated (logged on). So the Logon and Logoff forms look bad, but once inside the site, the CSS works again. I'm guessing it's some kind of authent...
{ "language": "en", "url": "https://stackoverflow.com/questions/55594", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Best Technique for Multiple Eval Fields in Gridview ItemTemplate? What is the best way to use multiple EVAL fields in a GridView ItemTemplate? Looking to have some control over formatting for appearance as well as setting up hyperlinks/javascript etc. A: Even clearer, IMO, is: <%# String.Format("{0} - {1}", Eval("N...
{ "language": "en", "url": "https://stackoverflow.com/questions/55607", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "35" }
Q: JavaScript private methods To make a JavaScript class with a public method I'd do something like: function Restaurant() {} Restaurant.prototype.buy_food = function(){ // something here } Restaurant.prototype.use_restroom = function(){ // something here } That way users of my class can: var restaurant = new ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55611", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "545" }
Q: CSS to select/style first word This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this? A: You have to...
{ "language": "en", "url": "https://stackoverflow.com/questions/55612", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "93" }
Q: Where is the console API for WebKit/Safari? WebKit/Safari supports the console object, which is similar to what Firebug does. But what exactly is supported? There is a console documentation for Firebug, but where can I find the console documentation for Safari/WebKit? A: Supported methods were originally: * *con...
{ "language": "en", "url": "https://stackoverflow.com/questions/55633", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "64" }
Q: How do you communicate between Windows Vista Session 0 and Desktop? In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55639", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Unicode Processing in C++ What is the best practice of Unicode processing in C++? A: * *Use ICU for dealing with your data (or a similar library) *In your own data store, make sure everything is stored in the same encoding *Make sure you are always using your unicode library for mundane tasks like string length...
{ "language": "en", "url": "https://stackoverflow.com/questions/55641", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "108" }
Q: How do I keep a mySQL database secure? I'm going to be implementing a PHP/mySQL setup to store credit card information. It seems like AES_ENCRYPT/AES_DECRYPT is the way to go, but I'm still confused on one point: How do I keep the encryption key secure? Hardwiring it into my PHP scripts (which will live on the same ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55643", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: SharePoint Permissions I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page. Is this possible to do without going to every single page and removing t...
{ "language": "en", "url": "https://stackoverflow.com/questions/55669", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I get the coordinates of a mouse click on a canvas element? What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)? No legacy browser compatibility required, Safari, Opera and Firefox will do. A: Edit 201...
{ "language": "en", "url": "https://stackoverflow.com/questions/55677", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "323" }
Q: .NET namespaces My background is primarily as a Java Developer, but lately I have been doing some work in .NET. So I have been trying to do some simple projects at home to get better at working with .NET. I have been able to transfer much of my Java experience into working with .NET (specifically C#), but the only t...
{ "language": "en", "url": "https://stackoverflow.com/questions/55692", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How do you use FogBugz with an Agile methodology? "Evidence-based scheduling" in FogBugz is interesting, but how do I use it w/ an Agile methodology? A: I asked the FogBugz guys the same thing because in XP for example you'd provide the estimate in IET (ideal engineering time). Their answer was to be consistent in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55693", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Streaming large files in a java servlet I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3. Recently under load, I ran out of memory in my VM and it was after I added the code to serve the images so I'm pretty sure that streaming larger servlet responses i...
{ "language": "en", "url": "https://stackoverflow.com/questions/55709", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "46" }
Q: Options for distribution of an offline Ruby on Rails application I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language. This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but... My understanding is, that in order to run an ins...
{ "language": "en", "url": "https://stackoverflow.com/questions/55711", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: PHP: How do I check if all public methods of two classes return the same values? In effect, if I have a class c and instances of $c1 and $c2 which might have different private variable amounts but all their public methods return the same values I would like to be able to check that $c1 == $c2? Does anyone know an e...
{ "language": "en", "url": "https://stackoverflow.com/questions/55713", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Find out where your PHP code is slowing down (Performance Issue) Here's my first question at SO. I have a internal application for my company which I've been recently ask to maintain. The applications is built in PHP and its fairly well coded (OO, DB Abstraction, Smarty) nothing WTF-ish. The problem is the applicat...
{ "language": "en", "url": "https://stackoverflow.com/questions/55720", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: How often should you use git-gc? How often should you use git-gc? The manual page simply says: Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance. Are there some commands to get some object counts to find out whet...
{ "language": "en", "url": "https://stackoverflow.com/questions/55729", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "255" }
Q: How Do I detect Text and Cursor position changes in Word using VSTO I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event on the documen...
{ "language": "en", "url": "https://stackoverflow.com/questions/55735", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is the best way to cache a menu system locally, in the browser? I have a very large cascading menu system with over 300 items in it. (I know it's large but it's a requirement.) Currently, it's written in javascript so the external file is cached by browsers. To improve search engine results I need to convert ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55752", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Creating Custom Performance Counters in Visual C++ Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged Visual C++? I know that it can be done easily using managed C++, but I need to do it using an unmanaged Windows service. I also know that you can retrieve performance cou...
{ "language": "en", "url": "https://stackoverflow.com/questions/55753", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to zero pad numbers in file names in Bash? What is the best way, using Bash, to rename files in the form: (foo1, foo2, ..., foo1300, ..., fooN) With zero-padded file names: (foo00001, foo00002, ..., foo01300, ..., fooN) A: Pure Bash, no external processes other than 'mv': for file in foo*; do newnumber='000...
{ "language": "en", "url": "https://stackoverflow.com/questions/55754", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "63" }
Q: ASP.NET - Performance Implications of a sql server database in the app_data folder The default asp.net membership provider uses a .mdf sql server database file in the app_code database. How scalable is this in terms of calling a flat file database instead of running it in a standard sql environment? Is this recommen...
{ "language": "en", "url": "https://stackoverflow.com/questions/55755", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: PHP Multiform Validation and Redirection I have buy.php with a form where you enter items, quantity, shipping data, etc. When you click the Submit button, it posts back to buy.php ($_SERVER['PHP_SELF']) and does some data validation. If there are fields missing or errors, they are highlighted. If everything is cor...
{ "language": "en", "url": "https://stackoverflow.com/questions/55757", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How do I find a user's IP address with PHP? I would like to find a user's IP address when he/she enters my page. How do I programmatically do that?
{ "language": "en", "url": "https://stackoverflow.com/questions/55768", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "38" }
Q: How can one reference a WCF service in a different Visual Studio solution? A Visual Studio 2008 project in one solution needs to reference a WCF service in another VS 2008 solution on the same development machine. Does anybody have any suggestions on how best to accomplish this? A: Host the service, and then use t...
{ "language": "en", "url": "https://stackoverflow.com/questions/55797", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Visual studio automation: Enumerate opened windows upon solution loading How to enumerate opened code windows (i.e. those windows where you edit documents) upon solution loading using macros? As you probably know, MSVS remembers opened documents, i.e. when you load solution, IDE will load previously opened files. Wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/55804", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What, if anything is typically done in a repository's structure to reflect deployed units? This is a follow-up to the question: Should the folders in a solution match the namespace? The consensus on that question was a qualified "yes": that is, folders == namespaces, generally, but not slavishly (the way java requi...
{ "language": "en", "url": "https://stackoverflow.com/questions/55823", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How does one parse XML files? Is there a simple method of parsing XML files in C#? If so, what? A: In Addition you can use XPath selector in the following way (easy way to select specific nodes): XmlDocument doc = new XmlDocument(); doc.Load("test.xml"); var found = doc.DocumentElement.SelectNodes("//book[@title='...
{ "language": "en", "url": "https://stackoverflow.com/questions/55828", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "491" }
Q: Is there a reliable way to prevent cheating in a web based contest where anonymous users can vote? I'm working on a web-based contest which is supposed to allow anonymous users to vote, but we want to prevent them from voting more than once. IP based limits can be bypassed with anonymous proxies, users can clear coo...
{ "language": "en", "url": "https://stackoverflow.com/questions/55835", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How can I test that my Linq IQueryable has executed I am currently using Linq to NHibernate (although that is not an issue with regards to this question) to execute queries against my database and I want to be able to test whether the current IQueryable result instance has been executed or not. The debugger knows th...
{ "language": "en", "url": "https://stackoverflow.com/questions/55843", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Should data security be performed on the database side? We're in the process of setting up a new framework and way of doing business for our new internal apps. Our current design dictates that all security logic should be handled by our database, and all information (and I mean all) will be going in and out of the d...
{ "language": "en", "url": "https://stackoverflow.com/questions/55845", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: TextBox.TextChanged & ICommandSource I am following the M-V-VM pattern for my WPF UI. I would like to hook up a command to the TextChanged event of a TextBox to a command that is in my ViewModel class. The only way I can conceive of completing this task is to inherit from the TextBox control, and implement ICommandS...
{ "language": "en", "url": "https://stackoverflow.com/questions/55855", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How can I catch all types of exceptions in one catch block? In C++, I'm trying to catch all types of exceptions in one catch (like catch(Exception) in C#). How is it done? And what's more, how can one catch divide-by-zero exceptions? A: If you are on windows and need to handle errors like divide by zero and access ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55859", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Why can't I delete this cookie? Okay, here is the 411 - I have the following event handler in my Global.asax.cs file: private void Global_PostRequestHandlerExecute(object sender, EventArgs e) { if (/* logic that determines that this is an ajax call */) { // we want to set a cookie Response.Cookies....
{ "language": "en", "url": "https://stackoverflow.com/questions/55860", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How to implement password protection for individual files? I'm writing a little desktop app that should be able to encrypt a data file and protect it with a password (i.e. one must enter the correct password to decrypt). I want the encrypted data file to be self-contained and portable, so the authentication has to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55862", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Determine file type of an image I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask). What's the best way to determine the image format in .NET? The application that is reading these downloaded images need...
{ "language": "en", "url": "https://stackoverflow.com/questions/55869", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "51" }
Q: Track when user hits back button on the browser Is it possible to detect when the user clicks on the browser's back button? I have an Ajax application and if I can detect when the user clicks on the back button I can display the appropriate data back Any solution using PHP, JavaScript is preferable. Hell a solution ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55871", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "26" }
Q: How do distributed transactions work (eg. MSDTC)? I understand, in a fuzzy sort of way, how regular ACID transactions work. You perform some work on a database in such a way that the work is not confirmed until some kind of commit flag is set. The commit part is based on some underlying assumption (like a single d...
{ "language": "en", "url": "https://stackoverflow.com/questions/55878", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: How to see the actual Oracle SQL statement that is being executed I'm using a custom-built inhouse application that generates a standard set of reports on a weekly basis. I have no access to the source code of the application, and everyone tells me there is no documentation available for the Oracle database schema. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55899", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: Web service - current time zone for a city? Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't f...
{ "language": "en", "url": "https://stackoverflow.com/questions/55901", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "54" }
Q: Eclipse alternative to VS .sln files I've recently had to switch from Visual Studio to Eclipse CDT. It would seem that Eclipse "workspaces" are not quite like VS solution files. Eclipse workspaces use the .metadata folder for managing multiple projects, but there doesn't seem to be a simple distinction between user ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55903", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Win32 CreatePatternBrush MSDN displays the following for CreatePatternBrush: You can delete a pattern brush without affecting the associated bitmap by using the DeleteObject function. Therefore, you can then use this bitmap to create any number of pattern brushes. My question is the opposite. If the HBRU...
{ "language": "en", "url": "https://stackoverflow.com/questions/55932", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to profile a silverlight application? Is their any profilers that support Silverlight? I have tried ANTS (Version 3.1) without any success? Does version 4 support it? Any other products I can try? Updated since the release of Silverlight 4, it is now possible to do full profiling on SL applications... check out ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55943", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Can't make an SSL Connection I'm using a device that's got GPRS media to connect to a PC running stunnel. On TCPIP connections, the number of sessions is limitless. However, when it comes to SSL connections, it could only go as far as 1062 successful sessions. I've tried it like 3 times but makes no difference. I...
{ "language": "en", "url": "https://stackoverflow.com/questions/55953", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: mysql_insert_id alternative for postgresql is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column.... A: From...
{ "language": "en", "url": "https://stackoverflow.com/questions/55956", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: Exception Handling in .net web apps I admit it: I don't bother with too much exception handling. I know I should do more but I can never wrap my head around where to start and where to stop. I'm not being lazy. Far from it. It's that I'm overwrought with exception handling ambivalence. It just seems that there i...
{ "language": "en", "url": "https://stackoverflow.com/questions/55961", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Unsafe C# and pointers for 2D rendering, good or bad? I am writing a C# control that wraps DirectX 9 and provides a simplified interface to perform 2D pixel level drawing. .NET requires that I wrap this code in an unsafe code block and compile with the allow unsafe code option. I'm locking the entire surface which t...
{ "language": "en", "url": "https://stackoverflow.com/questions/55963", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Make WiX installation set upgrade to the same folder How can I make a major upgrade to an installation set (MSI) built with WiX install into the same folder as the original installation? The installation is correctly detected as an upgrade, but the directory selection screen is still shown and with the default value...
{ "language": "en", "url": "https://stackoverflow.com/questions/55964", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: Is there a MySQLAdmin or SQL Server Management Studio equivalent for SQLite databases on Windows? I need some software to explore and modify some SQLite databases. Does anything similar to SQL Server Management Studio or MySQLAdmin exist for it? A: As a Firefox plugin (aimed mainly at gears, but should work) As a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/55968", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Test an object for NOT being a type I know how to test an object to see if it is of a type, using the IS keyword e.g. if (foo is bar) { //do something here } but how do you test for it not being "bar"?, I can't seem to find a keyword that works with IS to test for a negative result. BTW - I have a horrible feel...
{ "language": "en", "url": "https://stackoverflow.com/questions/55978", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is the difference between const and readonly in C#? What is the difference between const and readonly in C#? When would you use one over the other? A: They are both constant, but a const is available also at compile time. This means that one aspect of the difference is that you can use const variables as inpu...
{ "language": "en", "url": "https://stackoverflow.com/questions/55984", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1661" }
Q: .NET serialization class design issue We have a rather large object graph that needs to be serialized and deserialized in a lot of different ways (modes). In some modes we want certain properties to be deserialized and in some we don't. In future modes it might also be possible that there are more options for proper...
{ "language": "en", "url": "https://stackoverflow.com/questions/56005", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Single quotes vs. double quotes in Python According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to use one over the other? A: Quoting the official docs at https://docs.python.org/2.0/ref/strings.html: In plain English: String literals can be enclosed in matching single q...
{ "language": "en", "url": "https://stackoverflow.com/questions/56011", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "718" }
Q: Cross platform .Net? If you were to write an GUI application that runs locally and calls a webservice, to be cross platform, can you do it with .Net, what tools would you recommend? I was considering Java as it would be relatively easy to pick up due to its C# similarity and then I could use the JVM. A: Another rel...
{ "language": "en", "url": "https://stackoverflow.com/questions/56013", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Prevent file casing problems in Subversion We encountered a problem with using Subversion on Windows. A developer committed a file foo.Data.sql and later another developer committed a file called foo.data.sql. Naturally, this caused a problem on Windows clients (all clients are Windows in our environments) because f...
{ "language": "en", "url": "https://stackoverflow.com/questions/56022", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: how to represent an empty field in yaml I am working with fixtures on rails and I want one of the fixture fields to be blank. Example: two: name: test path: - I want this blank but not to act as a group heading. test: 4 But, I do not know how to leave path: blank without it acting as a group title. Does anybody kn...
{ "language": "en", "url": "https://stackoverflow.com/questions/56037", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Stuts2 Tiles Tomcat suspected of changing UTF-8 to? I'm having some internationalisation woes: My UTF-8 string fields are being rendered in the browser as ???? after being returned from the database. After retrieval from the database using Hibernate, the String fields are presented correctly on inspection using the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/56045", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Stop system entering 'standby' How can i stop the host machine entering standby mode while my application is running? Is there any win32 api call to do this? A: There are two APIs, depending on what version of Windows. XP,2000, 2003: http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx Respond to PBT_APMQUE...
{ "language": "en", "url": "https://stackoverflow.com/questions/56046", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Best way to insert timestamp in Vim? EditPad Lite has a nice feature (CTRL-E, CTRL-I) which inserts a time stamp e.g. "2008-09-11 10:34:53" into your code. What is the best way to get this functionality in Vim? (I am using Vim 6.1 on a Linux server via SSH. In the current situation a number of us share a login so I ...
{ "language": "en", "url": "https://stackoverflow.com/questions/56052", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "101" }
Q: DELETE Statement hangs on SQL Server for no apparent reason Edit: Solved, there was a trigger with a loop on the table (read my own answer further below). We have a simple delete statement that looks like this: DELETE FROM tablename WHERE pk = 12345 This just hangs, no timeout, no nothing. We've looked at the exec...
{ "language": "en", "url": "https://stackoverflow.com/questions/56070", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Merging two Collection I got a Function that returns a Collection<string>, and that calls itself recursively to eventually return one big Collection<string>. Now, i just wonder what the best approach to merge the lists? Collection.CopyTo() only copies to string[], and using a foreach() loop feels like being ineffici...
{ "language": "en", "url": "https://stackoverflow.com/questions/56078", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Does ruby have real multithreading? I know about the "cooperative" threading of ruby using green threads. How can I create real "OS-level" threads in my application in order to make use of multiple cpu cores for processing? A: It depends on the implementation: * *MRI doesn't have, YARV is closer. *JRuby and Ma...
{ "language": "en", "url": "https://stackoverflow.com/questions/56087", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "302" }
Q: Subversion merge history visualisation Are there any utilities out there which can draw pictures of the merge history of a subversion repo - we always commit merges with a (fairly) consistent log message, and it would be handy to be able to automatically extract this info into a single picture that shows what branch...
{ "language": "en", "url": "https://stackoverflow.com/questions/56090", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Pointers to C++ class methods Whilst refactoring some legacy C++ code I found that I could potentially remove some code duplication by somehow defining a variable that could point to any class method that shared the same signature. After a little digging, I found that I could do something like the following: class ...
{ "language": "en", "url": "https://stackoverflow.com/questions/56091", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Removing web.config from subversion (ASP.NET Project) I have a project which is source controlled using Subversion and VisualSVN. Since the version of web.config is different on the server and the developers' computers I want the file to remain on the computers but to be ignored by Subversion. I added it to the svn:...
{ "language": "en", "url": "https://stackoverflow.com/questions/56096", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What is the best way to parse html in C#? I'm looking for a library/method to parse an html file with more html specific features than generic xml parsing libraries. A: I've written some code that provides "LINQ to HTML" functionality. I thought I would share it here. It is based on Majestic 12. It takes the Maj...
{ "language": "en", "url": "https://stackoverflow.com/questions/56107", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "66" }
Q: WCF, ASP.NET Membership Provider and Authentication Service I have written a Silverlight 2 application communicating with a WCF service (BasicHttpBinding). The site hosting the Silverlight content is protected using a ASP.NET Membership Provider. I can access the current user using HttpContext.Current.User.Identity....
{ "language": "en", "url": "https://stackoverflow.com/questions/56112", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Triangle Trigonometry (ActionScript 3) I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians. I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypotenuse and ther...
{ "language": "en", "url": "https://stackoverflow.com/questions/56118", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: IPC Mechanisms in C# - Usage and Best Practices I have used IPC in Win32 code a while ago - critical sections, events, and semaphores. How is the scene in the .NET environment? Are there any tutorial explaining all available options and when to use and why? A: I would recommend using Memory Mapped Files if you need...
{ "language": "en", "url": "https://stackoverflow.com/questions/56121", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "54" }
Q: Can I run a 64-bit VMware image on a 32-bit machine? Can I run a 64-bit VMware image on a 32-bit machine? I've googled this, but there doesn't seem to be a conclusive answer. I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just int...
{ "language": "en", "url": "https://stackoverflow.com/questions/56124", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "90" }
Q: MFC IE embedded web browser wackiness I have this modeless MFC dialog which embeds an Internet Explorer web browser control. The control is derived straight from CWnd with ActiveX wrappers generated by Visual Studio, and I map it to the CDialog using only a DDX_Control(pDX, IDC_EXPLORER, m_explorer);. I have 2 probl...
{ "language": "en", "url": "https://stackoverflow.com/questions/56145", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Storing file permissions in Subversion repository How do you store file permissions in a repository? A few files need to be read-only to stop a third party program from trashing it but after checking out of the repository they are set to read-write. I looked on google and found a blog post from 2005 that states that...
{ "language": "en", "url": "https://stackoverflow.com/questions/56149", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "41" }
Q: Test Cases AND assertion statements The code in this question made me think assert(value>0); //Precondition if (value>0) { //Doit } I never write the if-statement. Asserting is enough/all you can do. "Crash early, crash often" CodeComplete states: * *The assert-statement makes the application Correct *The if...
{ "language": "en", "url": "https://stackoverflow.com/questions/56168", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How to obtain Vista Edition programmatically? How to obtain Vista Edition programmatically, that is Home Basic, Home Premium, Business or Ultimate ? A: MSDN gives extensive answer: Getting the System Version A: [Environment.OSVersion][1] A: Brilliant! This is just what I need as well. Thanks aku. edg: Environmen...
{ "language": "en", "url": "https://stackoverflow.com/questions/56195", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: WMI - Directly accessing the singleton instance of Win32_OperatingSystem I've having trouble directly accessing the Win32_OperatingSystem management class that is exposed via WMI. It is a singleton class, and I'm pretty certain "Win32_OperatingSystem=@" is the correct path syntax to get the instance of a singleton. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/56208", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: shuffle card deck issues in language agnostic Not so long ago I was in an interview, that required solving two very interesting problems. I'm curious how would you approach the solutions. Problem 1 : Product of everything except current Write a function that takes as input two integer arrays of length len, input an...
{ "language": "en", "url": "https://stackoverflow.com/questions/56215", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Creating objects driven by the database to populate a Treeview - very slow I have an application that reads a table from a database. I issue an SQL query to get a result set, based on a unique string value I glean from the results, I use a case/switch statement to generate certain objects (they inherit TreeNode BTW...
{ "language": "en", "url": "https://stackoverflow.com/questions/56224", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do you determine the latest SVN revision number rooted in a directory? I would like to start tagging my deployed binaries with the latest SVN revision number. However, because SVN is file-based and not directory/project-based, I need to scan through all the directory's and subdirectory's files in order to determ...
{ "language": "en", "url": "https://stackoverflow.com/questions/56227", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: XML writing tools for Python I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. Am I missing something truly wonderful I haven't heard of? This is similar to what I'm actually doing: import xml.etree.ElementTree as ET root = ET.Element('html') head = ET.SubElement(ro...
{ "language": "en", "url": "https://stackoverflow.com/questions/56229", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "35" }
Q: WCF service configuration file question regarding From what I've seen the tag is ignored when hosting a WCF service in IIS. I understand that when self-hosting this is required but is this harmful or even used when operating under IIS? ex. <system.serviceModel> <service blah blah blah> <host> <baseAdd...
{ "language": "en", "url": "https://stackoverflow.com/questions/56249", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Converting a .rptproj from VS2005 to VS2008 I've got my brand new VS2008 and decided to convert my main solution from VS2005. One of the projects is a SQL2005 reporting services project. Now that I've converted I cannot load it in VS2008. Is there anyway around this? My problem is that my solution is a hybrid and h...
{ "language": "en", "url": "https://stackoverflow.com/questions/56256", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Using Silverlight for an entire website? We need to build an administration portal website to support our client/server application. Since we're a .Net shop the obvious traditional way would be to do that in ASP.Net. But Silverlight 2 will be coming out of beta a good while before our release date. Should we conside...
{ "language": "en", "url": "https://stackoverflow.com/questions/56266", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Context.User losing Roles after being assigned in Global.asax.Application_AuthenticateRequest I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this: <syst...
{ "language": "en", "url": "https://stackoverflow.com/questions/56271", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Export ASPX to HTML We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's. The way we're doing it now is with code I found here that overloads the Render method in the Aspx Page and writes the HTML string to a file. This works fine f...
{ "language": "en", "url": "https://stackoverflow.com/questions/56279", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Can you view an aggregate changeset in git? If so, how? In Subversion you can specify a range of versions to get an aggregate view of a series of commits. Is this possible in git? If so, how? A: You can pass ranges of revisions using the .. (and ...) operator. git diff 6d0918...HEAD instead of giving (abbreviate...
{ "language": "en", "url": "https://stackoverflow.com/questions/56296", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How to convert a string to a date in sybase I need to specify a date value in a sybase where clause. For example: select * from data where dateVal < [THE DATE] A: Here's a good reference on the different formatting you can use with regard to the date: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase....
{ "language": "en", "url": "https://stackoverflow.com/questions/56303", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: ReSharper Code Cleanup/Reformat Code feature vs Versioning Control Systems ReSharper Code cleanup feature (with "reorder members" and "reformat code" enabled) is really great. You define a layout template using XML, then a simple key combination reorganizes your whole source file (or folder/project/solution) accordi...
{ "language": "en", "url": "https://stackoverflow.com/questions/56313", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: D Programming Language in the real world? Is anyone out there using D for real world applications? If so, what are you using it for? I can't seem to find anything big on the web written in D. Despite the lack of known big users, D seems like a very promissing language to me, and according to TIOBE, it's fairly popul...
{ "language": "en", "url": "https://stackoverflow.com/questions/56315", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "140" }
Q: Reset screen point to the top of screen in Windows & Linux console I have a little routine that's run under Linux and Windows written in C and displays output on the console. I'm not linking in any form of curses or anything like that. Currently I clear the screen using #ifdef __WIN32 system( "cls" ); #else syst...
{ "language": "en", "url": "https://stackoverflow.com/questions/56324", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Team System get-latest-version on checkout We used to use SourceSafe, and one thing I liked about it was that when you checked out a file, it automatically got you its latest version. Now we work with Team System 2005, and it doesn't work that way - you have to "get latest version" before you start working on a file...
{ "language": "en", "url": "https://stackoverflow.com/questions/56325", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How do I perform a simple one-statement SQL search across tables? Suppose that two tables exist: users and groups. How does one provide "simple search" in which a user enters text and results contain both users and groups whose names contain the text? The result of the search must distinguish between the two types. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/56334", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can I set a data breakpoint in runtime in System C (or in Plain Vanilla C++)? I have a class in system-C with some data members as such: long double x[8]; I'm initializing it in the construction like this: for (i = 0; i < 8; ++i) { x[i] = 0; } But the first time I use it in my code I have garbage there. Beca...
{ "language": "en", "url": "https://stackoverflow.com/questions/56340", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What's the best way of parsing strings? We've got a scenario that requires us to parse lots of e-mail (plain text), each e-mail 'type' is the result of a script being run against various platforms. Some are tab delimited, some are space delimited, some we simply don't know yet. We'll need to support more 'formats' i...
{ "language": "en", "url": "https://stackoverflow.com/questions/56342", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Iterators in C++ (stl) vs Java, is there a conceptual difference? I'm returning to c++ after being away for a bit and trying to dust off the old melon. In Java Iterator is an interface to a container having methods: hasNext(), next() and remove(). The presence of hasNext() means it has the concept of a limit for th...
{ "language": "en", "url": "https://stackoverflow.com/questions/56347", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "33" }
Q: Precompilation and startup times on ASP.Net I am developping a (relatively small) website in ASP.Net 2.0. I am also using nAnt to perform some easy tweaking on my project before delivering executables. In its current state, the website is "precompiled" using aspnet_compiler.exe -nologo -v ${Appname} -u ${target} ...
{ "language": "en", "url": "https://stackoverflow.com/questions/56357", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Directory layout for pure Ruby project I'm starting to learn ruby. I'm also a day-to-day C++ dev. For C++ projects I usually go with following dir structure / -/bin <- built binaries -/build <- build time temporary object (eg. .obj, cmake intermediates) -/doc <- manuals and/or Doxygen docs -/src --/module-1 --...
{ "language": "en", "url": "https://stackoverflow.com/questions/56362", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Why is a method call shown as not covered when the code within the method is covered with emma? I am writing a unit test to check that a private method will close a stream. The unit test calls methodB and the variable something is null The unit test doesn't mock the class on test The private method is within a publi...
{ "language": "en", "url": "https://stackoverflow.com/questions/56373", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Are non-generic collections in .NET obsolete? Put differently: Is there a good reason to choose a loosely-typed collection over a type-safe one (HashTable vs. Dictionary)? Are they still there only for compatibility? As far as I understand, generic collections not only are type-safe, but their performance is better....
{ "language": "en", "url": "https://stackoverflow.com/questions/56375", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "26" }
Q: Automatically checking for a new version of my application Trying to honor a feature request from our customers, I'd like that my application, when Internet is available, check on our website if a new version is available. The problem is that I have no idea about what have to be done on the server side. I can imagin...
{ "language": "en", "url": "https://stackoverflow.com/questions/56391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: Aligning text in SVG I am trying to make SVG XML documents with a mixture of lines and brief text snippets (two or three words typically). The major problem I'm having is getting the text aligning with line segments. For horizontal alignment I can use text-anchor with left, middle or right. I can't find a equivalent...
{ "language": "en", "url": "https://stackoverflow.com/questions/56402", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "71" }