instruction stringlengths 0 30k ⌀ |
|---|
What is the web interface tool that Debian or Ubuntu use for publicizing their custom repositories on the web?
Like [packages.debian.org][1]
Is such tool open sourced, so that it could be re-used for a custom repository?
[1]: http://www.debian.org/distrib/packages |
I think technical terms should be kept in their original language, which is english in pretty much any case. I remember lectures about operating systems - virtual memory specifically - and they talked of tilings. I thought "what the hell? There is a tiling in my kitchen and my bathroom, but not in my memory!" and ended... |
Yes, you can absolutely do this and the code depends on the file format. I work for an imaging vendor ([Atalasoft][1]), and our product provides a GetImageInfo() for every codec that does the minimum to find out dimensions and some other easy to get data.
If you want to roll your own, I suggest starting with [wotsi... |
A friend has the simplest anti-spam method, and it works.
He has a custom text box which says "please type in the number 4".
His blog is rather popular, but still not popular enough for bots to figure it out (yet). |
I use camel case and underscore like many here. I use the underscore because I work with C# and I've gotten used to avoiding the 'this' keyword in my constructors. I camel case method-scoped variants so the underscore reminds me what scope I'm working with at the time. Otherwise I don't think it matters as long as you'... |
While Nescio's [answer][1] (DoEvents) will work, it will cause your application to use 100% of one CPU. Sleep will make the UI unresponsive. What you need is a combination of the two, and the magic combination that seems to work best is:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Lon... |
achieving 100% code coverage is almost always wasteful. There are many resources on this.
Nothing is impossible to unit test but there are always diminishing returns. It may not be worth it to unit test things that are painful to unit test. |
[Ltk][1] is quite popular, and it's well-documented through the Tk docs. Installation on SBCL is as easy as saying:
(require :asdf-install)
(asdf-install:install :ltk)
There's also [Cells-Gtk][2], which is reported to be quite usable but may have a slightly steeper learning curve because of its reliance... |
[Ltk][1] is quite popular, very portable, and reasonably well documented through the Tk docs. Installation on SBCL is as easy as saying:
(require :asdf-install)
(asdf-install:install :ltk)
There's also [Cells-Gtk][2], which is reported to be quite usable but may have a slightly steeper learning curve be... |
[Ltk][1] is quite popular, very portable, and reasonably well documented through the Tk docs. Installation on SBCL is as easy as saying:
(require :asdf-install)
(asdf-install:install :ltk)
There's also [Cells-Gtk][2], which is reported to be quite usable but may have a slightly steeper learning curve be... |
It lets you build web applications without having a good understanding of the underlying concepts such as HTTP. This strength is also its greatest weakness. |
It lets you build web applications without having a good understanding of the underlying concepts such as HTTP. This has its own downsides. |
[Google Gears][1]. There's also Mozilla's [XUL][2], but it's too bit complicated, IMHO (albeit extremely powerful).
[1]: http://gears.google.com
[2]: http://www.mozilla.org/projects/xul/ |
You can iterate through your datagridview and retrieve each cell.
for(int i =0; i < DataGridView.Rows.Count; i++){
DataGridView.Rows.Columns["columnName"].Text= "";
}
There is an example [here][1].
[1]: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=276684&SiteID=1 |
It's saturday, and I got bored... so, here:
private const string UglyMovieRegex = "(?<=5>|3>)(Cast|Director:|Fun\\sStuff|Genre:|Plot:|Runtime:|Tagline:|Writers:)"
+ "|href=\"[\\w\\d/]+?(Genres|name|character)/([\\w]+?)/\".*?>([.\\-\\s\\w]+)</a>"
... |
I would not call 60 events per second high volume. At that low level of activity any socket processing method at all with be fine. I've handled 5,000 events per second on a single thread using hardware that's much less capable than current machines, just using select.
I will say that if you are looking to scale, h... |
You mean like:
* {
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p, blockquote, form, label, ul, ol, dl, fieldset, address {
margin-bottom: 1em;
}
? |
You mean like:
* {
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p, blockquote, form, label, ul, ol, dl, fieldset, address {
margin-bottom: 1em;
}
?
Actually, sorry I mis-read your question, you're after something more like Eric Meyer's total reset @ [http://meyerw... |
The Sun Java tutorials are pretty. I cannot vouch specifically for the Swing one as it has been ages since I've done any Swing development and I have not read it myself.
[Creating a GUI with JFC/Swing][1]
[1]: http://java.sun.com/docs/books/tutorial/uiswing/ |
The Sun Java tutorials are pretty good. I cannot vouch specifically for the Swing one as it has been ages since I've done any Swing development and I have not read it myself.
[Creating a GUI with JFC/Swing][1]
[1]: http://java.sun.com/docs/books/tutorial/uiswing/ |
Message passing between objects - How to refer to the target object? |
|oop|message-passing| |
The most basic task in an object oriented environment is executing a method on an object. To do this, you have to have a reference to the object on which you are invoking the method. Is the proper way to establish this reference to pass the object as a parameter to the constructor (or initializer method) of the calling... |
YUI provides a base CSS file that will give consistent styles across all 'A-grade' browsers. They also provide a CSS reset file, so you could use that as well, but you say you've already reset the CSS. For further details go to the [YUI website](http://developer.yahoo.com/yui/base/). This is what I've been using and... |
Private vs. Public members in practice (how important is encapsulation?) |
|encapsulation| |
One of the biggest advantages of object-oriented programming is encapsulation, and one of the "truths" we've (or, at least, I've) been taught is that members should always be made private and made available via accessor and mutator methods, thus ensuring the ability to verify and validate the changes.
I'm curious, t... |
<p>Well, after lots of further work, I decided I didn't need to access my diagram **from within** a custom DirectiveProcessor.</p>
<p>I've still got a custom DirectiveProcessor because the standard generated one doesn't load the existing diagram when it loads the domain model.</p>
<p>Getting a custom DirectiveProcess... |
How to compute the critical path of a directional acyclic graph? |
|algorithm| |
What is the best (regarding performance) way to compute the critical path of a directional acyclic graph when the nodes of the graph have weight?
For example, if I have the following structure:
Node A (weight 3)
/ \
Node B (weight 4) Node D (weight 7)
... |
|algorithm|graph-theory| |
Use this one:
.nav ul li {
list-style: none;
}
or
.links li {
list-style: none;
}
it should works... |
Hojou,
It seems that is the only way to add a bookmark for Firefox. So FF needs to land in the first branch to have anything happening at all. I Googled some more but I'm really getting the idea this is impossible to properly address in FF... |
Use XPath?
http://www.w3schools.com/XPath/default.asp |
Quicksilver is still alive and well. There are at least a couple of endeavours to keep it going, up to date and restructure and clean up the code base. Check out the [code](http://code.google.com/p/blacktree-alchemy/) from Google Code.
As for launching apps, not even Spotlight comes close to how fast it is in Quicks... |
The file icons are held in the registry. It's a little convoluted but it works something like
- Take the file extension and lookup
the registry entry for it, for
example .DOC Get the default value
for that registry setting,
"Word.Document.8"
- Now lookup that
value in the registry.
... |
Clock ticks should be predictable, but on most PC hardware - *because* they're not designed for real-time systems - other I/O device interrupts have priority over the clock tick interrupt, and some drivers do extensive processing in the interrupt service routine rather than defer it to a [deferred procedure call](http:... |
I also like [notepad++][1].
[1]: http://notepad-plus.sourceforge.net/uk/site.htm |
This is why, whenever you are editing data by hand, you should BEGIN TRAN, edit your data, check that it looks good (for instance that you didn't delete more data than you were expecting) and then END TRAN. If you're using Postgres then you want to create lots of savepoints as well so that a typo doesn't wipe out your... |
You store a SHA1 hash of the password in your properties file. Then when you validate a users password, you hash their login attempt and make sure that the two hashes match.
This is the code that will hash some bytes for you. You can easily ger bytes from a String using the getBytes() method.
/**
* R... |
You store a SHA1 hash of the password in your properties file. Then when you validate a users password, you hash their login attempt and make sure that the two hashes match.
This is the code that will hash some bytes for you. You can easily ger bytes from a String using the <code>getBytes()</code> method.
/... |
I think you can just do an explicit try-catch in your test code instead of relying on the ExpectedException attribute to do it for you. Then you can come up with some helper method that will read the resource file and compare the error message to the one that comes with the exception that was caught. (of course if ther... |
How can I test for an expected exception with a specific exception message in Visual Studio Test? |
|visual-studio|unit-testing|internationalization|exception| |
Visual Studio Test can check for expected exceptions using the ExpectedException attribute. You can pass in an exception like this:
[TestMethod]
[ExpectedException(typeof(CriticalException))]
public void GetOrganisation_MultipleOrganisations_ThrowsException()
You can also check for the message conta... |
How can I test for an expected exception with a specific exception message from a resource file in Visual Studio Test? |
|visual-studio|unit-testing|exception|internationalization| |
If you switch over to using the very nice [xUnit.Net][1] testing library, you can replace [ExpectedException] with something like this:
[Fact]
public void TestException()
{
Exception ex = Record.Exception(() => myClass.DoSomethingExceptional());
// Assert whatever you like about the exc... |
There is an example of doing what you describe in the MSDN documentation for the [GetGenericTypeDefinition method][1]. It uses the [GetGenericArguments method][2].
Type[] typeArguments = t.GetGenericArguments();
Console.WriteLine("\tList type arguments ({0}):", typeArguments.Length);
foreach (Type tPa... |
Of course there is a way but it would require server-side support. There is no magical one size fits all methodology that I know of. |
@GarryShutler
I actually unittest email by using a fake smtp server (Wiser). Makes sure you application code is correct:
http://maas-frensch.com/peter/2007/08/29/unittesting-e-mail-sending-using-spring/
Something like that could probably be done for other servers. Otherwise you should be able to mock the API.... |
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public static DataTable objDataTable = new DataTable("UpdateAddress");
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
... |
Tightly coupling your data model (entity beans) to your XML interface might not be the best idea in the world; it prevents you from changing one without changing the other.
I'm not 100% sure I understand what you are trying to do, but I think there is a way to instruct JAXB to extend classes rather than create new... |
Couldn't you have the app contact a server over https and download the password, after authenticating in some way of course? |
Some pre-screening would help reduce the number of distance computations you need to do in the average case.
Compute the distance between each pair of vertices such that one is a red vertex and one is a blue. Find those with the minimum distance (a full sort is not necessary, a heap structure would do).
For eac... |
Some pre-screening would help reduce the number of distance computations you need to do in the average case.
Find the the minimum distance between each pair of vertexes such that one is a red vertex and one is a blue. Call it *r*. The distance between the polygons is at most *r*. Construct a new region from the red... |
Some pre-screening would help reduce the number of distance computations you need to do in the average case.
Find the the minimum distance between each pair of vertexes such that one is a red vertex and one is a blue. Call it *r*. The distance between the polygons is at most *r*. Construct a new region from the red... |
This screening technique is intended to reduce the number of distance computations you need to perform in the average case, without compromising the accuracy of the result. It works on convex and concave polygons.
Find the the minimum distance between each pair of vertexes such that one is a red vertex and one is a ... |
What about first selecting the position of the players and goal and an equal length path and afterwards build a maze respecting the defined paths? If the paths do not intersect this should easily work, I presume |
I would approach this by setting the goal and each player's entry point, then generating paths of similar length for each of them to the goal. Then I would start adding false branches along these paths, being careful to avoid linking to other player's paths, or having a branch connect back to the path. So essentially e... |
You could use find along with the -exec flag in a single command line to do the job
find . -name "*.zip" -exec unzip {} \;
|
Weather web service for Europe? |
|web-services|rest|xml-rpc|provider|weather| |
We are looking for a reliable "current weather" web service for Europe, with city resolution. We only need the current weather.
Since it is for a commercial web site, we don't mind paying a reasonable fee for the service.
What are our options? What service would you recommend or avoid based on previous experienc... |
I have no idea what can cause this, but I would try to find out by subclassing QDrag, overwrite deleteLater() (well, reimplement it, but as it's a slot, it will get called anyway), use this instead of a QDrag and put a breakpoint in deleteLater(). |
I've found that the easiest way to have non-standard fonts on a website is to use [sIFR][1]
[1]: http://www.mikeindustries.com/blog/sifr/
It does involve the use of a Flash object that contains the font, but it degrades nicely to standard text / font if Flash is not installed.
The style is set in your CSS ... |
I've found that the easiest way to have non-standard fonts on a website is to use [sIFR][1]
[1]: http://www.mikeindustries.com/blog/sifr/
It does involve the use of a Flash object that contains the font, but it degrades nicely to standard text / font if Flash is not installed.
The style is set in your CSS ... |
I've found that the easiest way to have non-standard fonts on a website is to use **[sIFR][1]**
[1]: http://www.mikeindustries.com/blog/sifr/
It does involve the use of a Flash object that contains the font, but it degrades nicely to standard text / font if Flash is not installed.
The style is set in your ... |
While Nescio's [answer][1] (DoEvents) will work, it will cause your application to use 100% of one CPU. Sleep will make the UI unresponsive. What you need is a combination of the two, and the magic combination that seems to work best is:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Lon... |
How to install a masked package in Gentoo 2008? |
|installation|gentoo| |
I searched the net and handbook, but I only managed to learn what is the masked package, and not how to install it. I did find some commands, but they don't seem to work on 2008 (looking at it, it seems those are for earlier versions). I have something like this:
localhost ~ # emerge flamerobin
Calculating ... |
During my search for the right SCM, I found the following links to be of great help:
<ol>
<li><a href="http://better-scm.berlios.de/comparison/comparison.html">Better SCM Initiative : Comparison</a>. Comparison of about 26 version control systems.</li>
<li><a href="http://en.wikipedia.org/wiki/Comparison_of_re... |
During my search for the right SCM, I found the following links to be of great help:
<ol>
<li><a href="http://better-scm.berlios.de/comparison/comparison.html">Better SCM Initiative : Comparison</a>. Comparison of about 26 version control systems.</li>
<li><a href="http://en.wikipedia.org/wiki/Comparison_of_re... |
FTP, email and so forth can you test with a server emulation. It is difficult but possible.
Not testable are some error handling. In every code there are error handling that can never occur. For example in Java there must be catch many exception because it is part of a interface. But the used instance will never thr... |
how did you populate it? is the DataSource something useful like a BindlingList<T>?
If it is then something like:
BindingSource bindingSource = this.dataGridView1.DataSource as BindingSource;
//substitute your business object type for T
T entity = bindingSource.Current as T;
would get you the ent... |
how did you populate it? is the DataSource something useful like a BindlingList<T>?
If it is then something like:
BindingSource bindingSource = this.dataGridView1.DataSource as BindingSource;
//substitute your business object type for T
T entity = bindingSource.Current as T;
would get you the ent... |
Is it bad design to use table tags when displaying forms in html? |
|html|css|layout| |
So I keep hearing that div tags should be used for layout purposes and not table tags. So does that also apply to form layouts? I know a form layout is still a layout, but it seems like creating form layouts with divs requires plenty more html and css. So with that in mind, should forms layouts use div tags instead? |
|html|css|layout| |
It's certainly easier to use table than div to layout a table, but keep in mind that a table is supposed to mean something - it's presenting data in a regular way for the user to see, more than putting boxes on the screen in a given order. Generally, I think forms layouts should use divs to decide how the form element... |
You may have to drop the headers and footers from the GridView altogether and add them to the page as separate table elements. You will need to make sure each table cell in the header and footer tables have fixed widths that correspond to the widths of the cells in your GridView.
The GridView itself would probably ... |
It looks like you're describing three cases here.
1. Case 1 - maintenance scripts. Risk can be minimized by developing them and testing them in an environment other than your production box. For quick maintenance, do the maintenance in a single transaction, and check everything before committing. If you made a mist... |
**I would favour the standards based approach.** Put your version information (along with other useful publisher stuff such as build number, subversion revision number, author, company details, etc) in the jar's [Manifest File][1].
This is a well documented and understood Java specification. Strong tool support ... |
**I would favour the standards based approach.** Put your version information (along with other useful publisher stuff such as build number, subversion revision number, author, company details, etc) in the jar's [Manifest File][1].
**This is a well documented and understood Java specification.** Strong tool supp... |
There is an example of doing what you describe in the MSDN documentation for the [GetGenericTypeDefinition method][1]. It uses the [GetGenericArguments method][2].
Type[] typeArguments = t.GetGenericArguments();
Console.WriteLine("\tList type arguments ({0}):", typeArguments.Length);
foreach (Type tPa... |
You might want to take a look at FOP, which stands for Formatting Objects Processor. It can generate PDF files on linux since it is Java based. From their site:
> Apache FOP (Formatting Objects Processor) is a print formatter driven
> by XSL formatting objects (XSL-FO) and an output independent formatter.
> It is... |
How do I connect to a USB webcam in .NET? |
|c#|.net|webcam|camera|image-capture| |
I want to connect to a USB Webcam in .NET, specifically using C#. Being new to .NET I don't know what kind of support there is in the standard libraries for doing so. I found one example on the web that copies bitmaps through the clipboard, but that seems very hacky (and probably slow). Is there a better way? |
I prefer http://www.jungledisk.com/ .
It's based on Amazon S3, cheap, multiplatform, multiple machines with a single license. |
[Scott Hanselman][1] recommends Windows Home Server in his aptly titled post
[The Case of the Failing Disk Drive or Windows Home Server Saved My Marriage][2].
[1]: http://stackoverflow.com/users/6380/scott-hanselman
[2]: http://www.hanselman.com/blog/TheCaseOfTheFailingDiskDriveOrWindowsHomeServerSavedMyMar... |
You could create an service application and a non-service(normal) application and make them communicate through IPC (Mapped File, Pipes, MailSolts ... you name it).
This way you solve all the troubles.
NOTE: The same application can behave differently - when started as a process and when started by a user, but in... |
iPhone application : is-it possible to use a "double" slider to select a price range |
|iphone|user-interface|slider| |
I've found that the easiest way to have non-standard fonts on a website is to use **[sIFR][1]**
[1]: http://www.mikeindustries.com/blog/sifr/
It does involve the use of a Flash object that contains the font, but it degrades nicely to standard text / font if Flash is not installed.
The style is set in your ... |
> If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out there, what experiences do you have with them?
The key word in your sentence is 'potentially'. I think you really need ... |
Some libraries support 64 bits extensions, indeed, but there doesn't seem to be a standard. [xmlrpc-c](http://xmlrpc-c.sourceforge.net/), for example, has a so called i8 but it doesn't work with python (at least not by default).
I would recommend to either:
- Convert the integer to string by hand and send it as... |