instruction stringlengths 0 30k ⌀ |
|---|
|version-control|joeltest|bugtracking|dailybuilds| |
|version-control|bug-tracking|joeltest|dailybuilds| |
Is there a bug/issue tracking system which integrates with Mercurial? |
|mercurial|integration|bugtracking| |
I've used Trac/Subversion before and really like the integration. My current project is using Mercurial for distributed development and it'd be nice to be able to track issues/bugs and have this be integrated with Mercurial. I realized this could be tricky with the nature of DVCS. |
|bug-tracking|mercurial|integration| |
Auto Generate Database Diagram MySQL |
|database|mysql|diagram|datadesign| |
I'm tired of opening Dia and creating a database diagram at the beginning of every project. Is there a tool out there that will let me select specific tables and then create a database diagram for me based on a MySQL database? Preferably it would allow me to edit the diagram afterward since none of the foreign keys are... |
|database|mysql|database-design|diagram| |
PHP Script to populate MySQL tables |
|php|mysql|testing|data-sets|test-data| |
Is anyone aware of a script/class (preferably in PHP) that would parse a given MySQL table's structure and then fill it with x number of rows of random test data based on the field types? I have never seen or heard of something like this and thought I would check before writing one myself. |
|php|mysql|testing|dataset|test-data| |
DVCS Choices - What's good for Windows? |
|version-control|windows| |
So I want to get a project on a distributed version control system, such as mercurial, git, or bazaar. The catch is that I need the Windows support to be good, i.e. no instructions that start off with "install cygwin...". Now I've *heard* that git's Windows support is decent these days, but don't have any first hand ... |
|windows|version-control|distributedversioncontrol| |
|version-control|dvcs| |
|version-control|decentralized-version-co| |
[MSDN][1] has an article on how to use ADO.NET to connect and edit records in an Access database. Once your OleDB connection is made, you can easily create your DataReader/DataAdapter and process as needed.
EDIT: Gah! Curse you Rob and your god-like typing abilities!!! 8^D
[1]: http://msdn.microsoft.com/en-us... |
There's a lot of overhead associated with the Page class. Since you're just spitting out a CSV file and have no need for postback, server controls, caching, or the rest of it, you should make this into a handler with an .ashx extension. [See here](http://www.aspcode.net/Creating-an-ASHX-handler-in-ASPNET.aspx). |
> What was the '#' for? It didn't
> compile with it.
Typo. Normally you refer to functions with `#'` (like `(remove-if #'oddp list)`), but when I was editing, I forgot to remove the '#'. |
Should I avoid using Java Label Statements? |
|java| |
Today I had a coworker suggest I refactor my code to use a label statement to control flow through 2 nested for loops I had created. I've never used them before because personally I think they decrease the readability of a program. I am willing to change my mind about using them if the argument is solid enough however.... |
Well, just as a comment, you probably want the source to have a cloaked email address and then use jQuery to fix or construct the link to have the correct address... because bots will be looking at the source, not the results of running your javascript ;-) |
Automated Unit Testing Gen Tools for .NET |
|.net|unit-testing|testing|automated-tests| |
Looking to get your take on an automated testing tool (voting should bring good ones to the top)
Ideal tool would:
- Eliminate the need to present a set
of values to a method.
- employ techniques such as Interactive
Exploratory Testing where the code
is examined to determine what values
... |
In addition to using the master method (or one of its specializations), I test my algorithms experimentally. This can't *prove* that any particular complexity class is achieved, but it can provide reassurance that the mathematical analysis is appropriate. To help with this reassurance, I use code coverage tools in ... |
I am developing a web app which requires a username and password to be stored in the web.Config, it also refers to some URLs which will be requested by the web app itself and never the client.
I know the .Net framework will not allow a web.config file to be served, however I still think its bad practice to leave thi... |
It may not be available in the designer, but why not just add it to the DBML file itself? |
This is possible with [Adobe's Flash Media Server][1]. [Red5][2] is an open source alternative. The protocol they use for this is [RTMP][3].
[1]: http://www.adobe.com/products/flashmediaserver/
[2]: http://osflash.org/red5
[3]: http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol |
You can do this by creating a SoapExtention. Check [this article][1].
[1]: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconAlteringSOAPMessageUsingSOAPExtensions.asp |
IF you're reading/writing 4-byte value AND it is DWORD-aligned in memory AND you're running on the I32 architecture, THEN reads and writes are atomic. |
This should do the trick. Only works for positive (non-zero) numbers:
int num = 1234;
int ret = 1;
while (num >>= 1)
ret <<= 1;
printf("%i\n", ret);
prints
1024
|
This should do the trick. Only works for non-zero numbers:
int num = 1234;
int ret = 1;
while (num >>= 1)
ret <<= 1;
printf("%i\n", ret);
prints
1024
|
This should do the trick.
int hob (int num)
{
if (!num)
return 0;
int ret = 1;
while (num >>= 1)
ret <<= 1;
return ret;
}
hob(1234) returns 1024<br>
hob(1024) returns 1024<br>
hob(1023) returns 512 |
I don't think so, but there's a limit of two simultaneous HTTP connections per domain per client (you can override this in Firefox, but practically no one does so). |
Boy, what a question. The answer to which is:
> Yes, no, hmmm, well, it depends
It all comes down to the architecture of the system. On an IA32 a correctly aligned address will be an atomic operation. Unaligned writes might be atomic, it depends on the caching system in use. If the memory lies within a single L1 ca... |
`#line` directives are normally inserted by the precompiler, not into source code, so editors won't usually honor that if the file extension is `.c`.
However, the normal file extension for post-compiled files is `.i` or `.gch`, so you might try using that and see what happens. |
Not sure exactly what you mean by "add one and select it", since it will be selected by default anyway. But, if you were to add more than one, it would make more sense. How about something like:
$('select').children().remove();
$('select').append('<option id="foo">foo</option>');
$('#foo').focus();
|
Not sure exactly what you mean by "add one and select it", since it will be selected by default anyway. But, if you were to add more than one, it would make more sense. How about something like:
$('select').children().remove();
$('select').append('<option id="foo">foo</option>');
$('#foo').focus();
... |
In my opinion, you see this so often because it is a very good practice that is often applied in the wrong situations.
There are many advantages to interfaces relative to abstract classes:
* You can switch implementations w/o re-building code that depends on the interface. This is useful for: proxy classes, depe... |
One of the things I would do is go through [Adobe's migration guide][1] (which is basically just an itemized list of what has changed) item by item and try to figure out if each item can be changed via a simple search and replace operation (possibly using a regex) or whether it's easier to just manually edit the occurr... |
First off, I hope you're not using `eval()` in your projects, since there is no equivalent in AS3.
One of the things I would do is go through [Adobe's migration guide][1] (which is basically just an itemized list of what has changed) item by item and try to figure out if each item can be changed via a simple search ... |
I think it's only "tech" guys that really care for "100% standard compliance". My usual page consumers (= users) don't care if there's no alt-attribute for a "menu border picture element".
I usually just make sure that I don't see any obvious errors (all tags closed, all lower case, attributes in quotes, ...), but i... |
From Books On line, i think it is pretty clear after you read it
**NORECOVERY**
Instructs the restore operation to not roll back any uncommitted transactions. Either the NORECOVERY or STANDBY option must be specified if another transaction log has to be applied. If neither NORECOVERY, RECOVERY, or STANDBY is spec... |
I do the same thing with select boxes and Flash.
When using an overlay, hide the underlying objects that would push through. It's not great, but it works. You can use JavaScript to hide the elements just before displaying an overlay, then show them again once you're done.
I try not to mess with iframes unless it... |
|java|documentation|javadoc|generation| |
I have a large codebase without javadoc and I want to run a program to write a skeleton with the basic javadoc information (e.g. for each method's parameter write @param...) so I just have to fill the gaps left.
Somebody knows a good solution for this?
**Edit:**
JAutodoc is what I was looking for, it has ant t... |
I use APC, and can attest that it can dramatically reduce the CPU and I/O load on an app server if you maintain a high cache-hit rate. It not only saves you from having to compile, it can save you from having to read the php files from disk at all. (i.e. the bytecodes are served directly from main memory, so it's super... |
I'm pretty sure Windows has an API that developers can use to create new kinds of text input systems. I gather there are a wide variety of text input systems in use in non-Roman-derived markets, many of which are provided by third parties.
It's unclear if that's what you were really asking about, though, because yo... |
For completeness's sake:
it's of course completely possible to write an own implementation of a multimethod pointer table for your objects and calculate the method addresses manually at run time. There's a [paper](http://www.research.att.com/~bs/multimethods.pdf) by Stroustrup on the topic of implementing multimetho... |
using (var conn = new SqlConnection(yourConnectionString))
{
var cmd = new SqlCommand("insert into Foo values (@bar)", conn);
cmd.Parameters.AddWithValue("@bar", 17);
conn.Open();
cmd.ExecuteNonQuery();
} |
Is it a large system with many programmers? If so it might be worth checking that nowhere in the code is the logger having its config changed programatically.
In log4j, this can be done using the LogManager or BasicConfigurator classes. Just one rogue line of code could set up a new Logger to stdout using the Patter... |
The official tutorial on the [CPAN site](http://search.cpan.org/dist/perl/pod/perltoot.pod) is good.
There's also a good article called [Camel POOP](http://www.codeproject.com/KB/perl/camel_poop.aspx) at CodeProject. |
Daniel's and Eldila's answer have one problem: They remove all quotes and commas in the whole file.
What I usually do when I have to do something like this is to first replace all separating quotes and (usually) semicolons by tabs.
- *Search:* ";"
- *Replace:* \t
Since I know in which column my affected valu... |
The problem that I see with Active Records is, that it's always just about **one** table. That's okay, as long as you really work with just that one table, but when you work with data in most cases you'll have some kind of join somewhere.
Yes, join usually is worse than no join at all when it comes to performance, b... |
The problem that I see with Active Records is, that it's always just about **one** table. That's okay, as long as you really work with just that one table, but when you work with data in most cases you'll have some kind of join somewhere.
Yes, **join** usually is worse than **no join at all** when it comes to perfor... |
There's always the JavaScript way (see other answers) but since it's is purely styling, I'm kind of against use client scripts to achieve this.
The way I prefer (though it has its limits), is to use 4 rounded corner images that you will position in the 4 corners of your box using CSS:
<div class="Rounded">
... |
In 1.5, you can find all the threads and get each one's state, eg like this:
Map<Thread,StackTraceElement[]> map = Thread.getAllStackTraces();
for (Map.Entry<Thread, StackTraceElement[]> threadEntry : map.entrySet()) {
log.info("Thread:"+threadEntry.getKey().getName()+":"+threadEntry.ge... |
I don't think it is possible in C#, because MyObject<object> is not a baseclass of MyObject<something_else>. What I usually do is to define an interface (a 'normal' one, not generic) and make MyObject<T> implement that interface, e.g.
interface INamedObject
{
string Name {get;}
}
and then you... |
An instance of Test has no information as to what E is at runtime. So, you need to pass a Class<E> to the constructor of Test.
public class Test<E> {
private final Class<E> clazz;
public Test(Class<E> clazz) {
this.clazz = clazz;
}
// To make things easier on clie... |
Designers and developers working together |
|wpf|silverlight| |
The rich presentational capabilities of WPF and Silverlight mean developers like me will be working closely with graphic designers more often these days, as is the case in my next project.
Does anyone out there have any tips/experience (from both points of view) on making this go more smoothly? For example when I... |
Have you taken a look at [Source-Navigator][1]? It can be used as an IDE but I found to be very good at analyzing source code structure. For example, it can find out where and if a certain method is used in your source code.
I don't know if it's scriptable but it might be a good starting point for you.
[1]: htt... |
In a university project I toyed around with yFiles by [yWorks][1] and found it had pretty good API.
[1]: http://www.yworks.com |
I would go with XML. XML is widely supported on all platforms and has lots of libraries and tools available for it. And since it's text, there are no issues when you pass it between platforms.
I know JSON is another alternative, but I'm not familiar enough with it to know whether or not to recommend it in this cas... |
Are there any errors in the log on the TFS application server? Anything that indicates that it tried to fire but failed? |
You don't specify the operating system or environment, this answer assumes Linux, glibc, and C.
You can set __malloc_hook, __free_hook, and __realloc_hook to point to functions which will be called from malloc(), realloc(), and free() respectively. There is a __malloc_hook manpage showing the prototypes. You can add... |
In UML it'll be quoted tag before the member. Something conventional, like this:
"attached" Align: ElementAlign |
I had a pleasant experience with Mandriva power pack 2008. Select something like development->"java tools" and everything is installed for you.
Everything being Sun JRE, JDK, and eclispe.
Solaris did install a 64bit kernel by default though..... |
There is no fixed database role that includes these permissions. You'll have to create a role and assign the permissions individually.
<pre>
CREATE ROLE db_creator
GRANT CREATE DATABASE TO db_creator
GRANT ALTER ANY LOGIN TO db_creator
GRANT ALTER ANY USER TO db_creator
</pre> |
In the past I wrote a software library in C that had a memory management subsystem that contained the ability to log allocations and frees, and to manually match each allocation and free. This was of some use when attempting to find memory leaks, but it was difficult and time consuming to use. The number of logs was ... |
Solaris :)
On a serious note, there is no Linux distro dedicated to Java, so it would be about the same. OpenSolaris on the other hand would (in my VERY humble experience) be a bit faster, and you wuld have bonus af a Dtrace as a tool (not that you can't find similar tools in Linux, but Dtrace should be somewhat mor... |
Note: there are two interesting registers in an x86 seg-fault crash.
The first, **EIP**, specifies the code address at which the exception occurred. In RichQ's answer, he uses addr2line to show the source line that corresponds to the crash address. But EIP can be invalid; if you call a function pointer that is nu... |
Try [NetLimiter][1], which is great for that and also allows you to limit bandwidth usage so that you can test your app in reduced bandwidth scenarios.
[1]: http://www.netlimiter.com/ |
- [Encrypting and Decrypting Configuration Sections][1] (ASP.NET) on MSDN
- [Encrypting Web.Config Values in ASP.NET 2.0][2] on ScottGu's [blog][3]
- [Encrypting Custom Configuration Sections][4] on K. Scott Allen's [blog][5]
[1]: http://msdn.microsoft.com/en-us/library/zhhddkxy.aspx
[2]: http://weblo... |
- [Encrypting and Decrypting Configuration Sections][1] (ASP.NET) on MSDN
- [Encrypting Web.Config Values in ASP.NET 2.0][2] on ScottGu's [blog][3]
- [Encrypting Custom Configuration Sections][4] on K. Scott Allen's [blog][5]
**EDIT:**
If you can't use asp utility, you can encrypt config file using [Sect... |
In a year it will still be a minority of content, but the installed base will be large enough that mainstream projects will be considering it as a viable alternative to Flash. Until they survey the pool of available, talented designers familiar with it. |
How do I insert a character at the caret with javascript? |
|javascript| |
I want to insert some special characters at the caret inside textboxes using javscript on a button. How can this be done?
The script needs to find the active textbox and insert the character at the caret in that textbox. The script also needs to work in IE and Firefox. |
I want to insert some special characters at the caret inside textboxes using javscript on a button. How can this be done?
The script needs to find the active textbox and insert the character at the caret in that textbox. The script also needs to work in IE and Firefox.
**EDIT:** It is also ok to insert the charac... |
There's a related question [here][1] on post-commit hooks. Personally, I prefer to send a message to something I can get an RSS feed from, as an email-per-commit would overload my inbox pretty quickly.
[1]: http://stackoverflow.com/questions/6155/common-types-of-subversion-hooks#6359 |
Decoding printf statements in C (Printf Primer) |
|printf|c|qstring|qt| |
I'm working on bringing some old code from 1998 up to the 21st century. One of the first steps in the process is converting the printf statements to a <a href = "http://doc.trolltech.com/4.4/qstring.html">QString</a> variables. No matter how many times I look back at printf though, I always end up forgetting one thin... |
|c|qt|printf|qstring| |
I'm working on bringing some old code from 1998 up to the 21st century. One of the first steps in the process is converting the printf statements to [QString][1] variables. No matter how many times I look back at printf though, I always end up forgetting one thing or the other. So, for fun, let's decode it together,... |
a. decimal, four significant digits
b. Not sure
c. hex, minimum 4 characters
d. Also hex, minimum 2 characters
e. 1 character
f. String of characters, minimum 4 |
Thanks for the correction Blam. My command does remove all ',' and '"'.
In order to convert the sting "1,000" more strictly, you will need the following command.
Perl -lne 's/"(\d+),(\d+)"/$1$2/; print' file.txt > newfile.txt |
Best way to wrap rsync progress in a gui? |
|windows|user-interface|memory|console|logs|rsync| |
I use [rsync][1] to synchronize files to Windows clients in a server agnostic way. What methods are available to send the progress of rsync to the parent process for display in a gui progress bar?
I imagine two or three choices exist. (1) Watch STDOUT (2) Watch rsync.exe log file, similar to unix `tail` (3) Watch rs... |
This may not be what you're looking for, but if I needed to do this quick&dirty, I would:
1. Create a separate WPF application (so I could use the built-in document handling)
2. Give the service the ability to interact with the desktop (note that you don't actually have to show anything on the desktop, or be logged... |
|.net|winforms|user-interface|controls| |