text
stringlengths
8
267k
meta
dict
Q: XPath in XmlStream.addObserver doesn't work the way it should What I want to do is to react only on specified root elements. For example, if user sends XmlStream that looks like: <auth> <login>user</login> <pass>dupa.8</pass> </auth> My method ._auth should be executed. I've done it with addObserver method ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373189", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is classpath hell and is/was it really a problem for Java? What is classpath hell and is/was it really a problem for Java? A: Classpath hell is an unfortunate consequence of dynamic linking of the kind carried out by Java. Your program is not a fixed entity but rather the exact set of classes loaded by a JVM ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373193", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "26" }
Q: Python regex for MD5 hash I've come up with: re.findall("([a-fA-F\d]*)", data) but it's not very fool proof, is there a better way to grab all MD5-hash codes? A: Well, since md5 is just a string of 32 hex digits, about all you could add to your expression is a check for "32 digits", perhaps something like this? re...
{ "language": "en", "url": "https://stackoverflow.com/questions/373194", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Close an easygui Python script with the standard 'close' button I've created a very simple app, which presents an easygui entrybox() and continues to loop this indefinitely as it receives user input. I can quit the program using the Cancel button as this returns None, but I would also like to be able to use the stan...
{ "language": "en", "url": "https://stackoverflow.com/questions/373212", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Proper way to get a Winforms UI to block with a dialog until some non-user driven event conditioin? I was asking about specifics with this approach earlier today here but the confused responses has me wondering if I'm going about this all wrong. So here's the problem. I need to architect a WinForms application that...
{ "language": "en", "url": "https://stackoverflow.com/questions/373214", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: relative url in wcf service binding I have a silverlight control which has a reference to a silverlight enabled wcf service. When I add a reference to the service in my silverlight control, it adds the following to my clientconfig file: <configuration> <system.serviceModel> <bindings> <basicH...
{ "language": "en", "url": "https://stackoverflow.com/questions/373219", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Create a 2 dimension Quickreport I think im asking for the right type of report from Quickreport. What we have is a simple table, gauge,site,value Gauge and site are the keyfields, (there could be anynumber of Gauge-Site Pairs) normally there is only at most, about 10 sites. and we are looking to get a reports th...
{ "language": "en", "url": "https://stackoverflow.com/questions/373229", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Check for column name in a SqlDataReader object How do I check to see if a column exists in a SqlDataReader object? In my data access layer, I have create a method that builds the same object for multiple stored procedures calls. One of the stored procedures has an additional column that is not used by the other s...
{ "language": "en", "url": "https://stackoverflow.com/questions/373230", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "236" }
Q: C# How do I use "||" in combination with "!="? Why does adding an "||" OR between 2 "!=" not work for me? When 'name' is "test" or "test2" my if statement doesn't work if I've used 2 "!=" but if I use just one it does, please tell me why. if (col.Name != "test" || col.Name != "test2") { MessageBox.Show("No" + co...
{ "language": "en", "url": "https://stackoverflow.com/questions/373233", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I grab my local changelist and send it to someone else in Perforce? How can I grab my local changelist and send it to someone else in Perforce? More specifically, I would like to send unsubmitted changes from a local pending changelist to another user's pending changelist. A: To shelve your pending changeli...
{ "language": "en", "url": "https://stackoverflow.com/questions/373234", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Linux how do I put double quotes around a file before piping it to tar? I use ls to obtain my filename which has white space so it looks something like: my file with whitespace.tar.bz2 I want to pipe this to tar similar to: ls | grep mysearchstring | tar xvjf How can I insert double quotes before piping it to tar?...
{ "language": "en", "url": "https://stackoverflow.com/questions/373243", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to Design Domain Layer Objects to Represent Multiple Objects & Single Object in Zend Framework? I'm working on creating a domain layer in Zend Framework that is separate from the data access layer. The Data Access Layer is composed to two main objects, a Table Data Gateway and a Row Data Gateway. As per Bill Kar...
{ "language": "en", "url": "https://stackoverflow.com/questions/373244", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: sizeof with a type or variable Recently saw someone commending another user on their use of sizeof var instead of sizeof(type). I always thought that was just a style choice. Is there any significant difference? As an example, the lines with f and ff were considered better than the lines with g and gg: typedef stru...
{ "language": "en", "url": "https://stackoverflow.com/questions/373252", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: How do you count the words in an array of strings with LINQ? Given an array like {"one two", "three four five"}, how'd you calculate the total number of words contained in it using LINQ? A: You can do it with SelectMany: var stringArray = new[] {"one two", "three four five"}; var numWords = stringArray.SelectMany(s...
{ "language": "en", "url": "https://stackoverflow.com/questions/373253", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Hide categories that have no products magento I have many sites that use the same root category of the Main Site. Each product that is added is added to the site it was added to (wow.) and also the Main Site. However, I would like categories on a per site basis to only appear if there are products on that site. If I...
{ "language": "en", "url": "https://stackoverflow.com/questions/373257", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Computing a 95% confidence interval on the sum of n i.i.d. exponential random variables Let's in fact generalize to a c-confidence interval. Let the common rate parameter be a. (Note that the mean of an exponential distribution with rate parameter a is 1/a.) First find the cdf of the sum of n such i.i.d. random va...
{ "language": "en", "url": "https://stackoverflow.com/questions/373258", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: glGetError hangs for several seconds I am developing an OpenGL application and I am seeing some strange things happen. The machine I am testing with is equipped with an NVidia Quadro FX 4600 and it is running RHEL WS 4.3 x86_64 (kernel 2.6.9-34.ELsmp). I've stepped through the application with a debugger and I've no...
{ "language": "en", "url": "https://stackoverflow.com/questions/373261", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do you implement XOR using +-*/? How can the XOR operation (on two 32 bit ints) be implemented using only basic arithmetic operations? Do you have to do it bitwise after dividing by each power of 2 in turn, or is there a shortcut? I don't care about execution speed so much as about the simplest, shortest code. E...
{ "language": "en", "url": "https://stackoverflow.com/questions/373262", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Looking for an XSD representing an 'Order' for a shopping cart I am trying to create an XML schema representing an 'order' for a shopping cart I want this to completely abstract away my shopping cart's implementation -- and eventually support partners sending us orders using this schema. (yes i'm planning on integra...
{ "language": "en", "url": "https://stackoverflow.com/questions/373266", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Why does the EPIC eclipse plugin not show any info in "Explain Errors/Warnings"? I use the "EPIC" plugin to Eclipse for Perl development, but in the "Explain Errors/Warnings" view there's no info at all, even though I have some compilation errors. Do I need to do anything special to get EPIC to display useful info i...
{ "language": "en", "url": "https://stackoverflow.com/questions/373282", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: PHP: Messaging/Logging to Eclipse Console? Is it possible to send messages from a PHP script to the console in Eclipse? Has anyone attempted this already? I'm not very familiar with how the console works, so I'm not sure if there is a standardized method for communicating with it. A: If you look at... Main Menu -> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373287", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Digital Certificate: How to import .cer file in to .truststore file using? Has anyone came across where they have to deal with .truststore file? and knowing how to import .cer into .truststore file? I am not sure if I have to use Java Keytool or Linux command (such as openssl command). Thanks A: Instead of using s...
{ "language": "en", "url": "https://stackoverflow.com/questions/373295", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "102" }
Q: What API call would I use to change brightness of laptop (.NET)? I have Windows Server 2008 installed on a Sony laptop and the brightness control doesn't work. I'd like to write a program to allow me to change it. Currently what I have to do is open the Power control panel, click advanced settings, and fight through...
{ "language": "en", "url": "https://stackoverflow.com/questions/373297", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How do you specify a where clause on data returned from a .Include in an Entity Framework query? Given the following database table hierarchy: Region ------ RegionId RegionName Country ------- CountryId RegionId CountryName Destination ----------- DestinationId CountryId DestinationName Venue ----- VenueId Destin...
{ "language": "en", "url": "https://stackoverflow.com/questions/373303", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Use of setTimeout - how to pass parameters? I am trying to develop a slideshow with a pause between slides. So I'm trying to use the setTimeout statement as shown below. This is written to swap 2.jpg for 1.jpg with a pause of 10 seconds on clicking the button. But it does now work. Can anyone help me. Thanks. <html>...
{ "language": "en", "url": "https://stackoverflow.com/questions/373305", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What architectural perspectives do you consider as part of your overall software design? When someone uses the term XXX architecture I tend to cringe. It often indicates that there's another architectural discipline or perspective that I'm probably not considering. What perspectives of architecture are you conside...
{ "language": "en", "url": "https://stackoverflow.com/questions/373309", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I distinguish between a truly exceptional circumstances and a routine bad condition? A lot of developers say only throw exceptions in truly exceptional circumstances. One of these would be if an external hard drive I want to write to is not switched on (therefore not a connected/registered drive). However, th...
{ "language": "en", "url": "https://stackoverflow.com/questions/373312", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to escape everything in a block in HTML I seem to recall that there is an HTML tag that escapes absolutely everything inside it except the matching closing tag. Kind of like <plaintext> but not fundamentally broken. A: You need to use <pre><code> ... </code></pre>. <xmp> is deprecated and should not be used. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373324", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Invoking Java main method with parameters from Eclipse During development (and for debugging) it is very useful to run a Java class' public static void main(String[] argv) method directly from inside Eclipse (using the Run As context menu). Is there a similarily quick way to specify command line parameters for the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373328", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "33" }
Q: Type and Sys not defined JavaScript error I'm trying to follow a simple example of AJAX-enabled WCF Service like: http://www.pluralsight.com/community/blogs/fritz/archive/2008/01/31/50121.aspx I'm getting the JavaScript errors Type not defined and Sys not defined. Does this mean there is an issue with one of these ....
{ "language": "en", "url": "https://stackoverflow.com/questions/373331", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I get a Cron like scheduler in Python? I'm looking for a library in Python which will provide at and cron like functionality. I'd quite like have a pure Python solution, rather than relying on tools installed on the box; this way I run on machines with no cron. For those unfamiliar with cron: you can schedule...
{ "language": "en", "url": "https://stackoverflow.com/questions/373335", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "458" }
Q: Fortran: line to long / append line - but with text at the end? I have a line of Fortran code, which includes some text. I'm changing the text, which makes the code line too long for Fortran, so I split it over two lines using 'a'. Was: IF (MYVAR .EQ. 1) THEN WRITE(iott,'(A) (A)') 'ABC=', SOMEVAR Changed to:...
{ "language": "en", "url": "https://stackoverflow.com/questions/373342", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Simple (standalone) Java SOAP web service client from WSDL using Maven I'm looking to generate a simple standalone Java client which will make calls to a SOAP web service, given a wsdl. When I say simple and standalone I mean that once I'm done I want to be able to do something like import my.generated.nonsense; p...
{ "language": "en", "url": "https://stackoverflow.com/questions/373350", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Why is Windows Vista 64-bit using a 32-bit cmd.exe by default? (machine-specific) The situation: I need to convert our current development environment from Windows XP 32-bit to Windows Vista 64-bit (*). Naturally, I've run into plenty of places in our build system where hardcoded paths were problematic (e.g. "C:\Pro...
{ "language": "en", "url": "https://stackoverflow.com/questions/373351", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Obtaining iPhone Photo Exposure Information Is there any way to get the exposure settings (aperture, shutter speed, ISO) for a photo taken on an iPhone? An app running on the iPhone can use the UIImagePickerController interface for taking pictures, but that doesn't provide much info about the picture. The EXIF data ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373357", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is loading a dependency assembly from the internet a good practice? I know there are several ways to deploy a .net windows client application: There's Windows Installer, Click Once, a simple download & run, and loading the windows forms / WCF application in Internet Explorer (no to confuse the latter with WCF/E - Si...
{ "language": "en", "url": "https://stackoverflow.com/questions/373362", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why aren't Java generic type parameters reified at runtime? My understanding is that C# and java differ with respect to generics in some ways, one of which is that generic type parameters are available at runtime in C#/.NET but not in Java. Why did the Java language designers do it this way? A: To allow binary com...
{ "language": "en", "url": "https://stackoverflow.com/questions/373363", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How do I write out a text file in C# with a code page other than UTF-8? I want to write out a text file. Instead of the default UTF-8, I want to write it encoded as ISO-8859-1 which is code page 28591. I have no idea how to do this... I'm writing out my file with the following very simple code: using (StreamWriter s...
{ "language": "en", "url": "https://stackoverflow.com/questions/373365", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "57" }
Q: C# Object Initializers and v2.0 compiler error I'm having an issue setting up one of my projects in TeamCity (v4.0), specifically when it comes to using Object Initializers. The project builds fine normally, however it would seem that TeamCity transforms the build file into something it likes (some MSBuild mutation)...
{ "language": "en", "url": "https://stackoverflow.com/questions/373366", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: sqlite3:Unable to close due to unfinalised statements I have two sqlite connections and execute like below(CMyDatabase is a derived class of sqlite3): CMyDatabase* dbConnection1 = new CMyDatabase; dbConnection1->OpenDataBase(CQCommon::GetModulePath() + L"test.db"); CMyDatabase* dbConnection2 = new CMyDatabase; dbCo...
{ "language": "en", "url": "https://stackoverflow.com/questions/373369", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How do I get the UTC time of "midnight" for a given timezone? The best I can come up with for now is this monstrosity: >>> datetime.utcnow() \ ... .replace(tzinfo=pytz.UTC) \ ... .astimezone(pytz.timezone("Australia/Melbourne")) \ ... .replace(hour=0,minute=0,second=0,microsecond=0) \ ... .astimezone(pytz.UT...
{ "language": "en", "url": "https://stackoverflow.com/questions/373370", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "75" }
Q: How would you attack this polymorphism string building problem Sorry for not so discrptive title, if someone wants to change it go ahead. Also note I have already asked a question about this kind of thing but this one is more about how you would attack it because my attack just doesn't seem to feel right. I am havi...
{ "language": "en", "url": "https://stackoverflow.com/questions/373380", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Geocoding libraries I'm using python and I need to map locations like "Bloomington, IN" to GPS coordinates so I can measure distances between them. What Geocoding libraries/APIs do you recommend? Solutions in other languages are also welcome. A: The Google's web service is very easy to use. Just put the query in th...
{ "language": "en", "url": "https://stackoverflow.com/questions/373383", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Retrieve return value from DB2 stored procedure I have a block of code that is repeated within a DB2 stored procedure. I would like to separate this out into a new procedure that I can call with parameters and have it return a value. How do I create a procedure to return a value and how do I call this procedure from...
{ "language": "en", "url": "https://stackoverflow.com/questions/373386", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How can I generate a Visual Studio 2008 solution manually? For a project I am doing I need to manually create a .net project. I am currently using a StreamWriter to create the .sln, .csproj and base (empty for now) class. I am also generating the AssemblyInfo.cs class. I have copied exactly the files and folder stru...
{ "language": "en", "url": "https://stackoverflow.com/questions/373387", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Best way to implement multi-language/globalization in large .NET project I'll soon be working on a large c# project and would like to build in multi-language support from the start. I've had a play around and can get it working using a separate resource file for each language, then use a resource manager to load up ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373388", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "100" }
Q: What does this this ActionScript syntax mean? ( Syntax for returning Objects Inline ) I am a Java programmer and need to work on a Flex/ActionScript project right now. I got an example of using ITreeDataDesriptor from Flex 3 Cookbook, but there is one line of actionscript code that's hard for me to understand. I app...
{ "language": "en", "url": "https://stackoverflow.com/questions/373395", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Taking a snapshot of optimized JVM runtime I know that the JVM can do some pretty serious optimizations at runtime, especially in -server mode. Of course, it takes a little while for the JVM to settle down and reach peak performance. Is there any way to take a snapshot of those optimizations so they can be applied i...
{ "language": "en", "url": "https://stackoverflow.com/questions/373397", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Secure, sandboxable user exposed programming language / environment? Beyond offering an API for my website, I'd like to offer users the ability to write simple scripts that would run on my servers . The scripts would have access to objects owned by the user and be able to manipulate, modify, and otherwise process th...
{ "language": "en", "url": "https://stackoverflow.com/questions/373406", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: What's the difference between passing by reference vs. passing by value? What is the difference between * *a parameter passed by reference *a parameter passed by value? Could you give me some examples, please? A: Pass by value - The function copies the variable and works with a copy (so it doesn't change any...
{ "language": "en", "url": "https://stackoverflow.com/questions/373419", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "689" }
Q: Oracle checking existence before deletion in a trigger I have analyzed a hibernate generated oracle database and discovered that a delete of a row from a single table will spawn the firing of 1200+ triggers in order to delete the related rows in child tables. The triggers are all auto-generated the same - an automat...
{ "language": "en", "url": "https://stackoverflow.com/questions/373421", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I install a .NET DLL into a COM+ application using MSI (WiX) Update: looks like this is indeed a WiX limitation - Cannot add 64bit com+ component (3.0.3907.0) I have a .NET application with an MSI installer created using WiX 2.0. The installer creates a COM+ application (amongst other things) and installs a ....
{ "language": "en", "url": "https://stackoverflow.com/questions/373436", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What Simple Changes Made the Biggest Improvements to Your Delphi Programs I have a Delphi 2009 program that handles a lot of data and needs to be as fast as possible and not use too much memory. What small simple changes have you made to your Delphi code that had the biggest impact on the performance of your program...
{ "language": "en", "url": "https://stackoverflow.com/questions/373449", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: HTML.CheckBox(string) evaluates to two HTML elements instead of one The code <%=Html.CheckBox("SendEmail") %> evaluates to two HTML elements when it's rendered <input id="SendEmail" name="SendEmail" type="checkbox" value="true" /> <input name="SendEmail" type="hidden" value="false" /> Is this by a bug? Or by des...
{ "language": "en", "url": "https://stackoverflow.com/questions/373454", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: split string on a number of different characters I'd like to split a string using one or more separator characters. E.g. "a b.c", split on " " and "." would give the list ["a", "b", "c"]. At the moment, I can't see anything in the standard library to do this, and my own attempts are a bit clumsy. E.g. def my_split(s...
{ "language": "en", "url": "https://stackoverflow.com/questions/373459", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Help with C++ List erase function I'm trying to do a simple erase and keep getting errors. Here is the snippet of code for my erase: std::list<Mine*>::iterator iterMines = mines.begin(); for(int i = oldSizeOfMines; i >0 ; i--, iterMines++) { if(player->distanceFrom(*iterMines) < radiusOfOnScreen) { o...
{ "language": "en", "url": "https://stackoverflow.com/questions/373462", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to generate HTML in a Pop Up window with Asp.Net I have very simple html report generated from one of my objects on server. I generate html code at PageLoad because I need to clear that object from session and don't want ask external web service for data after user clicks on link button. Roughly idea is that u...
{ "language": "en", "url": "https://stackoverflow.com/questions/373488", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Insert Dates in the return from a query where there is none We are building a query to count the number of events per hour, per day. Most days there are hours that do not have any activity and therefore where the query is run the count of activities per hour show up but there are gaps and the query excludes these. W...
{ "language": "en", "url": "https://stackoverflow.com/questions/373490", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Can Flash Remoting run through a HTTP (Squid) proxy server I have a network were would like like to deliver data using the Flash Remoting data format over HTTP. We have Squid working as a reverse proxy/accelerator, are there any known problems running this traffic through Squid. We would configure that particular ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373500", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Reporting Services Deployment Problem Deploying from VS 2005 to RS 2008 I've got a report that works perfectly in development previews. But when I deploy I get the following error: In the Dev Environment the Error displayed is: Error 4 The data source 'myDataSource' cannot be found. c:\reporting services pro...
{ "language": "en", "url": "https://stackoverflow.com/questions/373507", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: CouchDB + Datamapper + View = no ids I'm using couchdbx v. 0.8.1 and datamapper 0.9.8. I've written a few simple views, copied some from other examples. If I query the views with a browser they return id's. If I query them using datamapper in ruby I get no id's. I've googled for days, been on IRC and looked through ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373516", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I use a local HTTPS URL in java? Using the Java URL class, I can connect to an external HTTPS server (such as our production site), but using a local URL I get following exception. "SunCertPathBuilderException: unable to find valid certification path to requested target". How do I get a valid certification...
{ "language": "en", "url": "https://stackoverflow.com/questions/373518", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How can I write out or read in a Perl hash of arrays? I have a program in Perl I'm working on where I would need multiple keys, and a way of giving each key multiple values and follow that by being able to both read them in and write them out to an external file depending on if the key matches what the person enters...
{ "language": "en", "url": "https://stackoverflow.com/questions/373520", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Add records from external ruby script What is the best way to add records to a database from an external script. I would like to use activerecord but I'm not sure how to do so outside the rails directory structure. A: You can use activerecord in ruby. Assuming you have installed the required database driveer. you c...
{ "language": "en", "url": "https://stackoverflow.com/questions/373524", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: silverlight: reflection effect I've seen examples in silverlight where the achieve a effect using 1 of 2 ways: * *Two image objects, both displaying the same image, but the bottom one rotating it 180 degrees and applying a gradient image opacity *A MediaElement object and a VideoBrush element. I have a series ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373528", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Change the connection string of a bound data set during runtime Is it possible to change the connection string of a bound dataset during runtime? I have created an application in my laptop, and the server host of my connection is localhost, but when I deploy it in another computer, I wanted my application to a datab...
{ "language": "en", "url": "https://stackoverflow.com/questions/373535", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Why is App_Offline failing to work as soon as you it starts loading dlls? Could anyone please help me with this. On the production site app_offline.htm works only till you start uploading dlls. As soon as you start uploading dlls it throws following error"Could not load file or assembly 'SubSonic' or one of its depe...
{ "language": "en", "url": "https://stackoverflow.com/questions/373540", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How to do joins in LINQ on multiple fields in single join I need to do a LINQ2DataSet query that does a join on more than one field (as var result = from x in entity join y in entity2 on x.field1 = y.field1 and x.field2 = y.field2 I have yet found a suitable solution (I can add the extra constra...
{ "language": "en", "url": "https://stackoverflow.com/questions/373541", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "298" }
Q: How to Check for Image in Cache Using Silverlight I am creating a basic image browsing application using Silverlight. Depending on the user's connection speed, some images may take time to appear once they click on the thumb nail. I would like to show a progress bar while it is being downloaded. I have this part ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373570", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Geometry column: STGeomFromText and SRID (what is an SRID?) I'm playing with the new geography column in SQL Server 2008 and the STGeomFromText function. Here is my code (works with AdventureWorks2008) DECLARE @region geography; set @region = geography::STGeomFromText('POLYGON(( -80.0 50.0, -90.0 50.0, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373589", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: When would you use the mediator design pattern As the title states when would you recommend the use of the mediator design pattern and where do you see it used incorrectly? A: Use a mediator when the complexity of object communication begins to hinder object reusability. This type of complexity often appears in vi...
{ "language": "en", "url": "https://stackoverflow.com/questions/373598", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: How to pass special characters so ASP.NET MVC can handle correctly query string data? I am using a route like this one: routes.MapRoute("Invoice-New-NewCustomer", "Invoice/New/Customer/New/{*name}", new { controller = "Customer", action = "NewInvoice" }, new { name = @"[^\.]*" }); There is an action whi...
{ "language": "en", "url": "https://stackoverflow.com/questions/373599", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: How do I load a dropdown list in ASP.NET and C#? How do I load a dropdown list in asp.net and c#? A: You can also do it declaratively: <asp:DropDownList runat="server" ID="yourDDL"> <asp:ListItem Text="Add something" Value="theValue" /> </asp:DropDownList> You can also data bind them: yourDDL.DataSource = Your...
{ "language": "en", "url": "https://stackoverflow.com/questions/373605", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Elegant way to prevent circular events in MVC? The question, in brief: In MVC, how do you distinguish between a checkbox click (or a selectbox or listbox change) from a human meaning "Controller, modify the model", and a checkbox click (or a selectbox or listbox change) from the Controller meaning "I'm updating the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373615", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How do I design a database to store changes over time? This database will store a list of children. But the problem is, they will have their weight measured once a day. How can I store the changes so I can easily query their actual weight and the weight variation over one day, one week and one month? A: I'd think s...
{ "language": "en", "url": "https://stackoverflow.com/questions/373623", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Singleton for Application Configuration In all my projects till now, I use to use singleton pattern to access Application configuration throughout the application. Lately I see lot of articles taking about not to use singleton pattern , because this pattern does not promote of testability also it hides the Componen...
{ "language": "en", "url": "https://stackoverflow.com/questions/373626", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "32" }
Q: Examples of design pattern misuse Design patterns are great in that they distill a potentially complex technique into something idiomatic. Often just the fact that it has a name helps communication and understanding. The downside is that it makes it easier to try to use them as a silver bullet, applying them to ever...
{ "language": "en", "url": "https://stackoverflow.com/questions/373636", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Running interactive commands in Paramiko I'm trying to run an interactive command through paramiko. The cmd execution tries to prompt for a password but I do not know how to supply the password through paramiko's exec_command and the execution hangs. Is there a way to send values to the terminal if a cmd execution...
{ "language": "en", "url": "https://stackoverflow.com/questions/373639", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "47" }
Q: CSS - Centering a page - then making the page 100% height I'm trying to center a page and then make it 100% in height. I have a div called "content" as the parent element of all elements in the HTML page. What do I need to do next? I'd like to stay away from any CSS-hacks. This is currently working in IE7, but not i...
{ "language": "en", "url": "https://stackoverflow.com/questions/373643", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: git archive vs cp -R If I have a clone of a git repository as a cached copy on a remote server for capistrano/vlad style deployment, is it better to do A) git archive --format=tar origin/master | (cd #{destination} && tar xf -) or B) cp -R cached-copy #{destination} && rm -Rf #{destination}/.git To clarify, the r...
{ "language": "en", "url": "https://stackoverflow.com/questions/373656", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Need a good unmanaged C++ OCX example I need a very simple and clear example of how to create an OCX in unmanaged C++ code. Ideally, I'd like to consume it in Office, but any container (i.e. VB6, .NET WinForms) should be good. I am having trouble seeing how I can add controls to the OCX canvas... I have seen example...
{ "language": "en", "url": "https://stackoverflow.com/questions/373662", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: WPF FlowDocument Paragraph Inlines Length Is there any limitations to the WPF Document.Paragraph object when using the FlowDocument control? I have the FlowDocument turning blank when I add a Paragraph that is more than 450 lines to the Paragraph. I could not locate anything within the MSDN documentation regarding ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373663", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: I've tested in Chrome, do I need to test in Safari? I've tested in Chrome, do I need to test in Safari? A: Browsershots will send you screen shots of your page in just about every browser ever made. A: Safari uses 'mac' fonts, but Chrome would use 'Windows' fonts. I've noticed that there can sometimes be problems...
{ "language": "en", "url": "https://stackoverflow.com/questions/373665", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: ASP.NET InnerXml automatically/incorrectly appending attribute text to tags So I have some XML in the following format: <somenode> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title/> </head> <body> <p>P one</p> <p>Another p</p> </body> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373671", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Are there well known algorithms for deducing the "return types" of parser rules? Given a grammar and the attached action code, are there any standard solution for deducing what type each production needs to result in (and consequently, what type the invoking production should expect to get from it)? I'm thinking of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373680", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Django Authentication from .NET using HttpWebRequest and HttpWebResponse via HTTP POST I am creating an application in .NET that will serve as a second UI for my already-deployed Django app. For some operations users need to authenticate themselves (as Django users). I used a super-simple way to do this (without enc...
{ "language": "en", "url": "https://stackoverflow.com/questions/373687", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Password protected PDF/Excel reports using SQL Reporting services I am generating a reports using SQL Reporting services 2005. I need to protect the protect the reports(pdf and excel) with the password while the user is exporting the report to to excel or pdf. Is there any way to protect the report. A: The short an...
{ "language": "en", "url": "https://stackoverflow.com/questions/373718", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Javascript compression via .htaccess? I'm using Apache. I'm auto gzipping my HTML & CSS files on the fly using the following directive in my .htaccess file. # Enable ETag FileETag MTime Size # Set expiration header ExpiresActive on ExpiresDefault "access plus 1 year" ExpiresByType image/gif A2592000 ExpiresByType ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373725", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Override ActiveRecord attribute methods An example of what I'm talking about: class Person < ActiveRecord::Base def name=(name) super(name.capitalize) end def name super().downcase # not sure why you'd do this; this is just an example end end This seems to work, but I was just read the section on o...
{ "language": "en", "url": "https://stackoverflow.com/questions/373731", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "153" }
Q: Handling scroll bars in VC++ 6.0 and MFC Hai in vc++6.0 MFC, i connected a serial port, while reading and displaying a data(i want to display date and time ) in edit box (IDC_EDIT1), My problem is I used a vertical scrollbar in the edit box. Whenever I display new data, the vertical scrollbar moves up; it must come ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373744", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Linq validation non-nullable properties I have Linq entities which contain non-nullable string properties. I'd like to iterate over the properties, perhaps in the partial OnValidate method, and set those properties to an empty string if they are null. How can I do this without explicitly writing code for each prope...
{ "language": "en", "url": "https://stackoverflow.com/questions/373757", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Converting a filepath to a url securely and reliably I'm using php and I have the following code to convert an absolute path to a url. function make_url($path, $secure = false){ return (!$secure ? 'http://' : 'https://').str_replace($_SERVER['DOCUMENT_ROOT'], $_SERVER['HTTP_HOST'], $path); } My question is basi...
{ "language": "en", "url": "https://stackoverflow.com/questions/373761", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: C++ - Unresolved external symbols Simply put: foo.h: #include "bar.h" class foo { private: bar it; void DoIt(); } bar.h: class bar { public: void Test(); } foo.cpp: void foo::DoIt() { it.Test(); } This will result in a: error LNK2001: unresolved external symbol Why? A: You have not written the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/373762", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: When writing a web backend for a system, is it important the code can still work without Javascript? Is it alright to expect that the user using the back end will have Javascript enabled? I guess the answer I'll get is 'it depends on your target users'. I am developing a system for fun that will hopefully be used by...
{ "language": "en", "url": "https://stackoverflow.com/questions/373768", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Linux using grep to print the file name and first n characters How do I use grep to perform a search which, when a match is found, will print the file name as well as the first n characters in that file? Note that n is a parameter that can be specified and it is irrelevant whether the first n characters actually co...
{ "language": "en", "url": "https://stackoverflow.com/questions/373774", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Monitor Usage Statistic-- How it is done? Windows, Firefox or Google Chrome all monitor usage statistics and analyze the crash reports are sent to them. I am thinking of implementing the same feature into my application. Of course it's easy to litter an application with a lot of logging statement, but this is the a...
{ "language": "en", "url": "https://stackoverflow.com/questions/373776", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How can I disable horizontal scrolling in a WPF ListBox? This seems to be an absurdly simple question but Google and Stack Overflow searches yield nothing. How can I disable horizontal scrolling in a WPF ListBox when items take up more horizontal space than is available in the box? A: In XAML: <ListBox ScrollViewer...
{ "language": "en", "url": "https://stackoverflow.com/questions/373778", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "136" }
Q: Could we have custom name of the primary key column in Fluent NHibernate? I'm so surprise while I'm working in Fluent NHibernate. I got my legacy database that has primary key column name is different from my property in domain model. I'm sure that I can use this mapping file: <class name="Person"> <id name="Id" c...
{ "language": "en", "url": "https://stackoverflow.com/questions/373787", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Fullscreen UIView with Status bar and Navigation Bar overlay on the top What is the proper way to implement the status bar and navigation bar that go on top of an UIView? alt text http://img.skitch.com/20081217-t78sdixk37hqgdh1ia2fgec4st.png A: Just set “wants fullscreen layout” in your view controller. That solves...
{ "language": "en", "url": "https://stackoverflow.com/questions/373791", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "51" }
Q: Which concurrent programming concepts do hiring managers expect developers to understand? When I hire developers for general mid-to-senior web app development positions, I generally expect them to understand core concurrent programming concepts such as liveness vs. safety, race conditions, thread synchronization and...
{ "language": "en", "url": "https://stackoverflow.com/questions/373794", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }