I am using jquery to find a first element having a class "error" applied to it using the below code
$('#mainDiv input.error:eq(0)')
But the above one working only for input elements only.
How to make this one to work for both input and select elements?
I have a table view that gets refreshed two different ways. One is through a button and the other is when I call my refresh method, which is the same method that I use for the button, but for some reason, when I hit the button it works, but when I call it through a different class it doesn't.
Here's the code that I use to refresh the tableview:
Msqv *qv = [Msqv new];
[qv refresh:self]; //refresh is an IBAction that is used by the button
Hello,
I have a python program/file that I want to run repeatedly and calculate the averages of some variables over these runs. To do so, I thought it might be convenient to convert this program into a function or a class. One way I can think of is to add a
def Main():
line at the top and indent every line manually within it. Is there an easier way? I am using pydev on eclipse.
Thanks.
Is there some way to acces the user object from a custom routing class?
I'd like to add a parameter when generating a url, and that parameter is inside the user session, so I need to access it.
The only way I found to access is using the sfContext::getInstance()-getUser(), but it's known to be inefficient.
Thanks!
I have a class like this
$.fn.dimeBar = function(custom) {
var var1 = 'test1';
var var2 = 'test2';
if(sometest){
//how can i access var1 or var2 here by using string name of variables
//some thing like alert(this['var1']) -- should alert: 'test1'
}
}
This might be a dumb question, but I don't get it:
I have a class called Card. I want to do a shallow clone using MemberWiseClone().
In Theory Card inherits from Object. So it should be able to use MemberWiseClone(), even if MWC() is protected ??
Am I missing/forgetting something?
I'm looking for a C# class that represents a file system path. I would like to use it (instead of strings) as the data type of variables and method arguments (top reasons: type safety, concat-proof, logical comparisons).
System.IO.Path provides most of the functionality I want, but it is abstract.
System.IO.FileInfo, as I understand, performs IO operations to do its job. I only want a wrapper for the path string.
Thanks!
What is the default values for members of a struct and members of a class in c++, and how do these rules differ (e.g. between classes/structs/primitives/etc) ? Are there circumstances where the rules about the default values differs ?
This is my code:
#include <algorithm>
class A {
void f() {
struct CompareMe {
bool operator() (int i, int j) { return i < j; }
} comp;
int a[] = {1, 2, 3, 4};
int found = std::min_element(a[0], a[3], comp);
}
}
Error message:
no matching function for call to ‘min_element(int&, int&, A::f()::CompareMe&)
What am I doing wrong?
Hello,
is their any way to make this work, without sacrificing the cdef in cdef caller? (no use of cpdef either)
from array import *
from numpy import *
cdef class Agents:
cdef public caller(self):
print "caller"
A[2].called()
cdef called(self):
print "called"
A = [Agents() for i in range(2)]
def main():
A[1].caller()
This is pretty strange.
I have a class in Classes folder of my project (a .h file and a .m file).
When I try to import it like so
#import <myClass.h>
I get an error saying "no such file or directory".
It is definitely there. What could be going on?
Hi,
Thread class has run method to implement the business logic that could be executed in parallel.But I want implement different business logics in a single run method and to run simultaneously.How to get this feature.
thanks
Is there a way to extract the array for a specified id with the set::class utiliy? I can't figure out the XPath.
I.E. I would like to extract the array where the id = 1
[Document] = Array
(
[0] = Array
(
[id] = 1
[filename] = 1.txt
)
[1] = Array
(
[id] = 2
[filename] = 2.txt
)
[2] = Array
(
[id] = 3
[filename] = 3.txt
)
)
I have to write a simple method extractArticle() that returns Article object which is extracted from Message object. I have MessageService and ArticleService classes intended to handle tasks like this. What service class is more correctly to use to incapsulate extractArticle() funcionality?
$article = MessageService::extractArticle(Message $message);
or
$article = ArticleService::extractArticleFromMessage(Message $message);
I am developing a website(web forms , not MVC) in VS 2008(with SP1 ).I am trying to incorporate the ASP.NET Routing.I am following the MSDN tutorial to do it.
http://msdn.microsoft.com/en-us/library/cc668201.aspx
I have added the below items to my glbal.asax.cs file as per the tutorial
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.Add(new Route
(
"Category/{action}/{categoryName}"
, new CategoryRouteHandler()
));
}
When trying to build it is telling like "The type or namespace name 'RouteCollection' could not be found (are you missing a using directive or an assembly reference?)
I have System.web imported to my global.asax file
Any Idea how to get rid of it ?
I'm pretty new at this. Tried to make sense of the manual page for mcrypt at PHP.net when I thought a good tutorial would do a better job. So I searched yet without anything substantial.
I also tried one of the examples of using mcrypt to perform the encryption and decryption with 2 functions, but it gives a warning of "Size of key is too large for this algorithm".
Can anyone please write me a two-way class to do the encryption / decryption using mcrypt so I can make sense of the library? Thanks!
As you may have known that I switched from ubuntu to windows from my previous questions. I was working on Zend Framework on ubuntu and now working on same project in windows. Because of this switching I facing some problems in windows which was not occurred in ubuntu.
Now I have the following error in firebug console when I go to login page:
<b>Fatal error</b>: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in <b>C:\wamp\www\vcred\library\Zend\Db\Adapter\Pdo\Mysql.php</b> on line <b>93</b><br />
Do you people know that what type of error is this and what is the solution?
I have the following configuration for database.
resources.db.adapter = "Pdo_Mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = ""
resources.db.params.dbname = "test"
resources.db.params.charset = "utf8"
Thanks
Hi All, im doing an aplication with Lucene (im a noob with it) and im facing some problems.
My aplication uses the Lucene 2.4.0 library with a custom similaraty implementation (the jar is imported)
In my app im calculating doqFreq and numDocs manually (im adding the values of all indexes and then i calculate a global value in order to use it on every query) and i want to use that values on a custom similarity implementation in order to calculate a new IDF.
The problem is that I dont know how to use (or send) the new doqFreq and numDocs values from my app on that new similarty implementation as I dont want to change lucene´s code apart from this extra class.
Any suggestions or examples? I read the docs but i dont now how to aproach this :s
Thanks
I have a pure ActionScript project. I'm using Flex Builder on a Mac, Flex SDK 3.4 and I've even added the playerglobal.swc from the Flash folder to the project's library path. I get autocomplete when I add
import flash.net.NetStreamPlayOptions;
import flash.net.NetStreamPlayTransitions;
But when I run the movie, I get:
VerifyError: Error #1014: Class flash.net::NetStreamPlayOptions could not be found.
I don't get it.. What must I do to use those classes?
Is there any point at all on inheriting from Type class in .Net?
i.e. What could be the meaning of doing so?
I am asking this because of this text in MSDN documentation:
Notes to Inheritors When you inherit from Type, you must override
the following members... list of
members.
MSDN doc for Type: http://msdn.microsoft.com/en-us/library/system.type.aspx
ok, that is actually saying that anyone can inherit from Type... but they dont say why would you ever want to do that.
Thanks!
Hi,
I want to extract method body from a Java Source Code.
Suppose I have the following code:
public class A{
public void print(){
System.out.println("Print This thing");
System.out.println("Print This thing");
System.out.println("Print This thing");
}
}
My objective is not to extract the method name (in this case print) but also the bode of the
method(In this case the three print statement inside the print method). Can anyone suggest how can I do so? Is their any library available for doing so.
Something that has been troubling me for a while:
The current wisdom is that types should be kept in a namespace that only
contains functions which are part of the type's non-member interface (see C++ Coding Standards Sutter and Alexandrescu or here) to prevent ADL pulling in unrelated definitions.
Does this imply that all classes must have a namespace of their own? If
we assume that a class may be augmented in the future by the addition of
non-member functions, then it can never be safe to put two types in the
same namespace as either one of them may introduce non-member functions
that could interfere with the other.
The reason I ask is that namespaces are becoming cumbersome for me. I'm
writing a header-only library and I find myself using classes names such as
project::component::class_name::class_name. Their implementations call
helper functions but as these can't be in the same namespace they also have
to be fully qualified!