text stringlengths 8 267k | meta dict |
|---|---|
Q: How to convert Decimal to Double in C#? I want to assign the decimal variable "trans" to the double variable "this.Opacity".
decimal trans = trackBar1.Value / 5000;
this.Opacity = trans;
When I build the app it gives the following error:
Cannot implicitly convert type decimal to double
A: Why are you dividing by... | {
"language": "en",
"url": "https://stackoverflow.com/questions/4",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "794"
} |
Q: Why did the width collapse in the percentage width child element in an absolutely positioned parent on Internet Explorer 7? I have an absolutely positioned div containing several children, one of which is a relatively positioned div. When I use a percentage-based width on the child div, it collapses to 0 width on IE... | {
"language": "en",
"url": "https://stackoverflow.com/questions/6",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "319"
} |
Q: How do I calculate someone's age based on a DateTime type birthday? Given a DateTime representing a person's birthday, how do I calculate their age in years?
A: My suggestion
int age = (int) ((DateTime.Now - bday).TotalDays/365.242199);
That seems to have the year changing on the right date. (I spot tested up to a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/9",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2199"
} |
Q: Calculate relative time in C# Given a specific DateTime value, how do I display relative time, like:
*
*2 hours ago
*3 days ago
*a month ago
A: public static string RelativeDate(DateTime theDate)
{
Dictionary<long, string> thresholds = new Dictionary<long, string>();
int minute = 60;
int hour = 60 *... | {
"language": "en",
"url": "https://stackoverflow.com/questions/11",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1644"
} |
Q: Determine a user's timezone Is there a standard way for a web server to be able to determine a user's timezone within a web page?
Perhaps from an HTTP header or part of the user-agent string?
A: One possible option is to use the Date header field, which is defined in RFC 7231 and is supposed to include the timezon... | {
"language": "en",
"url": "https://stackoverflow.com/questions/13",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "701"
} |
Q: Difference between Math.Floor() and Math.Truncate() What is the difference between Math.Floor() and Math.Truncate() in .NET?
A: Math.Floor() rounds toward negative infinity
Math.Truncate rounds up or down towards zero.
For example:
Math.Floor(-3.4) = -4
Math.Truncate(-3.4) = -3
while
Math.Floor(3.4) = 3... | {
"language": "en",
"url": "https://stackoverflow.com/questions/14",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "491"
} |
Q: Filling a DataSet or a DataTable from a LINQ query result set How do you expose a LINQ query as an ASMX web service?
Usually, from the business tier, I can return a typed DataSet or a DataTable which can be serialized for transport over ASMX.
How can I do the same for a LINQ query?
Is there a way to populate a typ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/16",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "157"
} |
Q: Binary Data in MySQL How do I store binary data in MySQL?
A: For a table like this:
CREATE TABLE binary_data (
id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY,
description CHAR(50),
bin_data LONGBLOB,
filename CHAR(50),
filesize CHAR(50),
filetype CHAR(50)
);
Here is a PHP example:
<?php
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/17",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "198"
} |
Q: What is the fastest way to get the value of π? I'm looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I'm using ways that don't involve using #define constants like M_PI, or hard-coding the number in.
The program below tests the various ways I know of. The inline assemb... | {
"language": "en",
"url": "https://stackoverflow.com/questions/19",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "351"
} |
Q: Throw an error preventing a table update in a MySQL trigger If I have a trigger before the update on a table, how can I throw an error that prevents the update on that table?
A: CREATE TRIGGER sample_trigger_msg
BEFORE INSERT
FOR EACH ROW
BEGIN
IF(NEW.important_value) < (1*2) THEN
DECLARE dummy INT;
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/24",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "193"
} |
Q: How to use the C socket API in C++ on z/OS I'm having issues getting the C sockets API to work properly in C++ on z/OS.
Although I am including sys/socket.h, I still get compile time errors telling me that AF_INET is not defined.
Am I missing something obvious, or is this related to the fact that being on z/OS makes... | {
"language": "en",
"url": "https://stackoverflow.com/questions/25",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "175"
} |
Q: How to unload a ByteArray using Actionscript 3? How do I forcefully unload a ByteArray from memory using ActionScript 3?
I have tried the following:
// First non-working solution
byteArray.length = 0;
byteArray = new ByteArray();
// Second non-working solution
for ( var i:int=0; i < byteArray.length; i++ ) {
by... | {
"language": "en",
"url": "https://stackoverflow.com/questions/34",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "96"
} |
Q: Check for changes to an SQL Server table? How can I monitor an SQL Server database for changes to a table without using triggers or modifying the structure of the database in any way? My preferred programming environment is .NET and C#.
I'd like to be able to support any SQL Server 2000 SP4 or newer. My application ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/36",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "153"
} |
Q: Reliable timer in a console application I am aware that in .NET there are three timer types (see Comparing the Timer Classes in the .NET Framework Class Library). I have chosen a threaded timer as the other types can drift if the main thread is busy, and I need this to be reliable.
The way this timer works in the co... | {
"language": "en",
"url": "https://stackoverflow.com/questions/39",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "114"
} |
Q: Best way to allow plugins for a PHP application I am starting a new web application in PHP and this time around I want to create something that people can extend by using a plugin interface.
How does one go about writing 'hooks' into their code so that plugins can attach to specific events?
A: I am surprised that ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/42",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "294"
} |
Q: Multiple submit buttons in an HTML form Let's say you create a wizard in an HTML form. One button goes back, and one goes forward. Since the back button appears first in the markup when you press Enter, it will use that button to submit the form.
Example:
<form>
<!-- Put your cursor in this field and press Ente... | {
"language": "en",
"url": "https://stackoverflow.com/questions/48",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "286"
} |
Q: How do I get a distinct, ordered list of names from a DataTable using LINQ? I have a DataTable with a Name column. I want to generate a collection of the unique names ordered alphabetically. The following query ignores the order by clause.
var names =
(from DataRow dr in dataTable.Rows
orderby (string)dr["Na... | {
"language": "en",
"url": "https://stackoverflow.com/questions/59",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "117"
} |
Q: Microsoft Office 2007 file type, Mime types and identifying characters Where can I find a list of all of the MIME types and the identifying characters for Microsoft Office 2007 files?
I have an upload form that is restricting uploads based on the extensions and identifying characters, but I cannot seem to find the O... | {
"language": "en",
"url": "https://stackoverflow.com/questions/61",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "52"
} |
Q: Paging a collection with LINQ How do you page through a collection in LINQ given that you have a startIndex and a count?
A: It is very simple with the Skip and Take extension methods.
var query = from i in ideas
select i;
var paggedCollection = query.Skip(startIndex).Take(count);
A: A few months back... | {
"language": "en",
"url": "https://stackoverflow.com/questions/66",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "89"
} |
Q: How do I add existing comments to RDoc in Ruby? I want to format my existing comments as 'RDoc comments' so they can be viewed using ri.
What are some recommended resources for starting out using RDoc?
A: A few things that have bitten me:
*
*:main: -- RDoc uses only the last one evaluated; best to make sure ther... | {
"language": "en",
"url": "https://stackoverflow.com/questions/72",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "48"
} |
Q: Getting Subclipse in Aptana to work with the newest release of Subversion The version of Subclipse (1.2.4) currently available through Aptana's automatic Plugins Manager does not work with the newest version of Subversion.
I see on the Subclipse website however that they have 1.4.2 out for Eclipse. So I added a new ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/79",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "50"
} |
Q: SQLStatement.execute() - multiple queries in one statement I've written a database generation script in SQL and want to execute it in my Adobe AIR application:
Create Table tRole (
roleID integer Primary Key
,roleName varchar(40)
);
Create Table tFile (
fileID integer Primary Key
,fileName varchar(50... | {
"language": "en",
"url": "https://stackoverflow.com/questions/80",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "54"
} |
Q: Flat file databases What are the best practices around creating flat file database structures in PHP?
A lot of more matured PHP flat file frameworks out there which I attempt to implement SQL-like query syntax which is over the top for my purposes in most cases. (I would just use a database at that point).
Are there... | {
"language": "en",
"url": "https://stackoverflow.com/questions/85",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "131"
} |
Q: Is gettimeofday() guaranteed to be of microsecond resolution? I am porting a game, that was originally written for the Win32 API, to Linux (well, porting the OS X port of the Win32 port to Linux).
I have implemented QueryPerformanceCounter by giving the uSeconds since the process start up:
BOOL QueryPerformance... | {
"language": "en",
"url": "https://stackoverflow.com/questions/88",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "106"
} |
Q: How do you branch and merge with TortoiseSVN? How do you branch and merge with Apache Subversion using the TortoiseSVN client?
A: You can also try Version Control for the Standalone Programmer - Part 1 or perhaps Merging with TortoiseSVN.
A: My easy click-by-click instructions (specific to TortoiseSVN) are in Sta... | {
"language": "en",
"url": "https://stackoverflow.com/questions/90",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "164"
} |
Q: Anatomy of a "Memory Leak" In .NET perspective:
*
*What is a memory leak?
*How can you determine whether your application leaks? What are the effects?
*How can you prevent a memory leak?
*If your application has memory leak, does it go away when the process exits or is killed? Or do memory leaks in your applic... | {
"language": "en",
"url": "https://stackoverflow.com/questions/104",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "181"
} |
Q: Best Subversion clients for Windows Vista (64bit) I've been using TortoiseSVN in a Windows environment for quite some time. It seems very feature-complete and nicely integrated into the Windows shell, and more importantly, it's fairly painless to teach to colleagues with little or no experience with source control... | {
"language": "en",
"url": "https://stackoverflow.com/questions/108",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "52"
} |
Q: Decoding T-SQL CAST in C#/VB.NET Recently our site has been deluged with the resurgence of the Asprox botnet SQL injection attack. Without going into details, the attack attempts to execute SQL code by encoding the T-SQL commands in an ASCII encoded BINARY string. It looks something like this:
DECLARE%20@S%20NVARCHA... | {
"language": "en",
"url": "https://stackoverflow.com/questions/109",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "68"
} |
Q: ASP.NET Site Maps Does anyone have experience creating SQL-based ASP.NET site-map providers?
I have the default XML file web.sitemap working properly with my Menu and SiteMapPath controls, but I'll need a way for the users of my site to create and modify pages dynamically.
I need to tie page viewing permissions into... | {
"language": "en",
"url": "https://stackoverflow.com/questions/120",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "45"
} |
Q: Java lib or app to convert CSV to XML file? Is there an existing application or library in Java which will allow me to convert a CSV data file to XML file?
The XML tags would be provided through possibly the first row containing column headings.
A: As far as I know, there's no ready-made library to do this for yo... | {
"language": "en",
"url": "https://stackoverflow.com/questions/123",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "119"
} |
Q: How would you access Object properties from within an object method? What is the "purist" or "correct" way to access an object's properties from within an object method that is not a getter/setter method?
I know that from outside of the object you should use a getter/setter, but from within would you just do:
Java:
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/126",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "105"
} |
Q: How to export data from SQL Server 2005 to MySQL I've been banging my head against SQL Server 2005 trying to get a lot of data out. I've been given a database with nearly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - st... | {
"language": "en",
"url": "https://stackoverflow.com/questions/129",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "90"
} |
Q: XSD DataSets and ignoring foreign keys I have a pretty standard table set-up in a current application using the .NET XSD DataSet and TableAdapter features. My contracts table consists of some standard contract information, with a column for the primary department. This column is a foreign key to my Departments table... | {
"language": "en",
"url": "https://stackoverflow.com/questions/134",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "39"
} |
Q: Compressing / Decompressing Folders & Files Does anyone know of a good way to compress or decompress files and folders in C# quickly? Handling large files might be necessary.
A: My answer would be close your eyes and opt for DotNetZip. It's been tested by a large community.
A: GZipStream is a really good utility t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/145",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "60"
} |
Q: How do I track file downloads I have a website that plays mp3s in a flash player. If a user clicks 'play' the flash player automatically downloads an mp3 and starts playing it.
Is there an easy way to track how many times a particular song clip (or any binary file) has been downloaded?
Is the play link a link to ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/146",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "89"
} |
Q: How do I sync the SVN revision number with my ASP.NET web site? Stack Overflow has a subversion version number at the bottom:
svn revision: 679
I want to use such automatic versioning with my .NET Web Site/Application, Windows Forms, WPD projects/solutions.
How do I implement this?
A: $rev and others like it are ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/163",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "101"
} |
Q: Embedding Windows Media Player for all browsers Edit: This question was written in 2008, which was like 3 internet ages ago. If this question is still relevant to your environment, please accept my condolences. Everyone else should convert into a format supported by your browsers (That would be H.264 if Internet Exp... | {
"language": "en",
"url": "https://stackoverflow.com/questions/164",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "64"
} |
Q: How to do version control for SQL Server database? I want to get my databases under version control.
I'll always want to have at least some data in there (as alumb mentions: user types and administrators). I'll also often want a large collection of generated test data for performance measurements.
How would I apply ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/173",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "337"
} |
Q: How do I print an HTML document from a web service? I want to print HTML from a C# web service. The web browser control is overkill, and does not function well in a service environment, nor does it function well on a system with very tight security constraints. Is there any sort of free .NET library that will supp... | {
"language": "en",
"url": "https://stackoverflow.com/questions/174",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "86"
} |
Q: Annotating YouTube videos programmatically I want to be able to display a normal YouTube video with overlaid annotations, consisting of coloured rectangles for each frame. The only requirement is that this should be done programmatically.
YouTube has annotations now, but require you to use their front end to create... | {
"language": "en",
"url": "https://stackoverflow.com/questions/175",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "53"
} |
Q: error_log per Virtual Host? On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts with separate log files. We cannot seem to separate the php error_log between virtual hosts.
Overriding this setting in the <Location> of the httpd.conf does not seem to do anything.
Is there a way to have separa... | {
"language": "en",
"url": "https://stackoverflow.com/questions/176",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "124"
} |
Q: Function for creating color wheels This is something I've pseudo-solved many times and have never quite found a solution for.
The problem is to come up with a way to generate N colors, that are as distinguishable as possible where N is a parameter.
A: Isn't it also a factor which order you set up the colors?
Like i... | {
"language": "en",
"url": "https://stackoverflow.com/questions/180",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "71"
} |
Q: Floating Point Number parsing: Is there a Catch All algorithm? One of the fun parts of multi-cultural programming is number formats.
*
*Americans use 10,000.50
*Germans use 10.000,50
*French use 10 000,50
My first approach would be to take the string, parse it backwards until I encounter a separator and use t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/192",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "72"
} |
Q: Upgrading SQL Server 6.5 Yes, I know. The existence of a running copy of SQL Server 6.5 in 2008 is absurd.
That stipulated, what is the best way to migrate from 6.5 to 2005? Is there any direct path? Most of the documentation I've found deals with upgrading 6.5 to 7.
Should I forget about the native SQL Server up... | {
"language": "en",
"url": "https://stackoverflow.com/questions/194",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "40"
} |
Q: What's the best way to generate a tag cloud from an array using h1 through h6 for sizing? I have the following arrays:
$artist = array("the roots", "michael jackson", "billy idol", "more", "and more", "and_YET_MORE");
$count = array(5, 3, 9, 1, 1, 3);
I want to generate a tag cloud that will have artists with a hig... | {
"language": "en",
"url": "https://stackoverflow.com/questions/227",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "80"
} |
Q: Register Windows program with the mailto protocol programmatically How do I make it so mailto: links will be registered with my program?
How would I then handle that event in my program?
Most of the solutions I found from a quick Google search are how to do this manually, but I need to do this automatically for user... | {
"language": "en",
"url": "https://stackoverflow.com/questions/231",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "43"
} |
Q: SQL Server 2005 implementation of MySQL REPLACE INTO? MySQL has this incredibly useful yet proprietary REPLACE INTO SQL Command.
Can this easily be emulated in SQL Server 2005?
Starting a new Transaction, doing a Select() and then either UPDATE or INSERT and COMMIT is always a little bit of a pain, especially when ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/234",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "89"
} |
Q: Create a SQLite database based on an XSD Data Set Does anybody know if there is a way to create an SQLite database based on an XSD DataSet? In the past, I've just used a basic SQLite manager, but I want to fuse things a bit more with my .NET development if possible.
A: Perhaps you could use an XSL transformation to... | {
"language": "en",
"url": "https://stackoverflow.com/questions/246",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "45"
} |
Q: Adding scripting functionality to .NET applications I have a little game written in C#. It uses a database as back-end. It's
a trading card game, and I wanted to implement the function of the cards as a script.
What I mean is that I essentially have an interface, ICard, which a card class implements (public class C... | {
"language": "en",
"url": "https://stackoverflow.com/questions/260",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "83"
} |
Q: GTK implementation of MessageBox I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL, so this isn't a GTK app.
I handle the initialization (gtk_init) sort of stuff inside the MessageBox function as follows:
int MessageBox(HWND hwnd, const char* text, const char* caption, UINT type)
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/263",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "42"
} |
Q: BerkeleyDB Concurrency
*
*What's the optimal level of concurrency that the C++ implementation of BerkeleyDB can reasonably support?
*How many threads can I have hammering away at the DB before throughput starts to suffer because of resource contention?
I've read the manual and know how to set the number of lock... | {
"language": "en",
"url": "https://stackoverflow.com/questions/264",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "38"
} |
Q: Best Practice: Collaborative Environment, Bin Directory, SVN What are the best practices for checking in BIN directories in a collaborative development environment using SVN? Should project level references be excluded from checkin? Is it easier to just add all bin directories?
I develop a lot of DotNetNuke sites ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/265",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "38"
} |
Q: How do you sort a dictionary by value? I often have to sort a dictionary (consisting of keys & values) by value. For example, I have a hash of words and respective frequencies that I want to order by frequency.
There is a SortedList which is good for a single value (say frequency), that I want to map back to the wor... | {
"language": "en",
"url": "https://stackoverflow.com/questions/289",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "929"
} |
Q: Is there a version control system for database structure changes? I often run into the following problem.
I work on some changes to a project that require new tables or columns in the database. I make the database modifications and continue my work. Usually, I remember to write down the changes so that they can be r... | {
"language": "en",
"url": "https://stackoverflow.com/questions/308",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "130"
} |
Q: PHP Session Security What are some guidelines for maintaining responsible session security with PHP? There's information all over the web and it's about time it all landed in one place!
A: This session fixation paper has very good pointers where attack may come. See also session fixation page at Wikipedia.
A: The... | {
"language": "en",
"url": "https://stackoverflow.com/questions/328",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "125"
} |
Q: Should I use nested classes in this case? I am working on a collection of classes used for video playback and recording. I have one main class which acts like the public interface, with methods like play(), stop(), pause(), record() etc... Then I have workhorse classes which do the video decoding and video encoding.... | {
"language": "en",
"url": "https://stackoverflow.com/questions/330",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "58"
} |
Q: When to use unsigned values over signed ones? When is it appropriate to use an unsigned variable over a signed one? What about in a for loop?
I hear a lot of opinions about this and I wanted to see if there was anything resembling a consensus.
for (unsigned int i = 0; i < someThing.length(); i++) {
SomeThing ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/336",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "89"
} |
Q: XML Processing in Python I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it.
Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/337",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "82"
} |
Q: Generate list of all possible permutations of a string How would I go about generating a list of all possible permutations of a string between x and y characters in length, containing a variable list of characters.
Any language would work, but it should be portable.
A: I just whipped this up quick in Ruby:
def perm... | {
"language": "en",
"url": "https://stackoverflow.com/questions/361",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "164"
} |
Q: How do you make sure email you send programmatically is not automatically marked as spam? This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology.
Of late, some of the emails I ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/371",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "461"
} |
Q: What is the meaning of the type safety warning in certain Java generics casts? What is the meaning of the Java warning?
Type safety: The cast from Object to List<Integer> is actually checking against the erased type List
I get this warning when I try to cast an Object to a type with generic information, such as in... | {
"language": "en",
"url": "https://stackoverflow.com/questions/382",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "81"
} |
Q: Lucene Score results In Lucene if you had multiple indexes that covered only one partition each. Why does the same search on different indexes return results with different scores? The results from different servers match exactly.
i.e. if I searched for :
*
*Name - John Smith
*DOB - 11/11/1934
Partition 0 wou... | {
"language": "en",
"url": "https://stackoverflow.com/questions/387",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "45"
} |
Q: iPhone app in landscape mode, 2008 systems Please note that this question is from 2008 and now is of only historic interest.
What's the best way to create an iPhone application that runs in landscape mode from the start, regardless of the position of the device?
Both programmatically and using the Interface Builder... | {
"language": "en",
"url": "https://stackoverflow.com/questions/402",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "100"
} |
Q: Unload a COM control when working in VB6 IDE Part of my everyday work is maintaining and extending legacy VB6 applications. A common engine is written in C/C++ and VB6 uses these functions in order to improve performance.
When it comes to asynchronous programming, a C interface is not enough and we rely on COM cont... | {
"language": "en",
"url": "https://stackoverflow.com/questions/419",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "37"
} |
Q: Programmatically launch IE Mobile favorites screen Is there any way to launch IE Mobile's "Favorites" screen directly by
specifying any command line parameter?
A: How about running IE with the HTML favorites file as a parameter?
IExplore file://\windows\fav.htm
A: I think this is going to be quite difficult with... | {
"language": "en",
"url": "https://stackoverflow.com/questions/427",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "29"
} |
Q: Implementation of "Remember me" in a Rails application My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session.
But sessions are impleme... | {
"language": "en",
"url": "https://stackoverflow.com/questions/438",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "57"
} |
Q: How can I find the full path to a font from its display name on a Mac? I am using the Photoshop's javascript API to find the fonts in a given PSD.
Given a font name returned by the API, I want to find the actual physical font file that font name corresponds to on the disc.
This is all happening in a python program r... | {
"language": "en",
"url": "https://stackoverflow.com/questions/469",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "48"
} |
Q: Homegrown consumption of web services I've been writing a few web services for a .net app, now I'm ready to consume them. I've seen numerous examples where there is homegrown code for consuming the service as opposed to using the auto generated methods that Visual Studio creates when adding the web reference.
Is th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/470",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "24"
} |
Q: WinForms ComboBox data binding gotcha Assume you are doing something like the following
List<string> myitems = new List<string>
{
"Item 1",
"Item 2",
"Item 3"
};
ComboBox box = new ComboBox();
box.DataSource = myitems;
ComboBox box2 = new ComboBox();
box2.DataSource = myitems
So now we have 2 combo bo... | {
"language": "en",
"url": "https://stackoverflow.com/questions/482",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "56"
} |
Q: Get a preview JPEG of a PDF on Windows? I have a cross-platform (Python) application which needs to generate a JPEG preview of the first page of a PDF.
On the Mac I am spawning sips. Is there something similarly simple I can do on Windows?
A: Is the PC likely to have Acrobat installed? I think Acrobat installs a s... | {
"language": "en",
"url": "https://stackoverflow.com/questions/502",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "59"
} |
Q: Frequent SystemExit in Ruby when making HTTP calls I have a Ruby on Rails Website that makes HTTP calls to an external Web Service.
About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine.
It... | {
"language": "en",
"url": "https://stackoverflow.com/questions/514",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "24"
} |
Q: Continuous Integration System for a Python Codebase I am starting to work on a hobby project with a Python codebase and I would like to set up some form of continuous integration (i.e. running a battery of test-cases each time a check-in is made and sending nag e-mails to responsible persons when the tests fail) sim... | {
"language": "en",
"url": "https://stackoverflow.com/questions/535",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "69"
} |
Q: The definitive guide to form-based website authentication
Moderator note:
This question is not a good fit for our question and answer format with the topicality rules which currently apply for Stack Overflow. We normally use a "historical lock" for such questions where the content still has value. However, the answ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/549",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5518"
} |
Q: How to use combinations of sets as test data I would like to test a function with a tuple from a set of fringe cases and normal values. For example, while testing a function which returns true whenever given three lengths that form a valid triangle, I would have specific cases, negative / small / large numbers, valu... | {
"language": "en",
"url": "https://stackoverflow.com/questions/561",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "29"
} |
Q: How to write to Web.Config in Medium Trust? Uploading my first decently sized web app to my shared host provided me with a fresh set of challenges, by which I mean, sleepless nights. The issue was that I had most certainly not developed my application for medium trust (or had any clue what that was.)
I mitigated al... | {
"language": "en",
"url": "https://stackoverflow.com/questions/562",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "51"
} |
Q: What is the difference between an int and an Integer in Java and C#? I was reading More Joel on Software when I came across Joel Spolsky saying something about a particular type of programmer knowing the difference between an int and an Integer in Java/C# (Object-Oriented Programming Languages).
So, what is the diff... | {
"language": "en",
"url": "https://stackoverflow.com/questions/564",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "269"
} |
Q: Deploying SQL Server Databases from Test to Live I wonder how you guys manage deployment of a database between 2 SQL Servers, specifically SQL Server 2005.
Now, there is a development and a live one. As this should be part of a buildscript (standard windows batch, even do with current complexity of those scripts, i ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/580",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "30"
} |
Q: Best way to access Exchange using PHP? I'm writing a CMS application in PHP and one of the requirements is that it must be able to interface with the customer's Exchange server. I've written up this functionality a few times before and have always used WebDAV to do it, but now I'm leaning away from that.
I will be ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/588",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "58"
} |
Q: cx_Oracle: How do I iterate over a result set? There are several ways to iterate over a result set. What are the tradeoff of each?
A: There's also the way psyco-pg seems to do it... From what I gather, it seems to create dictionary-like row-proxies to map key lookup into the memory block returned by the query. In t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/594",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "55"
} |
Q: Robust Random Number Generation I'm looking for a performant, reasonably robust RNG using no special hardware. It can use mathematical methods (Mersenne Twister, etc), it can "collect entropy" from the machine, whatever. On Linux/etc we have a drand48() which generates 48 random bits. I'd like a similar function/cla... | {
"language": "en",
"url": "https://stackoverflow.com/questions/601",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "42"
} |
Q: Build for Windows NT 4.0 using Visual Studio 2005? An MFC application that I'm trying to migrate uses afxext.h, which causes _AFXDLL to get set, which causes this error if I set /MT:
Please use the /MD switch for _AFXDLL builds
My research to date indicates that it is impossible to build an application for executi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/609",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "21"
} |
Q: Most efficient code for the first 10000 prime numbers? I want to print the first 10000 prime numbers.
Can anyone give me the most efficient code for this?
Clarifications:
*
*It does not matter if your code is inefficient for n >10000.
*The size of the code does not matter.
*You cannot just hard code the values ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/622",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "64"
} |
Q: When to use lambda, when to use Proc.new? In Ruby 1.8, there are subtle differences between proc/lambda on the one hand, and Proc.new on the other.
*
*What are those differences?
*Can you give guidelines on how to decide which one to choose?
*In Ruby 1.9, proc and lambda are different. What's the deal?
A: To... | {
"language": "en",
"url": "https://stackoverflow.com/questions/626",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "345"
} |
Q: Swap unique indexed column values in database I have a database table and one of the fields (not the primary key) is having a unique index on it. Now I want to swap values under this column for two rows. How could this be done? Two hacks I know are:
*
*Delete both rows and re-insert them.
*Update rows with some ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/644",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "70"
} |
Q: Automatically update version number I would like the version property of my application to be incremented for each build but I'm not sure on how to enable this functionality in Visual Studio (2005/2008). I have tried to specify the AssemblyVersion as 1.0.* but it doesn't get me exactly what I want.
I'm also using a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/650",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "114"
} |
Q: Checklist for IIS 6/ASP.NET Windows Authentication? I've been having trouble getting my ASP.NET application to automatically log users into the Intranet site I'm building. No matter the googling or the experimentation I applied, there is always a login box displayed by IE7.
I've got Windows authentication mode set ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/651",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "34"
} |
Q: Encrypting Passwords What is the fastest, yet secure way to encrypt passwords (in PHP preferably), and for whichever method you choose, is it portable?
In other words, if I later migrate my website to a different server, will my passwords continue to work?
The method I am using now, as I was told, is dependent on th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/657",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "38"
} |
Q: Using 'in' to match an attribute of Python objects in an array I don't remember whether I was dreaming or not but I seem to recall there being a function which allowed something like,
foo in iter_attr(array of python objects, attribute name)
I've looked over the docs but this kind of thing doesn't fall under any obv... | {
"language": "en",
"url": "https://stackoverflow.com/questions/683",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "58"
} |
Q: Connect PHP to IBM i (AS/400) I've got an upcoming project wherein I will need to connect our website (PHP5/Apache 1.3/OpenBSD 4.1) to our back-end system running on an iSeries with OS400 V5R3 so that I can access some tables stored there. I've done some checking around but am running into some roadblocks.
From what... | {
"language": "en",
"url": "https://stackoverflow.com/questions/696",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "37"
} |
Q: Embedded Database for .net that can run off a network I was (and still am) looking for an embedded database to be used in a .net (c#) application. The caveat: The Application (or at least the database) is stored on a Network drive, but only used by 1 user at a time.
Now, my first idea was SQL Server Compact edition.... | {
"language": "en",
"url": "https://stackoverflow.com/questions/705",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "38"
} |
Q: .NET testing framework advice I'm looking to introduce a unit testing framework into the mix at my job. We're using Visual Studio 2005 (though we may be moving to 2008 within the next six months) and work primarily in C#. If the framework has some kind of IDE integration that would be best, but I'm open to framewor... | {
"language": "en",
"url": "https://stackoverflow.com/questions/709",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "55"
} |
Q: Why doesn't VFP .NET OLEdb provider work in 64 bit Windows? I wrote a windows service using VB that read some legacy data from Visual Foxpro Databases to be inserted in SQL 2005. The problem is this use to run fine in Windows server 2003 32-Bits, but the client recently moved to Windows 2003 64-Bits and now the serv... | {
"language": "en",
"url": "https://stackoverflow.com/questions/717",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "31"
} |
Q: Class views in Django Django view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach.
For example, I have a page that displays a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/742",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "62"
} |
Q: Format string to title case How do I format a string to title case?
A:
To capatilise it in, say, C - use the ascii codes (http://www.asciitable.com/) to find the integer value of the char and subtract 32 from it.
This is a poor solution if you ever plan to accept characters beyond a-z and A-Z.
For instance: ASCII... | {
"language": "en",
"url": "https://stackoverflow.com/questions/746",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "30"
} |
Q: How to create a new object instance from a Type One may not always know the Type of an object at compile-time, but may need to create an instance of the Type.
How do you get a new object instance from a Type?
A: public AbstractType New
{
get
{
return (AbstractType) Activator.CreateInstance(GetType... | {
"language": "en",
"url": "https://stackoverflow.com/questions/752",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "896"
} |
Q: Localising date format descriptors What is the best way to localise a date format descriptor?
As anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse dates ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/761",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "22"
} |
Q: Python and MySQL I can get Python to work with Postgresql but I cannot get it to work with MySQL. The main problem is that on the shared hosting account I have I do not have the ability to install things such as Django or PySQL, I generally fail when installing them on my computer so maybe it's good I can't install ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/766",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "45"
} |
Q: Solving a linear equation I need to programmatically solve a system of linear equations in C, Objective C, or (if needed) C++.
Here's an example of the equations:
-44.3940 = a * 50.0 + b * 37.0 + tx
-45.3049 = a * 43.0 + b * 39.0 + tx
-44.9594 = a * 52.0 + b * 41.0 + tx
From this, I'd like to get the best approxima... | {
"language": "en",
"url": "https://stackoverflow.com/questions/769",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "48"
} |
Q: How do I use itertools.groupby()? I haven't been able to find an understandable explanation of how to actually use Python's itertools.groupby() function. What I'm trying to do is this:
*
*Take a list - in this case, the children of an objectified lxml element
*Divide it into groups based on some criteria
*Then ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/773",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "664"
} |
Q: ASP, need to use SFTP This is ASP classic, not .Net. We have to get a way to SFTP into a server to upload and download a couple of files, kicked off by a user.
What have other people used to do SFTP in ASP classic? Not necessarily opposed to purchasing a control.
A: If you have the ability to use WScript.Shell th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/805",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "17"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.