« first day (1433 days earlier)      last day (3516 days later) » 
00:00 - 23:0023:00 - 00:00

11:01 PM
@AIL you have write access. Please read and follow the rules
 
Hi, Android!
 
Hi Code
 
actually...an appointment didn't show up or respond to my txt, so I'm gonna go get lunch, brb
 
AIL
@Emmanuel Thank you , the link does not work :/
 
should work now
 
11:04 PM
Oh man why did I discover product hunt
now I have another site I'm wasting time on
80k left. then I shall get a swag box.
 
AIL
:O i have way much longer way than you :P
but still interesting
 
gimme da swag!
 
I have like 5 accounts with over 100k rep, but I try to keep a low profile which is why I use this guy.
 
:D
 
AIL
5 accounts -_- , not bad :P
 
11:13 PM
What in the hell happened to the badge filters on the profile page???
 
AIL
yeah what about it ? what happened ?
 
the more important question at the moment is
what happened to scotland?
the referendum was today right?
 
Does anyone else still have filters?
 
it's past midnight here
 
Ok, my new lib will be a simple ButterKnife
 
11:15 PM
I don't know
 
Then I will write a post on how to do it
 
there seems to be no result yet
a simple butterknife?
reinventing sonething that's already there?
:D
 
just for the purpose of explaining to people how to create their own
 
well, how does one create their own?
 
and it will help me understand annotation processing
 
11:17 PM
I guess it has to do with reflection, no?
 
kind of
so basically what the do is the following
 
first you need a mold, then you melt some metal, then you pour the molten metal into the butterknife mold, then you let it cool, take it out of the mold and bam, butter knife.
 
when you annotate your fields with InjectView for example
they process the metadata from that annotation
 
they get the value of that id you passed in
 
11:18 PM
lol dave
and then find out the actual view with reflection?
^lots of reflection :0
 
then they literally generate a new class via a StringBuilder
that class has a method that basically does a findViewById()
 
"Late YouGov 'exit poll' shows Yes 46, No 54
- Polls close have closed at 10pm
- First result expected at 2am"
 
@Ahmad you mean SE sends you swag when you get 100k? And here I thought these imaginary points weren't worth anything...
 
so the first results should be in in one and a half hour
 
and assigns the returned view to the variable you annotated with InjectView
 
11:21 PM
@Code-Apprentice hah! you can prove everybody wrong now :D
 
AIL
@a
@Ahmad is it worth really ?
 
what is worth it?
I'm just going through the butter knife code, emmanuel. Such majestic JW-code.
 
they use reflection to actually invoke the method generated via the StringBuilder that is inside compile-time generated Class
Look at the ViewInjector class
 
AIL
The time you take in contribution for the question on SO
 
specifically at ViewInjector.brewJava()
 
11:24 PM
oh it generates code?
ah never mind
it injects code, so yeah of course it does
AIL: Yes the contribution is worth the time. You'll learn a lot. But if you're doing it for a gift basket then no.
isn't it possible to just get the meta info per annotation and then invoke the class per reflection?
I don't quite understand why you need the code generation :|
 
Yeah, it actually generates a new Class using a StringBuilder and JavaFileObject
the problem with that is that it is slower
> Instead of slow reflection, code is generated to perform the view look-ups. Calling inject delegates to this generated code that you can see and debug.
 
Ah I see
 
I really thought there was more magic behind ButterKinfe
 
Never thought reflection would be so slow that it's actually better to generate code at run time to over come this
But wow
this looks like an awesome project to study
 
yeah
I have been doing that for the last couple nights
 
11:31 PM
I love studying other peoples github repos
although, it actually makes one feel so awful about ones own code.
 
that is why I wanted to break it down by doing a small little project that just injects a View
not really
 
but you learn lots of stuff
 
TBH I didn't know until yesterday night that you can have methods inside enums
and I learned it thanks to studying that repo
 
Any Scots here?
 
I don't think so
some brits though
methods inside enums?
Hmm I think I've seen it before
but I've only once actually used enums
Whenever I need a flag I just chose int over enums
 
11:35 PM
yeah
 
hmm there was this presentation from Romain Guy I think
where they inspected java byte code
on the one side there was the stuff that gets produced for enums
and on the other for int
 
hmm can't find the talk rn, but it's interesting to see
 
sound cool
 
I'm thinking about maybe adapting 2 space indentation for java
this code just made me think of it again
 
11:38 PM
4 spaces per indent or die
7
 
but look at the code!
so majestic
and looks way cleaner
 
I don't like it
 
I do not know why they have those @Override on the enum methods...
 
the language that looks best with 2 space indentation is without a doubt ruby
 
They even format the code generated class, lol
 
11:40 PM
ikr?
Was just looking at that lol
22
A: Java Enum Methods

Amir AfghaniFor a small enum like this, I find the most readable solution to be: public enum Direction { NORTH { @Override public Direction getOppositeDirection() { return SOUTH; } }, SOUTH { @Override public Direction getOppositeDirection() ...

I'm just looking at that myself
 
so what do you think? Annotations are not as intimidating as I thought...
 
I love annotations
And yeah, the lib is not that difficult to understand
I think I get the enums now
wow, I had no idea
totally feeling like a newb rn :|
 
lol
hey but we understand the code!
lol
that makes me feel better
 
he even generates the code for his tests!
lol
Got a long day ahead of me tomorrow, so good night!
 
LOL
he does
Well after I get good with annotations, I was thinking of creating a lib that generates simple Robotium tests from code
 
00:00 - 23:0023:00 - 00:00

« first day (1433 days earlier)      last day (3516 days later) »