instruction stringlengths 0 30k ⌀ |
|---|
|css|firefox| |
I can make Firefox not display the ugly dotted focus outlines on <b>links</b> with this:
<pre><code>a:focus {
outline: none;
}
</code></pre>
But how can I do this for `<button>` tags as well? When I do this:
<pre><code>button:focus {
outline: none;
}
</code></pre>
the buttons still have the dotted focus... |
I can make Firefox not display the ugly dotted focus outlines on <b>links</b> with this:
<pre><code>a:focus {
outline: none;
}
</code></pre>
But how can I do this for `<button>` tags as well? When I do this:
<pre><code>button:focus {
outline: none;
}
</code></pre>
the buttons still have the dotted focus... |
For Zip Compression, have you seen http://www.icsharpcode.net/OpenSource/SharpZipLib/ |
I think [Python Challenge][1] is great.
It's not about learning Python (syntax) but presents you small and fun riddles. Solving the riddles is based on Python but you can use whatever fits (your calculator, bash scripts, Perl...). After you solved one, you get to see how others have solved it and can discuss the pr... |
You may consider using the mciSendString(...) function (error checking is omitted for clarity):
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace Sound
{
public static class SoundInfo
{
[DllImport("winmm.dll")]
p... |
Is there a way to override the empty constructor in a class generated by LINQtoSQL? |
|c#|.net|linq|linq-to-sql| |
If I have a table in my database called 'Users', there will be a class generated by LINQtoSQL called 'User' with an already declared empty constructor.
What is the best practice if I want to override this constructor and add my own logic to it? |
If you were using C++ and the Win32 directly then I'd suggest that you read up about overlapped I/O and I/O Completion ports. I have a free C++, IOCP, client/server framework with complete source code form on my blog, see here: <a href="http://www.lenholgate.com/archives/000637.html">http://www.lenholgate.com/archives/... |
If you were using C++ and the Win32 directly then I'd suggest that you read up about overlapped I/O and I/O Completion ports. I have a free C++, IOCP, client/server framework with complete source code on my blog, see here: <a href="http://www.lenholgate.com/archives/000637.html">http://www.lenholgate.com/archives/00063... |
I already had my share of problems with JPA and timestamps. I've been reading in the [oracle forums][1] and please check the following:
- The field in the database should be TIMESTAMP_TZ and not just TIMESTAMP
- Try adding the annotation @Temporal(value = TemporalType.TIMESTAMP)
- If you don't really need th... |
In the OnLoad event of the form, you could always explicitly set the location of each section. If starting at the top left with the first and assuming an array with the images in order:
images[0].Location = new Point(0,0);
for (int i = 1; i < images.Length; i++)
{
images[i].Location = new Point(... |
google maps traffic info |
|google-maps| |
Google maps in some region can serve traffic information showing the blocked roads and so on. I was wondering if there is any code example demonstrating how can I serve traffice information for my own region. |
Not specifically for this issue but: [FirePHP][1]?
[1]: http://www.firephp.org/ |
MasterCard: 5431111111111111
Amex: 341111111111111
Discover: 6011601160116611
American Express (15 digits) 378282246310005
American Express (15 digits) 371449635398431
American Express Corporate (15 digits) 378734493671000
Diners Club (14 digits) 30569309025904
Diners Club (14 digits) 38520000023237
... |
<pre>
MasterCard: 5431111111111111
Amex: 341111111111111
Discover: 6011601160116611
American Express (15 digits) 378282246310005
American Express (15 digits) 371449635398431
American Express Corporate (15 digits) 378734493671000
Diners Club (14 digits) 30569309025904
Diners Club (14 digits) 385200000... |
Just rolling out a WPF LOB application to about 400 municipal locations. Not heavy on the eye-candy but very heavy on databinding.
WPF is custom made for LOB!
Many drawbacks (ie no refactoring) were recently fixed in SP1, but tools are still, to put it mildly, retarded.
I find that ironic seeing that XAML was ... |
check the max_packet setting in your my.cnf file. this determines the largest amount of data you can send to your mysql server in a single statement. exceeding this values results in that error. |
If you really have to do this, regular expressions are probably the best solution.
I would strongly recommend that you think about why you have to do this, though - at least some of the characters your listing as undesirable are perfectly valid and useful in other languages, and just filtering them out will most lik... |
Backups alone aren't enough. You should be keeping a detailed system log of all configuration changes you make to the system so that you can reproduce your configuration elsewhere. Ideally, perform the changes on a local VM, then write a script to perform those changes automatically, then run those scripts on the liv... |
Vb6
<pre><code>
Public Property Let x(ByVal y As Long)
x = y
End Property
Private Sub Class_Initialize()
x = 0
End Sub
</code></pre>
|
Join multiple XML files with xinclude tags into single file |
|java|xml|installation|izpack|xinclude| |
I am creating an installer in IzPack. It is quite large, and I have broken up my XML files appropriately using <xinclude> and <xfragment> tags. Unfortunately, IzPack does not combine them together when you build your installer. This requires you to package the files with the installer, which just won't work... |
Jay,
You are seeing designed behavior. To limit opportunities for malicious behavior, scripts running in tabbed windows cannot affect other tabs.
For more information, please see Tabbed Browsing for Developers at http://msdn.microsoft.com/en-us/library/ms537636.aspx :
"The ability to open multiple documents w... |
If it's a real GUI-having end user application you should ignore the lanaguage in which you wrote the program (Java) and use a native installer for each of your chosen platforms. Mac folks want a .dmg and on windows a .msi or a .exe installer is the way to go. On Windows I prefer NSIS from NullSoft only because it's ... |
It seems that is someone else altering the other stored procedure and you need something to effectively check on the results no matter the changes to such procedure.
Create a tempt table and insert the result from that procedure in it.
Then you can perform a row count on the results. It is not the most efficient ... |
`this` corresponds to the context for the function call. For functions not called as part of an object (no `.` operator), this is the global context (`window` in web pages). For functions called as object methods (via the . operator), it's the object.
But, you can make it whatever you want. All functions have .call(... |
What does COINIT_SPEED_OVER_MEMORY do? |
|com| |
When calling `CoInitializeEx`, you can specify the following values for `dwCoInit`:
typedef enum tagCOINIT {
COINIT_MULTITHREADED = 0x0,
COINIT_APARTMENTTHREADED = 0x2,
COINIT_DISABLE_OLE1DDE = 0x4,
COINIT_SPEED_OVER_MEMORY = 0x8,
} COINIT;
What does the suggesti... |
Win+D, Win+R, Win+E, Win+1 (Firefox) |
mspdbsrv.exe is the process Visual Studio uses to create .pdb files when you compile; these are the symbol files that let you debug an application. Sometimes it goes berserk and doesn't shutdown correctly when you exit Visual Studio. I've had this cause bad compiles even after quitting and restarting Visual Studio. ... |
I'm not sure which version of Crystal Reports you are using, but if it is XIR2 or earlier then this isn't possible. I haven't used the newer versions so I can't tell you. One thing that I've done to solve this in the past was to have the drill actually link to another report altogether. It depends on how your viewer... |
Change report data visibility based on rendering format in Reporting Services |
|sql-server|reporting-services|report| |
Is it possible to hide or exclude certain data from a report if it's being rendered in a particular format (csv, xml, excel, pdf, html).
The problem is that I want hyperlinks to other reports to not be rendered when the report is generated in Excel format - but they should be there when the report is rendered in HTML ... |
Tables are for outputting tabular data. Anything that you might display in a spreadsheet, columns of results, that kind of thing.
The suggestion of using CSS rather than tables is for columnar layouts, which weren't really actual tables. It was never intended to suggest that tables should be removed completely. |
Here is a blog post <a href="http://www.julienlecomte.net/blog/2007/08/13/">comparing various options</a>
basically Packer get initial compression , but if you are going to gzip the files before sending on the wire (and you should) YUI Compressor gets the best compression.
The tests were done on jQuery code btw.... |
Here is a blog post <a href="http://www.julienlecomte.net/blog/2007/08/13/">comparing various options</a>
Basically <a href="http://dean.edwards.name/packer/">Packer</a> get initial compression , but if you are going to gzip the files before sending on the wire (and you should) <a href="http://www.julienlecomte.net... |
Here is a blog post <a href="http://www.julienlecomte.net/blog/2007/08/13/">comparing various options</a>
Basically <a href="http://dean.edwards.name/packer/">Packer</a> does a better job at initial compression , but if you are going to gzip the files before sending on the wire (and you should) <a href="http://www.... |
Here is a blog post <a href="http://www.julienlecomte.net/blog/2007/08/13/">comparing various options</a>
Basically <a href="http://dean.edwards.name/packer/">Packer</a> does a better job at initial compression , but if you are going to gzip the files before sending on the wire (and you should) <a href="http://www.... |
<del>A Csv file with Quoted fields, is not a Csv file. Far more things (Excel) output without quotes rather than with quotes when you select "Csv" in a save as.</del>
If you want one you can use, free, or commit to, here's mine that also does IDataReader/Record. It also uses DataTable to define/convert/enforce colum... |
I have all the private fields, then the public, then the constructors, then the main, then the methods that main calls, in the order they are called. |
Which framework should I use to write modules? |
|perl|module| |
What's the best framework for writing modules -- ExtUtils::MakeMaker (h2xs) or Module::Build? |
|perl|perl-module| |
Using 7zip from delphi |
|delphi|7zip| |
I would like to use the 7zip dlls from delphi but have not been able to find decent documentation or examples. Does anyone know how to use the 7zip dlls from delphi? |
And lets not forget the requirements that the "customer" of your solution must also have in place. If your writing a commercial application for a small companies, then Oracle might not be a good choice... but if your writing a customized solution for a large enterprise which must share data among multiple campuses, an... |
I've always done this by maintaining a "master" tree of the different servers' keys, and using rsync to update the remote machines. This lets you edit things in one location, push the changes out efficiently, and keeps things "up to date" -- everyone edits the master files, no one edits the files on random hosts.
Yo... |
Several ways to accomplish that but be aware that your DB **date_format option** & **date_order option** settings could affect the incoming format:
Select
cast('2008-09-16' as date)
convert(date,'16/09/2008',103)
date('2008-09-16')
from dummy
; |
I've found that Access database files almost always get corrupted over time. Compacting and repairing them helps hold that off for a while. |
If you are intending to use custom exception types to be thrown across the remoting boundray, be sure to mark these types as "[Serializable]". I can't remember the exact error message, but it perplexed me for the better part of a day the first time I saw it.
Also, just a tip, TargetInvocationException often has the... |
The whole life-cycle thing in general.
Not that I see anything wrong with it, it's just that you'd be amazed at the number of people who start working on large ASP.Net projects _before_ understanding it, rather than vice versa. Hence, it becomes a gotcha.
Note that I said _large_ projects: I think the best way t... |
Tools to you test/debug/fix PHP concurrency issues? |
|php|concurrency|memcached| |
I find myself doing some relatively advanced stuff with memcached in PHP. It's becoming a mental struggle to think about and resolve race conditions and concurrency issues caused by the lock-free nature of the cache.
PHP seems pretty poor in tools when it comes to concurrency (threads, anyone?), so I wonder if there... |
Tools to test/debug/fix PHP concurrency issues? |
First you go in and put an anchor tag with a name attribute in front of each footnote.
<a name="footnote1">Footnote 1</a>
<div>blah blah about stuff</div>
This anchor tag will not be a link. It will just be a named section of the page. Then you make the footnote marker a tag that refers to that named... |
Keep an eye on [Bort][1]. It is a base rails application which already has restful_authentication setup among other things. The guy doing it is planning on adding OpenID.
[1]: http://jimneath.org/2008/09/09/bort-base-rails-application/ |
I totally agree with Rich B, you need to look at where you are placing your application logic rather than trying to cludge the WinForms mechanisms. All of those operations and data that your Tasks form is exposing should really be in a separate class say some kind of Application Controller or something held by your mai... |
Here is a version that works in C/C++ that doesn't rely on integer sizes or have the overflow problem (i.e. x*y>=0 doesn't work)
bool SameSign(int x, int y)
{
return (x >= 0) ^ (y < 0);
}
Of course, you can geek out and template:
template <typename valueType>
bool SameSign(typen... |
I would say from a maintance stand point rewrite the code. It's going to bring the initial cost of the projet up but would be less labor intensive later for whoever is looking at the code. Like previous posters stated anything automated like this can't do as good as a job as a "real" programmer and doing line by line c... |
@Eridius' answer is the preferred way to do it. Requiring a process to register a name may have unintended side-effects such as increasing the visibility of the process not to mention the hassle of coming up with unique names when you have lots of processes. |
If you are talking UI frameworks, then you should be comparing Qt with the VCL, not the IDE (Delphi in this case). I know I'm being a stickler, but Delphi is the IDE, Object-Pascal is the language, and VCL is the graphical framework.
That being said, I don't think there is anything that even comes close to matching ... |
The place where <code>each</code> can cause you problems is that it's a true, non-scoped iterator. By way of example:
while ( my ($key,$val) = each %a_hash ) {
print "$key => $val\n";
last if $val; #exits loop when $val is true
}
# but "each" hasn't reset!!
while ( my ($key,$val) = each %a_hash ) {
... |
I'm reasonably certain you can't shift focus to another tab.
My understanding is this is done to somewhat limit pop ups and other malicious content from stealing the users focus. |
e => e.MoveNext() ? e.Current : null
This will advance the enumerator and return the current value, and return null when the enumeration is complete.
|
(a) Looks like you have some kind of filesystem problems; I'd recommend you run fsck and see if it finds anything
(b) Really not a programming-related question, so off-topic here. |
Log4net/ports of Log4xxx to other languages. It's open-source, pretty wide-spread, popular, has a good community behind, and isused widel (for example, in Hibernate/nHibernate). |
If you expect your method to fail occasionally, but don't consider that exceptional, I prefer this pattern as used in the .NET Framework:
bool TryMyFunction(out FunctionResult result){
//...
result = new FunctionResult();
} |
I guess you've meant:
[{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]
This would be sorted like this:
sorted(l,cmp=lambda x,y: cmp(x['name'],y['name'])) |
Konrad is right, C# uses dual return values all the time. But I kind of like the TryParse, Dictionary.TryGetValue, etc. methods in C#.
int value;
if (int.TryParse("123", out value)) {
// use value
}
instead of
int? value = int.TryParse("123");
if (value != null) {
// u... |
Same query, different revision of SQL spec. The query optimizer should come up with the same query plan for those. |
The best thing to do if you are running *AMP is to do what Thomas suggests and do virtual hosts in Apache. You can do this either with or without the redirect you describe.
Most likely you will want to do [name-based virtual hosts][1], as it's easiest to set up and only requires one IP address (so will also be easy ... |
The best thing to do if you are running *AMP is to do what Thomas suggests and do virtual hosts in Apache. You can do this either with or without the redirect you describe.
## Virtual hosts
Most likely you will want to do [name-based virtual hosts][1], as it's easiest to set up and only requires one IP address (so ... |
The benefit of CSS is that it separates design and layout from content.
If you have tabular data then it makes sense to use a `<TABLE>` tag. If you want to layout different blocks of content then you should use `<DIV>` or `<SPAN>` and CSS. |
Are you sure that this is a bottleneck? Have you done any performance analysis?
Try using the NetBeans profiler (its free and built into NB 6.1) to look at hotspots.
Finally, a JVM upgrade (say from 1.5->1.6) is often a cheap performance booster. Even an upgrade in build number can provide good performance boosts... |
My very simple and basic opinion on this is that tables are there for tabular data - not for positioning one thing on top or next to another element because you happen to like it being there.
So - if you want to display a table of data: do so (with a table). If you want to position content on the page: use css. |
Sadly, no. This is possible in Parallels on the Mac, in what they call "Coherence" mode. But Virtual PC does not support that kind of integration. |
Thanks for all the responses! This is ace :)
Based on OneByOne's answer (which looked the simplest to me), I added some non-capturing groups (the '(?:' parts - thanks to VonC for introducing me to non-capturing groups!), so the groups that do capture only contain the digits or * character.
^(?:(\d+)\.)?(?:(\... |
When Hibernate flushes a Session, how does it decide which objects in the session are dirty? |
|java|hibernate| |
My understanding of Hibernate is that as objects are loaded from the DB they are added to the Session. At various points, depending on your configuration, the session is flushed. At this point, modified objects are written to the database.
How does Hibernate decide which objects are 'dirty' and need to be written?
... |
For a lot of the protocols you could just search for "://" without the quotes. Not sure about the others though. |
Hosting a website on your own server |
|linux|dns|web-hosting| |
Is there a detailed guide which explains how to host a website on your own server on linux.
I have currently hosted it on one of the commerical web-hosts.
Also the domain is registered to a different vendor.
Thanks |
I'm gonna have to say [MediaInfo](http://mediainfo.sourceforge.net/en), I have been using it for over a year with a audio/video encoding application I'm working on. It gives all the information for wav files along with almost every other format.
[MediaInfoDll](http://sourceforge.net/project/showfiles.php?group_id=86... |
I recently started using the concepts, standards and templates defined by the [International Institute of Business Analysts][1] organization ([IIBA][2]).
They have a pretty good BOK (Book of Knowledge) that can be downloaded from their website. They do also have a certificate.
[1]: http://www.theiiba.org
... |
A simple example would be using `int** foo_mat` as a 2d array of integers.
Or you may also use pointers to pointers - lets say that you have a pointer `void* foo` and you have 2 different objects that have a reference to it with the following members: `void** foo_pointer1` and `void** foo_pointer2`, by having a pointe... |
Try:
import HTMLParser |
If you can distinguish by parameter count, then something like this would work:
Public Function Morph(ParamArray Args())
Select Case UBound(Args)
Case -1 '' nothing supplied
Morph = Morph_NoParams()
Case 0
Morph = Morph_One_Param(Args(0))
Case 1
... |
Combined SVN FTP system? |