Is there some library which I could wrap so I could call it from the commandline and run refactorings like extract method from Textmate or Vim? I am mainly thinking about on the Mono framework.
I have an app which stores co-ordinates. I am using Google maps to show the location to allow full use of the maps app. I am using the intent call and placing the co-ordinates in the q=xxxxxxxxx,xxxxxxxxx part.
This works, however when Google maps shows the location it often finds a point on the road, sometimes a little distance from the actual co-ordinates.
Is there a way to get maps to show the actual point?
As far as I know I can access the web.xml <context-param>s by making my class implement ServletContextListener and use the ServletContext.getInitParam(String) to read them, but it´s cumbersome as only one instance of the class will receive the contextInitialized(ServletContextEvent sce) call, so I need to make the ServletContext an static member of the class.
What other ways exist of setting conf params at deployment time and what are the recommended ones?
We have a Silverlight application client and a WCF Service hosted as Managed Window Service and exposing Service Contracts on BasicHttpBinding.
We are sending FaultContract on the wire in case of exception is caught with the WCF Service Code. We are facing following problem as:
A. If we have Synconized proxy call (in case of Window or Web Client), we are able to catch the Fault Contract.
B. If we are using Silverlight Client which uses Asyncronized calls, we are unable to catch the Fault Contract.
We need help on later problem (B.), Thanks in advance
When a cell in a spreadsheet contains a simple date (mm/dd/yyyy) the poi API flags the cell-type as 'numeric'. This is probably because spreadsheets ( IMO ) historically recognize only strings and real numbers.
It is possible to hard-code the cell-index, and use it conditionally to call 'getDateCellValue'. But this feels like a hack.
What other ways are there in the poi API to determine whether the content in a cell is a Date rather than a real number?
from google.appengine.ext import db
class Log(db.Model):
content = db.StringProperty(multiline=True)
class MyThread(threading.Thread):
def run(self,request):
#logs_query = Log.all().order('-date')
#logs = logs_query.fetch(3)
log=Log()
log.content=request.POST.get('content',None)
log.put()
def Log(request):
thr = MyThread()
thr.start(request)
return HttpResponse('')
error is :
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner
self.run()
File "D:\zjm_code\helloworld\views.py", line 33, in run
log.content=request.POST.get('content',None)
NameError: global name 'request' is not defined
Hi,
I have a javascript function, I want it to be called programatically on init and later onClick event but its not getting called programatically but works ok with onClick.
The example would be:
function init() {
a();
}
init() is called on initialization which should call a() but thats not happening!
Hello, i have 2 classes.
How i call first.TQ in Second ? Without creating object First in Second.
class First:
def __init__(self):
self.str = ""
def TQ(self):
pass
def main(self):
T = Second(self.str) # Called here
class Second():
def __init__(self):
list = {u"RANDINT":first.TQ} # List of funcs maybe called in first
.....
.....
return data
This is my code:
#include <algorithm>
class A {
void f() {
struct CompareMe {
bool operator() (int i, int j) { return i < j; }
} comp;
int a[] = {1, 2, 3, 4};
int found = std::min_element(a[0], a[3], comp);
}
}
Error message:
no matching function for call to ‘min_element(int&, int&, A::f()::CompareMe&)
What am I doing wrong?
Maybe the question is not self-explanatory, so I will explain it through.
The deal is: I got the variable $conn in the bootstrap class file. I'd like to make it global for every controller so that I just have to call $this-conn in the controller action scope in order to access the data inside. How would I do it?
Thx
What's the best way to get the current PowerShell Cmdlet from another object? If I create a helper object that is not a Cmdlet but will be called by Cmdlets, the helper methods may want to call WriteVerbose, WriteDebug etc. What's the best way to get access to that? Is there a static PowerShell method that will return the current Cmdlet or do I need to have the Cmdlet pass itself to the helper?
I want to create a backend for my android app with Tapestry5 and this http://code.google.com/p/t5-restful-webservices/ plugin.
The app will communicate with the server by calling REST methods both for registered users (that would be easy to secure I guess) as well as unregistered users.
Now of course I don't want people to just call that webservice from a browser.
How can I make sure that only my app can make calls to this backend?
if i create my enum class in the global.ascx in MVC, is there a way i can call that class from a controller.
ie
i do this in my global.ascx class
volume myVolume = volume.Low
is there a way i can find out what i set myVolume to from a controller.
Yes, I'm being lazy.
What happens when I call performSelector:onThread:... and pass in a thread that's currently blocked (on synchronous I/O, for instance)? Does the selector just get queued to be executed later?
If a long running operation is defined in a frequently called static method, is it a bottleneck for other threads in an ASP.Net application trying to call the same method?
Does that only apply to methods with the "Synchronized" attribute?
I've searched and can't seem to find a definitive answer.
For the iPad, iPhone, iTouch app that talk to remote web service by making NSURLConnection calls, is there a way for the remote service to tell what kind of device that the call is made from?
How do you install Tomcat 6 as a service using the Wix ServiceInstall Tag? Is there a way to do it, or do I need to use a custom action to call the executable or batch file that comes with it to install the service?
The docs for flash.utils.setTimeout() state:
Instead of using this method, consider
creating a Timer object, with the
specified interval, using 1 as the
repeatCount parameter (which sets the
timer to run only once).
Does anyone know if there is a (significant) advantage in doing so? Using setTimeout is a lot easier when you only need to delay 1 call.
The Java manual says:
The locks held on a particular file by a single Java virtual machine do not overlap. The overlaps method may be used to test whether a candidate lock range overlaps an existing lock.
I guess that if I lock a file in a tomcat web application I can't be sure that every call to this application is done by a different JVM, can I? So how can I lock files within my tomcat application in a reliable way?
I am using a table view controller that makes a call to a web service and then parses the XML and display it in the table view. The problem is that the first time that I load it the XML apparently is not finished parsing before the view is shown. How can I reload the view after the XML is done parsing?
I'm making a call to PayPal's credit card processor, and after a successful/unsuccessful transaction it returns me a string that looks like this:
DoDirectPayment failed: Array ( [TIMESTAMP] = 2010%2d05%2d02T23%3a33%3a28Z [CORRELATIONID] = 8c503f5c6c861 [ACK] = Failure [VERSION] = 51%2e0 [BUILD] = 1268624 [L_ERRORCODE0] = 10527 [L_SHORTMESSAGE0] = Invalid%20Data [L_LONGMESSAGE0] = This%20transaction%20cannot%20be%20processed%2e%20Please%20enter%20a%20valid%20credit%20card%20number%20and%20type%2e [L_SEVERITYCODE0] = Error [AMT] = 90%2e00 [CURRENCYCODE] = USD )
I'm not a javascript pro, but how exactly can I turn that into a parseable array?
Thank you!
i am using vbscript to call a batch file. my script looks like:
dim shell
set shell=createobject("wscript.shell")
shell.run "a.bat"
set shell=nothing
my batch file is simple and looks like:
D:
cd D:\d
winzip32.exe -min -a D:\a
i want to pass a variable from a script to the batch file. lets say the destination folder.
how do i do that?
any help is very much appreciated.
Hi,
how can i call a function which computes with input parameters from an another static function.
say,
class X
{
static void xyz();
static int pqr(int, int);
};
static X::void xyz()
{
...pqr(10,20);
}
int X::pqr(int t1, int t2)
{
return t1*t2;
}
I have a PC with dual cores, it has two MAC addresses : 00-1D.... & 00-21.....
Are these IDs for the two cores ?
If I want to get hold of a unique ID for this PC, how to get it with a Java call ? Maybe there is something in Java like "System.getId()" ?
Frank