instruction
stringlengths
0
30k
Yes, there is no standard but libraries like **Qt** and **boost** can make your life much easier when you do cross-platform development.
Looks like RHEL4 is the culprit. Works well on Fedore 7 (the version of apache is newer and there is no crash)
I actually develop in .NET, run all my tests first on Mono, and then on Windows. That way I know my applications are cross platform. I have done this very successfully on both ASP.NET and Winforms applications. I am not really sure where some people get the impression Mono is so horrible from, but it certainly has d...
Actually, you're not quite right about that you cannot specify what types a method expects, it does work as you'd expect. function foo ( array $param0, string $param1 ); And so on, and you can even pass in your own classes as expected parameters. Calling the methods/functions with something else will result i...
Shouul you learn ASP.NET or Winforms first? ASP or MFC? HTML or VB? C# or VB? Set aside the idea that there is a logical progression through what has become a hgihly complex interwoven set of technologies, and take a step back and ask yourself a series of questions: - What are your goals; how do you want to ba...
I actually don't think the compiler is wrong, although this is an odd case. From a code analysis point-of-view, it sees you storing the address of a variable, but that address is never dereferenced and you don't jump outside of the function to external code that could use that address you stored. When you exit the ...
You'll have to add a reference to Microsoft Visual Basic for Applications Extensibility 5.3 (or whatever version you have). I have the VBA SDK and such on my box - so this may not be exactly what office ships with. Also you have to enable access to the VBA Object Model specifically - see the "Trust Center" in Word o...
Take a deep look at the [XmlSerializer][1]. Even if you are constrained to not use XML on-disk, you might want to copy some of its features. This could then look like this: public class DataObject { [Column("name")] public string Name { get; set; } [Column("prefix")] public string P...
I've used both FLEXlm from Macrovision (formerly Globetrotter) and the newer RLM from Reprise Software (as I understand, written by FlexLM's original authors). Both can key off either the MAC address or a physical dongle, can be either node-locked (tied to one machine only) or "floating" (any authorized machine on the...
You don't use an img tag, but an element with a background-image css attribute and set the background-position on hover. IE requires an 'a' tag as a parent element for the :hover selector. They are called css sprites. A great article explaining how to use css sprites. http://www.alistapart.com/articles/sprites/...
Yeah, make sure you have a sensible editor set. Not sure what you're default editor will be but if, like me, it is nano (will say somewhere near the top after you type commit) you just need to type in a comment and then hit Ctrl-x to finish. Then hit y, followed by enter to affirm the commit. Also, if you want to ...
here's some code to play with. basic idea: put all possible states of the picture into one big image; set a "window size", that's smaller then the image; move the window around using <code>background-position</code> <style type="text/css" media="screen"> #test { display: block; width: 250px; ...
TinyMCE vs Xinha
|html|editor|tinymce|wsyiswyg|
I have to choose an online WYSIWYG editor. I'm pending between [TinyMCE][1] and [Xinha][2]. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons? [1]: http://tinymce.moxiecode.com/ [2]: http://trac.xinha.org/
|html|editor|tinymce|wsyiswyg|
|html|editor|wysiwyg|tinymce|
I would thought that you're out of luck, but did find this: <http://dotnetslackers.com/articles/csharp/WritingAnActiveXControlInCSharp.aspx> Gives me the willies... but it might just right for you.
Listview background drawing problem C# Winform.
|c#|winforms|listview|bounty|
I have a little problem with a Listview. I can load it with listview items fine, but when I set the background color it doesn't draw the color all the way to the left side of the row [The listViewItems are loaded with ListViewSubItems to make a grid view, only the first column shows the error]. There is a a narrow ...
Server performance metric tools for LAMP
|performance|monitoring|metrics|
Any suggestions for tools to monitor page load times/errors and other performance metrics for a PHP application? I am aware of the FireBug and YSlow tools, but this is for more server monitoring.
SVN only controls what you put into it when creating your repository. Don't just import your entire project folder but import a "clean" folder BEFORE doing a build. After the build you get all the object files or your _Resharper folder etc. but they are not version controlled. I forgot: the <pre>svn:ignore</pre> com...
Add the file names (or even the pattern `_Resharper.*`) to the `svn:ignore` property for its parent directory.
I'm not an expert with After Effects, but I have messed around with it. I think [reading this][1] might help you out. [1]: http://library.creativecow.net/articles/ebberts_dan/ae6_exp.php
[Here's a link to show the ignoring process in TortoiseSVN][1] [1]: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-ignore.html
Short answer: the "svn:ignore" property Long answer: # cd /your/working/copy # export EDITOR=vi # svn propedit svn:ignore . (add "_Resharper.ProjectName" on its own line and write the file out) Edit: erg... doh, just realized you said tortoise... this is how you do it with the command-line ver...
> On initially loading the page the js loads and is executed but on subsequent reloads of the page the js code does not go through the execution process again I'm not sure I understand your problem exactly, since the JS should execute every time, no matter if it's an include, or inline script. But I'm wondering if ...
`$_` (dollar underscore): the last word from the previous command. Similar to `!$` except it doesn't put its substitution in your history like `!$` does.
images can be selected too. there are limits to using javascript to deselect text, as it might happen even in places where you want to select. To ensure a rich and successful career, steer clear of all requirements that need ability to influence or manage the browser beyond the ordinary... unless, of course, they are...
When I yank text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), I can't paste it anywhere else. I'm reduced to opening kate to copy the text with ^C. Is there a better way?
Explode that doesn't return empty strings?
|php|
PHP's explode function returns an array of strings split on some provided substring. It will return empty strings like this: var_dump(explode('/', '1/2//3/')); array(5) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(0) "" [3]=> string(1) "3" ...
In the RPC field, Json-RPC will bring a big performance improvement over xml-rpc: [http://json-rpc.org/wiki/python-json-rpc][1] [1]: http://json-rpc.org/wiki/python-json-rpc
In assembly language (x86 processors, 16 or 32 bit mode): <pre><code> call $ </code></pre> which will generate: * in 32 bit mode: 0xe8;0xfb;0xff;0xff;0xff * in 16 bit mode: 0xe8;0xfd;0xff in C/C++: <pre><code> int main( ) { return main( ); } </code></pre>
I don't agree. Object Oriented Programming is not inherently better than procedural programming. I believe that you should not use OO unless you need polymorphic behavior (inheritance, overriding methods, etc). Using objects as simple containers for code is not worth the overhead. This is *particularly* true of strings...
.NET Web Application Portability to SilverLight
|asp.net|silverlight|
The company where I work created this application which is core to our business and relies on the web browser to enforce certain "rules" that without them renders the application kinda useless to our customers. Sorry about having to be circumspect, An NDA along with a host of other things prevents me from saying exact...
The aim of the new automatic properties is to reduce the ammount of boiler plate code you need to write when you just have a simple propertly that doesn't need any special logic in the get or the set. If you want to access the private member that these properties use, that's usually for a few reasons: - You ne...
The aim of the new automatic properties is to reduce the ammount of boiler plate code you need to write when you just have a simple propertly that doesn't need any special logic in the get or the set. If you want to access the private member that these properties use, that's usually for a few reasons: - You ne...
I think the obvious use is as a shortcut. If you're e.g. initializing an object you simply save typing a lot of "ObjectName." Kind of like lisp's "with-slots" which lets you write (with-slots (foo bar) objectname "some code that accesses foo and bar" which is the same as writing "some code tha...
There are many libraries that make cross-platform development easier on their own, but making a complete wrapper for all platforms ends up being either small and highly customized, or massive and completely ridiculous. Carried to it's logical conclusion, a complete wrapper for all aspects of an operating system beco...
`join()` function in Ruby: def join(seq, sep) seq.inject { |total, item| total << sep << item } or "" end join(["a", "b", "c"], ", ") # => "a, b, c"
@David: I already have the parser (and most of these will be hand written, so I decided against XML). But that looks like I really nice way of doing it; I'll have to check it out. Excellent point about versioning too. @Argelbargel: That looks good too. :')
I've started using PDO because the statement support is better, in my opinion. I'm using an ActiveRecord-esque data-access layer, and it's much easier to implement dynamically generated statements. MySQLi's parameter binding must be done in a single function/method call, so if you don't know until runtime how many para...
@itj You may have FlexeLint aliased to "lint" on your system, but FlexeLint is a commercial product which has no development history in common with Johnson's original Unix Lint, AFAIK. A non-commercial alternative is [Splint][1]. Lint-like tools generally suffer from a "false alarm" problem: they report a lot more i...
Lint-like tools generally suffer from a "false alarm" problem: they report a lot more issues than really exist. If the proportion of genuinely-useful warnings is too low, the user learns to just ignore the tool. More modern tools expend some effort to focus on the most likely/interesting warnings.
You could export the code to files and then read them back in. I've been using the code below to help me keep some Excel macros under source control (using Subversion & TortoiseSVN). It basically exports all the code to text files any time I save with the VBA editor open. I put the text files in subversion so that...
|c#|winforms|listview|
I have a little problem with a Listview. I can load it with listview items fine, but when I set the background color it doesn't draw the color all the way to the left side of the row [The listViewItems are loaded with ListViewSubItems to make a grid view, only the first column shows the error]. There is a a narrow ...
I have a little problem with a Listview. I can load it with listview items fine, but when I set the background color it doesn't draw the color all the way to the left side of the row [The listViewItems are loaded with ListViewSubItems to make a grid view, only the first column shows the error]. There is a a narrow ...
I'd recommend FCKEditor over TinyMCE. I've had much better luck with it (better markup, better managers, better extensibility, better speed, better compatibility, etc)
Haven't tried Xihna myself, but I have experience with TinyMCE and FCKeditor. In my company we switched to TinyMce (from FCKeditor) due to the superior support for pasting from word documents and the (relatively easy to work with) plugin architecture which we used to add some custom modules (links browser, simple file ...
How do you create templates for SQL Server 2005 Reporting Services reports?
|reporting|services|report|templates|
I want to create templates for base new reports on to have common designs. How do you do it?
|reporting-services|templates|
I guess the best two (and by far the most common) are either GD or ImageMagick. I've had a lot of joy with the second.
No, but you can **PEEK** into the queue and decided if you really want to consume the messge.
No, but you can **PEEK** into the queue and decide if you really want to consume the message.
IMagick is a native PHP extension to create and modify images using the ImageMagick API. It is used on many shared hosts: <http://pecl.php.net/package/imagick>
I don't think there's any excuse for generating HTML inside your business logic. Don't even do it when it's just a "quick fix" or when you'll "go back and fix it later", because that never happens. To reiterate my position from other questions, using some control logic (conditionals, loops) within HTML to construct ...
The need to produce reports with a common starting design and format is key to any project involving clients and their reports. I have been working on reports for over 10 years now. This has not been the largest portion of my jobs through the years but it has been a very import one. The key to any report project is ...
Did you know that MS VC6's implementation of the STL isn't thread-safe? In particular, the reference counting optimization in basic_string blows up even when compiled with the multi-threaded libraries. http://support.microsoft.com/kb/813810
You don't actually need to do anything here. The original code listed in your question will work fine, assuming `ms_timer()` returns a value of type uint16_t. (Also assuming that the timer doesn't overflow twice between checks...)
You don't actually need to do anything here. The original code listed in your question will work fine, assuming `ms_timer()` returns a value of type uint16_t. (Also assuming that the timer doesn't overflow twice between checks...) To convince yourself this is the case, try the following test: uint16_t t1 ...
Does Django have HTML helpers?
|django|
Does Django have any template tags to generate common HTML markup? For example, I know that I can get a url using {% url mapper.views.foo %} But that only gives me the URL and not the HTML code to create the link. Does Django have anything similar to Rails' link_to helper? I found [django-helpers][1] but sinc...
|html|django|
Having experience with Delphi, I would say that using *with* should be a last-resort size optimization, possibly performed by some kind of javascript minimizer algorithm with access to static code analysis to verify its safety. The scoping problems you can get into with liberal use of the *with* statement can be a r...
Javascript has static variables inside functions: function someFunction(){ var Static = arguments.callee; Static.someStaticVariable = (Static.someStaticVariable || 0) + 1; alert(Static.someStaticVariable); } someFunction() //Alerts 1 someFunction() //Alerts 2 someFunction...
Doesn't matter one bit if you can do this on your normal desktop computer. The iPhone is not a normal desktop computer. Unlike a desktop computer, the *only* way to get an application on the iPhone without a jailbreak is to get it from the App Store. The *only* way to get on the App Store is to follow Apple's rules...
Starting a process with inherited stdin/stdout/stderr in Java
|java|io|process|pipe|
If I start a process via Java's [ProcessBuilder][1] class, I have full access to that process's standard in, standard out, and standard error streams as Java `InputStreams` and `OutputStreams`. However, I can't find a way to seamlessly connect those streams to `System.in`, `System.out`, and `System.err`. It's possib...
Starting a process with inherited stdin/stdout/stderr in Java 6
|java|process|io|pipe|
If I start a process via Java's [ProcessBuilder][1] class, I have full access to that process's standard in, standard out, and standard error streams as Java `InputStreams` and `OutputStreams`. However, I can't find a way to seamlessly connect those streams to `System.in`, `System.out`, and `System.err`. It's possib...
All the answers here seem right: locks' usefulness is to block threads from acessing locked code concurrently. However, there are many subtleties in this field, one of which is that locked blocks of code are automatically marked as **critical regions** by the Common Language Runtime. The effect of code being marked ...
1) We're programmers, not DBA fascists. If your requirements state that the database must be locked down 100%, Linq is not for you. I'm not a DBA, so I believe that most of the performance/security hype is just that. Linq is for me. 2) You can do joins with linq.
1) We're programmers, not DBA fascists. If your requirements state that the database must be locked down 100%, Linq is not for you. I'm not a DBA, so I believe that most of the performance/security hype is just that. Linq is for me. 2) You can do joins with linq. *@Philippe*: Linq automatically transforms eva...
What do you need object for? The way you describe it, you'll use them as some kind (of key-wise) restricted map anyway. If you do not need some kind of inheritance, I'd simply wrap a map-like structure into a object like this: <pre><code> class RestrictedKVDataStore { const ALLOWED_KEYS = new Collection('name',...
What do you need object for? The way you describe it, you'll use them as some kind (of key-wise) restricted map anyway. If you do not need some kind of inheritance, I'd simply wrap a map-like structure into a object like this: <pre>[java-inspired pseudo-code:]<code> class RestrictedKVDataStore { const ALLOWED_K...
Whether all of your database access is "behind" stored procedures depends on the needs of the application and the company. I have implemented systems that use views to get all data and stored procedures for all updates. This allows for centralized security and database logic while still letting front-end developers us...
The HTML specs are a bit vague (ie. completely lacking) with regard to this odd combination. They do say that a form element with the disabled attribute set should not be successful, so it really *can't* be selected. The browser may well render it so that it looks selected, but it shouldn't show up in the POSTed dat...
How often do you use System.Component.Background worker in your UIs ? (if ever)
|.net|user-interface|
[Ooh, can I use PowerShell][1]? Get-Content -Encoding UTF8 FILE-UTF8.TXT | Out-File -Encoding UTF7 FILE-UTF7.TXT The shortest version, if you can assume that the input BOM is correct: gc FILE.TXT | Out-File -en utf7 file-utf7.txt [1]: http://stackoverflow.com/questions/52487/the-most-amazing-pie...
This is one possible reason. There is a IBOutlet object that isn't being initialized and a message is being invoked on nil. The stack trace might look like this: #0 0x90a594c7 in objc_msgSend #1 0xbffff7b8 in ?? #2 0x932899d8 in loadNib #3 0x932893d9 in +[NSBundle(NSNibLoading) _load...
I work with graph structures in Java a lot, and my advice would be to make any data member of the Node and Edge class that the Graph depends on for maintaining its structure final, with no setters. In fact, if you can, I would make Node and Edge completely immutable, which has <a href="http://www.javapractices.com/topi...
I work with graph structures in Java a lot, and my advice would be to make any data member of the Node and Edge class that the Graph depends on for maintaining its structure final, with no setters. In fact, if you can, I would make Node and Edge completely immutable, which has <a href="http://www.javapractices.com/topi...
Try libraries like http://sourceforge.net/projects/dougnewsnntp/ and http://www.codeplex.com/nntpclientlib
You should make sure you format the date in the correct format - [RFC2822][1]. [1]: http://www.faqs.org/rfcs/rfc2822.html
C# ODBC Dialog
|c#|odbc|dialog|