text
stringlengths
8
267k
meta
dict
Q: Fetch two next and two previous entries in a single SQL query I want to display an image gallery, and on the view page, one should be able to have a look at a bunch of thumbnails: the current picture, wrapped with the two previous entries and the two next ones. The problem of fetching two next/prev is that I can't (...
{ "language": "en", "url": "https://stackoverflow.com/questions/406616", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Debug.WriteLine() happening twice when running tests I have an odd problem in VS2008 running unit tests. When I run the unit test using either Resharper or TestDriven, in either normal or Debug mode, the Debug.WriteLine("foo") lines are being carried out twice: ie. in the Output window of VS I can see each line writ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406632", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Why does this code only work when I use a break point? See code below, for some reason it only works when I put a breakpoint on line 2 (*) is there some delay? Is it starting the next line before it finishes the 2nd one? dp.SSLCertStoreType = nsoftware.IBizPayPal.DirectpaymentSSLCertStoreTypes.sstPEMKey *dp.SSLCert...
{ "language": "en", "url": "https://stackoverflow.com/questions/406637", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Vertical center an anchor tag within a fieldset I am trying to vertically center an anchor within a fieldset using CSS but it always appears to align to bottom. Is there any tricks to this? A: You are not giving too much detail here. Besides the line-height you might also want to tweak top and bottom padding. It al...
{ "language": "en", "url": "https://stackoverflow.com/questions/406640", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Moving ASP.net webservices to WCF I am verifying my login authentication using ASP.net webservices. But the client requested to move to WCF. I need to know in what way WCF differs from ASP.net webservices. What are the advantages for me to use WCF than ASP.net webservices. A: Recently there was an episode about th...
{ "language": "en", "url": "https://stackoverflow.com/questions/406665", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Objective-C Clarification; -/+ and *var I'm teaching myself Objective-C from a book (Cocoa programming for mac OS X) and am about halfway through however I have two questions that aren't answered or defined in the book. * *When defining class methods what is the difference between (assuming there in a .h file): -...
{ "language": "en", "url": "https://stackoverflow.com/questions/406667", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How does the memory footprint of some common web framework(s) compare? Hypothetically, if I were to build the same app using a few popular/similar frameworks, say PHP(cakePHP|Zend), Django, and Rails, should the memory consumption of each be roughly the same? Also, I'm sure many have evaluated or used each and would...
{ "language": "en", "url": "https://stackoverflow.com/questions/406668", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: php exec() error I'm having a little problem with the following: When I execute this line: echo exec(createDir($somevariable)); I get this error: Warning: exec() [function.exec]: Cannot execute a blank command in /home/mydir/myfile.inc.php on line 32 Any ideas. Thanks. A: exec() expects a string argument, which i...
{ "language": "en", "url": "https://stackoverflow.com/questions/406682", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Reading the fileset from a torrent I want to (quickly) put a program/script together to read the fileset from a .torrent file. I want to then use that set to delete any files from a specific directory that do not belong to the torrent. Any recommendations on a handy library for reading this index from the .torrent f...
{ "language": "en", "url": "https://stackoverflow.com/questions/406695", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: Performance comparisons betweeen enum evaluations and ints Would there be difference in speed between if (myInt == CONST_STATE1) and if (myEnum == myENUM.State1) in c#? A: The thing to be careful about when using Enums is not to use any of the operations that require reflection (or use them with care). For examp...
{ "language": "en", "url": "https://stackoverflow.com/questions/406700", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: UrlEncode of link ids with ASP.NET MVC HtmlHelper extension methods I have actions that take string id parameters that are based on a username which can include characters that require encoding, for instance "user?1" If I use ActionLink() to generate the links, passing the string without encoding, it generates a lin...
{ "language": "en", "url": "https://stackoverflow.com/questions/406711", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: CSLA .NET Architecture Is CSLA.NET architecture is a good choice in an enterprise level application? A: That depends on what you mean by enterprise level... what is the application? Is a desktop application, Web based? Middleware? A shared library? CSLA has some good and bad points. I've asked a similar question. L...
{ "language": "en", "url": "https://stackoverflow.com/questions/406728", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What's the point of testing fake repositories? I've been trying to push my mentallity when developing at home to be geared more towards TDD and a bit DDD. One thing I don't understand though is why you would create a fake repository to test against? I haven't really looked into it much but surely the idea of testin...
{ "language": "en", "url": "https://stackoverflow.com/questions/406731", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How well is Objective-C++ supported? I've been learning Objective-C and Cocoa by working my way through the Hillegass book and it occurs to me that I might be better off using Objective-C++. Objective-C seems like the clear choice for developing UIs but I have a very strong C++ background and would love to develop a...
{ "language": "en", "url": "https://stackoverflow.com/questions/406753", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "33" }
Q: What's your most controversial programming opinion? This is definitely subjective, but I'd like to try to avoid it becoming argumentative. I think it could be an interesting question if people treat it appropriately. The idea for this question came from the comment thread from my answer to the "What are five things ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406760", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "363" }
Q: CSS dropdown, drops right instead Removed link, problem solved The menu at the top is supposed to be a dropdown menu, but it expands to the right instead. My CSS is this (I believe this is the relevant bit anyway) #primary-nav, #primary-nav ul { list-style: none; margin: 0px; padding: 0px; } #primary-nav ul { posi...
{ "language": "en", "url": "https://stackoverflow.com/questions/406776", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Informix JDBC timestamp string format I have Informix database with timestamp field defined as YEAR TO SECOND. When I show this field using JDBC rs.getString(column) it uses format with miliseconds so this field looks like: 2008-12-18 13:58:14.0 I would like it to use only YEAR TO SECOND fields. I set environment v...
{ "language": "en", "url": "https://stackoverflow.com/questions/406777", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Send UDP broadcast message with wxWidgets Using wxWidgets 2.8.9 on Mac/Win/Linux, how do I send a UDP broadcast message? Receiving is working using wxDatagramSocket, but it's not obvious to me how I would go about SENDING a UDP broadcast message. A: In principle simply using wxSOCKET_BROADCAST in the socket flags s...
{ "language": "en", "url": "https://stackoverflow.com/questions/406789", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why can't I find _left and _right in BinarySearchTree? I'm having a problem with the following code snippet: using System; using System.Collections.Generic; using System.Text; namespace trees_by_firas { class Program { static void Main(string[] args) { BinarySearchTree t = new Bi...
{ "language": "en", "url": "https://stackoverflow.com/questions/406791", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Forcing reload of a html page after a small wait I have a html page A and a link in the page which opens up page B in a new window. How to reload the page A on clicking and opening this link ? EDIT: I should have been more clear. Page B opens in a new window and not as a popup. The hyperlink in question has its tar...
{ "language": "en", "url": "https://stackoverflow.com/questions/406810", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: iPhone Development - XMLParser vs. libxml2 vs. TouchXML I cannot find comparison of these parsing technique. Which one is most commonly used? Regards. Mustafa A: NSXMLParser is a SAX parser, meaning it steps through the XML document, and informs you (via delegate methods) of various events (such as starting an xml ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406811", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "32" }
Q: jquery: on click, add text from title-tag to an input box I have a contactbook, and a form close to it... For the form, one of the requirements is to fill in the receiver for the message. So when the user clicks on a contact from the contactbook, automaticly the username from the titel-tag should appear in the recei...
{ "language": "en", "url": "https://stackoverflow.com/questions/406813", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Do you separate your unit tests from your integration tests? I was just wondering if anyone else just sees integration tests as just a special unit test. I have, however, heard from other programmers that it is a good idea to separate your unit tests and integration test. I was wondering if someone could explain w...
{ "language": "en", "url": "https://stackoverflow.com/questions/406826", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Can Java Enumerations be merged (like Bitwise in C#)? Is there a way in Java to declare an enumeration whose values can be used together? For example: enum FileAccess { Read, Write, ReadWrite } Is it possible to define ReadWrite as Read | Write (or anything that would yield the same result)? A: See EnumSet which a...
{ "language": "en", "url": "https://stackoverflow.com/questions/406830", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: Language in a Sandbox in Rails I've found that there WAS a sandbox gem (created by the guys that made try ruby in your browser but it was compatible only with Ruby 1.8. Another problem is that I cannot find it anymore (it seems they stop serving the gem from the servers...). So, is there any secure way of running ru...
{ "language": "en", "url": "https://stackoverflow.com/questions/406833", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: It's possible to develop for .net 2.x in Visual Studio 2008? It's possible to develop only for .net 2.0 running Visual Studio 2008? Thanks! A: Check out this article - http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx You might be able to ditch 2005 now... I still use 2.0 projec...
{ "language": "en", "url": "https://stackoverflow.com/questions/406850", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to show all ASP.NET web application's loaded/referenced assemblies with version numbers? I'd like to show a list of all used assemblies on a dedicated web page inside a ASP.NET web application for debugging and maintainance purposes (there are many instances of this web application on many different servers). Th...
{ "language": "en", "url": "https://stackoverflow.com/questions/406860", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Calling SSIS package Asynchronously I'm calling a SSIS package using LoadPackage(...). Is it possible to make this call an Asynchronous call? A: Yes, use an asynchronous delegate, as demostrated here: http://msdn.microsoft.com/en-us/library/h80ttd5f.aspx A: If you just want it to run in the background then yes, yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/406866", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Debugging issues I have a certain application in MSVC6.0 all C code. I have it as two workspaces : 1.) First workspace creates a static library file, *.lib after compiling the source. 2.)Second workspace has a test application(main()) and links the previously generated *.lib library and creates and exe. When i try ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406870", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: .htaccess URL is being cut at a space (I'm using Codeigniter) I've used the following code to map https://live.example.com on to http://example.com/api Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTPS} =on RewriteCond %{HTTP_HOST} ^live\.example\.com [NC] RewriteRule (.+)$ "http://example.com/api/$1" ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406880", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: simple C++ templates suited for STL Containers I need a template like this, which work perfectly template <typename container> void mySuperTempalte (const container myCont) { //do something here } then i want to specialize the above template for std::string so i came up with template <typename container> void m...
{ "language": "en", "url": "https://stackoverflow.com/questions/406903", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Why does Ruby have Rails while Python has no central framework? This is a(n) historical question, not a comparison-between-languages question: This article from 2005 talks about the lack of a single, central framework for Python. For Ruby, this framework is clearly Rails. Why, historically speaking, did this happen ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406907", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: how to add 2 values of textbox in asp.net using javascript I have 2 textbox in my asp.net page and also have one hiddenfield in my asp.net page , my hiddenfield will always have numeric value like 123.00 , and in my one textbox also I will always have numeric value like 20.00 now I want to add this hiddenfield valu...
{ "language": "en", "url": "https://stackoverflow.com/questions/406912", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Using BeginInvoke/EndInvoke in a multithreaded fashion. How do AsyncCallback, AsyncWaitHandle and IsCompleted interact? Andreas Huber's answer to this question gave me an idea to implement Concurrent<T> with async delegates instead of the ThreadPool. However, I am finding it harder to understand what's going on when...
{ "language": "en", "url": "https://stackoverflow.com/questions/406915", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Detect if an application is not in use How can I detect if an application is not used for more than x minutes in DELPHI A: If you write Windows app take a look at GetLastInputInfo function. A: Here is some code that looks for mouse and keybord activity with the applicatin procedure TUserActivity.AppMessage(var Msg...
{ "language": "en", "url": "https://stackoverflow.com/questions/406927", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to intercept special (alt / ctrl) key press? How can I catch key combinations like ALT+K or CTRL+ALT+H in python curses? A: A terminal converts the control key in combination with a letter key to a normal ASCII code. This can be read from the getch() function like any other key press. CTRL-A: getch() returns 1 ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406933", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: PyQt: getting widgets to resize automatically in a QDialog I'm having difficulty getting widgets in a QDialog resized automatically when the dialog itself is resized. In the following program, the textarea resizes automatically if you resize the main window. However, the textarea within the dialog stays the same si...
{ "language": "en", "url": "https://stackoverflow.com/questions/406939", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: What is a good name for a configuration value that holds that name of a table or view? Is there a database term for "table or view"? In my app, the table name I'm pulling data from is configurable using the configuration setting UserTableName Now the DBA went and renamed the table but created a view using the origin...
{ "language": "en", "url": "https://stackoverflow.com/questions/406954", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Easy way to mock a WCF service? I've got an app which is using a WCF service. Now I'd like to add unit tests to the app. For some cases I need to mock the WCF service, since getting the desired behaviour from the service sometimes is tough (e.g. service throws special exceptions). I could add yet another interface t...
{ "language": "en", "url": "https://stackoverflow.com/questions/406955", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: NHibernate2 query is wired when fetch the collection from the proxy. Is this correct behavior? This is my class: public class User { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual IList<UserFriend> Friends { get; protected set; } } public class UserF...
{ "language": "en", "url": "https://stackoverflow.com/questions/406957", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: VS2005 - Automatically requesting checkout of form on open, with "View Designer" I'm trying to integrate our Source Control(SourceAnywhere) with VS and are getting a lot of push back because of this one issue. Almost every time we open some of our Windows forms using 'View Designer' it edits the file (* appears be...
{ "language": "en", "url": "https://stackoverflow.com/questions/406960", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to display java applet inside GWT page? I'm probably missing something simple here, but I can't find the answer elsewhere. I just want to display an applet in my GWT code. OS: Windows XP Java: JDK 1.6.0_10 Other: GWT, GWT-Ext 2.0.5 Here is the applet (obviously simplified for testing): package foo.applet; impo...
{ "language": "en", "url": "https://stackoverflow.com/questions/406963", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What is the best way to check that external applications are available? I have an application which had optional extras depending on if the user has the software installed. On Linux what is the best way to determine if something like python and PyUsb is installed? I am developing a C++ Qt application if that helps. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406966", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Implement word boundary states in flex/lex (parser-generator) I want to be able to predicate pattern matches on whether they occur after word characters or after non-word characters. In other words, I want to simulate the \b word break regex char at the beginning of the pattern which flex/lex does not support. Here'...
{ "language": "en", "url": "https://stackoverflow.com/questions/406985", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Connecting a form to a Javascript Object (and other best practice advice) I've been using javascript to do lightweight functionality on sites for years - DOM manipulation etc - but just now im beginning to investigate using it to do a lot more of the heavy lifting (in combo with PHP). I've only just started getting ...
{ "language": "en", "url": "https://stackoverflow.com/questions/406987", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Notifications in wxWidgets? I'm working on a small application using C++/wxWidgets, where several parts of the GUI need to be updated based on e.g. received UDP datagrams. More specifically, a secondary thread tries to keep a list of available "clients" in the network (which may come and go away) and e.g. correspond...
{ "language": "en", "url": "https://stackoverflow.com/questions/407004", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Need to load the whole postgreSQL database into the RAM How do I put my whole PostgreSql database into the RAM for a faster access?? I have 8GB memory and I want to dedicate 2 GB for the DB. I have read about the shared buffers settings but it just caches the most accessed fragment of the database. I needed a soluti...
{ "language": "en", "url": "https://stackoverflow.com/questions/407006", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "25" }
Q: How to convert an existing Java application to a SYS V service (daemon) I have a Java application, to start it I use java -jar myapp.jar To stop it I use CTRL+C. Now I need to convert that application to something that I can start with: /etc/init.d/myapp start And I can stop with: /etc/init.d/myapp stop The pr...
{ "language": "en", "url": "https://stackoverflow.com/questions/407016", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Sending Keyboard Macro Commands to Game Windows I wanna do a macro program for a game. But there is a problem with sending keys to only game application (game window). I am using keybd_event API for sending keys to game window. But I only want to send keys to the game window, not to explorer or any opened window whi...
{ "language": "en", "url": "https://stackoverflow.com/questions/407020", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: printf() functionality in Java combined with a CharBuffer or something like it I am a little confused here. I would like to do something like this: * *create some kind of buffer I can write into *clear the buffer *use a printf()-like function several times to append a bunch of stuff into the buffer based on som...
{ "language": "en", "url": "https://stackoverflow.com/questions/407026", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Oracle REPLACE() function isn't handling carriage-returns & line-feeds We've a table with a varchar2(100) column, that occasionally contains carriage-return & line-feeds. We should like to remove those characters in the SQL query. We're using: REPLACE( col_name, CHR(10) ) which has no effect, however replacing 'CH...
{ "language": "en", "url": "https://stackoverflow.com/questions/407027", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: Unable to Connect error with Zend_Rest_Client on localhost I am using Zend_Rest_Client to connect Zend_Rest_Server, everything seems to be alright, but when I try to get() from the server I recieve this error: Zend_Http_Client_Adapter_Exception: Unable to Connect to tcp://localhost:80. Error #10060: A connect...
{ "language": "en", "url": "https://stackoverflow.com/questions/407030", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: When is it too long for someone to return to a development role from other roles? What would be the best way to bring people back to "their first love", i.e. programming, from other roles, e.g. sales, management, support, testing, etc. This may become an issue given the current state of the economy. I'm not talker a...
{ "language": "en", "url": "https://stackoverflow.com/questions/407046", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Accessing variables from other functions without using global variables I've heard from a variety of places that global variables are inherently nasty and evil, but when doing some non-object oriented Javascript, I can't see how to avoid them. Say I have a function which generates a number using a complex algorithm ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407048", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "78" }
Q: What is the cs_PostViews Table used for in Community Server I'm running Community Server 2.1 at the moment. My cs_PostViews table is at 200MB. What is the exact use of this table. Is it safe to truncate? A: Found out myself. This table holds a list of every single unique URL that was requested and served. I.e. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407063", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: On Windows XP: How to create a user with read access to only one certain directory? Let me state first: I know that any user that wants to run a program (or even log in), has to have access to (probably at least) the Windows system directories and the shared libraries in %ProgramFiles%, but I'd like to be able to ac...
{ "language": "en", "url": "https://stackoverflow.com/questions/407069", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Automatic build ID We're looking for a way to include some sort of build ID automatically in our builds. This needs to be portable (VC++, g++ on Linux and Mac) and automatic. VC++ is what matters most, since in the other environments we use custom Python build scripts so I can do whatever I want. We use SVN, so we w...
{ "language": "en", "url": "https://stackoverflow.com/questions/407074", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Best Update Method for MySQL DB I have read through the solutions to similar problems, but they all seem to involve scripts and extra tools. I'm hoping my problem simple enough to avoid that. So the user uploads a csv of next week's data. It gets inserted into the DB, no problem. BUT an hour later he gets feedback f...
{ "language": "en", "url": "https://stackoverflow.com/questions/407080", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Calling a const function from a non-const object I need to call a const function from a non-const object. See example struct IProcess { virtual bool doSomeWork() const = 0L; }; class Foo : public IProcess { virtual bool doSomeWork() const { ... } }; class Bar { public: const IProcess& getProcess()...
{ "language": "en", "url": "https://stackoverflow.com/questions/407100", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Return value from SQL 2005 SP returns DBNULL - Where am I going wrong? This is the SP... USE [EBDB] GO /****** Object: StoredProcedure [dbo].[delete_treatment_category] Script Date: 01/02/2009 15:18:12 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /* RETURNS 0 FOR SUCESS 1 FOR NO DELETE AS HAS...
{ "language": "en", "url": "https://stackoverflow.com/questions/407108", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Installing a windows service from a Visual Studio Installer project A colleague has written a Windows Application and left me to do the installers. I have created the installer project through Visual Studio and added the primary output of the service project to the new project. When I run the installer it creates t...
{ "language": "en", "url": "https://stackoverflow.com/questions/407109", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "40" }
Q: Setting dropdown height of a combobox in WPF I have a combobox in WPF that I add items to at run-time (via a data binding to a List). I'd like to set the height of the dropdown box dynamically so that all (or most) of the items show. Unfortunately it seems that the height of the dropdown is set once and cannot be ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407115", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Pros and cons of using DB id in the URL? For example: http://stackoverflow.com/questions/396164/exposing-database-ids-security-risk and http://stackoverflow.com/questions/396164/blah-blah loads the same question. (I guess this is DB id of Questions table? Is this standard in ASP.NET?) What are the pros and cons of u...
{ "language": "en", "url": "https://stackoverflow.com/questions/407120", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Calling a C# method, and make it take 10 seconds to return From a web service (WCF), I want an endpoint to take 10 seconds to finish. Is there a way I can do a thread.sleep(10); on the method? A: Start a new thread that sleeps for 10 sec, then return, that way the time that the methos takes to run won't add to the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407130", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: UIDatePicker show only month and day I'd like to have a UIDatePicker where the user can pick a month and a day but not the year. I'm aware that leap years have an extra day, so for simplicity, let's throw that day away. Is there any way to remove the year column or have 2 reels with month/day that act like the UIDat...
{ "language": "en", "url": "https://stackoverflow.com/questions/407149", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: (g)Vim 7.x :: Possible to trick Vim into allowing lower-case user-defined commands Not that it is seriously burdensome to type :My_custom_foobar() instead of just :my_custom_foobar() but it just feels odd considering how virtually every other aspect of Vim is so extensible. Some searching for an answer has not t...
{ "language": "en", "url": "https://stackoverflow.com/questions/407154", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Is there a way to display a PDF in an asp.net webpage without frames? I have a PDF document that needs to be pulled up in the browser, edited, and saved. I can save via the embedded adobe toolbar, along with all the other acrobat functions. But, what I am trying to see is if there is a way to display the PDF in a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407179", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Binding a object with a sub objects as properties to a datagrid I am working with an object which has sub objects within (see example below). I am attempting to bind a List<rootClass> to the datagrid. When I bind the List<>, in the cell that contains the subObject, I see the following value ... "namespace.subObject"...
{ "language": "en", "url": "https://stackoverflow.com/questions/407180", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How to check the extension of a filename in a bash script? I am writing a nightly build script in bash. Everything is fine and dandy except for one little snag: #!/bin/bash for file in "$PATH_TO_SOMEWHERE"; do if [ -d $file ] then # do something directory-ish else if [ ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407184", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "233" }
Q: Problem with encoding after in/out of a database I'm doing a bookmarking-system. But when I insert the fetched title "Chapter 4. Examples for advanced use of VLC's stream output (transcoding, multiple streaming, etc...)", it looks perfectly good in the database, but when I print it out again on the display-page, it...
{ "language": "en", "url": "https://stackoverflow.com/questions/407200", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What was the scary code comment about dragons? The phrase was used as a warning that the code was pulling some serious stunts. My google search for this is pulling up nada; but I remember someone doing a search of google source for the phrase quite a while back. in lies dragons? dragons sleep here... Bah... A: /...
{ "language": "en", "url": "https://stackoverflow.com/questions/407202", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "25" }
Q: How to move autocompleted closing tag in Visual Studio I want to make Visual Studio move the autocompleted closing tag a word (or more) to the right. For example, given the following HTML: <p>I need to emphasize some text.</p> If I type <em> before the word "emphasize", Visual Studio autocompletes like so: <p>I nee...
{ "language": "en", "url": "https://stackoverflow.com/questions/407209", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Custom properties in XAML of System.Windows.Window I've got a very simple WPF UserControl that looks like this: namespace WpfControlLibrary1 { public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); Composite = new Composite(); Composite.Color = ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407210", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Updating an application with 100% uptime In a past interview, I was asked how would I write a mission critical windows service which must maintain 100% uptime, be very responsive, and also be updatable. The service was described as a remoting based application which takes in requests, performs calculations and sends...
{ "language": "en", "url": "https://stackoverflow.com/questions/407235", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Use javascript to determine if an ASP.NET page is a postback Is it possible to determine if an ASP.NET page is a postback from javascript? So basically a javascript equivalent of C# Page.IsPostBack. Thanks. A: Sure. Just use your server code to write out a javascript flag, if you really need this. But I suspect yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/407237", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: ReaderWriterLockSlim vs. Monitor I have an IDictionary<TKey,TValue> implementation that internally holds n other Dictionary<TKey, TValue> and distributes that insertions by the HashCode of the key to the invidual sub-dictionaries. With 16 sub-dictionaries, the number of collisions is pretty low on a 4-core machine. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407238", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to dynamically add controls to a Silverlight Button? I'm working on a Silverlight Polling control. My goal is to have a Button that contains other controls, so that when a user clicks on this combination, stuff happens. Here's the basic XAML: <Button Grid.Row="1" Grid.Column="0" Style="{StaticResource AnswerButt...
{ "language": "en", "url": "https://stackoverflow.com/questions/407239", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Difference between declaring variables before or in loop? I have always wondered if, in general, declaring a throw-away variable before a loop, as opposed to repeatedly inside the loop, makes any (performance) difference? A (quite pointless) example in Java: a) declaration before loop: double intermediateResult; fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/407255", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "341" }
Q: JavaScript equivalent of PHP's preg_replace I am using a simple regex to replace break tags with newlines: br_regex = /<br>/; input_content = input_content.replace(br_regex, "\n"); This only replaces the first instance of a break tag, but I need to replace all. preg_match_all() would do the trick in PHP, but I'd li...
{ "language": "en", "url": "https://stackoverflow.com/questions/407256", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "73" }
Q: How can I make a radio button for "Other - please specify?" I am creating an HTML form with some radio button options. I'd like to have one option as "Other - please specify" and allow the user to type something in. Two questions: 1) How can I make a "hybrid" input type of radio/text? 2) On the PHP back end,...
{ "language": "en", "url": "https://stackoverflow.com/questions/407272", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Fill placeholders in file in single pass I have a skeleton text file with placeholder strings: blah blah blah blah $PLACEHOLDER_1$ blah $PLACEHOLDER_2$ and so on. Specific "form" of placeholders does not matter -- I may change them to whatever most comfortable for specific implementation. I have a bash script where...
{ "language": "en", "url": "https://stackoverflow.com/questions/407279", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: AJAX - Reload a part of a webpage without the use of a separate file to load Title might be a bit confusing, so let me explain. I have a website that has a side-panel, which contains information about the user, things the user can do, etc. When the user is not logged in, this side-panel becomes the area for logging ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407287", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Running many versions of .net on a machine I'm curious about the various versions of .net. We have an environment where we've developed applications in various versions (1.1 and 2.0). Now, I'm trying to get the 'go ahead' for developing in 3.5. The biggest issue is whether or not these versions will play nicely toge...
{ "language": "en", "url": "https://stackoverflow.com/questions/407306", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How do I get a real name stored in Active Directory from an username with C#? I want to create a quick application for people to resolve the name of a user stored in Active Directory from a set of credentials. Some applications only provide the user id and it is too much to expect an end user to fire up the Active D...
{ "language": "en", "url": "https://stackoverflow.com/questions/407314", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Strange SQL2005 problem. "SqlConnection does not support parallel transactions" I have a problem that seems like its a result of a deadlock-situation. Whe are now searching for the root of the problem but meantime we wanted to restart the server and get the customer going. And now everytime we start the program it ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407320", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: .NET 1.1 Windows service doesnt start due to leap year We have a few backend windows services written in .net framework 1.1 running and on December 31st 2008 around 5.00 pm (EST) we stopped these services to run some year end reports.After the reports were run , we tried to start the services and the moment we attem...
{ "language": "en", "url": "https://stackoverflow.com/questions/407336", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: .NET - Get default value for a reflected PropertyInfo This is really stumping me today. I'm sure its not that hard, but I have a System.Reflection.PropertyInfo object. I want to set its value based on the result of a database lookup (think ORM, mapping a column back to a property). My problem is if the DB returned ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407337", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "66" }
Q: applet or activex for a graphical overlay plugin (IE)? I'm looking to write a plugin for IE that will do a little parsing of any webpage and display a layer atop that page that my users can interact with (an analytics heatmap might be my closest example). I'm trying to decide whether this should be written as an Ap...
{ "language": "en", "url": "https://stackoverflow.com/questions/407342", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Where are Swing applications used? Are Swing applications really used nowadays? I don't find a place where they are used. Is it okay to skip the AWT and Swing package (I learned a bit of the basics though)? A: Swing is heavily used in business specific (vertical)/internal application development. A: Swing applicat...
{ "language": "en", "url": "https://stackoverflow.com/questions/407343", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: How best to use XPath with very large XML files in .NET? I need to do some processing on fairly large XML files ( large here being potentially upwards of a gigabyte ) in C# including performing some complex xpath queries. The problem I have is that the standard way I would normally do this through the System.XML lib...
{ "language": "en", "url": "https://stackoverflow.com/questions/407350", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Custom Flex Ant build task A beginner's question. I'm building a .swf with Flex Ant. To my .swf I link a file, target.as, which I generate from file source.txt with command ./tool.sh source.txt > target.as How can I add what is described in the above sentence to my ant build process? A: The exec task executes an...
{ "language": "en", "url": "https://stackoverflow.com/questions/407362", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: List reports with inline SQL in SQL Server Reporting Services? I have a couple of inline SQL in many of our reports on the report manager. Now I need to do some code change for all of them, is there a way to list all those reports based on the inline SQL and not any SP? Thanks, D A: You can use the reporting servic...
{ "language": "en", "url": "https://stackoverflow.com/questions/407367", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: ASP.NET: Function key shortcuts? I recently participated a project that replaced a mainframe system with a web (asp.net 2.0, VS2005) system. The 3270-terminals are still much used and I respect the IMS/CICS/Cobol application designers for their work. Users like the web application, but one thing they keep ask for is...
{ "language": "en", "url": "https://stackoverflow.com/questions/407370", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to move caret position to end of current word? I'm using a webbrowser control. How can I move the insert position for an execCommand to the end of the word, that is currently selected? Example: | <- current caret position Som|eword -> move -> Someword| -> execCommand executes after current word What I want to...
{ "language": "en", "url": "https://stackoverflow.com/questions/407371", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Troubleshooting VS C#/SQL Server Compact setup - "event log file full" message I'm trying to develop a little C# application (with MS Visual Express and SQL Server) and am having an issue trying to figure out the error dialog that pops up: "the event log file is full" I'm following these instructions: http://msdn.m...
{ "language": "en", "url": "https://stackoverflow.com/questions/407402", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Can an MBean be run under Tomcat? We have 2 applications that run under JBoss. I am looking for a way to reduce the overhead of the server. The main app runs under Tomcat. The other app is made up of MBeans. Is there a way to run MBeans under Tomcat? Alternative suggestions are appreciated. A: MBeans are a part of...
{ "language": "en", "url": "https://stackoverflow.com/questions/407405", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How do I read fixed-length records in Perl? What's the best way to read a fixed length record in Perl. I know to read a file like: ABCDE 302 DEFGC 876 I can do while (<FILE>) { $key = substr($_, 0, 5); $value = substr($_, 7, 3); } but isn't there a way to do this with read/unpack? A: Assume 10 character re...
{ "language": "en", "url": "https://stackoverflow.com/questions/407407", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: What is the benefit of tableless design if you need clearing blocks everywhere? I understand that the goal of moving towards <div> tags from <table> makes sense since it is more semantic. However, I don't understand the benefit gained if you still need a clearing block to make column-based layouts work. For example:...
{ "language": "en", "url": "https://stackoverflow.com/questions/407420", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Syncing a Core Data Model With A Web Service This problem has been kicking my butt for a few days now. I have a web service that serves XML that looks like this: <levels> <level>Level 1</level> <level>Level 2</level> <level>Consulting</level> <level>Office Support</level> <level>Learning</level> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/407424", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Databinding ASP.net DropDownList with Entity Framework I'm trying to bind an ASP.net DropDownList to the results of an entity framework query, while still maintaining multi-tier separation. (i.e. I don't want my UI code to contain query details, nor my Data Layer code to have UI dependencies.) My code-behind in th...
{ "language": "en", "url": "https://stackoverflow.com/questions/407428", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }