instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
How does gcc implement stack unrolling for C++ exceptions on linux? In particular, how does it know which destructors to call when unrolling a frame (i.e., what kind of information is stored and where is it stored)?
| stackexchange/codereview |
So this post talked about how to actually implement url rewriting in an ASP.NET application to get "friendly urls". That works perfect and it is great for sending a user to a specific page, but does anyone know of a good solution for creating "Friendly" URLs inside your code when using one of the tools referenced?
For... | stackexchange/codereview |
Is there any centralized repository of useful Objective-C / Cocoa libraries as there is for Perl, Ruby, Python, etc.?
In building my first iPhone app, I'm finding myself implementing some very basic functions that would be just a quick "gem install" away in Ruby.
| stackexchange/codereview |
I have a third-party app that creates HTML-based reports that I need to display. I have some control over how they look, but in general it's pretty primitive. I can inject some javascript, though. I'd like to try to inject some jQuery goodness into it to tidy it up some. One specific thing I would like to do is to ... | stackexchange/codereview |
I'm using jmockit for unit testing (with TestNG), and I'm having trouble using the Expectations class to mock out a method that takes a primitive type (boolean) as a parameter, using a matcher. Here's some sample code that illustrates the problem.
/******************************************************/
import static ... | stackexchange/codereview |
When setting up foreign keys in SQL Server, under what circumstances should you have it cascade on delete or update, and what is the reasoning behind it?
This probably applies to other databases as well.
I'm looking most of all for concrete examples of each scenario, preferably from someone who has used them successful... | stackexchange/codereview |
I'm migrating a Hibernate application's cache from EHCache to JBoss TreeCache.
I'm trying to find how to configure the equivalent to maxElementsOnDisk to limit the cache size on disk, but I couldn't find anything similar to configure in a FileCacheLoader with passivation activated.
Thanks
| stackexchange/codereview |
I've got a program that periodically updates its database schema. Sometimes, one of the DDL statements might fail and if it does, I want to roll back all the changes. I wrap the update in a transaction like so:
BEGIN TRAN;
CREATE TABLE A (PKey int NOT NULL IDENTITY, NewFieldKey int NULL, CONSTRAINT PK_A PRIMARY KEY ... | stackexchange/codereview |
What are the typical average bytes-per-character rates for different unicode encodings in different languages?
E.g. if I wanted the smallest number of bytes to encode some english text, then on average UTF-8 would be 1-byte per character and UTF-16 would be 2 so I'd pick UTF-8.
If I wanted some Korean text, then UTF-16... | stackexchange/codereview |
I'm writing some xlst file which I want to use under linux and Windows.
In this file I use node-set function which declared in different namespaces for MSXML and xsltproc ("urn:schemas-microsoft-com:xslt" and "http://exslt.org/common" respectively). Is there any platform independent way of using node-set?
| stackexchange/codereview |
Okay so im working on this php image upload system but for some reason internet explorer turns my basepath into the same path, but with double backslashes instead of one; ie:
C:\\Documents and Settings\\kasper\\Bureaublad\\24.jpg
This needs to become C:\Documents and Settings\kasper\Bureaublad\24.jpg.
| stackexchange/codereview |
I was happily using Eclipse 3.2 (or as happy as one can be using Eclipse) when for a forgotten reason I decided to upgrade to 3.4. I'm primarily using PyDev, Aptana, and Subclipse, very little Java development.
I've noticed 3.4 tends to really give my laptop a hernia compared to 3.2 (vista, core2duo, 2G). Is memory usa... | stackexchange/codereview |
When I start Tomcat (6.0.18) from Eclipse (3.4), I receive this message (first in the log):
WARNING:
[SetPropertiesRule]{Server/Service/Engine/Host/Context}
Setting property 'source' to
'org.eclipse.jst.jee.server: (project name)'
did not find a matching property.
Seems this message does not have any severe i... | stackexchange/codereview |
Is there a (cross-platform) way to get a C FILE* handle from a C++ std::fstream ?
The reason I ask is because my C++ library accepts fstreams and in one particular function I'd like to use a C library that accepts a FILE*.
| stackexchange/codereview |
I have a report that I built for a client where I need to plot x 0-100, y 0-100. Let's imagine I have these points:
0, 0
2, 24
50, 70
100, 100
I need to represent these as a smoothed line chart, as the application of it is a dot gain graph for printing presses.
Here's the problem. The line draws fine from 100... | stackexchange/codereview |
In my Servlet I would like to access the root of the context so that I can do some JavaScript minifying.
It would be possible to do the minify as part of the install process but I would like to do it on Servlet startup to reduce the implementation cost.
Does anyone know of a method for getting the context directory so ... | stackexchange/codereview |
App needs to run on the .Net Compact Framework v.3.5. Video can be any format, but I do need to be able to know when it's finished playing, so I can start another one.
I'm hoping for a method that doesn't involve unmanaged code, if possible.
| stackexchange/codereview |
I am re-factoring some code and am wondering about the use of a lock in the instance constructor.
public class MyClass {
private static Int32 counter = 0;
private Int32 myCount;
public MyClass() {
lock(this) {
counter++;
myCount = counter;
}
}
}
Please confirm... | stackexchange/codereview |
I'm looking for a quality WinForms component that supports syntax highlighting, code folding and the like. The key criteria are:
Stability
Value (price)
Ability to easily customize syntax to highlight
Light weight
| stackexchange/codereview |
What is the Java analogue of .NET's XML serialization?
| stackexchange/codereview |
I've created a forum, and we're implementing an apc and memcache caching solution to save the database some work.
I started implementing the cache layer with keys like "Categories::getAll", and if I had user-specific data, I'd append the keys with stuff like the user ID, so you'd get "User::getFavoriteThreads|1471". Wh... | stackexchange/codereview |
Does the VFW (Video For Windows) API support Alpha Channel Transparency? I want to be able to export video with Alpha channel information. How can I do this in VC6?
| stackexchange/codereview |
Name the design considerations in deciding between use of a singleton versus a static class. In doing this, you're kind of forced to contrast the two, so whatever contrasts you can come up with are also useful in showing your thought process! Also, every interviewer likes to see illustrative examples. :)
| stackexchange/codereview |
How do I do backups in MySQL?
I'm hoping there'll be something better than just running mysqldump every "x" hours.
Is there anything like SQL Server has, where you can take a full backup each day, and then incrementals every hour, so if your DB dies you can restore up to the latest backup?
Something like the DB log, ... | stackexchange/codereview |
How do I get Asterisk to forward incoming calls based on matching the incoming call number with a number to forward to? Both numbers are stored in a MySQL database.
| stackexchange/codereview |
As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?
| stackexchange/codereview |
How do i represent CRLF using Hex in C#?
| stackexchange/codereview |
It is obviosly some Perl extensions. Perl version is 5.8.8.
I found Error.pm, but now I'm looking for Core.pm.
While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks.
And finally, after I built everything, running:
./Build install
gives me:
Running make instal... | stackexchange/codereview |
default is 49
how to edit to higher?
| stackexchange/codereview |
I'm wondering what is the quickest and most reliable way to forward mail from an IMAP account.
My university does not allow our student-mailbox to forward to a private e-mail account (everybody uses either Gmail or Hotmail here). It's a political thing, not technical. We do have IMAP access to the mailbox. I would like... | stackexchange/codereview |
I'm just starting to design some embedded devices, and am looking for resources.
What I want to be able to do is to connect a GPS receiver to a lightweight SBC or mini-ITX, x86-based computer, and track a remote-controlled vehicle's location/progress.
Ideally, this could morph into building some hobby, semi-autonomous ... | stackexchange/codereview |
Ok, so I got my extender working on a default.aspx page on my website and it looks good. I basically copied and pasted the code for it into a user control control.ascx page. When I do this I completely loose the functionality (just shows the target control label and no dropdown, even upon hover). Is there any reason... | stackexchange/codereview |
Why does C++ Builder 6 always compile all files?
I make some changes on one file but BCB 6 compiles all files when I start the app. Any idea? I use Windows XP SP2.
| stackexchange/codereview |
How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005?
| stackexchange/codereview |
When I first heard about StackOverflow, and heard that it was being built in ASP.Net MVC, I was a little confused. I thought ASP.Net was always an example of an MVC architecture. You have the .aspx page that provides the view, the .aspx.vb page that provides the controller, and you can create another class to be the ... | stackexchange/codereview |
Imagine this directory structure:
app/
__init__.py
sub1/
__init__.py
mod1.py
sub2/
__init__.py
mod2.py
I'm coding mod1, and I need to import something from mod2. How should I do it?
I tried from ..sub2 import mod2, but I'm getting an "Attempted relative import in non-package".
I google... | stackexchange/codereview |
We have a requirement to build a tool for users in an Intranet scenario.
The tool should check how much percentage of the Mailbox Quota (set in Active Directory) is being used.
Currently, they can check their Folder size using Outlook 2003 but this does not show the Quota Limit set for them or the percentage being use... | stackexchange/codereview |
What's the best way in c# to determine is a given QFE/patch has been installed?
| stackexchange/codereview |
I need to use XmlRpc in C++ on a Windows platform. Despite the fact that my friends assure me that XmlRpc is a "widely available standard technology", there are not many libraries available for it. In fact I only found one library to do this on Windows, (plus another one that claims "you'll have to do a lot of work t... | stackexchange/codereview |
I took a data structures class in C++ last year, and consequently implemented all the major data structures in templated code. I saved it all on a flash drive because I have a feeling that at some point in my life, I'll use it again. I imagine something I end up programming will need a B-Tree, or is that just delusio... | stackexchange/codereview |
I have a set of tree objects with a depth somewhere in the 20s. Each of the nodes in this tree needs access to its tree's root.
A couple of solutions:
Each node can store a reference to the root directly (wastes memory)
I can compute the root at runtime by "going up" (wastes cycles)
I can use static fields (but thi... | stackexchange/codereview |
What is the best way to setup one Linux box to listen on its serial port for incoming connections? I've done a lot of googling but I can't find the right combination of commands to actually get them to talk!
My main objective is to provide a serial interface to running instances of kvm/qemu VMs. They currently only hav... | stackexchange/codereview |
I keep hearing that div tags should be used for layout purposes and not table tags. So does that also apply to form layout? I know a form layout is still a layout, but it seems like creating form layouts with divs requires more html and css. So with that in mind, should forms layouts use div tags instead?
| stackexchange/codereview |
I keep getting compiler errors when I try to access flashVars in an AS3 class.
Here's a stripped version of the code:
package myPackage {
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.display.Sprite;
public class myClass {
public function CTrafficHandler() {
var myVar:Strin... | stackexchange/codereview |
Is there some way to hide the browser toolbar / statusbar etc in current window via javascript? I know I can do it in a popup with window.open() but I need to do it this way. Is it possible at all?
| stackexchange/codereview |
There must be a generic way to transform some hierachical XML such as:
<element1 A="AValue" B="BValue">
<element2 C="DValue" D="CValue">
<element3 E="EValue1" F="FValue1"/>
<element3 E="EValue2" F="FValue2"/>
</element2>
...
</element1>
into the flattened XML (html) picking up selected attributes ... | stackexchange/codereview |
I work at a college and have been developing an ASP.NET site with many, many reports about students, attendance stats... The basis for the data is an MSSQL server DB which is the back end to our student management system. This has a regular maintenance period on Thursday mornings for an unknown length of time (dependen... | stackexchange/codereview |
Do you think ASP.NET MVC will ever have a significant share of the Microsoft web development market? Or will it be more like 10-15% of the market?
| stackexchange/codereview |
I was wondering what people thought of using properties as object initializers in C#. For some reason it seems to break the fundamentals of what constructors are used for.
An example...
public class Person
{
string firstName;
string lastName;
public string FirstName
{
get { return firstName; }
... | stackexchange/codereview |
I've got my Rails (2.1) app setup to send email via Gmail, however whenever I send an email no matter what I set the from address to in my ActionMailer the emails always come as if sent from my Gmail email address. Is this a security restriction they've put in place at Gmail to stop spammers using their SMTP?
Note: I'v... | stackexchange/codereview |
I am creating a Rails plugin and it is dynamically adding a method to a Helper. I just want to ensure that the method is added. How can I see if the Helper responds to the method name?
| stackexchange/codereview |
Grails vs Rails. Which has better support? And which one is a better choice to develop medium size apps with? Most importantly which one has more plug-ins?
| stackexchange/codereview |
I'm looking to locate a good resource (book or otherwise) on safety critical systems development techniques/methodologies, especially something that will cover both hardware and software . I have a sound working knowledge of C/C++, so even if it is just code on SourceForge etc I would still appreciate a link to it to h... | stackexchange/codereview |
I am unable to load any existing projects after starting VS2008. When I try to open an existing project VS2008 will crash. It looks like it is crashing when trying to load a floating window in VS but I cant tell which one.
When I launch the debugger on the crashed instance I get the following message which is not very ... | stackexchange/codereview |
How can I restore a mysql database that was dropped using a "drop database" command? I have access to binary logs which should make this type of rollback possible.
| stackexchange/codereview |
What is the best way to vertically center the content of a div when the height of the content is variable. In my particular case, the height of the container div is fixed, but it would be great if there were a solution that would work in cases where the container has a variable height as well. Also, I would love a sol... | stackexchange/codereview |
I remember watching a webcast from Mark Russinovich showing the sequence of keyboard keys for a user initiated kernel dump. Can somebody refresh my memory on the exact order of the keys.
Please note this is for XP.
| stackexchange/codereview |
I'd like to encourage our users of our RCP application to send the problem details to our support department. To this end, I've added a "Contact support" widget to our standard error dialogue.
I've managed to use URI headers to send a stacktrace using Java 6's JDIC call: Desktop.getDesktop().mail(java.net.URI). This wi... | stackexchange/codereview |
I need to query existing rules, as well as being able to easily add and delete rules. I haven't found any API's for doing this. Is there something that I'm missing?
The closest I've come to a solution is using iptables-save | iptables-xml for querying and manually calling the iptables command itself to add/delete rules... | stackexchange/codereview |
I'm trying to use cygwin as a build environment under Windows. I have some dependencies on 3rd party packages, for example, GTK+.
Normally when I build under Linux, in my Makefile I can add a call to pkg-config as an argument to gcc, so it comes out like so:
gcc example.c `pkg-config --libs --cflags gtk+-2.0`
This ... | stackexchange/codereview |
Let's say I have this code:
if (md5($_POST[$foo['bar']]) == $somemd5) {
doSomethingWith(md5($_POST[$foo['bar']]);
}
I could shorten that down by doing:
$value = md5($_POST[$foo['bar']];
if ($value == $somemd5) {
doSomethingWith($value);
}
But is there any pre-set variable that contains the first or second conditi... | stackexchange/codereview |
I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original folder with a symlink to the new folder, but it seems that if I continued with that practice it... | stackexchange/codereview |
I would like to know what kind of tool you use for writing your specifications. I think it's essential to use a tool that supports some kind of plain text format so that one can control the specification with a source control system like SVN. For the specification as for the code as well, it's important to have a histo... | stackexchange/codereview |
So far I had "designed" my app-icon in the Visual-Studio-Editor. 16-Colors, 4kB.
Now someone created a more sophisticated and up-to-date app-icon for me, which results in a filesize of about 250kB.
Problem: A user reported, that win2000 is complaining, because it is not able to digest this amount of data for an icon.
... | stackexchange/codereview |
I am trying to use a stringstream object in VC++ (VStudio 2003) butI am getting an error when I use the overloaded << operator to try and set some manipulators.
I am trying the following:
int SomeInt = 1;
stringstream StrStream;
StrStream << std::setw(2) << SomeInt;
This will not compile (error C2593: 'opera... | stackexchange/codereview |
Am looking for a regression test framework where I can add tests to.. Tests could be any sort of binaries that poke an application..
| stackexchange/codereview |
Currently IIS sends an expires http header of yesterday minus 1 hour on ASP.NET pages. How do I change this to 60 seconds in the further instead?
| stackexchange/codereview |
For example:
int a = 12;
cout << typeof(a) << endl;
Expected output:
int
| stackexchange/codereview |
As a part of database maintenance we are thinking of taking daily backups onto an external/firewire drives. Are there any specific recommended drives for the frequent read/write operations from sql server 2000 to take backups?
| stackexchange/codereview |
This may be a no-brainer for the WPF cognoscenti, but I'd like to know if there's a simple way to put text on the WPF ProgressBar. To me, an empty progress bar looks naked. That's screen real estate that could carry a message about what is in progress, or even just add numbers to the representation. Now, WPF is all abo... | stackexchange/codereview |
I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the requirements to remove the leading zeroes from a particular field, which is a simple VARCHAR(10) field. So, for example, if the field contains '00001A', the SELECT statement needs to return the data as '1A'.
Is ther... | stackexchange/codereview |
Is it possible to get gdb or use some other tools to create a core dump of a running process and it's symbol table? It would be great if there's a way to do this without terminating the process.
If this is possible, what commands would you use? (I'm trying to do this on a Linux box)
| stackexchange/codereview |
I'm working on several distinct but related projects in different programming languages. Some of these projects need to parse filenames written by other projects, and expect a certain filename pattern.
This pattern is now hardcoded in several places and in several languages, making it a maintenance bomb. It is fairly e... | stackexchange/codereview |
I'm looking to grab cookie values for the same domain within a Flash movie. Is this possible?
Let's see I let a user set a variable foo and I store it using any web programming language. I can access it easily via that language, but I would like to access it via the Flash movie without passing it in via printing it w... | stackexchange/codereview |
Looking for C# class which wraps calls to do the following:
read and write a key value
read & write a key entry
enumerate the entries in a key. This is important. For example, need to list all entries in:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources
(I scanned through some codeproject.com registry classe... | stackexchange/codereview |
I'm working on a PHP application that links into the Protx VSP Direct payment gateway. To handle "3D Secure" requests from the credit card processing company, I need to forward the user to a different website, mimicking a form that has been posted. I'm trying to use the cURL libraries, but seem to have hit a problem. M... | stackexchange/codereview |
is there a way to add an existing classic ASP webapp into a solution in VS? The application is around 4000 files large and currently maintained outisde Visual Studio.
| stackexchange/codereview |
What is the difference between the AddRange and Concat functions on a generic List? Is one recommended over the other?
| stackexchange/codereview |
public static void main(String[] args) {
List<? extends Object> mylist = new ArrayList<Object>();
mylist.add("Java"); // compile error
}
The above code does not allow you to add elements to the list and wild cards can only be used as a signature in methods, again not for adding but only for accessing.
In th... | stackexchange/codereview |
I would like to know how to infer coercions (a.k.a. implicit conversions) during type inference. I am using the type inference scheme described in Top Quality Type Error Messages by Bastiaan Heeren, but I'd assume that the general idea is probably the same in all Hindley-Milner-esque approaches.
It seems like coercion ... | stackexchange/codereview |
I have a string that contains the representation of a date. It looks like:
Thu Nov 30 19:00:00 EST 2006
I'm trying to create a Date object using SimpleDateFormat and have 2 problems.
1.) I can't figure out the pattern to hard-code the solution into the SimpleDateFormat constructor
2.) I can't find a way I could parse... | stackexchange/codereview |
I have the following code:
SELECT <column>, count(*)
FROM <table>
GROUP BY <column> HAVING COUNT(*) > 1;
Is there any difference to the results or performance if I replace the COUNT(*) with COUNT('x')?
(This question is related to a previous one)
| stackexchange/codereview |
In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up quik, with the exception of images, they really lag significantly. Any suggestions optimization for image serving?
Here is my server.xml:
<Service name="Catalina">
<Connector port="8009" protocol="AJP/1.3" />
<Conn... | stackexchange/codereview |
I have just inherited a server application, however it seems that the only copy of the database is corrupt and the working version is gone, so is it possible to find what queries the application is running so I can try to rebuild the tables?
Edit: I have some files with no extensions that I are named the same as the da... | stackexchange/codereview |
I am using Microsoft Access 2007 to move and massage some data between two SQL Servers. Yesterday everything was working correctly, I was able to run queries, update data, and delete data.
Today I opened up the Access database to finish my data migration and am now receiving the following message when I try to run som... | stackexchange/codereview |
Anyone happen to have a sample script for recursing a given directory in a filesystem with Powershell? Ultimately what I'm wanting to do is create a script that will generate NSIS file lists for me given a directory. Something very similar to what was done here with a BASH script.
| stackexchange/codereview |
Is it possible to set code behind a resource dictionary in WPF. For example in a usercontrol for a button you declare it in XAML. The event handling code for the button click is done in the code file behind the control. If I was to create a data template with a button how can I write the event handler code for it's but... | stackexchange/codereview |
What do you find is the optimal setting for mysql slow query log parameter, and why?
| stackexchange/codereview |
When I place a control on a tabpage in Silverlight the control is placed ~10 pixels down and ~10 pixels right. For example, the following xaml:
<System_Windows_Controls:TabControl x:Name=TabControlMain Canvas.Left="0" Canvas.Top="75" Width="800" Height="525" Background="Red" HorizontalContentAlignment="Left" VerticalCo... | stackexchange/codereview |
I have a link on a long HTML page. When I click it, I wish a div on another part of the page to be visible in the window by scrolling into view.
A bit like EnsureVisible in other languages.
I've checked out scrollTop and scrollTo but they seem like red herrings.
Can anyone help?
| stackexchange/codereview |
What I currently do is I link the project to another location and give it the same name, then check the box where it says "Branch after share."
And then I would Check out the shared project and work off it. And finally merge with the original project.
This works okay, but it feels very clunky: I have multiple instance... | stackexchange/codereview |
So I'm getting really sick of E*TRADE and, being a developer, would love to find an online broker that offers an API. It would be great to be able to write my own trading tools, and maybe even modify existing ones.
Based on my research so far, I've only found one option. Interactive Brokers offers a multi-language API ... | stackexchange/codereview |
Suppose I have fileA.h which declares a class classA with template function SomeFunc<T>(). This function is implemented directly in the header file (as is usual for template functions). Now I add a specialized implementation of SomeFunc() (like for SomeFunc<int>()) in fileA.C (ie. not in the header file).
If I now call... | stackexchange/codereview |
I'm working in a .net application where we need to generate XML files on the fly based on the dataset retrieved from the db. XML schema should be based on a xsd provided. I would like to know is there any way to bind or associate a dataset or each datarow with the xsd. I dont know whether it can be done at all or i may... | stackexchange/codereview |
I am using gcc for windows. The OS is windows XP.
How do I import the homepath variable into my c program so I can write to c:\%homepath%\desktop? I would like to use something similar to:
fd = fopen("C:\\%%homepath%%\\desktop\\helloworld.txt","w");
| stackexchange/codereview |
Is there an advantage to dynamically attaching/detaching event handlers?
Would manually detaching handlers help ensure that there isn't a reference remaining to a disposed object?
| stackexchange/codereview |
There are some HTML based games (ie bootleggers.us) that have a simple login form and after that your entire game experience revolves around submitting various forms and reading information from the website itself.
My Question is, what is the best way to go about writing a bot / automate the html-based game using C#? ... | stackexchange/codereview |
I want the following layout to appear on the screen:
FieldName 1 [Field input 1]
FieldName 2 is longer [Field input 2]
. .
. .
FieldName N [Field input N]
Requirements:
Field names and field inputs must align on the left edges
Both colu... | stackexchange/codereview |
I've been developing Winforms applications in C# for a few years now and have been interested in moving future development toward WPF, mainly because of the positive things I've been hearing about it. But, I'm wondering what sort of hurdles others have had to overcome as they migrated to WPF. Was there a significant ... | stackexchange/codereview |
What are the best continuous integration frameworks/projects for Perl and why?
| stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.