instruction stringlengths 0 30k ⌀ |
|---|
[Algorithms for Java: Part 5][1] by Robert Sedgewick is all about graph algorithms and datastructures. This would be a good first book to work through if you want to implement some graph algorithms.
[1]: http://www.amazon.com/Algorithms-Java-Part-Graph-3rd/dp/0201361213 |
I personally would say Email w/ Verification, OpenId is a great idea but I find that finding a provider that your already with is a pain, I only had an openId for here cause just 2 days before beta i decided to start a blog on blogspot. But everyone on the internet has en email address, especially when dealing with bus... |
OpenID is very slick, and something you should seriously consider as it basically removes the requirement to save local usernames and passwords and worry about authentication.
A lot of sites nowadays are using both OpenID and their own, giving users the option.
If you do decide to roll your own, I'd recommend usi... |
Is SearchButton a LinkButton? If so, the javascript that is written to the browser doesn't work properly.
Here is a good blog post explaining the issue and how to solve it:
[Using Panel.DefaultButton property with LinkButton control in ASP.NET](http://kpumuk.info/asp-net/using-panel-defaultbutton-property-with-... |
I might be wrong and this might not make a difference but have you tried:
Me.Page.Form.DefaultButton = SearchButton.ID
instead of
Me.Page.Form.DefaultButton = SearchButton.UniqueID |
If most of your customers are mostly businesses then I think that using anything other than email creates problems for your customers. Most people are comfortable with email address login and since they are a business customer will likely want to use their work email rather than a personal account. OpenID creates a sit... |
Document versus RPC is only a question if you are using SOAP Web Services which require a service description ([WSDL][1]). RESTful web services do not not use WSDL because the service can't be described by it, and the feeling is that REST is simpler and easier to understand. Some people have proposed [WADL][2] as a way... |
Using TortoiseSVN I just right-click and drag the folder from one location to another. When you release the right-click you'll have the option to "SVN Move Version File." However, I believe that SVN doesn't do anything "fancy" there, but simply deletes the file in the previous location and Adds it to the new location... |
**Theory**
There is no C syntax for accessing or setting the n-th bit of a built-in datatype (e.g. a 'char'). However, you can access bits using a logical AND operation, and set bits using a logical OR operation.
As an example, say that you have a variable that holds 1101 and you want to check the 2nd bit from th... |
The data has to live somewhere, whether it's internal to the DB or whether you just store a link to a (server) accessible file path, you're still chewing space.
I've just used simple LOB fields in the past, it seemed to work fine. If you keep the data inside the DB at least you keep your backup hassles low - you may... |
Following on from what Kyle has said, you can use a macro to do the hard work for you.
> It is possible.
>
> To set the nth bit, use OR:
>
> x |= (1 << 5); // sets the 5th-from
> right
>
> To clear a bit, use AND:
>
> x &= ~(1 << 5); // clears
> 5th-from-right
>
> To flip a bit, use XOR:
>
> x ^=... |
How do I learn Java5 or Java6? |
|algorithm|image| |
invisible watermarks in images |
|python|image|copyright|watermark|invisible| |
How do you insert invisible watermarks in images for copyright purposes? I'm looking for a python library.
What algorithm do you use? What about performance and efficiency? |
|python|image|copyright|watermark|invisible| |
colored build output in Visual Studio |
|visual-studio|colors| |
I am using a VS project with custom build script/batch file (ala make/ant etc)
When the build is run from the command line we have placed colored highlighting on various output lines.
However when built via Visual Studio (2005 in my case) the output window does not show the color anymore.
Is this possible? I... |
|visual-studio|colors| |
How can I render a PNG image (as a memory stream) onto a .NET ReportViewer report surface |
|.net|reportviewer|streaming|image| |
I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface.
Setup:
* Report datasource is an object datasource, with a dynamically generated stream as a property (CustomImage)
* Report.EnableExternalImages = true
* Image.Source = Database
* Image.MIMETy... |
|.net|reportviewer|image| |
|.net|image|reportviewer| |
I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface.
Setup:
* Windows Client application (not WebForms)
* Report datasource is an object datasource, with a dynamically generated stream as a property (CustomImage)
* Report.EnableExternalImages = tr... |
|.net|image|reportviewer| |
How to bind a MemoryStream to asp:image control? |
|asp.net|image|memorystream| |
Is there a way to bind a MemoryStream to asp:image control? |
|java| |
I'm a very experienced Java programmer who has spent my entire time working with Java 1.4 and earlier. Where can I find a quick reference that will give me everything I need to know about the new features in Java5 and later in a quick reference? |
well if you think it can break, write a test for it. I usually don't test setter/getter, but lets says you make one for User.Name, which concatenate first and last name, I would write a test so if someone change the order for last and first name, at least he would know he changed something that was tested.
|
If you want seamless method calls from JavaScript to Python, [JSON-RPC][1] works well with Google App Engine. See Google's article, "[Using AJAX to Enable Client RPC Requests][2]", for details.
[1]: http://json-rpc.org/wiki/python-json-rpc
[2]: http://code.google.com/appengine/articles/rpc.html |
If you want to be able to invoke method calls from JavaScript to Python, [JSON-RPC][1] works well with Google App Engine. See Google's article, "[Using AJAX to Enable Client RPC Requests][2]", for details.
[1]: http://json-rpc.org/wiki/python-json-rpc
[2]: http://code.google.com/appengine/articles/rpc.html |
Perhaps try using a timer which retrieves the next image each time it ticks, unfortunately i don't know any JavaScript so I can't provide a code sample |
In terms of client software consider users/customers who are using a browser that supports some but not all Javascript. For example, most mobile phone browsers support a bit of Javascript but nothing very complicated. The browsers on devices such as the Playstation 3 are similar.
Then there are browsers such as [O... |
You should use a timer to continuously bring new images instead of an infinite loop. Check the setTimeout() function. The caveat is that you should call it in a function that calls itself, for it to wait again. Example taken from [w3schools][1]
<html>
<head>
<script type="text/javascript">
var c=0... |
wxwidgets is a great abstraction layer on the native GUI widgets of most window managers. |
Stopping keystrokes being lost in a web application |
|javascript|gwt| |
My current project is to write a web application that is an equivalent of an existing desktop application.
In the desktop app at certain points in the workflow the user might click on a button and then be shown a form to fill in. Even if it takes a little time for the app to display the form, expert users know wh... |
It looks like you can [download the symbols][1], though they're not available for browsing.
[1]: http://geekswithblogs.net/sdorman/archive/2007/05/23/Debugging-in-Visual-Studio-2005-with-a-Symbol-Server.aspx |
If it crashes (or throws an exception) all you are left with is a bunch of binary data to try and sift through to recreate your objects.
If you are only persisting binary why not just save straight to disk. You also might want to look at using something like xml as, as has been mentioned, if you alter your object d... |
It's definitely fast. Gmail, Google Reader and Yahoo mail all load instantly. Can't say that for FF or Opera. |
vb.net object persisted in database |
|vb.net|sql| |
How can I go about storing a vb.net user defined object in a sql database. I am not trying to replicate the properties with columns. I mean something along the lines of converting or encoding my object to a byte array and then storing that in a field in the db. Like when you store an instance of an object in session, b... |
|sql|vb.net|serialization| |
Do you have different ruby versions on your system? If you're running the Darwin-supplied ruby binary, but installed ruby gems under /usr/local, then you'll get errors like this. Even if you've aliased ruby to point to /usr/local, the gem command may fail if the proper ruby binary is not resolved correctly by your sh... |
While in Microsoft:
> Consuming twice as much RAM as Firefox
> and saturating the CPU with nearly six
> times as many execution threads,
> Microsoft's latest beta release of
> Internet Explorer 8 is in fact more
> demanding on your PC than Windows XP
> itself, research firm Devil Mountain
> Software found in ... |
This is built into Firefox. Open up about:config, search for 'ntlm'
The setting you're looking for is called network.automatic-ntlm-auth.trusted-uris and accepts a comma-space delimited list of your proxy server uris.
This will make FireFox automatically send hashed copies of your windows password to the proxy, w... |
|64-bit|development-environment|compatibility| |
We are getting new dev machines and moving up to Vista 64 Ultimate to take advantage of our 8gb ram. Our manager wants us to do all dev in 32bit virtual machines to make sure there will be no problems with our code moving into production.
Is there any way to guarantee the resultant programs will work on 32bit os'... |
The original intent was that GET was used for getting data back and POST was to be anything. The rule of thumb that I use is that if I'm sending anything back to the server, I use POST. If I'm just calling an URL to get back data, I use GET. |
I would go for a freetext field and a field that contains a purely numeric version of the phone number. I would leave the representation of the phone number to the user and use the normalized field specifically for phone number comparisons in TAPI-based applications or when trying to find double entries in a phone dire... |
The original paper should be thought of as "Unconditional GOTO Considered Harmful". It was in particular advocating a form of programming based on conditional (`if`) and iterative (`while`) constructs, rather than the test-and-jump common to early code. `goto` is still useful in some languages or circumstances, where n... |
My general rule of thumb is to use Get when you are making requests to the server that aren't going to alter state. Posts are reserved for requests to the server that alter state. |
You can use it for breaking from a deeply nested loop, but most of the time your code can be refactored to be cleaner without deeply nested loops. |
erickson is on the the right track.
On the areas of the site that are prone to session-timeout due to "complex forms/user interaction where there are few if no round trips to the server", you can place a keepalive control to keep pinging the server, thus keeping the session alive.
[Here][1] is a sample control th... |
i use post when i dont want people to see the querystring or when the querystring gets large. also, post is needed for file uploads.
i dont see a problem using get though, i use it for simple things where it makes sense to keep things on the query string.
using get will allow linking to a particular page possibl... |
Stopping keystrokes from being lost in a web application |
|javascript|user-input| |
Preventing the loss of keystrokes between pages in a web application |
While that error message is on the screen (before the rollback begins) go to Control Panel -> Administrative Tools -> Services and see if the service is actually installed. Also check what account it is using to run as. If it's not using Local System, then double and triple check that the account it's using has right... |
Embed a WebBrowser control, and use a [technique like this][1] to do some javascript scrolling of the HTML content of your choice.
[1]: http://articles.techrepublic.com.com/5100-22_11-5076826.html |
The canonical answer is "test anything that can possibly break." If you are sure the properties won't break, don't test them.
And once something is found to have broken (you find a bug), obviously it means you need to test it. Write a test to reproduce the bug, watch it fail, then fix the bug, then watch the test ... |
One way would be to move to a "stable trunk" model.
- Make a branch from trunk to use as your working area.
- Stop making commits directly to trunk - have everyone switch to the development branch.
- Have trunk checked out by the people who are managing stable releases, ensure they have commit rights.
- W... |
Instead of using an infinite loop, make a timer that keeps firing every n seconds - you'll get the 'run forever' aspect without the browser hang. |
Expose the resource property you want to consume in the page as a protected page property. Then you can just do use "this.ResourceName" |
You need an [Alert](http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Alert.html):
>An alert is a screen that shows data to the user and waits for a certain period of time before proceeding to the next Displayable. An alert can contain a text string and an image. The intended use of Alert is ... |
Scene graphs for drawing graphics in games and multimedia applications heavily use trees and graphs. Nodes represents objects to be rendered, transformations, controls, groups, ...
Scene graphs usually have multiple layers and attributes which mean that you can draw only some node of a graph (attributes) in a speci... |
If you are building on the command line you could tell it to be verbose and capture all of the output to a text file to archiving with each build.
eg, msbuild <build_file> > myfile.txt |
I think that OpenID is definitely worth looking at. Besides giving you a framework in which to provide a unified id for customers, it can also provide large businesses with the ability to manage their own logins and provide a common login across all products that they use, including your own. This isn't that large of... |
I think that OpenID is definitely worth looking at. Besides giving you a framework in which to provide a unified id for customers, it can also provide large businesses with the ability to manage their own logins and provide a common login across all products that they use, including your own. This isn't that large of... |
In WPF and Silverlight the binding infrastructure takes care of the switching to the UI thread. |
Emacs ships with url.el and url-http.el. Although http-get.el, http-post.el and http-cookies.el are in vogue today. Here's the GitHub link where you can get it from.
[http://github.com/wfarr/dotfiles/tree/master/.elisp][1]
Any other suggestions are also welcome.
[1]:
http://github.com/wfarr/dotfiles/tree/master... |
This is a classic example of encapsulation in object-oriented design.
A Form is an object whose responsibility is to present UI to the user and accept input. The interface between the Form object and other areas of the code should be a data-oriented interface, not an interface which exposes the inner implementation ... |
If you're using a .NET form you can just flick to the HTML view and use the marquee html element:
http://www.htmlcodetutorial.com/_MARQUEE.html
To be honest it's not great and I wouldn't use it for a commercial job since it can come across as a bit tacky - mainly because it's been overused on so many bad sites in... |
Here's a good place to start:
http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html
http://java.sun.com/developer/technicalArticles/releases/j2se15/
|
Is there a way to tell WCF to use security in the request, but ignore it on the response? |
|wcf|soap|axis| |
We have to connect to a third party SOAP service and we are using WCF to do so. The service was developed using Apache AXIS, and we have no control over it, and have no influence to change how it works.
The problem we are seeing is that it expects the requests to be formatted using Web Services Security, so we are do... |
You can use the [casting operators][1]:
$myText = (string)$myVar;
There are more details for string casting and conversion in the [Strings section][2] of the PHP manual, including special handling for booleans and nulls.
[1]: http://us3.php.net/manual/en/language.types.type-juggling.php
[2]: http://... |
Regular macros operate on lists of objects. Most commonly, these objects are other lists (thus forming trees) and symbols, but they can be other objects such as strings, hashtables, user-defined objects, etc. These structures are called [s-exps][1].
So, when you load a source file, your Lisp compiler will parse the ... |
Regular macros operate on lists of objects. Most commonly, these objects are other lists (thus forming trees) and symbols, but they can be other objects such as strings, hashtables, user-defined objects, etc. These structures are called [s-exps][1].
So, when you load a source file, your Lisp compiler will parse the ... |
The biggest problem I've noticed with controls in ASP.Net is that you can't easily get designer support for both building the control _and_ using the control in a site once you built it. The only way I've been able to do that is create an .ascx control with no code-behind (ie: all the server-side code is in a script ... |
|asp.net|image|memorystream| |
Web 2.0 CSS Color Combinations |
|web-2.0| |
What are the most user-friendly color combinations for Web 2.0 websites, such as background, button colors, etc.? |
|colors|color-scheme| |
|colors|color-scheme| |
Web 2.0 Color Combinations |
|colors|color-scheme| |
|colors|color-scheme| |
iPhone App Crashing - Error Question |
|iphone|image|user-interface|audio| |
I'm writing my first iPhone app, so I haven't gotten around to figuring out much in the way of debugging.
Essentially my app displays an image and when touched plays a short sound.
When compiling and building the project in XCode, everything builds successfully, but when the app is run in the iPhone simulator, it cra... |