text
string
meta
dict
Q: In LINQ how to find a distinct item that is joining 2 tables? Given the Below Tables. How do I get the Distinct name given the other ID of 76 in LINQ? **Table S** SID OtherID ------------------------------ 1 77 2 76 **Table Q** QID SID HighLevelNAme LoweLevelName --------------------------------...
{ "language": "en", "url": "https://stackoverflow.com/questions/210178", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Why so many web pages contain such a strange code snippet in header? I've noticed for quite a long time that strange domains such like jsev.com, cssxx.com appered in my firefox status bar from time to time, I always wonder why so many web pages contains resources from these strange domains. I googled it, but found n...
{ "language": "en", "url": "https://stackoverflow.com/questions/210180", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Finding blank areas of an image file using ImageMagick I need to be able to determine if a part of an image (outside of predetermined crop marks) contains any image content. Is there a way with ImageMagick (specifically the php interface) to do this? Scenario: The canvas is 8.5x11 with .5 in margins on the top, lef...
{ "language": "en", "url": "https://stackoverflow.com/questions/210189", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Can anyone figure out how to update to flash_switcher.xpi to include Flash Player 10 I don't know anything about XPIs but I've searched through the install.rdf, *.js, and *.xul files and found no reference to an array of flash versions, so I cannot clearly see where the version list comes from. A: It turns out code...
{ "language": "en", "url": "https://stackoverflow.com/questions/210191", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to create empty text file from a batch file? Can somebody remember what was the command to create an empty file in MSDOS using BAT file? A: Techniques I gathered from other answers: Makes a 0 byte file a very clear, backward-compatible way: type nul >EmptyFile.txt idea via: anonymous, Danny Backett, possibly o...
{ "language": "en", "url": "https://stackoverflow.com/questions/210201", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "278" }
Q: What is a "Nested Quantifier" and why is it causing my regex to fail? I have this regex I built and tested in regex buddy. "_ [ 0-9]{10}+ {1}+[ 0-9]{10}+ {2}+[ 0-9]{6}+ {2}[ 0-9]{2}" When I use this in .Net C# I receive the exception "parsing \"_ [ 0-9]{10}+ +[ 0-9]{10}+ +[ 0-9]{6}+ [ 0-9]{2}\" - Nested quantifi...
{ "language": "en", "url": "https://stackoverflow.com/questions/210206", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: How do I set up my environment for ESC/Java2 in Windows and build/run with ESC/Java2? How do I set up my execution environment for ESC/Java2 in WindowsXP? And furthermore, how do I build and run, in WindowsXP, projects with ESC/Java2. It is hard to tell from their specifications/readme and documentation, specially c...
{ "language": "en", "url": "https://stackoverflow.com/questions/210218", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Converting between document formats in C# What is the best way to convert between HTML, XML, and XSL-FO in C#? I already have the HTML (piped in from FCKEditor) and I'd like to print a PDF (I have an XSL->PDF converter). I just can't seem to find a library that will convert from HTML into anything XSL friendly. A: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210222", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why does my OpenGL ES iPhone game flicker when I first turn on the phone? I made a simple game for the iPhone using OpenGL ES. Everything works fine except for this problem: I turn the phone completely off, then back on, then launch my app and I get this wierd flickering! Every other frame is correct... the incorr...
{ "language": "en", "url": "https://stackoverflow.com/questions/210225", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Creating a web application, then adding Ajax to it? I imagine there are many of you out there who have developed an application online which automates a lot of processes and saves people at your company time and money. The question is, what are your experiences with developing that application, having it all set in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210233", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Visual studio intellisense for headers without .h I am using a library that has headers without the .h This defeats visual studio's intellisense (declaration/definition lookup) Anyone know how to tell VS2008 that a file is a header? A: Go to Tools::Options::Text Editor::File Extension tab in Visual Studio. Check th...
{ "language": "en", "url": "https://stackoverflow.com/questions/210247", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: What is the best way to roll-back a change set using Subversion? I've been using various source control systems for a while, but when it comes to reverting changes I'm not yet an expert. Can someone help given this scenario: Scenario * *Given a bug was introduced in revision #5 *And 3 files were changed in revis...
{ "language": "en", "url": "https://stackoverflow.com/questions/210249", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: How do I attach the debugger to IIS instead of ASP.NET Development Server? I have an ASP.NET website and when I press F5 it automatically attaches to the ASP.NET Development Server, how do I attach to IIS worker process instead when I press F5? A: Debug->Attach To Process... Select the aspnet_wp.exe process from th...
{ "language": "en", "url": "https://stackoverflow.com/questions/210250", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "70" }
Q: Flash AS2.0 - Read * tags from XML I have an XML document, and contained within one of the nodes, I have <li> tags. I don't need <ul></ul> tags for Flash because it only accepts <li> tags anyway. For example, here's part of the XML doc: <node> <li>item1</li> <li>item2</li> </node> I want to put all the data with...
{ "language": "en", "url": "https://stackoverflow.com/questions/210256", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do you start debugging a Cocoa app with a URL? I'm debugging a Cocoa application that can act as a handler to a custom URL protocol. The application works fine when I click on a link after the application has launched, but something is causing the app to crash if it has not launched at the time the link is click...
{ "language": "en", "url": "https://stackoverflow.com/questions/210261", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Interface too general In the Java code I'm working with we have an interface to define our Data Access Objects(DAO). Most of the methods take a parameter of a Data Transfer Object (DTO). The problem occurs when an implementation of the DAO needs to refer to a specific type of DTO. The method then needs to do a (to m...
{ "language": "en", "url": "https://stackoverflow.com/questions/210266", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Software patents or Can I write a RSVP program for my mobile device? I wanted to write a small Rapid Serial Visual Presentation (RSVP) program for my mobile device but I realized that there are some patent issues associated with that technique (exhibit 1 and exhibit 2). Can I write such program and try to make mone...
{ "language": "en", "url": "https://stackoverflow.com/questions/210270", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: .Net 2.0 ServiceController.GetServices() I've got a website that has windows authentication enable on it. From a page in the website, the users have the ability to start a service that does some stuff with the database. It works fine for me to start the service because I'm a local admin on the server. But I just had...
{ "language": "en", "url": "https://stackoverflow.com/questions/210296", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Nice Labels with X in To Field of Compose Message? In Facebook's Compose Message, each name that appears in the TO field uses a nice LABEL with an X. Click on the X, and you remove name from the To sender field. I see this same feature again in other web2.0 social networking apps. Are there open source tools that ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210308", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I stop FCKeditor reverting html entities back to their unicode characters I am having a problem with FCKeditor reverting html entities entered in the source view back to their original unicode representations. For example when I enter &euro; into the source view, switch to html and then back to source view, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210309", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Best way to determine if cookies are enabled in ASP.NET? What is the best method for determining if a users browser has cookies enabled in ASP.NET A: @Mattew is right the only way to find out is to set a cookie, redirect, then check it. Here is a C# function to preform that check you can put this in your page load ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210321", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: What is the easiest way to add a Visual Studio 2008 Context Menu Item? I would like to add a custom menu item when you right-click a certain file extension in Visual Studio. There seem to be some helper open source projects to accomplish this, but I'd like to ask if anyone has ever used them, and how easy were they ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210323", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: VB.NET - Click Submit Button on Webbrowser page I have a html page open on my webbrowser object, I can enter username and password okay, but I'm stuck and don't know how to submit the info. Here is the html code for the username/password submit: <div id="signin"> <h2 class="ir"> <em></em>Sign in</h2> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210342", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: py3k RC-1: "LookupError: unknown encoding: uft-8" I just installed the first release candidate of Python 3.0 and got this error after typing: >>> help('modules foo') [...] LookupError: unknown encoding: uft-8 Notice that it says uft-8 and not utf-8 Is this a py3k specific bug or a misconfiguration on my part? I do ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210344", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Remove repetitive, hard coded loops and conditions in C# I have a class that compares 2 instances of the same objects, and generates a list of their differences. This is done by looping through the key collections and filling a set of other collections with a list of what has changed (this may make more sense after...
{ "language": "en", "url": "https://stackoverflow.com/questions/210353", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Capturing data from a .Net web-service that fails with an HTTP 500 error code I have a .net web-service hosted in IIS 6.0 that periodically fails with an http 500 because a client connects to it with data that does not match the wsdl. Things like having an element specified in a method as being of type int and the i...
{ "language": "en", "url": "https://stackoverflow.com/questions/210354", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: WordPress - Changed directory and images do not appear I changed the folder that my WordPress installation was in. However, this worked fine, except now all my images are not showing up. The problem is that each post has the full url of the image in it. (not my doing, this seems to be the default setting) Is there a...
{ "language": "en", "url": "https://stackoverflow.com/questions/210355", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Can I cancel postback when user presses return in a textbox? I have a textbox whose input is being handled by jQuery. $('input.Search').bind("keyup", updateSearchTextbox); When I press Enter in the textbox, I get a postback, which messes everything up. How can I trap that Enter and ignore it? (Just to preempt one p...
{ "language": "en", "url": "https://stackoverflow.com/questions/210359", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: View need to go Winform to Webform, what is your advices? Our application is well structured (well we did our best!) and we have split the Model from the View, Now, we need to let some information to our client with a web access. We would like to build something small with IIS and some webform. Here some information...
{ "language": "en", "url": "https://stackoverflow.com/questions/210368", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: LuaSocket FTP always times out I've had success with LuaSocket's TCP facility, but I'm having trouble with its FTP module. I always get a timeout when trying to retrieve a (small) file. I can download the file just fine using Firefox or ftp in passive mode (on Ubuntu Dapper Linux). I thought it might be that I nee...
{ "language": "en", "url": "https://stackoverflow.com/questions/210371", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Problems Reading RSS with C# and .net 3.5 I have been attempting to write some routines to read RSS and ATOM feeds using the new routines available in System.ServiceModel.Syndication, but unfortunately the Rss20FeedFormatter bombs out on about half the feeds I try with the following exception: An error was encounte...
{ "language": "en", "url": "https://stackoverflow.com/questions/210375", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Get All Elements in an HTML document with a specific CSS Class What's the best way to get an array of all elements in an html document with a specific CSS class using javascript? No javascript frameworks like jQuery allowed here right now, and I could loop all the elements and check them manually myself. I'm hoping...
{ "language": "en", "url": "https://stackoverflow.com/questions/210377", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "39" }
Q: UInt32 to Int32 If I have a VB.Net function that returns an Int32, but uses an unsigned int (UInt32) for calculations, etc. How can I convert a variable "MyUintVar32" with a value of say "3392918397 into a standard Int32 in VB.Net? In c# if I just do a "return (int)(MyUintVar32);", I get -902048899, not an error....
{ "language": "en", "url": "https://stackoverflow.com/questions/210383", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Host C# winforms in VB6 applications I have a VB 6 application and we are starting to port it over to C#. We have finished one of the screens and wanted to see if there was an incremental way of hosting the winform within VB to start to have the existing users get used to new screens. This is a migration strategy....
{ "language": "en", "url": "https://stackoverflow.com/questions/210391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Get other process' argv in OS X using C I want to get other process' argv like ps. I'm using Mac OS X 10.4.11 running on Intel or PowerPC. First, I read code of ps and man kvm, then I wrote some C code. #include <kvm.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <sys/sysctl.h> #include <paths...
{ "language": "en", "url": "https://stackoverflow.com/questions/210397", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How do you get people to value abstraction and flexibility over "just getting it done"? I sometimes have difficulties with other people who wish to solve a problem when they wish to skip the official interfaces and access underlying implementation details directly. They argue that doing so will allow them to solve t...
{ "language": "en", "url": "https://stackoverflow.com/questions/210421", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to keep ActiveRecord association DRY? I have an issue with trying to keep AR finders DRY in my application. I have created a blogging application which fetches all the related pages,posts,links,tags and categories for a blog when a user first views it. A sample show action for the Blog controller is shown below:...
{ "language": "en", "url": "https://stackoverflow.com/questions/210423", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Are immutable arrays possible in .NET? Is it possible to somehow mark a System.Array as immutable. When put behind a public-get/private-set they can't be added to, since it requires re-allocation and re-assignment, but a consumer can still set any subscript they wish: public class Immy { public string[] { get; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210428", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: What is the aspnet_client folder for under the IIS structure? I notice that there's frequently an aspnet_client folder under the standard IIS web folder structure. What is this used for? Is it needed? A: It also has certain icons and scripts that are required for crystal reports to run properly even in versions lat...
{ "language": "en", "url": "https://stackoverflow.com/questions/210440", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "121" }
Q: What is the best way for a client app to find a server on a local network in C#? The client connects to the server using GenuineChannels (we are considering switching to DotNetRemoting). What I mean by find is obtain the IP and port number of a server to connect to. It seems like a brute-force approach would be try...
{ "language": "en", "url": "https://stackoverflow.com/questions/210446", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: YAWS fronting Tomcat Is there currently any easy way to set up a YAWS web server in front of Apache Tomcat Servlet container, similar to popular Apache httpd + Tomcat set up? A: I do not believe there is an AJP connector for YAWS, but you should be able to front Tomcat with YAWS via HTTP. YAWS is relatively easy to...
{ "language": "en", "url": "https://stackoverflow.com/questions/210454", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Best practice for getting app name/id What's the best way for a common library to know what context - a.k.a. the calling app - it is in? I'm in a very controlled enterprise environment... is there a better way for the library to know what application it is getting called from than reading a setting in the config fil...
{ "language": "en", "url": "https://stackoverflow.com/questions/210455", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: Try to describe polymorphism as easy as you can How can polymorphism be described in an easy-to-understand way? We can find a lot of information about the subject on the Internet and books, like in Type polymorphism. But let's try to make it as simple as we can. A: Two objects respond to the same message with diffe...
{ "language": "en", "url": "https://stackoverflow.com/questions/210460", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "61" }
Q: Distributing a stand-alone Python web-based application to non-technical users I'm writing a web application in Python, intended for use by teachers and pupils in a classroom. It'll run from a hosted website, but I also want people to be able to download a self-contained application they can install locally if they ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210461", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Countering the shady JavaScript IntelliSense support in Visual Studio 2008 With the release of Visual Studio 2008, Microsoft implemented code-completion and IntelliSense support for JavaScript. Unfortunately the support for JavaScript is shady at best--one of the major hassles being that when referencing external Ja...
{ "language": "en", "url": "https://stackoverflow.com/questions/210467", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: QR decoder that works on mac? Anyone know a QR decoder that works on mac or that might be online? I just need to decode one single image. A: Unfortunately, the most used library libdecodeqr is depends on OpenCV (gtk2) and it is too hard to compile it on OS X. (Tried to compile it because it is needed by Image::Deco...
{ "language": "en", "url": "https://stackoverflow.com/questions/210470", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Remove repetitive, hard coded loops and conditions in PHP I saw this question asked about C# I would like an answer for PHP. I have some old code that has 4 pages of foreach loops and conditions which just makes it hard to read and follow. How would I make this more OO? I was thinking of using SPL Functions but don'...
{ "language": "en", "url": "https://stackoverflow.com/questions/210475", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How secure are CGI based web apps? A very well known major drawback of using CGI is poor webserver performance. But how secure are CGI (mainly C/C++) based applications? Are there any major security holes in CGI architecture built on C/C++? I would like to know some real life implementations of CGI based web apps/w...
{ "language": "en", "url": "https://stackoverflow.com/questions/210490", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Protected Pages in MediaWiki I am currently using MediaWiki as a documentation website, with login authenticated by LDAP. However, we have hit a snag. Certain pages contain sensitive information. For example links that say "click here to log in". I would like to be able to protect certain pages from being edited b...
{ "language": "en", "url": "https://stackoverflow.com/questions/210495", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: SQL Server 2005, need script to check for all constraints on table I continue to get this error: Object '%s' cannot be renamed because the object participates in enforced dependencies I need to find a script that will help me to find all the dependencies that there is with this table. I will need to drop them, rena...
{ "language": "en", "url": "https://stackoverflow.com/questions/210496", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Enumerate windows like alt-tab does I'm creating an alt-tab replacement for Vista but I have some problems listing all active programs. I'm using EnumWindows to get a list of Windows, but this list is huge. It contains about 400 items when I only have 10 windows open. It seems to be a hwnd for every single control a...
{ "language": "en", "url": "https://stackoverflow.com/questions/210504", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "34" }
Q: Tracking automatic variable lifetime? This may not be possible, but I figured I'd ask... Is there any way anyone can think of to track whether or not an automatic variable has been deleted without modifying the class of the variable itself? For example, consider this code: const char* pStringBuffer; { std::strin...
{ "language": "en", "url": "https://stackoverflow.com/questions/210506", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Ordering numbers that are stored as strings in the database I have a bunch of records in several tables in a database that have a "process number" field, that's basically a number, but I have to store it as a string both because of some legacy data that has stuff like "89a" as a number and some numbering system that...
{ "language": "en", "url": "https://stackoverflow.com/questions/210509", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: POST request in namespaced resource controller going to index action instead of create I have a namespaced controller for some admin functionality. My create form does not work -- it ends up routing the request to the index action instead of the create action. Why isn't the POST getting routed to the create actio...
{ "language": "en", "url": "https://stackoverflow.com/questions/210513", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: sql statement to delete records older than XXX as long as there are more than YY rows Assume a table with the following columns: pri_id, item_id, comment, date What I want to have is a SQL query that will delete any records, for a specific item_id that are older than a given date, BUT only as long as there are more ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210515", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Regex multi word search What do I use to search for multiple words in a string? I would like the logical operation to be AND so that all the words are in the string somewhere. I have a bunch of nonsense paragraphs and one plain English paragraph, and I'd like to narrow it down by specifying a couple common words l...
{ "language": "en", "url": "https://stackoverflow.com/questions/210518", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Cursor event handling in python+Tkinter I'm building a code in which I'd like to be able to generate an event when the user changes the focus of the cursor from an Entry widget to anywhere, for example another entry widget, a button... So far i only came out with the idea to bind to TAB and mouse click, although if ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210522", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: ASP.NET User Controls Cross-Communication The scenario: 2 user controls (foo.ascx and fum.ascx) foo has a method that would really like to access a property from fum. They live on the same page, but I can't find a very simple way to accomplish this sort of communication. Any ideas? A: * *Add an event OnMyProper...
{ "language": "en", "url": "https://stackoverflow.com/questions/210541", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Displaying Japanese fonts in source code using Visual Studio I have some source files that have comments written in Japanese. When I open these files in Visual Studio they appear like this: à–¾FNCAP‰¹—p‚̃XƒŒƒbƒh I am using the English version of WinXP, but is there a way to get Visual Studio to display the actual ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210547", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Visual Studio enable assert I am trying to add assert statements to a project, but they keep being skipped. Is there an option I need to enable somewhere? The assert statement is: Debug.Assert(false, "Deserialization failed", "Deserialization failed"); And I am running in debug mode. I could be doing something sill...
{ "language": "en", "url": "https://stackoverflow.com/questions/210558", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Getting raw SQL query string from PDO prepared statements Is there a way to get the raw SQL string executed when calling PDOStatement::execute() on a prepared statement? For debugging purposes this would be extremely useful. A: PDOStatement has a public property $queryString. It should be what you want. I've just n...
{ "language": "en", "url": "https://stackoverflow.com/questions/210564", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "156" }
Q: Package structure for a Java project? Whats the best practice for setting up package structures in a Java Web Application? How would you setup your src, unit test code, etc? A: The way I usually organise is - src - main - java - groovy - resources - te...
{ "language": "en", "url": "https://stackoverflow.com/questions/210567", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "142" }
Q: Why does scanf() need "%lf" for doubles, when printf() is okay with just "%f"? Why is it that scanf() needs the l in "%lf" when reading a double, when printf() can use "%f" regardless of whether its argument is a double or a float? Example code: double d; scanf("%lf", &d); printf("%f", d); A: Because otherwise sca...
{ "language": "en", "url": "https://stackoverflow.com/questions/210590", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "193" }
Q: how to release resources of a process I am invoking an external process by using System.Diagonistics.Process and passing two filenames as parameters. Now some time this process terminates due to exceptions and it seems that files handle are not being released by the process. How can i release the resources occupied ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210594", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Suggestions for a C# custom tabcontrol? Has anybody got any suggestions for a custom tabcontrol implemented in C# and which adheres to these criteria: * *Allows the tabs to be placed along the side of the control. *Tab text must read horizontally. *Allow custom colouring. *Open source or no cost. I prefer no...
{ "language": "en", "url": "https://stackoverflow.com/questions/210597", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Accessing a property of derived class from the base class in C# In C#, what is the best way to access a property of the derived class when the generic list contains just the base class. public class ClassA : BaseClass { public object PropertyA { get; set; } } public class ClassB: BaseClass { public object Pr...
{ "language": "en", "url": "https://stackoverflow.com/questions/210601", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Calling batch/script files from VC6/VC2005/VC2008 project files Is there a way to invoke an external script or batch file from VC6 (and later) project files? I have a background process that I need to kill before attempting to build certain projects (DLLS, executables) and haven't found a way to successfully do so f...
{ "language": "en", "url": "https://stackoverflow.com/questions/210606", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Exact time between 2 DateTime? I would like to know many minutes between 2 dates? Example : Now - tommorow at the exact time would return me 1440. A: Look at the TimeSpan class. DateTime date1 = DateTime.Now; DateTime date2 = DateTime.Now.AddDays(1); TimeSpan diff = date2.Subtract(date1); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210607", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: What is the member variables list after the colon in a constructor good for? I'm reading this C++ open source code and I came to a constructor but I don't get it ( basically because I don't know C++ :P ) I understand C and Java very well. TransparentObject::TransparentObject( int w, int x, int y, int z ) : _...
{ "language": "en", "url": "https://stackoverflow.com/questions/210616", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: ASP.NET HTTP handlers and global variables I have created HTTP handlers. How do I create global variables for these handlers like I can with ASP.net web pages in global.asax? A: Add the variables to the Application instance: System.Web.HttpContext.Current.Application["MyGlobalVariable"] = myValue; Or, if the var...
{ "language": "en", "url": "https://stackoverflow.com/questions/210620", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Python: unsigned 32 bit bitwise arithmetic Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic. Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe negative) integ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210629", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "40" }
Q: add menu item to default context menu I'd like to add a menu item to the default ContextMenu of a RichTextBox. I could create a new context menu but then I lose the spell check suggestions that show up in the default menu. Is there a way to add an item without re-implementing everything? A: It's not too tricky to r...
{ "language": "en", "url": "https://stackoverflow.com/questions/210634", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Teacher time schedule algorithm This is a problem I've had on my mind for a long time. Being the son of a teacher and a programmer, it occurred to me early on... but I still haven't found a solution for it. So this is the problem. One needs to create a time schedule for a school, using some constraints. These are ge...
{ "language": "en", "url": "https://stackoverflow.com/questions/210635", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: jQuery Thickbox or similar to show iFrame? I have been looking at jQUery thickbox for showing modal dialogs with images, it is great. But now I have the need to display a hidden div of content that contains an iFrame in a similar fashion, with a link to open the content. So I'd have something like this. <a href=""...
{ "language": "en", "url": "https://stackoverflow.com/questions/210637", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How can I limit CreateWindowEx to alphanumeric input only? I know that ES_NUMBER exists to limit CreateWindowEx to numeric input only, is there a similar mechanism for limiting it to only alphanumeric (a-z,0-9) input? Or another way to do something similar. I know I can check after the fact, but I would like to l...
{ "language": "en", "url": "https://stackoverflow.com/questions/210639", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: In JavaScript can I make a "click" event fire programmatically for a file input element? I'd like to make a click event fire on an <input type="file"> tag programmatically. Just calling click() doesn't seem to do anything or at least it doesn't pop up a file selection dialog. I've been experimenting with capturing e...
{ "language": "en", "url": "https://stackoverflow.com/questions/210643", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "270" }
Q: Restricting file downloads I'm currently creating a website for a client that will basically involve selling various files. This is obviously a really common thing to do, which is making me feel kind of foolish for not thinking of a method for doing it. Once the purchase has been made the customer should be taken to...
{ "language": "en", "url": "https://stackoverflow.com/questions/210645", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Can't detect when Windows Font Size has changed C++ MFC I'm trying to determine how I can detect when the user changes the Windows Font Size from Normal to Extra Large Fonts, the font size is selected by executing the following steps on a Windows XP machine: * *Right-click on the desktop and select Properties. *...
{ "language": "en", "url": "https://stackoverflow.com/questions/210646", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Validate image from file in C# I'm loading an image from a file, and I want to know how to validate the image before it is fully read from the file. string filePath = "image.jpg"; Image newImage = Image.FromFile(filePath); The problem occurs when image.jpg isn't really a jpg. For example, if I create an empty text...
{ "language": "en", "url": "https://stackoverflow.com/questions/210650", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "54" }
Q: JSP: How can I still get the code on my error page to run, even if I can't display it? I've defined an error-page in my web.xml: <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.jsp</location> </error-page> In that error page, I have a custom tag that I created. The tag han...
{ "language": "en", "url": "https://stackoverflow.com/questions/210657", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Can an Actionscript component listen to its own propertyChange events? I have a CircleButton class in Actionscript. I want to know when someone externally has changed the 'on' property. I try listening to 'onChange' but it never hits that event handler. I know I can write the 'on' property as a get/setter but I like...
{ "language": "en", "url": "https://stackoverflow.com/questions/210666", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: google analytics tracking in iframe feeding to different partners our partners sites leverages our iframes in their own websites. I was wondering if there is a way to track the analytics on the iframes. The problem is, if we also utilize these iframes on our own website, how do i avoid duplicate tracking where a vi...
{ "language": "en", "url": "https://stackoverflow.com/questions/210682", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Readings on writing high-performance server in Java Could anyone please introduce books/papers/articles that I should read If I want to write a high-performance RPC server in Java, which handles large number of concurrent connections(C10K or over), is fault-tolerant, can be scaled out, and maintains high throughput?...
{ "language": "en", "url": "https://stackoverflow.com/questions/210684", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Managing users with Postgresql Our system will run on a local network with no more than 50 clients that connect to the same local server. We are creating a DB user for each client, to take advantage of the postgresql privilege system. 1) Analyzing the "performance", its OK to have ~ 50 DB users instead of reimplemen...
{ "language": "en", "url": "https://stackoverflow.com/questions/210691", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Tool purely for Syntax Checking? We have a proprietry system that we develop scripting code in. We currently do not have a developer environment (apart from Notepad++) and cannot debug or compile this code. We have to submit it to the vendor to insert the code into the test or live system. The language is essential...
{ "language": "en", "url": "https://stackoverflow.com/questions/210692", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Image equivalent of ActionLink in ASP.NET MVC In ASP.NET MVC is there an equivalent of the Html.ActionLink helper for Img tags? I have a controller action that outputs a dynamically generated JPEG and I wanted to use the same Lambda expressions to link to it as I do HREFs using ActionLink. Alternatively, a helper t...
{ "language": "en", "url": "https://stackoverflow.com/questions/210711", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "47" }
Q: Using jQuery to center a DIV on the screen How do I go about setting a <div> in the center of the screen using jQuery? A: I would like to correct one issue. this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px"); Above code won't work in cases when this.height (lets assume that us...
{ "language": "en", "url": "https://stackoverflow.com/questions/210717", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "787" }
Q: Can you override the formatter for a specific log in log.properties I am using log.properties to configure logging for a Java app. Each class gets its own logger named after itself (e.g. com.company.program.ClassX). I want to set a custom formatter for just one log, and leave the handler with the SimpleFormatter. Is...
{ "language": "en", "url": "https://stackoverflow.com/questions/210719", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Boilerplate for a professional PHP team development environment I would like to get a general consensus for the minimal/boilerplate professional PHP team development environment. I can not find this information anywhere on the web. In the open-source world there are so many choices and so many ways to do things bu...
{ "language": "en", "url": "https://stackoverflow.com/questions/210721", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: LINQ to SQL DataContext.Translate and properties with name different than the source I am working with some tables where I want the C# class to have a different property name than the underlying table column. However, when I use the Translate method to read the results, the properties that don't match the source nam...
{ "language": "en", "url": "https://stackoverflow.com/questions/210724", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How do I access a nested model from view? I have a drop down like this on my page: <p> <%= f.label :episode_id %><br /> <%= f.collection_select(:episode_id, @episodes, :id, :show) %> </p> An episode has an id and belongs_to to a show which has a name. In the dropdown, I'd like to display the show name. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210725", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Data structure for non-overlapping ranges within a single dimension I need a data structure that can store non-overlapping ranges within a single dimension. The entire range of the dimension need not be completely covered. An example would be a conference room scheduler. The dimension is time. No two schedules may o...
{ "language": "en", "url": "https://stackoverflow.com/questions/210729", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Automatically generated predicate row templates for to-many key? In my Core Data managed object model, I have an entity Foo with a to-many relationship (with a to-many inverse) to entity Baz named baz. Baz has a string property named "tag". When I use [NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:[NSA...
{ "language": "en", "url": "https://stackoverflow.com/questions/210735", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: networking in .net/C# Could somebody please point me in the right direction for learning how to do networking in C#/.net 3.5? Code samples and explanations are welcome. Basically I am looking for how to do asynchronous/multithreaded server/client models. I am fairly comfortable with the basics in how to accomplish t...
{ "language": "en", "url": "https://stackoverflow.com/questions/210738", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Modifying NSDatePicker for automatically generated predicate row templates How can I modify the NSDatePickerElementFlags for the NSDatePicker in row templates for NSDate properties returned by [NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:inEntityDescription:]? I would like the NSDatePicker to show hr...
{ "language": "en", "url": "https://stackoverflow.com/questions/210743", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Asp.Net: Javascript Modal Window I would like to create a javascript modal pop up window to get some values from a user in a ASP.Net 2.0 webpage. The basic idea is this. When a user clicks a button, a modal window will come up and ask 3 or 4 questions. The asp.net page will not be able to be changed while this windo...
{ "language": "en", "url": "https://stackoverflow.com/questions/210745", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Why would WaitForSingleObject return WAIT_FAILED MSDN says If the function fails, the return value is WAIT_FAILED. To get extended error information, call GetLastError. The code is: HANDLE m_mutex_handle; /**< m_mutex_handle. The handle to the created mutex. */ m_mutex_handle = ::CreateMutex( 0, false, NUL...
{ "language": "en", "url": "https://stackoverflow.com/questions/210751", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Filtering JSON Data on the Browser/Client Here's the scenario-- you've got a JSON object on the browser, and let's say it has a boolean property, called "Active". We want to create a new JSON object that contains only items that have Active = True. Is there an easy way to do this, other than looping through the enti...
{ "language": "en", "url": "https://stackoverflow.com/questions/210754", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: how to auto select an input field and the text in it on page load Upon page load I want to move the cursor to a particular field. No problem. But I also need to select and highlight the default value that is placed in that text field. A: I found a very simple method that works well: <input type="text" onclick="th...
{ "language": "en", "url": "https://stackoverflow.com/questions/210761", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "78" }
Q: What data type do you use for storing IDs? Why is there a minimum character count for posting questions? o.O Do you use int, bigint, tinyint, whatever? It seems like a small thing I guess, I was just wondering what the usual practice is A: It all depends ... my favorite answer to a question! =) Most of the time we ...
{ "language": "en", "url": "https://stackoverflow.com/questions/210770", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }