instruction
stringlengths
0
30k
Nobody's mentioned the best one yet. Click on a class or method name and press Ctrl-T. You get a quick type hierarchy. For a class name you see the entire class hierarchy. For a method name you get the hierarchy showing superclasses and subclasses, with implementations of that method distinguished from abstract m...
I have found David David Eppstein's [find rational approximation to given real number][1] C code to be exactly what you are asking for. I have used versions of this customized for specific numerator and denominator limits. [1]: http://www.ics.uci.edu/~eppstein/numth/frap.c
I have found David Eppstein's [find rational approximation to given real number][1] C code to be exactly what you are asking for. Its based on the theory of continued fractions and very fast and fairly compact. I have used versions of this customized for specific numerator and denominator limits. [1]: http...
Desperate networking question: Unix commands like ping, ssh, work fine but socket-based programs are failing in connect
|linux|sockets|suse|
I got a call from a tester about a machine that was failing our software. When I examined the problem machine, I quickly realized the problem was fairly low level: Inbound network traffic works fine. Basic outbound command like ping and ssh are working fine, but anything involving the connect() call is failing with "No...
Even with CPUID enabled is there actually a serial number available in modern processors? I remember there being a big outcry in the Pentium 3 days when this whole serial number issue was raised.
REST is implementation-agnostic and much more transparent, and this makes it great for public APIs, especially for big websites like Flickr, Amazon or Digg that are using their APIs as marketing tools and really want people to consume their data. They *don't* want to be hand-holding 1000s of novice developers who are t...
Good asp.net (C#) apps?
|c#|asp.net|css|design-patterns|
Any suggestions for good open source asp.net (C#) apps out there which meet as many of the following:? 1. Designed well and multi tiered 2. Clean & commented code 3. Good use of several design patterns 4. Web pages display properly in all common browsers 5. Produces valid html and has good use of css 6. U...
How to open mutliple HTMLHelp files at the same time using Delphi.
|delphi|chm|
In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed. In addition to TApplication.HelpFile, each form ...
I don't know if either are necessarily better, but two *alternate* ways would be: 1. Manually run through the table once you hit the footer and calculate from the on-screen text 2. Manually retrieve the data and do the calculation separately from the bind Of course, #2 sort of offsets the advantages of data bind...
Using those two exception handlers should work. Are you sure you've added them in a place where they're going to be called and properly set (ie, in your application's *managed* entry point -- you did put one in, right?)
Planning and Building a mobile enabled site for your main site.
|html|web|development|mobile|wap|wml|
We are in the initial planning stages of building out a mobile site for one of our clients. This mobile site will be in addition to the main site that we have already built for them. We've determined that the content is going to be a small subsection of the main site and will target the main audience that is expected...
I don't, but I appreciate your logic. I guess the reason most people don't is that underscores would look kind of ugly in the Properties window at design time. It'd also take up an extra character of horizontal space, which is at a premium in a docked window like that.
I don't know a lot about ASP.NET, but why not write a custom function for the onload event that in turn calls both functions for you? If you've got two functions, call them both from a third script which you register for the event.
Try this: window.attachEvent("onload", myOtherFunctionToCall); function myOtherFunctionToCall() { // do something }
Try this: window.attachEvent("onload", myOtherFunctionToCall); function myOtherFunctionToCall() { // do something }
Try this: window.attachEvent("onload", myOtherFunctionToCall); function myOtherFunctionToCall() { // do something } edit: hey, I was just getting ready to log in with Firefox and reformat this myself! Still doesn't seem to format code for me with IE7.
Actually, according to [this MSDN page](http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx), it looks like you *can* call this function multiple times to register multiple scripts. You just need to use different keys (the second argument). Page.ClientScript.RegisterStartupScript( this.GetType(), key...
If you have some guess of the preferred size of the pool you can create fixed size pool using stack structure using array (the fastest possible solution). Then you need to implement four phases of object life time hard initialization (and memory allocation), soft initialization, soft cleanup and hard cleanup (and memor...
I don't think there is such thing because some functions not having a body in the actual source tree might be defined in some external library. This can only be done by creating a script which makes a list of declared functions in a header and verifies if they are sometimes called.
According to the section titled "How to Throw and Catch Exceptions" in Lesson 2 of **MCTS Self-Paced Training Kit (Exam 70-536): Microsoft® .NET Framework 2.0—Application Development Foundation**, the reason is that the exception may have occurred before variable declarations in the try block (as others have noted alre...
There's no real point though is there? As Classic ASP files aren't compiled. I keep just opening them individually as needed from File Explorer. Although you could add them all to a VBProj or CSProj so you get them all showing up in your Solution Explorer, and could use features like Project -> Deploy.
It's worth noting that <http://perlmonks.org>, in addition to the fora, has the Chatterbox, where simple questions can be answered immediately in conversation with other users.
Opening two HTMLHelp files simultaneously in Delphi causes both help windows to hang.
In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed. In addition to TApplication.HelpFile, each form ...
In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed. In addition to TApplication.HelpFile, each form ...
Adding a classic ASP webapplication to VS 2008
|asp|classic|solution|visual|studio|
is there a way to add an existing classic ASP webapp into a solution in VS? The application is around 4000 files large and currently maintained outisde Visual Studio. Thanks in advance! Matthias
|visual-studio-2008|asp-classic|solution|
1. Would that be possible?<br> Hardly. Java is a C-like language, which was initially designed to support only static typing. It will take a lot of time to introduce this feature to Java and I don't think developers will spend time on that. 2. Would that be beneficial?<br> No. Java is a traditional language, and sta...
Example program: #include <gtk/gtk.h> static void on_destroy(GtkWidget* widget, gpointer data) { gtk_main_quit (); } int main (int argc, char* argv[]) { GtkWidget* window; GtkWidget* button; gtk_init(&argc, &argv); ...
In my experience in .NET, I would have to say no, sorry for the negative and short answer, but I really don't think there is
The best way to do this IMO is:- In VS 2008 File | Open | Web Site... In the dialog ensure File System is selected. Navigate to the physical folder that represents the root of your Web app. Click Open. Job Done.
You can't do this with Visual Studio 2008 out of the box, but you can if you install Service Pack 1 - see S[cott Guthrie's blog post][1] for more info. **Edit:** To clarify, whilst you can create a project out of the box, there is no intellisense or debugging unless you install SP1 [1]: http://weblogs.asp.net...
In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed. In addition to TApplication.HelpFile, each form ...
In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed. In addition to TApplication.HelpFile, each form ...
There is no way to do this in Java, not in the same way it works for you in C++. You could perhaps use annotations, and run [apt](http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html) before or after compilation to check your annotations. For example: @MyStaticCheck(false, "Compile Time Error,...
Probably the 4 biggest things you can start looking at first (besides just having good service code) are items related to: - **Bindings** - some binding and they protocols they run on are just faster than others, tcp is going to be faster than any of the http bindings - **Instance Mode** - this determines how y...
Lightweight alternatives to NHibernate
|nhibernate|orm|
NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.) Is there a good lightweight alternative? Support for simple file based databases such as Access/SQLite/VistaDB is essential. Ideally, something contained in a single assembly that only references .NET as...
If your event is already defined in your parent class, you do not need to rewire it again in your child class. That will cause the event to fire twice. Do verify if this is what is happening. HTH :)
<a href="http://www.dotnetblogengine.net/">BlogEngine.Net</a>
In windows, I am sure there is a system call, In linux one could try "sudo lshw" but most kernels do not seem to support CPU serial numbers, and preliminary research seems to indicate that the general outrage against uniquely identifiable computers means that there is no perfect answer. What are you trying to do? Al...
How important is avoiding cheating ? [Can you trust any information coming from a client or can they be trusted and authenticated ?] **Object model** How are objects communicated from one machine to another ? How are actions carried out on an object ? Are you doing client/server or peer to peer ? **Random N...
Think of it this way, if you were to do such a cast, and then add an object of type Foo to the list, the list of strings is no longer consistent. If you were to iterate the first reference, you would get a class cast exception because once you hit the Foo instance, the Foo could not be converted to string! As a sid...
My Apache had something like this in httpd.conf. Just change the ErrorLog and CustomLog settings <VirtualHost myvhost:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot /opt/web ServerName myvhost ErrorLog logs/myvhost-error_log CustomLog logs/myvhost-acce...
Mike - I believe contravariance isn't allowed in C# either - See [http://blogs.msdn.com/rmbyers/archive/2005/02/16/375079.aspx][1] for some more info. [1]: http://blogs.msdn.com/rmbyers/archive/2005/02/16/375079.aspx
Patrick is correct, the only way you can really do this is to use an explicit stack in your interpreter, and hoist the appropriate segment of stack into the heap when you need to convert to a continuation. This is basically the same as what is needed to support closures in languages that support them (closures and c...
This has a lot to do with covariance, e.g., generic types are considered as parameters, and if the parameters do not resolve properly to a more specific type then the operation fails. The implication of such is that you really cannot cast to a more general type like object. And as stated by Rex, the List object won't c...
- [FLOSS Weekly][1] - [Pragmatic Podcasts][2] - [Rails Envy][3] - [Webdev Radio][4] [1]: http://twit.tv/FLOSS [2]: http://www.pragprog.com/podcasts [3]: http://railsenvy.com/podcast [4]: http://webdevradio.com/
I remember reading an article that may be of help to you: _[Cheney on the M.T.A.](http://home.pipeline.com/~hbaker1/CheneyMTA.html)_ :-) Some implementations of Scheme I know of, such as [SISC](http://sisc.sourceforge.net/), allocate their call frames on the heap.
I remember reading an article that may be of help to you: _[Cheney on the M.T.A.](http://home.pipeline.com/~hbaker1/CheneyMTA.html)_ :-) Some implementations of Scheme I know of, such as [SISC](http://sisc.sourceforge.net/), allocate their call frames on the heap. @ollie: You don't need to do the hoisting if all ...
Look into [YUITest](http://developer.yahoo.com/yui/yuitest/)
How to compile Cairo for Visual C++ 2008 (Express edition)
|open-source|graphics|visual-studio-2008|visual-c++|
Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSCVRT runtime, which is incompatible with Visual C++ 2005/2008. So, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies (png,zlib,pixman).
|open-source|visual-studio-2008|graphics|visual-c++|
Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime, which is incompatible with Visual C++ 2005/2008. So, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies (png,zlib,pixman).
I would personally recommend us erubis in precompiled templates. Especially if there's no need for dynamic templating. Then your biggest slowdown will be limited by the speed at which ruby can parse ruby. I'd probably set up a small cron job that just monitors for changed source templates and autocompiles them ...
Looking for regex to extract email addresses from /etc/passwd
|regex|linux|grep|sed|bash|
Most of my users have email addresses associated with their profile in /etc/passwd. They are always in the 5th field, which I can grab, but they appear at different places within a comma-separated list in the 5th field. Can somebody give me a **regex to grab just the email address** (delimeted by commas) from a lin...
|linux|regex|sed|
Very popular layout engines: 1. Mozilla Gecko 2. KHTML 3. WebKit (based on KHTML) Though I'm not sure how easy it is to embed those in a .Net app.
Popular layout engines: 1. Mozilla Gecko 2. KHTML 3. WebKit (based on KHTML) Though I'm not sure how easy it is to embed those in a .Net app.
open IE without toolbar or address bar from Windows VB Application
|vb|
Shell ("explorer.exe www.google.com") is how I'm currently opening my products ad page after successful install. However I think it would look much nicer if I could do it more like Avira does, or even a popup where there are no address bar links etc. Doing this via an inbrowser link is easy enough <a hre...
Assuming you have to help files called "Help File 1.chm" and "Help File 2.chm" and you are opening these help files from your Delphi code: To open Help File 1, the following code will work: procedure TForm1.Button1Click(Sender: TObject); begin Application.HelpFile := 'Help File 1.chm'; Appl...
Assuming you have to help files called "Help File 1.chm" and "Help File 2.chm" and you are opening these help files from your Delphi code: To open Help File 1, the following code will work: procedure TForm1.Button1Click(Sender: TObject); begin Application.HelpFile := 'Help File 1.chm'; Appl...
Assuming you have to help files called "Help File 1.chm" and "Help File 2.chm" and you are opening these help files from your Delphi code: To open Help File 1, the following code will work: procedure TForm1.Button1Click(Sender: TObject); begin Application.HelpFile := 'Help File 1.chm'; Appl...
Take a look at using PostgreSQL and tsearch.
Try using postgresql with tsearch
you may implement following: - A ThreadLocal holder for the identity of your job. - Extend FileAppender, your FileAppender has to keep a Map holding a QuietWriter for every job identity. In method subAppend, you get the identity of your job from the ThreadLocal, you look up (or create) the QuietWriter and write to ...
The best advice was from: xtofl.myopenid.com ^^^^ If you don't understand the purposes of patterns, your really not going to use objects to their fullest. You need to know why inheritence, polymorphism, interfaces, factories, decorators, etc. really make design easier by addressing particular issues.
# Linux In Linux, this information is available in the /proc file system. I'm not a big fan of the text file format used, as each Linux distribution seems to customize at least one important file. A quick look as the source to 'ps' reveals the mess. But here is where to find the information you seek: **/proc/m...
# Linux In Linux, this information is available in the /proc file system. I'm not a big fan of the text file format used, as each Linux distribution seems to customize at least one important file. A quick look as the source to 'ps' reveals the mess. But here is where to find the information you seek: **/proc/m...
If you look for ability to share the SQL code try building a library of abstract functions. This way you could reuse some code which does generic things and keep business logic separate for each application. The same could be done with the views - they could be kept quite generic and useful for many applications. Yo...
one table for layout wouldn't be that bad. But you can't get the layout you need with just one table most of the time. Pretty soon you have 2 or three nested tables. This becomes very cumbersome. * It IS a LOT harder to read. That's not up to opinion. There's just more nested tags with no identifying marks on t...
How to deploy SQL Reporting 2005 when Data Sources are locked?
[dasBlog][1] which is a blogging platform that [Scott Hanselman][2] contributes to. [1]: http://www.codeplex.com/dasBlog [2]: http://www.hanselman.com/blog/
This is a typically 'High CPU' problem. There are two kind of high CPU problems a) Where on thread is using 100% CPU of one core (This is your scenario) b) CPU usage is 'abnormally high' when we execute certain actions. In such cases CPU may not be 100% but will be abnormally high. Typically this happens when ...
I would say it would be incredibly unwise to decide arbitrarily against multiple exit points as I have found the technical to be useful in practice *over and over*, in fact I have often *refactored existing code* to multiple exit points for clarity. We can compare the two approaches thus:- void string fooBar(str...
I would say it would be incredibly unwise to decide arbitrarily against multiple exit points as I have found the technical to be useful in practice *over and over*, in fact I have often *refactored existing code* to multiple exit points for clarity. We can compare the two approaches thus:- void string fooBar(str...
You want StructLayoutAttribute (<http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.structlayoutattribute(VS.71).aspx>) [StructLayout(LayoutKind.Explicit, Size=1, CharSet=CharSet.Ansi)] public struct Foo { [FieldOffset(0)]public ushort original_or_copy; [FieldOffset(1)]publ...
You want StructLayoutAttribute (<http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.structlayoutattribute(VS.71).aspx>) [StructLayout(LayoutKind.Explicit, Size=1, CharSet=CharSet.Ansi)] public struct Foo { [FieldOffset(0)]public byte original_or_copy; [FieldOffset(0)]public...
You want StructLayoutAttribute (<http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.structlayoutattribute(VS.71).aspx>) [StructLayout(LayoutKind.Explicit, Size=1, CharSet=CharSet.Ansi)] public struct Foo { [FieldOffset(0)]public byte original_or_copy; [FieldOffset(0)]public...
UltraEdit it my favorite text editor. Too bad I have to pay for it. You can't beat the ability to highlight vertically vs. horizontally.
A flags enum can work too, I think, if you make it a byte enum: [Flags] enum PesHeaders : byte { /* ... */ }
XSLT - Reverse Find in a string
|xslt|