If two clients do Activation.GetObject, using the Singleton approach, and the same address, are they going to get the same instance of the class? Or will each client get a different instance?
I would like to use a GUI app on my Mac (Changes http://connectedflow.com/changes/) to resolve merge conflicts when using Mercurial via SSH on my server.
What is the most straightforward way to achieve this without cloning the repository locally?
I have two web applications say App1 and App2. I want to call a servlet which is in App2 from a servlet in App1. I'm using URLConnection for this. I'm able to pass parameters to the servlet in App2 also and I'm also able to receive response from the servlet as string. But I want to send java objects from the servlet in App2 and receive them in servlet of App1. How to achieve this?
Here is the client side code. It is running insdide a Google Gadgets
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
var url = "http://invplatformtest.appspot.com/getrecent/";
gadgets.io.makeRequest(url, response, params);
The response function is:
function response(obj)
{
var r = obj.data;
alert(r['name']);
}
while on the server end, the python code sending the JSON is:
class GetRecent(webapp.RequestHandler):
def get(self):
self.response.out.write({'name':'geocities'}) #i know this is where the problem is so how do i encode json in GAE?
which is just supposed to send back a Json encoded string
but when i run this, the javascript throws the following error:
r is null
alert(r['name']);
If i were recieving just TEXT contents and my server send TEXT everything works fine. I only get this problem when am trying to send JSON. Where exactly is the problem? Am i encoding the JSON the wrong way on AppEngine? I tried using the JSON library but it looks as if this is not supported.
Where is the problem exactly? :(
I have a c# code that connects remotely to a winServer2008 machine (with a local user of that machine).
How do I configure via automated code the logon script that will be executed as soon as the connection is established ?
Hallo.
I am writing a tier2 ordering software for network usage. So we have client and server.
On the client I create Objects of TBest in which the Product ID, the amount and the user who orders it are saved. (So this is a item of an Order).
An order can have multiple items and those are saved in an array to later send the created order to the server. The class that holds the array is called TBestellung.
So i created both
TBest.toString: string;
and
TBest.fromString(source: string): TBest;
Now, I send the toString result to the server via socket and on the server I create the object using fromString (its parsing the attributes received). This works as intended.
Question:
Is there a better and more elegant way to do that? Serialisation is a keyword, yes, but isn't that awful / difficult when you serialize an object (TBestellung in this case) that contains an Array of other Objects (TBest in this case)?
//Small amendment: Before it gets asked. Yes I should create an extra (static) class for toString and fromString because otherwise the server needs to create an "empty" TBest in order to be able to use fromString.
I would like to know if I can use Android to remote control streaming on my laptop?
I would like to use my laptop as my streaming server and use my HDTV to view the stream.
And I need some way to remote control my streaming server.
I have read about
http://maketecheasier.com/install-vlc-shares-in-Ubuntu-and-stream-videos-to-Android/2011/02/25
and
http://code.google.com/p/android-vlc-remote/
but those are streaming to Android phone itself.
I am just need something to remote control streaming to my TV.
Is that possible?
Hello!
I was confused in the problem of time zones. I am writing a web application that will contain some news with dates of publication, and I want the client to see the date of publication of the news in the form of corresponding local time. However, I do not know in which time zone the client is located.
I have three questions.
I have to ask just in case: does DateTimeOffset.UtcNow always returns the correct UTC date and time, regardless of whether the server is dependent on daylight savings time? For example, if the first time I get the value of this property for two minutes before daylight savings time (or before the transition from daylight saving time back) and the second time in 2 minutes after the transfer, whether the value of properties in all cases differ by only 4 minutes? Or here require any further logic? (Question #1)
Please see the following example and tell me what you think.
I posted the news on the site. I assume that DateTimeOffset.UtcNow takes into account the time zone of the server and the daylight savings time, and so I immediately get the correct UTC server time when pressing the button "Submit". I write this value to a MS SQL database in the field of type datetime2(0).
Then the user opens a page with news and no matter how long after publication. This may occur even after many years. I did not ask him to enter his time zone. Instead, I get the offset of his current local time from UTC using the javascript function following way:
function GetUserTimezoneOffset()
{
var offset = new Date().getTimezoneOffset();
return offset;
}
Next I make the calculation of the date and time of publication, which will show the user:
public static DateTime Get_Publication_Date_In_User_Local_DateTime(
DateTime Publication_Utc_Date_Time_From_DataBase,
int User_Time_Zone_Offset_Returned_by_Javascript)
{
int userTimezoneOffset = User_Time_Zone_Offset_Returned_by_Javascript; // For
// example Javascript returns a value equal to -300, which means the
// current user's time differs from UTC to 300 minutes. Ie offset
// is UTC +6. In this case, it may be the time zone UTC +5 which
// currently operates summer time or UTC +6 which currently operates the
// standard time.
// Right? (Question #2)
DateTimeOffset utcPublicationDateTime =
new DateTimeOffset(Publication_Utc_Date_Time_From_DataBase,
new TimeSpan(0)); // get an instance of type DateTimeOffset for the
// date and time of publication for further calculations
DateTimeOffset publication_DateTime_In_User_Local_DateTime =
utcPublicationDateTime.ToOffset(new TimeSpan(0, - userTimezoneOffset, 0));
return publication_DateTime_In_User_Local_DateTime.DateTime;// return to user
}
Is the value obtained correct? Is this the right approach to solving this problem? (Question #3)
We're using hudson on Windows to build a .NET solution and run the unit tests (NUnit). Hudson is thereby used to start batch files that do the actual work.
I am now trying to set up a new test that is to run on a build slave and will run very long. The test should use the binaries produced by the upstream build.
I have searched the hudson documentation but I cannot find how to pass upstream build artifacts to downstream slaves. How do I do this?
I have a few images that i need to upload using an online form.
So far here's my code
$info = array('test title','1234','virginia','@'.realpath('e:\wamp\www\1.jpg'),'@'.realpath('e:\wamp\www\2.jpg'),'@'.realpath('e:\wamp\www\3.jpg'),'@'.realpath('e:\wamp\www\4.jpg'),'test description');
$post->postAd($url, $info);
The $info array is processed in the postAd method and it's being sent as an associative array using a method from a Curl class i have (it has been tested and worked nicely with everything i needed to do so far with curl).
The problem is that the data is completed correctly on the form but the images are not uploaded. Can anyone help with advices/code/guidance?
Hi,
Can anyone please provide me some example on how to save an image i fetch from websites into a cache. I had try to include the following function into my code and call it once i run the activity.
public void getRemoteImage(String imageUrl) {
imageUrl = "http://marga.mobile9.com/download/thumb/295/sexylady7_xo6npovn.jpg";
URL aURL = null;
URLConnection conn = null;
Bitmap bmp = null;
CacheResult cache_result = CacheManager.getCacheFile(imageUrl, new HashMap());
if (cache_result == null) {
try {
aURL = new URL(imageUrl);
conn = aURL.openConnection();
conn.connect();
InputStream is = conn.getInputStream();
cache_result = new CacheManager.CacheResult();
CacheManager.saveCacheFile(imageUrl, cache_result);
} catch (Exception e) {
//return null;
}
}
bmp = BitmapFactory.decodeStream(cache_result.getInputStream());*/
Toast.makeText(context,"Please work.. namo namo namo", Toast.LENGTH_SHORT).show();
//return bmp;
}
However, I got a nullPointerException. Can someone please help me with it as i'm quite new in android.
Hello,
I have a homebase script, that I have many other scripts ping for information using the CURL method. I need to determine the domain name of the callers. Can I do this with tricks just on my homebase script?
. using php .
Hudson
Ok here's my problem in a nutshell I've built a web service from ruby on rails. I'm using restful_authentication to create and run the login but I'm also building an iPhone application to access my web service but I can't quite figure it out. I was wondering if anyone could help me figure out a place to begin.
I have a setup where my nginx is in front with apache+PHP behind.
My PHP application cache some page in memcache which are accessed by nginx directly except some dynamic part which are build using SSI in Nginx.
The first problem I had was nginx didnt try to use memcache for ssi URI.
<!--# include virtual="/myuser" -->
So I figured that if I force it to use a full URL, it would do it.
<!--# include virtual="http://www.example.com/myuser" -->
But in logs file (both nginx and apache) I can see that a slash has been added at the beginning of the url
http ssi filter "/http://www.example.com/myuser"
In the source code of the SSI module I see a PREFIX that seems to be added, but I can really tell if I can disable it.
Anybody got this issue?
Nginx version : 0.7.62 on Ubuntu Karmic 64bits
Thanks a lot
Hello i need some help i work for a small non profit teaching program and i would like to change the logo of Subsonic. The logo where you connect to and login is this possible.
Any help please Thanks...
I am about to give up debugging SMTP servers to send email... My code is the following
private void SendMail()
{
SmtpClient mailClient = new SmtpClient("smtp.mail.yahoo.com", 465);
mailClient.EnableSsl = true;
MailMessage message = new MailMessage();
message.To.Add("[email protected]");
message.Subject = "i wish it would work";
MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
message.From = fromAddress;
mailClient.Send(message);
}
I am developing a library for Android that requires frequent updates from a central server. I was thinking how nice it would be if my library could update itself -- or if I could just release a bootstrap library that downloads the target library when the app is installed.
I see this class in 1.5 called "DexClassLoader" but there seems to be precious little on the web besides the API docs. Has anyone used this successfully for the scenario which I described?
Also, do the terms of the Android Market permit such a thing?
Hello,
I work on a Joomla web site, installed on a MySQL database and running on IIS7. It's all working fine.
I now need to add functionality that lets (Joomla-)registered users change some configuration data. Though I haven't done this yet, it looks straightforward enough to do with Joomla. The data is private so all external access will be done through HTTPS.
I also need an existing c# program, running on another machine, to read that configuration data. Sure enough, this data access needs to be as fast as possible. The data will be small (and filtered by query), but the latency should be kept to a minimum. A short-term, client-side cache (less than a minute, in case a user updates his configuration data) seems like a good idea.
I have done practically zero database/asp programming so far, so what's the best way of doing that last step? Should the c# program access the database 'directly' (using what? LINQ?) or setup some sort of Facade (SOAP?) service? If a service should be used, should it be done through Joomla or with ASP on IIS?
Thanks
Hey,
I would like users to upload links on my site. When another user clicks on the link (e.g. PDF file), then I would like the download popup to show instead of actually displaying the PDF in browser. I know I can use Response.AddHeader/Response.WriteFile to achieve this, but the WriteFile method required a virtual path. However, the links uploaded by the user will be pointing to external servers. Can I still force the download popup to show and, if so, what would be the most efficient way of doing it?
Thanks for any advice
Hello all,
This is my first post to Stack Overflow so apologies if I chosen wrong words for the title. I am very new to Google App Engine and python. I am building a web application using Pyhton and Django which is question and multiple answers type. Once the users are login to website,they will be provided with random questions from datastore.
What my requirement is if certain users want to form group so that they all can get the same set of random questions to answer,is this possible ? Without forming the group each user are getting different random questions on their end.
Thanks,
Sunil
I would like to use a GUI app on my Mac (Changes http://connectedflow.com/changes/) to resolve merge conflicts when using Mercurial via SSH on my server.
What is the most straightforward way to achieve this without cloning the repository locally?
I'd like to set up daily tarballs/zip archives on my host for an SVN of a related project. I do not have access to their server, however they do have a publicly accessible SVN. How would I grab this SVN and build archives with minimal load ( dreamhost shared ), via Cron task + php/shell script?
This link links to an image:
http://pix-all.com/t/w
Every other browser displays this image, only IE forces to download it.
The correct headers are set via PHP.
Is odd though that it works on my local testing server.
Any ideas why?