Id int64 4 8.51M | PostTypeId int64 1 7 | AcceptedAnswerId int64 7 75.5M ⌀ | ParentId int64 4 41.8M ⌀ | Score int64 -208 27.7k | ViewCount int64 11 12.4M ⌀ | Body stringlengths 0 45k | Title stringlengths 2 150 ⌀ | ContentLicense stringclasses 3
values | FavoriteCount int64 0 225 ⌀ | CreationDate stringdate 2008-07-31 21:42:52 2011-12-14 18:48:47 | LastActivityDate stringdate 2008-08-01 12:19:17 2023-03-05 04:40:26 | LastEditDate stringdate 2008-08-01 13:54:25 2023-03-05 03:12:45 ⌀ | LastEditorUserId int64 -1 21.3M ⌀ | OwnerUserId int64 -1 21.1M ⌀ | Tags listlengths 1 6 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17,488 | 2 | null | 17,483 | 2 | null | > a compile time warning about hiding non-virtual inherited function X.
change your compiler settings to make it a error instead of warning.
| null | CC BY-SA 2.5 | null | 2008-08-20T06:55:12.573 | 2008-08-21T01:20:21.120 | 2008-08-21T01:20:21.120 | 350 | 350 | null |
17,493 | 2 | null | 17,483 | 0 | null | Unless you make the method virtual, the child class cannot override it. If you want to keep child classes from calling it, make it private.
So by default C++ does what you want.
| null | CC BY-SA 2.5 | null | 2008-08-20T06:57:47.247 | 2008-08-20T06:57:47.247 | null | null | 116 | null |
17,477 | 2 | null | 16,832 | 2 | null | Lately I became a strong believer in [Git](http://git.or.cz/) and its [interesting index pseudo repository](http://osteele.com/archives/2008/05/my-git-workflow). But if you do not need all the [fancy rebase --interactive](http://blog.madism.org/index.php/2007/09/09/138-git-awsome-ness-git-rebase-interactive) and stuff ... | null | CC BY-SA 2.5 | null | 2008-08-20T06:45:37.680 | 2008-08-20T06:45:37.680 | null | null | 1,814 | null |
17,475 | 2 | null | 17,228 | 5 | null | When I developed C++ code on linux, I used emacs as an editor and as a gdb front-end. Later, my company purchased [SlickEdit](http://www.slickedit.com/) for all of the programmers, which is a nice IDE, maybe not on a par with Visual Studio. We used gdb extensively, with the occasional use of valgrind and gprof. I highl... | null | CC BY-SA 2.5 | null | 2008-08-20T06:44:36.887 | 2008-08-20T06:44:36.887 | null | null | 1,702 | null |
17,487 | 2 | null | 17,483 | -2 | null | C++ methods are private and un-overridable by default.
- - `virtual`
Are you perhaps referring to overloading?
| null | CC BY-SA 2.5 | null | 2008-08-20T06:54:28.097 | 2008-08-20T06:54:28.097 | null | null | 338 | null |
17,486 | 2 | null | 17,483 | 15 | null | A couple of ideas:
1. Make your function private.
2. Do not make your function virtual. This doesn't actually prevent the function from being shadowed by another definition though.
Other than that, I'm not aware of a language feature that will lock away your function in such a way which prevents it from being over... | null | CC BY-SA 2.5 | null | 2008-08-20T06:53:40.533 | 2008-08-20T06:53:40.533 | null | null | 611 | null |
17,467 | 2 | null | 17,333 | 50 | null | For a more in depth approach read [Comparing floating point numbers](http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm). Here is the code snippet from that link:
```
// Usable AlmostEqual function
bool AlmostEqual2sComplement(float A, float B, int maxUlps)
{
// Make sure maxUlps... | null | CC BY-SA 2.5 | null | 2008-08-20T06:31:10.773 | 2008-08-20T06:31:10.773 | null | null | 486 | null |
17,499 | 2 | null | 17,434 | 32 | null | The canonical example is to overload operator<<. Another common use is to allow a helper or admin class access to your internals.
Here are a couple of guidelines I heard about C++ friends. The last one is particularly memorable.
- - -
| null | CC BY-SA 2.5 | null | 2008-08-20T07:05:04.030 | 2008-08-20T07:05:04.030 | null | null | 116 | null |
17,469 | 1 | 17,589 | null | 10 | 6,491 | Try loading [this normal .jpg file](http://www.zodiacwheels.com/images/wheels/blackout_thumb.jpg) in Internet Explorer 6.0. I get an error saying the picture won't load. Try it in any other browser and it works fine. What's wrong? The .jpg file is just a normal picture sitting on the web server. I can even create a sim... | IE6 - can't load a normal JPG | CC BY-SA 2.5 | null | 2008-08-20T06:34:31.640 | 2009-01-03T14:30:19.407 | 2008-09-10T00:13:41.410 | -1 | 432 | [
"internet-explorer",
"image",
"rgb",
"jpeg",
"cmyk"
] |
17,502 | 2 | null | 17,469 | 1 | null | The file is probably not a fully valid JPG and IE6/7/8 (I tested on IE8 and it wont load). Other browsers are a bit more defensive and can load it, but perhaps IE team choose not to load it as it could be invalid in a way that causes a security hole.
As Ryan Fox says, open it in an editor and re-save it ... where did ... | null | CC BY-SA 2.5 | null | 2008-08-20T07:11:25.933 | 2008-08-20T07:11:25.933 | null | null | 1,478 | null |
17,507 | 2 | null | 17,500 | 0 | null | I can't find any documentation that says you shouldn't use those methods directly, but I haven't looked very long.
Also you refer to the EditorVisibleAttribute, which doesn't exist. According to Reflector it's the [EditorBrowsableAttribute](http://msdn.microsoft.com/en-us/library/system.componentmodel.editorbrowsablea... | null | CC BY-SA 2.5 | null | 2008-08-20T07:22:02.960 | 2008-08-20T07:22:02.960 | null | null | 100 | null |
17,509 | 2 | null | 7,284 | 2 | null | I think the importance of the concept "Turing Complete" is in the the ability to identify a computing machine (not necessarily a mechanical/electrical "computer") that can have its processes be deconstructed into "simple" instructions, composed of simpler and simpler instructions, that a Universal machine could interpr... | null | CC BY-SA 3.0 | null | 2008-08-20T07:23:29.867 | 2012-11-10T10:17:08.797 | 2012-11-10T10:17:08.797 | 31,671 | 580 | null |
17,508 | 1 | null | null | 14 | 20,325 | > Note that this question continues from [Is it possible to coax Visual Studio 2008 into using italics for comments?](https://stackoverflow.com/questions/15414/)
If the long question title got you, here's the problem:
> How to convert the style property of the Consolas Italic font to Bold without actually modifying a... | How to modify the style property of a font on Windows? | CC BY-SA 2.5 | 0 | 2008-08-20T07:22:11.320 | 2022-07-26T12:28:05.203 | 2017-05-23T11:54:19.247 | -1 | 1,630 | [
"windows",
"fonts"
] |
17,513 | 2 | null | 11,359 | 2 | null | I've been experimenting with munin for monitoring around 8 Windows 2003 servers.
[http://munin.projects.linpro.no/](http://munin.projects.linpro.no/)
Its a free linux-based system and the Windows agent works well & is easily extensible. Setup is simple if you have some minimal linux knowledge.
| null | CC BY-SA 2.5 | null | 2008-08-20T07:29:28.310 | 2008-08-20T07:29:28.310 | null | null | 635 | null |
17,511 | 2 | null | 17,435 | 12 | null | I like to read Googler Steve Yegge's blog, and recently I came across [this article of his](http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html) where he argues that [Mozilla Rhino](http://www.mozilla.org/rhino) is a good solution for server-side JS. It's a somewhat sloppy transcript, you might prefer to wat... | null | CC BY-SA 2.5 | null | 2008-08-20T07:26:22.013 | 2009-10-07T09:15:03.487 | 2009-10-07T09:15:03.487 | 2,077 | 2,077 | null |
17,500 | 1 | 158,065 | null | 22 | 2,419 | The `System.Windows.Threading.DispatcherObject` class (which `DependencyObject` is based on) contains a useful function, called `CheckAccess()`, that determines whether or not the code is running on the UI thread.
When I wanted to use it yesterday, I was puzzled to find out that Intellisense didn't show the function (... | Why are DispatcherObject.CheckAccess() and VerifyAccess() hidden from Intellisense? | CC BY-SA 2.5 | 0 | 2008-08-20T07:07:30.030 | 2008-10-01T15:53:22.610 | 2008-08-20T07:23:29.523 | 2,074 | 2,074 | [
".net-3.5",
"intellisense"
] |
17,505 | 2 | null | 17,434 | 46 | null | [@roo](https://stackoverflow.com/questions/17434/when-should-you-use-friend-in-c#17460): Encapsulation is not broken here because the class itself dictates who can access its private members. Encapsulation would only be broken if this could be caused from outside the class, e.g. if your `operator <<` would proclaim “I'... | null | CC BY-SA 3.0 | null | 2008-08-20T07:16:26.810 | 2016-01-26T16:15:37.913 | 2017-05-23T12:34:45.403 | -1 | 1,968 | null |
17,533 | 1 | 90,442 | null | 27 | 15,030 | For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation.
So, how do I check if a path is UAC protected and then how do I request elevation mid-execution?
| Request Windows Vista UAC elevation if path is protected? | CC BY-SA 3.0 | 0 | 2008-08-20T07:50:29.350 | 2015-10-13T08:22:47.403 | 2015-10-13T08:22:47.403 | 206,730 | 1,147 | [
"c#",
".net",
"windows-vista",
"uac",
"elevated-privileges"
] |
17,527 | 2 | null | 17,483 | 8 | null | Sounds like what you're looking for is the equivalent of the Java language keyword that [prevents a method from being overridden by a subclass](http://java.sun.com/docs/books/tutorial/java/IandI/final.html).
As [others](https://stackoverflow.com/questions/17483/c-anyway-to-prevent-a-method-from-being-over-ridden-in-s... | null | CC BY-SA 2.5 | null | 2008-08-20T07:45:10.393 | 2008-08-20T07:45:10.393 | 2017-05-23T12:00:24.427 | -1 | 375 | null |
17,522 | 2 | null | 16,563 | 0 | null | To process the whole input string at once, use `preg_match_all()`
```
preg_match_all('/Seat (\d+): \w+ \((\d+) in chips\)/', $preg_match_all, $matches);
```
For your input string, var_dump of $matches will look like this:
```
array
0 =>
array
0 => string 'Seat 1: fabulous29 (835 in chips)' (length=33)
... | null | CC BY-SA 2.5 | null | 2008-08-20T07:35:46.483 | 2008-08-20T07:35:46.483 | null | null | 1,897 | null |
17,529 | 2 | null | 17,434 | 0 | null | You adhere to the strictest and purest OOP principles and ensure that no data members for any class even have so that all objects be the only ones that can know about their data with the only way to act on them is through indirect , i.e., methods.
But even C# has an visibility keyword and Java has its default lev... | null | CC BY-SA 2.5 | null | 2008-08-20T07:46:14.120 | 2008-08-20T07:46:14.120 | null | null | 1,659 | null |
17,542 | 2 | null | 17,532 | 5 | null | I say go ahead with the custom rendered control. I find that in most cases the composite can be easier done and used in a UserControl, but anything beyond that and you'd need to have a finer degree of control (pun unintended) to merit your own rendering strategy.
There maybe controls that are simple enough to merit a ... | null | CC BY-SA 2.5 | null | 2008-08-20T07:53:32.230 | 2008-08-20T07:53:32.230 | null | null | 372 | null |
17,544 | 2 | null | 17,533 | 17 | null | Requesting elevation mid-execution requires that you either:
1. Use a COM control that's elevated, which will put up a prompt
2. Start a second process that is elevated from the start.
In .NET, there is currently no way to elevate a running process; you have to do one of the hackery things above, but all that does... | null | CC BY-SA 2.5 | null | 2008-08-20T07:56:07.667 | 2008-08-20T07:56:07.667 | null | null | 1,975,282 | null |
17,548 | 2 | null | 17,098 | 0 | null | Why should WS-* be transport dependant?
The whole point of the WS-* specifications is that they are part of the message, and hence transport independent.
| null | CC BY-SA 2.5 | null | 2008-08-20T07:58:25.743 | 2008-08-20T07:58:25.743 | null | null | 1,908 | null |
17,521 | 2 | null | 5,269 | 0 | null | [@csmba](https://stackoverflow.com/questions/5269/c-logic-order-and-compiler-behavior#5278):
> It was asked in a followup why or when would anyone use And instead of AndAlso (or & instead of &&): Here is an example:```
if ( x.init() And y.init()) then
x.process(y)
end
y.doDance()
```
In this case, I want to init bo... | null | CC BY-SA 2.5 | null | 2008-08-20T07:35:22.897 | 2008-08-20T07:35:22.897 | 2020-06-20T09:12:55.060 | -1 | 1,968 | null |
17,557 | 2 | null | 17,533 | 1 | null | You may want to notify the user that the path is protected and ask them to output the file to a "safer" area. This way your app will not need elevation. I'm sure it depends on your users and what you are trying to do, however I don't think it's too much to kindly let the user know you don't feel ok dumping xyz into t... | null | CC BY-SA 2.5 | null | 2008-08-20T08:07:10.917 | 2008-08-20T08:07:10.917 | null | null | 580 | null |
17,550 | 2 | null | 10,658 | 12 | null | The easiest way I've found of doing this is to markup your HTML using [microformats](http://microformats.org/).
If you're looking to generate iCalendar files then you could use the [hCalendar microformat](http://microformats.org/wiki/hcalendar) then include a link such as 'Add to Calendar' that points to:
[http://f... | null | CC BY-SA 2.5 | null | 2008-08-20T08:02:15.577 | 2008-08-20T08:02:15.577 | null | null | 1,904 | null |
17,555 | 2 | null | 14,155 | 3 | null | Notepad2, apart from Notepad++
| null | CC BY-SA 2.5 | null | 2008-08-20T08:05:22.933 | 2008-08-20T08:05:22.933 | null | null | 1,897 | null |
17,561 | 1 | 17,616 | null | 7 | 800 | Can anyone suggest some good browser add-on tools/extensions to help with development?
I have firebug installed in Firefox which is great for dealing with CSS, HTML and javascript; any other suggestions?
[Firebug](https://addons.mozilla.org/en-US/firefox/addon/1843)
| Recommendations for browser add-on tools to help with development | CC BY-SA 2.5 | 0 | 2008-08-20T08:09:38.010 | 2011-07-28T01:52:13.367 | 2009-09-26T16:45:43.483 | 1,288 | 1,762 | [
"browser"
] |
17,546 | 2 | null | 17,532 | 1 | null | I often use composite controls. Instead of overriding Render or RenderContents, just assign each Control a CssClass and use stylesheets. For multiple Controls.Add, I use an extension method:
```
//Controls.Add(c1, c2, c3)
static void Add(this ControlCollection coll, params Control[] controls)
{ foreach(Control contro... | null | CC BY-SA 2.5 | null | 2008-08-20T07:56:49.007 | 2008-08-20T08:02:18.900 | 2008-08-20T08:02:18.900 | 1,659 | 1,659 | null |
17,570 | 2 | null | 14,155 | 3 | null | Visual Studio for .Net development. Currently working with VS2008, but seems to be not quite finished yet. 2005 is probably the most stable and complete. Anything else for that would seem quite futile for .Net development
I use e-TextEditor for most other things. It covers most of the topics above including syntax... | null | CC BY-SA 2.5 | null | 2008-08-20T08:13:10.840 | 2008-08-20T08:13:10.840 | null | null | 274 | null |
17,567 | 2 | null | 17,561 | 2 | null | The other must-have for Firefox is Chris Pederick's [Web Developer Toolbar](http://chrispederick.com/work/web-developer/).
| null | CC BY-SA 2.5 | null | 2008-08-20T08:11:36.150 | 2008-08-20T08:11:36.150 | null | null | 1,450 | null |
17,564 | 2 | null | 14,155 | 3 | null | Visual Studio, notepad2, notepad++.
| null | CC BY-SA 2.5 | null | 2008-08-20T08:10:25.417 | 2008-08-20T08:10:25.417 | null | null | 1,688,440 | null |
17,562 | 2 | null | 17,435 | 5 | null | > Why would you want to process
something in Javascript when you can
process it in PHP or ASP.NET which are
designed specifically for this task?
Perhaps because JavaScript is a more powerful programming language than those two? For example, it has functions as first-class data types and support for closures.
St... | null | CC BY-SA 2.5 | null | 2008-08-20T08:09:46.107 | 2008-08-20T08:09:46.107 | null | null | 1,450 | null |
17,569 | 2 | null | 17,561 | 1 | null | and for Opera:
[http://dev.opera.com/tools/](http://dev.opera.com/tools/)
Awesomeness is that these are bookmarklets implemented with JS. Suckiness is that they require the Internetz.
| null | CC BY-SA 2.5 | null | 2008-08-20T08:13:09.140 | 2008-08-20T08:13:09.140 | null | null | 227 | null |
17,535 | 2 | null | 17,373 | 3 | null | > I don't know if Java has some built-in method for urlencoding the string, but this link [http://www.permadi.com/tutorial/urlEncoding/](http://www.permadi.com/tutorial/urlEncoding/) shows some of the most common chars to encode:
For percent-encoding mailto URI hnames and hvalues, I use the rules at [http://shadow2531... | null | CC BY-SA 2.5 | null | 2008-08-20T07:51:04.857 | 2008-08-20T07:51:04.857 | null | null | 1,697 | null |
17,577 | 2 | null | 17,576 | 5 | null | Would not make sense. An Interface is a contract with the that you support those methods and properties. Stick with abstract classes.
| null | CC BY-SA 2.5 | null | 2008-08-20T08:15:40.163 | 2008-08-20T08:15:40.163 | null | null | 227 | null |
17,532 | 1 | 17,542 | null | 19 | 4,166 |
## Summary
Hi All,
OK, further into my adventures with custom controls...
In summary, here is that I have learned of three main "classes" of custom controls. Please feel free to correct me if any of this is wrong!
1. UserControls - Which inherit from UserControl and are contained within an ASCX file. These are pret... | ASP.NET Custom Controls - Composites | CC BY-SA 2.5 | 0 | 2008-08-20T07:49:06.967 | 2017-04-20T15:22:37.347 | 2020-06-20T09:12:55.060 | -1 | 832 | [
"c#",
".net",
"asp.net",
"user-controls",
"controls"
] |
17,574 | 2 | null | 14,397 | 0 | null | I've answered a similar question in a StackOverflow [Version Control Structure question](https://stackoverflow.com/questions/16829/structure-of-projects-in-version-control#16915). It actually fits even better here since we do heavy OSGi development and have lots of bundles. I must echo Anders Sandvig comments: keep tru... | null | CC BY-SA 2.5 | null | 2008-08-20T08:13:59.340 | 2008-08-20T08:13:59.340 | 2017-05-23T12:13:37.900 | -1 | 1,996 | null |
17,576 | 1 | null | null | 34 | 37,997 | In C#, when you implement an interface, all members are implicitly public. Wouldn't it be better if we could specify the accessibility modifier (`protected`, `internal`, except `private` of course), or should we just use an abstract class instead?
| Non Public Members for C# Interfaces | CC BY-SA 4.0 | 0 | 2008-08-20T08:14:06.610 | 2018-07-26T23:48:32.030 | 2018-07-26T23:48:32.030 | 1,171,702 | 718 | [
"c#",
".net",
"interface"
] |
17,579 | 2 | null | 17,576 | 1 | null | Interfaces do not have access modifiers in their methods, leaving them open to whichever access modifier is appropriate. This has a purpose: it allows other types to infer what methods and properties are available for an object following an interface. Giving them protected/internal accessors defeats the purpose of an i... | null | CC BY-SA 2.5 | null | 2008-08-20T08:16:33.203 | 2008-08-20T08:22:50.927 | 2008-08-20T08:22:50.927 | 372 | 372 | null |
17,580 | 2 | null | 17,576 | 0 | null | I'm familiar with Java rather than C#, but why an earth would you want a private member within an interface? It couldn't have any implementation and would be invisible to implementing classes, so would be useless. Interfaces exist to specify behaviour. If you need default behaviour than use an abstract class.
| null | CC BY-SA 2.5 | null | 2008-08-20T08:17:08.430 | 2008-08-20T08:17:08.430 | null | null | 1,450 | null |
17,589 | 2 | null | 17,469 | 29 | null | The JPG you uploaded is in [CMYK](http://en.wikipedia.org/wiki/Cmyk), IE and Firefox versions before 3 can't read these. Open it using Photoshop (or anything similar, I'm sure GIMP would work too) and resave it in [RGB](http://en.wikipedia.org/wiki/Rgb).
edit: Further Googling makes me suspect that CMYK isn't really a... | null | CC BY-SA 2.5 | null | 2008-08-20T08:24:28.270 | 2008-10-28T14:22:42.860 | 2008-10-28T14:22:42.860 | 914 | 914 | null |
17,586 | 1 | null | null | 34 | 48,605 | Word wrap is one of the must-have features in a modern text editor.
How word wrap be handled? What is the best algorithm for word-wrap?
If text is several million lines, how can I make word-wrap very fast?
Why do I need the solution? Because my projects must draw text with various zoom level and simultaneously beaut... | Best word wrap algorithm? | CC BY-SA 4.0 | 0 | 2008-08-20T08:19:29.640 | 2021-01-14T00:05:25.457 | 2019-04-28T22:12:25.740 | 63,550 | 1,556 | [
"algorithm",
"word-wrap"
] |
17,594 | 2 | null | 17,469 | 2 | null | You can use jpeginfo to find out if a jpeg file is OK or not.
> $jpeginfo -c blackout_thumb.jpgblackout_thumb.jpg 240 x 240 32bit
Exif N 595116 Unsupported color
conversion request [ERROR]
In your case the file is corrupted which explain why some browsers cannot display it.
| null | CC BY-SA 2.5 | null | 2008-08-20T08:30:53.043 | 2008-08-20T08:30:53.043 | 2020-06-20T09:12:55.060 | -1 | 238 | null |
17,598 | 2 | null | 17,576 | 21 | null | You can hide the implementation of an interface by explicitly stating the interface name before the method name:
```
public interface IInterface {
public void Method();
}
public class A : IInterface {
public void IInterface.Method() {
// Do something
}
}
public class Program {
public static v... | null | CC BY-SA 3.0 | null | 2008-08-20T08:32:47.080 | 2017-04-20T07:39:25.077 | 2017-04-20T07:39:25.077 | 4,380,409 | 1,908 | null |
17,593 | 2 | null | 17,320 | 1 | null | Go as deep as you can starting off in one environment, win32, .net, Java, Objective C... whatever.
It is important to build the deep understanding of how X works... so that you can translate the same concepts into other languages or platforms/environments, if you so desire.
"Are there any areas of specialization ... | null | CC BY-SA 2.5 | null | 2008-08-20T08:29:15.560 | 2008-08-20T08:29:15.560 | null | null | 580 | null |
17,597 | 2 | null | 17,434 | 3 | null | To do TDD many times I've used 'friend' keyword in C++.
Can a friend know everything about me?
---
Updated: I found this valuable answer about "friend" keyword from [Bjarne Stroustrup site](http://www.research.att.com/~bs/bs_faq2.html).
> "Friend" is an explicit mechanism for granting access, just like membershi... | null | CC BY-SA 2.5 | null | 2008-08-20T08:32:26.583 | 2010-08-27T21:11:59.020 | 2010-08-27T21:11:59.020 | 71,131 | 1,556 | null |
17,602 | 2 | null | 17,561 | 2 | null | You should definitely install Safari. It has a number of tools built-in. I use it in combination with other browsers all the time.
- - - -
Plus it lets you set the user agent for your requests.
Consider this, it has a separate top-level menu called .
| null | CC BY-SA 2.5 | null | 2008-08-20T08:36:19.023 | 2008-08-20T08:36:19.023 | null | null | 380 | null |
17,588 | 2 | null | 17,561 | 9 | null | For Firefox:
[Firebug](http://getfirebug.com/) is awesome for investigation and development.
[Web Developer Toolbar](http://chrispederick.com/work/web-developer/) is good also. Really helps with CSS and page layout stuff as well as much more.
I also use [Live HTTP Headers](https://addons.mozilla.org/en-US/firefox/a... | null | CC BY-SA 2.5 | null | 2008-08-20T08:22:05.983 | 2008-08-20T08:27:20.090 | 2008-08-20T08:27:20.090 | 274 | 274 | null |
17,601 | 2 | null | 17,586 | 4 | null | With or without hyphenation?
Without it's easy. Just encapsulate your text as wordobjects per word and give them a method getWidth(). Then start at the first word adding up the rowlength until it is greater than the available space. If so, wrap the last word and start counting again for the next row starting with this... | null | CC BY-SA 4.0 | null | 2008-08-20T08:35:35.980 | 2019-04-28T22:14:20.413 | 2019-04-28T22:14:20.413 | 63,550 | 1,168 | null |
17,591 | 2 | null | 17,576 | 36 | null | If an interface is internal, all its members will be internal to the assembly. If a nested interface is protected, only the subclasses of the outer class could access that interface.
Internal members for an interface outside of its declaring assembly would be pointless, as would protected members for an interface outs... | null | CC BY-SA 3.0 | null | 2008-08-20T08:28:02.147 | 2017-08-26T13:31:20.613 | 2017-08-26T13:31:20.613 | 4,519,059 | 1,659 | null |
17,608 | 2 | null | 16,432 | 1 | null | Oh, and just for completeness, the following is a few ticks faster than normal concatenation:
```
Console.WriteLine(String.Concat(p.FirstName," ",p.LastName));
```
| null | CC BY-SA 2.5 | null | 2008-08-20T08:38:11.343 | 2008-08-20T08:38:11.343 | null | null | 1,908 | null |
17,609 | 1 | 17,617 | null | 5 | 6,663 | What is the most proper way to sending email of minimal 1000 or more in PHP? Any reliable email queuing technique that is capable to handle that?
| Email queueing in php | CC BY-SA 3.0 | 0 | 2008-08-20T08:38:24.803 | 2020-01-13T08:15:23.407 | 2017-07-10T20:01:45.093 | 7,750,640 | null | [
"php",
"email",
"queue"
] |
17,603 | 2 | null | 17,586 | 6 | null | I don't know of any specific algorithms, but the following could be a rough outline of how it should work:
1. For the current text size, font, display size, window size, margins, etc., determine how many characters can fit on a line (if fixed-type), or how many pixels can fit on a line (if not fixed-type).
2. Go thro... | null | CC BY-SA 4.0 | null | 2008-08-20T08:36:32.703 | 2019-11-21T11:32:19.893 | 2019-11-21T11:32:19.893 | 63,550 | 51 | null |
17,610 | 2 | null | 17,576 | 2 | null | An interface is a contract that all implementing classes adhere to. This means that they must adhere to all of it or none of it.
If the interface is public then every part of that contact has to be public, otherwise it would mean one to friend/internal classes and a different thing to everything else.
Either use an a... | null | CC BY-SA 2.5 | null | 2008-08-20T08:41:37.387 | 2008-08-20T08:41:37.387 | 2017-05-23T12:09:36.713 | -1 | 905 | null |
17,612 | 1 | 17,620 | null | 29 | 11,087 | Programmatic solution of course...
| How do you place a file in recycle bin instead of delete? | CC BY-SA 3.0 | 0 | 2008-08-20T08:43:00.393 | 2013-04-28T03:27:06.143 | 2013-04-28T03:27:06.143 | 1,012,641 | 580 | [
"c#",
".net",
"c++",
"windows",
"io"
] |
17,614 | 2 | null | 17,098 | 0 | null | WS-* is transport independant. That's the entire point.
Authentication really depends on who the desired consumers of your service are. Don't weigh down internal services with security that isn't required, and likewise it's useful to add extra layers of security if you need to know specific things about third party ... | null | CC BY-SA 2.5 | null | 2008-08-20T08:45:12.777 | 2008-08-20T08:45:12.777 | null | null | 1,297 | null |
17,617 | 2 | null | 17,609 | 6 | null | You could just insert your emails into a Mail Queue database table, and have a separate process check the queue and batch send a certain number at once.
| null | CC BY-SA 2.5 | null | 2008-08-20T08:46:49.933 | 2008-08-20T08:46:49.933 | null | null | 1,951 | null |
17,620 | 2 | null | 17,612 | 38 | null | [http://www.daveamenta.com/2008-05/c-delete-a-file-to-the-recycle-bin/](http://www.daveamenta.com/2008-05/c-delete-a-file-to-the-recycle-bin/)
From above:
```
using Microsoft.VisualBasic;
string path = @"c:\myfile.txt";
FileIO.FileSystem.DeleteDirectory(path,
FileIO.UIOption.OnlyErrorDialogs,
RecycleOption... | null | CC BY-SA 2.5 | null | 2008-08-20T08:48:07.073 | 2008-08-20T08:51:00.517 | 2008-08-20T08:51:00.517 | 1 | 1,816 | null |
17,624 | 1 | 17,627 | null | 11 | 25,612 | I have a table with a 'filename' column.
I recently performed an insert into this column but in my haste forgot to append the file extension to all the filenames entered. Fortunately they are all '.jpg' images.
How can I easily update the 'filename' column of these inserted fields (assuming I can select the recent ro... | What is the easiest way using T-SQL / MS-SQL to append a string to existing table cells? | CC BY-SA 2.5 | 0 | 2008-08-20T08:52:00.497 | 2012-07-22T12:58:51.037 | 2008-10-08T22:41:37.907 | 15,401 | 364 | [
"sql",
"sql-server",
"tsql"
] |
17,616 | 2 | null | 17,561 | 5 | null | Firefox:
- [Inspect This](https://addons.mozilla.org/en-US/firefox/addon/1913)- [Measure It](https://addons.mozilla.org/en-US/firefox/addon/539)- [IE View](https://addons.mozilla.org/en-US/firefox/addon/35)[Safari View](https://addons.mozilla.org/en-US/firefox/addon/4641)- [HTML Validator](https://addons.mozilla.org/e... | null | CC BY-SA 2.5 | null | 2008-08-20T08:46:13.537 | 2008-08-20T08:46:13.537 | null | null | 1,612 | null |
17,615 | 2 | null | 16,432 | 54 | null | Oh dear - after reading one of the other replies I tried reversing the order of the operations - so performing the concatenation first, then the String.Format...
```
Bill Gates
Console.WriteLine(p.FirstName + " " + p.LastName); took: 8ms - 30488 ticks
Bill Gates
Console.WriteLine("{0} {1}", p.FirstName, p.LastName); to... | null | CC BY-SA 4.0 | null | 2008-08-20T08:45:19.563 | 2021-07-11T15:59:52.900 | 2021-07-11T15:59:52.900 | 2,667,173 | 1,908 | null |
17,623 | 2 | null | 17,612 | 13 | null | The best way I have found is to use the VB function `FileSystem.DeleteFile`.
```
Microsoft.VisualBasic.FileIO.FileSystem.DeleteFile(file.FullName,
Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs,
Microsoft.VisualBasic.FileIO.RecycleOption.SendToRecycleBin);
```
It requires adding `Microsoft.VisualBasi... | null | CC BY-SA 2.5 | null | 2008-08-20T08:50:47.223 | 2008-08-22T07:00:22.230 | 2008-08-22T07:00:22.230 | 891 | 891 | null |
17,618 | 2 | null | 17,612 | 18 | null | You need to delve into unmanaged code. Here's a static class that I've been using:
```
public static class Recycle
{
private const int FO_DELETE = 3;
private const int FOF_ALLOWUNDO = 0x40;
private const int FOF_NOCONFIRMATION = 0x0010;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack... | null | CC BY-SA 2.5 | null | 2008-08-20T08:47:04.597 | 2008-08-20T08:57:26.100 | 2008-08-20T08:57:26.100 | 227 | 227 | null |
17,621 | 2 | null | 17,561 | 2 | null | In case of IE, next tools can be useful
- [Microsoft Developer Toolbar](http://www.microsoft.com/downloads/details.aspx?FamilyId=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en)- [Fiddler HTTP Debugger](http://www.fiddlertool.com/fiddler/)- [Instant source](http://www.blazingtools.com/is.html)- [Companion.JS](http... | null | CC BY-SA 3.0 | null | 2008-08-20T08:49:14.030 | 2011-07-28T01:52:13.367 | 2011-07-28T01:52:13.367 | 10,936 | 2,080 | null |
17,627 | 2 | null | 17,624 | 27 | null | The solution is:
```
UPDATE tablename SET [filename] = RTRIM([filename]) + '.jpg' WHERE id > 50
```
RTRIM is required because otherwise the [filename] column in its entirety will be selected for the string concatenation i.e. if it is a varchar(20) column and filename is only 10 letters long then it will still select... | null | CC BY-SA 2.5 | null | 2008-08-20T08:54:43.220 | 2008-08-20T08:54:43.220 | null | null | 364 | null |
17,633 | 2 | null | 17,609 | 0 | null | I've generally relied on a hack.
I have a database list of email addresses and then use a meta-redirect to self with an increasing 'offset' parameter that specifies which row in the database I am up to. Server redirects cause problems because browsers assume that the time taken indicates an infinite loop.
| null | CC BY-SA 2.5 | null | 2008-08-20T09:02:59.690 | 2008-08-20T09:02:59.690 | null | null | 364 | null |
17,637 | 2 | null | 14,697 | 3 | null | +1 UrlRewritingNET.URLRewrite -- used in several hundred services/portals/sites on a single box without issue for years! (@Jason -- that is the one you're talking about, right?)
and I've also used the URLRewriter.NET on a personal site, and found it, ah, interesting. @travis, you're right about the changed syntax, but... | null | CC BY-SA 2.5 | null | 2008-08-20T09:09:50.953 | 2008-08-20T09:09:50.953 | null | null | 1,677 | null |
17,636 | 2 | null | 17,624 | 6 | null | MattMitchell's answer is correct if the column is a CHAR(20), but is not true if it was a VARCHAR(20) and the spaces hadn't been explicitly entered.
If you do try it on a CHAR field without the RTRIM function you will get a error.
| null | CC BY-SA 3.0 | null | 2008-08-20T09:06:04.863 | 2012-07-22T12:58:32.893 | 2012-07-22T12:58:32.893 | 364 | 1,908 | null |
17,642 | 2 | null | 16,897 | 11 | null | I think you should have a good look at Delphi 2009.
Delphi 2009 has changes to the COM support, including a text-based replacement for the binary TLB files.
You can read more on [Chris Bensen's blog](http://chrisbensen.blogspot.com/2008/07/tiburn-sneak-peek-com_23.html).
| null | CC BY-SA 2.5 | null | 2008-08-20T09:16:37.427 | 2010-11-19T07:51:26.570 | 2010-11-19T07:51:26.570 | 6,244 | 1,737 | null |
17,638 | 2 | null | 17,170 | 24 | null | I would agree with Lee's advice for taking parameters, but not returning.
If you specify your methods to return an interface that means you are free to change the exact implementation later on without the consuming method ever knowing. I thought I'd never need to change from a List<T> but had to later change to use a ... | null | CC BY-SA 2.5 | null | 2008-08-20T09:12:08.903 | 2008-08-20T09:12:08.903 | null | null | 214 | null |
17,643 | 2 | null | 15,481 | 1 | null | As labels are so rarely useful, it appears, that there is no clear convention. The Java language specification has one example with labels and they are in non_cap.
But since they are so rare, in my opinion it is best, to think twice whether they are really the right tool.
And if they are the right tool, make them all... | null | CC BY-SA 2.5 | null | 2008-08-20T09:17:20.657 | 2008-08-20T09:17:20.657 | null | null | 1,870 | null |
17,648 | 2 | null | 16,926 | 1 | null | Another way to approach this is to standardise the id and class names you use in your HTML according to [some sort of naming convention](http://www.stuffandnonsense.co.uk/archives/whats_in_a_name_pt2.html).
| null | CC BY-SA 2.5 | null | 2008-08-20T09:21:04.593 | 2008-08-20T09:21:04.593 | null | null | 1,904 | null |
17,646 | 2 | null | 17,434 | 1 | null | > To do TDD many times I've used 'friend' keyword in C++.Can a friend know everything about me?
No, its only a one way friendship :`(
| null | CC BY-SA 2.5 | null | 2008-08-20T09:19:44.720 | 2008-08-20T09:19:44.720 | null | null | 716 | null |
17,629 | 2 | null | 17,624 | 4 | null | Nice easy one I think.
```
update MyTable
set filename = filename + '.jpg'
where ...
```
Edit: Ooh +1 to @MattMitchell's answer for the rtrim suggestion.
| null | CC BY-SA 3.0 | null | 2008-08-20T08:55:08.227 | 2012-07-22T12:58:42.160 | 2012-07-22T12:58:42.160 | 364 | 615 | null |
17,649 | 2 | null | 17,645 | 13 | null | This is only a difference in text files, where UNIX uses a single Line Feed (LF) to signify a new line, Windows uses a Carriage Return/Line Feed (CRLF) and Mac uses just a CR.
Binary files there should be no difference (i.e. a JPEG on a windows machine will be byte for byte the same as the same JPEG on a unix box.)
| null | CC BY-SA 2.5 | null | 2008-08-20T09:22:07.477 | 2008-08-20T09:22:07.477 | null | null | 1,908 | null |
17,654 | 2 | null | 17,645 | 2 | null | If you are just interested in the content of text files, then yes the line endings are different. Take a look at something like [dos2unix](http://www.linuxcommand.org/man_pages/dos2unix1.html), it may be of help here.
(Of course there are many other things that make unix and windows files different, but I don't think... | null | CC BY-SA 2.5 | null | 2008-08-20T09:23:29.517 | 2008-08-20T09:23:29.517 | null | null | 755 | null |
17,659 | 2 | null | 17,645 | 1 | null | In addition to the new-line differences, the [byte-order mark](http://en.wikipedia.org/wiki/Byte_Order_Mark) can cause problems if files are treated as Unicode on Windows.
| null | CC BY-SA 2.5 | null | 2008-08-20T09:28:41.487 | 2008-08-20T09:28:41.487 | null | null | 304 | null |
17,650 | 2 | null | 17,645 | 4 | null | There could also be a difference in character encoding for national characters. There is no "unix-encoding" but many linux-variants use UTF-8 as the default encoding. Mac OS (which is also a unix) uses its own encoding (macroman). I am not sure, what windows default encoding is.
But this could be another source of tro... | null | CC BY-SA 2.5 | null | 2008-08-20T09:22:15.743 | 2008-08-20T09:22:15.743 | null | null | 1,870 | null |
17,635 | 2 | null | 17,586 | 36 | null | Here is a word-wrap algorithm I've written in C#. It should be fairly easy to translate into other languages (except perhaps for `IndexOfAny`).
```
static char[] splitChars = new char[] { ' ', '-', '\t' };
private static string WordWrap(string str, int width)
{
string[] words = Explode(str, splitChars);
int ... | null | CC BY-SA 3.0 | null | 2008-08-20T09:04:32.357 | 2014-06-22T06:33:02.120 | 2014-06-22T06:33:02.120 | 1,381,108 | 214 | null |
17,658 | 2 | null | 17,561 | 1 | null | > Firefox:Inspect This if you use the DOM Inspector at allMeasure It for telling you pixel distances (if you need that)IE View or Safari View for ease of testing in other browsersHTML Validator if you care about validationConsole2 to improve your js error consoleThe Javascript Shell bookmarklet is also handy (and look ... | null | CC BY-SA 2.5 | null | 2008-08-20T09:28:33.623 | 2008-08-20T09:28:33.623 | 2020-06-20T09:12:55.060 | -1 | 1,870 | null |
17,664 | 1 | 17,698 | null | 3 | 1,146 | I have an ASP.net Application that runs on the internal network (well, actually it's running on Sharepoint 2007).
I just wonder:
Can I somehow retrieve the name of the PC the Client is using? I would have access to Active Directory if that helps. The thing is, people use multiple PCs. So, I cannot use any manual/st... | Retrieving the PC Name of a Client? (Windows Auth) | CC BY-SA 4.0 | null | 2008-08-20T09:34:54.887 | 2019-06-12T14:09:05.117 | 2019-06-12T14:02:53.013 | 1,011,722 | 91 | [
"asp.net",
"sharepoint",
"authentication"
] |
17,680 | 2 | null | 17,609 | 1 | null | Sure, the database table might be an idea. But what about sending 1000 e-mails with a 2mb attachment? you'd have to take that into account as well. I had the problem myself, and I eventually resorted to writing the e-mail to the database, and the files to the filesystem. The e-mail script I used then read the database ... | null | CC BY-SA 2.5 | null | 2008-08-20T09:48:43.013 | 2008-08-20T09:48:43.013 | null | null | 909 | null |
17,675 | 2 | null | 17,645 | 1 | null | As pauldoo suggests, tools like dos2unix can be very useful. Note that these may be on your linux/unix system as or , or perhaps even as the general purpose toolbox .
However, another set of problems that you may come across can be related to single/multi-byte character encodings. If you see strange unexpected chars ... | null | CC BY-SA 2.5 | null | 2008-08-20T09:40:26.497 | 2008-08-20T09:40:26.497 | null | null | 1,820 | null |
17,678 | 2 | null | 17,645 | 2 | null | In addition to the answers given, you may find issues with the different file systems:
- On unix, files that start with a are hidden. On windows, it's a filesystem flag that you probably don't have easy access to. This may result in files that are supposed to be hidden now becoming visible on the client machines.- Fi... | null | CC BY-SA 2.5 | null | 2008-08-20T09:42:10.190 | 2008-08-20T09:42:10.190 | null | null | 1,000 | null |
17,679 | 1 | 17,859 | null | 9 | 2,400 | We're storing some Guid's in a MS SQL database. There's some legacy code that does `Guid.ToString()` and then passes them in to a `varchar(64)` and there's some newer code that passes them in using a unique identifier parameter. When you look at the results using MS SQL Management studio they look different. The byte o... | Why does Guid.ToString() reverse the byte order? | CC BY-SA 3.0 | null | 2008-08-20T09:44:02.947 | 2013-12-19T18:45:14.363 | 2013-12-19T18:45:14.363 | 2,124,004 | 1,039 | [
".net",
"sql-server"
] |
17,670 | 1 | 17,683 | null | 2 | 806 | We have a situation in our product where for a long time some data has been stored in the application's database as SQL string (choice of MS SQL server or sybase SQL anywhere) which was encrypted via the Windows API function [CryptEncrypt.](http://msdn.microsoft.com/en-us/library/aa379924.aspx) (direct and de-cryptabl... | Suitable alternative to CryptEncrypt | CC BY-SA 3.0 | null | 2008-08-20T09:37:02.603 | 2017-07-10T19:55:54.427 | 2020-06-20T09:12:55.060 | -1 | 379 | [
"c++",
"encryption",
"winapi"
] |
17,676 | 2 | null | 17,609 | 1 | null | as mercutio suggested, i would insert a new record into a mail queue table for each email waiting to be sent and then use a separate process (like a CRON) to check the table periodically for any queued items.
if any emails are queued (and the email is not customised for each recipient) i would then group the emails by... | null | CC BY-SA 2.5 | null | 2008-08-20T09:41:53.280 | 2008-08-20T09:41:53.280 | null | null | 2,083 | null |
17,681 | 1 | null | null | 8 | 12,560 | I have a [VisualSVN Server](http://www.visualsvn.com/server/) installed on a Windows server, serving several repositories.
Since the web-viewer built into VisualSVN server is a minimalistic subversion browser, I'd like to install [WebSVN](http://websvn.tigris.org/) on top of my repositories.
The problem, however, is ... | WebSVN with VisualSVN Server, anyone gotten authentication to work? | CC BY-SA 2.5 | 0 | 2008-08-20T09:48:43.840 | 2015-12-29T14:14:03.883 | 2015-12-29T14:14:03.883 | 761,095 | 267 | [
"php",
"svn",
"visualsvn-server",
"websvn"
] |
17,690 | 2 | null | 1,669 | 8 | null | An easy way to create a compiler is to use bison and flex (or similar), build a tree (AST) and generate code in C. With generating C code being the most important step. By generating C code, your language will automatically work on all platforms that have a C compiler.
Generating C code is as easy as generating HTML (... | null | CC BY-SA 2.5 | null | 2008-08-20T09:56:34.367 | 2008-08-20T09:56:34.367 | null | null | 1,633 | null |
17,683 | 2 | null | 17,670 | 3 | null | Any semi-decent algorithm will end up with a strong chance of generating a NULL value somewhere in the resulting ciphertext.
Why not do something like [base-64 encode](http://en.wikipedia.org/wiki/Base64) your resulting binary blob before persisting to the DB? ([sample implementation in C++](http://synesis.com.au/soft... | null | CC BY-SA 2.5 | null | 2008-08-20T09:49:56.333 | 2008-08-20T09:49:56.333 | null | null | 611 | null |
17,691 | 2 | null | 17,664 | 3 | null | Does [System.Web.HttpRequest.UserHostname](http://msdn.microsoft.com/en-us/library/system.web.httprequest.userhostname.aspx) provide what you're looking for?
| null | CC BY-SA 2.5 | null | 2008-08-20T09:56:47.300 | 2008-08-20T09:56:47.300 | null | null | 611 | null |
17,693 | 2 | null | 4,724 | 4 | null | Learning lisp will put Javascript in a completely different light! Lisp really forces you to grasp both recursion and the whole "functions as first class objects"-paradigm. See Crockfords excellent article on [Scheme vs Javascript](http://javascript.crockford.com/little.html). Javascript is perhaps the most important l... | null | CC BY-SA 2.5 | null | 2008-08-20T09:58:38.310 | 2008-08-20T09:58:38.310 | null | null | 1,920 | null |
17,694 | 2 | null | 1,669 | 11 | null | If you're willing to use LLVM, check this out: [http://llvm.org/docs/tutorial/](http://llvm.org/docs/tutorial/). It teaches you how to write a compiler from scratch using LLVM's framework, and doesn't assume you have any knowledge about the subject.
The tutorial suggest you write your own parser and lexer etc, but I a... | null | CC BY-SA 2.5 | null | 2008-08-20T10:01:17.023 | 2008-08-20T10:01:17.023 | null | null | 2,018 | null |
17,682 | 2 | null | 17,561 | 2 | null | Opera has:
Dragonfly (tools -> advanced -> developer tools)
[Debug Menu](http://my.opera.com/dragonfly/blog/2008/06/09/the-debug-menu-and-the-new-weekly)
[UserJS methods for intercepting things](http://www.opera.com/support/tutorials/userjs/specs/)
opera:config#CompatMode%20Override for forcing quirks or standards ... | null | CC BY-SA 2.5 | null | 2008-08-20T09:49:29.097 | 2008-08-20T09:54:57.773 | 2008-08-20T09:54:57.773 | 1,697 | 1,697 | null |
17,695 | 2 | null | 17,117 | 1 | null | Part of the beauty of Boost is that all code is in header files. They have to for template reasons. So probably downloading the code and including it in your project will work. There are some libraries in Boost that do need compiling, but as long as you don't need those...
| null | CC BY-SA 2.5 | null | 2008-08-20T10:02:02.357 | 2008-08-20T10:02:02.357 | null | null | 1,633 | null |
17,697 | 2 | null | 13,086 | 1 | null | There are a number of videos by Alister Christie at [codegearguru](http://www.codegearguru.com) - check them out :)
edit... @Martin, check out the Turbo products at [CodeGear](http://cc.codegear.com/free/turbo)
| null | CC BY-SA 2.5 | null | 2008-08-20T10:05:17.857 | 2008-08-20T10:05:17.857 | null | null | 1,461 | null |
17,696 | 2 | null | 17,609 | 2 | null | There's a tested solution for that: PEAR [Mail_Queue](http://pear.php.net/package/Mail_Queue)
Works fine for me.
| null | CC BY-SA 2.5 | null | 2008-08-20T10:03:29.140 | 2008-08-20T10:03:29.140 | null | null | 999 | null |
17,699 | 2 | null | 17,670 | 0 | null | That's an interesting route OJ.
We're looking at the feasability of a non-reversable method (still making sure we don't explicitly retrieve the data to decrypt) e.g. just store a Hash to compare on a submission
| null | CC BY-SA 2.5 | null | 2008-08-20T10:06:03.970 | 2008-08-20T10:06:03.970 | null | null | 379 | null |