text stringlengths 8 267k | meta dict |
|---|---|
Q: How to return rows with 0 count for missing data? I have unevenly distributed data (wrt date) for a few years (2003-2008). I want to query data for a given set of start and end date, grouping the data by any of the supported intervals (day, week, month, quarter, year) in PostgreSQL 8.3.
The problem is that some of t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346132",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "25"
} |
Q: Why Java programs? I've had little exp. with java and since now i've worked with c++. what makes this one more special and preferred?
Moreover I would like to know about the use of System.in classes and parseInt classes.
A: In theory (and sometimes in reality) Java programs also run on multiple platforms, "write on... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346137",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: combining and joining two tables with different no. of columns and same column name I tried to combined tables which is fus_shift and root table into a new table which is final table but it outputs like "ERROR at line 2:
ORA-01789: query block has incorrect number of result columns". I tried also joining table as my... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346138",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: The 'invalid field type' error with TClientDataSets I don't understand I use nested database stuctures with TClientDataSets. I'm new to programming so my lingo is ten-to-one wrong.
My problem is as follows: I defined my database stucture and all the fields of the nested stuctures and then I called the CreatDataSet ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346142",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Debugger Visualizer not working? Have i incorrectly registered it? I have created a debugger visualizer in VS2008. There are two classes i've made, in the same .dll :-
*
*BinaryDataDebuggerVisualizer
*ImageDebuggerVisualizer
The image one works fine (eg. the magnify glass appears in debug mode) but not for t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346154",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: When to use an object instance variable versus passing an argument to the method How do you decide between passing arguments to a method versus simply declaring them as object instance variables that are visible to all of the object's methods?
I prefer keeping instance variables in a list at the end of the Class, bu... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346169",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "104"
} |
Q: Use 32bit "Program Files" directory in msbuild In 64 bit versions of windows, 32 bit software is installed in "c:\program files (x86)". This means you cannot use $(programfiles) to get the path to (32 bit) software. So I need a $(ProgramFiles32) to overcome this in my MSBuild project. I don't want to change the proj... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346175",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "42"
} |
Q: Drawing a user interface based on preferences I want to use the built-in preference system for my xulrunner (Firefox) application. But I can't figure out how to easily drive the user interface based on preferences.
The user can specify a list of home pages, and each home page will show up in a different tab. Becau... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346189",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Castle ActiveRecord - Determining connectionstrings during runtime When using Castle ActiveRecord, is it possible to determine during runtime which connection string to use?
As I understand it, ActiveRecord has to be initialized only once during the application's lifetime and this means that database connection stri... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346198",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: What is your contribution to open source projects? I was always wondering about this seemingly utopic world of open source.
Assuming the vast majority of users here are professional software engineers which need some sort of income source, I assume most of us hold stable, money-making jobs.
So who are the key player... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346207",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Mxml and as3 confusion [simple] I was wondering i can call an as3 function defined in script from mxml code just like this:
<mx:Line x="translateX(xmin);" .. >
<mx:Script>
<![CDATA[
// do some basic math
private function translate ...
If not possible do i have to convert everything to as3 ?
Thanks
A: Y... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346208",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Breaking out unit tests into another project I used to have a Tests folders in my main project where a unit test had this line of code:
Foo foo = new Foo(Environment.CurrentDirectory + @"\XML\FooData.xml" );
I have an XML directory in the Foo project that has a FooData.xml
In the post build event of my projects i h... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346211",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to write a java web service to do remote login? I have two application. I need to do a single signon from application a to application b.
I thinking of using web service. I wonder how do i go about that approach.
Can anyone advise?
A: Assuming these are web applications - you must implement some type of shared ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346225",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: How to create a boolean value? I am totally new to XSLT and can't work out where I am going wrong with the following code.
<xsl:variable name="var" select="boolean('false')"/>
<xsl:if test="$var'">variable is true</xsl:if>
It is always returning true when it is meant to be false. Why?
A: A bit late at this stage ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346226",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "88"
} |
Q: Read file object as string in python I'm using urllib2 to read in a page. I need to do a quick regex on the source and pull out a few variables but urllib2 presents as a file object rather than a string.
I'm new to python so I'm struggling to see how I use a file object to do this. Is there a quick way to convert th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346230",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "31"
} |
Q: Concatenating Environment.CurrentDirectory with back path If i have the following directory structure:
Project1/bin/debug
Project2/xml/file.xml
I am trying to refer to file.xml from Project1/bin/debug directory
I am essentially trying to do the following:
string path = Environment.CurrentDirectory + @"..\..\Project... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346243",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: How to Intercept connection requests? I'm working on an app that needs to intercept when a program tries to connect to an specified IP address and redirects it to another IP.
Is this possible?
I'm using .net for this.
thanks!
A: Your best bet is to use EasyHook project to hook the connect function.
A: It might not... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346263",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Python regex to parse into a 2D array I have a string like this that I need to parse into a 2D array:
str = "'813702104[813702106]','813702141[813702143]','813702172[813702174]'"
the array equiv would be:
arr[0][0] = 813702104
arr[0][1] = 813702106
arr[1][0] = 813702141
arr[1][1] = 813702143
#... etc ...
I'm tryi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346267",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Best threading queue example / best practice I have data that needs to be executed on a certain background thread. I have code coming from all other threads that need to call into this. does anyone have a good tutorial or best practice on having a queue for synchronization to support this threading requirement
A:... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346268",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "38"
} |
Q: Re-usability of controls within .NET MVC I only know a small amount about .NET MVC and haven't used it barely at all so far but I was wondering how would you create re-useable controls that can be spread across different applications?
We have various controls that have been created in external libraries and we refer... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346289",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Setting Default Namespace in Visual Web Developer 2008 Express Hi all I've just started a new project using Visual Web Developer 2008 Express and all my code behinds are not in any namespace. How can I set the default namespace for the project?
In VisualStudioPro it used to be in project properties, the website prop... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346297",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: $id: name of file, date/time creation Exp $ Frequently I come across the following statements in C/C++ source code:
$Id: lzio.c,v 1.24 2003/03/20 16:00:56 roberto Exp $
$Id: file name, version, timestamp, creator Exp $
Have you got any idea which software produces those "signatures"?
A: Keyword substitution in su... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346301",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "9"
} |
Q: What is the difference between a static global and a static volatile variable? I have used a static global variable and a static volatile variable in file scope,
both are updated by an ISR and a main loop and main loop checks the value of the variable. here during optimization neither the global variable nor the vo... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346306",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "28"
} |
Q: Drift when restoring window location and size in WPF I am using the code below to save and restore the window position and size upon restart.
I am observing an upward drift of 28 pixels everytime I execute this code!
Am I reading the wrong values, or am I restoring them incorrectly? Where is the number 28 (size of... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346309",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How to do Joins in Linq using lambdas and the expression tree? I'm trying to do a JOIN in Linq using lambda expressions ... and running into some problems.
I have two entities, Comments and CommentSources. CommentSources are associated to Comments. I have the following code, which does work:
01 IQueryable<Data.C... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346313",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "9"
} |
Q: Xorg loading an image I'm starting to code up my own window manager, and was wondering how to use the xorg api to get from raw image data ( such as the data given by libpng ), into an Xorg Pixmap or something drawable by Xorg?
A: You probably discovered this at some point since 2008, but for the benefit of future r... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346323",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How to add WCF service reference in Visual Studio 2005? What do I need to allow Visual Studio 2005 to add WCF service reference to a project?
I know I should just use Visual Studio 2008, but I'm preparing for a "what-if" situation where the client does not have VS2008 just yet.
A: If you want visual studio 2005 in... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346329",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How do you unit test a class that is dependent on many other classes? I have been hearing that with unit testing we can catch most of the bugs in the code and I really believe that this is true. But my question is in large projects where each class is dependent on many other classes how do you go about unit testing ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346345",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: A student grade practice not working I want to create a program that requests from the user 10 grades and then filters them to pass and fail, then prints the number of passes and fails. I did the program but the output is wrong.
int pass,fail,grade,studentcounter;
pass=0;
fail=0;
grade=0;
studentcounter=10;
while ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346349",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: VB6 (erk) - Inline functions? I use VB6 for an application.
Is it possible to force the compiler to inline a function?
Or is there an add-in that achieves the same thing?
There's a secure part of my code that I want to make difficult to hack, by repeating the code at every point where it is used instead of being lis... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346351",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Meaning of SIZE and RSS values in prstat output Can somebody give some clear explanation of the meaning of the SIZE and RSS values we get from prstat in Solaris?
I wrote a testing C++ application that allocates memory with new[], fills it and frees it with delete[].
As I understood, the SIZE value should be related ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346352",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: How to UDP Broadcast from Linux Kernel? I'm developing a experimental Linux Kernel module, so...
How to UDP Broadcast from Linux Kernel?
A: -13 is -EACCES. Do you have SO_BROADCAST set? I believe sock_sendmsg returns -EACCES if SO_BROADCAST isn't set and you're sending to a broadcast address.
You're looking for <e... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346361",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How can xsl:apply-templates match only templates I have defined? I have several templates that match various nodes in an xml document. If I do just an
<xsl:apply-templates/>
it somehow recursively outputs the text of all the nodes beneath. I just want it to recursively match any template I have defined. How do I do... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346362",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "26"
} |
Q: Why can't yield return appear inside a try block with a catch? The following is okay:
try
{
Console.WriteLine("Before");
yield return 1;
Console.WriteLine("After");
}
finally
{
Console.WriteLine("Done");
}
The finally block runs when the whole thing has finished executing (IEnumerator<T> supports ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346365",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "115"
} |
Q: Building 32-bit Qt Mysql plugin fails with MinGw I'm building a MySQL plugin for Qt 4.4.3 Open Source Edition (Qt documentation), and using command:
cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
make
I manage to b... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346369",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: What's the difference between faking, mocking, and stubbing? I know how I use these terms, but I'm wondering if there are accepted definitions for faking, mocking, and stubbing for unit tests? How do you define these for your tests? Describe situations where you might use each.
Here is how I use them:
Fake: a clas... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346372",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "928"
} |
Q: In Ruby, can you perform string interpolation on data read from a file? In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable foo equals "Ted" and you declare a string "Hello, #{foo}" it interpolates to "Hello, Ted".
I've not been able to f... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346380",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "31"
} |
Q: Sandcastle -> Output to HTML -> Import to MOSS utility I am about to write an import to MOSS utility from Sandcastle HTML output. Before I do this I would just like to ask if anyone knows of a tool that can already accomplish this?
Oh and if the question gets closed for not being programming related, please just lea... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346384",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Drawing a point on the screen I need to read the color of and draw to a calculated point on the screen.
What is the VB.NET equivalent of the old Peek and Poke, or PointSet and PointGet, commands in older versions of VB?
Or in the alternative, is there a way to use a label as a Cursor object, so that it does not eras... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346385",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Default action gets 404 for only one page (asp.net mvc) I test my app only on local cassini web server, and I get strange thing.
One Index page works right in default manner, second shows 404, but when use full version Controller/Index - works normal. Only difference I found is that in first sample there is no slash... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346390",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How do I create a custom validator in VAB that tests two properties at once? In my database, I have a composite unique key constraint (CustomerId, Name) on a entity. I want to test if the unique constraint is upheld before submitting changes to the database. The user can customize the Name attribute on the entity, s... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346391",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Project layout using Wicket Where should I put the .html files in a wicket Application?
my current project layout is as follows:
src/myproject
--classes+ duplicated html files
web
--numerous .html files - previewed
web/img
--resource files such as css/png/js files
i want to avoid putting the html files on dupliat... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346411",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Affordably hosting a web app with a 10GB SQL Server database? One of my clients is developing an ASP.NET application that will be dealing with large amounts of data. The initial size of their SQL Server database will be at least 5GB and could grow to 10GB within a year or so.
Most web hosting companies we've looked... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346423",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Installation problems with django-tagging I am having problems using django-tagging. I try to follow the documentation but it fails at the second step
Once you've installed Django Tagging and want to use it in your Django applications, do the following:
*
*Put 'tagging' in your INSTALLED_APPS setting.
*... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346426",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Bash while read loop breaking early I've been banging my head against for wall for a while with this one.
I want to SSH into a set of machines and check whether they are available (accepting connections and not being used). I have created a small script, tssh, which does just that:
#!/bin/bash
host=$1
timeout=${2:-... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346445",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "32"
} |
Q: MySQL best way to construct this query? I've inherited a database that has a structure with a table of products, a table consisting of some product attributes and another table to build the relationship between these attributes and a given product.
A user can filter the products by a combination of these attributes,... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346446",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Templating Engine to Generate Simple Reports in .NET I'm looking for a free templating engine to generate simple reports. I want some basic features such as :
*
*Ability to Write Loops (with any IEnumerable)
*Passing Variables
*Passing Templates Files (main template, footer, header)
I'll use this to generate ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346449",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Format numbers in django templates I'm trying to format numbers. Examples:
1 => 1
12 => 12
123 => 123
1234 => 1,234
12345 => 12,345
It strikes as a fairly common thing to do but I can't figure out which filter I'm supposed to use.
Edit: If you've a generic Python way to do this, I'm happy adding a formatt... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346467",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "193"
} |
Q: Web Part Feature and Reading XML File I have deployed a custom Web Part as a Feature. I used STSDEV to create the Feature and supporting config files. I ran into some problems trying to add a simple XML file to contain values that I need to read. Where do I place the XML file within the Feature project and what do I... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346495",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: C Pointer confusion I want to store a string in memory and read it later:
$$->desc.constant->base.id = (char*)malloc(200);
sprintf($$->desc.constant->base.id, "%f", $1);
printf("->%s\n", $$->desc.constant->base.id); //LINE A
printf("->%i\n", $$->desc.constant); //LINE B
//SOME OTHER CODE
//Then, later on in a fun... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346499",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: What the best way to print the contents of the WPF web browser? We use a modified version of the IE engine (the COM version in a C# wrapper) to display a lot of the formatted content in our application. The problem, however, is you don't have a lot of control of any printout of such documents. For example, you can... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346506",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: SQL query of multi-member file on AS400 On AS400 in interactive SQL in a 5250 session,
select * from myfile
returns rows from one member only when myfile has more than one member.
How can I get rows from a specific member?
Important: in the end I'd like to do this over JDBC with jt400 so really I want a solution th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346512",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "19"
} |
Q: Google Map API and Links I am trying to add a link into the pop-up text bubble of a marker in Google Maps through the API. I have successfully run the below code:
echo '<marker lat="43.91892" lng="-78.89231" html="Albertus Magnus College<br>Link to Admissions" label="Albertus Magnus College" />';
But once I ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346516",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How do I compile an Expression Tree into a callable method, C#? I have an expression tree I have created by parsing an Xml using the expression class in C#. See this question.
I only have Add, Subtract, Divide, Multiply, Parameters, And and Or in my Expression Tree.
Is there a way to convert this ExpressionTree into... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346523",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: UTF8 problem with MySQL 5 I'm migrating my WordPress blog and phpBB Forum into a new hosting server. I am using phpMyAdmin to import the SQL script from the database in the previous site.
When I open the .sql script with Kate, it says it uses UTF8 as encoding. When I import the sql in the new server, I have the opt... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346531",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Difference between a Structure and a Union Is there any good example to give the difference between a struct and a union?
Basically I know that struct uses all the memory of its member and union uses the largest members memory space. Is there any other OS level difference?
A: Here's the short answer: a struct is a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346536",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "458"
} |
Q: Using jQuery, how to locate an element when the Name and Value are known Thanks for reading this
I thought I could use find(), but couldn't make it work. I know I can add IDs or classnames, but would like to know how with the current markup.
Thanks
Here is the HTML
<input name="keywordCheckbox" type="checkbox" value... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346542",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "14"
} |
Q: Best way to cancel a slow loading remote JS call I have a remote JS that must appear in the head of the document. If the server is slow to respond or inaccessible, obviously this slows or prevents the page from loading. I have been searching for a simple way to set a limit of say 3 seconds (probably less) for it t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346544",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How to set the name of the file when streaming a Pdf in a browser? Not sure exactly how to word this question ... so edits are welcomed! Anyway ... here goes.
I am currently use Crystal Reports to generated Pdfs and just stream the output to the user. My code looks like the following:
System.IO.MemoryStream stream... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346546",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "10"
} |
Q: How can one turn regular quotes (i.e. ', ") into LaTeX/TeX quotes (i.e. `', ``'') Given a document written with normal quotes, e.g.
Ben said "buttons, dear sir".
I replied "Did you say 'buttons'?" to him.
What ways can one turn these sort of things into LaTeX quotes, with the appropriate semantics. i.e.
Ben said ``... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346567",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: How to query for 10 most recent items or items from last month, whichever is more? On my blog, I want to display the all the posts from the last month. But if that is less than 10 posts, I want to show the ten most recent posts (in other words, there should never be less than 10 posts on the front page). I am wond... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346568",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Relocatable symbols in ELF format (assembly language) We are developing a port of the GNU Assembler for a client architecture.
Now the problem being faced is that:
If an immediate operand to an instruction is an expression involving more than one relocatable symbols, how is it handled in output file in elf format. W... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346572",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "10"
} |
Q: Creating a new database (.mdb) with ADO.NET How can I create a empty .mdb file? I'm using ADO.NET and C#. Thanks!
A: Copy a pre-existing .mdb file is the best way.
The same is true for most of the other filebased database formats that ADO.NET can connect to, such as Excel files. Since a file based database syste... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346581",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: C# - How can I make sure all my structures are initialized? I am writing an application in C# which is going to do extensive calculations. Everything is going around basic struct - Value. It is basically double with some additional parameters (accuracy etc.)
It has to be a struct, because there will be too many of t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346589",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: What happens in WCF to methods with IsOneWay=true at application termination I have a client application that once in while notifies about its progress a service.
The method call to the service is marked with IsOneWay=true, because the notification doesn't need any return value and I don't want to delay.
The client... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346594",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: How do you exit from a void function in C++? How can you prematurely exit from a function without returning a value if it is a void function? I have a void method that needs to not execute its code if a certain condition is true. I really don't want to have to change the method to actually return a value.
A: Use a ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346613",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "182"
} |
Q: What are unit tests and why should I care? Okay, I develop web applications in PHP and JavaScript and a lot of times here on Stack Overflow I have seen the word unit test passing by, but nowhere on the website have I been able to found a satisfactory answer to what exactly a unit test is.
So what are unit tests and... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346620",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "18"
} |
Q: Opinions on type-punning in C++? I'm curious about conventions for type-punning pointers/arrays in C++. Here's the use case I have at the moment:
Compute a simple 32-bit checksum over a binary blob of data by treating it as an array of 32-bit integers (we know its total length is a multiple of 4), and then summing... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346622",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "23"
} |
Q: How do I Get the Autocomplete Control script side with a Script control (ASP.Net) Problem
How do I capture and assign the events on an Ajax Toolkit autocomplete control using a script control on the script file?
Explanation
I basically created a script control to combine a textbox and an autocomplete control so that... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346632",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How do I do a JavaScript redirect in ASP.Net MVC? The following code will generate a link to the page I want to get to.
<%= Html.ActionLink(image.Title, image.Id.ToString(), "Image") %>
The following code will cause the correct url to be rendered on the page.
<%= Url.Action("Index", "Image", new { id = image.Id })%... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346644",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: On using Terracotta as a persistence solution Would it be a good idea to use Terracotta as a persistence solution (replacing a database)? I'm specifically wondering about data integrity issues and support for transactional systems.
A: Terracotta is Java only. If it's OK for you to be locked into this technology, wi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346647",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "14"
} |
Q: How can I have over loaded constructor in Php5? I have two constructor :
function clsUsagerEmailUserName($nickName, $email)
{
$this->nickName = $nickName;
$this->email = $email;
}
function clsUsagerEmailUserName($email)
{
$this->email = $email;
}
But this is no... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346649",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Is there a "nice" way to deal with reassembling multicasts from multiple sources? I'm currently reworking our existing proprietary socket wrapper code to use boost asio so that it can do some of the heavy lifting for us. Perhaps the most complex area of our existing code is the multicast handling code. The code a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346650",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: What are the most common SQL anti-patterns? All of us who work with relational databases have learned (or are learning) that SQL is different. Eliciting the desired results, and doing so efficiently, involves a tedious process partly characterized by learning unfamiliar paradigms, and finding out that some of our m... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346659",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "249"
} |
Q: Visual Studio and add-in unloading When I remove an add-in from Visual Studio's add-in menu, it doesn't get unloaded from memory. Does anyone know if I can write some code for my add-in (in C#) that would force this unloading. Is this even possible, or do I have to restart VS?
A: If your DLL is written in managed c... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346674",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: writing bash script to change text and write to a log I have written a very simple bash script to help me migrate from dev to staging. What it does is it deletes all files in staging, copies the files over from dev to stage.
However, the config.inc.php file needs to have the first instance of "dev" to be changed to... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346692",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: "No MAKE-LOAD-FORM" error with OpenMCL Common Lisp I'm trying to run the ray tracing code form Paul Graham's ANSI Common Lisp on OS X using SLIME with OpenMCL (well, now called CCL). In that code, there's a constant defined whose value is a structure, and when I call either slime-compile-and-load-file or slime-compi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346695",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: Can the "using" declaration be used with templates? Is it possible to use the "using" declaration with template base classes? I have read it isn't here but is that because of a technical reason or is it against the C++ standard, and does it apply to gcc or other compilers? If it is not possible, why not?
Example co... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346697",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: Problem with images and stylesheet while using urlrewriter I'm using the urlrewriter.net as recommended in several questions in here.
I'm having difficulties with displaying images and with the stylesheet.
I read ScottGu's Blog (again as recommended in here) and in the end he does reffer to this problem and states t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346702",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: PHP debug_backtrace in production code to get information about calling method? Is there a compelling reason to not use debug_backtrace for the sole purpose of determining the calling method's class, name, and parameter list? Not for debugging purposes. It has the word "debug" in the function name, which makes me f... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346703",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "35"
} |
Q: Project Euler #219 I'm trying to do project Euler number 219 but am failing to get a grasp of it. I'm trying to use Python which according to project Euler should be able to do it within a minute! This leads me to think that they can't possibly want me to compute each individual bitstring since that would be too slo... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346708",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Get access to ForeignKey objects at parent save in Django I am trying to make a combined image of all images added to a modell in django with inline editing and a ForeignKey. Ive got these models (simplified):
class Modell(models.Model):
title = models.CharField('beskrivelse', max_length=200)
slug = models.S... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346718",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: What is the best way to generate a Rails app using edge? Currently when I want to create a Rails application using edge I first just run...
rails appname
Then I...
rake rails:freeze:edge
Then I delete all of the folders but the vendor folder which contains the frozen edge. Once that's done I run (from the root of ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346720",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: LINQ for Java tool Would a LINQ for java be a useful tool? I have been working on a tool that will allow a Java object to map to a row in a database.
*
*Would this be useful for Java
programmers?
*What features would be
useful?
A: For a more general approach to the issue, consider using Querydsl.
It provid... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346721",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "40"
} |
Q: Is it more efficient to use "import " or "from import "? Say I only needed to use findall() from the re module, is it more efficient to do:
from re import findall
or
import re
Is there actually any difference in speed/memory usage etc?
A: There is no difference, except for what names from re are visible in you ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346723",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: How do you extract a value from a field of the associated item in a custom Sharepoint workflow? I'm creating a custom WSS workflow in Visual Studio 2008 and have a 'create task' activity. When creating the task I want to be able to reference some of the field values from the list item that is associated with the wor... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346729",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to work with pointer to pointer to structure in C? I want to change member of structure under double pointer. Do you know how?
Example code
typedef struct {
int member;
} Ttype;
void changeMember(Ttype **foo) {
//I don`t know how to do it
//maybe
*foo->member = 1;
}
A: Try
(*foo)->member = 1;
Yo... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346730",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "17"
} |
Q: How to create a non OwnerDraw Button in .NET? I'm creating a plugin to a software that skins the form I created. However, the button are not skin based on them and a standard gray button is shown. Asking on the software forum pointed me that .NET forms control are owner-draw and therefor my button won't redraw with ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346750",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: How do spell checkers work? I need to implement a spell checker in C. Basically, I need all the standard operations... I need to be able to spell check a block of text, make word suggestions and dynamically add new words to the index.
I'd kind of like to write this myself, tho I really don't know where to begin.
A:... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346757",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "25"
} |
Q: How to find "equivalent" texts? I want to find (not generate) 2 text strings such that, after removing all non letters and ucasing, one string can be translated to the other by simple substitution.
The motivation for this comes from a project I known of that is testing methods for attacking cyphers via probability d... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346760",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Garbage Collecting objects which keep track of their own instances in an internal Map In the constructor of my class, I map the current object (this), along with its key (a string entered as a parameter in the constructor) into a static LinkedHashMap so I can reference the object by the string anywhere I might need ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346762",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Dealing with timezones in PHP Some issues with timezones in PHP have been in the back of my mind for a while now, and I was wondering if there are better ways to handle it than what I'm currently doing.
All of the issues revolve around reformating database stored dates:
When dealing with a site that has to support m... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346770",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "20"
} |
Q: Adding negative and positive binary? X = 01001001 and Y = 10101010
If I want to add them together how do I do that? They are "Two's Complement"...
I have tried a lots of things but I am not quite sure I am getting the right answer since there seems to be different type of rules.
Just want to make sure it is correc... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346774",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: How to use full-page background image leaving space for binding? In Latex how can you make the background image to occupy the whole sheet on every page except a certain stripe on the inner side of each page? I can't figure it out.
I have a background image I'd like to be seen in whole on each page after printing/bin... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346775",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: how to dynamically check number of arguments of a function in php how can I check at runtime home many parameters a method or a function have in PHP.
example
class foo {
function bar ( arg1, arg2 ){
.....
}
}
I will need to know if there is a way to run something like
get_func_arg_number ( "foo", "bar"... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346777",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "11"
} |
Q: Protocol for remote process management In short: Is there any known protocol for remote process management?
I have a system that contains several applications, each has it's own computer in a local network. When the applications are up and running, they communicate without any problems.
What I'm interested in is a p... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346778",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: best way to check performance of web application what is the best tool (open or commercial) currently available, that lets me send customized requests to a web server and get back a response to check the performance?
i will be sending it a load of more than 20K per second, but i need to get numbers for each call ma... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346784",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: difference between baseline and benchmark in performance of an application what is a baseline and what is a benchmark? what is the best definition for these and how do you baseline a set of numbers and benchmark another set?
A: Interesting definitions from SPR (Software Productivity Research)
Baseline and benchmar... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346788",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "10"
} |
Q: JSON to string in Prototype The people on this website seem to know everything so I figured I would ask this just in case:
Is there a method/function in prototype that converts a JSON object to a string that you can store in a cookie?
If not,..i'll just use another external library.
Thanks,
Andrww
A: Sure there is:... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346793",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Not Detecting Flash 10: World's Most Widespread Web Video Bug? Here's the Question: What is the best way to make sure that your requirement for Flash Version "x" on a site will properly detect presence of later-version Adobe Flash Player Version "10" (or "1y" for that matter)?
Now here's the mystery: Why are so many... | {
"language": "en",
"url": "https://stackoverflow.com/questions/346794",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.