Using simplexml_load_string() how do I get "ForgotPassword" from the following XML?
<?xml version="1.0" encoding="utf-8"?>
<ForgotPassword>
<version>1.0</version>
<authentication>
<login>username</login>
<apikey>login</apikey>
</authentication>
<parameters>
<emailAddress>[email protected]</emailAddress>
</parameters>
</ForgotPassword>
I want to add a UISlider to my app programmatically without using the IB.
I am adding a UISlider to my UIViewController using the code below. However I don't see the slider when the view comes up. What am I missing? I am using iPhone SDK 3.1.2.
Appreciate any help.
@synthesize slider;
....
- (void)viewDidLoad {
...
...
slider = [[UISlider alloc] initWithFrame: CGRectMake(0, 480 - 80, 300, 20)];
slider.minimumValue = 0.0;
slider.maximumValue = 100.0;
slider.tag = 0;
slider.value = 50;
slider.continuous = YES;
slider.enabled = YES;
[slider addTarget:selfaction:@selector(handleSlider:)forControlEvents:UIControlEventValueChanged];
self.view addSubview:slider];
In the .h file
...
UISlider *slider;
...
@property (nonatomic, retain) UISlider *slider;
- (void) handleSlider:(id)sender;
I have made an AIR 2.0 app that uses NativeProcess so it needs to be packaged as a native installer (.exe) rather than a .air file.
I first tried using Package Assistant but I kept getting an error telling me it cannot load keystore file. so I tried using the command line
I use:
pathToAirSDK>adt -args
but I get an error telling me that "adt" is not a known command so I try:
pathToAirSDK>adt.jar -args
but I get a pop up telling me windows does not know how to open adt.jar files.
Has anyone packaged a native installer for an AIR 2.0 app? How did you do it?
edit
forgot to mention I am doing this in windows using the windows command line.
Is there any way in C/C++ to stop a backtracking algorithm after finding the first solution without exiting the program.
I want my function to immediately exit the function,not to quit every level of recurrsion one by one stating return.
Hello,
I have a value range from 0 to 255.
There is a method that returns an array with a min and max values within this range, i.e: 13, 15, 20, 27, 50 ... 240
where 13 is the min and 240 is the max
I need to scale these values so that 13 becomes 0 and 240 becomes 255 and scale all the other values between them proportionally.
Is there any C# method that does that?
thanks!
I'm using Crystal Report with VB.NET in Visual Studio 2005.
I have report that works if I pass in a list of List(Of Stuff). I had been sorting the report by one of the members of Stuff but a need now to sort first by one member, like Stuff.StatusCode and then by another member, like Stuff.ItemNumber.
Can I do this just be having more than one SortField member, or do I need to do it some other way?
Thanks as always!
Here is some example data:
data = data.frame(series = c("1a", "1b", "1e"), reading = c(0.1, 0.4, 0.6))
> data
series reading
1 1a 0.1
2 1b 0.4
3 1e 0.6
Which I can pull out selective single rows using subset:
> subset (data, series == "1a")
series reading
1 1a 0.1
And pull out multiple rows using a logical OR
> subset (data, series == "1a" | series == "1e")
series reading
1 1a 0.1
3 1e 0.6
But if I have a long list of series expressions, this gets really annoying to input, so I'd prefer to define them in a better way, something like this:
series_you_want = c("1a", "1e") (although even this sucks a little)
and be able to do something like this,
subset (data, series == series_you_want)
The above obviously fails, I'm just not sure what the best way to do this is?
If we use a CMS that is covered by the GPL (v2), do we have to re-release the source code of the CMS if we make modifications to the core?
The GPL v2 states:
The GPL does not require you to release your modified version. You are
free to make modifications and use
them privately, without ever releasing
them. This applies to organizations
(including companies), too; an
organization can make a modified
version and use it internally without
ever releasing it outside the
organization.
But if you release the modified
version to the public in some way, the
GPL requires you to make the modified
source code available to the program's
users, under the GPL.
The grey area for me here is the part that states "if you release the modified version to the public in some way" - does displaying a website to the public count as "releasing it to the public"?
What about if a custom plugin is written which integrates with the CMS - are we required to release the source? Does this count as a modification?
I am having trouble using EnumSet on the client side.
I get this runtime error message:
java.util.EnumSet.EnumSetImpl is not default instantiable (it must
have a zero-argument constructor or no constructors at all) and has
no custom serializer.
Is this is a known issue?
Here is what I am doing (basically a hello world app)
Service:
String echo (EnumSet<Names> name) throws IllegalArgumentException;
Client:
echoServ.echo (EnumSet.of(Names.JOHN), new AsyncCallback<String>()
{ ....... });
Shared enum class
enum Names { JOHN, NUMAN, OBAMA }
In Clojure, I want to combine two lists to give a list of pairs,
> (zip '(1 2 3) '(4 5 6))
((1 4) (2 5) (3 6))
In Haskell or Ruby the function is called zip. Implementing it is not difficult, but I wanted to make sure I wasn't missing a function in Core or Contrib.
There is a zip namespace in Core, but it is described as providing access to the Zipper functional technique, which does not appear to be what I am after.
Is there an equivalent function for combining 2 or more lists, in this way, in Core?
If there is not, is it because there is an idiomatic approach that renders the function unneeded?
Hi there.
I've created a couple of shared templates (.xdp) which will be shared among several clients. Obviously, each client has their own logo and I'd like to set the logo upon form generation.
I've managed to change the logo dynamically although I'm not sure if my approach is good.
In the xml datasource I've got this element: <ClientID>SomeNumber</ClientId>
In the form itself I set the image href with this javascript code:
SomeHiddenTextField::calculate
HeaderLogo.value.image.href = $record.ClientID + "_logo.jpg";
I've got the logos stored on the server in the same folder as the shared templates.
Is this an alright approach to load logos dynamically?
I've been trying to achieve the same dynamic behaviour with each client's footer fragment, but I have been unable to figure out how to load these on demand. I could make each footer fragment in to an image but I'd like to avoid it if possible.
I get "E2511 Type parameter 'T' must be a class type" on the third class.
type TSomeClass=class
end;
ParentParentClass<T>=class
end;
ParentClass<T: class> = class(ParentParentClass<T>)
end;
ChildClass<T: TSomeClass> = class(ParentClass<T>)
end;
I'm trying to write a lite Generic Array wrapper for any data type(ParentParentClass) ,but because I'm unable to free type idenitifiers( if T is TObject then Tobject(T).Free) , I created the second class, which is useful for class types, so I can free the objects.
The third class is where I use my wrapper, but the compiler throws that error. How do I make it compile?
I'm currently moving my application from a Linode setup to EC2. Redis is currently installed on a remote instance with various worker instances interacting with the queue. Thats all going fantastic.
My problem is with the amount of time it takes for a worker to be 'instantiated' and slow forking. Starting a worker will usually take between 30 seconds and a minute(from god.rb starting the worker rake task and the worker actively starting work on the queue). I could live with that, but I've not experienced such a wait time on my current Linode production box so I believe its one of my symptoms to a bigger problem. Next issue is that jobs that took a second or less in my previous environment now seem to take about 5 to 10 times longer..
I'm assuming this must be some sort of issue with my Ubuntu install on EC2? One notable difference is that I'm running REE 1.8.7-2010.01 in my new setup, and REE 1.8.6 on the old Linode boxes.
Anyone else experienced these issues?
I have searched the internet thoroughly for this type of issue, there were responses but hasn't really found a concrete solution yet.
I have an application which makes use of SQL Server 2008 R2 and thus it makes connections with a database file which I have set up. The application executes successfully, makes connections with the database and retrieves/inserts/updates data to and fro the database.
However when I come to create a deployment project i.e. a setup project, I fail to transfer my database files to other computers and make database connections. I have checked the SQL Server 2008 prerequisite in the publish settings of the application and has also included the database files.
Can anyone suggest the best way to this type of setup?
Thanks
I am trying to build a small table using NSString. I cannot seem to format the strings properly.
Here is what I have
[NSString stringWithFormat:@"%8@: %.6f",e,v]
where e is an NSString from somewhere else, and v is a float.
What I want is output something like this:
Grapes: 20.3
Pomegranates: 2.5
Oranges: 15.1
What I get is
Grapes:20.3
Pomegranates:2.5
Oranges:15.1
How can I fix my format to do something like this?
I am building an iPhone app that will need to display info primarily in a calendar view. Users will need to be able to search for entries and view them by day, month or in a list view. It seems like the built-in calendar type interface is ideal for my app. So I could build a similar calendar with 3 buttons at the bottom for list/day/month view as well as a button for today, in short a very similar interface to the built in iPhone calendar with different colors primarily. However, if I replicate it am I a) a lame copycat for replicating the built-in interface or smart for using a well-known iPhone metaphor and b) in danger of having my app rejected?
While writing a test suite, I needed to provide an implementation of operator<<(std::ostream&... for Boost unit test to use.
This worked:
namespace theseus { namespace core {
std::ostream& operator<<(std::ostream& ss, const PixelRGB& p) {
return (ss << "PixelRGB(" << (int)p.r << "," << (int)p.g << "," << (int)p.b << ")");
}
}}
This didn't:
std::ostream& operator<<(std::ostream& ss, const theseus::core::PixelRGB& p) {
return (ss << "PixelRGB(" << (int)p.r << "," << (int)p.g << "," << (int)p.b << ")");
}
Apparently, the second wasn't included in the candidate matches when g++ tried to resolve the use of the operator. Why (what rule causes this)?
The code calling operator<< is deep within the Boost unit test framework, but here's the test code:
BOOST_AUTO_TEST_SUITE(core_image)
BOOST_AUTO_TEST_CASE(test_output) {
using namespace theseus::core;
BOOST_TEST_MESSAGE(PixelRGB(5,5,5)); // only compiles with operator<< definition inside theseus::core
std::cout << PixelRGB(5,5,5) << "\n"; // works with either definition
BOOST_CHECK(true); // prevent no-assertion error
}
BOOST_AUTO_TEST_SUITE_END()
For reference, I'm using g++ 4.4 (though for the moment I'm assuming this behaviour is standards-conformant).
I was recently approached by my management with an interesting problem - where I am pretty sure I am telling my bosses the correct information but I really want to make sure I am telling them the correct stuff.
I am being asked to develop some software that has this function:
An application at one location is constantly processing real-time data every second and only generates data if the underlying data has changed in any way.
On the event that the data has changed send the results to another box over a network
Maintains a persistent connection between the both machines, altering the remote box if for some reason the network connection went down
From what I understand, I imagine that I need to do some reading on doing some sort of TCP/IP socket-level stuff. That way if the connection is dropped the remote location will be aware that the data it has received may be stale.
However management seems to be very convinced that this can be accomplished using SOAP. I was under the impression that SOAP is more or less a way for a client to initiate a procedure from a server and get some results via the HTTP protocol. Am I wrong in assuming this? I haven't been able to find much information on how SOAP might be able to solve a problem like this.
I feel like a lot of people around my office are using SOAP as a buzzword and that has generated a bit of confusion over what SOAP actually is - and is capable of.
Any thoughts on how to accomplish this task would be appreciated!
Does any US wireless carrier offer individuals or companies with a direct connection to the SMSC?
The number is 747-772-3101 (repalce 7's with 6's)
This number is registered to t-mobile, also verified by t-mobile to be a valid subscriber sending 160,000+ text messages monthly and that all they have is an unlimited text messaging plan on top of the cheapest voice plan. This company of the number verified to me that they don't use gsm modems as they are too slow.
So I know it's possible but who would I contact, Sales or anyone else reachable through a 1-800 is ignorant to these services and developer.t-mobile is worthless and doesn't reply to emails.
Any info??
Hello,
There is already a similar question(link).The thing is I don't understand what unit I have to delete.
I have installed the latest JCL library and added 'JclCompression' to the uses list in a unit and I get the error: "Unit JclCompression was compiled with a different version of sevenzip.IOutArchive".
Please explain to me in a simpler way how to resolve the problem.
Thanks in advance!
Hello,
I am attempting to return a image from a server using Silverlight 3. The server returns the Response stream like this:
context.Response.ContentType = imageFactory.ContentType
imgStream.WriteTo(context.Response.OutputStream)
imgStream.Close()
context.Response.End()
On the Silverlight client I am handling the stream like:
Dim request As HttpWebRequest = result.AsyncState
Dim response As HttpWebResponse = request.EndGetResponse(result)
Dim responseStream As IO.Stream = response.GetResponseStream()
I want to take that stream and open the browsers save dialog, one option I have explored is using the Html.Window.Navigate(New Uri("image url")) and this opened the correct browser default dialog but it is not an option because I need to send extended information(e.g. XML) to the server through the HttpRequest.Headers.Item and the Navigate doesn't allow this.
How can I take a Response Stream and force the default browser Save dialog to appear from the Silverlight Application without using the Html.Window.Navigate(New Uri("image url"))?