instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
I need to create a nice installer for a Mac application. I want it to be a disk image (DMG), with a predefined size, layout and background image.
I need to do this programmatically in a script, to be integrated in an existing build system (more of a pack system really, since it only create installers. The builds are do... | stackexchange/codereview |
Should I keep project filesm like Eclipse's .project, .classpath, .settings, under version control (e.g. Subversion, GitHub, CVS, Mercurial, etc)?
| stackexchange/codereview |
The code below shows a sample that I've used recently to explain the different behaviour of structs and classes to someone brand new to development. Is there a better way of doing so? (Yes - the code uses public fields - that's purely for brevity)
namespace StructsVsClasses
{
class Program
{
static void... | stackexchange/codereview |
I'm trying to write a script to allow me to log in to a console servers 48 ports so that I can quickly determine what devices are connected to each serial line.
Essentially I want to be able to have a script that, given a list of hosts/ports, telnets to the first device in the list and leaves me in interactive mode so ... | stackexchange/codereview |
Should I use a hand-written schema for my projected developed in a high-level language (such as Python, Ruby) or should I let my ORM solution auto-generate it?
Eventually I will need to migrate without destroying all the data. It's okay to be tied to a specific RDBMS but it would be nice if features such as constraints... | stackexchange/codereview |
I do alot of systems programming where my apps have no chance of being used to communicate over the web or viewed through a browser. But, there has been some push by management to use XML. For example, if I want to keep a time log I could use a text file like this:
command date time project
in 2008/09/23 08:00:00 PRO... | stackexchange/codereview |
I would like to support keyboard shortcuts in my WPF XBAP application, such as Ctrl+O for 'Open' etc. How do I disable the browsers built-in keyboard shortcuts and replace them with my own?
| stackexchange/codereview |
I would like to repeatedly capture snippets of audio on a Nokia mobile phone with a Java Midlet. My current experience is that using the code in Sun's documentation (see: http://java.sun.com/javame/reference/apis/jsr135/javax/microedition/media/control/RecordControl.html) and wrapping this in a "while(true)" loop works... | stackexchange/codereview |
I've had a bug in our software that occurs when I receive a connection timeout. These errors are very rare (usually when my connection gets dropped by our internal network). How can I generate this kind of effect artificially so I can test our software?
If it matters the app is written in C++/MFC using CAsyncSocket cl... | stackexchange/codereview |
What are all the valid self-closing elements (e.g. <br/>) in XHTML (as implemented by the major browsers)?
I know that XHTML technically allows any element to be self-closed, but I'm looking for a list of those elements supported by all major browsers. See http://dusan.fora.si/blog/self-closing-tags for examples of so... | stackexchange/codereview |
Is there a way to "align" columns in a data repeater control?
I.E currently it looks like this:
user1 - colA colB colC colD colE
user2 - colD colE
I want it to look like:
user1
-colA
-colB
-colC
-colD
-colE
user1
-colD
-colE
I need to columns for each record to align properly when addi... | stackexchange/codereview |
I would like to redirect/rewrite this two kinds of URLs:
mydomain.com -> newdomain.com
mydomain.com/specificPage -> newdomain.com/newSpecificPage
mydomain.com/anyOtherPage -> mydomain.com/anyOtherPage (no redirect here)
So I just want to redirect the root domain to a new domain, and some pages from my domain to some ... | stackexchange/codereview |
I'm using Spring.net with NHiberante (HibernateTemplate) to implement my DAO's.
I also have some integration tests, that extend from 'AbstractTransactionalDbProviderSpringContextTests '.
DI is working fine, and all test pass BUT sometimes they pass even when they shouldn't.
For example if my hbm.xml files have an erro... | stackexchange/codereview |
I have a need to use extensionless URLs. I do not have access to IIS (6.0) so I cannot map requests to ASP.NET and handle with a HttpHandler/HttpModule. However, I can set a custom 404 page via web host control panel.
My current plan is to perform necessary logic in the custom 404 page, but it "feels wrong". Are the... | stackexchange/codereview |
What are the advantages and disadvantages of DTOs from a website performance perspective? (I'm talking in the case where the database is accessed on a different app server to the web server - and the web server could access the database directly.)
| stackexchange/codereview |
I'd like to search a Word 2007 file (.docx) for a text string, e.g., "some special phrase" that could/would be found from a search within Word.
Is there a way from Python to see the text? I have no interest in formatting - I just want to classify documents as having or not having "some special phrase".
| stackexchange/codereview |
I've got several AssemblyInfo.cs files as part of many projects in a single solution that I'm building automatically as part of TeamCity.
To make the msbuild script more maintainable I'd like to be able to use the AssemblyInfo community task in conjunction with an ItemGroup e.g.
<ItemGroup>
<AllAssemblyInfos Inclu... | stackexchange/codereview |
I would like to know if there is any way to add custom behaviour to the auto property get/set methods.
An obvious case I can think of is wanting every set property method to call on any PropertyChanged event handlers as part of a System.ComponentModel.INotifyPropertyChanged implementation. This would allow a class to ... | stackexchange/codereview |
Can I determine from an ASP.NET application the transfer rate, i.e. how many KB per second are transferd?
| stackexchange/codereview |
I am getting ready to start a new asp.net web project, and I am going to LINQ-to-SQL. I have done a little bit of work getting my data layer setup using some info I found by Mike Hadlow that uses an Interface and generics to create a Repository for each table in the database. I thought this was an interesting approach ... | stackexchange/codereview |
The standard answer is that it's useful when you only need to write a few lines of code ...
I have both languages integrated inside of Eclipse. Because Eclipse handles the compiling, interpreting, running etc. both "run" exactly the same.
The Eclipse IDE for both is similar - instant "compilation", intellisense etc. Bo... | stackexchange/codereview |
What's the name of the circled UI element here? And how do I access it using keyboard shortcuts? Sometimes it's nearly impossible to get the mouse to focus on it.
catch (ItemNotFoundException e)
{
}
| stackexchange/codereview |
I have a bowling web application that allows pretty detailed frame-by-frame information entry. One thing it allows is tracking which pins were knocked down on each ball. To display this information, I make it look like a rack of pins:
o o o o
o o o
o o
o
Images are used to represent the pins. So, for the back ... | stackexchange/codereview |
When writing j2me applications for cellphones, using System.out.println() prints on the console if using an emulator. However, when the code is deployed on a cellphone, where does the console output go?
If it is impossible to see this in the untethered cellphone, is there a way to see it if the cellphone is still conne... | stackexchange/codereview |
I need to compress portions of our application's network traffic for performance. I presume this means I need to stay away from some of the newer algorithms like bzip2, which I think I have heard is slower.
| stackexchange/codereview |
Could anyone recommend to me a good online guide to PowerPoint VBA? Also, does anyone has advice on how to record a macro in PowerPoint?
| stackexchange/codereview |
I am using Oracle 9 and JDBC and would like to encyrpt a clob as it is inserted into the DB. Ideally I'd like to be able to just insert the plaintext and have it encrypted by a stored procedure:
String SQL = "INSERT INTO table (ID, VALUE) values (?, encrypt(?))";
PreparedStatement ps = connection.prepareStatement(SQL)... | stackexchange/codereview |
In this situation I am trying to perform a data import from an XML file to a database using LINQ to XML and LINQ to SQL.
Here's my LINQ data model:
public struct Page
{
public string Name;
public char Status;
public EntitySet<PageContent> PageContents;
}
public struct PageContent
{
public string Conten... | stackexchange/codereview |
While editing an aspx file I found both these opening tags used for seemingly the same thing. Is there a difference and if yes, what is it?
| stackexchange/codereview |
I have C++ project (VS2005) which includes header file with version number in #define directive. Now I need to include exactly the same number in twin C# project. What is the best way to do it?
I'm thinking about including this file as a resource, then parse it at a runtime with regex to recover version number, but may... | stackexchange/codereview |
I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server.
Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) assuming that the overall approa... | stackexchange/codereview |
What is the best way to add "Expires" in http header for static content? eg. images, css, js
The web server is IIS 6.0; the language is classical ASP
| stackexchange/codereview |
I'm working against a large COM library (ArcObjects) and I'm trying to pinpont a memory leak.
What is the most reliable way to determine the amount of memory used by unmanaged code/objects.
What performance counters can be used?
| stackexchange/codereview |
Is it possible to have one appBase served up by multiple context paths in Tomcat?
I have an application base that recently replaced a second application base. My problem is a number of users still access the old context. I would like to serve the, now common, application from a single appBase yet accessed via either ... | stackexchange/codereview |
For <script> HTML tags, what is the technical difference between lang=Javascript and type=text/javascript?
I usually use both, because I've always assumed that older browsers need one or the other.
| stackexchange/codereview |
I'm specifically looking for one that lets me display a map of US states with each one as it's own "object" in the sense that I can control the color, on click, and on mouseover of each one individually. GTK is my personal preference, but at this point I'd settle for just about anything. The application itself will b... | stackexchange/codereview |
Does someone know if it is possible to modify the JVM settings at runtime (e.g. -dname=value)?
I need this little trick to run my Java stored procedure (oracle 10g).
| stackexchange/codereview |
When using the Eclipse->Team->Show History view, what's the difference between using Subclipse "Get Contents" and "Get Revision" options on a revision of a file?
Is there any way to see what svn commands Subclipse is issuing behind the scenes?
| stackexchange/codereview |
Is there a tool or programmatic way to install an SSL certificate to the default website in IIS 6 and 7? Ideally I am looking for something that can be done via unmanaged code or .NET managed code.
| stackexchange/codereview |
In Emacs, C-x o takes me to the next window.
What keyboard macro takes me to the previous window in Emacs?
| stackexchange/codereview |
I would like to have something like this:
class Foo {
private:
int bar;
public:
void setBar(int bar);
int getBar() const;
}
class MyDialog : public CDialogImpl<MyDialog> {
BEGIN_MODEL_MAPPING()
MAP_INT_EDITOR(m_editBar, m_model, getBar, setBar);
END_MODEL_MAPPING()
// other methods and message map
priv... | stackexchange/codereview |
I have a paradox table from a legacy system I need to run a single query on. The field names have spaces in them - i.e. "Street 1". When I try and formulate a query in delphi for only the "Street 1" field, I get an error - Invalid use of keyword. Token: 1, Line Number: 1
Delphi V7 - object pascal, standard Tquery obj... | stackexchange/codereview |
Some files in our repository are individual to each developer. For example some developers use a local database, which is configured in a properties file in the project. So each developer has different settings. When one developer commits, he always has to take care to not commit his individually configured files.
How ... | stackexchange/codereview |
How can I create a custom aggregate function in MS SQL Server? An example would help a lot.
| stackexchange/codereview |
As most of you would know, if I drop a file named app_offline.htm in the root of an asp.net application, it takes the application offline as detailed here.
You would also know, that while this is great, IIS actually returns a 404 code when this is in process and Microsoft is not going to do anything about it as mention... | stackexchange/codereview |
I mean, this is Sakai, the open source project of a learning management system. But, really I'm clueless trying to estimate the hidden costs in one implementation project (on the technology side, not the pedagogy-stuff) in a small-medium scale institution.
Deployment (1 engineer two or three months, with experience in... | stackexchange/codereview |
C# question (.net 3.5). I have a class, ImageData, that has a field ushort[,] pixels. I am dealing with proprietary image formats. The ImageData class takes a file location in the constructor, then switches on file extension to determine how to decode. In several of the image files, there is a "bit depth" field in ... | stackexchange/codereview |
I am wondering if anyone is already using Entity Framework with an Oracle database in a production environment? There seems to be no support for EF in ODP.Net and only 3rd party data providers (OraDirect) seem to be available to connect with Oracle. Someone mentioned asample data provider available on Codeplex but it i... | stackexchange/codereview |
Maybe I'm just thinking about this too hard, but I'm having a problem figuring out what escaping to use on a string in some JavaScript code inside a link's onClick handler. Example:
<a href="#" onclick="SelectSurveyItem('<%itemid%>', '<%itemname%>'); return false;">Select</a>
The <%itemid%> and <%itemname%> are where ... | stackexchange/codereview |
Suppose I want to implement in C++ a data-structure to store oriented graphs. Arcs will be stored in Nodes thanks to STL containers. I'd like users to be able to iterate over the arcs of a node, in an STL-like way.
The issue I have is that I don't want to expose in the Node class (that will actually be an abstract bas... | stackexchange/codereview |
My boss loves VB (we work in a Java shop) because he thinks it's easy to learn and maintain. We want to replace some of the VB with java equivalents using the Eclipse SWT editor, because we think it is almost as easy to maintain. To sell this, we'd like to use an aerith style L&F.
Can anyone provide an example of an SW... | stackexchange/codereview |
What is the best available tool to monitor the memory usage of my C#/.Net windows service over a long period of time. As far as I know, tools like perfmon can monitor the memory usage over a short period of time, but not graphically over a long period of time. I need trend data over days, not seconds.
To be clear, I ... | stackexchange/codereview |
This might seem obvious but I've had this error when trying to use LINQ to SQL with my business logic in a separate class library project.
I've created the DBML in a class library, with all my business logic and custom controls in this project. I'd referenced the class library from my web project and attempted to u... | stackexchange/codereview |
Can anyone recommend a library for chart generation (bar charts, pie charts etc.) which runs on both Java and .Net?
| stackexchange/codereview |
How do I convert between big-endian and little-endian values in C++?
For clarity, I have to translate binary data (double-precision floating point values and 32-bit and 64-bit integers) from one CPU architecture to another. This doesn't involve networking, so ntoh() and similar functions won't work here.
Note: The an... | stackexchange/codereview |
I need to do the following for the purposes of paging a query in nHibernate:
Select count(*) from
(Select e.ID,e.Name from Object as e where...)
I have tried the following,
select count(*) from Object e where e = (Select distinct e.ID,e.Name from ...)
and I get an nHibernate Exception saying I cannot convert Object... | stackexchange/codereview |
Yes XML is human readable but so is comma delimited text and properties files.
XML is bloated, hard to parse, hard to modify in code, plus a ton of other problems that I can think about with it.
My questions is what are XML's most attractive qualities that has made it so popular????
| stackexchange/codereview |
What's the best / simplest / most accurate way to detect the browser of a user?
Ease of extendability and implementation is a plus.
The less technologies used, the better.
The solution can be server side, client side, or both. The results should eventually end up at the server, though.
The solution can be framework agn... | stackexchange/codereview |
Per man pages, snprintf is returning number of bytes written from glibc version 2.2 onwards. But on lower versions of libc2.2 and HP-UX, it returns a positive integer, which could lead to a buffer overflow.
How can one overcome this and write portable code?
Edit : For want of more clarity
This code is working perfectly... | stackexchange/codereview |
I have a .net (3.5) WinForms application and want to display some html on one of the forms. Is there a control that I can use for this?
| stackexchange/codereview |
Being vaguely familiar with the Java world I was googling for a static analysis tool that would also was intelligent enough to fix the issues it finds. I ran at CodePro tool but, again, I'm new to the Java community and don't know the vendors.
What tool can you recommend based on the criteria above?
| stackexchange/codereview |
This is not a new topic, but I am curious how everyone is handling either .js or .css that is browser specific.
Do you have .js functions that have if/else conditions in them or do you have separate files for each browser?
Is this really an issue these days with the current versions of each of the popular browsers?
| stackexchange/codereview |
I'm trying to read data from a Delphi DBIV database, every time I access the database it creates a Paradox.lck and a Pdoxusrs.lck file. I'm using only a TQuery Object to do this (nothing else). can I access a Delphi DBIV database without it creating these lock files?
| stackexchange/codereview |
Are there any easy, smart ways to keep your client and server-side validation-rules synchronized?
On the client side we have JavaScript, maybe some kind of framework like jQuery or YUI.
On the server-side we have ASP.NET WebForms or ASP.NET MVC.
What is validated are things like:
Correct e-mail-addresses
Correct home-... | stackexchange/codereview |
How are folks integrating various static analysis tools such as PMD, Checkstyle, and FindBugs so that they are used together in some uniform way? In particular, I'm interested in generating a single uniform report that includes warnings from all tools. Also, I want to be able to mark-up my code with reasonably consiste... | stackexchange/codereview |
What are the stack and heap?
Where are they located physically in a computer's memory?
To what extent are they controlled by the OS or language run-time?
What is their scope?
What determines their sizes?
What makes one faster?
| stackexchange/codereview |
I want to run text through a filter to ensure it is all UTF-8 encoded. What is the recommended way to do this with PHP?
| stackexchange/codereview |
I'm sure there were several, but the one I was thinking of would display a nice text screen when you crashed the computer thoroughly.
The Text was "Well smoke me a kipper."
| stackexchange/codereview |
Our company has a policy imposing the requirement of keeping source code in a SourceSafe repository. I've tried hard to persuade the management to migrate to SVN with no success (whcih is an another issue, anyway).
As I and few of my colleagues use SVN repository placed on my computer (via Apache), I made a PowerShell... | stackexchange/codereview |
I use a byte to store some flag like 10101010, and I would like to know how to verify that a specific bit is at 1 or 0.
| stackexchange/codereview |
Our application takes significantly more time to launch after a reboot (cold start) than if it was already opened once (warm start).
Most (if not all) the difference seems to come from loading DLLs, when the DLLs' are in cached memory pages they load much faster. We tried using ClearMem to simulate rebooting (since it... | stackexchange/codereview |
Can someone explain to me the advantages of using an IOC container over simply hardcoding the default implementation into a default constructor?
In other words, what is wrong about this code?
public class MyClass
{
private IMyInterface _myInterface;
public MyClass()
{
_myInterface = new DefaultMyIn... | stackexchange/codereview |
I have a secondary Exchange mailbox configured on my iPhone using IMAP. This all appears to work fine except when a message is deleted on the phone, it still shows normally in Outlook. It does not seem to matter what I set the "remove deleted messages" setting to on the phone.
I understand this is due to a combination ... | stackexchange/codereview |
When creating the id attributes for HTML elements, what rules are there for the value?
| stackexchange/codereview |
I've only recently started working with asp.net and c#. Is there a standard practice set of web.config settings for a live final website? There seem to be a ton of options available and I'm looking to streamline performance, close possible security holes and other unnecessary options.
| stackexchange/codereview |
As it stands now, I'm a Java and C# developer. The more and more I look at Ruby on Rails, the more I really want to learn it.
What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with Linux?
Is there an IDE that can match the robust... | stackexchange/codereview |
I've got a database which I intend to replicate for backup reasons (performance is not a problem at the moment).
We've set up the replication correctly and tested it and all was fine.
Then we realized that it replicates all the writes to the temporary tables, which in effect meant that replication of one day's worth o... | stackexchange/codereview |
I was wondering if I could access the iPhones Core Location framework over a website?
My goal is to build a webapp/website that the iPhone would browse to, then upload its current GPS location. This would be a simple site primary for friends/family so we could locate each other. I can have them manually enter lng/lat b... | stackexchange/codereview |
I am writing my first serious wxWidgets program. I'd like to use the wxConfig facility to make the program's user options persistent. However I don't want wxConfigBase to automatically use the Windows registry. Even though I'm initially targeting Windows, I'd prefer to use a configuration (eg .ini) file. Does anyone kn... | stackexchange/codereview |
If you have a JSF <h:commandLink> (which uses the onclick event of an <a> to submit the current form), how do you execute JavaScript (such as asking for delete confirmation) prior to the action being performed?
| stackexchange/codereview |
I have a string that is like below.
,liger, unicorn, snipe
in other languages I'm familiar with I can just do a string.trim(",") but how can I do that in c#?
Thanks.
There's been a lot of back and forth about the StartTrim function. As several have pointed out, the StartTrim doesn't affect the primary variable. How... | stackexchange/codereview |
I'd like to add a drop-down list to a Windows application. It will have two choices, neither of which are editable. What's the best control to use? Is it a combo box with the editing property set to No?
I'm using Visual Studio 2008.
| stackexchange/codereview |
Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript.
| stackexchange/codereview |
In Internet Explorer I can use the clipboardData object to access the clipboard. How can I do that in FireFox, Safari and/or Chrome?
| stackexchange/codereview |
How do I assign a method's output to a textbox value without code behind?
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Public TextFromString As String = "test text test text"
Public Tex... | stackexchange/codereview |
I'm developing a web app on Yaws 1.65 (installed through apt) running on Debian etch on a VPS with UML. Whenever I do /etc/init.d/yaws restart or a stop/start, it initializes according to an old version of the config file (/etc/yaws/yaws.conf).
I know this because I changed the docroot from the default to another dire... | stackexchange/codereview |
So I'm running PPP under linux with a cellular modem. The program I'm writing needs to know if the link is active before sending any data.
What are my options to check
if the link is available
if it routes to a server I control (it doesn't go to the internet as I said earlier)
Also, what is the best way to restart i... | stackexchange/codereview |
I've created an IHttpHandler in .NET C# which returns pieces of html to a classic asp page.
The classic asp page communicates with the IHttpHandler through basic http requests using ServerXMLHTTP in vbscript or Ajax Calls in JavaScript.
Now, I need a way to share a variable which I have in vbscript but not in javascrip... | stackexchange/codereview |
I've found an article on how to elevate a COM object written in C++ by calling
CoCreateInstanceAsAdmin. But what I have not been able to find or do, is a way to implement a component of my .NET (c#) application as a COM object and then call into that object to execute the tasks which need UAC elevation. MSDN documents... | stackexchange/codereview |
I'm trying to find a way of finding out who is downloading what image from an image gallery. Users can download using a button beside the thumbnail or right click and use the "save link as" Is it possible to relate a user session or ID to a "save link as" action from all browsers using either PHP or JavaScript.
| stackexchange/codereview |
I am getting the following error whenever I click on a postbacking control
HttpException (0x80004005): Validation
of viewstate MAC failed. If this
application is hosted by a Web Farm
or cluster, ensure that configuration
specifies the same validationKey and
validation algorithm. AutoGenerate
cannot be used in a clu... | stackexchange/codereview |
I am working with some CSS that is poorly written to say the least. I am not a design/CSS expert, but I at least understand the C in CSS. While the builtin CSS support inside of VS-2008 is far improved over previous versions, it still doesn't quite do what I am looking for.
I was wondering if anyone know of a good prog... | stackexchange/codereview |
Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl?
| stackexchange/codereview |
I have the following (pretty standard) table structure:
Post <-> PostTag <-> Tag
Suppose I have the following records:
PostID Title
1, 'Foo'
2, 'Bar'
3, 'Baz'
TagID Name
1, 'Foo'
2, 'Bar'
PostID TagID
1 1
1 2
2 2
In other words, the first post has two tags, the second has one and th... | stackexchange/codereview |
I want to place a Webpart on a page that holds a subfolder of the Document Library in SharePoint, but somehow, the only thing I get is the root folder of the document library.
Is there a Webpart that fills this need?
| stackexchange/codereview |
Theres is a little problem I want to solve with Haskell:
let substitute a function that change all of the wildcards in a string for one concrete parameter. The function has de signature of:
subs :: String -> String -> String -> String
-- example:
-- subs 'x' "x^3 + x + sin(x)" "6.2" will generate
-- "6.2^3 + 6... | stackexchange/codereview |
I'm new to the WCSF and can't seem to find anything related to "building a custom template" for creating the views/presenters/code-behinds/etc with your own flavor ...
Can anyone point me in the right direction?
| stackexchange/codereview |
I got a comment to my answer on this thread:
Malloc inside a function call appears to be getting freed on return?
In short I had code like this:
int * somefunc (void)
{
int * temp = (int*) malloc (sizeof (int));
temp[0] = 0;
return temp;
}
I got this comment:
Can I just say, please don't cast the
return value... | stackexchange/codereview |
In the new login dialog of the SQL Server 2005 Management Studio Express, what is the User Mapping actually doing? Am I restricting access to those databases that are checked? What if I check none?
| stackexchange/codereview |
What would be a good local database for a Silverlight application? The database's main purpose is for local data caching and synchronization services. I do not believe that SQL anywhere or SQLite will work since they use unmanaged code which will not run under the silverlight sandbox
| stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.