instruction
stringlengths
0
30k
I'm not sure how best to approach the problem in your specific environment, but I'd suggest reading up on Rail's migrations feature for some inspiration on how to get started. [http://wiki.rubyonrails.org/rails/pages/UnderstandingMigrations][1] [1]: http://wiki.rubyonrails.org/rails/pages/UnderstandingMigrat...
Binding custom functions to DOM events in prototype?
|javascript|dom|prototype|
Jquery has a great language construct that looks like this: $(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); As you might guess this, once the document has loaded, binds a custom function to the onClick event of all ***a*** tags. Th...
I would ensure that the UI layer is referencing the appropriate 'debug' .dll's. I'd also consider pressing CTRL+ALT+U (**Modules View**) when you're debugging to see if symbols are loaded for your BLL and DAL .dlls. If not then Visual Studio is unable to find .PDBs for that file. Are **debug files (.PDBs) in the same d...
This would actually be a good question to ask on an interview as it is simple enough that you could write up on a white board, but complex enough that it might trip someone up if they don't think carefully enough about it. Also, you can also for two different answers which cause the implementation to be quite different...
<%@ WebService Class="flightinfo.Soap,flightinfo" %> What is the name of your class?
Good challenges/tasks/exercises for learning or improving object oriented programming (OOP) skills.
|oop|
What is a good challenge to improve your skills in object oriented programming? The idea behind this poll is to provide an idea of which exercises are useful for learning OOP. The challenge should be as language agnostic as possible, requiring either little or no use of specific libraries, or only the most common...
|git|macos|
Can anyone recommend a good repository viewer for Git, similar to gitk, that works on Mac OS X Leopard? (I'm not saying gitk doesn't work) Of course I would like a native Mac application, but as I haven't found any, what are the best options to gitk? I know about gitview, but I'm looking forward to evaluate as ma...
Can anyone recommend a good repository viewer for Git, similar to gitk, that works on Mac OS X Leopard? (I'm not saying gitk doesn't work) Of course I would like a native Mac application, but as I haven't found any, what are the best options to gitk? I know about gitview, but I'm looking forward to evaluate as ma...
|macos|git|
|macos|version-control|git|
You can't upload file(s) via `AJAX` only by reloading a whole `HTML` document. You should either use `iframe`s if you prefer pure HTML (this is more common, eg. used by WordPress) or something else like swfupload suggested by Sven.
Looks like the registry location is `HKLM\Software\Microsoft\VisualStudio`, with version-specific subkeys for each install. In PowerShell: (Get-ItemProperty HKLM:\Software\Microsoft\VisualStudio\9.0).InstallDir [Adapted from [here](http://irfanyar.wordpress.com/2008/06/07/locate-the-installation-directory-...
*Environment:* Thanks to Zeb and Sam for the `VS*COMNTOOLS` environment variable suggestion. To get to the IDE in PowerShell: $vs = "$VS90COMNTOOLS..\IDE\devenv.exe" --- *Registry:* Looks like the registry location is `HKLM\Software\Microsoft\VisualStudio`, with version-specific subkeys for each install. I...
*Environment:* Thanks to Zeb and Sam for the `VS*COMNTOOLS` environment variable suggestion. To get to the IDE in PowerShell: $vs = Join-Path $env:VS90COMNTOOLS '..\IDE\devenv.exe' --- *Registry:* Looks like the registry location is `HKLM\Software\Microsoft\VisualStudio`, with version-specific subkeys for ...
How do you organise multiple git repositories?
|git|organizing|
With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could checkout the entire thing. Now, I have a ...
* Attach the debugger to ASP.NET process and click on the modules window. Ensure that debugging symbols are loaded for the assemblies you want to debug. * Make sure the UI is referencing the debug assemblies, not release assemblies. * Make sure the .PDB files are in the /bin/debug/ directory * Make sure you rebuild ...
From an SMTP point of view, a better way to handle this is to reject the RCPT request at some point during the SMTP transaction. This way, your server isn't responsible for sending any blowback to the alleged sender. I don't know how to configure IIS to do this specifically, but you certainly can with [Postfix](http...
I've always wondered why the possibility that the file was previously stored in a different physical location on the disk isn't considered. For example, if a defrag has just occurred there could easily be a copy of the file that's easily recoverable somewhere else on the disk.
HTTPS with Visual Studio's built-in ASP.NET Develpment Server
|asp.net|visual-studio|visual-studio-2008|
Is there a way to access Visual Studio's built-in ASP.NET Development Server over HTTPS?
First of all, I would recommend refactoring much sooner than when you are done with the first version of the class. Anytime you see duplication, eliminate it ASAP. This may take a little longer initially, but I think the results end up being a lot cleaner, and it helps you rethink your code as you go to ensure you ar...
I have the same thing. I assume you're working with Cassini (the integrated web server). I've yet to find an answer to that (I just go back to VS and press *Shift+F5* to stop the debugger), but I can tell you that if you check the *"Edit and Continue"* box in the project's properties (web tab), your web server will ...
Thanks for the responses and ideas guys - I had already tried all of those or variations of them. I think that it must be a very subtle VS bug. A colleague suggested I make the function that I was trying to break on public (previously "undefined" so was implicitly private) and try again. I did this and the breakpoin...
profile-guided optimization (C)
Groovy: main() $ groovy stack.groovy: Caught: java.lang.StackOverflowError at stack.main(stack.groovy) at stack.run(stack.groovy:1) ...
That can be annoying, the name overloading in Scala's collections is one of its big weaknesses. For what it's worth, if you had `scala.collections._` imported, you could probably have written your `HashMap` type as: new HashMap[ Integer, mutable.Set[ TreeNode ] ]
What is the best way to store big files in Plone 3?
|plone|
I want to serve a lot of big files in a Plone site. By big files I mean around 5MB (music) and a lot of them. I've already do it straight to the ZODB, not a good idea. I'm running Plone 3.1.1 and Zope 2.10.6.
It depends on the language you wrote your function in. Some languages like C are very low-level, translating each function call or statement to specific assembly statements. If you did use C, you can replace your function with inline assembly to improve performance. Other high-level languages may convert each stat...
Just FYI, here's an alternate implementation... Probably violates about 15 million pythonic rules, but I publish it per information/observation: class Resettable(object): base_dict = {} def reset(self): self.__dict__ = self.__class__.base_dict def __init__(self): ...
Never. They are removed in XHTML 2.0 as they are presentational tags. CSS should be used to bold/italicise content.
Never. They are removed in XHTML 2.0 as they are presentational tags. CSS should be used to bold/italicise content. **edit:** If you're looking for a purely presentational tag, that's what the `SPAN` tag with a class and a little CSS is for.
Publishing Website fails for some pages
|asp.net|c#|.net|.net-2.0|
|c#|.net|asp.net|.net-2.0|
I have a strange problem when I publish my website. I inherited this project and the problem started before I arrived so I don't know what conditions lead to the creation of the problem. Basically, 3 folders below the website project fail to publish properly. When the PrecompiledWeb is transferred to the host these ...
Some other reasons to choose Firefox: - [Firebug](http://getfirebug.com/) - [Web Developer](https://addons.mozilla.org/en-US/firefox/addon/60) - [Tamper Data](https://addons.mozilla.org/en-US/firefox/addon/966) These addons make it a lot easier to develop web application for.
@Will - these things that define types are called [uniform type identifiers][1]. The problem is they are a combination of extensions (like .txt) and generic types (i.e. public.plain-text matches a txt file without the txt extension based purely on content) so it's not as simple as looking for an extension. RichTe...
@Will - these things that define types are called [uniform type identifiers][1]. The problem is they are a combination of extensions (like .txt) and generic types (i.e. public.plain-text matches a txt file without the txt extension based purely on content) so it's not as simple as looking for an extension. RichTe...
What are the differences between GNU v2 and GNU v3 licenses?
|licensing|
In simple terms, what are the reasons for, and what are the differences between the GNU v2 and GNU v3 open source licenses? Explanations and references to legal terms and further descriptions would be appreciated.
What are the differences between GPL v2 and GPL v3 licenses?
In simple terms, what are the reasons for, and what are the differences between the GPL v2 and GPL v3 open source licenses? Explanations and references to legal terms and further descriptions would be appreciated.
|c++|c|optimization|compiler|gcc|
Anyone know how to use the most of the compilers? It seems GCC support that. What is the real gain? In which case it's good? Inner loops?
Anyone know this compiler feature? It seems GCC support that. How does it work? What is the potential gain? In which case it's good? Inner loops? (this question is specific, not about optimization in general, thanks)
Cassini does not support HTTPS. However, you can use IIS to do this, if your using IIS 5.1, download the MS IIS toolpack for IIS 6.0, it comes with a tool to create self signed SSL certificates. This works on IIS 5.1 http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&Dis...
Certainly a good challenge, although less accessible than a "start from scratch" assignment, is to refactor some existing code that either doesn't use inheritance or doesn't use very much of it to make greater use of inheritance. The process of refactoring will expose a lot of the benefits and gotchas of oop, as it ce...
Silverlight Install Base - How big is it?
|apache-flex|silverlight|installation|
Silverlight v2.0 is getting closer and closer to RTM but I have yet to hear any stats as to how many browsers are running Silverlight. If I ask Adobe (by googling "Flash install base") they're [only too happy to tell me][1] that 97.7% of browsers are running Flash player 9 or better. Not that I believe everything I ...
> const has a funny way of propagating through your code. Thus, it's a really good idea to start using const as early and as often as possible. Deciding to start const-ifying your code late in the game can be painful (easy, but annoying). Additionally, you will easily run into problems if methods that should be cons...
|.net|sql|linq-to-sql|iis|caching|
We've just started using LINQ to SQL at work for our DAL & we haven't really come up with a standard for out caching model. Previously we had being using a base 'DAL' class that implemented a cache manager property that all our DAL classes inherited from, but now we don't have that. I'm wondering if anyone has come u...
|.net|sql|iis|caching|linq-to-sql|
|.net|sql|iis|linq-to-sql|caching|
We've just started using LINQ to SQL at work for our DAL & we haven't really come up with a standard for out caching model. Previously we had being using a base 'DAL' class that implemented a cache manager property that all our DAL classes inherited from, but now we don't have that. I'm wondering if anyone has come u...
Javascript: To trim a few more characters, and to get ourselves kicked out of more software shops, let's go with: eval(i='eval(i)');
Try Ctrl-x followed by Ctrl-b (C-x C-b) to list buffers.
The point is to keep the display logic separate from the rest of the code. In any complex site you'll have code mixed in with your HTML, but the code should be for display purposes only. It shouldn't be doing any complex calculations. For example, templates will contain loops and conditionals. Plus you'll probably h...
cout << text_ << i << endl;
cout << text << " " << i << endl;
[JXL][1] for Excel workbook creation/edition. I work in a bank and the multipurpose report tool for diary work is Excel. Whatever appliction we do must import/export from/to Excel. The only fail it's that it has memory problems with large workbooks and formating it's a little obscure [1]: http://jexcelapi.source...
I hate when developers print() a bunch of html. It's completely unnecessary and looks ugly in any text editor that shows print/echo strings in red.
Well, having never used Boo, my (educated) guess is that it's for passing parameter to the closure lambda-style functions. In this case, { p | C } refers to an anonymous function taking a single parameter bound to p within the code C.
The documentation of Boo seems to be lacking in this area -- it seems that setter = { value | a = value } is shorthand for setter = def(value): a = value
Also you should remember that [IPv4][1] and [IPv6][2] are different lengths. [1]: http://en.wikipedia.org/wiki/IPv4 [2]: http://en.wikipedia.org/wiki/IPv6
[Robert S.](#32778) is completely correct; for example:- class A { static void Main() { Func<int, bool> func = i => i > 100; Predicate<int> pred = i => i > 100; Test<int>(pred, 150); Test<int>(func, 150); // Error } static void Test<T>(Predicate<T> pre...
Dependency properties are static because of a key optimization in WPF: Many of the controls in WPF have tens, if not hundreds of properties. Most of the properties in these classes are set to their default value. If DP's where instance properties, memory would need to be allocated for every property in every object ...
By the way, the structure you're giving as an example already exist in the Java base class library as `java.awt.Point`. It has x and y as public fields, [check it out for yourself][1]. If you know what you're doing, and others in your team know about it, then it is okay to have public fields. But you shouldn't rely ...
[ASP.NET] Conditional Redirect on Login
|asp.net|forms-authentication|
I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method always redirects to the default page in web.config....
How exactly do you configure httpOnlyCookies in ASP.NET?
|asp.net|xss|
Inspired by this CodingHorror article, "[Protecting Your Cookies: HttpOnly][1]" How do you set this property? Somewhere in the web config? [1]: http://www.codinghorror.com/blog/archives/001167.html
see [Question: Making sure a webpage is not cached, across all browsers.](/questions/49547/making-sure-a-webpage-is-not-cached-across-all-browsers) <http://beta.stackoverflow.com/questions/49547/making-sure-a-webpage-is-not-cached-across-all-browsers> I think this should help out with your problem too.
see [Question: Making sure a webpage is not cached, across all browsers.](/questions/49547/making-sure-a-webpage-is-not-cached-across-all-browsers#49549) <http://beta.stackoverflow.com/questions/49547/making-sure-a-webpage-is-not-cached-across-all-browsers#49549> I think this should help out with your problem too.
I was also thinking using procmail to start some script. There is also formail, which might come in handy to change or extract headers. If you have admin access to the mail server, you could also use /etc/aliases and just pipe to your script. Besides usability issues, you should really think about security - it's ac...
How to limit result set size for arbitrary query in Ingres?
|sql|oracle-database|ingres|
In Oracle you can limit the number of rows returned in an arbitrary query by filtering on the "virtual" rownum column. e.g. <pre>select * from all_tables where rownum &lt;= 10</pre> will return at most 10 rows. Is there a simple generic way to do something similar in Ingres?
You should check [CVSNT][1] as server and use any of the clients you would like (standalone or integrated with your IDE). There are plenty of them. [1]: http://www.cvsnt.org/
[Subversion][1] is great -- you can run the server yourself our use something like http://www.assembla.com to host your code (although that exposes it to the network). There are numerous gui applications like [tortoise svn][2] that would allow you to interact w/ the source control repo [1]: http://subversion....
I like the Keyword: continue; In a loop if you hit a condition and don't want to do anything but advance the loop just stick in "continue;" eg foreach(object o in ACollection) { if(NotInterested) continue; }
I'm [currently][1] writing a library for embedding Perl in C++, but it's not finished yet. In any case I would recommend against using the EP library. Not only has it not been maintained for years, but is also has some severe architectural deficiencies and is rather limited in its scope. If you are interested in alpha ...
I'm [currently][1] writing a library for embedding Perl in C++, but it's not finished yet. In any case I would recommend against using the EP library. Not only has it not been maintained for years, but is also has some severe architectural deficiencies and is rather limited in its scope. If you are interested in alpha ...
One of the things I do, is try to make small and simple methods that I can see on a single page in my editor (visual studio). I've learnt from experience that making code simple makes it easier for the compiler to optimise it. The larger the method, the harder the compiler has to work! I've also recently seen a p...
1. Multiple all the numbers by 10 until you have integers. 2. Divide by 2,3,5,7 while you still have all integers. I think that covers all cases. 2.1 * 10/7 -> 3 0.008 * 10^3/2^3 -> 1 That's assuming your multiplier can be a rational fraction.
A couple of suggestions. The first one is to check the status of the breakpoint in the source line. Is it a solid red ball? If not, it generally indicates that the file in question isn't the one used for the build. Secondly - have a look at the modules view and see what module and symbols have been loaded. You may fi...