i want to to pass class method as and a default argument to another class method, so that i can re-use the method as a @classmethod
@classmethod
class foo:
def func1(self,x):
do somthing;
def func2(self, aFunc = self.func1):
# make some a call to afunc
afunc(4)
this why when the method func2 is called within the class aFunc defaults to self.func1, but i can call this same function from outside of the class and pass it a different function at the input.
i get
NameError: name 'self' is not defined
I'm using jQuery UI Autocomplete plug-in. I'm giving it an URL to make an ajax call and retrieve data. I want to pass optional data parameters but not as part of URL. In the code they make a getJSON call and pass in 'request' parameter(which is an optional data parameter), however I don't see a way to get at this request parameter.
this.source = function( request, response )
{
$.getJSON( url, request, response );
};
I have 2 skins, almost identical, but differ in 1 small way that can be accounted for if I could pass a Boolean to the skin while assigning it to the host component (a button).
<s:Button skinClass="MyBtnSkin" />
Is there a way while assigning the skin to the button, I could also pass a parameter to the skin somehow?
May be this simple. But, I've hard time figuring it out.
I've a controller with different actions that calls the DB code and return result. I want to pass the value of text box to different actions in controller.
How to do it? I know that, I can pass values by using form. But, I don't to know how to call different actions in controller from single view.
I am writing my first chrome extension, and I want to pass a variable to the currently opened tab and manipulate the DOM with it.
My extension has a button, and when clicked, is executing this code:
chrome.tabs.getSelected(null, function(tab) {
chrome.tabs.executeScript(tab.id, {
file: 'tabscript.js'
});
});
This works fine, but I see no way to pass a variable to tabscript.js so it can be used on the opened tab.
How do you securely pass credit card information between pages in PHP? I am building an ecommerce application and I would like to have the users to go through the checkout like this:
Enter Information - Review - Finalize Order
Problem is that I am not sure on how to safely pass credit information from when the user inputs them to when I process it (at the Finalize Order step). I heard using sessions is insecure, even with encryption.
Any help would be appreciated!
i using the dynamic query to pass the variables
select a.TableName, COUNT(a.columnvalue) as '+'count'+' from Settings a
where a.ColumnValue in ('+ @columnvalue +') and a.Value in (' + @value +')
the @columnvalues = 'a','b','c'
@value ='comm(,)','con(:)'
how to pass this in dynamic query
any idea???
I am trying to pass a variable from one page, load another and enter that information.
something Like this:
When 127.0.0.1/test.html&ID=1234
location.href = "127.0.0.1/newpage.html"
if (location.href == newpage.html){
var e = document.GetElementById("Loginbx");
e.Value = ID
}
I don't have access to modify 127.0.0.1/test.html nor newpage.html but would like to pass variables to them from another. Is this possible?
I would like to pass over 50 items of variables from php to flash. Actually I want to pass array with foreach statement, looping through the array and assigning loop index to the variables and flash again accept the php values through looping. Is this possible?
If passing values through foreach or loop statement is impossible, I would like to break a new line in tag. how can I break a new line in FlashVars tag?
Hi
How do I pass a row information from my class to a grid in the windows form of my application? The row information changes every now and then and I need to pass this updated information to the form
Thanks
Hi !
I have 3 TextBoxes to edit a DateTime.
One to edit the Date and 2 to edit hour and minutes.
How would you do that? The code below doesn't reflect the DateTime changes when editing the hour or minute:
<TextBox Text="{Binding MyDateTime}" />
<TextBox Text="{Binding MyDateTime, StringFormat=\{0:HH\}}}" />
<TextBox Text="{Binding MyDateTime}, StringFormat=\{0:mm\}}" />
I know we can have this in 1.4:
$("a").bind({
click : clickFn,
mouseover: mouseFn
});
and that is nice and i would like to use it, but it seems like there is no way to pass extra data to events bound this way, it needs to be done the 'old way':
$("a").bind("click", {"some":"data"}, clickFn);
Question:
how can i pass the extra data to my event call backs and bind multiple events in a single bind at the same time?
I need to be able to display data that I have in 15 minute increments in different display types. I have two queries that are giving me trouble. One shows data by half an hour, the other shows data by hour. The only issue is that the data totals change between queries. It's not counting the data that happens between the time frames, only AT the time frames.
Ex:
There are 5 things that happen at 7:15am. 2 that happen at 7:30am and 4 that show at 7:00am.
The 15 minute view displays all of the data.
The half hour view displays the data from 7:00am and from 7:30am but ignores the 7:15am.
The hour display only shows the 7:00am data
Here are my queries:
$query="SELECT * FROM data WHERE startDate='$startDate' and queue='$queue' GROUP BY HOUR(start),floor(minute(start)/30)";
and
$query="SELECT * FROM data WHERE startDate='$startDate' and queue='$queue' GROUP BY HOUR(start) ";
How can I pull out the data in groups like I have but get all the data included?
Is the issue the way the data is stored in the mysql table? Currently I have a column with dates (2010-03-29) and a column with times (00:00) Do I need to convert these into something else?
Can i pass two string as eventargs on a button click
internal void OnSaveComm(string strTitle,string strLink)
{
WorkItem.EventTopics[EventTopicNames.AgentRecentComm].Fire(this,new EventArgs<> XYZ,WorkItem,Microsoft.Practices.CompositeUI.EventBroker.PublicationScope.Global);
}
Using Event broker to pass string to subscribing event to display in a different view.
I'm trying to plot out GPS data that is given to me in Hour Minute Second degree format. Will GLatLng take it in this form or do I need to convert it first. Having a hard time finding anything on the internet about this. If it can take it in this format an example would be much appreciated.
i using the dynamic query to pass the variables
select a.TableName, COUNT(a.columnvalue) as '+'count'+' from Settings.ColumnMapping a
where a.ColumnValue in ('+ @columnvalue +') and a.Value in (' + @value +')
the @columnvalues = 'a','b','c'
@value ='comm(,)','con(:)'
how to pass this in dynamic query
any idea???
Hi,
I enabled the selection on my gridview. The question is, I can pass values with buttons but it seems redundan, because I have selection linkbuttons. So how can I pass variables with them ?
Hello,
I am working on Silverlight project.
I added a custom user control (Say, control1) which has a text box and button to a xaml page (Say, Page1).
Now what I want to do is when users clicks on the button, i want to pass the value in the textbox to Page1 and do something.
So basically, I am looking for a way to pass back a value from child to parent page in Silverlight.
Thank you.
DatarowsForOneDay = dt.Select(
dt.Columns[0].Caption + "='" + x.ToString("dd/MM/yyyy HH") + "'");
doesn't work, but
DatarowsForOneDay = dt.Select(
dt.Columns[0].Caption + "='" + x.ToString("dd/MM/yyyy") + "'");
works.
So how can I select the date with a same hour?
Variable x type is DateTime.
i have this code in my overridden drawRect method
NSDate *date = [NSDate date];
NSCalendar *calendar = [NSCalendar currentCalendar];
unsigned int unitFlags = NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit;
NSDateComponents *comp = [calendar components:unitFlags fromDate:date];
NSInteger h = [comp hour];
NSInteger m = [comp minute];
NSInteger s = [comp second];
NSLog(@"%i,%i,%i", h,m,s);
NSLog(@"test");
[date release];
[calendar release];
[comp release];
I am calling drawRect using setNeedsDisplay from my custom method (timer based after each 1 secon). It runs only once and then app exit automatically. If i comment out all the code and just write
NSLog(@"test");
then application works ok, it logs "test" after each 1 sec.
I am trying to pass a variable from one page, load another and enter that information.
something Like this:
When 127.0.0.1/test.html&ID=1234
location.href = "127.0.0.1/newpage.html"
if (location.href == newpage.html){
var e = document.GetElementById("Loginbx");
e.Value = ID
}
I don't have access to modify 127.0.0.1/test.html nor newpage.html but would like to pass variables to them from another. Is this possible?
If I want to get a user that has the email address of '[email protected]', how do I pass that as a parameter in linq?
ie.:
var a = from u in Users
where u.Email = @email
Select u;
So this would be used in my method:
public static GetuserByEmail(string email)
Do I just pass in the variable or?
I have a registration form that collects several parameters.
i need to pass all these AND a confirmation code (generated by the controller) to the model for inserting in the DB.
How can I do that?
is there a way to pass the whole post to the model, eg like
$this->model->insert($this->input->form(), $confirmation_code)?
DatarowsForOneDay = dt.Select(dt.Columns[0].Caption + "='" + x.ToString("dd/MM/yyyy HH") + "'");
doesn't works,
but
DatarowsForOneDay = dt.Select(dt.Columns[0].Caption + "='" + x.ToString("dd/MM/yyyy") + "'");
works.
So how can I select the date with a same hour ... ?