text stringlengths 8 267k | meta dict |
|---|---|
Q: C#, correct use of the static keyword when designing a basic color class I am making a Color class, and provide a standard constructor like
Color(int red, int green, int blue)
And then I want to provide an easy way to get the most common colors, like
Color.Blue, Color.Red. I see two possible options:
public static ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311439",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How would you format/indent this piece of code? How would you format/indent this piece of code?
int ID = Blahs.Add( new Blah( -1, -2, -3) );
or
int ID = Blahs.Add( new Blah(
1,2,3,55
)
);
Edit:
My class has lots of parameters actually, so that might effect your response.
A: I'd go with the one-liner. ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311454",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: problem with PHP reading CSV files I'm trying to read data from a.csv file to ouput it on a webpage as text.
It's the first time I'm doing this and I've run into a nasty little problem.
My .csv file(which gets openened by Excel by default), has multiple rows and I read the entire thing as one long string.
like this:... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311460",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Store large amounts of data in RMS I need to store large amount of data using RMS API through J2ME.
How can I store that multiple-column data, given they must be hardcoded so I need to store those multiple columns and rows data.
How can I do this in this, should I use structs?
A: Well, RMS only allows you to store... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311461",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Bonjour Networking Help on iPhone WiTap sample I can follow most of Apple's WiTap sample, but am sort of stumped on this bit in the send method:
- (void) send:(const uint8_t)message
{
if (_outStream && [_outStream hasSpaceAvailable])
if([_outStream write:(const uint8_t *)&message maxLength:sizeof(const uint8_t)]... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311463",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: LINQ To SQL not saving to database I have a very simple table and I can happily query it using LINQ To SQL, but when I do any save/updates the GetChangeSet method on my datacontext is always empty.
My code is very simple (concatenated code from various classes):
public static EntitiesDataContext EntitiesContext
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311476",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: MySQL - Faster method for this complex query? Is there a less resource intensive / faster way of performing this query (which is partly based upon: This StackOverflow question ). Currently it takes 0.008 seconds searching through only a dozen or so rows per table.
SELECT DISTINCT *
FROM (
(
SELECT DISTINCT ta.auto_... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311479",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to test a second parameter in a PHPUnit mock object This is what I have:
$observer = $this->getMock('SomeObserverClass', array('method'));
$observer->expects($this->once())
->method('method')
->with($this->equalTo($arg1));
But the method should take two parameters. I am only testing that the f... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311485",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "72"
} |
Q: How do you add Start->Run shortcuts in Windows XP? Does anyone know how you setup new commands to launch an application from the Start->Run box?
ie. you can type "firefox", "winword" or "excel" into the Run box and those applications will open even though they're not in the system path, but others won't. For example... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311496",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "16"
} |
Q: Why Math.Atan(Math.Tan(x)) != x? If tan(x) = y and atan(y) = x why Math.Atan(Math.Tan(x)) != x?
I´m trying to calculate x in something like:
tan(2/x +3) = 5
so
atan(tan(2/x + 3) = atan(5)
and so on... but I´ve tried this:
double d = Math.Atan(Math.Tan(10));
and d != 10. Why?
A: A graph might help explain why... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311501",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Long pages in FireFox offset when scrollbar appears In Firefox and Safari, pages that are centered move a few pixels when the page is long enough for the scrollbar to appear. If you navigate through a site that has long and short pages, the page seems to "jump" around.
IE7 tends to leave the scroll bar visible all ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311504",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: Does anyone use Virtualization to create a quicker disaster recovery of a development environment? I'm getting pretty tired of my development box dying and then I end up having to reinstall a laundry list of tools that I use in development.
This time I think I'm going to set the development environment up on a Vir... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311507",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Flex Help: Repeaters not repeating in an Accordian control I am having a issue with databinding child repeaters inside an accordion control, hopefully you can help...
I have an accordion in a ViewStack (of which,that ViewStack is also in another top-level ViewStack). I have a repeater in each child of the accordion ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311530",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Filling in datagrid columns from database after page is already loaded I have a web page that loads some data via a SQL query into a datagrid. I was asked to add a new column. During testing I discovered that pulling this extra column of data from the database slows the query down substantially. What used to be a su... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311532",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Fire an event when email is received I'm trying to write something that puts the contents of the message on a queue, to have work done on it later. I've been messing around with IMAP IDLE with varying degrees of success.
I was wondering if anyone knows of a method to have a mail server receive an email, and then per... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311536",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: Console Application Edit:
I don't know what this user originally wanted, and hopefully they'll edit their question to let us know, but otherwise, let's use this question to answer (or give links to) the following common console window issues:
*
*How do you capture the output of a console application in your progr... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311543",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Parsing a Date Range in C# - ASP.NET Given say 11/13/2008 - 12/11/2008 as the value posted back in TextBox, what would be the best way to parse out the start and end date using C#?
I know I could use:
DateTime startDate = Convert.ToDateTime(TextBoxDateRange.Text.Substring(0, 10));
DateTime endDate = Convert.ToDateTi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311576",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How do I select the parent form based on which submit button is clicked? I have a web page with 3 forms on it. Not nested, just one after the other (they are almost identical, just one hidden variable that's different). A user will only fill in one form, and I'd like to validate/etc all the forms with only one JS ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311579",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "135"
} |
Q: How to indent Python list-comprehensions? List comprehensions can be useful in certain situations, but they can also be rather horrible to read.. As a slightly exaggerated example, how would you indent the following?
allUuids = [x.id for x in self.db.query(schema.allPostsUuid).execute(timeout = 20) if x.type == "pos... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311588",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "78"
} |
Q: Gotchas: Upgrading from single servers to web farms Our company currently runs two Windows 2003 servers (a web server & a MSSQL 8 database server). We're planning to add another couple of servers for redundancy / availability purposes in a web farm setup. Our web sites are predominately ASP.NET, we do have a few PHP... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311596",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: How to use generics in a world of mixed Java versions? I like generics a lot and use them whereever I can. Every now and then I need to use one of my classes in another project which has to run on an old JVM (before 5.0), needs to run on JavaME (where generics are not allowed neither) or in Microsoft J# (which has V... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311599",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: python as a "batch" script (i.e. run commands from python) I'm working in a windows environment (my laptop!) and I need a couple of scripts that run other programs, pretty much like a windows batch file.
how can I run a command from python such that the program when run, will replace the script? The program is inter... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311601",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "14"
} |
Q: Using XML as (read only) human readable datasource for survey questions Scientific or market research questionnaires mainly consist of questions in the following form:
INTRO: Indicate how much you agree with the following statements...
OPTIONS: very much - rather - so-so - rather not - not at all
ITEM 1: I love Coca... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311602",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How do I determine object that function is a method of? var A = {
x : function () { }
};
var b = function (method) {
//want to know method's "parent" here
};
b(A.x);
I want to know that x is defined in A when I call the b(A.x). Is this possible?
A: There's no nice built-in way to do this, because actuall... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311605",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: What constitutes a rich domain model in a POJO/POCO? What is the difference between
*
*A simple fields-accesors-mutators class
*A rich-modeled class
What constitutes rich modeling in business-domain classes?
A: "Rich" as used here implies "rich behavior" (as opposed to state).
There is technical behavior and ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311608",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Accidental overwrite of OSX Python system framework I got ahead of myself and downloaded and installed the OSX Python 2.6 package from www.python.org/download/ on my OSX 10.5.5 Intel Mac and installed the full package contents. Only after this did I come across http://wiki.python.org/moin/MacPython/Leopard stating t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311621",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How to update created and modified fields using the repository design pattern? I am currently working on my first asp.net mvc application. I am trying to drink the kool-aid of all the the sample projects I see and trying to use the repository design pattern.
I have a interface called IUserRepository that looks like... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311625",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Duck type as syntactic sugar for reflection: Good or bad idea? I've been thinking lately, would it be a good form of syntactic sugar in languages like Java and C#, to include a "duck" type as a method parameter type? This would look as follows:
void myFunction(duck foo) {
foo.doStuff();
}
This could be syntacti... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311626",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to print a date in a regular format? This is my code:
import datetime
today = datetime.date.today()
print(today)
This prints: 2008-11-22 which is exactly what I want.
But, I have a list I'm appending this to and then suddenly everything goes "wonky". Here is the code:
import datetime
mylist = []
today = datetim... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311627",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "803"
} |
Q: How to deal with a Many-To-Many Relation in my API I have two entities Foo and Bar with a Many to Many relationship between them.
Let's say there is no semantic argument for why Foo might be "responsible" for the many to many relationship, but we arbitrarily decide that Foo is responsible for the relation (I.e., in ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311630",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: JQuery - replace one string for another in .load-ed html? I'm loading an html snippet using
$("#TemplateDump").load("Themes/default.template", function() { processTemplate() })
The html i am loading contains
<div>
`hello ##name##, your age is ##age##.
your page is <a href="##website##">here</a>
</div>
I need to ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311644",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Public free web services for testing soap client Are there any publicly available SOAP 1.2/WSDL 2.0 compliant free web services for testing a Python based soap client library (e.g. Zolera SOAP Infrastructure)?
So far, it appears to me that Google Web API may be the only option.
Otherwise, how can one test a SOAP 1.... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311654",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "99"
} |
Q: How to learn work effectively with Unix CLI Do you know any resources that teach to good habits of working in UNIX command line?
EDIT: I don't mean general books about shell or man pages. I mean the things that you can only see watching professionals working with command line. For example when changing frequently be... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311656",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: MySQL – How do you find the time down to the Millisecond? Is there any way to get the time down to the Millisecond in MySQL?
A: MySQL doesn't support milliseconds in any of the time / date columns, or return it in NOW() so unfortunately, no.
If you have a string in a date / time + microseconds format you can use SE... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311657",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: C# work around for XmlSerializer.Deserialize pitfall? I was just wondering if there are any good work-arounds for Deserializing private fields/properties using XmlSerializer.Deserialize() ?
Currently, I Deserialize my XML to a simple disposable type with all public properties, then I load the complex type that has p... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311662",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Windows Mobile : Which icon is the application icon? I am trying to write a unix command line utility that will extract the "application" icon from a Windows Mobile executable. When I look inside the .exe with wrestool from the icoutils package, I see multiple icon and group_icon resources. I am trying to figure o... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311666",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How to disable auto sleep on external USB hard drive in Windows XP I've seen a related question on this website regarding a Linux system. I have the same question on a Windows XP OS. I bought a Winchester USB external HD, and found out from technical support that the sleep feature is in the firmware and cannot be ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311672",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
} |
Q: How can I put (parts of) a large object graph in Rails.cache? I have a class in which looking up an instance is expensive, so instances are cached:
class Foo
def self.find(id)
Rails.cache.fetch("Foo.#{id}") do
// some expensive lookup, like an HTTParty request, or a long SQL query
...
end
end... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311674",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: SecurityManager.IsGranted() behaviour can anybody please explain the following c# behaviour? I have written a small console application just to learn about CAS, but I can not seem to understand why the following lines of code work like they do:
string[] myRoles = new string[] { "role1", "role2", "role3" };
GenericId... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311677",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Importing a SQLite3 dump back into the database I feel like this is a stupid question because it seems like common sense . . . but no google search I can put together seems to be able to give me the answer!
I know how to get data OUT of a sqlite3 database using the .dump command. But now that I have this ASCII file... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311691",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "47"
} |
Q: Why does .NET use banker's rounding as default? According to the documentation, the decimal.Round method uses a round-to-even algorithm which is not common for most applications. So I always end up writing a custom function to do the more natural round-half-up algorithm:
public static decimal RoundHalfUp(this decima... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311696",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "290"
} |
Q: Scripting.FileSystemObject.FileExists always returns false I'm attempting to check that a file exists before including it with Server.Execute in Classic ASP. While FileExists() returns False, Server.Execute successfully executes the file. Both calls use the exact same file path.
Why does this happen and how can I wo... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311702",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Algorithm for sampling without replacement? I am trying to test the likelihood that a particular clustering of data has occurred by chance. A robust way to do this is Monte Carlo simulation, in which the associations between data and groups are randomly reassigned a large number of times (e.g. 10,000), and a metric... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311703",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "15"
} |
Q: Performance Optimization For Highly Interactive Websites I recently completed development of a mid-traficked(?) website (peak 60k hits/hour), however, the site only needs to be updated once a minute - and achieving the required performance can be summed up by a single word: "caching".
For a site like SO where the da... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311706",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How do I sum a list<> of arrays I have a List< int[] > myList, where I know that all the int[] arrays are the same length - for the sake of argument, let us say I have 500 arrays, each is 2048 elements long. I'd like to sum all 500 of these arrays, to give me a single array, 2048 elements long, where each element i... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311710",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "13"
} |
Q: Simple tips to reduce coupling I have a large .NET web application. The system has projects for different intentions (e.g. CMS, Forum, eCommerce), and I have noticed a (naive) pattern of calling on another project's class. For example, the ecommerce module needs functionality to generate a file on the fly for produc... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311714",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: SQL query to return rows sorted by key plus empty rows for missing keys I have a table that has, in essence, this structure:
key value
------ ------
2 val1
3 val2
5 val3
The keys are sequential integers from 1 up to (currently) 1 million, increasing by several thousand each... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311725",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: What language would people recommend as simple GUI that can be used as input to a script runing on Cygwin? I need a simple window with three input boxes and three labels (login name, password, and server node) and a button to execute the script. I do not want any third party programs that need to be installed on Win... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311730",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Wpf custom control template - relative font size I am creating a custom WPF control that let's say for simplicity sake has a vertical stack panel with a "title" TextBlock, followed by a ContentPresenter. I want the font size for the "title" to be 5 Points LARGER than the size used in the content, which is inherited ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311734",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: check if X is derived of Y via typeid i need to convert pointers to long (SendMessage())
and i want to safely check if the variable is correct on the otherside. So i was thinking of doing dynamic_cast but that wont work on classes that are not virtual. Then i thought of doing typeid but that will work until i pass a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311735",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Parsing GPS receiver output via regex in Python I have a friend who is finishing up his masters degree in aerospace engineering. For his final project, he is on a small team tasked with writing a program for tracking weather balloons, rockets and satellites. The program receives input from a GPS device, does calcula... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311763",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "14"
} |
Q: select from table, then form a space-separated string all in a stored procedure I want to select about 4-5 rows from a table, then form a space separated string.
All of this is to be done in a stored procedure (SQL server 2005).
Is this possible?
I will then use this space-separated string and save it to another tab... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311768",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Create a list with initial capacity in Python Code like this often happens:
l = []
while foo:
# baz
l.append(bar)
# qux
This is really slow if you're about to append thousands of elements to your list, as the list will have to be constantly resized to fit the new elements.
In Java, you can create an Arr... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311775",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "224"
} |
Q: MSBuild ITaskItem array is out of date I'm creating a custom ITask for MSBuild which uploads the output files of my build. I'm using a web deployment project to publish my app and hooking in to the AfterBuild target to do my custom work.
If I add a file to my web application, the first time I do a build, my custom ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311781",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Schema (XSD) for Microsoft .NET configuration file I'm searching the XSD (XML Schema) for the Microsoft .NET application configuration files. Till now I found only this: Configuration File Schema for the .NET Framework but I'm more interested in the XSD.
Or - asked in general - I search also XSDs in general for .NET... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311782",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: AS400 C#.net inserting new record problems I am trying to build a C#.net program that works like a RPG Subfile on the AS400.
Have the general subfile part working. I can display and then edit and update existing records.
Am blowing up in my code where I am trying to insert a new record. Blowing up on the
cmd.Execu... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311789",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: UITableView Exit Edit Mode I have an array of objects which populate a UITableView. When a user removes the last object from the array, I automatically create a new "default" object. However, in the TableView, when the user gets there, the list is still in "Edit" mode. Is there a way for me to programatically set th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311800",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: url encoded forward slashes breaking my codeigniter app i’m trying to create a url string that works like this:
/app/process/example.com/index.html
so in other words,
/app/process/$URL
i then retrieve the url with
$this->uri->segment(3);
the forward slashes in the URL will of course be a problem accessing uri se... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311801",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "13"
} |
Q: W3C Involvement In Flash & Silverlight It seems to me that the key USP of Flash/Silverlight is the ability to provide access (albeit indirectly) to the graphics subsystem of the client, enabling video, smooth transitions and "fancy" visual effects.
This sounds like a good idea, and a natural evolution/extension of H... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311802",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-2"
} |
Q: Access desktop release directory from windows ce device I am writing a test program to copy some file in Application data folder on device to release directory on desktop.
I am not sure how to access release dir on desktop?
Is there any shell command to do that?
Basically I want to write c++ program that will run on... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311805",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Unit Testing with functions that return random results I don't think that this is specific to a language or framework, but I am using xUnit.net and C#.
I have a function that returns a random date in a certain range. I pass in a date, and the returning date is always in range of 1 to 40 years before the given date.
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311807",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "73"
} |
Q: How can I associate ".js.php" to JavaScript Syntax in the NetBeans 6.5 IDE? When I generate CSS or JavaScript files using PHP I like to use .js.php or .css.php file extensions. so that I know what's going on.
Is there a way of associating these "compound" file extensions to their respective languages?
A: I don't us... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311816",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Maximize SDL window How should I tell SDL to maximize the application window?
I'm creating the window with these flags: SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE.
A: All answers seem outdated, nowadays just specify SDL_WINDOW_MAXIMIZED as flag for SDL_CreateWindow.
window = SDL_CreateWindow(
"F... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311818",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: Tool to trace local function calls in Linux I am looking for a tool like ltrace or strace that can trace locally defined functions in an executable. ltrace only traces dynamic library calls and strace only traces system calls. For example, given the following C program:
#include <stdio.h>
int triple ( int x )
{
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311840",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "66"
} |
Q: Autocreate stub properties for interfaces in C#? I've switch from VB.NET to C# several months ago, while there are a lot of features I really like in C#, believe it or not, there are some features that I really miss from VB.NET.
One of those features is whenever I implemented an interface in VB.NET the stub properti... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311856",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: How to programmatically cancel an embedded MsBuild build I'm embedding MSBuild directly into a more complex build tool. The relevant code looks roughly like this:
// assume 'using Microsoft.Build.BuildEngine;'
Engine e = Engine();
BuildPropertyGroup props = new BuildPropertyGroup();
props.SetProperty( "Configuration... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311857",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How do I optimize MySQL's queries with constants? NOTE: the original question is moot but scan to the bottom for something relevant.
I have a query I want to optimize that looks something like this:
select cols from tbl where col = "some run time value" limit 1;
I want to know what keys are being used but whatever ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311873",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: JButton expanding to take up entire frame/container Hey everyone. I'm trying to make a swing GUI with a button and a label on it. im using a border layout and the label ( in the north field ) shows up fine, but the button takes up the rest of the frame (it's in the center field). any idea how to fix this?
A: Or j... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311876",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: What do 'statically linked' and 'dynamically linked' mean? I often hear the terms 'statically linked' and 'dynamically linked', often in reference to code written in C, C++ or C#. What are they, what exactly are they talking about, and what are they linking?
A: There are (in most cases, discounting interpreted code... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311882",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "280"
} |
Q: Java Hashmap and Mutlidimensional array type sig in JSNI? I've got a method JSNI that calls a Java method that take a Hasmap as input.
I've tried
handler.@com.mypackage::myMethod(Ljava/util/Hashmap;)(myHashMap);
handler.@com.mypackage::myMethod(Ljava/util/Hashmap<Ljava/lang/String,Ljava/lang/String>;)(myHashMap);
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311883",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: What is the best (most productive) FLEX IDE? Some requirements:
*
*Step-by-step debugging & Break Points
*View variable values while debugging
*IntelliSense (auto-completion). Ideally done with "smarts" so it only shows you the syntactically valid options to complete something. E.g., Textbox. would trigger me... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311887",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: Regular Expression to get comments in VB.Net source code I have a syntax highlighting function in vb.net. I use regular expressions to match "!IF" for instance and then color it blue. This works perfect until I tried to figure out how to do comments.
The language I'm writing this for a comment can either be if the ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311888",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Best way to stress test a rails web app? Are there any good (preferably free) tools out there?
Can they give accurate estimates that reflect production results when the app goes live?
A: WebLoad is open source:
http://www.webload.org/
A: There's a good summary of tools here.
A: This is definitely not a free solu... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311925",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "25"
} |
Q: Resharper update namespace on all files in project I know i can update my current files namespace to match the directory structure. Can i do this all at once for all files in a project.
A: AFAIK, there is no way to do this OOB.
But, you can update them fairly quickly through the Class View window. Open class view... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311930",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: ViewState, FormView, and Controls How do you (in Visual Studio) compare the controls in the different templates in a formview so you can track down a ViewState error?
A: I know you can use the ChangeMode method on an Asp:DetailsView control to set the mode and therefor which template is used on the client side.
I... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311931",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Javascript Timing I am trying to create a countdown using javascript. I got some code from here and modified it slighly.
<script type="text/javascript">
var c=10, t;
function timedCount() {
document.getElementById('txt').value=c;
c=c-1;
t=setInterval("timedCount()",1000);
}
function stopCount() {
clearInte... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311933",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: What is the difference between equality and equivalence? I've read a few instances in reading mathematics and computer science that use the equivalence symbol ≡, (basically an '=' with three lines) and it always makes sense to me to read this as if it were equality. What is the difference between these two concepts... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311936",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "38"
} |
Q: Apache Redirect Rule Always fires on every request So the following rewrite rules always seem to fire. This has the effect of hiding another domain that I am hosting on the server?
I can't seem to figure out what's wrong and it is time to call in the experts:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^danielhonig.c... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311939",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Make GDB print control flow of functions as they are called How do I make gdb print functions of interest as they are called, indented according to how deep in the stack they are?
I want to be able to say something like (made up):
(gdb) trace Foo* Bar* printf
And have gdb print all functions which begin with Foo or... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311948",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "18"
} |
Q: Unit testing destructors? Is there any good way to unit test destructors? Like say I have a class like this (contrived) example:
class X
{
private:
int *x;
public:
X()
{
x = new int;
}
~X()
{
delete x;
}
int *getX() {return x;}
const int *getX() const {return... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311949",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "19"
} |
Q: Redirecting cout to a console in windows I have an application which is a relatively old. Through some minor changes, it builds nearly perfectly with Visual C++ 2008. One thing that I've noticed is that my "debug console" isn't quite working right. Basically in the past, I've use AllocConsole() to create a console f... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311955",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "41"
} |
Q: Getting a unique ID for a window of another application I'm a newbie Cocoa developer and I'm developing my first application. I want to read a unique identifier from any window of any application - whether it's Cocoa or Carbon. Cocoa applications make their window IDs available to AppleScript (although I'm sure ther... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311956",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: How do I not raise a Python exception when converting an integer-as-string to an int I have some HTML I am trying to parse. There are cases where the html attributes alone are not going to help me identify the row type (header versus data). Fortunately, if my row is a data row then it should have some values that ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311963",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Starting out doing server side things - what languages and techniques to choose? I've been doing html, css and javascript for quite a long time, mostly for my very own enjoyment. I would say I know fairly much, I've created many simple games and apps and experiments with javascript. However there is only so much tha... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311966",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Custom accordion - using each I am trying to create a custom accordion for my page to that display my posts. I have it in list format using HTML and I am trying to create an effect when you click each header to expand to show more information.
But I don't want to have say six blocks of code for six of the <li> eleme... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311970",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Best way to pass JSON from Browser to PHP using Ajax.Request Hi I have a JSON object that is a 2-dimentional array and I need to pass it to PHP using Ajax.Request (only way I know how). ...Right now I manually serialized my array using a js function...and get the data in this format: s[]=1&d[]=3&[]=4 etc. ....
my qu... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311987",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: How do I get a div to float to the bottom of its container? I have floated images and inset boxes at the top of a container using float:right (or left) many times. Now, I need to float a div to the bottom right corner of another div with the normal text wrap that you get with float (text wrapped above and to the lef... | {
"language": "en",
"url": "https://stackoverflow.com/questions/311990",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "312"
} |
Q: What is the most ridiculous pessimization you've seen? We all know that premature optimization is the root of all evil because it leads to unreadable/unmaintainable code. Even worse is pessimization, when someone implements an "optimization" because they think it will be faster, but it ends up being slower, as well... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312003",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "147"
} |
Q: What database schema can I use to save different types of billing data? I have a system that creates an order and that order can be billed to a house account, sent Cash on Delivery (COD), or charged to a credit card. I've created the following tables:
ORDERS
order_id
billingoption_id
BILLINGOPTIONS
billingoption_id... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312006",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Join Tables in .NET DataSet to Display in DataGridView I have two tables in a DataSet in .NET. I want to join them on an ID column. Then I want a DataGridView to display two columns from the first table and one column from the second table.
If it makes it easier, the relation between the two tables is one-to-one.
Ca... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312009",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: .NET/Mono Database Access—Easy column access? I am not sure if I am missing something grotesquely obvious or what, but I can't seem to figure out how to efficiently access tables in a relational database. I am using PostgreSQL for the database server (and Npgsql for its access) and C# with Mono 2.0.
Say I have the ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312013",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Multiline Template Text Control in C# I'd like a textbox that allows for certain text within to be "constant" and uneditable while the rest of the text is editable. For instance, I'd like to define a template like this:
<Name:>[]
<Address:>[] <City>:[]
So that the user could later enter:
<Name:>[Stefan]
<Address:>... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312015",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Use double classes in IE6 CSS? is there any way to make IE6 understand double classes,
say I have a class MenuButton with a color class and possibly a clicked class;
like :
.LeftContent a.MenuButton {..general rules..}
.LeftContent a.MenuButton.Orange {..sets background-image..}
.LeftContent a.MenuButton.Clicked... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312022",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "24"
} |
Q: LINQy way to check if any objects in a collection have the same property value I have a class Agent with a property Id
Given a collection of Agents I need to check if any of them have duplicate Ids.
I am currently doing this with a hash table but am trying to get Linq-ified, what's a good way of doing this?
A: For ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312024",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: Entity Framework pipeline: Expression trees to ESQL to SQL? What is the Entity Framework pipeline like?
What gets translated to SQL, Expression Trees or ESQL, or both?
Is ESQL something an Entity Framework provider needs to implement or translate, or that the framework takes care of?
A: Both Entity SQL and LINQ exp... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312030",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: MultiMap implementation I'm writing a simple IDictionary abstraction in C# that wraps a
Dictionary<K, ICollection<V>>. Basically, it maps multiple values to one key. I can't decide whether to remove a key and its empty list when the last item in a values list is removed, or leave it (to avoid instantiating a new c... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312040",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Pass the value of one control to a Converter to set the width on another control I want to set the width of a TextBlock based on the width of its container, minus the margins set on the TextBlock.
Here is my code:
<TextBlock x:Name="txtStatusMessages"
Width="{Binding ElementName=LayoutRoot,Path=ActualWid... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312044",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "14"
} |
Q: Efficient ISNUMERIC() replacements on SQL Server? So I just spent 5 hours troubleshooting a problem which turned out to be due not only to the old unreliable ISNUMERIC but it looks like my problem only appears when the UDF in which ISNUMERIC is declared WITH SCHEMABINDING and is called within a stored proc (I've got... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312054",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "20"
} |
Q: How do I fix missing git remote details? Some repository clones I have allow me to do this:
% git pull
% git push
But other repositories require me to type:
% git pull origin master
% git push origin master
I think I am missing something in the latter case - does anyone know what is (not) going on here? I am usin... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312055",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: The Best Memory Leak Definition I feel like developers talk about memory leaks but when you ask them what that means many have no idea. To prevent these situations, let's decide on one.
Please no Wikipedia definitions...
What is your best definition of a
memory leak and what is the best way
to prevent them?
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/312069",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "55"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.