instruction
stringlengths
0
30k
Does it start at the begining of a line or can it appear anywhere? If the former s/old/new is what you want. If the latter, I'll have to figure that out. I suspect that back referances could be used somehow.
What are futures?
|computer-science|futures|
What are futures? It's something to do with lazy evaluation.
The [DSNIFF][1] package has the mailsnarf utility. It can grab POP3 too. There are all sorts of other wonderful sniffing utilities there. Make sure you have the legal right before using these tools. I beleive the documentation has more information on the legality. According to the web page there are Windows and Mac OS ...
The [DSNIFF][1] package has the mailsnarf utility. It can grab POP3 too. There are all sorts of other wonderful sniffing utilities there. Make sure you have the legal right before using these tools (the legal right to intercept other peoples traffic). I beleive the documentation has more information on the legality. Ac...
Since this question is tagged with regex, I decided to try a regex approach. I first replace all the spaces in the quotes parts with \x00, then split by spaces, then replace the \x00 back to spaces in each part. Both versions do the same thing, but splitter is a bit more readable then splitter2. import re ...
Keep in mind whenever you're splitting by "word" anywhere that some languages such as Chinese and Japanese do not use a space character to split words. Also, a malicious user could simply enter text without any spaces, or using some Unicode look-alike to the standard space character, in which case any solution you use ...
Algorithm for finding similar images
|algorithm|image-comparison|math|
I need an algorithm that can determine whether two images are 'similar' and recognizes similar patterns of color, brightness, shape etc.. I might need some pointers as to what parameters the human brain uses to 'categorize' images. .. I have looked at hausdorff based matching but that seems mainly for matching tran...
|algorithm|math|image-comparison|
I need an algorithm that can determine whether two images are 'similar' and recognizes similar patterns of color, brightness, shape etc.. I might need some pointers as to what parameters the human brain uses to 'categorize' images. .. I have looked at hausdorff based matching but that seems mainly for matching tran...
There's an automated test tool called [RIATest][1] that might fit the bill for you. Unfortunately only for Windows, and not open source, but if it does the job it might be well worth the price ($399 at time of writing). [1]: http://www.riatest.com/
Generally, if you must have the BEST indexed lookup performance it's best to build a List<T> first and then turn it into a array thus paying a small penalty at first but avoiding any later. If the issue is that you will be continually adding new data and removing old data then you may want to use a ArrayList or List<T>...
Creating a DNN Module that uses a end-user modifyable template
|asp.net|dotnetnuke|module|
Best way to read commandline parameters in console application
|.net|command-line|parameters|
Below are two ways of reading in the commandline parameters. The first is the way that I'm accustom to seeing using the parameter in the main. The second I stumbled on when reviewing code. I noticed that the second assigns the first item in the array to the path and application but the first skips this. Is it j...
I don't think you can create non-zero based arrays in C#, but you could easily write a wrapper class of your own around the built in data structures.This wrapper class would hold a private instance of the array type you required; overloading the [] indexing operator is not allowed, but you can add an indexer to a class...
I use [ArtisticStyle](http://astyle.sourceforge.net/) (C++) to do this and also reformat my code. However I had to add this as external tool and you need to trigger it yourself so you might not like it. However I find it excellent that I can reformat code in more custom way (eg. multiline function parameters) that I...
You may have to use a regular JTextField and call setDocument() with a custom document. I recommend extending PlainDocument, this makes it easy to validate input as the document changes, and add slashes as appropriate.
Class variables are scoped according to their member visibility attributes, and have global storage, not thread storage. Scope is a syntactic concept, and relates to what identifiers are visible from where. It is the storage of the variable that is of concern here.
**Show** them how **simple GUIs can be effective.** Examples: Google Chrome, Apple's software. You may also want to show examples of bloated software, like Eclipse, Netbeans, Visual Studio... ok, these are actually all software IDEs, but they all have cluttered interface.
[Power commands for visual studio][1] will do the trick. Didn't notice any performance\stability issues with them. [1]: http://code.msdn.microsoft.com/PowerCommands
One of my favorite things to do with Yahoo! Pipes is to aggregate multiple craigslist feeds into a single feed. You can make a feed out of any category or search criteria on craigslist. I live in a university town and am always on the lookout for tickets to sporting events, for example. I have a half-dozen craigslis...
You could have a limited amount of instances of each type in a pool, and reuse the already done with instances. The size of the pool would depend on the amount of messages you'll be processing.
The answer is *NEVER*. If you need to write programs to load or process data you need to do it outside of your data tier from another computer on the network. Running external applications directly on your data tier or god forbid in-process with your data tier or the misapplication of external languages when native...
I found WROX's Professional .NET 2.0 Generics very useful as it contains lots of real world examples. Generics could be confusing to the beginner but they could be a very useful/powerful/time saving tool in the hands of an experienced developer. Personally, I find .NET Generics most useful in simplifying the defining a...
Are you collecting both the start time and stop time? If so, you could use the "timestamp" data type, if your DBMS supports that. If not, just as a date/time type. Now, you've said you don't want the date part to be stored - but consider the case where the time period spans midnight - you start at 23:55:01 and end a...
Forcing a GC.Collect() is generally a bad idea, leave the GC to do what it does best. It sounds like the best solution would be to use a pool of objects that you can grow if necessary - I've used this pattern successfully. This way you avoid not only the garbage collection but the regular allocation cost as well. ...
Windows users might want to throw in desktop.ini and thumbs.db.
Here's an even simpler implementation. All you do is take a snapshot of the stage using the **draw()** method of bitmapData, then use **getPixel()** on the pixel under the mouse. The advantage of this is that you can sample anything that's been drawn to the stage, not just a given bitmap. import flash.display.Bi...
SharePoint - How do insert new items using the list web service?
|c#|xml|sharepoint|service|
Which library should I use to generate RSS in Common Lisp?
|lisp|rss|
What's the best library to use to generate RSS for a webserver written in Common Lisp?
If DoingSomething to an object is likely to produce a different result in another scenario, then i'd suggest you oneThing.DoSomethingToThing(anotherThing). For example you may have two was of saving thing in you program so you might adopt a DatabaseObject.Save(thing) SessionObject.Save(thing) would be more advantag...
Depending on your project's budget, you may also consider Zend Platform for your production machines, which in addition to a bunch of other great features, includes configurable session clustering, which works sort of like a CDN does.
You can get the Analytics data, but it'll take a bit of hacking. In any analytics report, click the 'email' button at the top of the screen. Set up the email to go to your address (or a new address on your server) and change the format to csv or xml. Then, you can use php (or another language) to check the email ...
This tutorial isn't 'for python programmers' but I thinkit's a pretty good vba resource: [http://www.vbtutor.net/VBA/vba_tutorial.html][1] This site goes over a real-world example using lists: [http://www.ozgrid.com/VBA/count-of-list.htm][2] [1]: http://www.vbtutor.net/VBA/vba_tutorial.html [2]: http...
You can do all of your compiling exclusively on Java6 and then use System.getProperty("java.version") to conditionally run either the Java5 or the Java6 code path. You can have Java6-only code in a class and the class will run fine on Java5 as long as the Java6-only code path is not executed. This is a trick that...
Any question "Should I use a certain tool?" comes down to asking exactly what you want to do. You should ask yourself - "Do I want to write my own storage for this data?" Most web based applications are written against a database because most databases support many "free" features - you can have multiple webservers....
You could go the linked server route. you just can't use the select * into you have to do an insert into select. I would avoid replication if you don't have experience with it as it can be difficult to fix if it breaks and can be prone to other problems if not properly managed. Keep it simple especially if ...
Advice on building a distributed CMS?
@Espo: I'll do that re KB153119. Thanks. About the mail server: I hear you. I'll update when I uncover more.
PHP and J2EE
|php|struts|
Can I use Struts as a backend and PHP as front end for a web application? If yes, what may be the implications.
cross platform unicode support
|java|c|perl|unicode|
I find that getting Unicode support in my cross-platform apps a real pain in the butt. I need strings that can go from C code, to a database, to a Java application and into a Perl module. Each of these use a different Unicode encodings (UTF8, UTF16) or some other code page. The biggest thing that I need is a cross...
running traceroute to some public site will show you. Of course, there may be more than one interface that would get you there.
Install the Radrails plugin for Aptana Studio offline
|ruby-on-rails|radrails|aptana|
I downloaded and installed the Aptana Studio free version. But apparently, to install the Radrails plugin for ruby on rails development you have to connect to the internet. I don't have internet on my machine right now. So is there a way I could download the installer from another machine and copy it over my existing A...
|ruby-on-rails|aptana|radrails|
I downloaded and installed the Aptana Studio free version. But apparently, to install the Radrails plugin for ruby on rails development you have to connect to the internet. I don't have internet on my machine right now. So is there a way I could download the installer from another machine and copy it over my existing A...
Depending on what you need a tree structure for, you might not need any pre-built implementation. Perl already supports them using arrays of arrayrefs. For example, a simple representation of this tree t / \ a d / \ / \ b c e ...
Throwing an &amp;nbsp; in there seems to create a space: <html> <head><title>Blah</title></head> <body> <h2 style="display:inline;">Something</h2> &nbsp; <h2 style="display:inline;">Something Else</h2> </body> </html> In this example, you actually end up with 2 spac...
The first answer: string s = ",liger, unicorn, snipe"; s.TrimStart(','); is incorrect. The second line does nothing because .NET strings don't change. As it says on the [TrimStart page][1], "This method does not modify the value of the current instance. Instead, it returns a new string...". As othe...
string s = ",liger, unicorn, snipe"; s = s.TrimStart(','); It's important to assign the result of TrimStart to a variable. As it says on the [TrimStart page][1], "This method does not modify the value of the current instance. Instead, it returns a new string...". In .NET, strings don't change. [1]:...
Because a class that has a read-only property (no setter) probably has a good reason for it. There might not be any underlying datastore, for example. Allowing you to create a setter breaks the contract set forth by the class. It's just bad OOP.
Subscription Parameters in SQL Server Reporting Services 2005
|sql|server|reporting|services|
When I subscribe for a report, I may chose to have a subject like: @ReportName was executed at: @ExecutionTime I would like a name like this: Your "@ReportName" report covering Sep 10 2008 - Sep 16 2008 Sep 10 2008 - Sep 16 2008 are values of the two report parameters: @DateFrom and @DateTo, respectivel...
|sql-server|reporting-services|
Connecting to Oracle using PHP
|php|oracle-database|
I am a PHP Developer, but I am confused on how to connect to a remote Oracle database instance from PHP. I simply need to query a read only database and get some data. Do I need to have the Oracle Instant Client or the extension is enough? Thanks.
A standard for loop would be best, you don't have to worry about the processing overhead of reversing the collection.
How do I check ClickOnce prerequisites after first install?
|clickonce|.net|
If I understand correctly, ClickOnce only checks for prerequisites with the first install of an application through the setup.exe file that contains the prerequisite information. If the user opens the app in the future it will check for new versions, but it does not launch the setup.exe again, thus not checking for any...
I'd like to create a module in DNN that, similar to the Announcements control, offers a template that the portal admin can modify for formatting. I have a control that currently uses a Repeater control with templates. Is there a way to override the contents of the repeater ItemTemplate, HeaderTemplate, and FooterTemp...
[VLINQ](http://code.msdn.microsoft.com/vlinq) LINQPad is essential, but for quick stuff inside VS, VLINQ is great.
Well, first define the meaning of that column. Is operator a name so you can justify using chars? Or is it a number? If the field is a name then you will use chars, and then you would want to determine the fixed length. Pad all operator names with zeros on the left. Define naming rules for operators (I.E. No leters...
Checking version of file in Ruby
|ruby|dll|file|version|
Is there a way in Ruby to find the version of file, specifically a .dll file?
The book "Shell Script Recipes: A Problem Solution Approach" (ISBN: 978-1-59059-471-1) by Chris F.A. Johnson has a date functions library that might be helpful. The source code is available at http://apress.com/book/downloadfile/2146 (the date functions are in Chapter08/data-funcs-sh within the tar file).
Percentage-based widths are relative to the first parent element that has a width specified. If your div does not have a width specified then the width of the table has nothing to do with it. Can you post a simplified version of the markup that shows what your DOM tree looks like? From another angle, if your p...
[Source Code Outliner](http://www.visualstudiogallery.com/ExtensionDetails.aspx?ExtensionID=bea9ed59-8857-4032-9666-9af1c1a33969) Nice alternate view of your source files. It's the outliner from the code pane, but without all the code getting in the way of the structure.
Powershell: Setting Encoding for Get-Content Pipeline
|powershell|encoding|
I have a file saved as UCS-2 Little Endian I want to change the encoding so I ran the following code: cat tmp.log -encoding UTF8 > new.log The resulting file is still in UCS-2 Little Endian. Is this because the pipeline is always in that format? Is there an easy way to pipe this to a new file as UTF8?
|content-management-system|php|
I'm in the process of designing a PHP-based content management system for personal use and eventually to be distributed. I know there are a lot of CMS's already out there, but I really haven't found one that meets my all of my needs and I also would like to have the learning experience. Security is a large focus, as ar...
|php|content-management-system|
I'm in the process of designing a PHP-based content management system for personal use and eventually to be distributed. I know there are a lot of CMS's already out there, but I really haven't found one that meets my all of my needs and I also would like to have the learning experience. Security is a large focus, as ar...
I'm sure Don Box created SOAP as a joke - 'look you *can* call RPC methods over the web' and today groans when he realises what a bloated nightmare of web standards it has become :-) REST is good, simple, implemented everywhere (so more a 'standard' than the standards) fast and easy. Use REST.
I believe so, yes. It would be quite simple to confirm using a ViewState Decoder (google it, there are tools available from Fritz Onion or as FireFox plugins).
There's also the [AppDomain.TypeResolve][1] event that you can override. [1]: http://msdn.microsoft.com/en-us/library/system.appdomain.typeresolve(VS.80).aspx
It's done to prevent someone from creating a new SecurityManager object from untrusted code. public class Evil : SecurityManager { Evil() { try { super(); } catch { Throwable t } { } } }
I would have to assume that the viewstate contains information for each of a Multiview's views/controls. Otherwise, there's no way it would be able to keep track of the state of the controls in each view- unless you were using some sort of custom state management.
To add to Aeon's answer, it depends on the the thing and what you want to do to it. So if you are writing Thing, and DoSomething alters the internal state of Thing, then the best approach is Thing.DoSomething. However, if the action does more than change the internal state, then DoSomething(Thing) makes more sense. For...
Rails - recovering database from Production.log
|ruby-on-rails|session|