« first day (1108 days earlier)      last day (3847 days later) » 

2:23 AM
@bharal I think it's kind of a no-brainer. Guava is basically a convenience library, making menial Java tasks easier to quickly implement. Since it is so basic at its core, it's no doubt used ubiquitously throughout most Google software. Open sourcing it gives Google the benefit of quickly obtaining a large base of testing users, who might report bugs. Users can also contribute to Guava, which is going to make Guava more robust over time.
This page sums up nicely why open sourcing the library is beneficial for Google: code.google.com/p/guava-libraries/wiki/HowToContribute
> We believe that a bigger, more involved community makes for a better library, and that better libraries make the world a better place. We can always use more feedback.
 
 
5 hours later…
7:46 AM
Hello everyone, Do you any tools in Intellij idea for generate HTML code?
 
 
3 hours later…
10:47 AM
hi all
 
 
2 hours later…
12:28 PM
hi ,did anybody had an experience with Xpath
 
Hi folks.
 
1:00 PM
I have a question. Is there a way to round up or down a double. So for example. If the result produces 66.35. The result would be 66. If the result was 67.5 it would round up to 68.
 
Use Math.round()
 
i was just about to type that... lol
i was being silly ^^. Thanks
 
Hehe, kind of obvious, but sometimes the obvious methods get missed (Math.max() and Math.min() get used way less than they should).
 
Not used java is donkies years. So just trying to get familiar with it once again. :)
 
1:22 PM
So I'm here now.
 
2:17 PM
please help me "unable to make equilateral triangle with 2 dimension array?"
Desired output like this : i.stack.imgur.com/HzOuO.gif
 
2:42 PM
@Danny post a pastebin with your code
 
 
6 hours later…
8:50 PM
hi all
Hello guys, is there someone available now?
 
9:14 PM
@eyasu I'm here
 
ok, how are u Aaron?
I need a help one one issue
on*
hello
here is my question if u have a couple of minutes to check it
1
Q: Injecting property values from property file or xml file into PreAuthorize(...) java annotation (Unresolved)

eyasuI've asked this question in my previous post here: SpEL for spring security: Passing Values from XML to Java based SpEL configuration. But it wasn't yet resolved. I want to inject values either from an xml configuration or from external file into @PreAuthorize(...) annotation. It is not easy like...

 
9:45 PM
hi @kylar
 
bonjour
 
come stai? :)
 
Still talking Canadian, eh?
 
nope :)
 
Je ne parlez pas français.
 
9:46 PM
Not you, eyasu
 
ok Aaron
 
Do you speak Canadian?
 
I cannot speak francais
me no :)
italiano and english
Aaron have u seen the link?
 
Yes. Alas, I cannot help.
 
ok
really i am fade up on that issue
 
9:49 PM
*fed up
;)
 
ya :)
 
I gave it an upvote. It's a very well-written question.
 
thanks bro
 
yes, i tried to write it clearly. Because such type of questions are not yet solved.
 
9:50 PM
That's the spirit!
 
I can able to solve such type of issues by implementing custom permission evaluator, but I want to try it without considering permission evaluator
because we can avoid the complexity that can come with permission evaluator
that is my point
 
Makes sense
 
thanks again!
 
You mention you were able to inject values with @Value annotation?
 
sure
 
9:56 PM
What does that look like?
 
I can inject the values
 
In what format?
@ or ${}
 
string
no no
the value it self
ok
got u
@Value(...)
but not in the @PreAuthorize
I did that on member variables
 
gotcha
 
for example: @Value("#{propertyConfig['user.id']}")
private String userId;
this injects the value from external property file to userId
but am unable to do the same thing for expressions inside @PreAuthorize("....") annotation
 
10:06 PM
Right. Hmm that's weird
 
ya
 
So basically Spring is evaluating the SpEL expressions differently between the two Annotations?
 
ya
i mean the expressions might be different
 
Take this as an opportunity to rid yourself of Spring!
 
10:11 PM
probably there is another way of expression in case of @PreAuthorize(...) annotation
I think i've checked it,
 
Hey hey
 
there is one case, there are some built in SpEL expressions. You can pass those expressions in the PreAuthorize annotation
 
Helping a friend with a HW here, I'm an Obj-C coder but this is Java.
Can anyone help?
 
@Mo
 
The assignment is to extend the Stack class so there's a pushdown method.
 
10:15 PM
Spring by it self can evaluate such type of expressions
 
@Moshe what problem are you having?
 
The method copies the first value and inserts it at index i
 
for example if the expression is role related stuff
 
