instruction stringlengths 0 30k ⌀ |
|---|
Never used Mediawiki but that sort of problem in my experience is indicative of a php error that occurred but was suppressed either with the @ operator or because php error output to screen is turned off.
I hate to resort to this debugging method but when absolutely and utterly frustrated in php I will just start pu... |
In the Rails world, there's the concept of migrations, scripts in which changes to the database are made in Ruby rather than a database-specific flavour of SQL. Your Ruby migration code ends up being converted into the DDL specific to your current database; this makes switching database platforms very easy.
For eve... |
If you are using C#, have a look at Subsonic, a very useful ORM tool, but is also generates sql script to recreated your scheme and\or data. These scripts can then be put into source control.
[http://subsonicproject.com/][1]
[1]: http://subsonicproject.com/ |
If you are quite happy with MSBuild, then I would stick with MSBuild. This may be one of those cases where the tool you learn first is the one you will prefer. I started with NAnt and can't quite get used to MSBuild. I'm sure they will both be around for quite some time.
There are some fundamental differences bet... |
**By default, always just create new folder within the same project**
- You will get single assembly (without additional ILMerge gymnastic)
- Easier to obfuscate (because you will have less public types and methods, ideally none at all)
Separating your source code into multiple projects makes only sense if you..... |
By default, always just create new folder within the same project
- You will get single assembly (without additional ILMerge gymnastic)
- Easier to obfuscate (because you will have less public types and methods, ideally none at all)
Separating your source code into multiple projects makes only sense if you...
... |
Bytecode creates an extra level of indirection.
The advantages of this extra level of indirection are:
- Platform independence
- Can create any number of programming languages (syntax) and have them compile down to the same bytecode.
- Could easily create cross language converters
- x86, x64, and IA6... |
Configure static routes on Windows |
|windows|networking| |
There is a "netsh" and a "route" command on Windows. From their help text it looks like both can be used to configure static routes. When should you use one and not the other? Is IPv6 a distinguishing factor here? |
The performance of essentially any program will improve if it is compiled, executed with profiling, and the results fed back into the compiler for a second pass. The code paths which are actually used will be more aggressively optimized, loops unrolled to exactly the right degree, and the hot instruction paths arranged... |
Here: http://slashdot.org/developers/02/01/31/013247.shtml
Go see what the geeks of Slashdot have to say about it! Little dated, but very good comments! |
A magic number is a direct usage of a number in the code.
public class Foo {
public void setPassword(String password) {
// don't do this
if (password.length() > 7) {
throw new InvalidArgumentException("password");
} }
This should be r... |
Does anyone know if you can and how to start off a scheduled Windows task on a Remote Server from within a SQL Server Integration Services (SSIS) package?
Cheers
Nigel |
It should be possible as the Task Scheduler has a scriptable [COM API][1] that can be used for interactoing with tasks.
You could therefore either create a custom task that uses COM interop to call the Task Scheduler API, or it'd probably be quicker to use an Active X Script task to do your dirty work.
[1]: htt... |
It should be possible as the Task Scheduler has a scriptable [COM API][1] that can be used for interacting with tasks.
You could therefore either create a custom task that uses COM interop to call the Task Scheduler API, or it'd probably be quicker to use an Active X Script task to do your dirty work.
[1]: http... |
How to do crossdomain calls from Silverlight? |
|silverlight| |
What's needed to succesfully make a crossdomain call from Silverlight? |
|web-services|silverlight| |
Integrating InstantRails with Aptana or any other IDE |
|ruby|ruby-on-rails|ide|aptana|radrails| |
So I've been using InstantRails to check out Ruby on rails. I've been using Notepad++ for the editing. Now I don't want to install Ruby or Rails on my machine. Is there any walk through/tutorial on how to integrate Radrails or Netbeans with InstantRails? |
Don't make it a religion or faith discussion. Those are hard to win (and is not what you want anyway)
Don't frame it the way you just did in your question. The issue is not getting anyone to agree that this way or that way is the general way they should work. You should talk about how each one needs to think in orde... |
It may be complete overkill for what you're attempting, but have a look at [eAccelerator](http://eaccelerator.net/) or [memcache](http://www.danga.com/memcached/). If you have queries that will change regularly and queries that won't, you may not want all of your db queries cached for the same length of time by mysql.
... |
Save yourself problems and use stored procedures with prepared statements or parameterized queries. Stored procedures are good practice anyway, as they act like an interface to the database, so you can change what happens behind the scenes (inside the stored proc) but the signature remains the same. The prepared statem... |
The purpose of an interface is to define an abstract pattern that at type must implement.
It would be better implement as:
public interface ISomething
public class Something1 : ISomething
public class Something2 : ISomething
You do not gain anything in the form of code reusability or scalab... |
It may seem weird, but I got started writing code by automating the tasks and data analysis at my former job. This was accomplished by recording then studying the code an Excel macro generated. Of course this approach assumes you can learn via VB. |
I don't know why people downvote your post. I think that good naming guidelines are **very** important.
If you need to maintain compatibility with prev. version of the same interface consider using inheritance.
If you need to introduce new version of interface consider following rule:
> Try to add meaningful su... |
Check out: http://bobpowell.net/onebit.htm
You need this conversion as CCITT3 and CCITT4 don't support color (if I remember right). |
Are we talking about something like this:
JavaScript:
<body>
...
...
<script type="text/javascript">
<!--
document.write("Hello World!")
//-->
</script>
<noscript>Your browser does not support JavaScript!</noscript>
...
...
</body> |
I would create a Windows Service (a visual studio 2005 project type) that handles the OnSessionChange event as shown below:
protected override void OnSessionChange(SessionChangeDescription changeDescription)
{
if (changeDescription.Reason == SessionChangeReason.SessionLock)
... |
Linker order - GCC |
|c++|gcc|linker| |
Why does the order in which libraries are linked sometimes cause errors? |
You need to put
from project import Project
in `controllers/__init__.py`.
Note that when [Absolute imports][1] become the default (Python 2.7?), you will need to add a dot before the module name to import from within the current package, i.e.,
from .project import Project
[1]: http://docs.pyt... |
The worksheet formula, =CELL("color",D3) returns 1 if the cell is formatted with colour for negative values (else returns 0).
You can solve this with a bit of VBA. Insert this into a VBA code module:
Function CellColor(xlRange As Excel.Range)
CellColor = xlRange.Cells(1, 1).Interior.ColorIndex
E... |
How do I size a UITextView to it's content? |
|iphone|cocoa| |
Is there a good way to adjust the size of a UITextView to conform to it's content? Say for instance I have a UITextView that contains one line of text:
"Hello world"
I then add another line of text:
"Goodbye world"
Is there a good way in Cocoa Touch to get the rect that will hold all of the lines in the tex... |
Can I prevent user pasting Javascript into Design Mode IFrame? |
|javascript|iframe| |
I'm building a webapp that contains an IFrame in design mode so my user's can "tart" their content up and paste in content to be displayed on their page. Like the WYSIWYG editor on most blog engines or forums.
I'm trying to think of all potential security holes I need to plug, one of which is a user pasting in Java... |
I like [ProFont TT >tweaked<][1] It's clean and there is a clear difference between 1, l and I and 0 and O.It works best at 9pt. It doesn't scale up very well.
![ProFont Windows 9pt][2]
[1]: http://www.tobias-jung.de/seekingprofont/
[2]: http://farm3.static.flickr.com/2195/2840832152_af1d5cff6a.jpg?v=0 |
Mediawiki custom tag Stops page parsing. |
|php|mediawiki| |
I created a few mediawiki custom tags, using the guide found here
http://www.mediawiki.org/wiki/Manual:Tag_extensions
I will post my code below, but the problem is after it hits the first custom tag in the page, it calls it, and prints the response, but does not get anything that comes after it in the wikitext. I... |
By default, **always just create new folder** within the same project
- You will get single assembly (without additional ILMerge gymnastic)
- Easier to obfuscate (because you will have less public types and methods, ideally none at all)
Separating your source code into multiple projects makes only sense if you..... |
@John Downey:
["Let's Build a Compiler"](http://compilers.iecc.com/crenshaw/) is awesome, but it's a bit outdated. (I'm not saying it makes it even a little bit less valid) |
How do I calculate these statistics? |
|statistics| |
I'm writing an app to help facilitate some research, and part of this involves doing some statistical calculations. Right now, the researchers are using a program called SPSS. Part of the output that they care about looks like this:

T... |
I'm writing an app to help facilitate some research, and part of this involves doing some statistical calculations. Right now, the researchers are using a program called [SPSS](http://en.wikipedia.org/wiki/Spss). Part of the output that they care about looks like this:
 {
// don't do this
if (password.length() > 7) {
throw new InvalidArgumentException("password");
} }
This should be r... |
it looks like it's answered in this post:
[http://forums.mysql.com/read.php?52,198596,198717#msg-198717][1]
With mysqli PHP API:
Assume sproc myproc( IN i int, OUT j int ):
$mysqli = new mysqli( "HOST", "USR", "PWD", "DBNAME" );
$ivalue=1;
$res = $mysqli->multi_query( "CALL myproc($ival... |
Returning from a finally block in Java |
|java| |
I was surprised recently to find that it's possible to have a return statement in a finally block in Java.
It seems like lots of people think it's a bad thing to do as described in '[Don't return in a finally clause][1]'. Scratching a little deaper, I also found '[Java's return doesn't always][2]' which shows some p... |
|java|exception| |
Furthermore if you need to look at the .NET/unmanaged stack just donwload [Process Explorer][1] and look at your w3wp.exe processes to examine memory and other stats without having to do a remote/local debugging (just look at the .NET Tab on the properties of the process). It will show all the .NET performance counters... |
`route` is a very old and basic tool for displaying and modifying the entries in the local IP routing table while `netsh` is the newer, more robust command-line **scripting utility** that allows you to, either locally or **remotely**, manipulate the network configuration.
`netsh` has a zillion more features than rou... |
Often you use constraints in a database to ensure data to be "unique" in the data-based sense.
Regarding "isomorphisms" I think you are on your own, ie writing the code your self. If in the database you could use a trigger. |
I believe it's not possible to keep xml comments in sync with autogenerated code automatically. However, xml comments can leave in separate file (just set "XML documentation file" option on "Project properties"->"Build" tab). You can create initial version of XML documentation file and update in manually if necessary |
Queue alternatives to MSMQ on Windows? |
|.net|soa|messaging|msmq| |
If you want to use a queuing product for durable messaging under Windows, running .NET 2.0 and above, which alternatives to MSMQ exist today? I know of ActiveMQ (http://activemq.apache.org/), and I've seen references to WSMQ (pointing to http://wsmq.net), but the site seems to be down.
Are there any other alternativ... |
Take a look at this - that might explain it:
[http://weblogs.asp.net/owscott/archive/2006/02/21/ASP.NET-v2.0-_2D00_-AppDomain-recycles_2C00_-more-common-than-before.aspx#440333][1]
[1]: http://weblogs.asp.net/owscott/archive/2006/02/21/ASP.NET-v2.0-_2D00_-AppDomain-recycles_2C00_-more-common-than-before.aspx... |
What abour SQL 2005's [service broker][1]?
[1]: http://msdn.microsoft.com/en-us/library/ms345108.aspx |
The earlier you can stop people, the easier it'll be in the long run!
Not being too familiar with your db schema or data entry form, I'd suggest a route something like the following:
* have distinct fields in your db for each address "part", e.g. street, city, postal code, Länder, etc.
* have your data entry ... |
|php|mediawiki| |
I created a few mediawiki custom tags, using the guide found here
http://www.mediawiki.org/wiki/Manual:Tag_extensions
I will post my code below, but the problem is after it hits the first custom tag in the page, it calls it, and prints the response, but does not get anything that comes after it in the wikitext. I... |
As the previous poster mentioned, the transplant extension can be used for cherry-picking individual changes from one branch to another. If, however, you always want to pull *all* the latest changes, the `hg merge` command will get you there.
The simplest case is when you're using clones to implement branching (sin... |
multithreading in asp.net |
|asp.net|multithreading| |
What kind of multi-threading issues do you have to be careful for in asp.net? |
Multithreading in asp.net |
> ...I'm worried about the possibility of someone being able to paste some script in and run it there and then, without even sending it back to the server for processing.
>
> Am I worrying over nothing?
Firefox has a plug-in called Greasemonkey that allows users to arbitrarily run JavaScript against any pa... |
How about this? You could expand this pattern to do "years" messages, and you could put in a check for "1 day" or "1 hour" so it wouldn't say "1 days ago"...
I like the CASE statement in SQL.
drop function dbo.time_diff_message
GO
create function dbo.time_diff_message (
@input_date datetime
)
returns va... |
To what extent should a developer learn database? |
|database| |
Modern Databases systems today come with loads of feature. And you would agree with me that to learn one database you must unlearn the concepts you learned in another database. For e.g. each database would implement locking differently than other. So to carry the concepts of one database to another would be a recipe fo... |
I've just been recently turned on to MVC and Linq to Sql for Asp.Net. I'm still learning both, and I'm really enjoying them both. There are quite a few screen casts on <http://www.asp.net/learn/>. |
I think a developer should have a fairly good grasp of how their database system works, not matter which one it is. When making design and architecture decisions, they need to understand the possible implications when it comes to the database. |
I can share a SQL Server Reporting Services Data SOURCE... what about a Data SET? |
|sql-server-reporting-ser| |
I am developing a Reporting Services solution for a DOD website. Frequently I'll have a report and want to have as a parameter the Service (in addition to other similar mundane, but repetitive parameters like Fiscal Year, Data Effective Date, etc). Basically everything I've seen of SSRS 2005 says it can't be done... ... |
|sql-server-reporting-ser| |
I am developing a Reporting Services solution for a DOD website. Frequently I'll have a report and want to have as a parameter the Service (in addition to other similar mundane, but repetitive parameters like Fiscal Year, Data Effective Date, etc). Basically everything I've seen of SSRS 2005 says it can't be done... ... |
A quick answer: Use the Repository pattern (see Domain Driven Design by Evans) to fetch your entities. Each repository will cache the things it will hold, ideally by letting each instance of the repository access a singleton cache (each thread/request will instantiate a new repository but there can be only one cache).
... |
You could use the [Google GeoCode API][1]
Wich in fact gives results for both of your examples, just tried it. That way you get structured results that you can save in your database. If the lookup fails, ask the user to write the address in another way.
[1]: http://code.google.com/apis/maps/documentation/serv... |
> `return fabs(a - b) < EPSILON;
This is fine if:
- the order of magnitude of your inputs don't change much
- very small numbers of opposite signs can be treated as equal
But otherwise it'll lead you into trouble. Double precision numbers have a resolution of about 16 decimal places. If the two numbers ... |
Problems passing special chars with observe_field |
|ruby-on-rails|ajax| |
I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type certain special chars.
1. ? => causes the variable not to be found... |
I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type certain special chars.
1. ? => causes the variable not to be found... |
The .XFDL file extension identifies XFDL Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.
I know how to view XFDL files using a file viewer I fou... |
The .XFDL file extension identifies XFDL Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.
I know how to view XFDL files using a file viewer I fou... |