instruction stringlengths 0 30k ⌀ |
|---|
|linux|unix|bsd|posix|chroot| |
How can one detect being in a chroot jail without root privileges? Assume a standard BSD or Linux system. The best I came up with was to look at the inode value for "/" and to consider whether it is reasonably low, but I would like a more accurate method for detection. |
How can one detect being in a chroot jail without root privileges? Assume a standard BSD or Linux system. The best I came up with was to look at the inode value for "/" and to consider whether it is reasonably low, but I would like a more accurate method for detection.
`[edit 20080916 142430 EST]` Simply looking a... |
I find this one also very useful:
Ctrl K + Ctrk L - Clear alll bookmarks |
What tool to use for automatic nightly builds? |
|visual-studio|build-process| |
I have a few Visual Studio Solutions/Projects that are being worked on in my company, which now require a scheme for automatic nightly builds. Such a scheme needs to be able to check the latest versions from SVN, build the solutions, create the appropriate downloadable files (including installers, documentation, etc.),... |
|visual-studio|build-process| |
|visual-studio|build-process| |
UI and event testing |
|tdd|unit-testing|visual-studio|user-interface| |
So I know that unit testing is a must. I get the idea that TDD is the way to go when adding new modules. Even if, in practice, I don't actually do it. A bit like commenting code, really.
The real thing is, I'm struggling to get my head around how to unit-test the UI and more generally objects that generate events: ... |
|visual-studio|unit-testing|user-interface|tdd| |
When the key is sent between the client and the server it is clear text and subject to interception. Combine that with the encrypted text of the password and the password is decrypted.
[Diffie-Hellman][1] is a good solution. If you only need to authenticate them, and not actually transmit the password (because t... |
How to Get attachments Associated with artifacts in SourceForge Enterprise Edition |
|sourceforge| |
We are using SourceForge Enterprise Edition 4.4 in one of our project. I am very new to it.
My question is, in CollabNet SFEE (SourceForge Enterprise Edition 4.4), how will we get attachments associated with an Artifacts Using SFEE SOAP API?
We have made our own .net 2.0 client. We are not using .net SDK provided... |
We are using SourceForge Enterprise Edition 4.4 in one of our project. I am very new to it.
My question is, in CollabNet SFEE (SourceForge Enterprise Edition 4.4), how will we get attachments associated with an Artifacts Using SFEE SOAP API?
We have made our own .net 2.0 client. We are not using .net SDK provided... |
Database abstraction layers for (Visual) C++ |
|c++|database| |
What options exist for accessing different databases from C++?
Put differently, what alternatives are there to ADO?
What are the pros and cons? |
Ever Heard of a License Transfer Fee upon Acquisition? |
|licensing| |
My employer was recently acquired by a much larger company. In the process of sorting out all the legal details around our licenses for our development software, we have learned that the vendor of our IDE charges a "nominal" fee of 25% of the cost of a new license to transfer our existing licenses to the new corporate... |
MSDN? I usually do pretty well with the Library reference itself, and I usually expect to find valuable articles there. |
You can use the undocumented [DBCC LOG <db> command.][1]
[1]: http://searchsqlserver.techtarget.com/tip/1,289483,sid87_gci1173464,00.html |
To have permissions vary at the "sub site" level which is the SPWeb object in object model terms you need to enable unqiue permission for the site.
A good article outlining the permission hierarchy in SharePoint 2007 can be found on the office web site [About controlling access to sites and site content
](http://of... |
To have permissions vary at the "sub site" level which is the SPWeb object in object model terms you need to **enable unqiue permission for the site**.
A good article outlining the permission hierarchy in SharePoint 2007 can be found on the office web site [About controlling access to sites and site content
](http:... |
To have permissions vary at the "sub site" level which is the SPWeb object in object model terms you need to **enable unique permission for the site**.
A good article outlining the permission hierarchy in SharePoint 2007 can be found on the office web site [About controlling access to sites and site content
](http:... |
|linux|unix|posix|bsd|chroot| |
How can one detect being in a chroot jail without root privileges? Assume a standard BSD or Linux system. The best I came up with was to look at the inode value for "/" and to consider whether it is reasonably low, but I would like a more accurate method for detection.
`[edit 20080916 142430 EST]` Simply looking a... |
Eclipse RCP app fails to start |
|java|eclipse|rcp| |
I have an Eclipse RCP app running on Java 6. When I try to run the product configuration from within Eclipse, it silently terminates almost immediately. No error is reported in the console. I've tried setting breakpoints in the IApplication and in the Activator, and neither are reached.
I know I don't have much s... |
**using** is used when you have a resource that you want disposed after it's been used.
For instance if you allocate a File resource and only need to use it in one section of code for a little reading or writing, using is helpful for disposing of the File resource as soon as your done.
The resource being used nee... |
Use the <[attrib][1]> task. For example, to make the file "test.txt" read/write, you would use
<attrib file="test.txt" readonly="false"/>
[1]: http://nant.sourceforge.net/release/0.85-rc1/help/tasks/attrib.html |
How can I pre-compress files with mod_deflate in Apache 2.x? |
|apache|http|gzip|mod-deflate|content-encoding| |
I am serving all content through apache with `Content-Encoding: zip` but that compresses on the fly. A good amount of my content is static files on the disk. I want to gzip the files beforehand rather than compressing them every time they are requested.
This is something that, I believe, `mod_gzip` did in Apache 1... |
The reason for the "using" statement is to ensure that the object is always disposed correctly, and it doesn't require explicit code to ensure that this happens.
As per <http://www.codeproject.com/KB/cs/tinguusingstatement.aspx>, the .NET CLR converts
using (MyResource myRes = new MyResource())
{
... |
Not really obscure, but one of the features I absolutely *love* is tab completion.
Really useful when you are navigating trough an entire subtree structure, or when you are using some obscure, or long command! |
%[width].[precision]
Width should include the decimal point.
%8.2 means 8 characters wide; 5 digits before the point and 2 after. One character is reserved for the point.
5 + 1 + 2 = 8 |
There are some great ideas here already. Here are some requirements gathering principles that I always like to keep in mind:
**Know the difference between the user and the customer.**
The business owners that approve the shiny project are usually the customers. However, a devastating mistake is the tendency to conf... |
How to associate a file extension to the current executable in C# |
|c#|windows|winforms| |
I'd like to to associate a file extension to the current executable in C#.
This way when the user clicks on the file afterwards in explorer, it'll run my executable with the given file as the first argument.
Ideally it'd also set the icon for the given file extensions to the icon for my executable.
Thanks all. |
Is this about serialization? Or printing proper?
If the former, consider boost::serialization as well. It's all about "recursive" serialization of objects and sub-object. |
What do you use to write and edit stored procedures in Oracle? |
|sql|oracle-database|stored-procedures|toad|jdeveloper| |
There are many options for editing and writing Stored Procedures in Oracle; what is the best tool for you and why? (one tool per answer.) |
You can use std::string and iostreams with formatting, such as the setw() call and others in iomanip |
I like to construct commands with **echo** and pipe them to the shell:
$ find ~/ops/bin -name \*~ | xargs echo rm
...
$ find dir -name \*~ | xargs echo rm | ksh -s
Why? Because it allows me to look at what's going to be done before I do it. That way if I have a horrible error (like removing my hom... |
I know you said you want the service to be local, but... if you have to be connected to the Internet to take the screenshot, you should equally have access to a web service. It seems like a better move to do this than to open yourself up to cross-platform issues of taking screenshots locally. |
A list can be stored by having a column contain the offset (list index position) -- an insert in the middle is then incrementing all above the new parent and then doing an insert. |
Check out [diff][1]. Here it is [in the gnu project][2] (open source, of course), and many more links to implementations are found in the wikipedia article. A comparison of different such programs is found [here][3].
[1]: http://en.wikipedia.org/wiki/Diff
[2]: http://www.gnu.org/software/diffutils/diffutils.h... |
You're likely going to have to remove the runat="server" from the span and then place a <asp:Literal /> within the span so you can stylize the span and still have the dynamic internal content.
Not an elegant or easy solution (and it requires a recompile), but it works. |
Why do you have any expectation that param will be set to the value? You're responsible for parsing the command line in the fashion you desire, from the $argv array. |
Instead of just chiming in with another vote for a particular font, I'd recommend reading these comparisons of programming fonts where you can learn a little more:
Jeff Atwood's excellent "round-up":<br>
http://www.codinghorror.com/blog/archives/000157.html
Another review of 5 fonts with nice screenshots:<br>
... |
[JNI][1]. In fact, with JNI, crashing is the default mode of operation. You have to work extra hard to get it not to crash.
[1]: http://en.wikipedia.org/wiki/Java_Native_Interface |
Store an integer column in your table called 'position'. Record a 0 for the first item in your list, a 1 for the second item, etc. Index that column in your database, and when you want to pull your values out, sort by that column.
alter table linked_list add column position integer not null default 0;
a... |
Oops, it's
$('#mySelect').attr('size', value) |
If you want a macro then this should do the trick:
#define IS_SIGNED( T ) (((T)-1)<0)
Basically, cast -1 to your type and see if it's still -1. In C++ you don't need a macro. Just `#include <limits>` and:
bool my_type_is_signed = std::numeric_limits<my_type>::is_signed;
|
Write the interface in C++ and use macros to make it look like a standard cpp header file on UNIX and like an IDL file on windows (If this does not work out, you can always write a python/ruby script to generate the IDL from the C++ header file).
Compile the IDL to generate a typelib. Use TypeLib Importer to generat... |
There's a commercial product from Lumigent called "Log Explorer". It's $995 per seat, but should cover your basic requirements.
|
This is only relevant if you're talking SQL Server 2000 but RedGate produced a tool called [SQL Log Rescue](http://www.red-gate.com/products/SQL_Log_Rescue/index.htm) |
This is only relevant if you're talking SQL Server 2000 but RedGate produced a free tool called [SQL Log Rescue](http://www.red-gate.com/products/SQL_Log_Rescue/index.htm).
Otherwise, for SQL Server 2005 [ApexSQLLog](http://www.apexsql.com/sql_tools_log.asp) from ApexSQL is the only other product I'm aware of |
To create a color, try this:
Device device = Display.getCurrent ();
Color red = new Color (device, 255, 0, 0);
|
Unfriendly? Yes. Abnormal? No. Its actually very common for tools with a hefty per-seat license fee to charge for a transfer after acquisition. I believe they do it because they can: the cost of transferring license is either overlooked during the M&A due diligence or is considered inconsequential compared to the rest.... |
There are some companies that produce log readers like Lumigent and Red Gate. However they do not work with SQL server versions greater than 2000 because of meta data changes in the underlying system tables and data types, they might work if you do not use any new functionality but if you use varchar(max) XML datatype... |
I would have expected your new overlords to have been made aware of this as part of their takeover plans. Part of the process involves checking for exactly this kind of gotcha.
Sounds like they chose to ignore the information or did not check it out. |
I've heard of it before in regards to some high-end graphics software, but this was also back in the 1990's and only applied if you sold your license to someone else.
However, it does seem to be a bit odd to change 25% of a new license to just change the name on it. I'm not a lawyer, but isn't there some way that yo... |
http://code.activestate.com/recipes/223972/ |
This sounds like the subset sum problem, which is [known to be NP-complete][1].
Good luck with that.
[1]: http://en.wikipedia.org/wiki/Subset_sum_problem |
This sounds like the subset sum problem, which is [known to be NP-complete][1].
Good luck with that.
**Edit:** If you're allowed arbitrary number of bills/coins of some denomination (as opposed to just one), then it's a different problem, and is easier. See the [coin problem][2]. I realized this when reading an... |
You can also do something like this and add the directory that the config file is sitting in to the python load path, and then just do a normal import, assuming you know the name of the file in advance, in this case "config"
Messy but it works.
configfile = '~/config.py'
import os
import sys
... |
This is how I did it just recently. Add an interface that implements IDispatch and a coclass for that interface to your IDL:
[
object,
uuid(6EDA5438-0915-4183-841D-D3F0AEDFA466),
nonextensible,
oleautomation,
pointer_default(unique)
]
interface IServerEvent... |
There's comparison of the different techniques at [http://blogs.msdn.com/bclteam/archive/2005/02/11/371436.aspx] [1].
[1]: http://blogs.msdn.com/bclteam/archive/2005/02/11/371436.aspx |
The using keyword defines the scope for the object and then disposes of the object when the scope is complete. For example.
Font font2 = new Font("Arial", 10.0f);
using (font2)
{
// use font2
}
See [here][1] for the MSDN article on the C# using keyword.
[1]: http://msdn.microso... |
The using keyword defines the scope for the object and then disposes of the object when the scope is complete. For example.
using (Font font2 = new Font("Arial", 10.0f))
{
// use font2
}
See [here][1] for the MSDN article on the C# using keyword.
[1]: http://msdn.microsoft.com/en-us... |
You should look at the source code of [xbindkeys](http://hocwp.free.fr/xbindkeys/xbindkeys.html).
Xlib programming is pretty arcane, documentation is hard to find, and there are subtle portability issues. You'll be better off copying some battle-hardened code. |
The onSuccess element of the function call you are making to handle the AJAX call is executed at the time you receive a response from get-table.php. This is a separate Javascript function which you are telling the browser to call when you get an answer from get-table.php. The code below your AJAX.Request call is acce... |
What are the major new 'core' features of MS SQL Server 2008? |
|sql-server| |
I'm looking mainly at things like new SQL syntax, new kinds of locking, new capabilities etc. Not so much in the surrounding services like data warehousing and reports... |
Since this is stack**overflow**, I'll give you my _programmer's answer_
####semantics 101
First take a look at this code and think about what's wrong here...
class car {
int wheels = 4;
string engine;
}
car mybike = new car();
mybike.wheels = 2;
mybike.engine = null;... |
Formatting a long timestamp into a Date with JSTL |
|java|jsp|jstl| |
I am pulling a long timestamp from a database, but want to present it as a Date using Tags only, no embedded java in the JSP.<br><br> I've created my own tag to do this because I was unable to get the parseDate and formatDate tags to work, but that's not to say they don't work.<br>
<br>
Any advice?
Thanks. |
At my current job we just created a subversion repository, setup hook scripts to ignore all vss and generated files, and then just started importing the various projects with tortoiseSVN. Worked out pretty decent, we were up and running within a couple of hours. |
My first comment would be to avoid using JavaScript to change the angle brackets. Bypassing this is as simple as disabling JavaScript in the browser. Almost all server-side languages have some utility method that converts some HTML characters into their entity counterparts. For instance, PHP uses htmlentities(), and I ... |
You can subclass whatever library class you are using to manage your sockets (presumably CAsyncSocket or CSocket if you are using MFC), override the methods whose failure you want to test, and insert appropriate test code in your overrides. |
There's actually a way to turn that "feature" off. This will allow the user to post whichever characters they want, and there will be no need to convert characters to an alias using Javascript. See this article for [disabling request validation][1]. It means that you'll have to do your own validation, but from the so... |
I think the safest way to go is to NOT allow the user to create <script> tags with your WISYWIG. Maybe using something like a markdown editor like on this site or [available here.][1] would be another approach.
Also keep the Page directive ValidateRequest=true which should stop <script> markup from being sent in th... |
python cgi on IIS |
|vb|asp|python|cgi| |
How do you set up IIS so that you can call python scripts from asp pages?
Ok, so I found the answer to that question here: <a href="http://support.microsoft.com/kb/276494">http://support.microsoft.com/kb/276494</a>
So on to my next question: How do you call a cgi script from within classic asp (vb) code? Particul... |
|python|iis|asp|vb|cgi| |
Development directory Structure |
|directory-structure| |
SQLite UDF - VBA Callback |