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 set... Here is what I am picturing diagram-wise (please excuse the horrible data design, I didn't design it. Let's focus on the diagram concept and not on the actual data it represents for this example ;) ): ![diagram][1] [see full size diagram][2] [1]: http://www.chomperstomp.com/img/shippingDBDesign.jpg [2]: http://www.chomperstomp.com/img/shippingDBDesign.png
|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 experience. Also, it sounds like the bazaar team has an explicit goal of making it as multiplatform as possible. Can I get any recommendations?
|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/library/ms971485.aspx
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. What are people's opinions on label statements?
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 are required to exercise all code paths. i.e. the unit tests for a method is determined by the complexity of the code For example, if a method checks that an integer argument is 123, at least 2 unit tests are generated: one where that argument is 123 and one where it is not. For Java my understanding is these are some options but not .NET - TestGen4J - AgitarOne Have heard of Pex - For .NET from Microsoft Research but this has a non-commercial license Thanks
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 conjunction with my experiments, to ensure that I'm exercising all the cases. As a very simple example say you wanted to do a sanity check on the speed of the .NET framework's list sort. You could write something like the following, then analyze the results in Excel to make sure they did not exceed an n*log(n) curve. In this example I measure the number of comparisons, but it's also prudent to examine the actual time required for each sample size. However then you must be even more careful that you are just measuring the algorithm and not including artifacts from your test infrastructure. int nCmp = 0; System.Random rnd = new System.Random(); // measure the time required to sort a list of n integers void DoTest(int n) { List<int> lst = new List<int>(n); for( int i=0; i<n; i++ ) lst[i] = rnd.Next(0,1000); // as we sort, keep track of the number of comparisons performed! nCmp = 0; lst.Sort( delegate( int a, int b ) { nCmp++; return (a<b)?-1:((a>b)?1:0)); } System.Console.Writeline( "{0},{1}", n, nCmp ); } // Perform measurement for a variety of sample sizes. // It would be prudent to check multiple random samples of each size, but this is OK for a quick sanity check for( int n = 0; n<1000; n++ ) DoTest(n);
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 this sort of information in plain text. Everything I have read so far requires me to use a command line switch or to store values in the registry of the server. I have access to neither of these as the host is online and I have only FTP and Control Panel (helm) access. Can anyone recommend any good, free encryption DLL's or methods which I can use? I'd rather not develop my own! Thanks for the feedback so far guys but I am not able to issue commands and and not able to edit the registry. Its going to have to be an encryption util/helper but just wondering which one!
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 cache line then it is atomic, otherwise it's not. The width of the bus between the CPU and RAM can affect the atomic nature: a corectly aligned 16bit write on an 8086 was atomic whereas the same write on an 8088 wasn't because the 8088 only had an 8 bit bus whereas the 8086 had a 16 bit bus. Also, if you're using C/C++ don't forget to mark the shared value as volatile, otherwise the optimiser will think the variable is never updated in one of your threads. Skizz
`#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(); **Response to "EDIT"**: Can you clarify what you mean by "This select box is populated by a set of radio buttons"? A &lt;select&gt; element cannot (legally) contain &lt;input type="radio"&gt; elements.
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, dependency injection, AOP, etc. * You can separate the API from the implementation in your code. This can be nice because it makes it obvious when you're changing code that will affect other modules. * It allows developers writing code that is dependent on your code to easily mock your API for testing purposes. You gain the most advantage from interfaces when dealing with modules of code. However, there is no easy rule to determine where module boundaries should be. So this best practice is easy to over-use, especially when first designing some software.
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 occurrences to correspond to AS3. Probably in a lot of cases (especially if, as you said, the amount of code to be migrated is quite high) you'll be best off scripting the changes (i.e. using regex search & replace) and manually fixing any border cases where the automated changes have failed. Be prepared to set some time aside for a bit of debugging and running through some test cases as well. [1]: http://livedocs.adobe.com/flex/3/langref/migration.html
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 and replace operation (possibly using a regex) or whether it's easier to just manually edit the occurrences to correspond to AS3. Probably in a lot of cases (especially if, as you said, the amount of code to be migrated is quite high) you'll be best off scripting the changes (i.e. using regex search & replace) and manually fixing any border cases where the automated changes have failed. Be prepared to set some time aside for a bit of debugging and running through some test cases as well. Also, as others have already mentioned, trying to combine AS2 SWFs with AS3 SWFs is not a good idea and doesn't really even work, so you'll definitely have to migrate all of the code in one project at once. [1]: http://livedocs.adobe.com/flex/3/langref/migration.html
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 if it looks good on IE and FF, that's all I care for. I don't really care if I use a non-standard attribute in any HTML tag, so that the page doesn't validate against an DTD - as long as I get the visual results that I intended to get.
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 specified, RECOVERY is the default. SQL Server requires that the WITH NORECOVERY option be used on all but the final RESTORE statement when restoring a database backup and multiple transaction logs, or when multiple RESTORE statements are needed (for example, a full database backup followed by a differential database backup). Note When specifying the NORECOVERY option, the database is not usable in this intermediate, nonrecovered state. When used with a file or filegroup restore operation, NORECOVERY forces the database to remain in the restoring state after the restore operation. This is useful in either of these situations: A restore script is being run and the log is always being applied. A sequence of file restores is used and the database is not intended to be usable between two of the restore operations. **RECOVERY** Instructs the restore operation to roll back any uncommitted transactions. After the recovery process, the database is ready for use. If subsequent RESTORE operations (RESTORE LOG, or RESTORE DATABASE from differential) are planned, NORECOVERY or STANDBY should be specified instead. If neither NORECOVERY, RECOVERY, or STANDBY is specified, RECOVERY is the default. When restoring backup sets from an earlier version of SQL Server, a database upgrade may be required. This upgrade is performed automatically when WITH RECOVERY is specified. For more information, see Transaction Log Backups . **STANDBY** = undo_file_name Specifies the undo file name so the recovery effects can be undone. The size required for the undo file depends on the volume of undo actions resulting from uncommitted transactions. If neither NORECOVERY, RECOVERY, or STANDBY is specified, RECOVERY is the default. STANDBY allows a database to be brought up for read-only access between transaction log restores and can be used with either warm standby server situations or special recovery situations in which it is useful to inspect the database between log restores. If the specified undo file name does not exist, SQL Server creates it. If the file does exist, SQL Server overwrites it. The same undo file can be used for consecutive restores of the same database. For more information, see Using Standby Servers. Important If free disk space is exhausted on the drive containing the specified undo file name, the restore operation stops. STANDBY is not allowed when a database upgrade is necessary.
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's absolutely necessary. The trick of using labels or textboxes instead of select boxes during overlays is neat. I may use that in the future.
|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 tasks, an eclipse plugin and uses velocity for the template definition. Thank you Laurent K.
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 fast) It lowers the speed to render a single page, and increases the requests per second your server can handle. If you use RedHat or CentOS, installing APC is super simple: yum install php-devel httpd-devel php-pear pecl install apc echo "extension=apc.so" > /etc/php.d/apc.ini # if you're using SELinux: chcon "system_u:object_r:textrel_shlib_t" /usr/lib/php/modules/apc.so /etc/init.d/httpd restart You asked about downsides. The only downside is that it requires some memory. The default on APC is 30MB, but it can be adjusted, and the cost of a little bit of memory more than pays for itself with the increased speed and response rate.
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 you just assumed everyone knows what you would want to use an Input Manager for on Mac OS X. - If you want to create a new type of input method, ask how to do that. - If you want to get your own code running inside other applications, ask how to do that. Don't just assume people can read your mind when asking questions, and don't assume that they have the same experience that you do and will recognize all the same platform-specific terminology.
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 multimethods (albeit in the compiler). I wouldn't really advise anyone to do this. Getting the implementation to perform well is quite complicated and the syntax for using it will probably be very awkward and error-prone. If everything else fails, this might still be the way to go, though.
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 PatternLayout shown in your example. BasicConfigurator.configure();
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 values will be I then do another search and replace: - *Search:* ^([\t]+)\t([\t]+)\t([0-9]+),([0-9]+)\t - *Replace:* \1\t\2\t\3\4\t ... given the value with the comma is in the third column. You need to start with an "^" to make sure that it starts at the beginning of a line. Then you repeat ([0-9]+)\t as often as there are columns that you just want to leave as they are. ([0-9]+),([0-9]+) searches for values where there is a number, then a comma and then another number. In the replace string we use \1 and \2 to just keep the values from the edited line, separating them with \t (tab). Then we put \3\4 (no tab between) to put the two components of the number without the comma right after each other. All values after that will be left alone. If you need your file to have semicolon to separate the elements, you then can go on and replace the tabs with semicolons. However then - if you leave out the quotes - you'll have to make sure that the text values do not contain any semicolons themselves. That's why I prefer to use TAB as column separator. I usually do that in an ordinary text editor (EditPlus) that supports RegExp, but the same regexps can be used in any programming language.
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, but join *usually* is better than "fake" join by first reading the whole table A and then using the gained information to read and filter table 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 performance, but **join** *usually* is better than **"fake" join** by first reading the whole table A and then using the gained information to read and filter table B.
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"> // content <div class="TopLeft"></div> <div class="TopRight"></div> <div class="BottomRight"></div> <div class="BottomLeft"></div> </div> --- /******************************** * Rounded styling ********************************/ .Rounded { position: relative; padding-left: 5px; padding-right: 5px; background-color: #ffffff; } .Rounded .TopLeft { position: absolute; top: 0; left: 0; height: 5px; width: 5px; background-repeat: no-repeat; background-image: url(/* path to rounded corner image for TopLeft */); } .Rounded .TopRight { position: absolute; top: 0; right: 0; height: 5px; width: 5px; background-repeat: no-repeat; background-image: url(/* path to rounded corner image for TopRight */); } /* Hack for IE6 */ * html .Rounded .TopRight { right: -1px; } .Rounded .BottomLeft { position: absolute; bottom: 0; left: 0; height: 5px; width: 5px; background-repeat: no-repeat; background-image: url(/* path to rounded corner image for BottomLeft */); } /* Hack for IE6 */ * html .Rounded .BottomLeft { bottom: -20px; } .Rounded .BottomRight { position: absolute; bottom: 0; right: 0; height: 5px; width: 5px; background-repeat: no-repeat; background-image: url(/* path to rounded corner image for BottomRight */); } /* Hack for IE6 */ * html .Rounded .BottomRight { bottom: -20px; right: -1px; } --- As mentioned, it has its limits (the background behind the rounded box should be plain otherwise the corners won't match the background), but it works very well for anything else.
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.getKey().getState()); for (StackTraceElement element : threadEntry.getValue()) { log.info("--> "+element); } } Thread.getState gives you info about whether the thread is BLOCKED, WAITING etc, see [jdk api ThreadState][1] [1]: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.State.html
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 can use the interface: List<INamedObject> list = new List<INamedObject>(){fst, snd}; foreach (INamedObject o in list) Console.WriteLine(o.Name); Did it answer your question?
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 clients: public static <T> Test<T> create(Class<T> clazz) { return new Test<T>(clazz); } public boolean sameClassAs(Object o) { return o != null && o.getClass() == clazz; } } If you want an "instanceof" relationship, use Class.isAssignableFrom instead of the Class comparison. Note, E will need to be a non-generic type, for the same reason Test needs the Class object. For examples in the Java API, see java.util.Collections.checkedSet and similar.
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 mentioned source control to a designer recently I was told you can't source control graphics, images etc, so it is a waste of time. But what about XAML files in WPF/Silverlight? Scott Hanselman spoke about this topic in a [podcast](http://www.hanselminutes.com/default.aspx?showID=138), but focused more on the tools. I'm more interested in the communication issues/aspects.
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]: http://sourcenav.sourceforge.net/
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 case.
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 track allocations in these hooks, then return to let glibc handle the memory allocation/deallocation. It sounds like you want to free any live allocations when the third-party function returns. There are ways to have gcc automatically insert calls at every function entrance and exit using -finstrument-functions, but I think that would be inelegant for what you are trying to do. Can you have your own code call a function in your memory-tracking library after calling one of these third-party functions? You could then check if there are any allocations which the third-party function did not already free.
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 overwhelming, and it took an extensive amount of time to understand the logs. That being said, if your third party library has extensive allocations, its more then likely impractical to track this via logging. If you're running in a Windows environment, I would suggest using a tool such as Purify[1] or BoundsChecker[2] that should be able to detect leaks in your third party libraries. The investment in the tool should pay for itself in time saved. [1]: http://www-01.ibm.com/software/awdtools/purify/ Purify [2]: http://www.compuware.com/products/devpartner/visualc.htm BoundsChecker
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 more advance).
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 null, it can be 0x00000000, and if you corrupt your call stack, the return can pop any random value into EIP. The second, **CR2**, specifies the data address which caused the segmentation fault. In RichQ's example, he is setting up i as a null pointer, then accessing it. In this case, CR2 would be 0x00000000. But if you change: int j = *i to: int j = i[2]; Then you are trying to access address 0x00000008, and that's what would be found in CR2.
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://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspx [3]: http://weblogs.asp.net/scottgu/default.aspx [4]: http://odetocode.com/Blogs/scott/archive/2006/01/08/2707.aspx [5]: http://odetocode.com/Blogs/scott/default.aspx
- [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 [SectionInformation.ProtectSection][6] method. Sample on codeproject: [Encryption of Connection Strings inside the Web.config in ASP.Net 2.0][7] [1]: http://msdn.microsoft.com/en-us/library/zhhddkxy.aspx [2]: http://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspx [3]: http://weblogs.asp.net/scottgu/default.aspx [4]: http://odetocode.com/Blogs/scott/archive/2006/01/08/2707.aspx [5]: http://odetocode.com/Blogs/scott/default.aspx [6]: http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.protectsection.aspx [7]: https://secure.codeproject.com/KB/aspnet/webconfig.aspx
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 character "last" in the previously active textbox.
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 thing or the other. So, for fun, let's decode it together, for ole' times sake and in the process create the first little **'printf primer'** for Stackoverflow. In the code, I came across this little gem, printf("%4u\t%016.1f\t%04X\t%02X\t%1c\t%1c\t%4s", a, b, c, d, e, f, g); How will the variables a, b, c, d, e, f, g be formatted?
|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, for ole' times sake and in the process create the first little **'printf primer'** for Stackoverflow. In the code, I came across this little gem, printf("%4u\t%016.1f\t%04X\t%02X\t%1c\t%1c\t%4s", a, b, c, d, e, f, g); How will the variables a, b, c, d, e, f, g be formatted? [1]: http://doc.trolltech.com/4.4/qstring.html
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 rsync console output in memory. Which one is best/preferred? [1]: http://rsync.samba.org/
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 in for this to work) 3. Have the service run the application, and give it the data to print. You could probably also jigger this to print from a web browser that you run from the service (though I'd recommend building your own shell IE, rather than using a full browser). For a more detailed (also free) solution, your best bet is probably to manually format the document yourself (using GDI+ to do the layout for you). This is tedious, error prone, time consuming, and wastes a lot of paper during development, but also gives you the most control over what's going to the printer.
|.net|winforms|user-interface|controls|