input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Using the name resolver of resolv.h with IPv6 <p>I write or modify programs which perform name resolution and need a
good control of the process. So I do not use <code>getaddrinfo()</code>, I go
deeper and use <code>res_query()</code> / <code>res_send()</code> / etc in <code>resolv.h</code>, documented
in resolver(3). ... | <p>Stéphane - if your <code>resolv.h</code> doesn't include any support for <code>sockaddr_in6</code> then that suggests that on your particular O/S the resolver does not itself support IPv6 transport.</p>
<p>I've checked some of my systems here:</p>
<ul>
<li><p>MacOS X 10.5.6 - supports the BIND 9 library, which ha... |
Mac Browsers - Is IE5.x for the Mac officially dead? <p>I don't use a mac much so my exposure is minimal but can I safely presume that IE on the Mac is dead?</p>
<p>I know that Microsoft isn't developing it any further and that Firefox, Safari (Opera and Camino) all run on Mac (and from my stats they are most used, in... | <p>It's dead. I just pulled up this months report and found 9 hits out of 3.5 million (about 0.0000257%).</p>
<p>If you need a time-of-death, I would say it was in 2006 when Microsoft <a href="http://en.wikipedia.org/wiki/Internet_Explorer_for_Mac" rel="nofollow">released a statement</a> urging users to "migrate to mo... |
How does the AddExtension property work in C# 2.0? <p>I want to open a save file dialog, have the user enter a filename, and if they forget the .csv extension, have it tacked on.</p>
<p>It would seem that the SaveFileDialog AddExtension property would work, but its doesn't. I've even set the DefaultExt property to .cs... | <p>Try just using <code>"csv"</code> for the <code>DefaultExt</code> - also, you should be <code>using</code> this (it is <code>IDisposable</code>):</p>
<pre><code> using (SaveFileDialog sfd = new SaveFileDialog())
{
sfd.AddExtension = true;
sfd.DefaultExt = "csv";
sf... |
Visual Studio 2008 on Vista problems <p>Does anyone have any problems with VS2008 on Vista?
For me every so often when I select items in the solution explorer the screen goes blank. No other application causes this to happen.</p>
| <p>One of our guys had this problem. For some odd reason, check to see if your video drivers are up to date.</p>
|
Is there a built-in IsLowerCase() in .NET? <p>Is there a built-in <code>IsLowerCase()</code> in .NET? </p>
| <pre><code>public static bool IsLowerCase( this string text ) {
if ( string.IsNullOrEmpty( text ) ) { return true; }
foreach ( char c in text )
if ( char.IsLetter( c ) && !char.IsLower( c ) )
return false;
return true;
}
"someString".IsLowerCase();
</code></pre>
|
Expanding a node in ASP.Net TreeView through XML Attribute <p>I have a ASP.Net TreeView control that I am binding to an XML data source. I'm wanting to be able to control which nodes are expanded and which ones are collapsed in the XML definition file. The Expanded='' doesn't work for me though. In the following simple... | <p>Unfortunately you can't do this in the XML. It is a short coming of the control. You will need to populate the TreeView with the XML and then traverse all of the nodes recursively and expand the branch that you need. Try the following:</p>
<p>Add the OnPreRender attrobite to the TreeView control...</p>
<pre><code>... |
assert and NDEBUG <p>After reading some threads on misuses of exceptions (basically saying you don't want to unwind the stack if a functions preconditions are incorrect - possibly signalling that all your memory is corrupt or something equally dangerous) I'm thinking about using assert() more often. Previously I have o... | <p>You could build your own assert instead of using the stock C assert.h. Your assert won't be disabled.</p>
<p>Look at how assert() is implemented in /usr/include/assert.h (or wherever). It's simply some preprocessor magic eventually calling an "assert fail" function.</p>
<p>In our embedded environments, we replace... |
Can't debug - "The breakpoint will not currently be hit. No symbols have been loaded for this document" <p>I'm getting the error in the subject line. I'm running vs2k8 on server 2k3sp2. I've tried deleting the pdbs, cache directories, verifying that debugging is set up on the specific page. The interesting thing is oth... | <p>The only time I've ever run into an issue like this is if I was trying to debug while the project was in release mode.</p>
|
Raising javascript events in ASP.NET user control <p>Is it possible to raise a "custom event" in an ASP.NET user control and to subscribe to the event in the calling page? This way I can have any containing page react to changes in a user control without having to do a partial or full postback.</p>
| <p>You're trying to mix server-side code with client-side code. You're probably better off using the built-in javascript events: </p>
<blockquote>
<pre><code>control.Attributes.Add("onclick", "mgr.Click();"); //server-side
//Javascript:
var mgr = new Object();
mgr.Click = new function(e) { //...
</code></pre>
</bloc... |
JPA - Hibernate <p>Can someone put in perspective the difference between JPA and Hibernate.
Or are these complementary concepts, to be used together?</p>
| <p>Roughly, JPA is a standard from the java community, <a href="http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html">here the specs</a>, which has been implemented (and extended) by the Hibernate guys (<a href="http://www.hibernate.org/397.html">some info here</a>).
Being a spec, you will not be using JP... |
Accessing Excel 2007 Binary (.xlsb) via OleDb ACE <p>I found the Excel 2007 Binary format (with extension .xlsb) perfectly
suitable for my needs, since it's fast to load and very compact. I deliver a
bunch of reports in Excel that carry a lot of data, and those reports are
actually being loaded with an IS package.</... | <p>I know this is old post. I came across this issue few days ago and after lots of struggling, I'm able to resolve it. Hope it can help someone.</p>
<p>In my case, I have the same exact error: </p>
<blockquote>
<p>This
file was created in a previous beta version of Excel 2007. Open the file
with Excel 2007 ... |
Adding xml comments to methods, properties, etc quickly in vs 2008 <p>Assume I have 10 Methods and 10 Properties. Is there a way to add the xml comments (///) to all 10 Methods and 10 Properties at once in VS 2008 or do I have to type /// for each one.</p>
| <p>This little tool is very useful <a href="http://www.roland-weigelt.de/ghostdoc/" rel="nofollow">Ghost Doc</a>.</p>
|
How do you show a list of tables in another database? <p>I can use:</p>
<pre><code>select * from sys.tables
</code></pre>
<p>in mssql to show a list of all tables in the current database. Is there anyways I can use similar syntax to show list of tables in another database?</p>
<p>Say I am using A with:</p>
<pre><co... | <p>This does it for me (MS SQL 2005 and newer):</p>
<pre><code>select * from your_database_name.sys.tables
</code></pre>
<p>Keep in mind that you (or whatever authentication context you're using) will still need read permission on that database.</p>
<p>To use your example:</p>
<pre><code>use a;
go
select * from sy... |
Can my build stipulate that my code coverage never get worse? <p>I am using hudson CI to manage a straight java web project, using ant to build.</p>
<p>I would like to mandate that the unit test coverage never be worse than the previous build, thereby making sure any new code is always tested, or at least the coverage... | <p>Yes. Which coverage tool are you using?</p>
<p>The Cobertura plugin for Hudson definitely supports this. On the project configuration screen you can specify thresholds.</p>
<p>Alternatively, you can make Ant fail the build (rather than Hudson), by using the cobertura-check task.</p>
<p><strong>EDIT:</strong> I'... |
How to retrieve sender in click handler from toolbartray or other control in wpf? <p>XAML:</p>
<pre><code><ToolBarTray Name="tlbTray" ButtonBase.Click="tlbTray_Click">
<ToolBar Name="tlbFile">
<Button Name="btnOpen"><Image Source="images\folder.png" Stretch="None" /></Button>
<... | <p>Owkay, I found it!</p>
<pre><code>private void tlbTray_Click(object sender, RoutedEventArgs e)
{
Button button = (Button)e.OriginalSource;
}
</code></pre>
|
How can I split "lastname, firstname" into separate strings? <p>Whats the best way to separate the string, "Parisi, Kenneth" into "Kenneth" and "Parisi"?
<br>I am still learning how to parse strings with these regular expressions, but not too familiar with how to set vars equal to the matched string & output of the... | <pre><code>my ($lname, $fname) = split(/,\s*/, $fullname, 2);
</code></pre>
<p>Note the third argument, which limits the results to two. Not strictly required but a good practice nonetheless imho.</p>
|
MVC pattern in .NET: Can View call Exceptions in Model? <p>I'm using the MVC pattern in a .NET winform app. There are places in the Controller that can cause an exception. Rather than catching the exception and dislpaying a messagebox, which is a View responsibility, I do nothing in the Controller and let the View wr... | <p>I feel that its the Controllers responsiblity to tell the view to show a message and what message to show.</p>
<p>Therefor, I would put a DisplayError(string) method on the view and call that when you catch the exception in the Controller. That way the controller does the exception handling that the view still man... |
Authenticating against Active Directory with Java on Linux <p>I have a simple task of authenticating against Active Directory using Java. Just verifying credentials and nothing else. Let's say my domain is "fun.xyz.tld", OU path is unknown, and username/password is testu/testp. </p>
<p>I know there's a few Java librar... | <p>There are 3 authentication protocols that can be used to perform authentication between Java and Active Directory on Linux or any other platform (and these are not just specific to HTTP services):</p>
<ol>
<li><p>Kerberos - Kerberos provides Single Sign-On (SSO) and delegation but web servers also need SPNEGO suppo... |
VS2008 IDE giving 5 second latency when switching tabs between aspx and aspx.cs , how come? <p>I have VS2008 (SP1) installed on a XP sp2 laptop.</p>
<p>One thing weired on IDE, I don't know how to fix it.</p>
<p>I'm programming a web application, have many tabs openning at the same time. When I switch from aspx to a... | <p>Visual Studio really likes a good video card with a decent amount of video memory. It uses this for compositing the webpage.</p>
<p>Also, it's just a resource hog in general.</p>
|
Elegant ways to support equivalence ("equality") in Python classes <p>When writing custom classes it is often important to allow equivalence by means of the <code>==</code> and <code>!=</code> operators. In Python, this is made possible by implementing the <code>__eq__</code> and <code>__ne__</code> special methods, re... | <p>You need to be careful with inheritance:</p>
<pre><code>>>> class Foo:
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
else:
return False
>>> class Bar(Foo):pass
>>> b = Bar()
>>> ... |
onbeforeunload in Opera <p>I'm using the code that netadictos posted to the question <a href="http://stackoverflow.com/questions/333665/">here</a>. All I want to do is to display a warning when a user is navigating away from or closing a window/tab.</p>
<p>The code that netadictos posted seems to work fine in IE7, FF... | <p>Opera does not support window.onbeforeunload at the moment. It will be supported in some future version, but has not been a sufficiently high priority to get implemented as of Opera 11.</p>
|
How to make a fully customizable hosted ASP.NET MVC application <p>This is related to my previous question regarding serving static html files but that doesn't seem to be a good solution, </p>
<p>I want to make a fully customizable ASP.NET MVC application as a hosted service. See allowing the user to customize the loo... | <p>"Fully customizable" is the most elusive of the white whales ;-)</p>
<p>I see your question is old, but none the less;
first I'd recommend defining some <strong>very</strong> clear,<br>
and cohesive rules governing just what the "bottom-line" is, our
an inheritable template of sorts.<br>
You get a pretty good imp... |
winsock missing data c++ win32 <p>I am writing an application that needs to send data over a network. I have the application completed but there is a problem with sending the data. Every time I send a piece of data, it is cut off after 4 characters and the rest is garbage. The application is a remote keylogger I am wri... | <p>In your server side, your send line is:</p>
<pre><code>send(kSock,buf,sizeof(buf),0);
</code></pre>
<p>And buf is a char*. The size of a char* in your case in 4 bytes, so you're telling send to send 4 bytes of data, when you really want to send the size of the buffer which is strlen(buf)+1 (The plus one is to inc... |
Create a query dynamically through code in MSAccess 2003 [VBA] <p>Hi I need to create a query in MSAccess 2003 through code (a.k.a. VB) -- how can I accomplish this?</p>
| <p>A vague answer for a vague question :)</p>
<pre><code>strSQL="SELECT * FROM tblT WHERE ID =" & Forms!Form1!txtID
Set qdf=CurrentDB.CreateQueryDef("NewQuery",strSQL)
DoCmd.OpenQuery qdf.Name
</code></pre>
|
Looking for alternative Collaberative Developing Environements <p>I'm interested in Collaberative Developing and I was wondering if there are alternative solutions than using <a href="http://www.vimeo.com/1653402" rel="nofollow">UNA (example video)</a> from N-Brain. Free would be even better, but I guess that's not an ... | <p>If you're in Mac world, <a href="http://www.subethaedit.net/" rel="nofollow">SubEthaEdit</a> is a good option. Not free, but â¬29 isn't bad.</p>
|
Database schema design <p>I'm quite new to database design and have some questions about best practices and would really like to learn.
I am designing a database schema, I have a good idea of the requirements and now its a matter of getting it into black and white.</p>
<p>In this pseudo-database-layout, I have a table... | <p>The most common way would be to store the order items in another table.</p>
<pre><code>TBL_ORDER:
ID
TBL_CUSTOMER.ID
TBL_ORDER_ITEM:
ID
TBL_ORDER.ID
TBL_PRODUCTS.ID
Quantity
UniqueDetails
</code></pre>
<p>The same can apply to your Order audit trail. It can be a new table such as</p>
<pre><code>TBL_ORDER_AUDIT:... |
Messaging, Queues and ESB's - I know where I want to be but not how to get there <p>To cut a long story short, I am working on a project where we are rewriting a large web application for all the usual reasons. The main aim of the rewrite is to separate this large single application running on single server into many s... | <p>I've worked with JMS messaging in various software systems since around 2003. I've got a web app where the clients are effectively JMS topic subscribers. By the mere act of publishing a message into a topic, the message gets server-pushed dissemenated to all the subscribing web clients.</p>
<p>The web client is Fle... |
Is there a way to do object (with its attributes) serializing to xml? <p>Create a class (call it FormElement). That class should have some properties like the metadata they have with data elements (name, sequence number, valueâwhich is just a string, etc).</p>
<p>This class has as attributes of type Validation Appl... | <p>The .NET framework has this built in, using C# you would do it like this:</p>
<pre><code>// This code serializes a class instance to an XML file:
XmlSerializer xs = new XmlSerializer(typeof(objectToSerialize));
using (TextWriter writer = new StreamWriter(xmlFileName))
{
xs.Serialize(writer, InstanceOfObjectTo... |
WiX generated MSI is not compressed <p>I use WiX3 to generate MSI installation package.
I have specified comression flag on in both the <code><Package></code> and <code><Media></code> elements:</p>
<pre><code><Package InstallerVersion="200" Compressed="yes"/>
<Media Id="1" Cabinet="MySetup.cab" E... | <p>MSI files are not OLE Structured Storage files. They cannot be compressed and have the Windows Installer still be able to read them. However, many things are stored in the MSI file (such as your UI graphics and CustomAction DLLs and Shortcut Icons) so you should be conscious of the content you are putting into the... |
Can't operator == be applied to generic types in C#? <p>According to the documentation of the <code>==</code> operator in <a href="http://msdn.microsoft.com/en-us/library/53k8ybth.aspx">MSDN</a>, </p>
<blockquote>
<p>For predefined value types, the
equality operator (==) returns true if
the values of its operand... | <p>As others have said, it will only work when T is constrained to be a reference type. Without any constraints, you can compare with null, but only null - and that comparison will always be false for non-nullable value types.</p>
<p>Instead of calling Equals, it's better to use an <code>IComparer<T></code> - an... |
In Excel automation, how to gracefully handle invalid file format error upon file opening? <p>I'm trying to open a Microsoft Excel file in a C# program using the 'excelApp.Workbooks.Open()' method. As it happens, if the format of the file is invalid, this method causes an error message box to be displayed. I, however, ... | <p>I am sorry, I am not able to simulate the corrupt xls file example with Excel 2007.</p>
<p>Try Application.DisplayAlerts = False before calling Workbooks.Open...</p>
<p>If the workbook can't be opened, the returned value will be null.<br>
(i.e. Workbook wkb = Workbooks.Open(....);
wkb will be null when DisplayAler... |
asp.net mvc authorization using roles <p>I'm creating an asp.net mvc application that has the concept of users. Each user is able to edit their own profile. For instance: </p>
<ul>
<li>PersonID=1 can edit their profile by going to <a href="http://localhost/person/edit/1">http://localhost/person/edit/1</a></li>
<li>... | <p>Maybe you could organize the controller action such that the URL is more like <a href="http://localhost/person/editme">http://localhost/person/editme</a> and it displays the edit form for the currently-logged-in user. That way there's no way a user could hack the URL to edit someone else.</p>
|
How do I trim date in PLSQL? <p>I have a date variable as 24-dec-08
I want only the 08 component from it.
How do I do it in a select statement?</p>
<p>e.g.:</p>
<pre><code>select db||sysdate
(this is the component where I want only 08 from the date)
from gct;
</code></pre>
<p>How do i do it?</p>
| <p>The easiest way is to use the <code>to_char</code> function this way:</p>
<pre><code>to_char(sysdate, 'YY')
</code></pre>
<p>as <a href="http://www.techonthenet.com/oracle/functions/to_char.php" rel="nofollow">documented here</a>.</p>
<p>If you need the integer value, you could use the <code>extract</code> functi... |
What is an HttpHandler in ASP.NET <p>What is an HttpHandler in ASP.NET? Why and how is it used?</p>
| <p>In the simplest terms, an ASP.NET HttpHandler is a class that implements the <code>System.Web.IHttpHandler</code> interface. </p>
<p>ASP.NET HTTPHandlers are responsible for intercepting requests made to your ASP.NET web application server. They run as processes in response to a request made to the ASP.NET Site. Th... |
Is it possible to programmatically distinguish between versions of SQL Server? <p>Basically, is it possible to identify if some-one hooks up my program to SQL server Compact or Express Edition? I want to be able to restrict different versions of my product to different versions of SQL Server.</p>
| <p>After connection to a database, you can always run the T-Sql:</p>
<pre><code>SELECT SERVERPROPERTY ('edition')
</code></pre>
<p>This should give you the different editions</p>
<p>Other useful info may come from:</p>
<pre><code>SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel')
</code></pre>... |
phpunit warning on an utilitary class <p>I use phpUnit on a integration server to run all tests and if I lauch phpunit command from the command line, I receive</p>
<pre><code>PHPUnit 3.2.18 by Sebastian Bergmann.
F..III..I......I.IIII...
Time: 6 seconds
There was 1 failure:
1) Warning(PHPUnit_Framework_Warning)
No te... | <p>For the class wich extends PHPUnit_Framework_TestCase, it should be abstract, and the warning disapear.
For the first problem, it seems it is a bug.</p>
|
Make <div> resizeable <p>Is there a way to make a <div> container resizeable with drag'n'drop? So that the user can change the size of it using drag'n'drop?</p>
<p>Any help would really be appreciated!</p>
| <p>The best method would be to use CSS3. It supported by at least Webkit and Gecko.</p>
<p>According to the <a href="http://www.w3.org/TR/css3-ui/#resize">w3c spec</a>:</p>
<pre><code>div.my_class {
resize:both;
overflow:auto; /* something other than visible */
}
</code></pre>
<p>Webkit and Firefox do not in... |
ASP.NET GridView sorting on a calculated field <p>I have a DataBound GridView. However I have one column where the value comes from a calculation in the code behind - it is displayed within a TemplateField.</p>
<p>How can a sort my grid based on this calculated value ?</p>
| <p>Put your initial returned data into a DATASET or a DATATABLE. Add to the DATATABLE a new column for you calculated field. Walked that data doing the necessary calculation, and putting the result into said calculated field. </p>
<p>Create a new view based on the datatable, and sort the view by the calculated field. ... |
Javascript Prototypal Inheritance Doubt II <p>I'been doing some inheritance in js in order to understand it better, and I found something that confuses me.</p>
<p>I know that when you call an 'constructor function' with the new keyword, you get a new object with a reference to that function's prototype.</p>
<p>I also... | <blockquote>
<p>1) Why if all new objects contain a
reference to the creator function's
prototype, fido.prototype is
undefined?</p>
</blockquote>
<p>All new objects do hold a reference to the prototype that was present on their constructor at the time of construction. However the property name used to store t... |
System design: Preventing/detecting vote fraud <p>In light of the recent <a href="http://blog.stackoverflow.com/2008/12/vote-fraud-and-you/" rel="nofollow">vote fraud incident</a> here, I was wondering if anyone out there is familiar with building systems for preventing or detecting undesirable voting behavior. I imagi... | <p>There is a whole lot in the literature on voting systems, and a good bit of game theory can be applied. The issue that's difficult is that it's inherently probabilistic; you pick certain patterns as indicating <em>probable</em> fraud, and detect or exclude them; by doing so, you also exclude the possibility that so... |
In Vim, what is the simplest way to join all lines in a file into a single line? <p>I want to join all lines in a file into a single line. What is the simplest way of doing this? I've had poor luck trying to use substitution (<code>\r\n</code> or <code>\n</code> doesn't seem to get picked up correctly in the case of ... | <p>Another way:</p>
<pre><code>ggVGJ
</code></pre>
<p>"<code>ggVG</code>" visually selects all lines, and "<code>J</code>" joins them.</p>
|
Form designer inconsistent in control display style for updated project <p>I've got a project that I started in Turbo Delphi, which I recently updated to D2009, and I've noticed a bit of a quirk in the form designer. All the old forms have a Win98 style applied to them. The buttons are gray with sharp square edges, fo... | <p>You should enable run time themes.</p>
<p>Did you check?</p>
<pre><code>Project | Options | Application | [ ] Enable Run Time Themes
</code></pre>
|
wxPython and sharing objects between windows <p>I've been working with python for a while now and am just starting to learn wxPython. After creating a few little programs, I'm having difficulty understanding how to create objects that can be shared between dialogs.</p>
<p>Here's some code as an example (apologies for... | <p>You can pass a gamePlayer object to <code>__init__</code> as another argument.</p>
<pre><code>def __init__(self, parent, id, title, gamePlayer ):
...etc...
</code></pre>
<p>In the long run, this isn't ideal. </p>
<p>You should separate building an empty panel from loading that panel with data. The empty pan... |
Why can't I declare a friend through a typedef? <p>Does anyone know why typedefs of class names don't work like class names for the friend declaration?</p>
<pre><code>class A
{
public:
};
class B : public A
{
public:
typedef A SUPERCLASS;
};
typedef A X;
class C
{
public:
friend class A; // OK
... | <p>It can't, currently. I don't know the reason yet (just looking it up, because i find it interesting). Update: you can find the reason in the first proposal to support typedef-names as friends: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1520.pdf">http://www.open-std.org/jtc1/sc22/wg21/docs/pape... |
What are your (concrete) use-cases for metaclasses in Python? <p>I have a friend who likes to use metaclasses, and regularly offers them as a solution.</p>
<p>I am of the mind that you almost never need to use metaclasses. Why? because I figure if you are doing something like that to a class, you should probably be do... | <p>The purpose of metaclasses isn't to replace the class/object distinction with metaclass/class - it's to change the behaviour of class definitions (and thus their instances) in some way. Effectively it's to alter the behaviour of the class statement in ways that may be more useful for your particular domain than the... |
Passing a value from PHP to JavaScript <p>I have PHP code as in the following.</p>
<pre><code><?php
echo "<SCRIPT LANGUAGE='javascript'>add dd_Employee('".$id1."','".$fname1."',".$sal1.");</SCRIPT>";
echo "<SCRIPT LANGUAGE='javascript'>add dd_Employee('".$id2."','".$fname2."',".$sal2.");&l... | <p>Just populate your global data structure directly rather than passing it through a JavaScript function. You are likely running into a variable scope problem since you are allocating memory in addEmployee.</p>
<p>Example:</p>
<pre><code><?php
print "details[details.length] = new Array('$id1', '$name1', '$salary... |
Using 64 bit OS for .Net development in VS <p>My development machine ( 32 bit Windows XP) runs excruciatingly slow when I am doing .Net development in Visual Studio 2008, thanks to the <a href="http://itscommonsensestupid.blogspot.com/2008/10/impressions-on-resharper.html" rel="nofollow">installation of Resharper</a>. ... | <p>64 bit will not solve you memory problem with Resharper 4.0, since Visual Studio 2008 runs as a 32 bit process anyway. <a href="http://rabdullin.com/journal/2008/12/19/resharper-45-features-and-release-date.html" rel="nofollow">Resharper 4.5</a> will deal with some of the problems, though.</p>
<p>PS: Here's my post... |
Adding parameters for a program at launch <p>I'm currently trying to make a small application that performs different duties. Right now I have a console app pop up and ask what I want to do, but sometimes I would rather just launch it with something like MyApp.exe -printdocuments or some such thing. </p>
<p>Are there ... | <p>In C++, your <code>main()</code> function can have <code>argc</code> and <code>argv</code> parameters, which contain the arguments passed on the command line. The <code>argc</code> is the count of arguments (including the executable name itself), and <code>argv</code> is an array of pointers to null-terminated strin... |
Pole display problem in c# <p>I used pole display(E POS) in my POS c# application.I have two major problem in that,
1. I can't clear the display perfectly.
2. I can't set the cursor position.</p>
<pre><code> I used some dirty tricks to do these.But I am not satisfied with that code.The following code i used.
</cod... | <p>Your problem is that you are calling Write to clear line 1, and WriteLine to clear line 2.</p>
<p>This doesn't make any sense. The only difference between the methods is that WriteLine adds a linebreak to the end. All you are really doing is this outputting this string:</p>
<pre><code> " ... |
how to prevent PHP's file_get_contents( ) <p>one of my php page returns data like this:</p>
<pre><code><?php
//...
echo "json string";
?>
</code></pre>
<p>but someone else use file_get_contents() to get my data and use in other website.</p>
<p>can anybody tell me what can i do to prevent such thing happen.... | <p>You can use $_SERVER['REMOTE_ADDR'] to get the address of the client address. You can also check $_SERVER['HTTP_REFERER'] and block external requests that way, but it's less reliable. There's probably a few other techniques involving <a href="http://us3.php.net/reserved.variables.server" rel="nofollow">$_SERVER</a> ... |
NHibernate Transactions in Open View per Session - suggested practices? <p>Cleaning up some transactional logic and wondered how other people were handling it.</p>
<p>Ayende's recommendation seems to be to handle transactions at the service boundary. This is a ASP.NET web app though, so it hasn't got a clear cut servi... | <p>You can use a IoC Container for your service layer and the container can manage the transaction and the Nibenrate Session.</p>
<p>Your WebApp Controller => call (A) Service Layer => call (B) one or several DAO methods /operations.</p>
<p>The IoC container like Spring.NET will manage te TX scope, by example at (A)... |
How to do it in mysql: If id=idold THEN UPDATE status=1 <p>I would like to compare two tables and then update if some logic is true,
<BR>
In pseudo code:</p>
<p>SELECT * FROM users, usersold IF users.id=usersold.id THEN UPDATE users.status=1;</p>
<p>Is there a way to do it in mysql?</p>
| <pre><code>UPDATE users u
SET status = 1
WHERE EXISTS (SELECT id FROM usersold WHERE id = u.id)
</code></pre>
<p>Alternate version:</p>
<pre><code>UPDATE users
SET status = 1
WHERE id IN (SELECT id FROM usersold)
</code></pre>
<p>You should test and, depending on your database, you may find one performs better than ... |
Force use of CDATA in XML-schema <p>I am creating an xml schema, and I want to make sure that the values in all the elements
are CDATA elements.</p>
<p>Is there a way to force this using XML-schema?</p>
| <p>As I recall XML Schema works on the XML Infoset, meaning with the XML document after it is parsed, entities are resolved, whitespace is normalised and CDATA is processed. CDATA is a way of easing the textual serialization not a part of the structural model. So: No. Neither in DTDs or RELAX NG.</p>
|
Showing flash above content <p>I have a page with a tutorial (<a href="http://www.poromenos.org/tutorials/bittorrent/download" rel="nofollow">http://www.poromenos.org/tutorials/bittorrent/download</a>), but the site layout obscures the flash player, which is too wide. Is there a way to show the flash above the content ... | <p>You could place IFrame with player- it would be above all page content</p>
|
FAST ESP vs Google Search Appliance for development <p>Which of the two provides a better API for developing on top of?
Although there is a virtual Google Search Appliance available for download, no such equivalent is present for FAST.<br />
So looking to developers with experience in either of these products to give s... | <p>I'm pretty sure that FAST does not provide a trial download of their Enteprise Search Platform (ESP) today nor it's SDK (which is useless without ESP).</p>
<p>FAST is pretty much the industry leader for customization (Google is popular as simple out of the box solution and Autonomy seems to be the leader in complia... |
How to get the device name in C#? <p>How can I get my device name (using WinCE) in C# code ?</p>
<p>It gives me only "WindowsCE" how can i get the type on name of the device ? (ex. symbol or datalogic or mio...)</p>
| <p>The registry value HKEY_LOCAL_MACHINE\Ident\Name contains the device name. Use the registry library to read it.</p>
|
Is Symfony a better choice than Zend for a web development shop (10+) because it is a full stack framework? <p>My team at work is considering to use a framework for developing web sites and applications. Some of the seniors are convinced we should use the Zend Framework because it is easier to pick-and-choose the featu... | <p>And why not both? I have been using symfony since 2006, have been a real Doctrine fan for one year, and for a few months, we've reach many steps on the productivity ladder by integrating Zend components directly onto our symfony applications.</p>
<p>The real strength of symfony lies on the decoupling of everything,... |
Figure out the focused control <p>I'm trying to add a CSS class to the Control that will get the focus, once a page is rendered. While the SetFocus() method of the Page class lets me set the Control, there is no corresponding GetFocus() method.</p>
<p>According to the .Net sources, the information is stored in the pri... | <p>If you are looking for a css solution for highlighting the focused element I believe you can use the ':focus' selector. I haven't tried this, but I believe this is a valid selector. You would use it like so in your css file:</p>
<pre><code>:focus{ background-color: yellow;}</code></pre>
|
What is a good scripting language for basic file operations? <p>I often need to copy, move or rename files and directories based on some criteria as I collect data from many resources and I like to keep things organized. What scripting language provides the most intuitive and easy to use methods for these operations? H... | <p>If you have cygwin use either bash script or install Python, Perl, or Ruby and use them instead. There is no real "best" when it comes to basic file operations. Just pick which language you like most.</p>
|
Auto accepting contacts using phpmsnclass <p>Hello
I'm currently using <a href="http://code.google.com/p/phpmsnclass/" rel="nofollow">phpmsnclass</a> to send messages to contacts on the MSN network. But to get the nickname on my "bot" to work I have to accept the "friend-request" my contacts has sent me.</p>
<p>From t... | <p>I'm not quite sure of how you would go about this but have you thought of a two part check? One that runs while the program is active, and then while it it active check to see if the feature someone is trying to add the bot. If someone is then proceed to auto accept. This would require a response time though. I hope... |
Where can I find a good FFT sample implementation/tutorial? <p>I've been looking everywhere for a sample Fast Fourier Transform implementation/tutorial in (preferably) C#.</p>
<p>However, every one I've found has been poor at explaining what's going on, and/or poorly commented; or they assume that you already know the... | <p><em>Apologies for lack of hyperlinks, I do not have permissions to add them</em> :(</p>
<p>You are asking for two things here</p>
<p><strong>1) An explanation of the FFT</strong></p>
<p>Very briefly:</p>
<p>If you want to obtain the frequency domain representation of a signal you use the <em>fourier transform</e... |
Would you recommend Java/Glassfish/Metro for brand-new project? <p>I developed in ASP.NET 2.0 for some time, and for slightly less time in Java/Spring/Hibernate. Right now I start developing new web-service and am confused with the choice of:</p>
<p>.NET WCF 3.5 versus Java/Metro.</p>
<p>From one side, WCF seems like... | <p>If you are building a Rails application, JRuby on Glassfish is a winning combination. I have five Rails apps deployed to Glassfish and I haven't had any problems so far. I have been impressed with the performance and deployment was super easy.</p>
|
WCF Authentication WITHOUT SSL <p>Is there a way to setup authentication (ala "Basic Authentication") without actually setting up an SSL Certificate? I'd also like to do this in REST or regular SOAP WCF Services, preferably in REST, but would like to be able to mix the services. In other words, "I want to be able to ... | <p>Use TransportCredentialOnly security mode. This post explains how to do it:</p>
<p><a href="http://developers.de/blogs/damir_dobric/archive/2006/07/31/890.aspx">http://developers.de/blogs/damir_dobric/archive/2006/07/31/890.aspx</a>.</p>
<p>Don't forget that you also have to enable basic authentication in IIS.</p>... |
Locating the node by value containing whitespaces using XPath <p>I need to locate the node within an xml file by its value using XPath.
The problem araises when the node to find contains value with whitespaces inside.
F.e.:</p>
<pre><code><Root>
<Child>value</Child>
<Child>value with spaces... | <p><strong>Depending on your exact situation, there are different XPath expressions that will select the node</strong>, whose value contains some whitespace.</p>
<p>First, let us recall that any one of these characters is "whitespace":</p>
<p> <strong><code>&#x09;</code></strong> -- the Ta... |
BlackBerry - Add items to a ListField <p>Can someone please give me a simple example on how to add three rows to a ListField so that the list shows something like this?</p>
<p>Item 1</p>
<p>Item 2</p>
<p>Item 3</p>
<p>I just want to show a list in which the user can select one of the items and the program would do ... | <p>You probably want to look at using an ObjectListField. Handling the select action is done throught the containing Screen object, I've done this below using a MenuItem, I'm not really sure how to set a default select listener, you may have to detect key and trackwheel events.</p>
<p>Some example code for you: (not t... |
Restricting symbols in a Linux static library <p>I'm looking for ways to restrict the number of C symbols exported to a Linux static library (archive). I'd like to limit these to only those symbols that are part of the official API for the library. I already use 'static' to declare most functions as static, but this ... | <p>Static libraries can not do what you want for code compiled with either GCC 3.x or 4.x. </p>
<p>If you can use shared objects (libraries), the GNU linker does what you need with a feature called a version script. This is usually used to provide version-specific entry points, but the degenerate case just distinguish... |
How accurate is System.Diagnostics.Stopwatch? <p>How accurate is <strong>System.Diagnostics.Stopwatch</strong>? I am trying to do some metrics for different code paths and I need it to be exact. Should I be using stopwatch or is there another solution that is more accurate.</p>
<p>I have been told that sometimes stop... | <p>I've just written an article that explains how a test setup must be done to get an high accuracy (better than 0.1ms) out of the stopwatch. I Think it should explain everything.</p>
<p><a href="http://www.codeproject.com/KB/testing/stopwatch-measure-precise.aspx">http://www.codeproject.com/KB/testing/stopwatch-measu... |
Detect the OS from a Bash script <p>I would like to keep my <code>.bashrc</code> and <code>.bash_login</code> files in version control so that I can use them between all the computers I use. The problem is I have some OS specific aliases so I was looking for a way to determine if the script is running on Mac OS&nb... | <p>For my .bashrc, I use the following code:</p>
<pre><code>platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'FreeBSD' ]]; then
platform='freebsd'
fi
</code></pre>
<p>Then I do somethings like:</p>
<pre><code>if [[ $platform == 'linux' ]]; then
... |
Description of what an Interface does? <h2>Duplicate: <a href="http://stackoverflow.com/questions/122883/interfaces-why-cant-i-seem-to-grasp-them">http://stackoverflow.com/questions/122883/interfaces-why-cant-i-seem-to-grasp-them</a></h2>
<p>With regards to OOP,how would you describe an interface?</p>
<p>What i mean ... | <p>I think of objects as <strong>nouns</strong>, methods as <strong>verbs</strong>, and interfaces as <strong>adjectives</strong> (of course this analogy is oversimplified, but frequently works well enough).</p>
<p>Example: an interface <code>Serializable</code> works like an adjective, in that it applies some qualit... |
python introspection not showing functions for Lock <p>When I try to use introspection to look at what methods are available on threading.Lock I don't see what I would expect.</p>
<p>Specifically I don't see acquire, release or locked. Why is this?</p>
<p>Here's what I do see:</p>
<pre><code>>>> dir (threa... | <p>You're doing it wrong. <code>threading.Lock</code> is not an object.</p>
<pre><code>>>> import threading
>>> threading.Lock
<built-in function allocate_lock>
>>> type(threading.Lock)
<type 'builtin_function_or_method'>
>>> x=threading.Lock()
>>> type(x)
<... |
Comb Technology <p>This question is about the rare case of software that is neither in active development nor moribund.</p>
<p>First, why is it so rare for software to ever be finished? It seems "no longer in active development" is often synonymous with "moribund". Second, what are exceptions to this? Donald Knuth'... | <blockquote>
<p>why is it so rare for software to ever be finished?</p>
</blockquote>
<p>Because, as the world always changes, requirement specifications always change.</p>
<blockquote>
<p>Second, what are exceptions to this?</p>
</blockquote>
<p>There are exceptions because there are indeed a few problems that ... |
Extraordinarily Simple Ruby Question: Where's My Class? <p><em>[I'm just starting with Ruby, but "no question is ever too newbie," so I trudge onwards...]</em></p>
<p>Every tutorial and book I see goes from Ruby with the interactive shell to Ruby on Rails. I'm not doing Rails (yet), but I don't want to use the interac... | <p>The easiest way is to put them both in the same file. </p>
<p>However you can also use require, e.g.:</p>
<pre><code>require 'first_class'
</code></pre>
|
Is it worth learning AMD-specific APIs? <p>I'm currently learning the APIs related to Intel's parallelization libraries such as TBB, MKL and IPP. I was wondering, though, whether it's also worth looking at AMD's part of the puzzle. Or would that just be a waste of time? (I must confess, I have no clue about AMD's libra... | <p>The MKL and IPP libraries will perform (nearly) as well on AMD machines. My guess is that TBB will also run just fine on AMD boxes. If I had to suggest a technology that would be beneficial and useful to both, it would be to master the OpenMP libraries. The Intel compiler with the OpenMP extensions is stunningly fas... |
Which Factor GUI tutorial/example app? <p>Is there a non-trivial example application written in Factor language, pregerrably for GUI application which could server as a language tutorial?</p>
| <p>A little late, but theres Factor bindings for Qt in the works. They should be in a usable state reasonably soon.</p>
|
Strange nullreference exception <p>So I have this code that takes care of command acknowledgment from remote computers, sometimes (like once in 14 days or something) the following line throws a null reference exception:</p>
<pre><code>computer.ProcessCommandAcknowledgment( commandType );
</code></pre>
<p>What really ... | <p>Based on the information you gave, it certainly appears impossible for a null ref to occur at that location. So the next question is "How do you know that the particular line is creating the NullReferenceException?" Are you using the debugger or stack trace information? Are you checking a retail or debug version ... |
How to animate a change in css using jQuery <p>Is it possible to animate a change in css using jquery? </p>
<p>If someone would be so kind as to provide me with an example i would be much obliged.</p>
<p>Essentially, i am trying to animate the sprites technique by manipulating the background-image in the css using jQ... | <p>To create a fade effect you need to absolutely position one element on top of the other, and animate the element's opacity down to reveal the image beneath.</p>
<p>Since you can't change the HTML, I suggest you change the markup using JavaScript by dynamically inserting a span that will reveal the new image for you... |
jquery select class inside parent div <p>I'm trying to change the alt of the image i'm clicking by
selecting the image's class 'add_answer'</p>
<p>Note: .add_answer shows up multiple times inside different containing div's</p>
<pre><code>jQuery(function(){ // Add Answer
jQuery(".add_answer").click(function(){
... | <p>you can use the parent div as the scope:</p>
<pre><code> $('.add_answer',$(this).parent('div:first')).attr('alt',count);
</code></pre>
|
Is there a simple way in Python to create a file which can be written to in one thread and read in a different one? <p>In the python program I'm writing, I've got a thread which iterates over a large structure in memory and writes it incrementally into a file-like object. I've got another thread which takes a file-lik... | <p>You should use the <a href="http://docs.python.org/library/queue.html" rel="nofollow">Queue</a> module for sharing sequential data across threads. You would have to make a file-like Queue subclass, where .read and .write mutually block each other, with a buffer in-between.</p>
<p>OTOH, I wonder why the first thread... |
Seems like it should be easy: Landscape Scrolling Text Field <p>I have a application that I am working on that is in landscape mode and does not rotate. However I can not get the text field to rotate. I have been putting in way to many hours so don't be to harsh if this is a easy answer...</p>
| <p>Are you using Interface Builder to create the view? In that case, adding the UITextField to the UIView in landscape mode. In case you do not know how to use IB for creating views in landscape mode, open the UIView object in IB. There is a small arrow on the top-right corner of the view. Click on that arrow to rotate... |
which tool to use to view memory layout of multiple inheritance <p>Is there a tool that I can use to see the multiple inheritance memory layout of compiled C++ code?</p>
| <p>I don't know what exactly you want to know. For this simple example</p>
<pre><code>class classA { };
class classB { };
class classC : public classA, public classB {
};
$ g++ -fdump-class-hierarchy test.cpp
</code></pre>
<p>Outputs the following into a file <code>test.cpp.002t.class</code></p>
<pre><code>Class... |
Override a method at instance level <p>Is there a way in Python to override a class method at instance level?
For example:</p>
<pre><code>class Dog:
def bark(self):
print "WOOF"
boby = Dog()
boby.bark() # WOOF
# METHOD OVERRIDE
boby.bark() # WoOoOoF!!
</code></pre>
| <p>Yes, it's possible:</p>
<pre><code>class Dog:
def bark(self):
print "Woof"
def new_bark(self):
print "Woof Woof"
foo = Dog()
funcType = type(Dog.bark)
# "Woof"
foo.bark()
# replace bark with new_bark for this object only
foo.bark = funcType(new_bark, foo, Dog)
foo.bark()
# "Woof Woof"
</code><... |
How I can get the calling methods in C# <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/171970/how-can-i-find-the-method-that-called-the-current-method">How can I find the method that called the current method?</a></p>
</blockquote>
<p>I need a way to know the n... | <p>from <a href="http://www.csharp-examples.net/reflection-calling-method-name/">http://www.csharp-examples.net/reflection-calling-method-name/</a></p>
<pre><code>using System.Diagnostics;
// get call stack
StackTrace stackTrace = new StackTrace();
// get calling method name
Console.WriteLine(stackTrace.GetFrame(1).... |
How to write an automated test for thread safety <p>I have a class which is not thread safe:</p>
<pre><code>class Foo {
/* Abstract base class, code which is not thread safe */
};
</code></pre>
<p>Moreover, if you have foo1 and foo2 objects, you cannot call foo1->someFunc() until foo2->anotherFunc() has returne... | <p>You might want to check out <a href="http://Research.Microsoft.Com/CHESS/"><em>CHESS: A Systematic Testing Tool for Concurrent Software</em></a> by Microsoft Research. It is a testing framework for multithreaded programs (both .NET and native code).</p>
<p>If I understood that correctly, it replaces the operating s... |
Flex: How does the compiler know about dependencies? <p>I'm completely new to Flex and am just having a play with a sample application from the Mate framework. I'm hacking on Linux so I'm using the command prompt and a text editor rather than Flex Builder.</p>
<p>The sample app has two folders in its root directory li... | <p>You have to specify the path to the libraries, this can be done by either using a command line argument or putting it in a configuration file. See:</p>
<p><a href="http://livedocs.adobe.com/flex/3/html/compilers_19.html#158337" rel="nofollow">http://livedocs.adobe.com/flex/3/html/compilers_19.html#158337</a></p>
|
Quick Java question: Casting an array of Objects into an array of my intended class <p>Just for review, can someone quickly explain what prevents this from working (on compile):</p>
<pre><code>private HashSet Data;
...
public DataObject[] getDataObjects( )
{
return (DataObject[]) Data.toArray();
}
</code></pre>
... | <p>Because <code>toArray()</code> creates an array of Object, and you can't make <code>Object[]</code> into <code>DataObject[]</code> just by casting it. <code>toArray(DataObject[])</code> creates an array of <code>DataObject</code>.</p>
<p>And yes, it is a shortcoming of the Collections class and the way Generics we... |
Extern keyword and unresolved external symbols <p>I drew a little graph in paint that explains my problem:</p>
<p>But it doesn't seem to show up when I use the <code><img></code> tag after posting?</p>
<p>Graph:</p>
<p><img src="http://i44.tinypic.com/103gcbk.jpg" alt="http://i44.tinypic.com/103gcbk.jpg"></p>
| <p>The problem is the scope of the declaration of db. The code:</p>
<pre><code>extern Database db;
</code></pre>
<p>really means "db is declared <em>globally somewhere</em>, just not here". The code then does not go ahead and actually declare it globally, but locally inside main(), which is not visible outside of m... |
Configure Emacs FlyMake to use Rakefile as well as Makefile <p>I have been learning to use Emacs for a little while now. So far liking it a lot.</p>
<p>My problem is that for little C codes I prefer using Rake instead of Make. However flymake does not seem to want anything else than Make. As it complains that it can n... | <p>Right, got it now; sorry about the earlier confusion.</p>
<p>Taking a quick look through flymake.el, for *.c files, the 'make' invocation ultimately comes from here:</p>
<pre><code>(defun flymake-get-make-cmdline (source base-dir)
(list "make"
(list "-s"
"-C"
base-dir
(concat "C... |
jQuery UI Datepicker and datejs <p>I want to have a datepicker where you can also just type basically I want to have the jQuery UI Datepicker and datejs in one. I want to type "tomorrow" and I want it to select the right day. I want to be able to type "saturday" and it actually getting the date right.</p>
| <p>If you have any experience creating jQuery plugins, the work is not too difficult. Wrap the target input with the code required to create the UI datepicker AND value testing (with date.js) on keyup/blur/whichever events you deem necessary. You'll need to ensure that you set the date on the datepicker instance when t... |
Extend System.Windows.Forms.ComboBox <p>I would like to extend the System.Windows.Forms.ComboBox control with a ReadOnly property, which would display the selected itemâs text (similar to a label) when ReadOnly = true. (I do not like the disabled look achieved by setting Enabled=false)</p>
<p>How do I do this in win... | <p>Do what windows does.<br>
Have just 1 item in the combobox and let it be selected and enabled.</p>
|
Can I use a ForeignKey in __unicode__ return? <p>I have the following classes: Ingredients, Recipe and RecipeContent...</p>
<pre><code>class Ingredient(models.Model):
name = models.CharField(max_length=30, primary_key=True)
qty_on_stock = models.IntegerField()
def __unicode__(self):
return self.na... | <pre><code>class RecipeContent(models.Model):
...
def __unicode__(self):
# You can access ForeignKey properties through the field name!
return self.recipe.name
</code></pre>
|
Preventing a second instance from running except in a specific case <p>Okay, I have this program and I don't want more than one instance of it running. So what I have right now is it grabs all instances that match it's name, and if there are more than one it quits and lets the user know it's already running in another ... | <p>The thing that complicates this is the fact that you want, in certain conditions, to allow a second invocation of the program to do something if another one is running. Using the named mutex will allow you to detect whether the program is already running -- it should be holding the mutex already. You will still nee... |
What are the steps I need to take to add nice java code formatting to my blogger/blogspot blog? <p>I'm looking for a sequence of steps to add java code formatting to my blogspot blog. </p>
<p>I'm really looking for a dummies guide - something so simple a cleaner could follow it if they found it on a piece of paper on ... | <p>I use <a href="http://code.google.com/p/google-code-prettify/">Google prettify</a> script (StackOverflow uses it also), here you can find a good guide for using it with blogger:</p>
<ul>
<li><a href="http://sunday-lab.blogspot.com/2007/10/source-code-high-light-in-blogger.html">Source code high-light in Blogger</a>... |
URL mapping in PHP? <p>I come from a Java background and with any servlets-based technology, it's trivial to map a range of URLs (eg /reports/<em>, /secure/</em>.do) to a specified servlet. Now I'm less familiar with PHP but I haven't yet seen anything that does quite the same thing with PHP (or mod_php). It's entire... | <p>With Apache, you are able to setup URL Rewriting for your php pages with mod_rewrite, check this resources:</p>
<ul>
<li><a href="http://www.sitepoint.com/article/guide-url-rewriting/">mod_rewrite: A Beginner's Guide to URL Rewriting</a></li>
<li><a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">Modul... |
Count occurrences of a word in a row in MySQL <p>I'm making a search function for my website, which finds relevant results from a database. I'm looking for a way to count occurrences of a word, but I need to ensure that there are word boundaries on both sides of the word ( so I don't end up with "triple" when I want "... | <p>This is not the sort of thing that relational databases are very good at, unless you can use fulltext indexing, and you have already stated that you cannot, since you're using InnoDB. I'd suggest selecting your relevant rows and doing the word count in your application code.</p>
|
PHP vs. application server? <p>For those of you who have had the opportunity of writing web applications in PHP and then as an application server (eg. Python-based solutions like CherryPy or Pylons), in what context are application servers a better alternative to PHP?</p>
<p>I tend to favor PHP simply because it's ava... | <p>The advantage of deployment for PHP is a huge one. You will also have a large developer base, and sound like you already have considerable expertise. In general if you know how to use a programming language well, you are safer to stick with it.</p>
<p>The advantages of using a Python web framework like Pylons are t... |
Is it Wise to Spend Cash on a C++ Book Keeping in View the Upcoming C++0x? <p>I just purchased <em>C++ GUI Programming with Qt4</em> and after reading the code samples in this book I'm beginning to realize that my knowledge of C++ is incomplete. I learned C++ two years ago from online tutorials and a couple of ebooks I... | <p>I wouldn't hold my breath for C++0x. I doubt it will be out by the end of this decade. Even when it will be out, you should probably count a year or so for compilers to implement it. Learn the fundamentals now, and it should be relatively easy for you to learn most of the new features when the standard is out. T... |
What is the best way to check for memory leaks in c++? <p>I'm implementing a sparse matrix with linked lists and it's not fun to manually check for leaks, any thoughts? </p>
| <p>The <a href="http://valgrind.org/"><code>valgrind</code></a> profiler for Unix offers a decent leak detection.</p>
<p>However, this is only one part of a successful approach. The other part is to prevent (i.e. minimize) explicit memory handling. Smart pointers and allocators can help a great deal in preventing memo... |
gridview control capable of displaying rich text in WinForms <p>I'm looking for a WinForms control that would allow me to display data in a table like manner but with some rich content such as different font colors, images. I do not need data-binding etc., just a "table of RichTextBox controls". I suppose it wouldn't b... | <p>You always have the option of creating your own DataGridView column type. I've done this a few times recently and found that it works quite well. It takes surprisingly little code and knowledge of GDI to put together something very nice.</p>
<p>What information are you trying to display in your grid?</p>
|
Lazy binding functions to multiple events with jQuery <p>Here's the scenario: I have a set of buttons that I want to bind to corresponding functions when clicked. The ids of these buttons are the same as the names of their corresponding functions. I could do this:</p>
<pre><code>$("#kick").click(kick);
$("#push").clic... | <p>Like the other answerers, I'm not sure that this is "true" laziness (as in the programmer's virtue), but only you know your implementation details.</p>
<p>If you really want to do something like this, you can use an object to store your particular functions and then use the string to look them up:</p>
<pre><code>v... |
Web for mobile devices - best practices for ASP.NET <p>Starting to build web applications for mobile devices (any phone). <br/>
What would be the best approach using ASP.NET 3.5/ASP.NET 4.0 and C#?
<br/></p>
<p>UPDATE (feb2010) <br/>
Any news using windows mobile 7?<br/></p>
| <p>It depends if you really want to <strong>support every cell phone</strong> or only high end or new phone like the iPhone which don't have many limitations rendering web pages. If you could ask for real <strong>HTML rendering, Javascript and cookies support on the phone as requirement</strong>, then the real constrai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.