I was wondering if it's frowned upon to use the decorator module that comes with python. Should I be creating decorators using the original means or is it considered okay practice to use the module?
I know how to reference an existing .dll to IronPython, but is there any way to add my project as a reference like I can between Visual Studio projects?
Or is it bestpractice to create a separate class library?
I have a web application running on LAMP with a testing server and a production server. Is there a standard practice for keeping the data on the testing server in sync with the production server? The data on the testing server gets out of date pretty quick and I feel like there must be an easier way than just dumping the production server and copying it onto the testing server every so often. It's not important that the data is in total sync, just that the testing server represents the production enviornment as accurately as possible.
Simple question - what part of my CSS do I tweak to adjust the gap between a bullet/number and the first text character in an HTML list?
Bonus question - I've seen it mentioned here that controlling table spacing by adjust padding on table tr td {} is bad practice, but I haven't seen someone explain how you're really supposed to do it...?
Using C++, I would like to obtain the DNS servers being used by a host for three operating systems: OS X, FreeBSD, and Windows. I'd like confirmation that the approaches below are indeed bestpractice, and if not, a superior alternative.
OS X: already answered; updated link at developer.apple.com
Windows: [GetNetworkParms](http://msdn.microsoft.com/en-us/library/aa365968(VS.85).aspx)
FreeBSD: /etc/resolv.conf
Thanks in advance for your help!
I am requesting (via Accept: application/json) that an API I'm designing respond as JSON. However, I want the values within that JSON to be specified to conform to text/plain or text/html depending on the capabilities of the client.
What is the RESTful bestpractice for a "sub-type"? How would this work if I formally switched to HAL as the top-level container?
Accept: application/json+text/plain
{
"value": "Hello World"
}
Accept: application/json+text/html
{
"value": "<h2>Hello World</h2>"
}
I get them theoretically, but I'm grappling with gzipping files inpractice. How should I go about gzip compressing my files, and what needs to be done in order to use them on a shared host?
Would the following work?
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Encoding} .*gzip.*
RewriteRule ^/(.*)\.js$ /$1.js.gz [L]
RewriteRule ^/(.*)\.css$ /$1.css.gz [L]
AddEncoding x-gzip text.gz
If I have something like:
typedef int MyType;
is it good practice to cast the operands of an operation if I do something like this:
int x = 5;
int y = 6;
MyType a = (MyType)(x + y);
I know that I don't need to do that but wondering if it's better for intent/documentation/readability concerns.
Hi,
In android, are using static variables a recommended practice?
E.g, implementing a Singleton pattern in Java, I usually do:
private static A the_instance;
public static A getInstance() {
if (the_instance == null) {
the_instance = new A();
}
return the_instance;
}
Also, when does this get cleaned up by the Android JVM?
Thank you.
In a pylons controller, I would like to first return the response to the request (so that the user gets a response ASAP), and then perform some additional operations (say, updating view counts, etc.) that didn't need to happen to generate the response. What's the best-practice for doing things like this?
Thanks!
I wish to add some sort of a "Write a Review" or "Rate Us" feature to my app so my customers can easily rate and review my app.
Bestpractice I can think of is to have some sort of pop-up or open a UIWebView within my app so the user is not kicked off of my app while opening the App Store application as done in:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/myAppName"]];
Does anyone knows of a way to do that?
Hi
I'm new to Android and web service development!
currently I'm working in developing Android program that will send longitude and latitude information to asp.net website (to show the location change the website map)
the questions are
- how to send this data to the website (the best practice)!
- any suggestions for a suitable framework starting from the android application itself , inserting to database , client/server connection !!
I've read a lot about web services specially REST ..but didn't find tutorials
Appreciate your kind help..
Our application is JSF , hibernate & Spring. Currently the url is in following format
http://www.skill-guru.com/skill/login/testDetails.faces?testId=62&testName=PMP-Certification-practice-test
We want a clean url like http://www.skill-guru.com/urltitle?some parameter
One of the ways we could do this is through integration with Spring webflow with JSF.
Any other suggestions ?
We are trying Spring webflow 1.0 with JSF 2.0 but that does not seem to work.
In Java if an input argument to a method is invalid, we can throw an IllegalArgumentException (which is of type RuntimeException). In C++, there is no notion of checked and unchecked exceptions. Is there a similar exception in standard C++ which can be used to indicate a runtime exception? Or is there a common style not in the standard but everyone follows inpractice for a situation like this?
Or, should I just create my own custom exception and throw it?
I heard a lot of people saying that it is a bad practice to use IoC.Resolve(), but I never heard a good reason why (if it's all about testing than you can just mock the container, and you're done).
now the advantages of using Resolve instead of Constructor Injection is that you don't need to create
classes that have 5 parameters in the constructor, and whenever you are going to create a instance of
that class you're not gonna need to provide it with anything
hi,
I've a question about how to customize drupal modules avoiding hacks.
Let's say I've downloaded Lightbox2 module and I want to change the javascript file to display differently my lightbox.
At the moment I'm modifying the Lightbox2 module, so I cannot update it anymore, so I know it is not the bestpractice.
I was wondering if I can customize the javascript file of this module with a hook, and how.
Thanks
After providing some answers here, and reading some comments, it would seem that, inpractice IOException is never thrown on close for file I/O.
Are there any cases in which calling close on a Stream/Reader/Writer actually throws an IOException?
If an exception is actually thrown, how should it be dealt with?
All,
I wonder what is the best practise regarding logging inside a library.
I am creating a C# library to be used by users and at some points I want to log an error or a warning. Is it a good practice to use log4net and log in a file?
Thanks,
M
The original link of the problem is here: https://code.google.com/codejam/contest/90101/dashboard#s=p2&a=2
In simple words we need to find how many times the string S="welcome to code jam" appears as a sub-sequence of given string S, e.g.
S="welcome to code jam"
T="wweellccoommee to code qps jam"
I know the theory but not good at DP inpractice. Would you please explain step-by-step process to solve this DP problem on example and why it works?
I have learned basis of Java but wanna practice more. I was looking via Google and couldn't find much beginner level problems that i can solve using Java.
Any suggestions???
Hi
As a developer I am a user of Subversion at the moment and I am changing job and going to work for a company that uses Team Foundation Server
I would like to learn the basic and more as user of Team Foundation Server
What do I need to do to replicate the enviroment and practice a bit?
Any Tips ?
What should I read?
Can I simulate the enviroment?
Thanks a lot
I doubt it is good practice but I was wondering if it is possible to register a control that is in the global namespace.
something like
<pages>
<controls>
<add namespace="global" assembly="MyControlAssembly" tagPrefix="mca" />
</controls>
</pages>
Thanks!