instruction
stringlengths
0
30k
|.net|dataview|icomparable|
|.net|dataview|icomparable|asp.net|
|.net|asp.net|dataview|icomparable|
My DataView is acting funny and it is sorting things alphabetically and I need it to sort things numerically. I have looked all across the web for this one and found many ideas on how to sort it with ICompare, but nothing really solid. So my questions are 1. How do I implement ICompare on a DataView (Looking f...
***What platform are you looking for?*** What library you use will depend on this. For the XNA framework, Farseer is pretty nice.
Use Eclipse integration, it works perfectly fine. The main change from CVS, is that you only merge deltas from a branch, ie changes from one revision to another. That is to say you have to track the correct start revision somehow (unless you have svn 1.5 merge history) If you got that right, it's only up to you ...
I feel like outvoted so far, but I'll vouch for one of: if (expr) { funcA(); } else { funcB(); } Or, shorthand in limited cases for readability: if (expr) funcA(); else funcB(); To me, the shorthand format is nice when you want it to read like English grammar. If...
I had a similar issue with a localization component that I wrote. My component is designed to access localized messages with enum constants that index into a resource bundle, not a hard problem. I found that I was copying and pasting the same "template" enum code all over the place. My solution to avoid the duplicat...
If you're generating the page that links to the JS files a simple solution is appending the file's last modification timestamp to the generated links. This is very similar to Huppie's answer, but works in version control systems without keyword substitution. It's also better than append the current time, since that...
According to the docs, you can do something like this: <!--- Create the component instance. ---> <cfobject component="tellTime2" name="tellTimeObj"> <!--- Invoke the methods. ---> <cfinvoke component="#tellTimeObj#" method="getLocalTime" returnvariable="localTime"> <cfinvoke component="#tellT...
Your question could use some clarification as to exactly what aspects of translation / localization you need help with. Do you need help extracting strings from code? Tracking down improper use of non-localizable String.Formats in code (i.e. mm/dd/yyyy vs. dd/mm/yyyy)? Help managing all the resources once you've ext...
You can use cfinvoke. You don't have to specify a component. <cfinvoke method="application.#funcName#" argumentCollection="#params#">
Note that concurrency doesn't magically give you more resource. You need to establish what is slowing CalculateSmth down. For example, if it's CPU-bound (and you're on a single core) then the same number of CPU ticks will go to the code, whether you execute them sequentially or in parallel. Plus you'd get some overh...
There are a number of different ways to pull external information into SharePoint. For mashing up SharePoint data in external applications: - [Web Services][5]; great web services coverage for the underlying API will allow you to build external mashups (like the one you mention in your question comment). Speci...
There are a number of different ways to pull external information into SharePoint. For mashing up SharePoint data in external applications: - [Web Services][5]; great web services coverage for the underlying API will allow you to build external mashups (like the one you mention in your question comment). Speci...
Declare the Clone() method as abstract. This should work even when the parent class does have a concrete implementation. Of course, the risk when enforcing such things is that the writer of the derived class will become annoyed, say "I'm not going to use Clone anyway" and does something like a bytewise copy, or even...
What is a multitasking operating system?
|operating-system|computer-science|
What are the characteristics of a multitasking operating system? What makes it multitasking? Are there non-multitasking operating systems?
|computer-science|homework|operating-system|
I really like [CodeLite][1]. Check out it's [feature page][2]. [1]: http://codelite.org [2]: http://codelite.org/Main/ReadMore
How do you interpret a query's explain plan?
|sql|database|oracle-database|sql-execution-plan|
When attempting to understand how a SQL statement is executing, it is sometimes recommended to look at the explain plan. What is the process one should go through in interpreting (making sense) of an explain plan? What should stand out as, "Oh, this is working splendidly?" versus "Oh no, that's not right."
You should have separated folder structure for scripts. For example JavaScript folder under application root. Storing js files with views is not only affects you with path resolving issues but also affects security and permissions thins. Also it's much more easier later to embed JS files as assembly resources if you wi...
I think perhaps the right way to do this would be an extender provider: [MSDN documentation][1] Then, you can use the editor to provide the field names to hook up with, and your extender provider can be passed an IQueryable&lt;T>, add the criteria, and return an IQueryable&lt;T>. [1]: http://msdn.microsoft.co...
A multitasking OS is able to manage various processes side-by-side. One particular ability is the sharing of CPU time among the processes. Yes, there are plenty of non-multitasking OSs. Back in time, they were the rule: MSDOS, for example.
Access has the capability to create downright beautiful reports. The problem is that it can't make a spreadsheet look better than Excel. You have to know when to use each tool. Use Excel when you have spreadsheet-like formatting, need a lot of boxes and lines, or want to draw charts. Use Access when you will outp...
What is the strict aliasing rule?
|c++|c|compiler|
When asking about [common undefined behavior in C][1], souls more enlightened than I referred to the strict aliasing rule. What are they talking about? [1]: http://stackoverflow.com/questions/98340/what-are-the-common-undefinedunspecified-behavior-for-c-that-you-run-into
One classic suggestion for a string hash is to step through the letters one by one adding their ascii/unicode values to an accumulator, each time multiplying the accumulator by a prime number. (allowing overflow on the hash value) size_t hash(const char *in) { size_t out=0; while(NULL != *in) ...
One classic suggestion for a string hash is to step through the letters one by one adding their ascii/unicode values to an accumulator, each time multiplying the accumulator by a prime number. (allowing overflow on the hash value) template <> struct myhash{}; template <> struct myhas...
It sounds like [Chipmunk](http://wiki.slembcke.net/main/published/Chipmunk) might meet your needs.
From small to large projects
|oop|
I've been quite used to working on small projects which I coded with 1,000 lines or less (pong, tetris, simple 3d games, etc). However as my abilities in programming are increasing, my organization isn't. I seem to be making everything dependent on one one another, so it's very hard for me to change the implementatio...
Another topic to research is [Heuristics][1] for usability. This can give you general tips to follow. Here's another [use of heuristics][2] [1]: http://www.useit.com/papers/heuristic/heuristic_list.html"heuristics" [2]: http://instone.org/heuristics
Hibernate has quirks to be sure but that is because the problem it is trying to solve is complex. Every time someone complains about Hibernate I remind them of all of the boring DAO code that they would have to maintain if they weren't using it. A few tips: - Hibernate is no substitute for a good database desig...
Disable Cakephp's Auto Model "feature"
|php|cakephp|model|
In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and now I'm experiencing the bad side of this. ...
@Lou: It would be just syntactic sugar for: void doSth(Object foo) throws Exception{ Method m = foo.getClass().getMethod("foo", String.class); m.invoke(foo, "baz"); } I do use reflection, but I prefer it to be ugly so it's not abused.
Best place: here. Each time I asked, I got **correct** answers, in less than 20 minutes. **Faster** that anywhere else.
I've done a lot of Spring/Hibernate development. Over time the way people used both in combination has changed a bit. The original HibernateTemplate approach has proved to be difficult to debug since it swallows and wraps otherwise useful exceptions; talk to the Hiberante API directly! Please keep looking at the gen...
There are two ways: 1. Install a Thread.UncaughtExceptionHandler on the EDT 2. Set a system property: System.setProperty("sun.awt.exception.handler",MyExceptionHandler.class.getName()); I don't know if the latter works on non-SUN jvms.
There are two ways: 1. /* Install a Thread.UncaughtExceptionHandler on the EDT */ 2. Set a system property: System.setProperty("sun.awt.exception.handler",MyExceptionHandler.class.getName()); I don't know if the latter works on non-SUN jvms. -- Indeed, the first is not correct, it's only a mechanism for d...
spring IDE Update URL: http://springide.org/updatesite
How do I programmatically wire up ToolStripButton events in C#?
|c#|events|toolstripbutton|toolstripitem|
I'm programmatically adding ToolStripButton items to a context menu. That part is easy. this.tsmiDelete.DropDownItems.Add("The text on the item."); However, I also need to wire up the events so that when the user clicks the item something actually happens! How do I do this? The method that handles the c...
string sample = ",liger, unicorn, snipe"; sample = sample.Trim(','); // to remove just the first comma Or perhaps: sample = sample.Trim.Trim(','); // to remove any whitespace and then the first comma
string sample = ",liger, unicorn, snipe"; sample = sample.Trim(','); // to remove just the first comma Or perhaps: sample = sample.Trim().Trim(','); // to remove any whitespace and then the first comma
string sample = ",liger, unicorn, snipe"; sample = sample.TrimStart(','); // to remove just the first comma Or perhaps: sample = sample.Trim().TrimStart(','); // to remove any whitespace and then the first comma
Well, if you want to use LDAP, let me point you to the LDAP authentication code we use for Maia Mailguard: look for the function named [lauth_ldap][1] I think it requires ldap version 3, so you have to set that parameter for ldap. To verify the password, we use the ldap bind function to let the ldap server authenti...
With help from the answer given the final solution was as follows: Add another button and hide it. <input id="btnHdn" runat="server" type="button" value="button" style="display:none;" /> Point the AnimationExtender to the hidden button so the firing of the unwanted click event never happens. <cc1:An...
Appending the current time to the URL is indeed a common solution. However, you can also manage this at the web server level, if you want to. The server can be configured to send different HTTP headers for javascript files. For example, to force the file to be cached for no longer than 1 day, you would send: ...
Emacs is a fantastic, stay-out-of-my-way-but-be-able-to-do-everything kind of IDE. See this other related question: [Using Emacs as an IDE][1] [1]: http://stackoverflow.com/questions/63421/using-emacs-as-an-ide
How to skip fields using javascript?
|javascript|firefox|focus|skip|
I have a form like this: &lt;form name="mine"&gt;<br> &lt;input type=text name=one&gt;<br> &lt;input type=text name=two&gt;<br> &lt;input type=text name=three&gt;<br> &lt;/form&gt; When user types a value in 'one', I sometimes want to skip the field 'two', depending on what he typed. For example, if user type...
From what I understand `MainWindowHandle` property of the process you are starting is not valid. If that's the case, you can use [`FindWindow`][1] function (from Win32 SDK) which returns the window handle you need. All you need is the class name of target application's main window. You can obtain it using Spy++ or [Win...
In addition to monitoring number of clicks, it might also be helpful to monitor how long they look at the story they clicked on. It's more complicated data, but provides another level of information. You would then not only be seeing if the stories you picked out grab the user's attentions, but also that the stories ...
Comet is challenging to scale with IIS because of comet's persistent connectivity, but there is a team looking at Comet scenarios now. Also look at Aaron Jensen's blog as I believe he's done some early Comet work in ASP.NET.
Comet is challenging to scale with IIS because of comet's persistent connectivity, but there is a team looking at Comet scenarios now. Also look at Aaron Lerch's blog as I believe he's done some early Comet work in ASP.NET.
@slim - I am with you again this morning. It sounds like a classic case of **Not Invented Here Syndrome**. If they aren't keen on spring, they should consider other options rather than rolling their own framework (whether they acknowledge doing it or not). [Guice][1] comes to mind as an possibility. Also picoco...
I would say it depends on the level of your AS2 (and general OOP) knowledge. If you're used to objected-oriented programming and strong typing the learning curve shouldn't really be that steep. I was brought up as a java programmer and find that the new concepts in AS3 are for the most part easy to grasp and that t...
How to do picture overlay in HTML (something like marker on top of google map)?
|html|overlay|image|
Anyone know how to do picture overlay or appear on top of each other in HTML? The effect will be something like the marker/icon appear on Google Map where the user can specify the coordinate of the second picture appear on the first picture. Thanks.
I agree this is one area that PHP's documentation has dropped the ball, but for me I've always used the SimpleXML mixed with something like the xml2Array functions. The Xml you get from simpleXML isn't that hard to navigate with the help of a dumping function like print_r.
I've used [ZetaHtmlTidy][1] in the past to load random websites and then hit against various parts of the content with xpath (eg /html/body//p[@class='textblock']). It worked well but there were some exceptional sites that it had problems with, so I don't know if it's the absolute best solution. [1]: http://www....
I think that it highly depends on what the exact relation is between the two objects.
Tabs and spaces conversion
|eclipse|formatting|
I would like to automatically convert between tabs and spaces for indentation when I commit/update code to/from our repository. I have found the AnyEdit plugin for eclipse, which can convert directories of files. Not bad for a start, but does anybody have more expierience on how to handle this? Or maybe know of an Ant ...
[Html Agility Pack](http://www.codeplex.com/htmlagilitypack) >This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. Th...
For static analysis there is [pylint](http://www.logilab.org/857) and [pychecker](http://pychecker.sourceforge.net/). Personally I use pylint as it seems to be more comprehensive than pychecker. For cyclomatic complexity you can try [this perl program](http://www.journyx.com/curt/complexity.html), or this [article]...
[Internet Explorer Developer Toolbar][1] seems to be the best option. [1]: http://www.microsoft.com/downloadS/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en
Subclipse SVN for eclipse Update URL: http://subclipse.tigris.org/update_1.4.x
Snippet from some Delphi source code using the Client Access Express Driver. Probably not exactly what you are looking for, but it may help others that stumble upon this post. The DBQ part is the default library, and the System part is the AS400/DB2 host name. ConnectionString := 'Driver={Client Access OD...
We're using Subversion 1.5, TortoiseSVN, and for Visual Studio integration, [PushOk's SVN plugin][1]. The plugin isn't free, but it's affordable and reliable. [1]: http://www.pushok.com/soft_svn.php
Answering my own question with my current favourite, Jadclipse, which works with jad to disassemble class files from third party libraries. [http://jadclipse.sourceforge.net/][1] [1]: http://jadclipse.sourceforge.net/
Writing data over RxTx using usbserial?
|linux|usbserial|data-available|rxtx|
I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial. One of my biggest problems is that the RxTx SerialPortEvent.OUTPUT_BUFFER_EMPTY does not work on linux over usbserial. How do I know when I should write to the ...
**DISCLAIMER** I haven't tested this code at all, but the idea should work. Here's some Actionscript 3.0 code which makes use of the [ExternalInterface](http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html) class. import flash.display.Sprite; import flash.external.Ext...
Another topic to research is [Heuristics][1] for usability. This can give you general tips to follow. Here's another [use of heuristics][2] [1]: http://www.useit.com/papers/heuristic/heuristic_list.html [2]: http://instone.org/heuristics
If you like how haml works from a coding point of view, don't worry about the performance of the templating engine too much. (Though, as you've pointed out, it's now fast.) It can definitely generate any output the other engines can. Generally, it's more profitable to put your energy into setting up caching than wor...
You could look at the Havok engine. I believe they released a free version for non-commerical use. There is a constraint kit for it that will allow you to constrain the physics to 2 planes, in your case, x and y.
Sketch out an architectural design ahead of time. It doesn't have to be too detailed, but imagine how you want things to fit together in general terms.
ask your wife or grandma to try using it
The physics in most 2D side-scrolling platform games are so simple that you could easily implement them yourself. What kind of effects are you looking for?
It may be "possible" depending on how the filesystem stores files to quickly insert (ie, add additional) bytes in the middle. If it is remotely possible it may only be feasible to do so a full block at a time, and only by either doing low level modification of the filesystem itself or by using a filesystem specific int...
Use of design patterns is a good first step. Also, spend a little time writing good documentation regarding system architecture and requirements for the application. Using source control will help if you are not already doing this. Look for libraries that may do want you want before you decide to roll your own...
Emacs 22 has worked pretty well for me.
Mono has a public BigInteger implementation already: http://www.go-mono.com/docs/index.aspx?link=T:Mono.Math.BigInteger You can just grab the Mono.Security assembly to use it; since its a Mono class library it should be MIT licensed too.
If you got the time you could use PhysX but its likely an over kill for 2D. Besides that if you plan on having your game work on a PC and want some cool physics, try googling for "verlet integration" I know there are quite a few verlet implementations around (nice for particles and 2D rag-dolls).
It's a functional programming language and will do well broaden your experience. Even if you don't use it in the real world doesn't mean it doesn't have any value. It will help you master things like recursion and help to force you to think of problems in different ways than you normally would. I *wish* my schoo...
`<link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />` The second one is for IE. The first one is for other browsers.