instruction
stringlengths
0
30k
if you uses Mono Remoting on Linux, what's your work-around for DateTime marshalling incompatibility between Mono and .NET Remoting? i'm using WinForms on Windows using .NET 2.0 runtime, using Remoting on Linux using Mono. i cannot yet use Mono runtime on both ends as Mono's DataGridView isn't yet working fully...
That depends on which type of automation you are doing like if it is testing autoamtion Perl is suggested because Perl is much powerful extension modules via CPAN, an online Perl module inventory. If you only need a handy tool to complete a simple source file, awk is very convenient. If you are planning to use the s...
Go for all three of them, start with bash/awk/sed plus fileutils (grep, find, and so on) and then move up the abstraction hierarchy with perl and python. That way you will be able to decide for yourself which one fits your needs best. I say start with bash and friends because they are ubiquitous, some machines will ...
|mod-rewrite|.htaccess|mod-alias|
**Problem** I need to redirect some short convenience URLs to longer actual URLs. The site in question uses a set of subdomains to identify a set of development or live versions. I would like the URL to which certain requests are redirected to include the HTTP_HOST such that I don't have to create a custom .htacc...
I guess it depends on your situation. Since ordinal comparisons are actually looking at the characters' numeric Unicode values, they won't be the best choice when you're sorting alphabetically. For string comparisons, though, ordinal would be a tad faster.
Check [this][1] out. They don't convert the coordinates, but they use a special Infragistics grid event ([MouseEnterElement][2]) to get the element, which the mouse currently hovers over. Maybe it helps. [1]: http://www.abstraction-systems.com/ttf/HTML/TTFactory_TaskBasedTutorials_UltraWinGrid.htm [2]: ht...
I agree that the simplest, most Pythonic way of approaching this is to simply redefine execute in your subclasses and have it call the execute method of the base class: class Sub(Base): def execute(self): """New docstring goes here""" return Base.execute(self) This is very l...
The other main difference is that table variables don't have column statistics, where as temp tables do. This means that the query optimiser doesn't know how many rows are in the table variable (it guesses 1), which can lead to highly non-optimal plans been generated if the table variable actually has a large number of...
Also keep changes in mind. Today, Select * only selects the columns that you need, but tomorrow it may also select that varbinary(MAX) column that i've just added without telling you, and you are now also retreiving all 3.18 Gigabytes of Binary Data that wasn't in the table yesterday.
Remember that a macro returns an expression to be evaluated. In order to do this, you have to backquote: (defmacro ++ (variable) `(incf ,variable))
Found a solution. Can't use the default constructor with no arguments. For some reason this constructor just doesn't work. If it's called like such: MessageDialog md = new MessageDialog (parent_window, DialogFlags.DestroyWithParent, MessageType....
if you want your site viewable by the top 100 companies in the US. I would write without javascript.
Iteratively refactor. Also look for new features that can be done completely in the new framework as a way to show the value of the new framework.
The best way to categorize content, be it text or multimedia is to use a [taxonomy][1]. Most of the well known CMSs have built in support for Taxonomy. [Drupal][2] has one of the best support for [taxonomy][3] among the various CMSs out there. [1]: http://en.wikipedia.org/wiki/Enterprise_taxonomy [2]: http:/...
Independence from Javascript and graceful degradation are important to an application despite the actual demographics -- because such an application probably has better software design. The "human user without Javascript" may be purely hypothetical (for example, if you're trying to make money with your product). But...
As pointed out by Ivan Hamilton and Mat Noguchi, C++ supports the feature. But note that covariant return types are broken for template classes which inherit from some base in MSVC 7.X through 9.X (and probably 6 also). You get error C2555.
This is achievable by introducing a communication interface or protocol which both components understand and not passing data directly between the components.
(no) Properties in Java?
|java|
So, I have willfully kept myself a Java n00b until recently, and my first real exposure brought about a minor shock: Java does not have C# style properties! Ok, I can live with that. However, I can also swear that I have seen property getter/setter code in Java in one codebase, but I cannot remember where. How was t...
|java|
Don't forget this excellent devnet article meant for transitioning from AS2 to AS3: [http://www.adobe.com/devnet/actionscript/articles/actionscript_tips.html][1] [1]: http://www.adobe.com/devnet/actionscript/articles/actionscript_tips.html
@Menno What about using [ActiveResource](http://wiki.rubyonrails.org/rails/pages/ActiveResource) for the AWS-attributes class?
Depends on the complexity and problem domain of the task at hand. Bash scripts are quick and dirty for simple system automation tasks. For more complex things than moving files around and running commands, I'd personally say Perl is next in line as the *defacto* sys-admin goto automation tool. For more focus on code...
HTML controls will be output a lot faster than server controls since there is nothing required on part of the server.. It just literally copies the markup in the ASPX page. Server controls however require instantiation.. Parsing of the postback data and the like, this is obviously where the work comes in for the ser...
Well , it's like this : Perl is not the most user friendly scripting language , but it has CPAN ( Comprehensive Perl Archive Newtork ) , which contains thousands of libraries that implement almost anything you may think of , and Perl is really powerful , when it comes to text processing. The disadvantage would be th...
You can use objcopy to bind the contents of the file to a symbol your program can use. See, for instance, [here][1] for more information. [1]: http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967
Change app icon in Visual Studio 2005?
|c++|visual-studio-2005|icons|
I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Studio use a different icon for the app Icon ...
cint is the command processor for the particle physics analysis package <a href="http://root.cern.ch/">ROOT</a>. I use it regularly, and it works very well for me. It is fairly complete and gets on well with compiled code (you can load compiled modules for use in the interperter...)
Actually, his example won't work (although at first I thought that it would, too). Based on the help for the Start command, the first parameter is the name of the newly created Command Prompt window, and the second and third should be the path to the application and its parameters, respectively. If you add another "" b...
My guess is that you're trying to make Delphi behave like Java, which is not a good approach. I'd advise not to worry too much about unhandled exceptions. In the worst case, they'll bubble up to the generic VCL exception handler and cause a Windows message dialog. In a normal application, they won't halt the applicatio...
Using a regular expression. Check out [this link][1] for more information. [1]: http://www.regular-expressions.info/creditcard.html
wrap-region.el from [this guy's blog post](http://sami.samhuri.net/2007/6/23/emacs-for-textmate-junkies) will do what you're looking for. [Paredit](http://mumble.net/~campbell/emacs/paredit.el) will complete the TextMate-style quoting. When you type one part of a matched pair (quotes, brackets, parentheses, etc), th...
Mike is correct. Tail recursion is *not* optimized out by the Java compiler or the JVM. You will always get a stack overflow with something like this: int count(int i) { return i >= 100000000 ? i : count(i+1); }
|caching|
Each of our production web servers maintains its own cache for separate web sites (ASP.NET Web Applications). Currently to clear a cache we log into the server and "touch" the web.config file. Does anyone have an example of a safe/secure way to **remotely** reset the cache for a specific web application? Ideally ...
1. Basically you need to implement IClonable interface and then realize object structure copying. 2. If it's deep copy of all members, you need to insure (not relating on solution you choose) that all children are clonable as well. 3. Sometimes you need to be aware of some restriction during this process, for examp...
atoi and atof will convert the number even if there are trailing non numerical characters. However, if you use strtol and strtod it will not only skip leading white space and an optional sign, but leave you with a pointer to the first character not in the number. Then you can check that the rest is whitespace.
Which JavaScript library is recommended for neat UI effects?
|html|javascript|
I need a JavaScript library that supports Ajax as well as help me in making simple and neat animation effects [in a website][1] I am working on. Which library do you recommend? [1]: http://www.voidy.com/
Abstract controllers are a good idea, and I haven't found a better way. I'm interested to see what other people have done, as well.
In addition to the semicolon problem, I strongly recommend you look into bind variables. Failing to use them can cause database performance problems down the road. The code also tends to be cleaner.
I would definitely recommend JQuery as the easiest to use and the one which requires you to write the least code. http://jquery.com/
The Request.Params object is mutable. It's pretty easy to add scalar values to it as part of the request processing cycle. From the view's perspective, that information could have been provided in the QueryString or FORM POST. hth
Click Start | Run and type regedit in the Open: line. Click OK. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services Scroll down the left pane, locate the service name, right click it and select Delete. Reboot the system
Depending on what you consider "productive", you could work with XAMLPad for a lot of the basic declarative stuff. <br /> The Moonlight project is working on an IDE called Lunar Eclipse, that I think they're eventually going to be integrating into MonoDevelop. Wikipedia says it's in the SVN repository already, but I ...
I don't see any obvious way to do this as implemented, but I'd expect it would be something you could do with a custom ip_conntrack module. You'd capture the uid when first creating the conntrack entry, then apply that same uid in both directions.
The idea of exception is elegant and makes the error handling process so smooth. but this only applies when you have appropriate exception classes and in team development, one more important thing is "standard" exceptions. so if you plan to use exceptions, you'd better first standardize your exception types, or the bet...
Here is a link for ya: [HOWTO: Silverlight and Visual Studio Express][1], <br>I haven't tried it myself though. [1]: http://www.informikon.com/component/option,com_mamblog/Itemid,0/&Itemid=/task,show/action,view/id,263/
If you are using the Sun JVM, and are interested in the internal memory usage of the application (how much out of the allocated memory your app is using) I prefer to turn on the JVMs built-in garbage collection logging. You simply add -verbose:gc to the startup command. From the Sun documentation: "The command li...
Directory layout for PHPUnit tests?
|php|unit-testing|phpunit|
I'm a longtime Java programmer working on a PHP project, and I'm trying to get PHPUnit up and working. When unit testing in Java, it's common to put test case classes and regular classes into separate directories, like this - /src MyClass.java /test MyClassTest.java and so on. When unit testing w...
If the position of the element containing the Lorum Ipsum is set absolute, you can specify the position via CSS. The "here" and "and here" elements would need to be contained in a block level element. I'll use markup like this. print("<div id="lipsum">"); print("<div id="here">"); print(" here"); ...
http://www.selfhtml.org/ is in German (originally) and French (translated). English translation has been unfortunately suspended: http://en.selfhtml.org/
In Tomcat 6.0 it should be something like: org.apache.catalina.ServerFactory.getServer().getServices to get the services. After that you might use Service.findConnectors which returns a Connector which finally has the method Connector.getPort See the [JavaDocs](http://tomcat.apache.org/t...
This should do the trick, however I'm not a lisp guru. (defmacro ++ (variable) `(setq ,variable (+ ,variable 1)))
YouTube provides an ActionScript API: http://code.google.com/apis/youtube/flash_api_reference.html Using this, you could load the videos into Flash using their API and then have your Flash app create the annotations on a layer above the video. Or, alternatively, if you want to stay away from creating somethin...
All factors matter. You should measure how much time you can save using 3rd party framework and compare it to the risks of using other's code
Plone implements it's LiveSearch feature by maintaining a separate metadata table of indexed attributes (fields such as last modified, creator, title are copied from the content objects into this table). Content objects then send ObjectAdded/ObjectModified/ObjectRemoved events, and an event subscriber listens for these...
Never "mandatory." Some problems are not well solved by any framework. It would be suggestible to switch to a framework when most of the code you are implementing has already be implemented by the framework in question in a way that suits your particular application. This saves you time, energy, and will most likely be...
Perhaps [BDB][1]? It is a high perf. database that doesn't use a DBMS. [1]: http://en.wikipedia.org/wiki/Berkeley_DB
If you work on several different sites then by using a common framework across all of them you can spend time working on the code rather than trying to remember what is located where and why. I'd always use a framework of some sort, even if it's your own, as the uniformity will help you structure your project. Unles...
If you can express what you want to do in terms of C or system calls you could use Haskell's Foreign Function Interface (FFI). I started to suggest using mmap, but on second thought I think mmap might be a mapping the wrong way even if you used it with the anonymous option. You can find more information about the H...
There is a radix-tree implementation available under the GNU General Public License version 2, or (at your option) any later version: [http://www.gelato.unsw.edu.au/lxr/source/lib/radix-tree.c](http://www.gelato.unsw.edu.au/lxr/source/lib/radix-tree.c)
Migrating from Stingray Objective Toolkit
|user-interface|mfc|toolkit|stingray|objective|
We have a collection of commercial MFC/C++ applications which we sell using [Stingray Objective Toolkit][1], we have source code license and have ported it in the past to Solaris/IRIX/HP-UX/AIX using [Bristol Technologies WindU][2] (Windows API on UNIX, including MFC). Any long story short recently about 18 months ...
The listview doesn't really have a concept of 'column' since it is intended just to be, well, a list. I'm going to assume that you are using databinding to attach a list of 'somethings' to the ListView. If that is the case then you will just have a list of items and the html in the LayoutTemplate will decide on just...
The listview doesn't really have a concept of 'column' since it is intended just to be, well, a list. I'm going to assume that you are using databinding to attach a list of 'somethings' to the ListView. If that is the case then you will just have a list of items and the html in the LayoutTemplate will decide on just...
Also remember that they all encode different sets of characters, and select the one you need appropriately. encodeURI() encodes fewer characters than encodeURIComponent(), which encodes fewer (and also different, to dannyp's point) characters than escape().
Add a NotifyIcon control to your form, then use the following code: private void frm_main_Resize(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) { this.ShowInTaskbar = false; this.Hide(); notif...
Like this: set @department := 'Engineering'; Then, reference `@department` wherever you need to in script.sql: update employee set salary = salary + 10000 where department = @department;
You can use a pty ("pseudo-teletype", where a serial port is a "real teletype") for this. From one end, open /dev/ptyp5, and then attach your program to /dev/ttyp5; ttyp5 will act just like a serial port, but will send/receive everything it does via /dev/ptyp5. If you really need it to talk to a file called "/dev/t...
You can use a pty ("pseudo-teletype", where a serial port is a "real teletype") for this. From one end, open /dev/ptyp5, and then attach your program to /dev/ttyp5; ttyp5 will act just like a serial port, but will send/receive everything it does via /dev/ptyp5. If you really need it to talk to a file called "/dev/t...
There's an answer above that says to use a synchronous ajax call, and that is the best case scenario. The problem is that unload doesn't work everywhere. If you look [here][1] you'll find some tricks to help you get unload events in safari... You could also use Google Gears to save content user side for situations w...
"Algorithms in C" (1st edition) by Sedgewick taught me all about algorithms as well as teaching me all about the pitfalls of documentation and copy/pasting code as all the example code in this version was taken from the "Algorithms in Pascal" version and were simply passed through a simple code translator which did not...
I prefer a copy ctor to a clone. The intent is clearer.
Dan Kegel put together a summary of techniques for handling large amounts of network connections from a single server, here: http://www.kegel.com/c10k.html
Using [sscanf][1], you can be certain if the string is a float or int or whatever without having to special case 0, as is the case with atoi and atof solution. Here's some example code: int i; float f; if(sscanf(str, "%d", &i) != 0) //It's an int. ... if(sscanf(str "%f", &f) != 0) //It'...
Using `$$` is a bad idea, because it will usually create a race condition, and allow your shell-script to be subverted by an attacker. See, for example, all [these people][1] who created insecure temporary files and would up having to issue security advisories. Instead, use `mktemp`. The [Linux man page for mktemp]...
You can use the [`include`][1] task to include another build file (containing your properties) within the main build file. The `if` attribute of the `include` task can test against a variable to determine whether the build file should be included: <include buildfile="devPropertyFile.build" if="${buildEnvironment ==...
http://script.aculo.us/ I think it fits your 'neat animation effects' requirement.
I've been playing with [Scriptaculous][1] and [jQuery][2]. Both are good although I'm leaning more toward jQuery. [1]: http://script.aculo.us/ [2]: http://jquery.com/
Python + Qt + OpenGL - I surely believe any application can be written faster and better using python. QT4 is cross-platform, beautifull, implements everything you need from widgets (acessibility, etc...), and...it integrates with OpenGL. That means, you can simply have a widget that is a viewport to openGL stuff you...
This is not an answer, more of a plea: Please don't do that. Your reimplemented widgets will lack all sorts of functionality that users will miss. Will your text-entry boxes support drag'n'drop? Copy/paste? Right-to-left scripts? Drag-select? Double-click-select? Will all these mechanisms follow the native conventio...
Also keep in mind not to get swept away in OO ([see blog][1]) and always model objects based on behavior required, if you were designing an app where the only behavior you required was a generic name and species for an animal then you would only need one class Animal with a property for the name, instead of millions of...
Output parameters not readable when used with a DataReader
|.net|stored-procedures|ado.net|parameters|datareader|
When using a DataReader object to access data from a database (such as SQL Server) through stored procedures, any output parameter added to the Command object before executing are not being filled after reading. I can read row data just fine, as well as all input parameters, but not output ones. *[This question is ...
Lets think about which is faster. If you can select just the data you need then it is faster. However in testing you can pull all the data to judge what data can be filtered out based on business needs.
This is due to the "by design" nature of [DataReaders][1]. Any parameters marked as `ParameterDirection.Output` won't be "filled" until the DataReader has been closed. While still open, all Output parameters will more than likely just come back `null`. The full Microsoft KB article concerning this can be viewed [h...
why to use StringBuffer in java instead of the string concantion operator
|java|
someone told me it's for more effecient to use StringBuffer to concanate strings in java then to use the '+' operator for Strings. I'd like to know what happens under the hood when you do that and what StringBuffer does differently
If you have such a large organization then do not mandate a single specific SCM. I am sure they are not all working on the same code and it would be worth while to let the teams themselves choose what they are most comfortable with. (You may need to provide some training so the understand how to choose between G...