Hello all!
I'm new here. I've got a question related to PHP, FTP and CURL.
I need to emulate PHP's stat() with CURL FTP. I already know that it may take more than one command to do it. Here's what I've got so far (PHP/STAT ... FTP/CURL):
dev
ino
mode ... LIST *
nlink
uid ... LIST *
gid ... LIST *
rdev
size ... SIZE (or better still, ...
Hello, I am writing a class. I have encountered the problem in the title.
Here is the code:
class delivery
{
private string strDeliveryName;
private string strDeliveryAddress;
private string strDeliveryDay;
private string strDeliveryTime;
private string strDeliveryMeal;
private string strDeliveryInstructions;
...
Hello
I'm trying to be able to check if a selector have a certain sets of classes.
.hasClass() can only check if the selector has one class. And the .is() selector can look for multiple classes but will return true if the selector have at least one of the classes.
But I wan't to achieve a way to check if a selector have both of the c...
Was wondering if it is possible to make a variable point to another variable instead of having it have a value of its own. What I'm trying to do is to have a class instance like:
$users = new User_Model();
and then have
$user
simply point to
$users
instead of making a new class instance. Is this possible? Think I saw something ...
i have an html page where i have a table of items (one item per row) where each item is a html link that says "Add" and there is a textbox next to each link with a number in it.
the text link and the textbox are in the same td inside the row of the table.
how do i, using jquery, capture the value from the textbox that is to the right o...
I'm looking at the auth class in Kohana 3 as well as a login script. When the login page calls the login function of the auth class, it is returned via a protected abstract function _login. Why would you do that out of curiosity? I can't seem to understand what would really be the difference since you'd be returning the same data eith...
I am currently working through the Gregory Brown Ruby Best Practices book. Early on, he is talking about refactoring some functionality from helper methods on a related class, to some methods on module, then had the module extend self.
Hadn't seen that before, after a quick google, found out that extend self on a module lets methods de...
I have a base class like this:
package MyClass;
use vars qw/$ME list of vars/;
use Exporter;
@ISA = qw/Exporter/;
@EXPORT_OK = qw/ many variables & functions/;
%EXPORT_TAGS = (all => \@EXPORT_OK );
sub my_method {
}
sub other_methods etc {
}
--- more code---
I want to subclass MyClass, but only for one method.
package MySubclass...
I want to have a class property that allow for an expression to take place on the right side of the equals sign. All versions of PHP choke on the following code, but it is written in this way to allow for easier extendibility in the future.
/* Example SDK Class */
class SDK
{
/* Runtime Option Flags */
// Strings
# 0: Makes...
Hi, i have a quick question. I have a 2D array that stores an instance of a class. The elements of the array are assigned a particular class based on a text file that is read earlier in the program. Since i do not know without looking in the file what class is stored at a particular element i could refer to a field that doesn't exist at ...
I just want to confirm that I'm understanding correctly, in Interface Builder the Class set under Class Identity (listed under Type in the name.xib summary window) is the class of the view whereas in IBOutlet Class *viewName the class listed describes the nature of the connection to Interface Builder, is this correct?
e.g.
Name________...
Hello,
I have been trying to return a collection from a property within a class to a routine in a normal module. The issue I am experiencing is that the collection is getting populated correctly within the property in the class (FetchAll) but when I pass the collection back to the module (Test) all the entries are populated with the las...
Is there a way to grab a list of attributes that exist on instances of a class? (This class is just an bland example, it is not my task at hand.)
class new_class():
def __init__(self, number):
self.multi = int(number) * 2
self.str = str(number)
a = new_class(2)
print(', '.join(a.SOMETHING))
The desired result is ...
Hello!
I've got a view function that has to decide which form to use depending on some conditions. The two forms look like that:
class OpenExtraForm(forms.ModelForm):
class Meta:
model = Extra
def __init__(self, *args, **kwargs):
super(OpenExtraForm, self).__init__(*args, **kwargs)
self.fields['opening...
I need to expose a third party vendor's web service internally on my network. The reason for this is the third party web service requires some custom header information which means it cannot be called from SSRS. Here is what I have done:
Took the WSDL files from the vendor (only available offline) and created .dll files (we will call...
When i use
new XStream().toXml(someObject);
it returns following xml...
<response>
<status>SUCCESS</status>
<isOwnershipVerified class="boolean">false</isOwnershipVerified>
</response>
and, when i use
new XStream(new JsonHierarchicalStreamDriver()).toXml(someObject);
it returns following json...
{"response": {
...
Should I give my class members default values like this:
class Foo:
num = 1
or like this?
class Foo:
def __init__(self):
self.num = 1
In this question I discovered that in both cases,
bar = Foo()
bar.num += 1
is a well-defined operation.
I understand that the first method will give me a class variable while the ...
As far as I know, should_receive is applied only to mock objects. What I want is to check, if a certain Class (not object) received a certain message, like:
User.should_receive(:all).once
How do I do that?
UPD. Commonly, writing test for models and controllers we can write User.should_receive(:smth).once. But in my case I'm testing a...
Hello! With this code:
class Complex:
def __init__(self, realpart, imagpart):
self.real = realpart
self.imag = imagpart
print self.real, self.imag
I get this output:
>>> Complex(3,2)
3 2
<__main__.Complex instance at 0x01412210>
But why does he print the last line?
...
I'm trying to use classes in XSL (the 'msxsl:script' tag). But I get the 'Syntax error' message when debugging the file. Here's a simple code that I'm using:
function Test1(str)
{
this.str = str;
}
Test1.prototype.getStr = function()
{
return this.str;
}
function test()
{
var newTest1 = new Test1("some string");
return...