instruction
stringlengths
0
30k
Can I revoke some database privileges from MediaWiki after installation?
|mysql|mediawiki|
I've just installed MediaWiki on a web server. Obviously it needs lots of privileges during installation to set up its database correctly. Now that it's installed can I safely revoke some privileges (e.g. create table, drop table?) Or might it need to create more tables later (when they are first needed?) If not th...
How to highlight source code in HTML?
|html|syntax-highlighting|sourcecode|
I want to highlight C/C++/Java/C# etc source codes in my website. How can I do this? Is there a library I can use? Is it a CPU intensive job to highlight the source code?
|html|source-code|syntax-highlighting|
rjk's suggestion is the right way to go. Bear in mind, though, that this query (with or without a union) can't use indexes, so it's not going to scale well. You might want to check out MySQL's fulltext indexing, which will scale better, allow more sophisticated queries, and even help with result ranking.
How do I Extend Blogengine.Net to collect statistics of visitors?
|blogengine.net|visitor-statistic|
I love BlogEngine. But from what I can se it does not collect the standard information about the visitors I would like to see (referrer, browser-type and so on). When I log in as Admin I have a menu item named "Referrer". I can choose a weekday and then I'll be presented with 1 or 2 rows with "google.com 4 hits...
I've been using WAMP for a while now, and from what I've gathered its pretty reliable. The installation is a breeze, and user interface is pretty friendly.
Since none of the code you've written modifies the static field after initialization, there is no need for any locking. Just replacing the string with a new value won't need synchronization either, unless the new value depends on the results of a read of the old value. Static fields aren't the only things that need...
Since none of the code you've written modifies the static field after initialization, there is no need for any locking. Just replacing the string with a new value won't need synchronization either, unless the new value depends on the results of a read of the old value. Static fields aren't the only things that need...
The Java designers decided that operator overloading was more trouble than it was worth. Simple as that. In a language where every object variable is actually a reference, operator overloading gets the additional hazard of being quite illogical - to a C++ programmer at least. Compare the situation with C#'s == opera...
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Console_Test { class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.DarkRed; ...
Perl 6 is evolving slowly but steadily. Larry Wall wrote a Parser that can parse all Perl 6 that we know of (which is basically the test suite plus a bit of other code). Rakudo, which is Perl 6 on Parrot, also performs nicely. You can track its progress in the test suite with the charts on [rakudo.de][1] Note that i...
You want <a href="http://en.wikipedia.org/wiki/ANSI_escape_code">ANSI escape codes</a>.
We are using Multilizer (http://www.multilizer.com/) and although sometimes it's a bit tricky to use, at the end with a bit of patient it works pretty well. We even have a translation web site where translators can download our projects and then upload the translations using Multilizer command-line features.
1. Compatibility mode does not affect storage. It's just a flag. Nothing will change in the data or queries. Only query execution will get affected. 2. Nothing - or lots of things. Did you use syntax marked as obsolete and subject to deletion in 2000? Did you use parethesis when providing hints in queries? Did you use...
If your searching go with a db. You could split the xml files up into directories to ease seeking, but the managerial overhead easily gets quite heavy. You also get a lot more than just performance with a sql db...
Way to read Windows EventLog with Java
|java|java-native-interface|event-log|
this should be simple...could someone provide me a simple code sample that has an aspx page hosting both a silverlight app (consisting of, say a button) and an iframe (pointing to, say stackoverflow.com). The silverlight app and iframe could be in separate div's, the same div, whatever. Everything I've tried so far...
SQL Compact Edition 3.5 SP 1 - LockTimeOutException - how to debug?
|vb.net|multithreading|sql-server-ce|
Intermittently in our app, we encounter LockTimeoutExceptions being throw from SQL CE. We've recently upgraded to 3.5 SP 1, and a number of them seem to have gone away, but we still do see them occasionally. I'm certain it's a bug in our code (which is multi-threaded) but I haven't been able to pin it down precisely. D...
Intermittently in our app, we encounter LockTimeoutExceptions being throw from SQL CE. We've recently upgraded to 3.5 SP 1, and a number of them seem to have gone away, but we still do see them occasionally. I'm certain it's a bug in our code (which is multi-threaded) but I haven't been able to pin it down precisely. D...
Since none of the code you've written modifies the static field after initialization, there is no need for any locking. Just replacing the string with a new value won't need synchronization either, unless the new value depends on the results of a read of the old value. Static fields aren't the only things that need...
As others have pointed out, your question is very general, and whether or not something is 'faster' than TCP depends a lot on the type of application. TCP is generally as fast as it gets for reliable streaming of data from one host to another. However, if your application does a lot of small bursts of traffic and wa...
Importing/exporting history in Team System
|visual-studio-team-system|svn|import-export|version-control|repost|
From the [netfilter FAQ][1]: > The answer unfortunately is: No. > Now you might think 'but what about libiptc?'. As has been pointed out numerous times on the mailinglist(s), libiptc was _NEVER_ meant to be used as a public interface. We don't guarantee a stable interface, and it is planned to remove it in the ne...
Speed up images in Tomcat 6
|optimization|tomcat|ajp|
In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up quik, with the exception of images, they really lag significantly. Any suggestions optimization for image serving? Here is my server.xml: <Service name="Catalina"> <Connector port="8009" protocol="AJP...
Try this: def test_that_foo_helper_defines_bar o = Object.new assert !o.respond_to? :bar o.extend FooHelper assert o.respond_to? :bar end
I believe flash objects have functions accessible through javascript, so if there's no easier way, you could at least use a javascript onload handler and pass document.cookie into your flash app from the outside. More info here: [http://www.permadi.com/tutorial/flashjscommand/][1] [1]: http://www.permadi.com...
Turn on SQL query logging and watch what the application asks for.
Test a Helper in Rails
|ruby-on-rails|helper|unit-testing|
I am creating a Rails plugin and it is dynamically adding a method to a Helper. I just want to ensure that the method is added. How can I see if the Helper responds to the method name?
|ruby|ruby-on-rails|helper|unit-testing|
How do I test that a Rails Helper defines a method?
|ruby|ruby-on-rails|unit-testing|helper|
Take a course at [Big Nerd Ranch][1] [1]: http://www.bignerdranch.com/classes/iphone.shtml
There are a whole host of problems with *printf portability, and realistically you probably want to follow one of three paths: 1. Require a c99 compliant *printf, because 9 years should be enough for anyone, and just say the platform is broken otherwise. 2. Have a my_snprintf() with a bunch of #ifdef's for the ...
Why Am I Getting Link Errors When Calling Function in Math.h?
|math|gcc|linker|
When attempting to call functions in `math.h`, I'm getting link errors like the following undefined reference to sqrt But I'm doing a `#include <math.h>` I'm using gcc and compiling as follows: gcc -Wall -D_GNU_SOURCE blah.c -o blah Why can't the linker find the definition for `sqrt`?
When do transactions become more of a burden than a benefit?
|sql|performance|design-patterns|transactions|
Transactional programming is, in this day and age, a staple in modern development. Concurrency and fault-tolerance are critical to an applications longevity and, rightly so, transactional logic has become easy to implement. As applications grow though, it seems that transactional code tends to become more and more burd...
Transactional programming is, in this day and age, a staple in modern development. Concurrency and fault-tolerance are critical to an applications longevity and, rightly so, transactional logic has become easy to implement. As applications grow though, it seems that transactional code tends to become more and more burd...
Are there any import and export tools that would let us move projects into and out of team system **with full history and log**? Our current SCM is SVN. PS - Sorry, I know it's a repost, but I didn't get an answer before... :)
|svn|version-control|import|export|visual-studio-team-system|
It could if you place them on seperate drives - not logical but physical drives so IO is not slowing you down so much.
_(I've set the community-owned flag on this one, because this is mostly all from my gut instinct, and I've probably missed a crucial step in there somewhere)_ **Short answer:** It's generally a good idea to deploy your dependencies along-side your application, using an installer. Without them, as you've noticed, th...
In a general sort of way, if your "contained class" is truly contained in your "MyClass", then MyClass should not be allowing outsiders to touch its private contents. So, MyClass should be providing methods to manipulate the contained class objects, not returning pointers to them. So, for example, a method such as ...
The file groups being on different physical drives is what will give you the biggest performance boost, can also split up where the indexes are housed so that table writes and index accesses are hitting different disks. There's a lot you can do with partitioning, but that general concept is where the biggest speed imp...
How do I pop up an image in a seperate div on the mouseover of a div using only CSS?
|css|xhtml|pop-ups|
I have a small gallery of thumbnails. When I place my mousepointer over a thumbnail image I'd like to have a full size image pop up in a div in the top right of the screen. I've seen this done using just CSS and I'd like to go down that route rather than use javascript if possible.
One thing to consider is that the cost of a try block where no exception is thrown is a different question from the cost of actually throwing and catching an exception. If exceptions are only thrown in failure cases, you almost certainly don't care about performance, since you won't fail very many times per executio...
|multithreading|sql-server-ce|
Database integration tests
|tdd|integration-testing|
When you are doing integration tests with either just your data access layer or the majority of the application stack. What is the best way prevent multiple tests from clashing with each other if they are run on the same database?
|tdd|integration-testing|database-testing|
Mysql: Using "AND" Operation on tags and categories tables in Wordpress
|mysql|wordpress|query|
This is a very specific question regarding **mysql** as implemented in **WordPress**. I'm trying to develop a plugin which will show (select) posts that have specific '**tags**' and belong to specific '**categories**' (both multiple) I was told it's impossible because the way categories and tags are stored: 1....
|mysql|plugins|query|wordpress|
The file you create with `TemporaryFile` or `NamedTemporaryFile` is automatically removed when it's closed, which is why you get an error. If you don't want this, you can use `mkstemp` instead (see the docs for [tempfile][1]). [1]: http://docs.python.org/lib/module-tempfile.html
The file you create with `TemporaryFile` or `NamedTemporaryFile` is automatically removed when it's closed, which is why you get an error. If you don't want this, you can use `mkstemp` instead (see the docs for [tempfile][1]). >>> import tempfile, shutil, os >>> fd, path = tempfile.mkstemp() >>> os.wri...
Well, you don't specify on which platform this occurs. The memory management may vary if you're using Windows XP, Vista, Linux, OS X, ... Usually, on my computer (WinXP with 1Gb of Ram), Eclipse take rarely more than 200Mb, depengin of the size of the opened projects, the loaded plugins and the ongoing action.
I would suggest [JSON][1]. - Just as readable/editable as YAML - If you happen to use for Web then can be eval()'ed into JavaScript objects - Probably as cross language as YAML - I don't think it has the annoying 'can not put a comma after last element in a list' issue which I always get caught by in YAML...
Does anyone have any pointers on how to read the Windows EventLog without using JNI? Or if you *have to* use JNI, are there any good open-source libraries for doing so?
Be extremely careful using any of the suggestions above. It all depends on context. I have spent a long time tracing a bugs in a system that presumed _a=b_ if _|a-b|&lt;epsion_. The underlying problems were: 1. The implicit presumption in an algorithm that if _a=b_ and _b=c_ then _a=c_. 1. Using the same eps...
Be extremely careful using any of the suggestions above. It all depends on context. I have spent a long time tracing a bugs in a system that presumed _a=b_ if _|a-b|&lt;epsion_. The underlying problems were: 1. The implicit presumption in an algorithm that if _a=b_ and _b=c_ then _a=c_. 1. Using the same eps...
The boss has to trust the dev to make correct technical decisions (including when to refactor). Establish that trust or replace the boss or replace the dev.
C++ runtime knowledge of classes
|c++|class|runtime|
I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded. Is there a way to determine what class...
Why do you have multiple threads destroying objects they did not create? It's a simple way to handle object lifetime, but the costs can vary widely depending on use. Anyways, if you haven't started implementing this yet, at the very least you can put the create/destroy functionality behind an interface so that you c...
GetWindowText is a win32 api call that is aliased via a macro to GetWindowTextW in your C++ project. Try adding #undef GetWindowText to you C++ project.
In addition to the WURFL / WALL capabilities system that todd mentioned, there are Java Server Faces libraries available that use alternate WML renderkits for mobile phones.
I'm a huge fan of [SubSonic][1]. A well-written batch/CMD file can generate an entire object model for your database in minutes; you can compile it into its own DLL and use it as needed. Wonderful model, wonderful tool. The site makes it sound like an ASP.NET deal, but generally speaking it works wonderfully just about...
I have never found any reasons to use anything else than UTF-8 to be honest.
> This seems like a strange hole in an IDE, am I missing some builtin facility for this? This is a common problem, there are around 4 bugs opened in Eclipse tracker for this. Unfortunately you would probably see macros in Eclipse in v4.0 or later.
In bash, environmental variables not tab-expanding correctly
|bash|unix|keyboard-shortcuts|
In bash, environmental variables will tab-expand correctly when placed after an echo command, for example: echo $HOME But after cd or cat, bash places a \ before the $ sign, like so: cd \$HOME If I use a variable as the second argument to a command, it won't expand at all: cp somefile $HOM ...
|bash|unix|keyboard-shortcuts|offtopic|
|unix|bash|keyboard-shortcuts|
Displaying Window on Logon Screen Using C# in Windows XP
|c#|windows-xp|desktop|service|winlogon|
One thing to consider is that the cost of a try block where no exception is thrown is a different question from the cost of actually throwing and catching an exception. If exceptions are only thrown in failure cases, you almost certainly don't care about performance, since you won't fail very many times per executio...
Please refer to this http://technet.microsoft.com/en-us/library/bb490982.aspx which explains what you can do with command output.
And for IBM DB2 (will double check this on Monday to be sure...) SELECT TABNAME,COLNAME from SYSCAT.COLUMNS where TABNAME='MYTABLE'