What are some best practices for using MEF in your code? Are there any pitfalls to take into account when starting your extensible application? Did you run into anything you should have known earlier?
What are your advises on using model driven development in developing enterprise applications. Adobe's LiveCycle Data Services looks very promising, I have found numerous tutorials/videos that shows how fast an application can be build by having methods/functions auto-generated.
What are the best-practices, is it good/bad to use those auto-generated methods, they can really save a lot of time.
All suggestions are welcome, also if you know some existing blog/discussion please let me know.
I'm developing an application that communicates with an internal web service using HTTP.
Are there any "best practices" for custom user-agent strings so that I can put a nice one in my app? It's a Python library and the lower transport is Python's own httplib. Should the user-agent string say that or something else?
I'm going to implement a CI process with CC.NET so I'm looking for best practices for CC.net implementation.
I use SVN as source control and JIRA as an issue tracker (if it's a useful tip).
Any recommandation or article suggestion will be appreciated.
Note: I read this article by Martin Fowler.
I've done the same mistake lots of times:
I've tried to use a Stream that is positioned in the end, consequently returning nothing.
When and how is the best way to rewind the Stream (setting the Position to 0) after "loading" it?
I have PHP configured so that magic quotes are on and register globals are off.
I do my best to always call htmlentities() for anything I am outputing that is derived from user input.
I also occasionally seach my database for common things used in xss attached such as...
<script
What else should I be doing and how can I make sure that the things I am trying to do are always done.
I just realized a function may be defined inside another function in C:
void main(){
int foo(){ return 2; };
printf("%d\n", foo());
}
Besides being a neat trick, the useful thing about this is that the inner function is private to the outer function. But... is that a good enough reason to do this in a "real-world" application? What are the best practices for using this syntax?
Hi guys,
I'm developing a JAX-RS application and it's working fine. Now, I want to develop a web service client application using Rails. And my question is which is the best way to parse a RESTful webservice's response in Rails?
In terms of performance, IIS process management and reliability, is there a best practice in how to expose functionality over ASP.NET webservices?
Like:
Each consulting service in a specific asmx (like consultA.asmx)
All consulting services in one asmx (like consults.asmx)
NOTE: In this case, I cannot use WCF
I recently started these naming conventions..
all functions & variables = camelCase
constants with define() = ALL_CAPS_AND_UNDERSCORES
Now I see a lot of other people mix up camelCase and underscores and they seem to have some sort of convention to it... What do you use and what is best? I've heard that public and private functions should have underscores before some.. I assume private have 2 underscores as in __construct() ?
Thank you!
I was recently reviewing some code written by two different contractors, both were basic ASP.NET management sites. The sites allowed the user to view and edit data. Pretty much simple CRUD gateways.
One group did their best to use built in ASP + AJAX Toolkit controls and did their best to use as many built in controls as possible. I found the code much easier to read and maintain.
The other used jQuery and the code is heavily marked up with script blocks which are then used to build pages from javascript files.
Which one is more common? The one that basically leveraged embedded HTML markup in scripts controled by javascript files screams readability and maintenance issues? Is this just the way of doing asp dev with jQuery?
Assuming the second example happens a lot, are there tools that help facilitate jQuery development with visual studio? Do you think they generated the html somewhere else and just copied it in?
Example Script block:
<script id="HRPanel" type="text/html">
<table cellpadding='0' cellspacing='0' class="atable"><thead class="mHeader"><tr><th>Name</th><th>Description</th><th>Other</th></thead><tbody>
<# for(var i=0; i < hrRows.length; i++) {
var r = HRRows[i]; #>
<tr><td><#=r.Name#></td><td><#=r.Description#></td><td class="taRight"><#=r.Other#></td></tr>
<#}#>
</tbody><tfoot><th></th><th></th><th></th></tfoot></table>
</script>
Then in a separate location (js file) you would see something like this.
$("#HRPanel").html($("#HRPanel").parseTemplate({ HRRows: response.something.bah.bah }));
I have a class library (c#) with many methods that call the same web service (asmx).
What is the best practice for instantiating the web service.
Instantiate the web service once and pass it as a parameter to each method
Or instantiate and dispose the web service in each method.
Say my application has a "Posts" model, and one of the function is add_post(), it might be something like:
function add_post($data) {
$this-db-insert('posts',$data);
}
Where $data is an array:
$data = array ('datetime'='2010-10-10 01:11:11', 'title'='test','body'='testing');
Is this best practice? It means if you use that function you need to know the names of the database fields where as my understanding of OOP is that you shouldnt need to know how the method works etc etc
If you have a long running SP, do you log somehow it's actions or just wait for this message?
"Command(s) completed successfully."
I assume, that there can be plenty solutions on this subject, but is there any best practice - a simple solution that is frequently used?
Say I need to use ajax to asynchronously ask the server for an xml file containing relevant data. What is the best practice on what this message should look like? Should it be a string like get_data or something similar? Should it be xml? I don't really need long polling since its a one-time (or close to it) request.
Thanks.
I am a beginning C programmer (though not a beginning programmer) looking to dive into a project to teach myself C. My project is music-based, and because of this I am curious whether there are any 'best practices' per-se, when it comes to timing functions.
What is the best practice for emulating overloaded methods over WCF?
Typically I might write an interface like this
interface IInterface
{
MyType ReadMyType(int id);
IEnumerable<MyType> ReadMyType(String name);
IEnumerable<MyType> ReadMyType(String name, int maxResults);
}
What would this interface look like after you converted it to WCF?
I'm starting to consider creating a class library that I want to make generic so others can use it. While planning it out, I came to thinking about the various configuration settings that I would need. Since the idea is to make it open/shared, I wanted to make things as easy on the end user as possible. What's the best way to setup configuration settings without making use of web.config/app.config?
Hey guys,
i have a list of items containig names.
then i have a eventlistener, which ckecks for keypress event.
if the user types i.g. an A all names starting with an A should be viewed with the A bold. so all starting As should be bold.
what is the best way using jquery to highlite only a part of a string?
thanks for your help
what is considered best practice when referring to a program's name? i've seen
#define PROGRAM_NAME "myprog"
printf("this is %s\n", PROGRAM_NAME);
as well as
printf("this is %s\n", argv[0]);
i know, that the second approach will give me ./myprog rather than myprog when the program is not called from $PATH and that the first approach will guarantee consistence regarding the program's name.
but is there anything else, that makes one approach superior to the other?
what is concerned best practice regarding the following "pattern"?
#ifndef BLAFOO_H
#define BLAFOO_H
/* ...
* ...
*/
#endif /* BLAFOO_H */
how should i name the header in the #define directive? i've seen all from said BLAFOO_H to __BLAFOO_H to _BLAFOO_H_ etc..
I have spent my career on the software development side of things and in the latter part have become more and more involved in the realm of Software Configuration Management. Now I am moving into an IT group and need to ramp up on CM practices from that standpoint.
Are there any good references (books, websites, blogs whatever) out there comparing Software CM practices to IT CM practices?
Basically I'm in learning mode and am trying compare things I already know from the software development side to things on the IT side.