instruction
stringlengths
0
30k
Other than what's already been mentioned here, another huge thing to consider is what your UI is going to be. If you're going to be using a lot of advanced UI controls like trees, lists, tab controls, etc then consider the following: * Javascript/HTML - No native support for anything beyond things basic drop down...
The size of the parameter on 32-bit systems will be 4 and on 64-bit systems compiled with -m64 will be 8. This is because arrays are passed as pointers in functions. The pointer is merely a memory address.
Welcome to the wonderful world of floating point. The answer you get will likely depend on the floating point model you compiled the code with. This happens because of the difference between the IEEE spec and the hardware the code is running on. Your CPU likely has 80 bit floating point registers that get use to...
Best way to play MIDI sounds using C#
|c#|.net|midi|
'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in .NET using C#. One of the issues I'm running into is playing the midi files that are used to represent the metronome "clicks". I've found a few articles online about playing MIDI in .NET, but most of them ...
There are three timer classes called 'Timer' in .NET. It sounds like you're using the Windows Forms one, but actually you might find the System.Threading.Timer class more useful - but be careful because it calls back on a pool thread, so you can't directly interact with your form from the callback. Another appro...
I can second Jon Galloway's mention of [Herding Code][1], and since I have absolutely nothing to do with the podcast, with nothing to gain, my opinion may be more valuable than his :-). There are only a few there as it's relatively new, but they are jam packed with good stuff that is very relevant to today's program...
I found this useful [Source Control HOWTO by Eric sink][1] [1]: http://www.ericsink.com/scm/source_control.html
The wikipedia article on Revision Control is a great place to start http://en.wikipedia.org/wiki/Revision_control When trying to teach my colleagues, I found getting him to understand the vocabulary at the end was a great way to start to introduce him to source code control techniques. Don't know what a branc...
To answer your question re: Which are the most important points to master I would suggest that after you get through the whole checking in and out process, rolling back to old versions and performing diffs you should take a look at branching. Branching can help you deal with the pain of being in the middle of a large c...
About how to develop Flex applications the right way, I wouldn't look too much at the Cairngorm framework. It does claim to show "best practice" and so on, but I would say that the opposite is true. It's based around the use of global variables, and other things you should try to avoid. I've [outlined some of the probl...
The [Xceed WPF Grid][1] looks like it has a lot of great capabilities. We use their WinForms grid and it does a pretty good job. They have a demo app you can download that shows off the different ways you can use the grid. [1]: http://xceed.com/Grid_WPF_Intro.html
[JetBrains dotTrace][1] (has a trial demo you can play with). It organizes the call stacks and can easily find the trouble spots. Has a lot of filtering capabilities as well. Very easy to navigate and find what you're looking for. [1]: http://www.jetbrains.com/profiler/index.html
Can't believe no one has mentioned GWT
At best, in the same place at Flash. Now, how many of you do Flash enterprise applications? Does Google do flash applications? or SalesForce.com? Oracle? or any other major on demand application provider? In my opinion, even if it kills off Flash, it will still be largely irrelevant for the types of applications we ...
What, if anything is typically done in a repository's structure to reflect deployed units?
|.net|version-control|directory|
This is a follow-up to the question [Should the folders in a solution match the namespace?](http://stackoverflow.com/questions/4664/should-the-folders-in-a-solution-match-the-namespace#4672) The consensus on that question was a qualified "yes": that is, folders == namespaces, generally, but not slavishly (the way ...
Right click the WCF solution in the other VS, and click Debug -> Start, that should get the WCF to show up in the system tray. Then, in the VS you want to add the service to, add the service reference. If you want to be able to step-into the WCF code for debugging, in the menu open Debug -> Attach Tread. Then sc...
You could do the whole thing in CSS and HTML only, and you don't need yo use any Java script. See < http://www.netwiz.com.au/cssmenu.htmlvalue >. This pages shows a tool to be used with a specific documentation software, but the sample CSS and HTML shows how to use <ul><li> elements for a CSS/HTML only menu in a larg...
For an e-commerce type use case (think Amazon 1-Click), you could encrypt the CC (or key) with the user's existing strong password. Assuming you only store a hash of the password, only the user (or a rainbow table - but, it'd have to be run on *each* user, and would not work if it didn't come up with the same password ...
Set s = New NotesSession Set db = s.CurrentDatabase If db.Server <> "" Then Set sName = New NotesName(db.Server) Else Set sName = New NotesName(s.Username) End If
.NET visual components
|.net|visual-studio|components|
I really like [DevX][1] components, but they are pretty expensive, maybe anyone knows free equivalents ? or web site where I can look for some kind of free visual component for .NET [1]: http://www.devexpress.com/
when using varchar values SQL Server needs an additional 2 bytes per row to store some info about that column whereas if you use char it doesn't need that so unless you
I believe passing -Wno-write-strings to gcc will suppress this warning.
Subversion Client-Side application
|windows|svn|
Which standalone Windows GUI application do you recommend for use for accessing a Subversion repository?
Which **standalone Windows GUI application** do you recommend for use for accessing a Subversion repository? Edit: A lot of people are mentioning Tortoise, however I am looking for an application not a shell extension.
Which **standalone Windows GUI application** do you recommend for use for accessing a Subversion repository? Edit: A lot of people are mentioning Tortoise, however I am looking for an application not a shell extension. Also people are questioning my reasoning behind not wanting to use a shell extension. In our env...
If you force it to be for example a byte and the number is over 255 you run the risk of a casting error (and an exception will be thrown). However if you know it not going to be higher than 6 it should not be a problem. If it was me, I would just use it as a normal int, I am not sure you save much if anything other...
Check out free [Krypton Toolkit][1] of Component Factory. [1]: http://www.componentfactory.com/products.php#toolkit
So, the answer to your question depends a fair bit on whether you are using UDP or TCP as your transport. For UDP, life gets a lot simpler, in that you can call recv/recvfrom/recvmsg with the packet size you need (you'd likely send fixed-length packets from the source anyway), and make the assumption that if data is...
Altova's [XMLSpy][1] is probably the best available. It offers different views of your data/schemas, XPath tools and produces good diagrams, among other things. It does cost quite a bit though. It's a mature product, so you don't tend to run into limitations as quickly as you do with some other tools. [Liquid XML...
If both Needle and Haystack are DAOs, then options 1 and 2 are out of the question. The reason for this is that DAOs should only be responsible for holding properties of the real world objects they are modeling, and only have getter and setter methods (or just direct property access). This makes serializing the DAO...
|javascript|xml|prototype|
This code is from Prototype.js. I've looked at probably 20 different tutorials, and I can't figure out why this is not working. The response I get is null. new Ajax.Request( /path/to/xml/file.xml, { method: "get", contentType: "application/xml", onSuccess: function( transport ) { alert( ...
There's only two output streams. If "> c:\foo.txt" doesn't work, and "2> C:\foo.txt" doesn't work then nothing is being output. You can merge the standard error into the standard output (2>&1) so all output is through standard output: pnputil -e 1>c:\foo.txt 2>&1 If that doesn't output anything to foo.txt the...
I'm pretty sure it is possible, since WPF is really flexible with data binding, but I haven't done that specific scenario yet. I've been following a [WPF Databinding FAQ][1] from the MSDN blogs as of late and it provides a lot of insights that might help. [1]: http://blogs.msdn.com/wpfsdk/archive/2006/10/19/w...
I think I found the technical answer for why it behaves this way. The MSDN page for WriteConsole says that redirecting standard output to a file causes WriteConsole to fail and that WriteFile should be used instead. The debugger confirms that pnputil.exe does call kernel32!WriteConsoleW and kernel32!WriteConsoleInput...
About your update: How big are the caches of your HDs? (specially the writing one). It may be that that is too much and you may need to reduce it to prevent unnecessary blocking.
Assuming you have a "config" object that you aim to setup with the flags and a suitable command line parser that takes care of parsing the command line and supply a constant stream of the options, here goes a block of pseudocode while (current_argument = cli_parser_next()) { switch(current_argument) { ...
Add these 2 template definitions to an XSLT file: <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="list"> <list> <xsl:apply-templates select="@* | *"/> <element id="2"...
If you are concerned about unexpected machine code which doesn't produce visible results, the only way is probably to contact compiler vendor for certification of some sort which will satisfy your customer. Otherwise you'll know it the same you know about bugs in your code - testing. Machine code from modern comp...
One way to do this is to put in the masterpage view the hook for the ViewData and then you define a BaseController : Controller (or multiple base classes) where you do all your db calls you need. What you wanna do is quite the same thing described in [this][1] articles. [1]: http://weblogs.asp.net/stephenwalthe...
One way to do this is to put in the masterpage view the hook for the ViewData and then you define a BaseController : Controller (or multiple base classes) where you do all the db calls you need. What you wanna do is quite the same thing described in [this][1] articles. [1]: http://weblogs.asp.net/stephenwalther...
How do I create an in-memory Handle in haskell?
|file-io|io|haskell|
I want something that looks like a file Handle but is really backed by an in-memory buffer to use for IO redirects. How can I do this?
The most you can certify is that you are using an untampered compiler from provider X. If they do not trust provider X, it's their problem (if X is reasonably trustworthy). If they do not trust any compiler provider, then they are totally unreasonable. Answering their question: I make sure I'm using an untampered co...
The most you can easily certify is that you are using an untampered compiler from provider X. If they do not trust provider X, it's their problem (if X is reasonably trustworthy). If they do not trust any compiler provider, then they are totally unreasonable. Answering their question: I make sure I'm using an untamp...
As a web developer, I'm a big fan of the idea of OpenID. Writing Auth code is a pain in the ass. As a web user, I'm a big fan of OpenID - for non-critical uses like SO, forums, etc - because once you have the ID, it's a very simple way to join a site. I think, outside of a few exceptions - like a community for dev...
I'd mention the following things in addition to what has already been stated: * GDK - extensions/additions to existing JDK classes * Interaction between Groovy and Java code (basically a non-issue) * Compiling Groovy code to Java .class files * XML parsing and mechanisms for accessing document content One thin...
Here's the code we found to work: IE browser = new IE(....); browser.Button("SlowPageLoadingButton").ClickNoWait(); Link continueLink = browser.Link(Find.ByText("linktext")); continueLink.WaitUntilExists(); continueLink.Click();
Storing MD5 Hash in SQL Server
|sql-server|md5|
In Sql Server would a varbinary(16) be the most efficient way of storing an MD5 hash? Won't be doing anything with it except returning it in a linq query.
I think I grew up in a different generation than most here.... One of the most influential books I read, was [APUE](http://www.kohala.com/start/apue.html). Or pretty much anything by W. Richard Stevens.
I think you are looking for something like [JLine][1] but I've never used it so cannot attest to its quality. She can apparently deal with autocompletion and command line history, and the last release was recently (feb this year) so it's by no means dead. [1]: http://jline.sourceforge.net/
What is the best way to make an .exe file from a python program
|python|windows|executable|exe|
I've used several modules to make .exe's for python which options/library is best? It has been some tome since i've done this and I'm curious if there are any new options etc.
boost has a python interface library which could help you. [check it out][1] [1]:http://www.boost.org/doc/libs/1_36_0/libs/python/doc/index.html
[py2exe][1] [1]: http://www.py2exe.org/
using System.Windows.Forms; ... MessageBox.Show( "hello world" );
[.Net OpenID project][1] is the best library to use right now that I know of. I think SO used it also. [1]: http://code.google.com/p/dotnetopenid/
[.Net OpenID project][1] is the best library to use right now that I know of. I think SO used it also. The source includes a sample ASP.NET MVC project using the library. Scott Hanselman did a [post][2] on how to use the .Net OpenID project inside of ASP.NET MVC. [1]: http://code.google.com/p/dotnetopenid/ ...
What's the best .NET library for OpenID and ASP.NET MVC?
You could do the whole thing in CSS and HTML only, and you don't need yo use any Java script. See < http://www.netwiz.com.au/cssmenu.htmlvalue >. This pages shows a tool to be used with a specific documentation software, but the sample CSS and HTML shows how to use ul li elements for a CSS/HTML only menu in a large ...
A fast way to do this is via a look-up table. For a 32-bit input, and an 8-bit look-up table, in only requires 4 iterations: int highest_order_bit(int x) { static const msb_lut[256] = { 0, 0, 1, 1, 2, 2, 2, 2, // 0000_0000 - 0000_0111 3, 3, 3, 3, 3, 3,...
A fast way to do this is via a look-up table. For a 32-bit input, and an 8-bit look-up table, in only requires 4 iterations: int highest_order_bit(int x) { static const int msb_lut[256] = { 0, 0, 1, 1, 2, 2, 2, 2, // 0000_0000 - 0000_0111 3, 3, 3, 3, 3...
[CMake](http://www.cmake.org/)? (generates makefiles, so technically not a replacement as such). I've also seen "[SCons](http://www.scons.org/)" pop up in a few places recently. Haven't created anything with it myself though.
Should I choose scripting or compiled code for small tasks?
|testing|scripting|
I'm a Java programmer, and I like my compiler, static analysis tools and unit testing frameworks as tools that help me quickly deliver robust and efficient code. The JRE is pretty much everywhere I would work, too. Given that situation, I can't see a reason why I would ever choose to use shell scripting, vb scriptin...
How Do You Insert Into an XML node some XML using XSLT?
|xml|xslt|
I'm not even sure if it's possible but say I have some XML: <source> <list> <element id="1"/> </list> </source> And I would like to insert into list: <element id="2"/> Can I write an XSLT to do this?
Using XSLT, How Do You Insert XML Into an existing XML node
Cook is another tool that can be used to replace make. I've seen several large companies using it. So, it is enterprise ready even though the website looks rather dated. http://miller.emu.id.au/pmiller/software/cook/
I have used css files as [Embedded resources][1]. [1]: http://aspalliance.com/726
I would say where it makes sense. If it's going to take you longer to open up your IDE, compile the script, etc. than it would to edit a script file and be done with it than use script file. If you're not going to be changing the thing often and are quicker at Java coding then go that route :)
If you are comfortable with Java, and the JRE is everywhere you work, then I would say keep using it. There are, however, languages like perl and python that are particularly suited to quickly solving problems. I would suggest learning either perl or python, and then use your judgement on when to use it.
It is usually quicker to write scripts than compiled programmes. You don't have to worry so much about portability between different platforms and environments. A shell script will run pretty much every where on most platforms. Because you're a java developer and you mention that you have java everywhere you might l...
The way I see it (others disagree) all your code needs to be maintainable. The smallest useful collection of code is that which a single person maintains. Even that benefits from the language and tools you mentioned. However, there may obviously be tasks where specialised languages are more advantageous than a singl...
Check out gcc's [Diagnostic Pragma][1] support, and the list of [-W warning options][2]. Looks like gcc doesn't have an equivalent to VC++'s #pragma warning(disable:NNNN) support which is very useful for cases like this. [1]: http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html [2]: http://www.redhat.com...
[volatile][1] keyword to tell to the compiler that field can be modified by multiple threads concurrently. [1]: http://msdn.microsoft.com/en-us/library/x13ttww7.aspx
Lists in python can contain any type of object -- If I understand the question correctly, will a `list` of `list`s do the job? Something like this (assuming you have a function `generate_poll_data()` which creates your data: data = [] for in xrange(num_iterations): data.append(generate_poll_data(...
Lists in python can contain any type of object -- If I understand the question correctly, will a `list` of `list`s do the job? Something like this (assuming you have a function `generate_poll_data()` which creates your data: data = [] for in xrange(num_iterations): data.append(generate_poll_data(...
In conventional terms, when a one is written to disk the media records a one, and when a zero is written the media records a zero. However the actual effect is closer to obtaining a 0.95 when a zero is overwritten with a one, and a 1.05 when a one is overwritten with a one. Normal disk circuitry is set up so that both ...
Stick with int32. That's what vb's "Integer" and SQL's INT is, anyway. You will not gain any significant performance improvement by using a tinyint/byte or an short/int16 instead of int/int32. In fact, the headaches you might run into in the future caused by all the casting you might have to do for objects that e...
<a href="http://headfirstlabs.com/books/hfjs/">Head First Javascript</a> is a good intro to JS for beginning programmers - it creatively explains basic programming concepts using JS syntax. The Head First series is based on researched techniques for helping you learn and remember new information. They have you do a lot...
My Qt app just uses QHttp to read tiny XML file off my website that contains the latest version number. If this is greater than the current version number it gives the option to go to the download page. Very simple. Works fine.
Sounds like it should be possible (but I've never done it). Have you already had a look at Remote Method Invocation ([RMI][1])? [1]: http://java.sun.com/javase/technologies/core/basic/rmi/index.jsp
Self Testing Systems.
|language-agnostic|unit-testing|
I had an idea I was mulling over with some colleagues. None of us knew whether or not it exists currently.<br><br> The Basic Premise is to have a system that has 100% uptime but can become more efficient dynamically.<br><br><br> Here is the scenario:<br><br> * So we hash out a system quickly to a specified set of in...