instruction
stringlengths
0
30k
|javascript|php|download|
On a PHP-based web site, I want to send users a download package after they have filled out a short form. The site-initiated download should be similar to sites like download.com, which say "your download will begin in a moment." A couple of possible approaches I know about, and browser compatibility (based on a qui...
You are best using a ObjectDataSource when you wnt to do more complex Linq and bind your Grid to the ObjectDataSource. You do however need to watch out for Anonymous types that could give you some trouble, but anything is posible...
In short, you may either parse the whole page and pick things you need(for speed I recommend looking at SAXParser) or running the HTML through a regexp that trims of all of the HTML... you can also convert it all into DOM, but that's going to be expensive especially if you're shooting for having a decent throughput.
If you are using Windows the traditional place to start is [Petzold](http://www.amazon.com/Programming-Windows®-Fifth-Microsoft/dp/157231995X/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1221565730&sr=8-1) There is a nice simple framework [here](http://users.bigpond.net.au/programming/) which will help you on the way withou...
You seem to want to screen scrape. You would probably want to write a framework which via an adapter / plugin per source site (as each site's format will differ), you could parse the html source and extract the text. you would prob use java's io API to connect to the URL and stream the data via InputStreams.
Sorry, FF / Chrome both report this error but in very silent way. You need to go to Firefox 3.0 Javascript errors dialog to see if is there any error and for Chrome you need to go to Javascript console. In my view, there should be at least some UI indications (like icon would turn RED), for such errors in FF 3.0 as ...
[PL/SQL Developer][1] from Allaround Automations.<p> I happily paid the $200 or so price for this.<p> Excellent IDE (+ good Intellisense) with easy creation and editing of PL/SQL packages, SPs, Triggers etc So much better than Toad. [1]: www.allroundautomations.com/plsqldev.html
[PL/SQL Developer][1] from Allaround Automations.<p> I happily paid the $200 or so price for this.<p> Excellent IDE (+ good Intellisense, + debugging capability) with easy creation and editing of PL/SQL packages, SPs, Triggers etc So much better than Toad. [1]: www.allroundautomations.com/plsqldev.html
How to change Firefox icon?
|firefox|icons|
Is there any way to change Firefox system icon (the one on the left top of the window)?
Is there any way to change Firefox system icon (the one on the left top of the window)? Precision : I want to change the icon of a bundled version of Firefox with apache/php and my application. So expert tools like Resourcehacker wich have a Gui, or manual operation are not a solution.
Is there any way to change Firefox system icon (the one on the left top of the window)? Precision : I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation is not a solution. I try Resource Hacker and making a specific extension and I come back with solutio...
|c#|asp.net|http|caching|
While writing a custom IHttpHandler I came across a behavior that I didn't expect concerning the HttpCachePolicy object. My handler calculates and sets an entity-tag (using the SetETag method on the HttpCachePolicy associated with the current response object). If I set the cache-control to public using the SetCachea...
While writing a custom IHttpHandler I came across a behavior that I didn't expect concerning the HttpCachePolicy object. My handler calculates and sets an entity-tag (using the SetETag method on the HttpCachePolicy associated with the current response object). If I set the cache-control to public using the SetCachea...
Well, this is an obvious one, but iGoogle seems to do a great job for me.
You could include, with your setup package, a program called Quicktime Lite. It comes with the same libraries as Quicktime uses, but is much, much smaller. Here"s the link: [Download Quicktime Lite][1] [1]: http://www.codecguide.com/qt_lite.htm
Making a game in C++ using parallel processing
|c++|graphics|sdl|opengl|directx|
I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) <pre> Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the sta...
I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) <pre> Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the sta...
|c++|graphics|opengl|directx|sdl|
On a PHP-based web site, I want to send users a download package after they have filled out a short form. The site-initiated download should be similar to sites like download.com, which say "your download will begin in a moment." A couple of **possible approaches** I know about, and browser compatibility (based on a...
On a PHP-based web site, I want to send users a download package after they have filled out a short form. The site-initiated download should be similar to sites like download.com, which say "your download will begin in a moment." A couple of **possible approaches** I know about, and browser compatibility (based on a...
How can I exclude the bin folder from sourcesafe in a Visual Studio 2008 web application?
|visual-studio-2008|web-applications|visual-sourcesafe|
How can I exclude the bin folder from SourceSafe in a Visual Studio 2008 web application? I want to be able to check in everything recursively from the solution node without picking up anything in the bin folder.
There is a nice book about this topic: [Spidering Hacks by Kevin Hemenway and Tara Calishain][1]. [1]: http://oreilly.com/catalog/9780596005771/
You might try launching a modal from JavaScript using the JavaScript integration (see http://www.raditha.com/java/mayscript.php for an example). The JavaScript you would need would be something like: function getPassword() { return prompt("Enter Password"); } And the Java would be: pass...
While writing a custom IHttpHandler I came across a behavior that I didn't expect concerning the HttpCachePolicy object. My handler calculates and sets an entity-tag (using the SetETag method on the HttpCachePolicy associated with the current response object). If I set the cache-control to public using the SetCachea...
While writing a custom IHttpHandler I came across a behavior that I didn't expect concerning the HttpCachePolicy object. My handler calculates and sets an entity-tag (using the SetETag method on the HttpCachePolicy associated with the current response object). If I set the cache-control to public using the SetCachea...
I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) <pre> Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the sta...
I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) <pre> Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the sta...
How do you iterate through every file/directory recursively in standard C++
|c++|filesystems|
How do you iterate through every file/directory recursively in standard C++
From Ruby 1.9 Proc#--- is an alias to Proc#call, which means Proc objects can be used in case statements like so: def multiple_of(factor) Proc.new{|product| product.modulo(factor).zero?} end case number when multiple_of(3): puts "Multiple of 3" when multiple_of(7): puts "Multupl...
From Ruby 1.9 Proc#=== is an alias to Proc#call, which means Proc objects can be used in case statements like so: def multiple_of(factor) Proc.new{|product| product.modulo(factor).zero?} end case number when multiple_of(3): puts "Multiple of 3" when multiple_of(7): puts "Multupl...
Properties should be fast, as they have a certain promise of just being there. They are also mandatory for databinding. And they should have **no side-effects**.
If using python, take a good look at Beautiful Soup (http://crummy.com/software/BeautifulSoup). An extremely capable library, makes scraping a breeze.
If you want to build the debug variants of the boost libraries as well, you have to invoke bjam with the option `--build-type=complete`. On Debian, you get the debug Python interpreter in the python2.x-dbg packages. Debug builds of the Boost libraries are in libboost1.xy-dbg, if you want to use the system Boost.
You need to call OS-specific functions for filesystem traversal, like `open()` and `readdir()`. The C standard does not specify any filesystem-related functions.
Recall that the Validator interface defines two methods: boolean supports(Class clazz) void validate(Object target, Errors errors) The "Object target" is your form object, which is the whole object representing the page to be shown to the user. The Errors instance will contain the errors that will be di...
You might want to look at distributed compiling, see for example [distcc][1] [1]: http://distcc.samba.org/
Your design is feasible, and I'm as big a fan of normalization as the next guy, but you really have to find a balance somewhere. So to begin, I think you're right that having fields like address1, address2, address3, etc... is bad practice. And if you are planning on handling many different types of mailing addresse...
There is a [STSADM Custom Extension: move web][1] that should be what you are looking for: > C:\>stsadm -help gl-moveweb > >stsadm -o gl-moveweb > >Moves a web. > >Parameters: > -url <url of web to move> > -parenturl <url of parent web> > [-haltonwarning (only considered if moving to a ...
How would you implement FORM based authentication without a backing database?
|php|authentication|cookies|cgi|http|
I have a PHP script that runs as a CGI program and the HTTP header Authenticate header gets eaten and spit out. So I would like to implement some kind of FORMs based authentication. Worse yet, I have no database, so can't store session info. I am very open to having master username and password. I just need to prote...
|php|http|authentication|cookies|cgi|
I have a PHP script that runs as a CGI program and the HTTP `Authenticate` header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can be stored. I am very open to having a master username and password. I jus...
I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) <pre> Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the sta...
Sure: File tmp = new File ("tmp"); tmp.mkdirs(); Process unjar = new ProcessBuilder ("jar", "-xf", "myjar.jar", tmp.getName ()).start(); unjar.waitFor(); // TODO read and update persistence.xml Process jar = new ProcessBuilder ("jar", "-cf", "myjar.jar", tmp.getName()).start(); j...
I agree with chakrit, objects of different types should be allowed to be semantically equal if they have the same data or ID. Personally, I use the following: public override bool Equals(object obj) { var other = obj as MyClass; if (other == null) return false; ...
If you're looking for the source-control a bug-tracking functionality that TFS provides, there are a number of free products out there that can do it for youm like CVS or Subversion if you want something open source. I prefer Sourcegear's products (they're free for single developers) - Vault if you're just looking f...
Looks like it's been done with Visual Studio 2005: [http://wiki.qgis.org/qgiswiki/Building_QT_4_with_Visual_C%2B%2B_2005][1] I'd imagine it would work with Visual Studio 2008, even if it requires some changes. [1]: http://wiki.qgis.org/qgiswiki/Building_QT_4_with_Visual_C%2B%2B_2005 "Building QT 4 with Visua...
Is there any way to change Firefox system icon (the one on the left top of the window)? Precision : I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation on each computer is not a solution. I try Resource Hacker and it's the good solution. The add ons one...
It is not likely that "with" would make the code run faster, it is more likely that the compiler would compile it to the same executable code. The main reason people don't like "with" is that it can introduce confusion about namespace scope and precedence. There are cases when this is a real issue, and cases when...
You have been able to load Assemblies from the network at leasst from .NET 2.0. I have used this on a previous project. The only thing to watch is the size of the assembly and the number and size of the dependancies that it is loading. If you are using a seperate AppDomain, then you will need to take special conside...
Get Visual Studio Express, and start with a MFC "Dialog Based" application. All the window toolkits mentioned are good, but MFC will look the best on a resume!
You could look at how httpunit does it. They use couple of decent html parsers, one is nekohtml. As far as getting data you can use whats built into the jdk (httpurlconnection), or use apache's http://hc.apache.org/httpclient-3.x/
Just wanted to chime in: I would agree this is a bug in the lib code. It should probably read: unless Amazon::AWS::Error.const_defined?( err_class ) kls = Class.new( StandardError ) Amazon::AWS::Error.const_set(err_class, kls) kls.include Amazon::AWS::Error ...
I find that http://www.rescuetime.com/ lets me know what I was actually doing all day, rather than what I THINK I was doing! It also lets you put a "productive" level on each process/website you run or do so you can see how productive you are being.
Topology drawing tool
|topology|
I need to draw some simple network topology charts, suggestions of some good tools appreciated. Edit: love freeware :-)
You must deploy to the GAC. http://www.developerdotstar.com/community/node/333
Encourage people to push their correspondence with you down the distraction chain: 1. Phone / Face-to-face 2. Instant messaging 3. Email You can do this by deffering them: "I'm really busy right now, can you send me it in an email?" This should reduce the amount of interruptions you receive allowing you...
It all depends on how properly your HTML to scrape is? If it's valid XHTML, you can simply use some XPath queries on it to get whatever you want. Example of xpath in php: http://blogoscoped.com/archive/2004_06_23_index.html#108802750834787821 A helper class to scrape a table into an array: http://www.tgreer.com/c...
I have tried screen-scraping before, but I found it to be very brittle, especially with dynamically-generated code. I found a third-party DOM-parser and used it to navigate the source code with Regex-like matching patterns in order to find the data I needed. I suggested trying to find out if the owners of the site ...
I suspect that I'll need to use a filter to add a response wrapper, which'll add the flag to all cookies as they're added by the framework.
$ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window. xwininfo: Window id: 0x1200007 "xeyes" Absolute upper-left X: 1130 Absolute upper-left Y: 0 Relative upper-left...
I guess it depends on what triggers the update to take place, if it is in a validation routine you could simply call that after the user clicks OK on editing the data. Your question is vague it would be easier to answer with more information. What is this interaction? Is it a dialog? What actually updates the data?
Yes that may, since your allocating with new[] but deallocating with delelte, yes malloc/free is safer here, but in c++ you should not use them since they won't handle (de)constructors. Also your code will call the constructor, but not the constructor. For some structs this may cause a memory leak (if the constructo...
Yes that may, since your allocating with new[] but deallocating with delelte, yes malloc/free is safer here, but in c++ you should not use them since they won't handle (de)constructors. Also your code will call the deconstructor, but not the constructor. For some structs this may cause a memory leak (if the construc...
What is the difference between lambdas and delegates in the .NET Framework?
|php|https|authentication|cookies|cgi|
|php|http|authentication|cookies|cgi|
Reading "chunked" response with HttpWebResponse
|c#|.net20|.net-3.5|http|
I'm having trouble reading a "chunked" response when using a StreamReader to read the stream returned by GetResponseStream() of a HttpWebResponse: // response is an HttpWebResponse StreamReader reader = new StreamReader(response.GetResponseStream()); string output = reader.ReadToEnd(); // throws except...
|c#|.net-3.5|http|.net-2.0|
|c#|.net-3.5|https|.net-2.0|
|c#|.net-3.5|http|.net-2.0|
Could you explain what you have to do in maintaining the code? Do you really have to modify the code? If you can get away by modifying just the interface to that code instead of the code itself, that would be the best. The inherent problem when dealing with a large scientific code (not just FORTRAN) is that the und...
In a trivial case like this, I would go with overloading. That is: getEmployeeName( int batchID ); getEmployeeName( Object SSN ); etc. Only in special cases would I specify the argument type in the method name, i.e. if the type of argument is difficult to determine, if there are several types of a...
Best way to let users download a file from my website: http or ftp
|http|ftp|download|
<p>We have some files on our website that users of our software can download. Some of the files are in virtual folders on the website while others are on our ftp. The files on the ftp are generally accessed by clicking on an ftp:// link in a browser - most of our customers do not have an ftp client. The other files are...
The built-in vnc seems to have very little configurability that I can see. As an alternative, you can try using [osxvnc][1] which I believe allows different bit depths [1]: http://sourceforge.net/projects/osxvnc/
The question is, *"What book really made an impact of how you work as a developer?"* Without any doubt, **Programming Windows with MFC**, by Jeff Prosise, is the book that had the greatest impact on HOW I work as a developer. It did not teach me the fundamentals of "programming" but it opened the world of Windows pla...
Even if you were to return an Object (which maps to a Variant in COM Interop), that doesn't solve your problem. VB will be able to "hold" onto it and "pass it around", but it won't be able to do anything with it. Technically, there is no exact equivalent in VB for a string[][]. However, if your array is not "jagged"...
Why not something like: <li id="uncheck_tagVO-$id">$tagname</li> and $('li').click( function() { var id = this.id.split("_")[1]; $('#'+id).attr("checked","").parent("li").css("color","black"); $(this).remove(); retrieveItems(); });
This is actually a pretty large topic, and fraught with all kinds of potential problems. Most intermediate to advanced books on Access will have some kind of section discussing "Query by Form," where you have an unbound form that allows the user to choose certain criteria, and that when executed, writes on-the-fly SQL ...
You may use HTMLParser (http://htmlparser.sourceforge.net/)in combination with URL#getInputStream() to parse the content of HTML pages hosted on Internet.
Creating a custom menu in .NET WinForms
|c#|.net|winforms|menu|
Using .NET 2.0 with WinForms, I'd like to create a custom, multi-columned menu (similiar to the word 2007 look&feel, but without the ribbon). My approach was creating a control, and using a left/right docked toolstrip, I have constructed a similar look&feel of a menu. However, there are a few shortcomings of this so...