instruction stringlengths 0 30k ⌀ |
|---|
Java import/export dependencies |
|java| |
I'm trying to find a way to list the (static) dependency requirements of a jar file, in terms of which symbols are required at run time.
I can see that the methods exported by classes can be listed using "javap", but there doesn't seem to be an opposite facility to list the 'imports'. Is it possible to do this?
T... |
I'm trying to find a way to list the (static) dependency requirements of a jar file, in terms of which symbols are required at run time.
I can see that the methods exported by classes can be listed using "javap", but there doesn't seem to be an opposite facility to list the 'imports'. Is it possible to do this?
T... |
My selection criteria (mainly programming centric):
- Maintenance: How are updates/hotfixes installed?
- Transaction control: How it is implemented
- Are Stored Procedures supported?
- Can you use exception handling in Stored Procedures?
- Costs
- As a benefit: Can you use recursion on Stored Proced... |
Simply move your code into an Excel Addin (XLA) - this gets loaded at startup (assuming it's in the %AppData%\Microsoft\Excel\XLSTART folder) but if it's a addin, not a workbook, then only your macros and defined startup functions will be loaded.
If the functions depend on a spreadsheet itself, then you might want t... |
Symfony has a plugin called sfMigrationsLight that handles basic migrations. CakePHP also has migrations.
For whatever reason, migration support has never really been a high priority for most of the PHP frameworks and ORMs out there. |
Stackoverflow uses jquery I think, and I hear that jquery is all the rage |
I really don't think that file-based databases can scale past half a dozen users. The last time I had an Access database (admittedly this was quite a while ago) I had to work really hard to get it to work for 8-9 people.
It is really much easier to install Ubuntu on an old junk computer with PostgreSQL or MySQL. Tha... |
I usually go for this, a public getter that returns System.Collections.ObjectModel.ReadOnlyCollection<T>:
public ReadOnlyCollection<SomeClass> Collection
{
get
{
return new ReadOnlyCollection<SomeClass>(myList);
}
}
And public methods on the object to modify ... |
We are starting to use jQuery where I work. I'm not big on JavaScript, but everyone else likes it a lot. I don't know if that helps at all... |
[Ayende][1] was recently trying to make a similar decision, and tried a bunch of so-called embedded databases. Hopefully his [observations][2] can help you.
[1]: http://www.ayende.com/Blog/Default.aspx
[2]: http://www.ayende.com/Blog/archive/2008/07/11/Observations-on-Embedded-databases.aspx |
You should really use a fixed-width field for your length.
- When the program on the receiving end has to read the length field of your packet, how does it know where the length stops?
- If the length of a packet can potentially reach 4 GB, does a 1-3 byte overhead really matter?
- Do you see how complex you... |
Mechanisms for tracking DB schema changes |
|database|php|mysql|subversion| |
What are the best methods for tracking and/or automating DB schema changes? Our team uses Subversion for version control and we've been able to automate some of our tasks this way (pushing builds up to a staging server, deploying tested code to a production server) but we're still doing database updates manually. I w... |
I have a question on the best way of exposing an asynchronous remote interface.
The conditions are as follows:
* The protocol is asynchronous
* A third party can modify the data at any time
* The command round-trip can be significant
* The model should be well suited for UI interaction
* The protocol supports... |
> If all you need to do is to be able to flush the cache from a web-application, you could create a simple php-page and then use the system() call...
Cache flushing is part of what we're looking for, but also a way to monitor what scripts are currently in there, how much data is in there, etc - basically the same st... |
You could also adjust the line height of the td element:
td {
line-height: 0
} |
One nice approach I've used lately is to add an event handler for the AppDomain's AssemblyResolve event.
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);
Then in the event handler method you can load the assembly that was ... |
One nice approach I've used lately is to add an event handler for the AppDomain's AssemblyResolve event.
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);
Then in the event handler method you can load the assembly that was ... |
One nice approach I've used lately is to add an event handler for the AppDomain's AssemblyResolve event.
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);
Then in the event handler method you can load the assembly that was ... |
One nice approach I've used lately is to add an event handler for the AppDomain's AssemblyResolve event.
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);
Then in the event handler method you can load the assembly that was ... |
Maybe consider not using BITS at all and use the old favourite **Robocopy**. Robocopy is a standalone command-line executable which is part of [the Windows Server 2003 ResKit tools][1] and now standard on Vista/2008. Robocopy has the `/IPG:ms` (Inter-Packet Gap) switch to "dribble" the download, which is designed speci... |
There's basicly 2 commands to do this...
- useradd
- adduser (which is a frendlier front end to useradd)
You have to run them has root.
Just read their manuals to find out how to use them. |
Firefox:
- multi-platform
- kiosk add-on
- patch the chrome logic with zip and javascript
- see the FF 3.1 javascript speed improvements
- easily deploy standard bookmarks |
<asp:hyperlink> after opening target in new window - new window cannot be closed |
|asp.net| |
I've got a page with an <asp:hyperlink> control - the link is to a gif file. Right clicking on the link (in IE7) and selecting "open target in new window" correctly displays the image. However I can't then close the new IE window.
What might I be doing wrong ?
TIA
Tom |
I've got a page with an <asp:hyperlink> control - the link is to a gif file. Right clicking on the link (in IE7) and selecting "open target in new window" correctly displays the image. However I can't then close the new IE window.
**MORE INFO:** Works OK in Firefox 3
What might I be doing wrong ?
TIA
T... |
Pinning pointer arrays in memory |
|c#|optimization|raytracing|unsafe| |
I'm currently working on a ray-tracer in C# as a hobby project. I'm trying to achieve a decent rendering speed by implementing some tricks from a c++ implementation and have run into a spot of trouble.
The objects in the scenes which the ray-tracer renders are stored in a KdTree structure and the tree's nodes are, i... |
Factory methods (alternative constructors) are indeed a classic example of class methods.
Basically, class methods are suitable anytime you need would like to have a method which naturally fits into the namespace of the class, but is not associated with a particular instance of the class.
As an example, in the ex... |
[memcache.php][1] may be what you're looking for.
> memcache.php that you can get stats and dump from multiple memcache servers.
Can [delete keys][2] and [flush servers][3].
[1]: http://livebookmark.net/journal/2008/05/21/memcachephp-stats-like-apcphp/
[2]: http://livebookmark.net/journal/2008/07/30/mem... |
Task oriented thread pooling |
|c++|multithreading|boost| |
I've created a model for executing worker tasks in a server application using a thread pool associated with an IO completion port such as shown in the posts below:
[http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.aspx][1]
[http://blogs.msdn.com/larryoste... |
(C) What is the difference between ++i and i++ |
|c|forloop|increment| |
In C, what is the difference between using ++i and i++. And which should be used in the incrementation block of a for loop? |
|c|forloop| |
|c|for-loop| |
We seem to be in the golden age of version control, with a ton of choices, all of which have their pros and cons.
Here are the ones I see most used:
- svn - currently the most popular open source?
- git - very hot since Linus switched to it
- mercurial - some smart people I know swear by it
- cvs - the one eve... |
We seem to be in the golden age of version control, with a ton of choices, all of which have their pros and cons.
Here are the ones I see most used:
- svn - currently the most popular open source?
- git - very hot since Linus switched to it
- mercurial - some smart people I know swear by it
- cvs - the one eve... |
Couldn't agree more with what's being said. Fail early, fail fast. Pretty good Exception mantra.
The question about which Exception to throw is mostly a matter of personal taste. In my mind IllegalArgumentException seems more specific than using a NPE since it's telling me that the problem was with an argument I... |
Compare a date string to datetime in SQL Server |
|database|mssql|t-sql|datetime| |
In SQL Server I have a DATETIME column which includes a time element.
Example:
'14 AUG 2008 14:23:019'
What is the best method to select the records for a particular day, ignoring the time part?
Example: (Not safe, as it does not match the time part and returns no rows)
SELECT *
FROM ... |
In SQL Server I have a DATETIME column which includes a time element.
Example:
'14 AUG 2008 14:23:019'
What is the best method to select the records for a particular day, ignoring the time part?
Example: (Not safe, as it does not match the time part and returns no rows)
DECLARE @p_date DATET... |
HOWTO - Compare a date string to datetime in SQL Server? |
|sql-server|database|t-sql|datetime| |
In SQL Server I have a DATETIME column which includes a time element.
Example:
'14 AUG 2008 14:23:019'
What is the **best** method to only select the records for a particular day, ignoring the time part?
Example: (Not safe, as it does not match the time part and returns no rows)
DECLARE @p_d... |
|database|php|svn|mysql|subversion| |
|php|database|svn|mysql| |
|php|database|mysql|svn|migration| |
Check out [article from Cocoa is My Girlfriend][1]. The gist of it, is that there is not performance penalty of using one over the other.
However, the notation does make it more difficult to see what is happening with your variables and what your variables are.
[1]: http://www.cimgf.com/2008/07/08/a-case-aga... |
Check out [article from Cocoa is My Girlfriend][1]. The gist of it, is that there is no performance penalty of using one over the other.
However, the notation does make it more difficult to see what is happening with your variables and what your variables are.
[1]: http://www.cimgf.com/2008/07/08/a-case-agai... |
[urlencode()][1] should probably do what you want.
[1]: http://se.php.net/manual/en/function.urlencode.php |
[urlencode()][1] should probably do what you want.
**Edit**: urlencode() works fine on swedish characters.
<pre><code>
<?php
echo urlencode("åäö");
?>
</code></pre>
converts to:
<pre><code>
%E5%E4%F6
</code></pre>
[1]: http://se.php.net/manual/en/function.urlencode.php |
jQuery, easy to learn, easy to use, small footprint, active plugin developer community. Can't go wrong with jQuery. |
For what its worth [jQuery's](http://jquery.com/) website redesign launched this morning (Friday August 29, 2008). Good fun fact. And of course +1 to its mention. |
There aren't any time limits in the question so I suggest that prisoners should decide to take 1 hour per box and open them in the order presented. If the second prisoner is allowed into the room after 2 hours then he knows that the first prisoner found his own number in box 2. Therefore he knows to skip box 2 in his s... |
The urlencode() function will convert spaces into plus signs (+), so it won't work. The rawurlencode does the trick. Thanks.
Be sure to convert each part of the path separately, otherwise path/file will be converted into path%2Ffile. (which was what I missed) |
Here is the script you would put into a batch file to register all of the files in the current directory with Gacutil. You don't need to put it in a batch file (you can just copy/paste it to a Command Prompt) to do it.
FOR %1 IN (*) DO Gacutil /i %1 |
Here is the script you would put into a batch file to register all of the files in the current directory with Gacutil. You don't need to put it in a batch file (you can just copy/paste it to a Command Prompt) to do it.
FOR %1 IN (*) DO Gacutil /i %1
Edit: Bah, sorry I was late. I didn't see the previous pos... |
I needed to pass id and password to a cmd (or bat) file at the time of running rather than hardcoding them into the file.
Here's how I do it.
echo off
fake-command /u %1 /p %2
Here's what the command line looks like:
test.cmd admin P@55w0rd > test-log.txt
The %1 applies to the first paramete... |
|command-line|batch-file|ms-dos|cmd| |
|command-line|batch-file|ms-dos|cmd| |
I needed to pass id and password to a cmd (or bat) file at the time of running rather than hardcoding them into the file.
Here's how I do it.
echo off
fake-command /u %1 /p %2
Here's what the command line looks like:
test.cmd admin P@55w0rd > test-log.txt
The %1 applies to the first paramete... |
I needed to pass id and password to a cmd (or bat) file at the time of running rather than hardcoding them into the file.
Here's how I do it.
echo off
fake-command /u %1 /p %2
Here's what the command line looks like:
test.cmd admin P@55w0rd > test-log.txt
The %1 applies to the first paramete... |
Is it really prohibitive to store the pair of array reference and index?
|
For starters, I would suggest that you use the .net data providers from Oracle - if at all possible. If you are starting off in a project it will be the best way to save yourself pain further down the line. You can get them from [here][1]
[1]: http://www.oracle.com/technology/tech/windows/odpnet/index.html |
Is there any way to draw an image to use 4 points rather than 3 (perspective warp). |
|c#|.net|gdi+| |
Drawing a parallelgram is nicely supported with Graphics.DrawImage:
Bitmap destImage = new Bitmap(srcImage.Width, srcImage.Height);
using (Graphics gr = new Graphics.FromImage(destImage))
{
Point[] destPts = new Point[] { new PointF(x1, y1),
new PointF(x2, y2), new PointF(x4, y4)... |
jar is just a zip file, so I guess you can. If you could get to the source, it's cleaner. Maybe try disassembling the class? |
Firstly, if you're using C# normally, you can't suddenly get a null reference due to the garbage collector moving stuff, because the garbage collector also updates all references, so you don't need to worry about it moving stuff around.
You can pin things in memory but this may cause more problems than it solves. F... |
The course [Software Carpentry][1] is aimed specifically at people doing scientific computing and aims to teach the basics and lessons of software engineering, and how best to apply them to projects.
It covers topics like version control, debugging, testing, scripting and various other issues.
I've listened to ab... |
Adding to this question, can that improve performance? Since the classes not used would not be JIT compiled improving startup time or does the java automatically detect that while compiling to bytecode and do not even deal with the code that is not used? |
You should take a look at [thinstall][1](It has been bought by vmware and is called thinapp now), its an application virtualizer.
[1]: http://www.thinstall.com/ |
Hmm.. Are you sure the specified project is set as the start project (right click > set as startup project) ??
Oh, and obviously you need to be in the correct configuration mode ^_^
(Notice it can be changed to _debug | build | all configurations_ ) |
In general my rule is: "The application should manage it's own schema."
This means schema upgrade scripts are part of any upgrade package for the application and run automatically when the application starts. In case of errors the application fails to start and the upgrade script transaction is not committed. The... |
In general my rule is: "The application should manage it's own schema."
This means schema upgrade scripts are part of any upgrade package for the application and run automatically when the application starts. In case of errors the application fails to start and the upgrade script transaction is not committed. The... |
Are you sure you are setting the command arguments on the same configuration (Debug|Release) you are debugging? As far as I remember command arguments are per configuration. |
Looks like you're using jQuery? It has a method to clone an element with events: http://docs.jquery.com/Manipulation/clone#true |
Looks like you're using jQuery? It has a method to clone an element with events: http://docs.jquery.com/Manipulation/clone#true
EDIT: Oops I see you're using Prototype. |
The neat thing with SSAS is that you can get those indicators that you talk about quite easily either by creating calculated measures or by using KPIs.
I started with [Delivering Business Intelligence with Microsoft SQL Server 2005][1]. It had some good introduction, but unfortunately it's too verbose when it comes ... |
If by "purist" you mean "most encapsulation", then I typically declare all my fields as private and then use this.field from within the class itself, but all other classes, including subclasses, access instance state using the getters. |
Well, when I build a website I tend to try and forget about the design completely while writing the HTML. I do this so I won't end up with any design-specific markup and so I can focus on the semantic meaning of the elements.
Some pointers how to markup things:
* menu - use the UL (unordered list) element, si... |
Well, when I build a website I tend to try and forget about the design completely while writing the HTML. I do this so I won't end up with any design-specific markup and so I can focus on the semantic meaning of the elements.
Some pointers how to markup things:
* menu - use the UL (unordered list) element, si... |
I too am on my adventure into ASP.NET and have also had similar frustrations.. However, you soon get used to it. You just need to remember, **the reason you dont have the tedious HTML crafting is because the ASP.NET controls do it all for you**.
To some extent you can control/tweak these things, even if it means inh... |
In .NET, how do I launch a file with command line arguments (without knowing the location of the exe)? |
|c#|.net|vb.net| |
Here's the situation: I am trying to launch an application, but the location of the .exe isn't known to me. Now, if the file extension is registered (in Windows), I can do something like:
Process.Start("Sample.xls");
However, I need to pass some command line arguments as well. I couldn't get this to work
... |
Here's the situation: I am trying to launch an application, but the location of the .exe isn't known to me. Now, if the file extension is registered (in Windows), I can do something like:
Process.Start("Sample.xls");
However, I need to pass some command line arguments as well. I couldn't get this to work
... |
Dealing with circular dependencies in OCaml |
|ocaml| |
I'm writing an interpreter for an experimental language. Three of the main constructs of the language are definitions, statements, and expressions. Definitions can contain statements and expressions, statements can contain definitions and expressions, and one kind of expression can contain statements. I represent all o... |
How much should one DataSet represent? |