instruction
stringlengths
0
30k
Is there a way to dynamically load a properties file in NAnt?
|.net|automation|nant|build|
ASP.NET Forms Authorization
|asp.net|iis-7|
I'm working on a website built with pure html and css, and I need a way to restrict access to pages located within particular directories within the site. The solution I came up with was, of course, ASP.Net Forms Authorization. I created the default Visual Studio log in form and set up the users, roles, and access rest...
What is a good use of lambda expressions, and how can I learn to use them?
|lambda|c#|
I've read that Lambda Expressions are an incredibly powerful addition to C#, yet I find myself mystified by them. How can they improve my life or make my code better? Can anyone point to a good resource for learning such expressions? They seem cool as hell, but how do they relate to my day-to-day life as an asp.net ...
|c#|lambda|
I've read that Lambda Expressions are an incredibly powerful addition to C#, yet I find myself mystified by them. How can they improve my life or make my code better? Can anyone point to a good resource for learning such expressions? They seem cool as hell, but how do they relate to my day-to-day life as an asp.net ...
Test Driven Development has sort of taken over the term Unit Test. As an old timer I will mention the more generic definition of it. Unit Test also means testing a single component in a larger system. This single component could be a dll, exe, class library, etc. It could even be a single system in a multi-system ...
At what point did you insert your login/password? Did you have a look at the tables that where created? Althought your password must be encrypted, maybe it's worth just checking if your user was actually created.
Check out the [ASP.NET AJAX Calendar Extender](http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx) or [Steve Orr's drop down Calendar control](http://steveorr.net/articles/DropDownCalendar.aspx).
>At what point did you insert your login/password? Did you have a look at the tables that where created? Althought your password must be encrypted, maybe it's worth just checking if your user was actually created. Forms Authentication does not require any form of user database. Steve, can you please paste in your...
How do I convert from a location (address) String to a YGeoPoint in Yahoo Maps API?
|api|yahoo-maps|
I have a list of addresses from a Database for which I'd like to put markers on a Yahoo Map. The [`addMarker()` method][1] on YMap takes a YGeoPoint, which requires a latitude and longitude. However, Yahoo Maps must know how to convert from addresses because `drawZoomAndCenter(LocationType,ZoomLevel)` can take an addre...
Not able to delete directory
|linux|directoryservices|
I am having a frequent problems with my web hosting (its shared) I am not able to delete or change permission for a particular directory. The response is "Cannot delete. Directory may not be empty". I checked the permissions and it looks OK. There are 100s of files in this folder which I dont want. I contacted m...
|linux|
|linux|web-hosting|file-permissions|
One thing to look at -- if you're using Eclipse, check out the ant4eclipse tasks. I use a single build script that asks for the details set up in eclipse (source dirs, build path including dependency projects, build order, etc). This allows you to manage dependencies in one place (eclipse) and still be able to use a...
Is it better to join two fields together, or to compare them each to the same constant?
|sql|join|
For example which is better: select * from t1, t2 where t1.country='US' and t2.country=t1.country and t1.id=t2.id <br>or<br> select * from t1, t2 where t1.country'US' and t2.country='US' and t1.id=t2.id better as in less work for the database, faster results.
For example which is better: select * from t1, t2 where t1.country='US' and t2.country=t1.country and t1.id=t2.id <br>or<br> select * from t1, t2 where t1.country'US' and t2.country='US' and t1.id=t2.id better as in less work for the database, faster results. --- Sybase, and there's an index on both table...
Since it is problematic from performance point of view to store large amounts of data in user Session object, ASP.Net provides some other workarounds on top of what is mentioned in the posts above. [ASP.NET Profile Provider][1] allows you to persist session related information in a database. You can also use [Session S...
If the ordering is most important, you could you a Stack<T> and create a simple struct to store your int, Object pair.
If you have .Net 3.5 you can use the .Reverse() extension method on IEnumerables. EG: foeach (SomeObject o in myDictionary.Values.Reverse()) { // Do stuff to object }
Best way to do a multilingual site in ASP.net
|asp.net|internationalization|multilingual|
I need to do a multilingual website, with urls like www.domain.com/en/home.aspx for english www.domain.com/es/home.aspx for spanish In the past, I would set up two virtual directories in IIS, and then detect the URL in global.aspx and change the language according to the URL Sub Application_Be...
Best way to handle URLs in a multilingual site in ASP.net
|asp.net|internationalization|multilingual|
I need to do a multilingual website, with urls like www.domain.com/en/home.aspx for english www.domain.com/es/home.aspx for spanish In the past, I would set up two virtual directories in IIS, and then detect the URL in global.aspx and change the language according to the URL Sub Application_Be...
I like ORM's because you don't have to reinvent the wheel. That being said, it completely depends on your application needs, development style and that of the team. This question has already been covered http://stackoverflow.com/questions/50346/why-is-parameterized-sql-generated-by-nhibernate-just-as-fast-as-a-store...
PHP - RSS builder
|php|rss|
I have a old website that generate its own RSS everytime a new post is created. Everything worked when I was on a server with PHP 4 but now that the host change to PHP 5, I always have a "bad formed XML". I was using xml_parser_create() and xml_parse(...) and fwrite(..) to save everything. My question is : how do yo...
[Resharper][1]. It's the best productivity tool for any software engineer! [TestDriven.Net][4] is pretty good too. and [GhostDoc][5]. [1]: http://www.jetbrains.com/resharper/index.html [2]: http://www.jetbrains.com/resharper/index.html [3]: http://www.jetbrains.com/resharper/index.html [4]: http://te...
My all-time favorite was the C# Back Book, by Matthew Telles.
You did not mention what language you are using. But if you using C# or VB.NET you can add Debug.Break() or Stop to trigger the prompt to attach debugger to the process. Or as mentioned above just use something like Console.Readline() or MessageBox.Show() to pause starting of process untill you can attach debugger t...
In addition to the solution suggested by Joel Coehoorn -- generate typed datasets or business entities from XSD -- let me add a couple of other approaches: 1. If you use a database that supports XML type like Oracle or MS SQL Server, you can construct XML right in your SQL queries and retrieve XML directly from the...
Erlang has recently gained renewed exposure not only through being used by Twitter, but also by the rise of XMPP driven messaging and implementations such as ejabberd. It sports many of the ideas coming from functional programming being a language designed with that in mind. Initially used to run Telephone switches and...
As suggested you can use JAD to decompile it and view the files. To make it easier to read you can use the JADclipse plugin for eclipse to integrate JAD directly to eclipse or use DJ Java Decompiler which is much easier to use than command line JAD
The application is actually running off of a compiled version of your code. If you modify it it will have to recompile it in order for your changes to work, which means that it will need to swap out the running version for the new compiled version. This is a pretty hard problem - which is why I think Microsoft has ma...
While you should generally prefer `sys.exit` because it is more "friendly" to other code, all it actually does is raise an exception. If you are sure that you need to exit a process immediately, and you might be inside of some exception handler which would catch `SystemExit`, there is another function - `os._exit` -...
You have to code it all yourself -- Poppler only handles the PDF part, you have to write the GUI. Look at the code to [Evince](http://www.gnome.org/projects/evince/) for a good example.
The Pragmatic programmer was pretty good. However one that really made an impact when I was starting out was : <a href="http://www.amazon.com/Windows-95-System-Programming-Secrets/dp/1568843186">Windows 95 System Programming Secrets"</a> I know - it sounds and looks a bit cheesy on the outside and has probably da...
Assembly assembly = Assembly.GetExecutingAssembly(); List<Type> types = assembly.GetTypes(); List<Type> childTypes = new List<Type>(); foreach (Type type in Types) { foreach (Type interfaceType in type.GetInterfaces()) { if (interfaceType.Equals(typeof([yourinterfacetype)) { ...
`char` and `unsigned char` aren't guaranteed to be 8-bit types on all platforms&mdash;they are guaranteed to be 8-bit or larger. Some platforms have [9-bit, 32-bit, or 64-bit bytes][1]. However, the most common platforms today (Windows, Mac, Linux x86, etc.) have 8-bit bytes. [1]: http://www.parashift.com/c++-fa...
I suppose you have problems with converting WinAPI declarations. Sometimes you can get away if you just declare your variable as string or integer because that is the real type of value returned. You can also try marshaling: <MarshalAsAttribute(UnmanagedType.AsAny)> ByRef buff As Object
I suppose you have problems with converting WinAPI declarations. Sometimes you can get away if you just declare your variable as string or integer because that is the real type of value returned. You can also try marshaling: <pre> &lt;MarshalAsAttribute(UnmanagedType.AsAny)&gt; ByRef buff As Object </pre>
Your way is the best way, there's no way to embed windows into tabs without using horrible hacks like `GtkPlug` (which I'd guess you'd be uninterested in if you're using .NET). Look at the code to `gnome-terminal` for an example of how to do this.
Do you mean getting all interfaces in a particular assembly? Have a look at Assembly.GetTypes() method. It returns all the types that can be found in an assembly. All you have to do is to iterate through every returned type and check its Type.IsInterface property. I do beleive that it is not a very efficient way ...
I want to load a different properties file based upon one variable. Basically, if doing a dev build use this properties file, if doing a test build use this other properties file, and if doing a production build use yet a third properties file.
Have you looked at the Yahoo YUI stuff? They have a cross-browser CSS Framework.
MSSQL Standard Edition (32 or 64 bit) will cost around $5K *per CPU socket*. 64 bit will allow you to use as much RAM as you need. Enterprise Edition is not really necessary for most deployments, so don't worry about the $20K you would need for that license. MySQL is only free if you forego a lot of the useful too...
I'm not sure I understood your question, but maybe you want something like this: SELECT id, COUNT(*) AS same_date FROM foo GROUP BY id, date HAVING same_date = 3; This is just written from my mind and not tested in any way. Read the GROUP BY and HAVING section [here][1]. If this is not what you meant, please ...
If you can't/don't use a smart pointer for something (although that should be a huge red flag), type in your code with: allocate if allocation succeeded: { //scope) deallocate() } That's obvious, but make sure you type it *before* you type any code in the scope
This has been asked http://stackoverflow.com/questions/68617/design-question-does-the-phone-dial-the-phonenumber-or-does-the-phonenumber-dia
Also, don't use manually allocated memory if there's a std library class (e.g. vector). Make sure if you violate that rule that you have a virtual destructor.
Note that there's some extra processing necessary if you're using a SQL DateTime field. If you've got that extra time data in there, then you can't just use that column as-is. You've got to normalize the DateTime to a single value for all records contained within the day. In SQL Server here's a little trick to do t...
Database, or Database+Memcache. Generally speaking sessions should not be written to very often. Start with a database solution that only writes to the db when the session data has *changed*. Memcache should be added later as a performance enhancement. A db solution will be very fast because you are only ever looki...
As Adam Tuttle said already, the workaround is on the page that you linked to <!--- Remove BOM from the start of the string, if it exists ---> <cfif Left(responseText, 1) EQ chr(65279)> <cfset responseText = mid(xmlText, 2, len(responseText))> </cfif>
Having a certificate is not enough, you have to configure the web server to encrypt the connections (that is, to use the certificate) for that domain or virtual host. In addition, I think you would just need a single certificate, responses to requests will still be encrypted. And yes, HTTP headers are encrypted as w...
You want to use the DataGridView RowPostPaint method. Let the framework draw the row, and afterwards go back and color in the cell you're interested in. An example is here at [MSDN][1] [1]: http://msdn.microsoft.com/en-us/library/85kxk29c.aspx
How about using a boost::tuple for the coordinates, and storing the tuple as the index for the map?
How about using a boost::tuple for the coordinates, and storing the tuple as the index for the map? (You may also need to do the divide-by-epsilon idea from [this answer](#72269).)
String.Split is just not going to cut it, but a Regex.Split may - Try this one: using System.Text.RegularExpressions; string[] line; line = Regex.Split( input, ",(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))"); Where 'input' is the csv line. This will handle quoted delimiters, and should give you b...
C# is a good answer here - it has a fair garbage collection (although you'd have to profile it quite a bit - to change the way you handle things now that the entire memory handling is out of your hands), it is simple to use, have a lot of examples and is well documented. In the 3D department it gives full support for ...
<h:commandLink id="myCommandLink" action="#{myPageCode.doDelete}"> <h:outputText value="#{msgs.deleteText}" /> </h:commandLink> <script type="text/javascript"> if (document.getElementById) { var commandLink = document.getElementById('<c:out value="${myPageCode.myCommandLinkClientId}" />'); if (commandLi...
My colleague Mike Hadlow has pretty good summary of why we utterly loath MSTest [here][1]. He's managed to remove it from his project, but I'm currently working on a larger project with more politics involved so we're still using it. The upshot of it is that whoever implemented MSTest doesn't understand TDD. I'm...
If you don't mind reading bytecode, javap should work fine. It's part of the standard JDK installation. Usage: javap <options> <classes>... where options include: -c Disassemble the code -classpath <pathlist> Specify where to find user class files -ex...
@ScArcher2 : I agree, Hibernate needs to make a second call to get the newly generated identity UNLESS an advanced generator strategy is used (sequence, hilo...)
I also recommend Simile Timeline... I just implemented a webpage that uses it and JQuery and produces fantastic results. The downside is that you need to implement it through some html page, hook it up with the js and create some xml files, so it probably won't do for a presentational tool. http://infosthetics.com/ ...
You can make your own timeout like this: use LWP::UserAgent; use IO::Pipe; my $agent = new LWP::UserAgent; my $finished = 0; my $timeout = 5; $SIG{CHLD} = sub { wait, $finished = 1 }; my $pipe = new IO::Pipe; my $pid = fork; if($pid == 0) { ...
ResultSet keys = statement.getGeneratedKeys(); Later, just iterate over ResultSet. Kind Regards
In addition to the ones that people already mentioned, Microsoft has "[Microsoft Search Server][1]" and "[Microsoft Search Server Express][2]". The latter is free, the former supports a larger corpus. [1]: http://www.microsoft.com/enterprisesearch/serverproducts/searchserver/default.aspx [2]: http://www.micro...
I have a old website that generate its own RSS everytime a new post is created. Everything worked when I was on a server with PHP 4 but now that the host change to PHP 5, I always have a "bad formed XML". I was using xml_parser_create() and xml_parse(...) and fwrite(..) to save everything. Here is the example when s...
Sort with one option forced to top of list
|sql|sorting|
I have a PHP application that displays a list of options to a user. The list is generated from a simple query against SQL 2000. What I would like to do is have a specific option at the top of the list, and then have the remaining options sorted alphabetically. For example, here's the options if sorted alphabetical...
To show all tables, use SELECT name FROM sqlite_master WHERE type = "table" To show all rows, I guess you can iterate through all tables and just do a SELECT * on each one. But maybe a DUMP is what you're after?
The only way I can come up with in **.net 2.0** is to first copy all the values to an List, then reverse the list and then run the foreach on that list. <pre><code> Dictionary<int, object> d; List<object> tmplist; foreach (object o in d.Values) tmplist.Add(s); tmplist.Reverse(); foreach (objec...
VBA resource for Python programmer
|python|vba|
I've written a lot of code in Python, and I'm very used to the syntax, object structure, and so forth of Python because of it. What's the best online guide or resource site to give me the basics, as well as lookup equivalent functions/features in VBA versus Python. For example, I'm having trouble equating a simpl...
Yes, you need to configure it in your configuration file (probably not web.config for a test library, but app.config). You still use the <system.web> section and within that the <membership> section to do the configuration. Once you have that in place, you'll be able to instantiate your user and go about testing it. ...
Soneone named Anthony Jones in microsoft.public.inetserver.asp.general provided the answer as follows: > In IIS7 IIS manager click in the web > site and double click the ASP icon in > the features view. Expand Limits > Properties and modify the Maximum > Requesting Entity Body Limit. To which I replied: ...
How to send SOAP requests in ISO-8859-1 whith Flex ?
|apache-flex|actionscript|encoding|character-encoding|soap|
Flex uses by default UTF-8. I have not fount a way to specify a different encoding/charset on the actionscript WebService class. Thanks in advance for your help
How to send SOAP requests in ISO-8859-1 with Flex ?
|apache-flex|soap|encoding|actionscript|character-encoding|
Nobody had what I was looking for so I decided to dust off my elisp manual and do it myself. This seems to work well enough, though the output isn't precisely what I asked for. In this version the first option goes on a line by itself instead of staying on the first line like in my original question. (defun tcl-...
Subversion and Siteminder
|siteminder|svn|
Has anyone implements Subversion with Siteminder as authentication provider ? If yes, would it be possible to provide an overview of how the whole setup is done ? Since I am using only HTTP authentication, I think it would be easier to integrate with SM, but I am not able to find much help on this on the net. Is ...