text
string
meta
dict
Q: Is it possible to print a DIV that is hidden by jQuery's "slideUp" function I have a simple "accordion" type page containing a list of H3 headers and DIV content boxes (each H3 is followed by a DIV). On this page I start with all DIVs hidden. When a H3 is clicked the DIV directly below (after) is revealed with jQu...
{ "language": "en", "url": "https://stackoverflow.com/questions/186035", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Is there any way to validate the width and height of image when uploaded? Is there any way to validate the width and height of image when uploaded? using javascript of server side ? like jsp, aspx etc? A: If you're using the Java platform, you can use ImageIO to read the image, then use getHeight and getWidth on th...
{ "language": "en", "url": "https://stackoverflow.com/questions/186037", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is it considered bad practice to use absolute positioning? I was developing a web page, where I was laying out a board for a Chess-like game, along with a couple of piece trays. It's all done using HTML (with jQuery for dynamic updating as the game is played). Somewhere I'd got the notion that using absolute positio...
{ "language": "en", "url": "https://stackoverflow.com/questions/186044", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "75" }
Q: Can an ASP.NET MVC controller return an Image? Can I create a Controller that simply returns an image asset? I would like to route this logic through a controller, whenever a URL such as the following is requested: www.mywebsite.com/resource/image/topbanner The controller will look up topbanner.png and send that im...
{ "language": "en", "url": "https://stackoverflow.com/questions/186062", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "477" }
Q: Left Join outperforming Inner Join? I've been profiling some queries in an application I'm working on, and I came across a query that was retrieving more rows than necessary, the result set being trimmed down in the application code. Changing a LEFT JOIN to an INNER JOIN trimmed the result set to just what was neede...
{ "language": "en", "url": "https://stackoverflow.com/questions/186071", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: What are some good DirectX resources for a beginner? I'm learning DirectX as part of a hobby project. I've been looking for some good online resources for DirectX9 (using C++, if that distinction matters), but haven't found anything that's a) great for a beginner and b) up to date. Any recommendations? A: When I st...
{ "language": "en", "url": "https://stackoverflow.com/questions/186073", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How do I create a sparse file programmatically, in C, on Mac OS X? I'd like to create a sparse file such that all-zero blocks don't take up actual disk space until I write data to them. Is it possible? A: As in other Unixes, it's a feature of the filesystem. Either the filesystem supports it for ALL files or it d...
{ "language": "en", "url": "https://stackoverflow.com/questions/186077", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Initializing static objects - Code design question In my webapplication (C#, .Net 3.5), made up of a core class library (containing the business logic, data layer and a couple of utility classes), a windows service project, a webservice project and the website project, I have a couple of static classes in the core l...
{ "language": "en", "url": "https://stackoverflow.com/questions/186082", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do you add a timer to a C# console application Just this - How do you add a timer to a C# console application? It would be great if you could supply some example coding. A: Use the System.Threading.Timer class. System.Windows.Forms.Timer is designed primarily for use in a single thread usually the Windows Forms...
{ "language": "en", "url": "https://stackoverflow.com/questions/186084", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "152" }
Q: How many rows can an SQLite table hold before queries become time comsuming I'm setting up a simple SQLite database to hold sensor readings. The tables will look something like this: sensors - id (pk) - name - description - units sensor_readings - id (pk) - sensor_id (fk to sensors) - value (ac...
{ "language": "en", "url": "https://stackoverflow.com/questions/186094", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Regex Search and Replace Program Is there a simple and lightweight program to search over a text file and replace a string with regex? A: For searching: grep - simple and fast. Included with Linux, here's a Windows version, not sure about Mac. For replacing: sed. Here's a Windows version, not sure about Mac. Of cou...
{ "language": "en", "url": "https://stackoverflow.com/questions/186096", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How do you handle the "Too many files" problem when working in Bash? I many times have to work with directories containing hundreds of thousands of files, doing text matching, replacing and so on. If I go the standard route of, say grep foo * I get the too many files error message, so I end up doing for i in *; do ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186099", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Storing parts of user data in files for preventing SQL injection I am new to web programming and have been exploring issues related to web security. I have a form where the user can post two types of data - lets call them "safe" and "unsafe" (from the point of view of sql). Most places recommend storing both parts o...
{ "language": "en", "url": "https://stackoverflow.com/questions/186106", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do you use environment variables in vxWorks? In a vxWorks Real-Time process, you can pass environment variables as one of the parameter of the main routine. How do you use the environment variables in the kernel context? A: Vxworks environment variable support is provided by the envLib. use putenv("VAR=value") ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186108", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Implementing a window manager like VS does it My boss thinks the VS 2008 IDE Window Manager(autohiding, docking of Solution Explorer, Properties, etc) is the best thing since sliced bread. I can't find a control that resembles that functionality in the Toolbox. Is there a control like that available that you know ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186115", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Eclipse fonts and background color I have been trying to change the background color of Eclipse's windows to black and customize the font colors. There doesn't seem to be a way to do this, at least not in an obvious way. I am using version 3.3. How do I do this or are there any plugin's that might be able to assist ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186118", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "253" }
Q: Setting up your first SSL page using PHP5 I would like to use a secure SSL login on my website! I have not used SSL before, so I am looking for some good reading. Can anyone tell me where I can find some sample code of SSL snippets or page code. (Not too technical) * *I do have a static IP *My host is set-up to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186125", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What to do if I don't have Visual Basic 6.0 and need to compile a VB6 project? A client wants me to do some maintenance work to a VB 6.0 application (migration to .NET is also in the pipeline), but he doesn't have the development tools because he received just the source code and running application from the origina...
{ "language": "en", "url": "https://stackoverflow.com/questions/186128", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Extracting unique items from a list of mappings He're an interesting problem that looks for the most Pythonic solution. Suppose I have a list of mappings {'id': id, 'url': url}. Some ids in the list are duplicate, and I want to create a new list, with all the duplicates removed. I came up with the following function...
{ "language": "en", "url": "https://stackoverflow.com/questions/186131", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: MVC data design problem with Zend framework If I have a class representing access to one table in my database in a class:table relationship, so I can hide table details in one class. But as any useful application I have to query several tables. How can I accomodate this using the class:table design? A: There's a co...
{ "language": "en", "url": "https://stackoverflow.com/questions/186142", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I add to a list with Linq to SQL? I have a table in the database that I'm retrieving using LINQ to SQL, and as a part of my processing I want to add to this list, then update the database with the new items + any changes I've made. What I thought I could do was this: var list = (from item in db.Table ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186160", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is your method to generate Websphere 6 EJB with Ant / JDK 1.4.x? The only working method I found, several years ago, was : * *Generating ibm-ejb-jar-bnd.xmi and ibm-ejb-jar-ext.xmi for each session bean by using XDoclet (ejbdoclet task) *Making a jar (without stubs) with task jar; ; *Calling the binary E...
{ "language": "en", "url": "https://stackoverflow.com/questions/186169", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: SQL 2005 Full-Text Catalog is randomly sloooowww I've built a full-text catalog on a SQL 2005 box that, after it's re-build process completes, runs extremely slow. I've implemented a hack (i.e. try...catch{do again}) so that my users don't get a timeout error; this makes me feel bad inside. All subsequent queries ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186190", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What project files shouldn't be checked into SVN At the moment I check in all my files (including dll's, VS solution files, images, etc). I often need to checkout these files to a staging server or to a another developer and so having these files there means the project is setup there all ready to go. Whats the best...
{ "language": "en", "url": "https://stackoverflow.com/questions/186196", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: What is the best way to open a file for exclusive access in Python? What is the most elegant way to solve this: * *open a file for reading, but only if it is not already opened for writing *open a file for writing, but only if it is not already opened for reading or writing The built-in functions work like thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/186202", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "52" }
Q: Visual Studio 6 Processor Pack compatibility I've seen that a Processor Pack is available for Visual Studio 6, however it appears to only be available for users with SP5 and I am already using SP6: In addition, the Visual C++ Processor Pack (VCPP) was removed from Service Pack 6. If you have the VCPP installed, inst...
{ "language": "en", "url": "https://stackoverflow.com/questions/186207", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Latex styles - what do you use and where to find them What Latex styles do you use and where do you find them? The reason I'm asking this is that it seems that some 99.9999% of all styles on the internet are copies of each other and of a physics exam paper However, when you try to find a style for a paper like this ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186208", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Run time error in ASP.Net 1.1 I am using Windows 2003. I have mapped a web application into a virtual directory. This is built on framework 1.1 When i try to browse to the default page i get a error as Description: An error occurred during the processing of a configuration file required to service this request. Ple...
{ "language": "en", "url": "https://stackoverflow.com/questions/186211", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: In WPF Style, How can Trigger access a son Element of the Element it is attatched The following is a Simple Style for ListBoxItem, ListBoxItem has a son Border. Border has a Padding property with value of 8, I want to change the value to 0, when the item is selected. How can I write the trigger? <??Style TargetT...
{ "language": "en", "url": "https://stackoverflow.com/questions/186217", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is EPiServer threadsafe? I can't find any information about this on either www.episerver.com or world.episerver.com, anyone knows? A: From what I've seen Episerver uses two mechanisms to achieve thread-safety: * *Locking (when initializing expensive resources) *Immutable data (when passing page data around) A...
{ "language": "en", "url": "https://stackoverflow.com/questions/186222", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: NHibernate bidirectional many-to-many association I have a class with following description: public class Customer { public ISet<Client> Contacts { get; protected set;} } I want to map Contacts property onto following table: CREATE TABLE user_contacts ( user1 uuid NOT NULL, user2 uuid NOT NULL ) I want...
{ "language": "en", "url": "https://stackoverflow.com/questions/186229", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Exporting DLL C++ Class , question about .def file I want to use implicit linking in my project , and nmake really wants a .def file . The problem is , that this is a class , and I don't know what to write in the exports section . Could anyone point me in the right direction ? The error message is the following : NM...
{ "language": "en", "url": "https://stackoverflow.com/questions/186232", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Easy IIS install of php Are there any "all-in-one" installers for php + mysql on iis? Preferably with a gui configuration interface. A: The PHP part is easy with Web Platform Installer: http://php.iis.net/ MySQL is a breeze to install on Windows: http://dev.mysql.com/downloads/mysql/5.1.html#win32 A: I don't know...
{ "language": "en", "url": "https://stackoverflow.com/questions/186234", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Program only crashes as release build -- how to debug? I've got a "Schroedinger's Cat" type of problem here -- my program (actually the test suite for my program, but a program nonetheless) is crashing, but only when built in release mode, and only when launched from the command line. Through caveman debugging (ie,...
{ "language": "en", "url": "https://stackoverflow.com/questions/186237", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "107" }
Q: What does it mean that Javascript is a prototype based language? One of the major advantages with Javascript is said to be that it is a prototype based language. But what does it mean that Javascript is prototype based, and why is that an advantage? A: Instead of declaring a class structure, you can create objects...
{ "language": "en", "url": "https://stackoverflow.com/questions/186244", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "278" }
Q: How do you organize your release tests? In the company where I work we have major releases twice every year. Extensive testing (automated and manual) is done the weeks before. The automated tests produce logfiles, the results of the manual tests are written down in test plans (Word documents). As you can imagine th...
{ "language": "en", "url": "https://stackoverflow.com/questions/186277", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: .NET partial class' accessibility over multiple files If I have the core of a class defined in one file as "public partial" and I wish to create additions to this in another file, what is the difference between defining "public partial" again in my second file or just defining "partial"? What happens if I define "pr...
{ "language": "en", "url": "https://stackoverflow.com/questions/186291", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Convert XML Data to Strong Flex Type A project I'm working on will pull XML from a web-server and build a data store from it. The data will have certain core fields but needs to be extendable... for example I have a and later might want to have which adds extra fields. In the Flex app, I don't want the central dat...
{ "language": "en", "url": "https://stackoverflow.com/questions/186307", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Best way to find date nearest to target in a list of dates? I have a list of Date objects, and a target Date. I want to find the date in the list that's nearest to the target date, but only dates that are before the target date. Example: 2008-10-1 2008-10-2 2008-10-4 With a target date of 2008-10-3, I want to get 20...
{ "language": "en", "url": "https://stackoverflow.com/questions/186311", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to create nestable draggables in Scriptaculous? I'm using the Scriptaculous library to slap an appealing UI on an application which helps an enduser build lists. Let's say its for pizza creation. To fill out an order, you drag a size of pizza from the pizza palette into the orders droppable. Once it is put in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186313", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Where in JavaScript is the request coming from? I am debugging a large, complex web page that has a lot of JavaScript, JQuery, Ajax and so on. Somewhere in that code I am getting a rouge request (I think it is an empty img) that calls the root of the server. I know it is not in the html or the css and am pretty co...
{ "language": "en", "url": "https://stackoverflow.com/questions/186314", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Python - How to use Conch to create a Virtual SSH server I'm looking at creating a server in python that I can run, and will work as an SSH server. This will then let different users login, and act as if they'd logged in normally, but only had access to one command. I want to do this so that I can have a system wher...
{ "language": "en", "url": "https://stackoverflow.com/questions/186316", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: .NET Fastest way to iterate through rows in a datatable? Which is generally fastest when reading/comparing row info from a DataTable? 'assume dt as datatable' 'method 1' dim i as int32 for i = 0 to dt.rows.count - 1 .... next 'method 2' dim row as datarow for each row in dt.rows .... next And if there's a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186328", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Why is require_once so bad to use? Everything I read about better PHP coding practices keeps saying don't use require_once because of speed. Why is this? What is the proper/better way to do the same thing as require_once? If it matters, I'm using PHP 5. A: A better way to do things is to use an object-oriented appr...
{ "language": "en", "url": "https://stackoverflow.com/questions/186338", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "146" }
Q: onClose Event in ASP.NET Is there an event like onLoad? just at closing the Site (onClose)? A: Not in the sense that I suspect you're thinking. All your code in ASP.net runs on the server which doesn't inherently "know" when the site is closed by the user. To achieve what you're after, you'd need to use Javascript...
{ "language": "en", "url": "https://stackoverflow.com/questions/186340", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I auto filter a HTML selectlist? I have a HTML select list with quite a few (1000+) names. I have a javascript in place which will select the first matching name if someone starts typing. This matching looks at the start of the item: var optionsLength = dropdownlist.options.length; for (var n=0; n < optio...
{ "language": "en", "url": "https://stackoverflow.com/questions/186345", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to reimplement jQuery's default helper in a custom helper I'm creating a custom drag helper (in jQuery): $('.dragme', element).draggable({ appendTo: 'body', helper : custom_drag_helper, opacity : 0.5 }); I'm doing this because I want to sometimes clone and sometimes do the default functionality, i....
{ "language": "en", "url": "https://stackoverflow.com/questions/186351", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: DB: To use identity column or not? While designing a table my colleague here says that I should avoid identity column as it is specific to SQL Server and MS Access, But I differ with his views as it makes my coding simpler. Should I use identity column or not? If not what is best way to create the identity columns ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186369", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Best Timer approach in C# console batch application Which is the best timer approach for a C# console batch application that has to process as follows: * *Connect to datasources *process batch until timeout occurs or processing complete. "Do something with datasources" *stop console app gracefully. related qu...
{ "language": "en", "url": "https://stackoverflow.com/questions/186385", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Deploying web apps that use cron What is the best procedure for deploying web apps that rely on cron jobs (for cache maintenance, db updates, ...)? For things like DB schema changes, there are tools such as DBDeploy for managing the changes between versions, but how do you automate updates to the crontab? I know ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186387", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do you document your database structure? Many database systems don't allow comments or descriptions of tables and fields, so how do you go about documenting the purpose of a table/field apart from the obvious of having good naming conventions? (Let's assume for now that "excellent" table and field names are not ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186392", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: How to display a VRML model with .NET? I have a request to display VRML models within a .NET application. Does someone know an easy way, maybe with standard .NET components, to achieve this? What are the issues I maybe have to face when representing VRML within an application? A: The VRML standard has evolved into ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186396", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: What is the size limit for a varchar2 PL/SQL subprogram argument in Oracle? When you create a procedure (or a function) in Oracle PL/SQL, you cannot specify the maximum length of the varchar2 arguments, only the datatype. For example create or replace procedure testproc(arg1 in varchar2) is begin null; end; Do yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/186403", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Visual C++ unresolved external symbol (can't find one of my own functions) This is a very basic problem that's frustrating me at the moment. Let's say within a single solution, I have two projects. Let's call the first project SimpleMath. It has one header file "Add.h" which has int add(int i, int j) and the imple...
{ "language": "en", "url": "https://stackoverflow.com/questions/186405", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to set "xml:lang" attribute? I need to add a xml:lang attribute on the root xml node in the outbound document from BizTalk. This is a fixed value, so it may be set in the schema or something. This is what I want to get out: <Catalog xml:lang="NB-NO"> ... </Catalog> I've tried to define the attribute "xml:lang",...
{ "language": "en", "url": "https://stackoverflow.com/questions/186413", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Generating PDF/Excel reports from a c# .net web application We have a system that is used by a few hundred separate customers, at the end of the month the customer likes to generate a report of the activity with his/her clients. These reports are nothing special; they maybe contain a logo, address and a few lines of...
{ "language": "en", "url": "https://stackoverflow.com/questions/186421", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Mongrel cluster and multi-applications problem we're running in this issue. We're using a web service (using soap4r) to run some kind of searches and the problem appears when the webservice server is down and our aplication is trying to connect to it. At that point the application is unreachable, and all the custom...
{ "language": "en", "url": "https://stackoverflow.com/questions/186422", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Calculating days of week given a week number Given a week number, e.g. date -u +%W, how do you calculate the days in that week starting from Monday? Example rfc-3339 output for week 40: 2008-10-06 2008-10-07 2008-10-08 2008-10-09 2008-10-10 2008-10-11 2008-10-12 A: If you've got Zend Framework you can use the Zend...
{ "language": "en", "url": "https://stackoverflow.com/questions/186431", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: What options are available for connecting to a Microsoft SQL Server database from an Oracle database? At the moment I pull data from remote MS SQL Server databases using custom-built JDBC connectors. This works fine but doesn't feel like the way to do it. I feel I should be able to put a JDBC connection string into ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186443", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is the best practice to use ExtJS with Asp.net and WCF in .NET 3.5? How do you save data from ExtJS form? Load data from the business layer into form or grid? A: For me, I have used an ASHX page to push straight XML - and then use the ExtJS data reader to read.. then, say using a form etc, I push the form data...
{ "language": "en", "url": "https://stackoverflow.com/questions/186456", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Have you noticed stray hits to your web pages that have no parameters? We have a web application that passes parameters in the url along the lines of this: www.example.com/ViewCustomer?customer=3945 Reasonably often, we will see attempts to access just: www.example.com/ViewCustomer Or system logs this as invalid a...
{ "language": "en", "url": "https://stackoverflow.com/questions/186467", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: 'from X import a' versus 'import X; X.a' I've seen some Python programmers use the following style fairly consistently (we'll call it style 1): import some_module # Use some_module.some_identifier in various places. For support of this style, you can cite the "explicit is better than implicit" maxim. I've seen othe...
{ "language": "en", "url": "https://stackoverflow.com/questions/186472", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Remove binding in WPF using code I would like to use databinding when displaying data in a TextBox. I'm basically doing like: public void ShowRandomObject(IRandomObject randomObject) { Binding binding = new Binding {Source = randomObject, Path = new PropertyPath("Name")}; txtName.SetBinding(TextBox....
{ "language": "en", "url": "https://stackoverflow.com/questions/186475", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "61" }
Q: In C++/CLI, how do I declare and call a function with an 'out' parameter? I have a function which parses one string into two strings. In C# I would declare it like this: void ParseQuery(string toParse, out string search, out string sort) { ... } and I'd call it like this: string searchOutput, sortOutput; Parse...
{ "language": "en", "url": "https://stackoverflow.com/questions/186477", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "52" }
Q: How do I code a Mono Daemon I'm trying to write a Mono C# daemon for linux. I'd like to do a starts and stops of it when its done processing instead of just killing the process. Does anyone have any examples of this? Edit: I figured out how to use start-stop-daemon --background in debian, so I think I'll just use th...
{ "language": "en", "url": "https://stackoverflow.com/questions/186493", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "52" }
Q: if(str1==str2) versus if(str1.length()==str2.length() && str1==str2) I've seen second one in another's code and I suppose this length comparison have been done to increase code productivity. It was used in a parser for a script language with a specific dictionary: words are 4 to 24 letters long with the average of 7...
{ "language": "en", "url": "https://stackoverflow.com/questions/186494", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can I list the resources in a given package? Lets assume my classes are loaded from a compressed .war file or loaded elsewhere, how can I discover all the resources in a given package? Enumerating files will not really work, since this is a war file. Most likely this will involve using the current classloader? Is...
{ "language": "en", "url": "https://stackoverflow.com/questions/186496", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Design for test OR Stop designing for test So which is better. Do we start letting Tests design our code. Do we start introducing constructor injection for dependencies just to make code testable? or do we use the "override" protected method & sub class the class under test. A: I generally think that testable code...
{ "language": "en", "url": "https://stackoverflow.com/questions/186501", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: DllMain in an exe? Is it possible to receive DllMain like notifications about thread attach/detach in stand-alone exe without using any extra dlls? Edit: This is just a theoretical question that has to do with some testing I'm doing. not a real life situation. A: There is no external code that runs on the thread an...
{ "language": "en", "url": "https://stackoverflow.com/questions/186502", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Flexible Decorator Pattern? I was looking for a pattern to model something I'm thinking of doing in a personal project and I was wondering if a modified version of the decorator patter would work. Basicly I'm thinking of creating a game where the characters attributes are modified by what items they have equiped. Th...
{ "language": "en", "url": "https://stackoverflow.com/questions/186507", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: PHP's file_get_contents not returning until remote servers' keep-alive limit is exceeded From one apache server file_get_contents returns the contents of a url straight away. On another apache server file_get contents won't return the contents of the same url until the keep-alive limit of the server hosting that ur...
{ "language": "en", "url": "https://stackoverflow.com/questions/186520", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Better way to profile? Is there a better way to profile code then: $start1 = microtime(TRUE); for($i=0;$i<count($array);$i++) { //do something } $time1 = microtime(TRUE) - $start1; A: Xdebug or Zend Debugger if you have some difficulty to install Xdebug. Their profiler will time everything for you without an...
{ "language": "en", "url": "https://stackoverflow.com/questions/186522", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is the maximum length of a C#/CLI identifier? Which other restrictions are there on names (beside the obvious uniqueness within a scope)? Where are those defined? A: In addition to the other answers, the maximum identifier length that is accepted by the Microsoft Visual C# compiler is 511 characters. This can ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186523", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: Mapstraction as a library to access Google maps Do you suggest Mapstraction (library) as a layer to access Google maps? Is it an actively maintained project? Do I stand to again/ lose anything by using this library apart from the primary reason that its provider independent? A: Have used this for a pretty major ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186525", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to synchronize the access to a List used in ASP.NET? I have some problems on a site with the concurrent access to a list. This list keeps a cart of items, and multiple deletes are crashing the site. Which is the best method to sync them? Is a lock enough? The lock option seems to be ugly because the code is spr...
{ "language": "en", "url": "https://stackoverflow.com/questions/186527", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Why does my datagridview repositions on escape I have a DataGridView control on a form in a manged c# project. (.net 2.0) When I use the scroll button on my mouse and then click a cell and click the escape button or select another cell the grid will reposition it self. But if i use the scrollbar on the control, thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/186534", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: @@IDENTITY after INSERT statement always returns 0 I need a function which executes an INSERT statement on a database and returns the Auto_Increment primary key. I have the following C# code but, while the INSERT statement works fine (I can see the record in the database, the PK is generated correctly and rows == 1)...
{ "language": "en", "url": "https://stackoverflow.com/questions/186544", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: IIS6 + HttpModule: This operation requires IIS integrated pipeline mode I am using IIS6, I've written an HttpModule, and I get this error? After googling the web I find that this problem is caused by the .NET framework 3.5, so I put this on a machine where I didn't install .NET 3.5, but the problem is still there! ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186548", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Anyone using Microsoft ASML language? To me the concept of "Gurevich Abstract State Machine" (formerly known as "evolving algebras") seems very promising to provide a solid fundation to systems behaviours. It could be what relational algebra is for databases: the underlying theoretic fundation. The most complete imp...
{ "language": "en", "url": "https://stackoverflow.com/questions/186549", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Sending a mouse click to a button in silverlight 2 There is the button control in silverlight application . Can I send a mouse click event to it programmatically? A: If you still want to do that. You can now upgrade to Silverlight version 3.0 or later versions and do the following: You can use the button automation...
{ "language": "en", "url": "https://stackoverflow.com/questions/186553", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Automate file copying from Windows command line Say you have 100 directories and for each directory you have a file named .pdf stored somewhere else. If you want to move/copy each file into the directory with the same name, can this be done on the Windows command line? A: This is a batch script that probably does w...
{ "language": "en", "url": "https://stackoverflow.com/questions/186556", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Does a user need admin rights to install Flash player? Will users who do not have admin rights on their computers be able to upgrade to new Flash player version by themselves? This would be interesting to know for: Windows 98 Windows XP/2000/Vista Macs Unix/Linux A: Take a look at the Adobe instructions for more cl...
{ "language": "en", "url": "https://stackoverflow.com/questions/186569", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Retrieving the date in SQL Server; CURRENT_TIMESTAMP vs GetDate() Using SQL Server, which is the fastest or best practice method to use for date retrieval? Is there a difference between CURRENT_TIMESTAMP and GetDate()? A: CURRENT_TIMESTAMP is standard ANSI SQL, and so is theoretically one tiny little island of 'don...
{ "language": "en", "url": "https://stackoverflow.com/questions/186572", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "75" }
Q: When do you design the GUI first and the backend code later, or vice versa? When I'm working on a project, sometimes I'll design the GUI first and then write the backend code to make it work, but other times I'll do the opposite and make the GUI once I have the system working. How do you choose which way round to co...
{ "language": "en", "url": "https://stackoverflow.com/questions/186581", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Which is fastest? SELECT SQL_CALC_FOUND_ROWS FROM `table`, or SELECT COUNT(*) When you limit the number of rows to be returned by a SQL query, usually used in paging, there are two methods to determine the total number of records: Method 1 Include the SQL_CALC_FOUND_ROWS option in the original SELECT, and then get t...
{ "language": "en", "url": "https://stackoverflow.com/questions/186588", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "192" }
Q: Get Visual Studio to throw exceptions across threads In my Silverlight project I have a thread that fires every x milliseconds. In this thread I was attempting to change the state of the application. This wasn't working and I didn't know why, so put a breakpoint in to the Timer callback. The breakpoint was hit, but ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186600", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Zend Framework fetchAll Can i override fetchall method in a model? I need to check sth everytime fetchAll is called. The model extends Zend_db_table_abstract A: To override this method you would need to subclass the Zend_Db_Table_Abstract. Like so: <?php abstract class My_Db_Table_Abstract extends Zend_Db_Table_Ab...
{ "language": "en", "url": "https://stackoverflow.com/questions/186606", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to set up Eclipse TPTP I need to profile a java application for a customer. It's an eclipse/maven project, so I decided on using eclipse TPTP ( http://www.eclipse.org/tptp ). I tried to install eclipse TPTP through the update manager from a standard eclipse installation, but I gave up because of the unbelievable...
{ "language": "en", "url": "https://stackoverflow.com/questions/186615", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How to unit test a pseudo random number generator? I have a pseudo random number generator (PRNG) class that I want to unit test. There are two approaches: * *write a test case that takes a large amount of samples and test whether they are properly distributed. This approach may lead to a fairly long execution ti...
{ "language": "en", "url": "https://stackoverflow.com/questions/186619", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: How to add jars dynamically with jython embedded in Tomcat app? I want to let the users of my app, which is in turn an app container (app contains subapps), add java jars to their jython path. I let the subapp managers write thir own extensions in jython, but some of the functionality they want to add needs addition...
{ "language": "en", "url": "https://stackoverflow.com/questions/186621", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: VB6 Date data type: precision and formatting * *How precise is the VB6 Date data type (by way of fractions of a second)? *How to format it to show fractions of a second? I'm revisiting VB6 after many years absence, and for the life of me can't remember the things I used to know. I considered putting a memory-le...
{ "language": "en", "url": "https://stackoverflow.com/questions/186622", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: REST / SOAP endpoints for a WCF service I have a WCF service and I want to expose it as both a RESTfull service and as a SOAP service. Anyone has done something like this before? A: MSDN seems to have an article for this now: https://msdn.microsoft.com/en-us/library/bb412196(v=vs.110).aspx Intro: By default, Wi...
{ "language": "en", "url": "https://stackoverflow.com/questions/186631", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "434" }
Q: window.showModalDialog Page Load not being executed I am actually loading a page as a modal dialog box as window.showModalDialog("url.aspx"). The first time the modal dialog is poped up the page load event gets called. When i close it and call the same again, the Control does not come to the PageLoad. Instead the pa...
{ "language": "en", "url": "https://stackoverflow.com/questions/186633", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Lazy initialization causing System.ArgumentException in Silverlight 2.0 beta I've got the following example running in a simple Silverlight page: public Page() { InitializeComponent(); InitializeOther(); } private DoubleCollection dashes; public DoubleCollection Dashes { get { //dashes = new DoubleColl...
{ "language": "en", "url": "https://stackoverflow.com/questions/186634", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Create COM component and ActiveX controls Is is possible to create COM component and ActiveX controls in .Net (using c# language). I searched internet but i could`t get anything. Thanks, santhosh A: Declare an interface and implement it with class. If you have parameters/return values that are not OLE Automation co...
{ "language": "en", "url": "https://stackoverflow.com/questions/186640", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Is it possible to automate MS SQL Server (2005) queries via SQL Server Management Studio? I have two queries saved on my SQL Server 2005 and I would like to have them running at certain intervals, e.g. every 24 hours. Is there a way to automate these queries and schedule them via SQL Server Management Studio? A: Yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/186642", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Visual Studio References and versioning - how does it work? We have several common libs. Ideally we want them all to use the latest version of a dll even if they have been compiled against an older different version (assume the latest version is backward compatible) e.g we have: Project dll Common controls dll Logg...
{ "language": "en", "url": "https://stackoverflow.com/questions/186643", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: How to organize C++ test apps and related files? I'm working on a C++ library that (among other stuff) has functions to read config files; and I want to add tests for this. So far, this has lead me to create lots of valid and invalid config files, each with only a few lines that test one specific functionality. But ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186648", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Aren't there any better ways of displaying an object other than using hierarchy? I have a class hierarchy as such: +-- VirtualNode | INode --+ +-- SiteNode | | +-- AbstractNode --+ | +-- SiteSubNod...
{ "language": "en", "url": "https://stackoverflow.com/questions/186649", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Get the index of the nth occurrence of a string? Unless I am missing an obvious built-in method, what is the quickest way to get the nth occurrence of a string within a string? I realize that I could loop the IndexOf method by updating its start index on each iteration of the loop. But doing it this way seems wastef...
{ "language": "en", "url": "https://stackoverflow.com/questions/186653", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "106" }