I'm getting an error about a missing symbol.
 
http://docs.spring.io/spring-security/site/docs/3.0.x/reference/el-access.html Any Spring-EL functionality is available within the expression, so you can also access properties on the arguments. For example, if you wanted a particular method to only allow access to a user whose username matched that of the contact, you could write
@PreAuthorize("#contact.name == authentication.name")
public void doSomething(Contact contact);
 
10:18 PM
Stack subclasses Vector, though, so it's supposed to be there.
@Kylar Love the avatar btw
 
Merçi
 
Yes, Aaron, that is why I decided to find out the solution for such type of cases. This example from their documentation is the one that motivates me to go in this way
 
Does anyone have any feedback on this class, though?
 
i mean they wouldn't put this example on their documentation unless otherwise it could be evaluated
 
Stack/Vector does not provide an insert() method
So you're calling a method that doesn't exist.
you might be looking for add()
 
10:22 PM
Hrm... Maybe - let me check the docs.
That's right
So now it's complaining about about "unchecked or unsafe operations"
 
Sorry guys, I'll be back when u finish this topic. I think i am confusing you with another topic :)
 
It looks like something to do with types, just not sure what to do to fix it.
 
@Moshe that's because you're using a class that can be typed, but you're not using that.
You can change it like this:
 
Yea, I did that.
What's the best way to dump the contents of the Stack to the screen?
 
public void dumpContents(){
        for(E e : this){
            System.out.println(e);
        }
    }
 
10:27 PM
nice
 
yay generics
 
Wait, there's an error here.
 
You can do it a bit differently too:
System.out.println(Arrays.toString(this.toArray()));
 
Stack subclasses array?
@Kylar: xtendedStack.java:38: error: cannot find symbol
		System.out.println(Array.toString(this.toArray()));
		                   ^
  symbol:   variable Array
  location: class ExtendedStack<T>
  where T is a type-variable:
    T extends Object declared in class ExtendedStack
1 error
 
No, but Vector is an implementer of List, which provides a toArray()
 
10:30 PM
Ok.
 
the error is because you didn't add an import statement for Arrays
you need:
import java.util.Arrays;
 
replace Array with Arrays too
 
thanks, noted
 
Whoops, type
 
Kylar, have u seen my question?
sorry for the disturbance :)
 
10:41 PM
Why is our output array right-to-left?
@Kylar Sorry to nag you, almost done.
 
Hang on, be back in a minute
 
ok
 
OK, so I think you're confused about the stack implementation.
 
Yes. Yes, I am.
 
the 0 index is considered the bottom of the stack, not the top
 
10:49 PM
oooh
 
so if you do a push, it pushes onto the top (or end)
and pop does the same
but then you're converting to an array, which is kind of at odds to how you're treating it
If you want to print it in stack order,
then do something like this:
Hang on, my machine is hanging :)
but something like this:
public void dumpContents(){
        for(int i = this.size()-1;  i >= 0; i--){
            System.out.println(this.get(i));
        }
    }
print from the end
@KevinVerlinden what do you want?
 
@Kylar Thanks, makes sense!
 
NP, glad I could help
 
@Kylar What do you want? Get off my lawn!
 
I just have a distaste for online marketers
 
10:59 PM
lol
 
guys please check this one when u have free time
and comment your suggestion
2
Q: Injecting property values from property file or xml file into PreAuthorize(...) java annotation (Unresolved)

eyasuI've asked this question in my previous post here: SpEL for spring security: Passing Values from XML to Java based SpEL configuration. But it wasn't yet resolved. I want to inject values either from an xml configuration or from external file into @PreAuthorize(...) annotation. It is not easy like...

this is my question
 
11:16 PM
@eyasu Do I have to SpEL it out for you? ;-)
 
:)
I wish if u can
:)
 
Here's a fun java exercise using the goes-to operator. It's rarely used.
public class GoesToOperator {
  public static void main(String[] args) {
    int x = 10;
    //use goes-to operator
    while (x --> 0){ // while x goes-to 0
      System.out.println("x = "+x);
    }

  }

}
 
Interesting
It's just postfix decrement x greater than zero though
Same as while (x-- > 0) { ... }
Looks cool though
 
;)
 
Best random number generator:
Random random = new Random();
for(int i=0;i<10;i++)
{
    System.out.print(random.nextInt(10)+" ");
}
 
11:32 PM
This is the best random number generator:
public int randomInt(){
    return 4;//completely random, chosen by dice roll.
}
 

« first day (1108 days earlier)      last day (3847 days later) »