instruction stringlengths 0 30k ⌀ |
|---|
|linux|email|redhat| |
You can use Boost Dynamic Bitset:
boost::dynamic_bitset<> x(std::string("01011"));
std::cout << x << ":" << x.to_ulong() << std::endl;
|
You need to get the content of the p tag and replace all the dolors in it with the highlighted version.
You don't even need to have jQuery for this. :-) |
You can append sendmail options to the end of the mail command by first adding --. -f is the command on sendmail to set the from address. So you can do this:
mail recipient@foo.com -- -f sender@bar.com
|
SubVersion is the best Choice for you , As Karl Seguin pointed out Moving to Another Versioning System would not be a problem. also SVN has very goof Easy to use GUIs in the Client Side (TortoiseSVN).
http://www.snee.com/bobdc.blog/2007/08/getting_started_with_subversio.html
http://dojo.jot.com/WikiHome/Getting%2... |
I don't remember any SourceSafe user ever liking the product. Do your colleges actually like it?
I've got a similar issue with CVS at my current customer's usage. Since "it works" and they are mostly pleased with it, I cannot push them to change. But daily I sure wish they would! |
I don't remember any SourceSafe user ever liking the product. Do your colleagues actually like it?
I've got a similar issue with CVS at my current customer's usage. Since "it works" and they are mostly pleased with it, I cannot push them to change. But daily I sure wish they would! |
I'd just write it like this instead:
[ -e filename ] && (
echo here we go
)
It is straightforward bash syntax and more readable to a bash script programmer than something encapsulated by a function.
I could go for a middle-way:
function file_exists {
[ -e $1 ]
}
f... |
I'd just write it like this instead:
[ -e filename ] && (
echo here we go
)
It is straightforward bash syntax and more readable to a bash script programmer than something encapsulated by a function.
I could go for a middle-way, more readable to most C programmers:
function file_exists {... |
This should be readable to most C programmers:
function file_exists {
if ( [ -e $1 ] ) then
echo "Doing stuff"
else
echo "File $1 doesn't exist"
false
fi
}
file_exists filename && (
echo "Here we go"
)
or the one-liner
file_e... |
A well know one is [Tahoe][1]. Others are
- http://www.sjjmicro.com/EDK.html
- http://www.ghielectronics.com/details.php?id=107&sid=108
[1]: http://devicesolutions.net/Products/Tahoe/tabid/55/Default.aspx |
A well known one is [Tahoe][1]. Others are
- http://www.sjjmicro.com/EDK.html
- http://www.ghielectronics.com/details.php?id=107&sid=108
[1]: http://devicesolutions.net/Products/Tahoe/tabid/55/Default.aspx |
The action or event has been blocked by Disabled Mode |
|ms-access|ms-access2007| |
I am using Microsoft Access 2007 to move and massage some data between two SQL Servers. Yesterday everything was working correctly, I was able to run queries, update data, and delete data.
Today I opened up the Access database to finish my data migration and am now receiving the following message when I try to run ... |
|ms-access|ms-access-2007| |
A single regex won't do. Every text markup will have it's own html translator. Better look into how the existing converters are implemented to get an idea on how it works.
<http://en.wikipedia.org/wiki/Markdown#Converters>
|
Another option is to get [Oracle JDeveloper][1] (free to download and use - it's a full featured IDE that includes some neat extras like the SQL workbench and BPEL designer).
As a learning tool, it is quite good, not only for the tutorials available from Oracle, but it includes a range of "cue-card" lessons in the t... |
Another option is to get [Oracle JDeveloper][1] (free to download and use - it's a full featured IDE that includes some neat extras like the SQL workbench and BPEL designer).
As a learning tool, it is quite good, not only for the tutorials available from Oracle, but it includes a range of "cue-card" lessons in the t... |
Thank you, Devin! Here is my C# Code for implementing your suggestion. It works quite good. Turning this into a community owned Wiki post, If someone likes to add some code, feel free to edit this.
![example][1]
Image img = Image.FromFile("rss-icon.jpg");
Graphics g = Graphics.FromImage(img);
Pen p ... |
Unfortunately the Lagrange or other forms of polynomial interpolation will not work on an arbitrary set of points. They only work on a set where in one dimension e.g. x
x<sub>i</sub> < x<sub>i+1</sub>
For an arbitary set of points, e.g. an aeroplane flight path, where each point is a (longitude, latitude) pair... |
Unfortunately the Lagrange or other forms of polynomial interpolation will not work on an arbitrary set of points. They only work on a set where in one dimension e.g. x
x<sub>i</sub> < x<sub>i+1</sub>
For an arbitary set of points, e.g. an aeroplane flight path, where each point is a (longitude, latitude) pair... |
Unfortunately the Lagrange or other forms of polynomial interpolation will not work on an arbitrary set of points. They only work on a set where in one dimension e.g. x
x<sub>i</sub> < x<sub>i+1</sub>
For an arbitary set of points, e.g. an aeroplane flight path, where each point is a (longitude, latitude) pair... |
Unfortunately the Lagrange or other forms of polynomial interpolation will not work on an arbitrary set of points. They only work on a set where in one dimension e.g. x
x<sub>i</sub> < x<sub>i+1</sub>
For an arbitary set of points, e.g. an aeroplane flight path, where each point is a (longitude, latitude) pair... |
If you don't want the contents of STDERR, then the capture() command from [IPC::System::Simple][1] module is almost exactly what you're after:
use IPC::System::Simple qw(capture system $EXITVAL);
my $output = capture($cmd, @args);
my $exit_value = $EXITVAL;
You can use capture() wit... |
If I remember correctly, for/foreach do get the whole list first anyways, so a lazily evaluated list would be read completely and then it would start to iterate through the elements. Therefore, I think there's no other way than using a while loop. But I may be wrong.
The advantage of a while loop is that you can fak... |
If I remember correctly, for/foreach do get the whole list first anyways, so a lazily evaluated list would be read completely and then it would start to iterate through the elements. Therefore, I think there's no other way than using a while loop. But I may be wrong.
The advantage of a while loop is that you can fak... |
What about r:Base? Way back in the day r:Base was a very robust DOS (then Windows) RDMBS and this is pre-Access / pre-Paradox days. Its closest competitor was dBase but that wasnt fully relational, at the time. I developed some very nice r:Base applications AND, like Access today, had a built in report generator, f... |
|semantic-web|rdf|owl|ontology| |
Can you render a Direct3D window for one process into another process' HWND? |
|winapi|direct3d| |
What I want to do is have a Windows application launch another Direct3D application and have the Direct3D application render into a control provided by the parent process.
Is this even possible? If it is, how would it be done? |
You have to use [NAnt][1] for those kind of stuff.
Here is the [Task Reference of Nant][2]..
[1]: http://nant.sourceforge.net/
[2]: http://nant.sourceforge.net/release/latest/help/tasks/ |
I would recommend to put the script into dhclient-exit-hooks.d. Because you should just change the DDNS entry, if the address change has been finished. However, I am not sure if dhclient-exit-hooks are called, if assigning an address fails.
Edit: The man pages (man dhclient-script) says, that the exit-hooks script ... |
Actually there is a difference between
throw new CustomException(ex);
and
throw;
The second will preserve the stack information.
But sometimes you want to make the Exception more "friendly" to your application domain, instead of letting the DatabaseException reach your GUI, you'll raise your cust... |
Actually there is a difference between
throw new CustomException(ex);
and
throw;
The second will preserve the stack information.
But sometimes you want to make the Exception more "friendly" to your application domain, instead of letting the DatabaseException reach your GUI, you'll raise your cust... |
The error you are getting seems to be related to your SELinux configuration. You might try temporarily disabling that.
As an aside, I would strongly suggest that you adjust your sudo configuration to be more restrictive.
User_Alias WWW=apache
Cmnd_Alias WEBCMDS=/etc/init.d/portmap
WWW ALL=NOPASSW... |
This should be readable to most C programmers:
function file_exists {
if ( [ -e $1 ] ) then
echo "Doing stuff"
else
echo "File $1 doesn't exist"
false
fi
}
file_exists filename && (
echo "Here we go"
)
or the one-liner
file_e... |
This should be readable to most C programmers:
function file_exists {
if ( [ -e $1 ] ) then
echo "Doing stuff"
else
echo "File $1 doesn't exist"
false
fi
}
file_exists filename && (
echo "Do your stuff..."
)
or the one-liner
... |
This may be a personal preference, but I find it extremely difficult to read SQL queries that are all slapped onto one long line. I prefer the following indentation style:
SELECT
[Fields]
FROM
Table
WHERE
x = x
This simple practice has helped me out a lot when writing stor... |
Use javascript to automatically submit your form. At least, that's what we do when forwarding to a 3D secure site. Here's what our provider suggests:
<html>
<head>
<title>Processing your request...</title>
</head>
<body OnLoad="OnLoadEvent();">
<form name="downloadForm" action="<%... |
#2008 Oct#
To be filled in at October to reflect the market status then.
#2008 Sept#
##Products/services/technologies currently existing##
1. VMware
2. Xen
3. ???
##Comparisons##
???
##Recommendations for particular application areas##
1. Home multi-boot replacement
2. Small business which... |
#2008 Oct#
To be filled in at October to reflect the market status then.
#2008 Sept#
##Products/services/technologies currently existing##
1. [VMware](http://www.vmware.com)
1. [Xen](http://www.xen.org)
1. [VirtualBox](http://www.virtualbox.org)
1. [VServer](http://linux-vserver.org)
1. ???
##Comp... |
Maybe you could create your own Attribute and have a constructor value that takes an enum value of View or Json. Below is what Im using for a custom Authorization Attribute to demonstrate what I mean. This way when authentication fails on a json request it responds with a json error and the same with if it returns a V... |
Maybe you could create your own Attribute and have a constructor value that takes an enum value of View or Json. Below is what Im using for a custom Authorization Attribute to demonstrate what I mean. This way when authentication fails on a json request it responds with a json error and the same with if it returns a V... |
[Use an iterator][1] or consider using [Tie::LazyList][2] from CPAN (which is a tad dated).
[1]: http://perldesignpatterns.com/?LazyEvaluation
[2]: http://search.cpan.org/dist/Tie-LazyList/ |
I think it massively clutters up the source code.
It also doesn't gain you much in a strongly typed language. If you do any form of type mismatch tomfoolery, the compiler will tell you about it. |
The IDE should impart that useful information. Hungarian might have made some sort (not a whole lot, but some sort) of sense when IDE's were much less advanced. |
Joel Spolsky wrote a good blog post about this.
http://www.joelonsoftware.com/articles/Wrong.html
Basically it comes down to not making your code harder to read when a decent IDE will tell you want type the variable is if you can't remember. Also, if you make your code compartmentalized enough, you don't have to rem... |
Have you taken a look at [put.py][1]? I've used it in the past. You can also just hack up your own request with urllib.
[1]: http://inamidst.com/proj/put/put.py |
* They're a humongous eyesore
* Your IDE should be able to tell you all you need to know about a variable's type
* Good names (which HN gets in the way of) should communicate to you everything else you need to know about a variable. |
Using the Lists web service to insert item into a SharePoint list can indeed be tricky. Since this method is of the form: XML in, XML out, it can be hard to get the parameters right.
First you should take a look at the list definition. It can be retrieved with the method GetList(), as shown below:
XmlNode li... |
The 3D Secure API doesn't allow you to do the request in the background. You need to forward the user to the 3D secure site. Use javascript to automatically submit your form. Here's what our provider suggests:
<html>
<head>
<title>Processing your request...</title>
</head>
<body OnLoad=... |
The best thing to do here is to use a HTML parser. With a HTML parser you can look at the table rows programmatically, without having to resort to fragile regular expressions and doing the parsing yourself.
Then you can run some logic along the lines of (this is not runnable code, just a sketch that you should be ab... |
Personally I find most of the unit tests like someone else's desire rather than mine. I think that any unit test should be written just like a normal program except the fact that it doesn't do anything other than testing a library/algorithm or any part of code.
My unit tests usually don't use tools like [CUnit][1], ... |
How can I extract the data out of a typical html day/time schedule? |
|regex|html|table|parsers| |
I'm trying to write a parser to get the data out of a typical html table day/time schedule (like <a href="http://kut.org/about/schedule">this</a>).
I'd like to give this parser a page and a table class/id, and have it return a list of events, along with days & times they occur. It should take into account rowspans... |
Oracle XE With Application Express.
- Has a nice web based gui,
- Is a "Real" database
- Will scale beyond a single desktop
- Offers a clear scale path beyond a small team
- Applications as web based, easily accessible.
- Can convert Excel spread sheets into Applications |
Now if you can sort on the attribute values this can be done:
class A
attr_accessor :val
def initialize(v); self.val = v; end
end
objs = [1,2,6,3,7,7,8,2,8].map{|i| A.new(i)}
objs.sort_by{|a| a.val}.inject([]) do |uniqs, a|
uniqs << a if uniqs.empty? || a.val != ... |
Does [the Masked Input plugin][1] do what you need or that one you have already found to be unreliable?
[1]: http://plugins.jquery.com/project/maskedinput |
In my opinion, the "best" solution is the one that can be read by another programmer (or the original programmer two years later) without copious comments. You may well want the fastest or cleverest solution which some have already provided but I prefer readability over cleverness anytime.
unsigned int bitCount... |
There's no standard library function afaik. So if you're writing portable code, you're looking at a loop.
If you're writing non-portable code then check your compiler/platform documentation, but don't hold your breath because it's rare to get much help here. Maybe someone else will chip in with examples of platforms... |
There's no standard library function afaik. So if you're writing portable code, you're looking at a loop.
If you're writing non-portable code then check your compiler/platform documentation, but don't hold your breath because it's rare to get much help here. Maybe someone else will chip in with examples of platforms... |
How do I get a decimal value when using the division operator in Python? |
|python|math|syntax|operator| |
For example, the standard division symbol '/' rounds to zero:
>>> 4 / 100
0
However, I want it to return 0.04. What do I use?
|
Javascript events |
|javascript|js| |
I'm aware of things like "onchange", "onmousedown" and "onmouseup" but is there a good reference somewhere that lists all of them complete with possibly a list of the elements that they cover? |
|javascript|browser|client-side| |
Opening more than one of the same Mac Application at once. |
|macos|java|eclipse| |
I'm developing a Mac App in Java that logs into any one of our client's databases. My users want to have several copies of this program running so they can log into a couple clients at the same time, rather than logging out and logging back in.
How can I allow a user to open several copies of my App at once?
I'm... |
|java|eclipse|macos| |
I'm developing a Mac App in Java that logs into any one of our client's databases. My users want to have several copies of this program running so they can log into a couple clients at the same time, rather than logging out and logging back in.
How can I allow a user to open several copies of my App at once?
I'm... |
Caching the property lookup might help some, but c[aching the length of the array before starting the loop has proven to be faster.][1]
So declaring a variable in the loop that holds the value of the scale_select.length would speed up the entire loop some.
var scale_select = document.getElementsByName('scale_... |
You can implement a type converter class that converts between int array and string data types.
Then decorate your int array property with the TypeConverterAttribute, specifying the class that you implemented. Visual Studio will then use your type converter for type conversions on your property. |
Getting the text from a drop-down box |
|javascript|js| |
This gets the value of whatever is selected in my dropdown menu.
document.getElementById('newSkill').value
I cannot however find out what property to go after for the text that's currently displayed by the drop down menu. I tried "text" then looked at [W3Schools][1] but that didn't have the answer, does anybo... |
|html|regex|table|parsers|sgml-not-regex| |
Highlight a word with jQuery |
|html|jquery|javascript| |
I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text:
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</p>
<p>
Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero.
... |
|javascript|html|jquery| |
I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text:
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</p>
<p>
Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero.
... |
How do you make the background of a video or picture clear in Quartz Composer? |
|mac|osx-leopard|quartzcomposer|composite| |
I'd like to remove all of the black from a picture attached to a sprite so that it becomes transparent. |
You can always do:
int i, j;
for (i = j = 0; j < foo.length; ++j)
if (!"a".equals(foo[j])) foo[i++] = foo[j];
foo = Arrays.copyOf(foo, i);
|
You can use [pymad](http://spacepants.org/src/pymad/). It's an external library, but don't fall for the Not Invented Here trap. Any particular reason you don't want any external libraries?
import mad
mf = mad.MadFile("foo.mp3")
track_length_in_milliseconds = mf.total_time()
Spotted [here... |
You can use [pymad](http://spacepants.org/src/pymad/). It's an external library, but don't fall for the Not Invented Here trap. Any particular reason you don't want any external libraries?
import mad
mf = mad.MadFile("foo.mp3")
track_length_in_milliseconds = mf.total_time()
Spotted [here... |
Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this:
MY PHP PAGE:
// some content...
<?php
$GLOBALS["topOfThePage"] = true;
$this->renderSomeHTML();
?>
// some content...
<?php
... |
Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this:
MY PHP PAGE:
// some content...
<?php
$GLOBALS["topOfThePage"] = true;
$this->renderSomeHTML();
?>
// some content...
<?php
... |
This is a shot in the dark, but you could try double buffering the control.
SetStyle(
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.DoubleBuffer, true) |
SVN checkout question |
|svn| |
I am about to move to SVN as my RCS of choice (after many years using CVS) and have a basic question...
I have a number of shared projects - code that I want to use with lots of different projects. Is it possible to 'link' these shared folders to the projects that need them, so checking out a project will also chec... |
I think <a href="http://code.google.com/p/jtracert/">jtracert</a> is what you are looking for. It generates a sequence diagram from a running Java program. Also, because its output is a text description of the diagram (in the formats of several popular SD tools), you can use grep to filter for only the classes you are... |