instruction
stringlengths
0
30k
You know, you should look at static linking. These days, we all have HUGE hard drives, and a few extra megabytes (for carrying around libc and what not) is really not that big a deal anymore. You could also try running your applications in chroot() jails and distributing those.
As long as there are the other web browsers (and I don't believe that they will die - which is good, because I don't want to see the internet in the hands of Google) it's just another web browser that you need to check compatibility with.
How to run gpg from a script run by cron?
|bash|cron|gnupg|
I have a script that has a part that looks like that: for file in `ls *.tar.gz`; do echo encrypting $file gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \ --simple-sk-checksum -c $file done For some reason if I run this script manually, works perfectly fine and all fil...
Are you trying to show the JDialog indepentently of the annimation? In order to get the order set properly, you may need to bundle those actions in a runnable that is passed to the EDT at once. eg: SwingUtilities.invokeLater(new Runnable(){ public void run(){ doAnnimation(); show...
You're right. dummynet works only in FreeBSD, it's actually built into the kernel. What I did when I used it was grab an older PC nobody used anymore and install the [FreeBSD distribution][1]. [1]: http://www.freebsd.org/releases/7.0R/announce.html
I liked **JavaScript:The Good Parts** by Douglas Crockford although it's focused entirely on the language and ignores the DOM altogether.
I liked [JavaScript:The Good Parts][1] by Douglas Crockford although it's focused entirely on the language and ignores the DOM altogether. [1]: http://oreilly.com/catalog/9780596517748/
Could you do it with an `onchange` event? <select onfocus="this.oldIndex=this.selectedIndex" onchange="this.selectedIndex=this.oldIndex">
Joel, (your co-host here) did a thing about using access reports for shipping labels a few years back... maybe this could be a inspriation for you? <http://www.joelonsoftware.com/articles/HowToShipAnything.html>
Please see: [http://www.sap-img.com/oracle-database/finding-oracle-sid-of-a-database.htm][1] > What is the difference between Oracle > SIDs and Oracle SERVICE NAMES. One > config tool looks for SERVICE NAME and > then the next looks for SIDs! What's > going on?! > > Oracle SID is the unique name that > uniqu...
If you want to do anything other than parse or format a date there is not much out there for handling the patterns themselves. Sometime ago I was writing a Swing component for entering dates into a formatted text field. You supplied a pattern and it moved the text entry cursor through the elements of that pattern, only...
Why @OneToMany does not work with inheritance in Hibernate
|java|orm|inheritance|hibernate|
<pre> @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class Problem { @ManyToOne private Person person; } @Entity @DiscriminatorValue("UP") public class UglyProblem extends Problem {} @Entity public class Person { @OneToMan...
If we're talking Microsoft platform, then I'd always develop a separate Windows Service to handle such batch tasks. You can always reference the same assemblies that are being used by your web application to avoid any nasty code duplication.
I see you have your solution, but mine would have avoided this and added a field to the documents you're indexing called email_domain, into which I would have added the parsed out domain of the email address. It might sound silly, but the amount of storage associated with this is pretty minimal. If you feel like getti...
Our network/server closet is a spaghetti-mess of wires; I'm not going to walk in there and start unplugging stuff lest I hit something mission-critical. (At least I have access to it; I'm sure many readers don't even know where their routers are.) Similarly, both ends of the ethernet cable require a hands-and-knees a...
is it better to structure an SQL table to have a match, or return no result
|sql|query|optimization|
I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to parts of the program. I'm using a simple Allow or Deny option for each 'Resource' or scre...
I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to parts of the program to other users. Its going to web-based and hosted on our servers. I...
To make this less tedious, you will need to encapsulate/refactor the mapping between the DataReader and the Object you hold in the list. There is quite of few steps to encapsulate that logic out. If that is the road you want to take, I can post code for you. I am just not sure how practical it would be to post the c...
As I understand it, the problem is that you don't know what format the document is prior to parsing. You could use a delegate pattern. I'm assuming you're not validating against a DTD/XSD/etcetera and that it is OK for the DefaultHandler to have state. public class DelegatingHandler extends DefaultHandler { ...
[Nerdtree](http://www.vim.org/scripts/script.php?script_id=1658)
MSTest is certainly not as efficient or extensible as some of the open source frameworks, but it is workable. Since the question asks about making life easier with MSTest and not about alternatives, here are my MSTest tips. * **Shortcuts**. Like Haacked said, take a few seconds to learn the shortcuts. * **Current...
Your two `xint` examples don't work for two different reasons. The first doesn't work because `self += value` is equivalent to `self = self + value` which just reassigns the local variable `self` to a different object (an integer) but doesn't change the original object. You can't really get this to work with a subcl...
Your two `xint` examples don't work for two different reasons. The first doesn't work because `self += value` is equivalent to `self = self + value` which just reassigns the local variable `self` to a different object (an integer) but doesn't change the original object. You can't really get this to work with a subcl...
Your two `xint` examples don't work for two different reasons. The first doesn't work because `self += value` is equivalent to `self = self + value` which just reassigns the local variable `self` to a different object (an integer) but doesn't change the original object. You can't really get this >>> x = xint...
In .NET you can use the RNGCryptoServiceProvider method GetBytes() which will "fill an array of bytes with a cryptographically strong sequence of random values" (from ms documentation). byte[] randomBytes = new byte[4]; RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); rng.GetBytes(randomB...
Try using a combination of [GetCurrentThemeName](http://www.pinvoke.net/default.aspx/uxtheme/GetCurrentThemeName.html) ([MSDN Page](http://tinyurl.com/67hbzj)) and [DwmIsCompositionEnabled](http://tinyurl.com/66l5mz) I linked the first to PInvoke so you can just drop it in your code, and for the second one you can u...
`/dev/cu.xxxxx` is the "callout" device, it's what you use when you establish a connection to the serial device and start talking to it. `/dev/tty.xxxxx` is the "dialin" device, used for monitoring a port for incoming calls for e.g. a fax listener.
We use FindBugs and JDepend integrated with Ant. We use JUnit but we're not using any coverage tool. I'm not using it integrated to Rational Application Developer (the IDE I'm using to develop J2EE applications) because I like how neat it looks when you run javac in the Windows console. :P
How to learn ADO.NET
|ado.net|
>I need to learn ADO.NET to build applications based on MS Office. I have read a good deal about ADO.NET in the MSDN Library, but everything seems rather messy to me. >What's the basics one must figure out when using ADO.NET? I think a few key words will suffice to let me organize my learning.
http://www.danga.com/memcached/ worked awesome for me and have heard nothing but goodness about it
1) I use print_r(). In TextMate, I have a snippet for 'pre' which expands to this: echo "<pre>"; print_r(); echo "<pre>"; 2) I use Xdebug, but haven't been able to get the GUI to work right on my Mac. It at least prints out a readable version of the stack trace.
Someone correct me if I'm wrong, but I don't think that AppSettings is typically meant to be used for these type of configuration settings. Normally you would only put in settings that remain fairly static (database connection strings, file paths, etc.). If you want to store customizable user settings, it would be be...
I would expect tools that need this simply walk the tree in a depth-first manner and when they hit a leaf, just process it (e.g. compile) and remove it from the graph (or mark it as processed, and treat nodes with all leaves processed as leaves). As long as it's a DAG, this simple stack-based walk should be trivial.
Could I ask why you're not saving the user's settings in a database? Generally, I save application settings that are changed very infrequently in the appSettings section (the default email address error logs are sent to, the number of minutes after which you are automatically logged out, etc.) The scope of this real...
one thing I would look at doing is caching the appsettings on a read, then flushing the settings from the cache on the write which should minimize the amount of actual load the server has to deal with for processing the appSettings. Also, if possible, look at breaking the appSettings up into [configSections][1] so y...
First, do you really want to ignore errors? If you get an error, it is likely that the data is not in sync any more. Perhaps what you want is to drop the slave database and restart the sync process when you get an error. Second, I think the error you are getting is not when you replicate an item that does not exist ...
[System.Diagnostics.FileVersionInfo]::GetVersionInfo("Path\To\File.dll")
Just to clarify, you want to be able to test your call into SQL Server returned some data, or that if you had some data you could map it back into the model? If you want to test your call into SQL returned some data checkout my answer found [here][1] [1]: http://stackoverflow.com/questions/12374/has-anyone-ha...
Try this: SELECT B.[Group], COUNT(*) AS GroupCount FROM Table1 A LEFT JOIN Table2 B ON B.ItemType=A.ItemType GROUP BY B.[Group]
How do I create a draggable and resizable JavaScript popup window?
|javascript|dialog|
I want to create a draggable and resizable window in JavaScript for cross browser use, but I want to try and avoid using a framework if I can. Has anyone got a link or some code that I can use?
@thomas -- Amazingly Microsoft's own [Windows Vista User Experience Guidelines][1] agree with you ... >While having a background window flash its taskbar button is better than having it automatically come to the top and steal input focus, flashing taskbar buttons are still very intrusive. It is hard for users to con...
Since PowerShell can call .Net classes you could do the following: [System.Diagnostics.FileVersionInfo]::GetVersionInfo("somefilepath").FileVersion Or as [noted here][1] on a list of files: get-childitem * -include *.dll,*.exe | foreach-object { "{0}`t{1}" -f $_.Name, [System.Diagnostics.FileVersionInf...
As EBGreen said, [System.Diagnostics.FileVersionInfo]::GetVersionInfo(path) will work, but remember that you can also get all the members of FileVersionInfo, for example: [System.Diagnostics.FileVersionInfo]::GetVersionInfo(path).CompanyName You should be able to use every member of FileVersionInfo documented...
|java|orm|hibernate|inheritance|
@Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class Problem { @ManyToOne private Person person; } @Entity @DiscriminatorValue("UP") public class UglyProblem extends Problem {} @Entity public class Person { @OneToMany(mappe...
Two others not mentioned yet are The Register's [Open Season][1] (about the Open Source industry) and [Semi Coherent Computing][2] (which loosely is about enterprise hardware). I'm not sure if Open Season has any more legs left in it though, since Ashley Vance (the apparent 'driver' of the podcast) has recently le...
I claim no credit for the answer because I found it after some searching: What I didn't know is that PostgreSQL allows you to define your own aggregate functions with [CREATE AGGREGATE][1] [This post][2] on the PostgreSQL list shows how trivial it is to create a function to do what's required: CREATE AGGRE...
Your best bet would be to swap out the options within the select box. If you only have one answer in that box, it doesn't matter if it is clickable. I would, however, try to find another way of doing this as it seems like it would cause frustration for a user. Imagine this user scenario: 1. "Look, a select bo...
@[Geoff](#43818) That sort of Eval statement was actually added in 2.0, but if performance is important Eval should be avoided since it uses Reflection. The repeater is a pretty good way of doing it, although it might be faster to generate the table in code: ASPX Page: <table class="report" id="bookTabl...
symbols in a .so file
|c++|c|gcc|symbols|
How do list the symbols being exported from a .so file. If possible, I'd also like to know there source (e.g. if they are pulled in from a static library). I'm using gcc 4.0.2, if that makes a difference
You don't have to live with that extension if you can install an ISAPI filter on the server. Basically you route matched urls to the {controller}.mvc variety, then in ASP.NET you rewrite this url to remove .mvc -- doing this you don't have to define any extra routes or expose .mvc to your users. I've written abou...
To be honest I would recode the function to make it a linear algorithm that uses a loop. This way you have no chance of running out of heap space if you are stepping through an extremely large string. Also, you would not need to have a the extra parameter just to keep track of the count. This also would probably hav...
DesignMode is a private property (from what I can tell). The answer is to provide a public property that exposes the DesignMode prop. Then you can cascasde back up the chain of user controls until you run into a non-user control or a control that is in design mode. Something like this.... public bool RealDe...
Best practices with jQuery form binding code in an application
|jquery|
We have an application with a good amount of jQuery JSON calls to server side code. Because of this, we have a large amount of binding code to parse responses and bind the appropriate values to the form. This is a two part question. 1. What is the reccomended approach for dealing with a large number of forms that al...
|javascript|jquery|ooad|
This is probably going to be difficult to resolve unless you post either the error message from the log file or the list of steps that you took so far. I have JRun 3.1 configured on my machine so maybe I can duplicate your issue if you give us more information.
|sql|optimization|query|
I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to parts of the program to other users. Its going to web-based and hosted on our servers. I...
Procedural languages tend to keep track of state (using variables) and tend to execute as a sequence of steps. Purely functional languages don't keep track of state, use immutable values, and tend to execute as a series of dependencies. In many cases the status of the call stack will hold the information that would be ...
There are several usages of [this][1] keyword in C#. 1. To qualify members hidden by similar name 2. To pass an object as a parameter to other methods 3. To declare indexers 4. To declare extension methods 5. To pass parameters between constructors You can avoid the first usage by declaring getter and se...
CruiseControl.NET and NAnt
|cruisecontrol.net|nant|
I have a CC.NET project configured to call a common NAnt build file, which does some stuff, and then calls a child NAnt build file. The child build file name is specified by CC.NET to the command build file using a property. The hurdle that I am trying to get over is that the common build file log gets overwritten b...
If you want to be one of the best you need to specialise. If you become very good in many skills then you may never become truly excellent in one. I know because I have taken this route myself and have found it difficult to get employment at times. After all, who wants someone who is capable at many languages when t...
Depending on your mix os OSes, you might be better off creating packages for each class of system. Alternatively, if they all share the same ABI and hardware architecture, you could also compile static binaries.
Use e.g. [mysql_pconnect][1] [1]: http://de.php.net/manual/en/function.mysql-pconnect.php
You cannot instantiate connection pools manually. But you can use the "built in" connection pooling with the [mysql_pconnect][1] function. [1]: http://de.php.net/manual/en/function.mysql-pconnect.php
One critical thing you has to keep in mind about TFS, is that it likes to have the machine all to it self. So if you have to create a separate instance on Hyper-V do it using the proven Windows Server 2003 platform with SQL Server 2005. I am sure Microsoft has done a great job getting it to work under Windows Ser...
Connection Pooling in .NET/MSSQL?
|c#|.net|database|connectionpooling|
Is it necessary or advantageous to write custom connection pooling code when developing applications in .NET with an MSSQL database? I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the framework and I don't need to worry about it? Why do people talk...
|c#|.net|database|connection-pooling|
Connection pooling in PHP
|php|
Is it possible to cache database connections when using PHP like you would in a J2EE container? If so, how?
|php|connection-pooling|
How do I model a chessboard when programming a computer to play chess?
|chess|
What data structures would you use to represent a chessboard for a computer chess program?
I've used [Traffic Shaper XP][1] on my XP dev box at work. It seems to handle any connection (not just HTTP). It wasn't perfect, but worked well enough for the tests I was doing. If you're on Windows maybe it'll do enough for you. [1]: http://bandwidthcontroller.com/trafficShaperXp.html
How Do You Communicate Service Layer Messages/Errors to Higher Layers Using MVP?
|c#|asp.net|exception|mvp|n-tier-architecture|
I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP architecture because I'm sick of Winforms and wanted something that had a better separation of concerns. So with MVP, the Presenter handles events raised by the View. Here's some code that I have in place to deal with the creation of user...
From a purely theoretical stance: The implementation I am familiar with would be to build a Deterministic Finite Automaton to recognize the regex. This is done in O(2^m), m being the size of the regex, using a standard algorithm. Once this is built, running a string through it is linear in the length of the string...
C++: Reading from text file until EOF repeats last line
|c++|fstream|iostream|