instruction
stringlengths
0
30k
On my latest project I used [SourceMonitor][1]. It' very nice free tool for code metrics analysis. Here is an excerpt from SourceMonitor official site: - Collects metrics in a fast, single pass through source files. - Measures metrics for source code written in C++, C, C#, VB.NET, Java, Delphi...
This sounds like a `crossdomain.xml` related problem? I did a quick search and there seems to be many people with the same issue. Some proxy requests through XMLHttpRequest etc.. Check here: [http://is.gd/2yXz][1] [1]: http://is.gd/2yXz
It encourages users to sign-up to OpenID, find out more about it and hopefully to evangelise it themselves. Stack Overflow proves just supporting OpenID can work. > **"Adds critical point to failure to the site"** In the event of an OpenID provider failing to work, the site should have a mechanism to allow us...
I read everywhere that business logic belongs in the models and not in controller but where is the limit? I am toying with a personnal accounting application. Account Entry Operation When creating an operation it is only valid if the corresponding entries are created and linked to accounts s...
|ruby|ruby-on-rails|
I read everywhere that business logic belongs in the models and not in controller but where is the limit? I am toying with a personnal accounting application. Account Entry Operation When creating an operation it is only valid if the corresponding entries are created and linked to accounts s...
For example: svn propset svn:mime-type image/png foo.png
I'm not sure what exactly you mean, but I'm assuming that what you really need is a wait and notify mechanism. In short, here's how it works: You wait for a condition to satisfy with a timeout. Your wait will be over if: - The timeout occurs, or - If the condition is satisfied. You can have this in a loop...
While not strictly a software development book, I would highly recommend that [Don't Make me Think!][1] be considered in this list. [1]: http://www.amazon.com/Dont-Make-Me-Think-Usability/dp/0321344758/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1221580188&sr=8-1
I use JSF and [IceFaces][1]. Although JSF has a few limitations, IceFaces seems to work pretty well and has ironed out a few of the problems with JSF. I haven't used a really good AJAX Java framework as yet, although [Echo2][2] looks interesting. [1]: http://www.icefaces.org [2]: http://echo.nextapp.com/si...
A solid option used by one of my friends is [Solr][1], a search engine using the original Java-based Lucene. To use it with Rails, there's, of course an acts\_as plugin, [acts\_as_solr][2]. He presented the combo recently at [Montreal on Rails][3] and gives a nice and thorough overview of [how to use acts\_as_solr o...
As per the [Subversion FAQ][1], you can use svn propset to change the **svn:mime-type** property to **application/octet-stream** [1]: http://subversion.tigris.org/faq.html#binary-files
Microsoft's [SQL Server Express Download page][1] has a link to the 64-bit version, down near the bottom of the page [1]: http://www.microsoft.com/express/2005/sql/download/
svn looks for a mime-type property, guessing it is text if it doesn't exist. You can explicity set this property, see http://svnbook.red-bean.com/en/1.5/svn.forcvs.binary-and-trans.html
I tend to take care of this using a simple parser. I have two functions, one is called NumStringParts which returns the number of "parts" in a string with a specific delimiter (in your case above the space) and GetStrPart returns the specific part from a string with a specific delimiter. Both of these routines have b...
DynamicPopulateExtender ,TextArea and line feeds
|web-services|soap|
I have this in a page : <textarea id="taEditableContent" runat="server" rows="5"></textarea> <ajaxToolkit:DynamicPopulateExtender ID="dpeEditPopulate" runat="server" TargetControlID="taEditableContent" ClearContentsDuringUpdate="true" PopulateTriggerControlID="hLink" ServicePath="/Content.asmx"...
If the IronPython and .Net Compact Framework teams work together, Visual Studio may one day support Python for Windows Mobile development out-of-the-box. Unfortunately, [this feature request has been sitting on their issue tracker for ages][1]... [1]: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkIte...
Programmatically get own phone number in Symbian
|symbian|telephony|
How to get the phone number of the device in Symbian?
Calculate code metrics
|metrics|
Are there any tools available that will calculate code metrics (for example number of code lines, cyclomatic complexity, coupling, cohesion) for your project and over time produce a graph showing the trends?
|metrics|
|metrics|quality|
FYI: Actually i have found this. [http://www3.symbian.com/faq.nsf/AllByDate/100335073FFD8FEF80256E3200571A49?OpenDocument][1] But the fact is, the phone number is not always stored in SIM. The operator chooses to do it or not! [1]: http://www3.symbian.com/faq.nsf/AllByDate/100335073FFD8FEF80256E3200571A49?...
You can't. Afaik. Check this discussion: http://discussion.forum.nokia.com/forum/showthread.php?t=65117
I'm not familiar with these interfaces, but unexpected failures in Vista may require being past a UAC prompt. Have you tried starting the debugger with admin privileges?
If you're after some trend analysis, does it really mean anything to measure beyond SLOC? Even if you just use a grep for trailing semi-colons and count the number of lines returned, what you are after is consistency in the SLOC measurement technique. so that today's measurement can be compared with last month's mea...
You might be able to get it to run faster if you do them in batches. Making a JNI call adds overhead, so you don't want to do it for each exp() you need to calculate. I'd try passing an array of 100 values and getting the results to see if it helps performance.
Slow and late. It has a terminal case of second system disease. When I was a Perl hacker (back in the day), they had been working on Perl 6 for two years. That was 6 years ago. You could build a whole operating system in that time.
Foo is only a location to hold a pointer to the data. The data has no knowledge of what points at it. In Smalltalk systems you could ask the VM for all pointers to an object, but that would only get you the object that contained the foo variable, not foo itself. There is no real way to reference a vaiable in Ruby. ...
Flip an Image horizontally
|php|
I need to flip an image so that a character faces in the right direction. This needs to be done "on the fly' as they say. The issue I am having is that with Gif images, I seem to lose the transparency. (The background goes white) Below is the code: (Alternatively someone could send me to a good example) $...
You'll really have to performance test - There is no Yes/No answer. As per Andy Living's post above links to, a CTE is just shorthand for a query or subquery. If you are calling it twice or more in the same function, you might get better performance if you fill a table variable and then join to/select from that. Ho...
That same code should work in the WebKit nightly build as of May 16th 2008. I guess that means you need to hope the 2.1 update included a new build of safari. <https://bugs.webkit.org/show_bug.cgi?id=19105>
In perl you could do something like this, leaving out all the my local variable declarations and ... or die "failmessage" error handling for brevity: use DBI; use DBD::Oracle; $dbh = DBI->connect( "dbi:Oracle:host=127.0.0.1;sid=XE", "username", "password ); # some settings that you usuall...
Try Chris Pederick's Web Developer Toolbar.
[@Jonathan Holland](#47273) Wow, I think that's the most raw work I've ever seen put into a StackOverflow post. Well done. **However**, instead of constructing DDL statements as strings, you should definitely use the [SQL Server Management Objects](http://msdn.microsoft.com/en-us/library/ms162169.aspx) classes intro...
A trigger is a named database object that is associated with a table and that is activated when a particular event occurs for the table.<br /> <br />To create a trigger:<br /> CREATE TRIGGER triggerName [BEFORE|AFTER] [INSERT|UPDATE|DELETE|REPLACE] ON tableName FOR EACH ROW SET stuffToDoHERE; <br />Even thou...
From [dev.mysql.com][1], a trigger is > ...a named database object that is > associated with a table and that is > activated when a particular event > occurs for the table. The syntax to create them [is also documented at that site][2]. Briefly, CREATE [DEFINER = { user | CURRENT_USER }] ...
@[EbGreen](#44022) said > I would just take the log files and strip the timestamps off the start of each line then save the file out to different files. Then diff those files. That's probably the best bet, unless your diffing tool has special powers. For example, you could cut -b13- file1 > trimmed_file...
@[EbGreen](#44022) said > I would just take the log files and strip the timestamps off the start of each line then save the file out to different files. Then diff those files. That's probably the best bet, unless your diffing tool has special powers. For example, you could cut -b13- file1 > trimmed_file...
When I first started, there was "Mastering Turbo Pascal" by Tom Swan. There is nothing terribly profound about this book. It was clear and concise with usable examples. Based on this knowledge, I spawned a software development career now 15+ years in.
It's not a binary question, and there's no silver bullet. Making sure you follow at least the basics of WCAG and testing in a couple of screen readers and without the mouse will probably be the most effective use of your time. If at all possible, test with real people with real disabilities, they have a perspective t...
C++ BlackBook. KISS all the way through
http://python.net/~gherman/projects/pdf2tiff/ You could also use pdf2ps, ps2image and then convert from the resulting image to tiff with other utilities (I remember 'paul' [paul - Yet another image viewer (displays PNG, TIFF, GIF, JPG, etc.])
[Create a Search engine for MSDN Library in Firefox][1] <pre> < search name = "MSDN Library" method = "GET" action = "http://msdn.microsoft.com/en-us/library/default.aspx" queryCharset = "utf-8" > < input name = "ctl00_Masthead1_ctl00_SearchTextBox" user > < /search > </pre> Like this perhaps?...
[Create a Search engine for MSDN Library in Firefox][1] Like this perhaps? [1]: http://labnol.blogspot.com/2006/09/learn-to-create-firefox-search-plugin.html
ABCPDF can do so as well -- check out <a href="http://www.websupergoo.com/helppdf6net/default.html">http://www.websupergoo.com/helppdf6net/default.html</a>
[Scala][1]'s a cool functional/OO language with pattern matching, first class functions, and the like. [1]: http://www.scala-lang.org
[Scala][1]'s a cool functional/OO language with pattern matching, first class functions, and the like. It has the advantage of compiling to java bit code and inter-operates well with java code. [1]: http://www.scala-lang.org
Use Async Delegates: public int SomeMethod(int someInput) { Thread.Sleep(20); Console.WriteLine(”Processed input : {0}”,someInput); return someInput+1; } // Define a delegate delegate int SomeMethodDelegate(int someInput); SomeMethodDelegate someMethodDelegate = SomeMet...
Use Async Delegates: // Method that does the real work public int SomeMethod(int someInput) { Thread.Sleep(20); Console.WriteLine(”Processed input : {0}”,someInput); return someInput+1; } // Method that will be called after work is complete public void EndSomeOthe...
I tend to take care of this using a simple parser. I have two functions, one is called NumStringParts which returns the number of "parts" in a string with a specific delimiter (in your case above the space) and GetStrPart returns the specific part from a string with a specific delimiter. Both of these routines have b...
I recommend to read [this.][1] Basicly, you have to set the mime type to octet-stream: svn propset svn:mime-type application/octet-stream <filename> [1]: http://tableau.stanford.edu/~mwest/group/Subversion_Quick_Reference
You say: > I create and initialize a variable (via new), and that all goes just fine. When I free it (via delete), it sets the pointer to 0xFEEEFEEE instead of NULL. When I insert a proper check for NULL, as all good programs that manage their own memory should, I come up with problems as 0xFEEEFEEE passes a NULL c...
As far as my experience in Flex/AIR/Flash actionscripting goes, Adobe AIR development environment and toolset is far inferior to the Visual Studio and .NET SDK as of the moment. ActionScript requires a different way of thinking, they use different primitive data types and the toolset isn't as powerful. And if I...
I occasionally get this in Visual Studio 2005. A method I use to get the controls back, is to switch the web page between code view and design view. I know it's not a fix but it's a little quicker than restarting Visual Studio.
I agree with @ZombieSheep. Just one more thing - I generally don't think that databases actually need be portable because you miss all the features your DBMS vendor provides. I think that migrating to another database would be the last thing one would consider. Just my $.02
Yes this is possible. You will have to create a named instance not used by another version of SQL Server. Works great!!
Yes this is possible. You will have to create a named instance not used by another version of SQL Server as per the previous answer and version 3.5 of .Net installed. Works great!!
Yes this is possible. You will have to create a named instance not used by another version of SQL Server as per the previous answer and version 3.5 of .Net installed. Works great!! Here the list of prerequisites: - .NET Framework 3.5 SP1 - Windows Installer 4.5 - Windows PowerShell 1.0
Unfortunately, the "full" Sharepoint Experience is limited to running Internet Explorer 6/7 and Office 2007. On the Mac, I recommend using Firefox (Camino?) which seems to work a bit better than Safari. Edit: When you say "Similar experience", what exactly are you missing? I don't have any Mac here, but I was und...
If you're just looking to dabble in it a bit and see if you like it, I recommend starting with the DAO layer, using Spring's JDBC and/or Hibernate support. This will expose you to a lot of the core concepts, but do so in a way that is easy to isolate from the rest of your app. This is the route I followed, and it was g...
What OSS project should I look at if I need to do Spring friendly WorkFlow?
|java|spring|workflow|
We need to add WorkFlow to our Spring managed application. Does anyone have any useful experience in using any of the myriad of OSS Work Flow solutions? Which one is best? Which one integrates with Spring best? Which ones should we avoid?
The overhead of having to parse a blob (image) into a byte array and then write it to disk in the proper file name and then reading it is enough of an overhead hit to discourage you from doing this too often, especially if the files are rather large.
@Nidonocu To add another flag to an existing set of values, use the OR assignment operator. Mode = Mode.Read; //Add Mode.Write Mode |= Mode.Write; Assert.True(((Mode & Mode.Write) == Mode.Write) && ((Mode & Mode.Read) == Mode.Read)));
It can depend on exactly what you want to do in addition to reading the metadata. If it is just simply the bitrate / name etc. that you need, and nothing else, something lightweight is probably best. If you're manipulating the mp3 past that PyMedia may be suitable. There are quite a few, whatever you do get, make...
@[EbGreen](#44022) said > I would just take the log files and strip the timestamps off the start of each line then save the file out to different files. Then diff those files. That's probably the best bet, unless your diffing tool has special powers. For example, you could cut -b13- file1 > trimmed_file...
I use it only when required, except for symmetric operations which due to single argument polymorphism have to be put into methods of one side: boolean sameValue (SomeNum other) { return this.importantValue == other.importantValue; }
Triggers allow you to perform a function in the database as certain events happen (eg, an insert into a table). I can't comment on mysql specifically. Precaution: Triggers can be very alluring, when you first start using them they seem like a magic bullet to all kinds of problems. But, they make "magic" stuff ha...
Triggers allow you to perform a function in the database as certain events happen (eg, an insert into a table). I can't comment on mysql specifically. Precaution: Triggers can be very alluring, when you first start using them they seem like a magic bullet to all kinds of problems. But, they make "magic" stuff ha...
The answer is no. You do not have to specify the namespace within child elements. The scoping of a namespace includes all elements until the closing tag of the element it was defined in. See section #6.1 here http://www.w3.org/TR/REC-xml-names/#scoping hope that helps
The answer is yes, namespaces do propagate to children. You do NOT have to specify the namespace within child elements. The scoping of a namespace includes all elements until the closing tag of the element it was defined in. See section #6.1 here http://www.w3.org/TR/REC-xml-names/#scoping hope that helps
Best way to test a MS Access application?
|database|unit-testing|ms-access|vba|
As far as my experience in Flex/AIR/Flash actionscripting goes, Adobe AIR development environment and toolsets are far inferior to the Visual Studio and .NET SDK as of the moment. ActionScript requires a different way of thinking, they use different primitive data types (e.g. just a `Number` instead of `int float do...
As far as my experience in Flex/AIR/Flash actionscripting goes, Adobe AIR development environment and toolsets are far inferior to the Visual Studio and .NET SDK as of the moment. ActionScript requires a different way of thinking, they use different primitive data types (e.g. just a `Number` instead of `int float do...
As far as my experience in Flex/AIR/Flash actionscripting goes, Adobe AIR development environment and toolsets are far inferior to the Visual Studio and .NET SDK as of the moment. ActionScript requires a different way of thinking, they use different primitive data types (e.g. just a `Number` instead of `int float do...
As far as my experience in Flex/AIR/Flash actionscripting goes, Adobe AIR development environment and coding/debugging toolsets are far inferior to the Visual Studio and .NET SDK as of the moment. The UI toolsets are superior though. But as _you already have a working C# code_, porting it to ActionScript might requi...
I like the [stripes framework][1]. It lets you use whatever javascript toolkit you want. Here is their documentation on [AJAX][2] [1]: http://www.stripesframework.org/ [2]: http://www.stripesframework.org/display/stripes/AJAX
First, make sure you ask yourself the question "Should I really be using an Array here"? Unless you're building something where speed is of the utmost importance, a typed List, like List<int> is probably the way to go. The only time I ever use arrays are for byte arrays when sending stuff over the network. Other tha...
Simplest I can think of: select job_number, count(*) from jobs group by job_number having count(*) > 1;
Step-By-Step ASP.NET Automated Build/Deploy
|asp.net|iis|deployment|
Seems like there are so many different ways of automating one's build/deployment that it becomes difficult to parse through all the different scenarios that people support in tutorials on the web. So I wanted to present the question to the stackoverflow crowd ... what would be the best way to set up an automated build...
Seems like there are so many different ways of automating one's build/deployment that it becomes difficult to parse through all the different scenarios that people support in tutorials on the web. So I wanted to present the question to the stackoverflow crowd ... what would be the best way to set up an automated build...
My philosophy is that you should write testable code to fit the tests, not write tests to fit the code. As for complexity, my opinion is that tests should be simple to write, simply because you write more tests if they are. I might agree that could be a good idea if the classes you're mocking doesn't have a t...
What is the null value of Nullable(Of T) ?
|vb.net|
I have a nullable property, and I want to return a null value. How do I do that in VB.NET ? Currently I use this solution, but I think there might be a better way. Public Shared ReadOnly Property rubrique_id() As Nullable(Of Integer) Get If Current.Request.QueryString("rid") ...
I've changed the code to use malloc/free. While I know how MSVC implements new/delete for plain-old-data (and SOME_STRUCT in this case was a Win32 structure, so simple C), I just wanted to know if it was a portable technique. It's not, so I'll use something that is.
Does your assembly do file I/O? If so, you must grant the assembly permission to do this. In SSMS: 1. Expand "Databases" 2. Expand the node for your database 3. Expand "Programmability" 4. Expand "Assemblies" 5. Right-click your assembly, choose Properties 6. On the "General" page, change "Permissi...
For automated testing in perl take a look at [Test::Harness](http://search.cpan.org/dist/Test-Harness/), which contains the `prove` tool. The `prove` tool can be executed with the following command: prove -r -Ilib t This will recursivly test all *.t files in the 't/' directory, while adding `lib` to the in...