instruction stringlengths 0 30k ⌀ |
|---|
I'd second http://descriptors.blogspot.com/ This is invaluable for getting to grips with Descriptors.
Also, sites such as newlc.com have forums for Symbian C++ specific code problems. |
NAnt best practicies |
|.net|nant|coding-style| |
I have here 300 lines long NAnt file and it is quite a messy. I am wondering if there is a any style guide for writing NAnt scripts and what are the best practices for doing so.
Any tips? |
I can't really help with organization or best practices, but an [NUnit][1] extension appears to be available for forms testing, [NUnitForms][2].
[1]: http://www.nunit.org/index.php
[2]: http://www.google.com/search?q=nunitforms |
@Michael Well, java.sql.Connection is an Interface - it might technically be possible for the concrete implementation you're getting from JBoss to be Serializable - but I don't think you're really going to have any options you can use. If it was possible, it would probably be easy :)
I think @toolkit might have said... |
I don't use VB, but here it goes.
I found [Using the Value of a Control][1], but it's not a programmatic solution.
If you have access to the code, look for
Attribute Value.VB_UserMemId = 0
using Notepad.
[1]: http://msdn.microsoft.com/en-us/library/aa733705%28VS.60%29.aspx |
If you have industry specific translations, you will likely need a thesaurus. For example, I worked in the jewelry industry and there were abbreviate in our descriptions such as kt - karat, rd - round, cwt - carat weight... Endeca (the search engine at that job) has a thesaurus that will translate from common misspell... |
The following book is an introduction to the subject.
There are as many ways as there are developers out there..
http://pragprog.com/titles/idgtr/scripted-gui-testing-with-ruby |
Take a look at [Geonames.org][1]
It's a free webservice that allow you to get a lot of informations from a long/lat
[They also provide a free (and open source) Java Client for GeoNames Webservices library (library for other language also provided: ruby, python, perl, lisp...)][2]
Here's some info you can get f... |
Take a look at [Geonames.org][1]
It's a free webservice that allow you to get a lot of informations from a long/lat
[They also provide a free (and open source) Java Client for GeoNames Webservices library (library for other language also provided: ruby, python, perl, lisp...)][2]
Here's some info you can get f... |
When the CSS is served by a server-side script, eg. PHP, usually coders make the CSS as a template file and substitute the colors at run-time. This might be used to let users choose a color model, too.
Another way, to avoid parsing this file each time (although cache should take care of that), or just if you have a ... |
Explain Plan Cost vs Execution Time |
|oracle-database|optimization| |
Before, I have found the "Cost" in the execution plan to be a good indicator of relative execution time. Why is this case different? Am I a fool for thinking the execution plan has relevance? What specifically can I try to improve v_test performance?
Thank you.
Using Oracle 10g I have a simple query view defined ... |
Before, I have found the "Cost" in the execution plan to be a good indicator of relative execution time. Why is this case different? Am I a fool for thinking the execution plan has relevance? What specifically can I try to improve v_test performance?
Thank you.
Using Oracle 10g I have a simple query view defined ... |
Any one-way encryption algorithm such as Blowfish will do, I guess. Blowfish is fast and open. You can use Blowfish through the crypt() function. AFAIK there are no encryption algorithm that work especially well on small strings. One thing to be aware of though is that brute-forcing such small strings will be very easy... |
The primary documentation for the Farseer Physics engine is on the homepage.
[http://www.codeplex.com/FarseerPhysics/Wiki/View.aspx?title=Documentation&referringTitle=Home][1]
You can also check out the source code, they have a demos folder in there, though it's only got one example, but it can show you how to im... |
Build new computer using Scripts |
|windows|scripting|build-automation| |
I would like to automate the process of setting up a new PC, this would include downloading and installing the latest windows and office updates; installing software from a network share (some software will require a restart so the script would need to be able to login and continue) adding PC to a domain and setting up... |
What is a good CI build-process |
|build-process|build-automation|continuous-integration| |
I use APC because it was easy to install in windows and I'm developing on WAMP.
Integrating APC into PHP6 was discussed here:
http://www.php.net/~derick/meeting-notes.html#add-an-opcode-cache-to-the-distribution-apc
And there are directions on installing APC on Debian Etch here:
http://www.howtoforge.com/apc-p... |
Coolest C# LINQ/Lambdas trick you've ever pulled? |
|c#|linq|lambda|functional-programming| |
Saw a post about hidden features in C# but not a lot of people have written linq/lambdas example so... I wonder...
> What's the coolest (as in the most elegant) use of the C# LINQ and/or Lambdas/anonymous delegates you have ever saw/written?
Bonus if it has went into production too! |
|c#|linq|functional-programming|lambda| |
I can't tell you for sure, but the place where I am working now is looking at APC and eAccelerator. However, this might influence you - I read somewhere on the PHP site that APC would be integrated into a future release of PHP (v6, I think, but I could be wrong on that). |
I can't tell you for sure, but the place where I am working now is looking at APC and eAccelerator. However, this might influence you - [APC will be integrated into a future release of PHP][1] (thanks to Ed Haber for the link).
[1]: http://www.php.net/~derick/meeting-notes.html#add-an-opcode-cache-to-the-distrib... |
http://herdingcode.com/
|
Have you tried working with your customer to define / formulate **acceptance tests**?
Using a something like Fit to come up with these tests - would result in better specs as well as force the customer to think about what is really required.
That is of course, if your customers are available and open to this appr... |
Have you tried working with your customer to define / formulate **acceptance tests**?
Using something like Fit to come up with these tests - would result in better specs as well as force the customer to think about what is really required. The icing on the cake is instant-doc-executable specs at the end of this proc... |
I have used SubSonic and EntitySpaces. Once you get the hang of them, I beleive they can save you time, but as complexity of your app and volume of data grow, you may outgrow these tools. You start to lose time trying to figure out if something like a performance issue is related to the ORM or to your code. So, to a... |
You should store the current language somewhere (in a [singleton][1], for instance) and in the product.Name property use the language setting to get the correct string. This way you only have to write the language specific code once for each field rather than thinking about languages everywhere the field is used.
... |
As far as I remember, the Microsoft "[SQL Server Migration Assistant for Access][1]" will properly migrate OLE Images, but this is only for Access->SQLServer. However, what you can do is use this to migrate to SQLServer Express (free download) and then migrate from SQLServer to MySQL.
[1]: http://www.microsoft.c... |
what is the difference between #include <filename> and #include "filename" |
|c|include|difference| |
in the programming language C, what is the difference between #include <filename> and #include "filename" |
|c|include| |
in the programming language C, what is the difference between #include < filename > and #include "filename" |
|c|include|vote-fishing| |
|c|include| |
I would recommend using [Qt](http://trolltech.com/products/qt).
There is an open-source licence as well as a commercial licence. |
In Java:
package somepackage;
class SomeClass {}
In C++:
namespace somenamespace {
class SomeClass {}
}
And using them, Java:
import somepackage;
And C++:
using namespace somenamespace;
Also, full names are "somepackge.SomeClass" for Java and "somenamespace::So... |
> you have access to the code, look for
Unfortunetly I don't have access to the code for most of the controls. However the link is useful for the Microsoft Controls, but I still would like a way to know for other controls.
|
I think this depends on how big your website it. On our local Intranet which is used by about 500 member of staff, I simply look at the search phrases that returned zero results and enter that search phrase with the new suggested search phrase into a SQL table.
I them call on that table if no search results has been... |
Have you tried using [Marshal#load][1]? I'm not sure how you're generating those session files, but it's quite possible Rails just uses Marshal.
[1]: http://corelib.rubyonrails.org/classes/Marshal.html |
Kyle's solution would obviously not catch situations were the data set does not follow the rules. If all numbers were in pairs the algorithm would give a result of zero, the exact same value as if zero would be the only value with single occurance.
If there were multiple single occurance values or triples, the resul... |
What is the best way of testing a function that throws on failure? Or testing a function that is fairly immune to failure?
For instance; I have a I/O Completion Port class that throws in the constructor if it can't initialise the port correctly. This uses the Win32 function of CreateIoCompletionPort in the initialis... |
|bestpractices|unittesting| |
|unit-testing| |
What is the best way of testing a function that throws on failure? Or testing a function that is fairly immune to failure?
For instance; I have a I/O Completion Port class that throws in the constructor if it can't initialise the port correctly. This uses the Win32 function of CreateIoCompletionPort in the initialis... |
IllegalArgumentException or NullPointerException for a null parameter? |
|java|bestpractices|exception|null| |
I have a simple setter method for a Java property and null is not appropriate for this particular property. I have always been torn, in this situation: should I throw an [IllegalArgumentException][1], or a [NullPointerException][2]? From the javadocs, both seem appropriate. Is there some kind of understood standard?... |
|java|exception|null| |
Removing N items from a list conditionally |
> In both cases above I want to inject one or more strings into the middle of a predefined template string.
In which case, I would suggest String.Format is the quickest because it is design for that exact purpose. |
Two more general-purpose mechanisms for fixing some of Eclipse's idiosyncrasies:
- Close and open the project
- Delete the project (but not from disk!) and reimport it as an existing project
Failing that, [bugs.eclipse.org][1] might provide the answer.
If the workspace is caching something broken, you m... |
String.Format actually uses a StringBuilder internally:
public static string Format(IFormatProvider provider, string format, params object[] args)
{
if ((format == null) || (args == null))
{
throw new ArgumentNullException((format == null) ? "format" : "args");
}
... |
String.Format actually uses a StringBuilder internally:
public static string Format(IFormatProvider provider, string format, params object[] args)
{
if ((format == null) || (args == null))
{
throw new ArgumentNullException((format == null) ? "format" : "args");
}
... |
String.Format actually uses a StringBuilder internally:
public static string Format(IFormatProvider provider, string format, params object[] args)
{
if ((format == null) || (args == null))
{
throw new ArgumentNullException((format == null) ? "format" : "args");
}
... |
Rhino's latest release includes much of the sweet sweet 3.5 love that MoQ has. I'm a fan of MoQ, so that's what I'm using. But I also have Rhino, in case it does something that MoQ doesn't do.
TL;DR: MoQ it baby. |
You can use macros, just do C-x( then do everything for the macro, then C-x) to end the macro, then C-xe will execute the last defined macro. Then, you can store the definition using M-x insert-kbd-macro which will put the macro into your current buffer, and then you can store it in your .emacs file. |
You can use macros, just do C-x( then do everything for the macro, then C-x) to end the macro, then C-xe will execute the last defined macro. Then, you can name it using M-x name-last-kbd-macro which lets you assign a name to it, which you can then invoke with M-x, then store the definition using M-x insert-kbd-macro ... |
You can use macros, just do C-x( then do everything for the macro, then C-x) to end the macro, then C-xe will execute the last defined macro. Then, you can name it using M-x name-last-kbd-macro which lets you assign a name to it, which you can then invoke with M-x, then store the definition using M-x insert-kbd-macro ... |
You can use macros, just do C-x( then do everything for the macro, then C-x) to end the macro, then C-xe will execute the last defined macro. Then, you can name it using M-x name-last-kbd-macro which lets you assign a name to it, which you can then invoke with M-x, then store the definition using M-x insert-kbd-macro ... |
Actually, LINQ has Skip and Take methods which can be combined to choose which records are fetched.
Check those out.
For DB: <http://www.singingeels.com/Articles/Pagination_In_SQL_Server_2005.aspx>
|
On MS SQL Server, [ROW_NUMBER()][1] seems to work:
[http://blogs.x2line.com/al/archive/2005/11/18/1323.aspx][2]
DECLARE @PageNum AS INT;
DECLARE @PageSize AS INT;
SET @PageNum = 2;
SET @PageSize = 10;
WITH OrdersRN AS
(
SELECT ROW_NUMBER() OVER(ORDER BY OrderDate, Order... |
The [LINQ Raytracer][1] certainly tops my list =)
I'm not quite sure if qualifies as elegant but it is most certainly the coolest linq-expression I've ever seen!
[1]: http://blogs.msdn.com/lukeh/archive/2007/10/01/taking-linq-to-objects-to-extremes-a-fully-linqified-raytracer.aspx |
The [LINQ Raytracer][1] certainly tops my list =)
I'm not quite sure if qualifies as elegant but it is most certainly the coolest linq-expression I've ever seen!
Oh, and just to be extremely clear; I did *not* write it ([Luke Hoban][2] did)
[1]: http://blogs.msdn.com/lukeh/archive/2007/10/01/taking-linq-to... |
TBH, I have had a couple of instances like this where files "seemed to go crazy".. However, upon investigation it has appeared that the files have changed in some way, shape or form.. (e.g. sometimes changes can be made to the file by inadvertantly changing a property somewhere that _seems_ unrelated).
I think there... |
OK, sorry that didn't work... I am no expert on ASP.NET impersonation, I tend to use app pools which I don't think you can do on W2K Have you tried writing a tiny little test app which does the same query, and then running that as various users?
I am reluctant to post a chunk of MS framework code here, but you... |
I don't know for sure what will be the best for your brother, but I know I started with python. I've been playing various games from a very early age and wanted to make my own, so my uncle introduced me to python with the [pygame][1] library. It has many tutorials and makes it all easy (WAY easier than openGL in my opi... |
It would help if you could describe the grammar you are currently using to parse. Sounds like the problem might lie there! |
It would help if you could describe the grammar you are currently using to parse. Sounds like the problem might lie there!
Edit:
The fact that you don't understand the grammar question and that 'you've written this by hand' very likely explains why you're having problems with expressions of the form '1+11*5' (i.e... |
You can automate GUI testing using [White][1] framework.
Also consider using TDD friendly design, i.e. use MVP/MVC pattern.
I would highly recommend you to read documentation from Microsoft patterns&practies teams.
Especially have a look at the [Composite UI application block][2] and [CompositeWPF][3].
... |
You can automate GUI testing using [White][1] framework.
Also consider using TDD friendly design, i.e. use [MVP/MVC][2] pattern.
I would highly recommend you to read documentation from Microsoft patterns&practies teams.
Especially have a look at the [Composite UI application block][3] and [CompositeWPF][4]. ... |
@[Keith](#41531) -
> In your comparison between
> IEnumerable<int> and
> IEnumerable<double> you don't need to
> worry - if you pass the wrong type
> your code won't compile anyway.
That isn't quite true - if a method is overloaded to both IEnumerable<int> and IEnumerable<double> then it may sile... |
No, that will just concatenate the output from `ls` and the contents of `directory`.
But you can do this:
#!/usr/bin/env ruby
directory = '/home/paulgreg/'
`ls #{directory}`
|
Also, note that you can add to a namespace. This is clearer with an example, what I mean is that you can have:
`namespace MyNamespace
{
double square(double x) { return x * x; }
}`
in a file square.h, and
`namespace MyNamespace
{
double cube(double x) { return x * x * x; }
}`
in a file cube.h.... |
Note that a namespace in C++ really is just a name space. They don't provide any of the encapsulation that packages do in Java, so you probably won't use them as much. |
Store more than 3GB of video-frames in memory, on 32-bit OS |
|linux|memory|32-bit| |
At work we have an application to play 2K (2048*1556px) OpenEXR film sequences. It works well.. apart from when sequences that are over 3GB (quite common), then it has to unload old frames from memory, despite the fact all machines have 8-16GB of memory (which is addressable via the linux BIGMEM stuff).
The frames h... |
String.Format actually uses a StringBuilder internally:
public static string Format(IFormatProvider provider, string format, params object[] args)
{
if ((format == null) || (args == null))
{
throw new ArgumentNullException((format == null) ? "format" : "args");
}
... |
As far as I know you cannot find the compression level of an already compressed file. When you are compressing the file you can specify the compression level with -# where the # is from 1 to 9 (1 being the fastest compression and 9 being the most compressed file). In practice you should never compare a compressed file ... |
You might want to check out [Google's Performance Tools][1]. They've released their version of malloc they use for multi-threaded applications. It also includes a nice set of profiling tools.
[1]: http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools |
I would expect **String.Format** to be slower - it has to parse the string and *then* concatenate it.
Couple of notes:
- **Format** is the way to go for user-visible strings in professional applications; this avoids localization bugs
- If you know the length of the resultant string beforehand, use the **St... |
I always work to prevent things like injection attacks. However, when you work on an internal intranet site, most of the security features feel like wasted effort. I still do them, maybe just not as well. |
Interesting, I'll give it a shot. The variation aren't slight, however. The newly encoded file is longer and comparing the binary of the before and after, the data hardly matches up at all. |
Interesting, I'll give it a shot. The variations aren't slight, however. The newly encoded file is longer and when comparing the binary of the before and after, the data hardly matches up at all.
Before (the first four lines)
application/vnd.xfdl;content-encoding="base64-gzip"
H4sIAAAAAAAAC+19eZOiyNb3/34K3r4RT... |
PHP - Determine Parent Node Of DOMElement |
|php|xml|dom| |
I'm translating my C# code for YouTube video comments into PHP. In order to properly nest comment replies I need to re-arrange XML nodes. In PHP I'm using DOMDocument and DOMXPath which closely corresponds to C# XmlDocument. I've gotten pretty far in my translation but now I'm stuck on getting the parent node of a DOME... |
The problem is I'm worried about breaking the build in the meantime while I'm moving folders in StarTeam. I suppose the only way to avoid that is to be ready to upload updated project files as soon as I move things around in StarTeam and do it as quickly as possible. |
this is because if the data you insert is not in the order of the index, SQL will have to split pages to make room for additional rows to keep them together logically |
You should NEVER EVER create an index on an empty table if you are going to massively load it right afterwards.
Indexes have to maintained as the data on the table changes, so imagine as if for every insert on the table the index was being recalculated (which is an expensive operation).
Load the table first and creat... |
In general, avoid allocating from the heap unless you have to. If you have to, use reference counting for objects that are long-lived and need to be shared between diverse parts of your code.
Sometimes you need to allocate objects dynamically, but they will only be used within a certain span of time. For example, in... |