instruction stringlengths 0 30k ⌀ |
|---|
There are several places you can indicate to the .Net Framework that a specific version of a strongly typed library should be preferred over another. These are:
- Publisher Policy file
- machine.config file
- app.config file
All these methods utilise the <a href="http://msdn.microsoft.com/en-us/library/e... |
You can use inspect.stack()
import inspect
inspect.stack()[0] => (<frame object at 0x00AC2AC0>, 'g:\\Python\\Test\\_GetCurrentProgram.py', 15, '<module>', ['print inspect.stack()[0]\n'], 0)
os.path.abspath (inspect.stack()[0][1]) => 'g:\\Python\\Test\\_GetCurrentProgram.py'
|
Even if the stored procedure is 10% faster (it probably isn't), you may want to ask yourself how much it really matters. What really matters in the end, is how easy it is to write and maintain code for your system. If you are coding a web app, and your pages all return in 0.25 seconds, then the extra time saved by usi... |
The [XML specification][1] agrees with Wikipedia:
> 2.5 Comments
>
> [Definition: Comments may appear anywhere in a document outside other markup; in addition, they may appear within the document type declaration at places allowed by the grammar. They are not part of the document's character data; an XML processo... |
According to the [XML specification][1], a well-formed XML document is:
> `document ::= prolog element Misc*`
where `prolog` is
> `prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?`
and
> `XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'`
which means that, if you want... |
According to the [XML specification][1], a well-formed XML document is:
> `document ::= prolog element Misc*`
where `prolog` is
> `prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?`
and
> `XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'`
which means that, if you want... |
|io|java| |
We have developed several applications using visual studio 2005 with the devart ado.net data provider for PostgreSql ([http://www.devart.com/pgsqlnet/][1]).
One of the advantages of this provider is that it provides full Visual Studio support. The latest versions include all the new framework features like linq.
... |
You might be able to use [Pmon.exe][1] for this. You can get it as part of the [Windows Resource Kit tools][2] (the link is to the Server 2003 version, which can apparently be used in XP as well).
[1]: http://commandwindows.com/server2003tools.htm
[2]: http://www.microsoft.com/downloads/details.aspx?familyid=... |
Metamodelling tools.. |
|model-driven|tool|diagram-editor| |
What tools are available for metamodelling?
Especially for developing diagram editors, at the moment trying out [Eclipse GMF][1]
Wondering what other options are out there?
Any comparison available?
[1]: http://www.eclipse.org/modeling/gmf/ |
|tools|model-driven|diagram-editor| |
Vista BEX error |
|winapi|windows-vista| |
Recently I got IE7 crashed on Vista on jar loading (presumably) with the following error:
Problem signature:
Problem Event Name: BEX
Application Name: iexplore.exe
Application Version: 7.0.6001.18000
Application Timestamp: 47918f11
Fault Module Name: ... |
|winapi|windows-vista| |
@slipsec: I don't have access to a 2003 server to try, but googling "2003 server" SCHTASKS there are links related to questions about it. Perhaps you misspell the command?
Like Matt says, you also can use AT, but in this case you don't have access to the scheduled tasks via the Control Panel, only via the AT command. |
It needs to be much simpler: involve less knowledge of the concepts, and require fewer steps - preferably zero. When the technology works with little or no assistance, it'll take off.
The mechanics of OpenID credentials, providers and suppliers shouldn't need to be exposed to the user. People talk about educating th... |
I suppose an alternative would be somewhere defining this sort of thing ...
public class Reference {
public var value:*;
}
Then use functions that take some number of Reference arguments to act as "pointers" if you're really just looking for "out" parameters and either initialize them on the way... |
Haskell implements type-constructor parameterisation (generics) quite well. So does Scala (although it needs a bit of hand-holding sometimes).
Both of these languages have higher-kinded types (a.k.a. abstract type constructors or type-constructor polymorphism).
See here: [Generics of a Higher Kind][1]
[1]:... |
You could also use a wrapper instead of int:
public class Integer
{
public var value:int;
public function Integer(value:int)
{
this.value = value;
}
}
Of course, this would be more useful if you could use operator overloading... |
Heck, English doesn't even implement generics well. :)
My bisas is for C#. Mainly because that is what I am currently using and I have used them to good effect. |
If I understand your proposal right, http://bitzi.com/ has done this for a while. |
I use .Net (VB.Net), and haven't had any problems using generics. It's mostly painless.
Dim Cars as List(Of Car)
Dim Car as Car
For Each Car in Cars
...
Next
Never had any problems using the generic collections, although I haven't gone so far as to design any objects that use generi... |
It appears that the <machinekey /> is only for ViewState encryption. It doesn't affect the file names for auto compiled assemblies. |
How do I find the high water mark (for sessions) on Oracle 9i |
|oracle-database| |
How can I find the high water mark (the historical maximum number of concurrent users) in an oracle database (9i). |
Short answer: when it's only going to happen once in a long time.
[Long Answer][2].
[1]: http://blogs.msdn.com/ricom/archive/2008/01/11/performance-quiz-13-linq-to-sql-compiled-queries-cost.aspx
[2]: http://blogs.msdn.com/ricom/archive/2008/01/14/performance-quiz-13-linq-to-sql-compiled-query-cost-solution... |
Pylons error - 'MySQL server has gone away' |
|python|mysql|pylons| |
[I hope this isn't too obscure… I'll ask the newsgroup if nobody knows here]
I'm using Pylons (a python framework) to serve a simple web application, but it seems to die from time to time, with this in the error log: (2006, 'MySQL server has gone away')
I did a bit of checking, and saw that this was becaus... |
1. Find out what minimum requrements you want to put on a plugin writer. Then make one or more Interfaces that the writer must implement for your code to know when and where to execute the code.
2. Make an API the writer can use to access some of the functionality in your code.
You could also make a base clas... |
in our continuous integration setup we use SVNRevisionLabeller and pass the variables from this to MSBuild to use when creating the compiled website dll. It's then available to .NET using GetCurrentAssembly() in the final build. |
The standard is to throw the NullPointerException. The generally infallible "Effective Java" discusses this briefly in Item 42 (in the first edition) "Favor the use of standard exceptions":
> "Arguably, all erroneous method
> invocations boil down to an illegal
> argument or illegal state, but other
> exceptions ... |
|scripting|xcode|arguments| |
How can I convince GroovyShell to maintain state over eval() calls? |
|groovy|script|shell|java| |
I'm trying to use Groovy to create an interactive scripting / macro mode for my application. The application is OSGi and much of the information the scripts may need is not know up front. I figured I could use GroovyShell and call eval() multiple times continually appending to the namespace as OSGi bundles are loaded. ... |
|java|script|groovy|groovyshell| |
|java|scripting|groovy|groovyshell| |
Application Control Scripts on Unix |
|linux|unix|script|solaris| |
I'm looking for some software that allows me to control a server based application, that is, there are bunch of interdependent processes that I'd like to be able to start up, shut down and monitor in a controller manner.
I've come across programs like Autosys, but that's expensive and very much over the top for what... |
|linux|unix|scripting|solaris| |
Should the folders in a solution match the namespace? |
|c#|.net|namespace| |
Should the folders in a solution match the namespace?
In one of my teams projects, we have a class library that has many sub-folders in the project.
Project Name and Namespace: MyCompany.Project.Section
Within this project, there are several folders that match the namespace section:
- Folder Vehicles has clas... |
|c#|.net|namespaces| |
How to make subdomain user accounts in a webapp |
|web-applications|dns|user|account|subdomain| |
My preferred method is to get a word list of 3,4 and 5 letter words. Then select at least 2 of those, and place a random 2 digit number or special symbol (%&*@#$) between each word. If you want to you can capitalize up to one character per word at random.
Depending on your strength requirements you end up with eas... |
Password generation, best practice |
|passwords|security|userexperience| |
I need to generate some passwords, I want to avoid characters that can be confused for each other. Is there a definitive list of characters I should avoid? my current list is
il10o8B3Evu![]{}
Are there any other pairs of characters that are easy to confuse? for special characters I was going to limit myself to th... |
|security|passwords|user-experience| |
Static variables are allocated inside a code segment -- they are part of the executable image, and so are mapped in already initialized.
Static variables within function scope are treated the same, the scoping is purely a language level construct.
For this reason you are guaranteed that a static variable will be ... |
Static variables are allocated inside a code segment -- they are part of the executable image, and so are mapped in already initialized.
Static variables within function scope are treated the same, the scoping is purely a language level construct.
For this reason you are guaranteed that a static variable will be ... |
Sites that use OpenID need to put it front and center on the login page. I have seen many sites [hide it][1] behind a link under the standard login/registration page like this:
> ##Username:
> ##Password:
> <span style="font-size:8px;">or use your OpenID</span>
[1]: http://disqus.com/login/ |
In most cases simple approach like @harpo suggested will work. You can develop more sophisticated code using this approach:
- Find all opened handles for selected file using SystemHandleInformation\SystemProcessInformation
- Subclass WaitHandle class to gain access to it's internal handle
- Pass found hand... |
Can XML comments go anywhere? |
|xml|comments| |
I wrote a simple tool to generate a DBUnit XML dataset using queries that the user enters. I want to include each query entered in the XML as a comment, but the DBUnit API to generate the XML file doesn't support inserting the comment where I would like it (above the data it generates), so I am resorting to putting th... |
I wrote a simple tool to generate a DBUnit XML dataset using queries that the user enters. I want to include each query entered in the XML as a comment, but the DBUnit API to generate the XML file doesn't support inserting the comment where I would like it (above the data it generates), so I am resorting to putting th... |
In case someone has the same problem. It works with the next code:
string lookupString = "string in list";
Regex lookup = new Regex(string.Format(".*{0}.*", lookupString));
Element list = Browser.Element("li", Find.ByText(lookup));
list.MouseDown();
|
Neat trick with boolean OR operator:
public function createShipment($startZip, $endZip, $weight = 0){
$weight or $weight = $this->getDefaultWeight();
...
}
|
Generating random terrain in Blender3D |
|blender3d| |
I tried finding a python script in google that will generate a random terrain when the game starts (or each time a the player advances to a new scene) but all the tools I found are for creating a terrain to render it, not for the game mode.
Any idea how/where to find one?
(I'm assuming that since Blender3D has ga... |
For reference, this problem is usually called "substring-after-last" in XSLT 1.0. |
For reference, this problem is usually called "substring-after-last" in XSLT. |
At work we use subversion with TortoiseSVN - works very nicely but it is philosophically different to VSS (not really a problem if there's just you but worth being aware of). I really like the fact that the whole repository has a revision number.
Given a free choice I'd've probably gone with vault but at the time I ... |
Use `xdg-utils` from <a href="http://portland.freedesktop.org/wiki/">freedesktop.org Portland</a>.
Register the icon for the MIME type:
xdg-icon-resource install --context mimetypes --size 48 myicon-file-type.png x-application-mytype
Create a configuration file (<a href="http://standards.freedesktop.org/sh... |
If you're just trying to get a value from the app.config file, you might want to use:
ConfigurationSettings.AppSettings["name"];
That works for me, anyways.
/Jonas |
Java Logging vs Log4J |
|java|logging| |
I always run into the same problem when creating web pages. When I add a font that is larger then about 16-18px it looks terrible. Its jagged, and pixelated. I have tried using different fonts and weights, however I haven't had much luck there.
Note: Its only in windows that it is like this. Mainly in Opera and FF ... |
|font|typography| |
|fonts|typography| |
Learning Lisp - Why ? |
|lisp| |
I really feel that I should learn Lisp and there are plenty of good resources out there to help me do it.
I'm not put off by the complicated syntax, but where in "traditional commercial programming" would I find places it would make sense to use it instead of a procedural language.
Is there a commercial killer-ap... |
|lisp| |
|lisp|functional| |
|functional-programming|lisp| |
You can use mail:
$mail -s <subject> <recipient>
You then type your message and end it with a line that has only a period. This signals you are done and sends the message. |
You can use mail:
$mail -s <subject> <recipients>
You then type your message and end it with a line that has only a period. This signals you are done and sends the message.
You can also pipe your email in from STDIN and it will be sent as the text of an email:
$<mail-generating-program> | mail -s <s... |
Is there a functional language for C++ ecosystem? |
|c++|functional| |
Java has [Scala][1] and .NET has [F#][2]. Both of these languages are very highly integrated into the respective Java and .NET platforms. Classes can be written in Scala then extended in Java for example.
Does there exist an equivalent functional language that interoperates highly with C++?
[1]: http://www.sc... |
|c++|functional-programming| |
cannot install ruby gems - zlib error |
|ruby|gems|rubygems| |
I'm trying to install some Ruby Gems so I can use Ruby to notify me when I get twitter messages. However, after doing a "gem update --system", I now get a zlib error every time I try and do a gem install of anything. below is the console output I get when trying to install ruby gems. (along with the output from "gem en... |
For this particular application directly observing the file will inevitably lead to a hard to trace bug, especially when the file size increases. Here are two different strategies that will work.
- Ftp two files but only watch one. For example send the files important.txt and important.finish. Only watch for the... |
Lack of operator overloading in ActionScript 3.0 |
|flash|actionscript-3| |
One of the things I miss the most in ActionScript is the lack of operator overloading, in particular ==. I kind of work around this issue by adding a "Compare" method to my classes, but that doesn't help in many cases, like when you want to use things like the built in Dictionary.
Is there a good way to work around ... |
I have used Eclipse as a framework base but it was mostly just using SWT-- we didn't really use much of the RCP.
It really depends on what you're writing, but from what I have learned from using Eclipse it is really only suited for writing an app that involves you editing data using various views (just like editing ... |