how can i store an object in the $_GET array in PHP. i want to pass an object containing database information from one page to another page via the $_GET array, so there would be no need to access the database again.
Hi, I have simple JSON object returned in form
{"d":"{\"Name\":\"DMX100\",\"Description\":\"blah blah\",\"ID\":\" 780\",\"Make\":\"2010\"}"}
How do I parse it in success.
success: function(msg)
{
$('#something').html(msg.d.Name);
}
Above code doesnt display Name but when I pass $('#something').html(msg.d);
it shows complete Json string. How do I reach to individual properties
Thanks
I have a newbie kind of question which I cant get my head around. How does the Proc in the if condition of the caches_action get executed for the caches_action method.
for example
caches_action :show, :if=Proc.new{|x| something}
what i dont get its how does this get called.
I know i can execute a proc defined as
proc= Proc.new by
proc.call
so i dont understand how this gets called.
Second how do I pass conditions like
if logged_in?
I'd appreciate any help on this
Default syntax for Header set Expires is
Header set Expires "Wed, 21 May 2010 20:00:00 GMT"
and default syntax for ExpiresDefault is
ExpiresDefault A2592000
OR
ExpiresByType image/gif A60
I want to use such a syntax for Header set Expires, that is I want to pass an expires time in seconds after access. how can i do this ?
Im a little confused on the varying definitions and implementations of web services available as implementations. Need some clarification please.
Ones I have used till now:
If a vendor gives me a specific format of XML that I can send populated with data to request and I make a simple HTTP POST over the internet passing in the XML String as the payload, is this a web service call ? If so, is there a specific name to it, this kind of web service ? Because obviously, it does not use anything like Axis, WSDL or SOAP to establish this connection.
A variant of this is If the vendor gives me an XSD, I use JAXB to make a java class out of it and pass in the serialized version of the object, which eventually works out to be the same as option 1.
RESTful web service: Vendor gives me a URL like http://restfulservice/products and I can make HTTP Requests to the URL and depending on what HTTP verb I use, the appropropriate action is called and the response sent over the wire.
Ones I have only read about\ have a vague idea about
SOAP. How does this work?.. Ive read the W3Schools tutorial and I undertsand that there is a very specific form of XML that is standardized according to W3C standards that we use to pass the same kind of messages as we did in option 1. But how does this work in real life? Vendor sends me what? Do I generate classes? Do I serialize some objects and http post them over to an address? Or do the generated objects themselves have connection methods that will do them for me?
What about WSDL? When does a vendor send me WSDL and what do I do with it ? I guess I can generate classes from it. If yes, then what do I do with the generated classes ?
When do I need that axis jar to generate classes from something that the vendor sends ?
As you can see, I have some clear and other mostly vague ideas about the different kinds of web services available. would help if someone ould clarify and\or point to more real-world resources. I've looked a little bit into Java Web Services on the internet and the numerous four letter acronyms that get thrown at me make me dizzy.
Thanks
I am using method to create folder on ftp i want get exception if folder already exsists how to make it over write the existing folder
using System; using System.Net;
class Test {
static void Main()
{
WebRequest request = WebRequest.Create("ftp://host.com/directory");
request.Method = WebRequestMethods.Ftp.MakeDirectory;
request.Credentials = new NetworkCredential("user", "pass");
using (var resp = (FtpWebResponse) request.GetResponse())
{
Console.WriteLine(resp.StatusCode);
}
} }
it is "remote server returned error (550) file not found"
Hi
I want to retrieve a set of records from a database, do a rs.next() and then assign the result of this to a variable to pass to a method that will use this record, in the same way that I would without assigning it to a variable and passing it to a method
is there any way to do this?
I'm using JAVA (1.5)
hi every one ..
i'm an it student , and it's time to finish my final project in java , i've faced too many problems , this one i couldn't solve it and i'm really ubset ! :S
my code is like this :
in Admin class :
public ArrayList cos_info = new ArrayList();
public ArrayList cas_info = new ArrayList();
public int cos_count = 0 ;
public int cas_count = 0 ;
void coustmer_acount() throws FileNotFoundException, IOException{
String add=null;
do{
person p = new person() ;
cos_info.add(cos_count, p);
cos_count ++ ;
add =JOptionPane.showInputDialog("Do you want to add more coustmer..\n'y'foryes ..\n 'n'for No ..");
}
while(add.charAt(0) == 'Y'||add.charAt(0)=='y');
writenew_cos();
// add_acounts();
}
void writenew_cos() throws IOException{
ObjectOutputStream aa = new ObjectOutputStream(new FileOutputStream("coustmer.txt"));
aa.writeObject(cos_info);
JOptionPane.showMessageDialog(null,"Added to file done sucessfuly..");
aa.close();
}
in Coustmer class :
void read_cos() throws IOException, ClassNotFoundException{
person p1= null ;
int array_count = 0;
ObjectInputStream d = new ObjectInputStream(new FileInputStrea ("coustmer.txt"));
JOptionPane.showMessageDialog(null,d.available() );
for(int i = 0;d.available() == 0;i++){
a.add(array_count,(ArrayList) d.readObject());
array_count++;
JOptionPane.showMessageDialog(null,"Haaaaai :D" );
JOptionPane.showMessageDialog(null,array_count );
}
d.close();
JOptionPane.showMessageDialog(null,array_count +"1111" );
for(int i = 0 ; i<a.size()&& found!= true ; i++){
count++ ;
p1 =(person)a.get(i);
user=p1.user;
pass = p1.pass;
cas_checkpass();
}
}
it just print JOptionPane.showMessageDialog(null,d.available() ); and having excep. here a.add(array_count,(ArrayList) d.readObject()); p.s : person object from my own class and it's Serializabled
i have an application, and in my urls.py i have something like that:
urlpatterns = patterns('',
url(r'^profile_view/(?P<id>\d+)/$',
profile_view,
name='profile_view'),)
meaning that the profile_view function has id as a parameter.
Now, i want to call that function from my template, using a link like Reply
The problem is that i don't know how to use the above url as a link, meaning how can i 'pass the id parameter to a link'?
thank you
I have a class that processes a file, and as part of the constructor with one argument I want to input a file using fstream.
I basically want it do something like this
class someClass{
public:
someClass(char * FILENAME)
{
fstream fileToProcess;
fileToProcess.open(<FILENAME>, fstream::in | fstream::out | fstream::app);
}
};
I want to pass the filename in as an argument to the class constructor, and then the class someClass will access it with fstream.
How can i pass a string delimited by space or comma to stored procedure and filter result?
I'm trying to do something like -
Parameter Value
--------------------------
@keywords key1 key2 key3
Then is stored procedure i want to first
find all records with first or last
name like key1
filter step 1 with first or last
name like key2
filter step 2 with first or last name like key 3
I guess the subject sounds pretty stupid, so I'll show some code:
def foo(**kwargs):
# How can you detect the difference between (**{}) and ()?
pass
foo(**{})
foo()
Is there any way to detect inside of foo, how the method was called?
I can hold the value of touched cell but I cannot pass that value to another class or call from that class.
SearchTableViewController.m
**deneme= [[NSMutableArray alloc]init];
deneme=[tableData objectAtIndex:indexPath.row];
NSLog(@"my row = %@", deneme); //I can hold one of the selected or touched rows in table
HistoryTableViewController.m
**SearchTableViewController *obj = (SearchTableViewController *)[self.tabBarController.viewControllers objectAtIndex:11];
NSLog(@"my 2nd row= %@", [obj deneme]); //It doesn't retrieve here
How can I write a unit test to test the actualWidth property to a userControl in Silverligh 4?
I hoped that this method would pass, but it fails.
I am using the Silverlight ToolKit april 2010, and VS 2010.
<TestMethod()> _
Public Sub TestAcrtualWidth()
Me.MyUserControl.Width = 100
Me.MyUserControl.UpdateLayout()
Assert.IsTrue(Me.MyUserControl.ActualWidth > 0)
End Sub
Hi,
I cannot get my SID working ...
<?php
session_start();
// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';?>
does not show up SID number but session_id is working not sure if I am missing something.
THnks
I'm trying to connect to an oracle database with .net but i get the error:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
however, when I enter add a new database connection through toolsconnect to database. it works fine. even after copying the connection string which is:
Data Source=source here;Persist Security Info=True;User ID=userhere;Password=pass;Unicode=True
I try all methods but in my google map on the marker doesn't work events, I try enable events and write (clickable: true), but it did not help, in test server working good, but on phpfox marker not clickable, help me please correct it
go to it http://iguansystems.com/phpfoxdev/index.php?do=/pages/24/quickstart/step2/ link
login - [email protected], and pass- tryuser
in center frontend right at "Primary Venue" have "Can't find venue? Add New" click on "Add New" and window with a map open
I have an application that uses the Process class, StandardInput, and StandardOutput to communicate with an external executable. I am using this to pass strings back and forth, and it works well in my Windows application.
On the mobile device, I do not see StandardInput or StandardOutput in the Process class. Is there an easy way to replicate this functionality on the Mobile?
I am working on a preexisting web application built with JSP, which uses an external Java library. I want to make some JavaBeans that were instantiated with jsp:useBean tags available to the Java code.
What would be a good practice to do that? I suppose I can pass the objects in question to every function call that requires them, but I'd like to avoid that.
Hi,
I'm using JavScript and jQuery to read an XML document and subsequently use the information from the XML to create HTML objects.
The main 'C' nodes in the XML document all have a type attribute, and depending on the type I want to run a function which will create a new html object using the other attributes assigned to that particular 'C' node node.
Currently, I have a for loop which extracts each 'C' node from the XML and also it's attributes (e.g. width, height, x, y).
Also inside the for loop, I have an if statement which checks the 'type' attribute of the current 'C' node being processed, and depending on the type it will run a different function which will then create a new HTML object with the attributes which have been drawn from the XML.
The problem is that there may be more than one 'C' node of the same type, so for example when I'm creating the function that will run when a 'C' node of 'type=1' is detected, I cannot use the 'var p = document.createElement('p')' because if a 'C' node of the same type comes up later in the loop it will clash and override that element with that variable that has just been created.
I'm not really sure how to approach this?
Here is my entire script. If you need me to elaborate on any parts please ask, I'm sure it's not written in the nicest possible way:
var arrayIds = new Array();
$(document).ready(function(){
$.ajax({
type: "GET",
url: "question.xml",
dataType: "xml",
success: function(xml)
{
$(xml).find("C").each(function(){
arrayIds.push($(this).attr('ID'));
});
var svgTag = document.createElement('SVG');
// Create question type objects
function ctyp3(x,y,width,height,baC)
{
alert('test');
var r = document.createElement('rect');
r.x = x;
r.y = y;
r.width = width;
r.height = height;
r.fillcolor = baC;
svgTag.appendChild(r);
}
// Extract question data from XML
var questions = [];
for (j=0; j<arrayIds.length; j++)
{
$(xml).find("C[ID='" + arrayIds[j] + "']").each(function(){
// pass values
questions[j] = {
typ: $(this).attr('typ'),
width: $(this).find("I").attr('wid'),
height: $(this).find("I").attr('hei'),
x: $(this).find("I").attr('x'),
y: $(this).find("I").attr('x'),
baC: $(this).find("I").attr('baC'),
boC: $(this).find("I").attr('boC'),
boW: $(this).find("I").attr('boW')
}
alert($(this).attr('typ'));
if ($(this).attr('typ') == '3')
{
ctyp3(x,y,width,height,baC);
// alert('pass');
} else {
// Add here
// alert('fail');
}
});
}
}
});
});
I want to get and pass the HTML element(a textbox) value as a query string to the Ajax.ActionLink(), is this possible? If yes, then please tell me how? Thanks in advance
I want to store a list of objects, lets say of type Car, but with an additional 'tag' property eg a boolean True/False which does not belong on the Car class. What is the best way to accomplish this? I need to pass the result between methods.