instruction stringlengths 0 30k ⌀ |
|---|
I'm pretty sure that dropdown has to have some item selected; I usually add an empty list item
this.myDropDownList.Items.Add("");
As my first list item, and proceed accordingly. |
It's not a very elegant solution, but you could block the site's crawler bot, then rename your mp3 files to break the links already on the site. |
[advanced installer][1] makes it easy to package java apps as windows executables, and it's quite flexible in the way you can set it up. I've found that for distributing java applications to windows clients, this is the easiest way to go.
[1]: http://www.advancedinstaller.com/ |
As far as I know that is not possible. It is not an open source database, so writing drivers for it is really hard. |
There are a variety of solutions, depending on your distribution requirements.
(1) Just use a jar. This assumes that the user has the the correct java version installed, otherwise the user will get "class-file format version" exceptions. This is fine for internal distribution inside a company.
(2) Use launch4j an... |
I'm not trying to be smart here, but if the admin interface of Joomla isn't working for you, aren't you doing yourself a disservice by trying to patch their UI instead of spending your time looking for a CMS that is easier to manage/a better fit for your user base? |
I'm not trying to be smart here, but if the admin interface of Joomla isn't working for you, aren't you doing yourself a disservice by trying to patch their UI instead of spending your time looking for a CMS that is easier to manage/a better fit for your user base?
**Edit:** All of the CMS's I've dealt with in ASP.N... |
How are you running the tests? Are you using a .vsmdi file or just specifying that you run all tests in *Tests.dll assemblies?
If it is the latter and you are using TFS 2008, then you need to add the following to the and of the first PropertyGroup in your TFSBuild.proj file for the build.
<RunConfigFile>$(... |
|sql-server|sqlserver2005|snapshot| |
We would like to be able to nightly make a copy/backup/snapshot of a production database so that we can import it in the dev environment.
We don't want to log ship to the dev environment because it needs to be something we can reset whenever we like to the last taken copy of the production database.
We need to b... |
|sql-server|snapshot| |
We would like to be able to nightly make a copy/backup/snapshot of a production database so that we can import it in the dev environment.
We don't want to log ship to the dev environment because it needs to be something we can reset whenever we like to the last taken copy of the production database.
We need to b... |
The algorithm you're looking for is the "longest common substring problem". From there it is easy to determine the differences. See Wikipedia:
<http://en.wikipedia.org/wiki/Diff#Algorithm> |
Not in tortoise but in command line.
svn info
will return what rev you are checked out on. |
Perl: variable scope issue with CGI & DBI modules |
|perl|variables|scope|cgi|module| |
I've run into what appears to be a variable scope issue I haven't encountered before. I'm using Perl's CGI module and a call to DBI's do() method. Here's the code structure, simplified a bit:
use DBI;
use CGI qw(:cgi-lib);
&ReadParse;
my $dbh = DBI->connect(...............);
my $test = $in{te... |
What's the best Free C++ Profiler for windows (if there are) |
|c++|windows|free|profile| |
I'm looking for a profiler in order to find the bottleneck of my c++ code.
I'd like to find a free, non intrusive, good profiling tool.
I'm a game developer and I use PIX for Xbox360, I found it very good (but not free)
I know the Intel v-Tune, but it's not free.
There exists any free profiling tool? |
Getting multiple file sizes for a preloader |
|flash|actionscript-3| |
Alright, currently I have my SWF hitting a php file that will go and find all the files I specify to it, add their sizes together and return their combined sizes as one number. I then use this number with a ProgressEvent listener to determine the current percentage of files downloading for that particular section of th... |
How to Audit Database Activity without Performance and Scalability Issues? |
|database|performance|oracle-database|audit| |
I have a need to do auditing all database activity regardless of whether it came from application or someone issuing some sql via other means. So the auditing must be done at the database level. The database in question is Oracle. I looked at doing it via Triggers and also via something called Fine Grained Auditing tha... |
Your problem might not be with the framerate but with keyframes and markers. |
You have to iterate through 0 or 1 to N and add them by hand. Or, you could just create your function f(int n), and in that function, you cache the results inside session or a global hashtable or dictionary.
Pseudocode, where ht is a global Hashtable or Dictionary (strongly recommend the later, because it is strong... |
Considering such code:
class ToBeTested {
public:
void doForEach() {
for (vector<Contained>::iterator it = m_contained.begin(); it != m_contained.end(); it++) {
doOnce(*it);
doTwice(*it);
doTwice(*it);
}
}
void doOnce(Contained & c) ... |
|c++|unit-testing|tdd| |
Considering such code:
class ToBeTested {
public:
void doForEach() {
for (vector<Contained>::iterator it = m_contained.begin(); it != m_contained.end(); it++) {
doOnce(*it);
doTwice(*it);
doTwice(*it);
}
}
void doOnce(Contained & c) ... |
I don't know about the performance here, but if you set up the LINQ to SQL data context class you should be able to query a database table with a .Select(...) or .Where(...). You should be able to build lambda expressions for either of these dynamically. You might look into dynamic generation of lambda expressions for... |
scanf() (and cin) statements skipped when using gcc. |
|memory|gcc|scanf| |
When multiple scanf() statements are encountered in the code, then, except the first scanf() statement, all others are skipped, that is, there is no prompt for input for those scanf() statements when the code is run.
I have a tried a few suggestions. For eg, use of flushall() was suggested on some site, but that giv... |
[zerobugs][1]
[1]: http://www.zerobugs.org/ |
Like some other people already have suggested: there are more good Java IDEs besides Eclipse. The strong point of Eclipse is the plug-in system. There's a wealth of functionality available and some of it is indeed very good. That said: I do not use Eclipse, but NetBeans at the moment. NetBeans feels less clunky, is mor... |
Best way to get the color where a mouse was clicked in AS3 |
|apache-flex|actionscript|3|as3|flash| |
I have an image (mx) and i want to get the uint of the pixel that was clicked.
Any ideas? |
|apache-flex|flash|actionscript-3| |
to give a specific answer to your problem, I'd suggest moving the above mentioned method into a module to be included by the models in question; so you'd have
class Contact
include NarrowFind
...
end
PS. watch out for sql escaping of the account_id, you should probably use the `:conditions... |
You can only instantiate MethodLocalInner within aMethod. So do
void aMethod() {
class MethodLocalInner {
void bMethod() {
System.out.println("Inside method-local bMethod");
}
}
MethodLocalInner foo = new MethodLocalInner(... |
Within the method *aMethod* after the declaration of the class *MethodLocalInner* you could for instance do the following call:
new MethodLocalInner().bMethod(); |
Asychronous Programming in Python Twisted |
|python|asynchronous|twisted| |
I'm having trouble developing a reverse proxy in Twisted. It works, but it seems overly complex and convoluted. So much of it feels like voodoo...
Are there any *simple, solid* examples of asynchronous program structure on the web or in books? A sort of best practices guide? When I complete my program I'd like to be... |
Have a look at [XPCOM][1], there might be something that you can use if Firefox 3 is used by a client.
[1]: http://www.mozilla.org/projects/xpcom/ |
From [this site][1]: (put this in your .htaccess file)
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://((www\.)?dizzler\.com [NC]
RewriteRule .* - [F]
[1]: http://www.javascriptkit.com/howto/htaccess14.shtml |
If you do not want to include extra packages, you can just do
open(TMP,">tmpfile");
print TMP $tmpdata ;
open(RES,"$yourcommand|");
$res = "" ;
while(<RES>){
$res .= $_ ;
}
which is the contrary of what you suggested, but should work also.
|
Well, after more than 4 hours of debugging, I have found that the DataGridView row height was too small for the checkbox to be painted, so it was not displayed at all. I have found this after an accidental row height resizing.
As a solution, you can set the AutoSizeRowsMode to AllCells.
richDataGrid.AutoSizeRowsM... |
Another book that has not been mentioned yet, and SHOULD be required reading for EVERY programmer, newbies on up to gurus, in ANY programming language, is Michael Howard's Writing Secure Code (2nd Edition) from MSPress. |
Spelling alternatives are often implemented by using the [Levenshtein distance][1] between two words (the one the user typed, en the one inside, for example, your database)
here is the pseudocode for the algorithm
([from wikipedia][2]):
int LevenshteinDistance(char s[1..m], char t[1..n])
// d is a ... |
I know of two solutions. The first (documented [here][1]) is essentially the same as manveru's—set the ENV variable directly in your code.
The second is to create a wrapper around the Ruby interpreter that Passenger uses, and is documented [here][2] (look for passenger_with_ruby). The gist is that you create (and po... |
Try something like...
int digit = 0;
int value = 11031;
while(value > 0)
{
digit = value % 10;
/* Do something with digit... */
value = value / 10;
} |
Here's a list:
- summary
- param
- returns
- example
- code
- see
- seealso
- list
- value
- author
- file
- copyright
Here's an example:
<pre>
<file>
<copyright>(c) Extreme Designers Inc. 2008.</copyright>
<author>Kevin Driedger</author>
<datecreated>2008-0... |
Try increasing the logging sensitivity for the Tomcat application server.
http://tomcat.apache.org/tomcat-5.5-doc/logging.html
You can increase the sensitivity to FINEST or ALL for most of them for a few days and see if that helps you catch anything. |
int count_digit(int nr, int digit) {
int count=0;
while(nr>0) {
if(nr%10==digit)
count++;
nr=nr/10;
}
return count;
}
|
One possiblity is to use a NULL pointer as a flag value:
const char *list[] = {"dog", "cat", NULL};
for (char **iList = list; *iList != NULL; ++iList)
{
cout << *iList;
} |
Here is what we use:
1. First number = Overall system era. Changes every couple of years and typically represents a fundamental change in technology, or client features or both.
2. Second number = database schema revision. An increment in this number requires a database migration and so is a significant change (o... |
Are there CScope-style source browsers for other languages besides C/C++ on Windows? |
|vim| |
I'm specifically interested in tools that can be plugged into Vim to allow CScope-style source browsing (1-2 keystroke commands to locate function definitions, callers, global symbols and so on). I'm not interested in IDE-based tools since I know Microsoft and other vendors already address that space -- I prefer to use... |
What can be stepped through is going to be limited by the debugging information that g++ produces, to a large extent. Emacs provides an interface to gdb that lets you control it via the toolbars/menus and display data in separate windows, as well as type gdb commands directly. Eclipse's CDT provides similar tools. I've... |
Outlook + Perl + Win32::Ole: How do you select calendar entries sorted by date? |
|perl|outlook|winapi| |
Current code opens up an Outlook Calendar database as follow:
my $outlook = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit');
my $namespace = $outlook->GetNamespace("MAPI");
## only fetch entries from Jan 1, 2007 onwards
my $restrictDates = "[... |
|perl|winapi|outlook| |
Current code opens up an Outlook Calendar database as follow:
my $outlook = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit');
my $namespace = $outlook->GetNamespace("MAPI");
## only fetch entries from Jan 1, 2007 onwards
my $restrictDates = "... |
I've been responsible for developing several internal web applications over the past year.
Our solution was using Windows Authentication (Active Directory or LDAP).
Our purpose was merely to allow a simple login using an existing company ID/password. We also wanted to make sure that the existing department would ... |
If you're refering to Joel's post [Don't hide or disable menu items][1], he [clarified in the StackOverflow podcast][2] that he intended that there be information - not a dialog - telling you why a menu item wouldn't do anything:
>So, the use-case I was thinking of was, you had mentioned that in the Windows Media Pl... |
Check out the Eclipse CDT project. It is a plugin for Eclipse geared towards C/C++ development and includes a fairly feature rich debugging perspective (that behind the scenes uses GDB). It is available on a wide variety of platforms.
|
A single, generic constants class is a bad idea. Constants should be grouped together with the class they're most logically related to.
Rather than using variables of any kind (especially enums), I would suggest that you use methods. Create a method with the same name as the variable and have it return the value you... |
To test everything as well as possible on a
separate dev site before going live, I use Selenium
(a web page tester) to run through all the navigable
parts of the site, fill dummy values into forms, check
that those values appear in the right places as a result, etc.
It's powerful enough to check a lot of javasc... |
You have to make sure your tests are always up to date, the moment you start ignoring red lights is the moment the tests become meaningless.
You also have to make sure the tests are comprehensive, or the moment a big bug appears, the stuffy management type you finally convinced to let you spend time writing more cod... |
Here are some additional references for moving from AS2 to AS3:
Grant Skinners Introductory AS3 Workshop slidedeck
<http://gskinner.com/talks/as3workshop/>
Lee Brimelow : 6 Reasons to learn ActionScript 3
<http://www.adobe.com/devnet/actionscript/articles/six_reasons_as3.html>
Colin Moock : Essential ActionS... |
Well the problem specification is a bit limited.
As I understand it you wish to see if several strings contain the same elements regardless of order.
For example:
A B C
C B A
are the same.
The way to do this is to create a set of the values then compare the sets. To create a set do:
HashSet set = new... |
I think the error occurs if the input encoding of the file is different from the preferred encoding of your environment.
Example: `in` is UTF-8
$ LANG=de_DE.UTF-8 sed 's/.*| //' < in
X
Y
$ LANG=de_DE.iso88591 sed 's/.*| //' < in
X
Y
UTF-8 can safely be interpreted as ISO-8859-1, ... |
fsutil fsinfo ntfsinfo [your drive] |
I'm just starting to code for JavaME, but have experience with old versions of PalmOS, where all data chunks are limited in size, requiring the design of data structures using record indexes and offsets. |
You can programmatically establish connection using a call like this
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "localhost",
:username => "myuser",
:password => "mypass",
:database => "somedatabase"
)
[ActiveRecord::Base.establis... |
You can programmatically establish connection using a call like this
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "localhost",
:username => "myuser",
:password => "mypass",
:database => "somedatabase"
)
As you see you can replace the... |
If you're developing for QNX, you can use pthread_timedjoin() function.
Otherwise, you can create a separate thread that will perform pthread_join() and alert the parent thread, by signalling a semaphore for example, that the child thread completes. This separate thread can return what is gets from pthread_join() to... |
This is a little old but should get you started:
//******************************************************************************
// Automated platform detection
//******************************************************************************
// _WIN32 is used by
// Visual C++
#ifdef _WIN32
#define __NT__
#... |
|perl|cgi|scope|variables|module| |
I've run into what appears to be a variable scope issue I haven't encountered before. I'm using Perl's CGI module and a call to DBI's do() method. Here's the code structure, simplified a bit:
use DBI;
use CGI qw(:cgi-lib);
&ReadParse;
my $dbh = DBI->connect(...............);
my $test = $in{te... |
I've run into what appears to be a variable scope issue I haven't encountered before. I'm using Perl's CGI module and a call to DBI's do() method. Here's the code structure, simplified a bit:
use DBI;
use CGI qw(:cgi-lib);
&ReadParse;
my $dbh = DBI->connect(...............);
my $test = $in{te... |
I recommend you look at what Delta Airlines does with CSS at [http://mobile.delta.com][1]. They get help from a company called MShift who does a bunch of mobile banking (which, obviously, has to work on many different devices).
You can get some inspiration from the stylesheet used by the Delta site with [https://my... |
Terrain has-a Terrain Attribute
Terrain Attributes are multidimensional.
Units has-a Propulsion.
Propulsion is compatible able with Terrain Attributes.
Units move by a Terrain visit with Propulsion as an argument.
That gets delegated to the Propulsion.
Units _may_ get affected by terrain as part of ... |
How to parse a query string into a NameValueCollection in .NET |
|.net| |
I would like to parse a string such as "p1=6&p2=7&p3=8" into a NameValueCollection.
What is the most elegant way of doing this? |
I would like to parse a string such as "p1=6&p2=7&p3=8" into a NameValueCollection.
What is the most elegant way of doing this when you don't have access to the Page.Request object? |
won't be the shortest but I had to try something... C#
string[] f = new string[] {""}; Main(f); |
won't be the shortest but I had to try something... C#
string[] f = new string[0]; Main(f); |
won't be the shortest but I had to try something... C#
string[] f = new string[0]; Main(f);
bit shorter
static void Main(){Main();} |
We use a "trunk, tag, branch and stream" strategy.
The "trunk" is where the most current version of whatever is out in production is supposed to be placed.
A "tag" is where a "copy to" occurs when a stream is complete and we need to store the status of the stream for archival purposes. It also allows development... |
The scrollbar isn't a property of the `<iframe>`, it's a property of the page that it contains. Try putting `overflow-x: hidden` on the `<html>` element of the inner page. |
AMD Code Analyst is free, but not as advanced as VTune. There's also [Sleepy][1], which is very simple, but does the job in many cases.
[1]: http://www.codersnotes.com/sleepy/ |
I was surprised not to find in the above answers any of the books I though of so here goes, the books that any development team in a game studio will always have:
- Game Programming Gems (there are 7
books by now).
- AI programming Wisdom (I think 4 are out).
Both series are combined of many very usefu... |