I am using google data api which gives date in datetime format. I want to convert in Gregorian calendar date format. Does anyone know any methods for doing this?
In Python, I want to make selected instance attributes of a class be readonly to code outside of the class. I want there to be no way outside code can alter the attribute, except indirectly by invoking methods on the instance. I want the syntax to be concise. What is the best way? (I give my current best answer below...)
why do programmers say that "live" is inefficient?
So what are the alternative
methods to replicating that function
that are more efficient?
How do we measure the impact of how much it slows things down?
I like scala's propose of operator precedence but in some rare case unmodified rules may be inconvenient because you have restrictions in naming your methods. Is there in scala ways to define another rules for a class/file/etc? If not would it be resolved in future?
In Excel, there are methods to access data from external data sources. Excel comes with MSN Money Web Service which pulls data into the sheet. The sheet can refresh the data, etc.. Is there info/doc on how to develop such service ?
The default methods for dealing with xml in c# seem incredibly crude to me, leading me to suspect that I must be missing something in my searches. What is considered the standard best practices to parse xml files in c#?
I have global static variables in a C library, which generate exceptions in a multithread run. I need to make them safe in some way (i.e. - each thread should relate to a different instance of these variables). Any recommended methods?
10x
Hi,
Every time when I change some values in form controls, I need to set a property of an object or vice versa. Instead of writing some methods for each control, I want a general solution for GUI elements. I do not use WPF but only C# 3.0.
Any suggestions?
Thanks.
I don't have access to my dev environment, but when I write the below:
interface IExample
void Test (HtmlControl ctrl);
class Example : IExample
{
public void Test (HtmlTextArea area) { }
I get an error stating the methods in the class implementation don't match the interface - so this is not possible. HtmlTextArea is a child class of HtmlControl, is there no way this is possible? I tried with .NET 3.5, but .NET 4.0 may be different (I am interested in any solution with either framework).
Thanks
We have a server solution written entirely in unmanaged Visual C++. It contains complicated methods for really heavy data processing.
The whole thing contains millions lines of code, so rewritning it all in some other language is not an option. We could write some extra code or make isolated changes, but rewriting everything is out of the question.
Now we'd like to put it on a cloud. Which platform do we choose - Amazon EC2 or Windows Azure - and why?
Hello
I'm looking for a piece of relatively simple software to browse large C++ project. What I would like is something that is somewhere between a simple text editor and a full-blown IDE like Eclipse. I would like syntax highlighting, a way to see all classes/methods defined in a file, a way to find where a particular method is called from and where a variable is declared/defined.
Any ideas?
Thank you!
All,
I am trying to use JQuery's URL Validator plugin.
http://docs.jquery.com/Plugins/Validation/Methods/url
I have a text box that has a URL. I want to write a function which takes the textbox value, uses the jquery's validator plugin to validate urls and returns true or false.
Something like Ex:
function validateURL(textval)
{
// var valid = get jquery's validate plugin return value
if(valid)
{
return true;
}
return false;
}
I wanted this to be a reusable function..
Thanks
I have a OCaml library with lots of classes I need some translator to make it from OCaml lib a C lib so to be able to use its methods. How to do such thing? How to port OCaml lib into lib Acsessable from C code?
In my services all exposed methods have:
try
{
// the method core is written here
}
catch(Exception ex)
{
Log.Append(ex);
}
It's boring and ugly to repeat it over and over again. There is any way to avoid that? There is better way to keep the service working even if exceptions occurs and keep sending the exception details to the Log class?
Hi,
it seems that this question has been asked before, I just would like to know whether there is an update in Android.
I plan to write an audio application involving low delay audio I/O (appr. < 10 ms). It seems not to be possible based on the methods proposed by the SDK, hence is there - in the meantime - a way to achieve this goal using the NDK?
Best regards,
HK
Given that my class looks like this:
class Methods{
function a(){
return 'a';
}
function b(){
$this->a();
}
function c(){
$this->a();
}
}
Is it possible to ensure that function a can only be called from function b?
In the above example function c should fail. I could just include it in function b, but in the future I may want to let a() be called by some new functions (e.g. d() or e())
I am trying to identify the point in time where code completion (autocomplete/intellisense/whatever) was first introduced in IDEs and would appreciate any pointers.
By code completion here I mean a feature within the editor that offers methods or suggestions based on the code that was already typed, and I am interested in programming language related completions (not word processor style completion).
I'm putting in some effort to learn Python, and I am paying close attention to common coding standards. This may seem like a pointlessly nit-picky question, but I am trying to focus on best-practices as I learn, so I don't have to unlearn any 'bad' habits.
I see two common methods for initializing a dict:
a = {
'a': 'value',
'another': 'value',
}
b = dict(
a='value',
another='value',
)
Which is considered to be "more pythonic"? Which do you use? Why?
I have global static variables in a C library, which generate exceptions in a multithread run. I need to make them safe in some way (i.e., each thread should relate to a different instance of these variables). Any recommended methods?
Already tried:
dofactory
Sourcemaking+their video
"GOF" book
"Head First Design Patterns" book
But still have problems with implementation scenarios on practice. Maybe i have too little experience? (almost 2 years using C#) Or maybe there are other resources or some methods to learn to see them?
In my other methods I could do something like this,
public void Add(T item)
{
if (dispatcher.CheckAccess())
{
...
}
else
{
dispatcher.Invoke(new Action<T>(Add), item);
}
}
But how do I invoke a property for a situation like this?
public T this[int index]
{
get
{
...
}
set
{
if (dispatcher.CheckAccess())
{
...
}
else
{
dispatcher.Invoke(???, index); // <-- problem is here
}
}
}
While working in Java, I find it hard to position my Main application window in the very center of the screen when I start the application.
Is there any way I can do that? I tried with some of the predefined methods but none worked.
BTW it doesn't have to be vertically centered, horizontal alignment is the more important goal for me. But vertical alignment is also welcome.
Thanks
I'd like to control visibility on a simple UI element. If it was a button, I'd just call setHiden on it, but UIImage has no such method.
What's the preferred way of showing or hiding an image? Just making it a UIButton and not hooking it up to any methods seems wasteful.. is that really the right way to do it?
Hi,
A co-worker asked me to change a signature from using a primitive "boolean" to using a classed "Boolean". He didn't offer a very good explanation why?
Have any of you heard of this and can any of you explain why it matters or doesn't matter?
Edit: He mentioned that it was good practice for public methods.
I'm trying to create a very basic REST-ish web service with Grails and Postgres. I have the read() & delete() methods working, but I can't get create() to work. Hibernate just gripes, "HibernateException: No session currently bound to execution context." Here's my create method:
def create = {
def member = new Member(params)
member.save()
render(status: 201)
}
Any advice would be great. Thanks.