How can I indicate that a method will return a collection of objects in UML? Is there a better way to explain the relationship than to have a collection class as a return type?
I was wondering, is the size() method that you can call on a existing ArrayList<T> cached?
Or is it preferable in performance critical code that I just store the size() in a local int?
I would expect that it is indeed cached, when you don't add/remove items between calls to size().
Am I right?
What is the safest communication method between two applications on the same machine, both Java and C/C++ clients with a Java server.
Are SSL sockets safe enough or they can be broken by "man in the middle" attacks?
As i saw in the documentation and code samples, JSSE retrieves private/public keys and certificates from keystore files which a malicious user can see. The only thing that you can hide in the code is the password used to unlock the keystores.
Can hackers retrieve that password?
I've been following Ryan Bates' Railscasts tutorial on CarrierWave, which you can find here
Everything works fine, except for when I go to view my profile, it gives me this error:
undefined local variable or method `user'
I don't know why it is telling me this, as I am using Devise for my authentication, and that is the name of my model.
Below are some of the files which may be useful:
https://gist.github.com/amarh21/7439421
I am using Rails 4.0.1 and ruby 2.0.0
Let's say you have two objects (UITextviews) in your class. When the text view changes, you have a delegate method that catches the change.. but how can you tell programatically WHICH object was changed and called the delegate ??
I have to be missing something, because this should be trivial, but I couldnt find anything.
Note: In this case, its not possible to just break up the class to only have one object (there by bypassing ambiguity).. I looked for things like assigned variable names for nsobjects, nothing there
Maybe my question might seem a bit weird, but I have an activity in which, in one case , I have to move to another activity before it finishes loading the screen. My condition is in the onCreate method, which means when I encounter it, i get a "startActivity called from outside an activity context" error and the app just crashes...
But then, is there an easy way like a flag for the intent to make it work without having the activity context resolved?
thanks for any answer
I am trying to set up a basic Facebook application using PHP and an external .swf
this line
$user_id = $facebook->require_login();
creates this error:
Fatal error: Call to undefined method Facebook::require_add() in C:\httpdocs\facebook_application\index.php on line 10
I cannot find the cause of this error...
What is the save method for cocoatouch?
I need to add it where the comment is: // whatever you want to do.
(BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)ntype {
if ([request.URL.scheme isEqualToString:@"hide"]) {
// whatever you want to do.
}
return true;
}
when I try and run the "rake db:seed" command the rails console outputs "NoMethodError: undefined method `db' for #" not quite sure what going on. I'm using netbeans to build my rails project which is using the built-in JRuby 1.2 would that have anything to do with it?
I would like to know if something like below is possible ,
list<**MyObject**>.**removeAll**(list<**String**>)
I hope the context is understandable.
The list<MyObject : is a ArrayList<MyObject
The list<String : is a ArrayList<String
I know this can be achieved by overriding equals method in MyObject class. I would like to know if any other choice is prsent.
Thanks,Srinivas N
i tried the following code for cloning the object. while compiling it shows clone is protected and cannot be accessed, but i had extended Object class, hence the clone method will be public to my class . please explain me the reason.
class storeDate extends Object {
public static void main(String[] args)
{
storeDate d = new storeDate();
Object o = (storeDate)d;
o.clone():
}
}
In Python I can use the iterkeys() method to iterate over the keys of a dictionary. For example:
mydict = {'a': [3,5,6,43,3,6,3,],
'b': [87,65,3,45,7,8],
'c': [34,57,8,9,9,2],}
for k in mydict.iterkeys():
print k
gives me:
a
c
b
How can I do something similar in Javascript?
Assuming the parameters are all the same type, is there a rule of thumb in regards to the number of parameters for a method? Im just wondering where I should draw the line and what my alternatives are (ie interface, array, etc).
elementData = Arrays.copyOf(elementData, newCapacity);
Gives error: "The method copyOf(Object[], int) is undefined for the type Arrays"
This was not a problem on my home computer, but at my school's it gives the error above. I'm guessing it's running an older JRE version - any workaround?
Thanks
public static synchronized void main(String[] args) throws InterruptedException {
Thread t = new Thread();
t.start();
System.out.print("X");
t.wait(10000);
System.out.print("Y");
}
What is the problem with this method?
How can I avoid such problems from now on?
Hello, once hardware is rotated, I use (void)didRotateFromInterfaceOrientation to adapt view when rotation is enabled but, wich method or how to detect that iphone got back to vertical position in order to readapt view???
I need to be able to read the value of my attribute from within my Method, how can I do it?
[MyAttribute("Hello World")]
public int MyMethod()
{
//Need to read the MyAttribute attribute and get its value
}
I am starting to use Unity 2 , having happily used earlier versions. I notice that the IUnityContainer.BuildUP(object obj) method has been removed. Why has this happened?
Hi, I am using jsf 1.2_12, here i am not able to find Method Expression or getExpressionFactory in Facescontext.getcurrentInstance().getApplication. What could be the problem. kindly help.
HI can any one tell me which web development method is currently use. and can anyone also tell me related article or any other guide for it, am working on web development project in asp.net and Sql server (Clothing Website) as it is my first project after finishing my studies and i don't have much idea, which process should i have to follow
I have a legacy application that I inherited that passes a lot of XML around as Strings.
I often need the ability to check if a String will be valid XML. What is the fastest and least expensive way to check if a string is valid XML in .NET?
I'm working in .NET 3.5 and would most likely use this as an extension method (off of string) in this one project within the solution.
Hello I have a string and when i try to use replace method in for loop it doesn't work
String phrase="hello friend";
String[] wordds=phrase.split(" ");
String newPhrase="sup friendhello weirdo";
for (int g=0;g<2;g++)
{
finalPhrase+=newPhrase.replace(wordds[g],"");}
}
System.out.println(finalPhrase)
It prints out "sup hello weirdo" and i expect it to print "sup weirdo".
What am i doing wrong?
I know this seems silly, but I would like to call some of Rails' Text Helpers in a rake task I am setting up. (Thinks like the pluralize and cycle method: http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html)
How would you go about making these available in a rake task, or is it not easily possible?
J2SE Client Server App: Client calls RMI message. Server handles RMI method and returns, but Client never receives it.
Any ideas how this could happen? Our attempted solution is to set client read timeouts and come up with a framework for resending requests or otherwise handling those failures gracefully.
But really, I'd like to know any root causes for how this might happen rather than addressing the symptoms.
Selenium clickAt() function is throwing "Unsupported" exception while using with WebDriver (WebDriverBackedSelenium or just Selenium 2.x using ChromeDriver).
Is there any way to use this Selenium function via WebDriver?
Adding some code for context ...
ChromeDriver driver = new ChromeDriver();
driver.findElement(By.id("someID")).clickAt("25, 25");
.clickAt() method isn't even recognized ... however, using the WebDriverBackedSelenium is what provides the Unhandled exception.