« first day (2363 days earlier)      last day (2810 days later) » 

13:00
superb costly.
mark because when you do background operation till the time it is completed onDetach may have been called and boom NPE
also i doubt fragment lifecycle actually work correct i have gotten NPE without doing any background operation
that makes sense
I have the error in network lib code, but before it is initialized
ronak well yes but nothing can be done
like "cannot init with null context" which is the activity
13:03
lmao what adam
Tim does your fragment extend some basefragments or something?
no just Fragment
well you must be calling before onAttach then
no
actually this happened today for the first time
paste the code
Tim it happens sometimes that is why i said it is quite weird
this is the first time in like a year time for 100 users that it happens
13:05
@ColdFire yeah but what are you supposed to pass as a context then? getApplicationContext()?
i just keep a activity private member init in onCreateView and null it in ondestroy
@MarkO'Sullivan pass where?
no issues what so ever
Into methods which need a context
@ColdFire I saw that on my way into work. It's a Canadian license plate that says Bratwurst lmao
lol
and in america
mark you can use getactivity() as long as it not detached
god damn android sometimes
9
13:07
lol
lol
well change sometimes to most of the times
remember BLE
stop it CF
Don't bring back those nightmares
mark i have used getActivity() in my app but i got tons of NPE
so well damned the fragment lifecycles
next thing you know getApplicationContext returns null
well in my app i have over 100 crashes over a stringblock returning null
which is inside fucking android sdk
to get a drawable :/
13:11
getApplicationContext returns null weird.
We got getActivity() null most of the time as Fragment is not attached.
So what I did ...I have created one method to return context in extends application class and I was using that context in non activity/fragment class to fetch string etc...
It all worked.
            </cfloop>
       </cfloop>
</cfloop>
My current situation :/
Are we still talking about Fragments and Activities?
What is the question?
It's coldfusion but I'm sure you can guess what's going on there
It doesn't return null I'm just saying stuff happens that is not supposed to happen
Yeah cM I can read that
cf loop is like "realm sucks realm sucks realm sucks realm sucks"
until </cfloop> ends it
lol
damn the cfloop
it must be c floop
13:20
It's more like
"realm sucks realm sucks realm sucks realm sucks"
"oh no this is terrible"
"shoot me now"
"realm sucks realm sucks realm sucks realm sucks"
"oh no this is terrible"
"shoot me now"
Until you run out of things to loop over
And 7 queries inside searching, deleting, and inserting shit. Well, sometimes. If it did those things all the time, I wouldn't be looking at it right now
That was all for you, CF, since you seem to miss my rants :D
well it looks like you are screwed
haha, yep
Unless I can bandaid it until next week when the guy returns who should have fixed it in the first place
oh this vivaldi browser is looking promising
well band aid it then
13:29
Is it possible to do something like this: setupUI(List<Object> objectList) and then convert the List<Object> to List<ClassA> or List<ClassB> depending on what the objects are?
o/
o/
mark cast it?
why do you need that mark?
why do you pass different object types to the same method?
Hey people and @codeMagic
Cut down on the amount of methods needed
Hopefully
13:34
brb
I think what you need is some polymorphism
o/ PeeWho
@MansiBhatt You need 80 rep and a better Q;A than what you currently have. Feel free to request again after giving back more and getting there room-15.github.io
using 1 method for 2 types is not efficient if you still have to check what the exact type is and then use an if/else
13:36
@codeMagic Did the bot gave up?
He was put in the shop for maintenance last night and haven't seen him since
Might have been GCed
Okay so essentially I'm wanting to make a generic searchboxdialog component which will be reuseable no matter the model
Right now the model is nationalities but in the future I'll want to use it for searching for golf courses
We will miss you buddy :(
mark, what is the common functionality?
The searchboxdialog should allow you to search through the model for a specific detail
So you might be searching for a specific nationality, it'll start looking for it when you start typing each letter.
13:40
Kind of Generic model.
Or if you're searching a golf course it'd do the same thing
how about class Nationalities implements SearchBoxDialogComponent
I tried extends, whoops
and setupUI(List<SearchBoxDialogComponent> list)
extends can work, but makes no sense :P
you can call your search specific method on the list items without having to cast or convert them to their respective type because the interface forces those classes to implement the method you will be calling on them
So I'm going to have a List<Interface>?
13:49
yes
But I need to pass through a List<Model> into the ListAdapter so I can populate the list of nations / golf courses
you can still do that
yay, dark theme in my app!
I'm pretty confused, so I do the logic on working out if it's a List<Nationality> / List<GolfCourse> and then setup the adapter accordingly?
That theme manager in AS is really bad
13:56
which libraries are available and that are maintained that can be used to build in app user guides like in this post stackoverflow.com/questions/18298590/…
@TimCastelijns I don't need to have an interface, I could just have two constructors for my Adapter, one for the Nationalities and one for the Golf Courses
@GotaloveCode What's wrong with the answer?
I don't really understand the structure I think mark
I got it!
you have the same adapter for multiple model/views?
13:58
@PeeHaa some those are libs havent been updated over the years
And some are updated
Any of you heard of WhiteMobi?
Also there are comments underneath it
SearchDialogBox will be a dialog component with a search bar at the top of the dialog which allows you to search for something. I'm wanting to keep it generic so I can reuse it, which is why I originally asked if you could pass through a generic object.
This is what I'm essentially tweaking and adapting
It works with nationalities atm but I want to make the component more generic so you could throw a model at it and it'll work
so in my case I'm wanting to create a model which will contain Golf Club names
@MarkO'Sullivan Stop throwing models at stuff. Models are people too
14:01
:c
sorry!
but if you're famous they will let you do anything
grab 'em by the property
idk how to make it generic
Which is why I've been tinkering with it and then asking in here for advice
you are altering the lib?
this? protected CountryListAdapter(Context context, List<Country> countries) {
14:05
Yes!
That's why I wanted to know if you could have a generic List and work with it, don't know where I was going with it
you search by model name?
Yeah atm the search uses the name to filter through when searching
Any ideas on how to make it more generic / reusable?
So what about interface Searchable { void getSearchableName(); } that for country returns the name of the country and for another model it returns something else
protected CountryListAdapter(Context context, List<? extends Searchable> countries)
I'll give it a shot!
You sure a parent class wouldn't work?
it would, but it makes more sense as an interface I think
14:10
@codeMagic lol
mark do what tim says
2
cough composition over inheritance cough
mark a parent class would also works
stripped down the bottom part a bit because it was not relevant
^^ exactly what i would recommend
@TimCastelijns thank you!
14:18
that is the right way^^
god damn it
why am I capable of giving others advice on software design
but I always make a mess of my own code
Could you explain this List<? extends Searchable>, like I've seen the ternary operator when working with booleans but I'm not overly sure what it means in this context
well because it is easy to give advice but difficult to implement
Does the ? mean generic class?
14:20
@MarkO'Sullivan it means ? can be anything but it has to extend searchable
See originally I was trying List<?>, why wouldn't that work?
Is it too generic?
it is not the ternary operator
yes and ^
? can be anything
List<?> implies the objects are Objects
List<? extends Searchable> implies the objects are Searchables.
when ? extends Searchable ? has to extend Searchable
14:25
Thanks guys
That makes perfect sense
If you have other questions about generics go to CF, I barely know anything about the subject
mark the reason we are using ? extends Searchable , because String text = getItem(position).getSearchableName();
you wouldnt be able to call this method without that
So I kinda want to scrape Facebook because I'm bored, but also, legality.
because compiler doesnt know what ? is
Which is more important. Technical legalities, or curiosity?
14:27
legalities
obviously
@ColdFire so what does getItem(position) return?
the item at that position
no no but what is the item? Searchable object?
CF is saying the reason you are allowed to call the 'generic' method getSearchableName on the item is that regardless what it is exactly, every item in the list implements Searchable and by interface contract it must implement that method
so it is safe to call the method, without knowing what you are calling it on
14:33
okay so if I'm handling that List<? extends Searchable> then any method I want to call must be within the interface. Gotcha :)
or any other interface both models implement
but you got the point
but if that's the case would it not be better making one general model which can adapt to all situations?
separate logic wherever you can
avoid God-objects
single responsibility principle etc
How would you go about converting one of the items from the list into one of the models so you could use the methods which are only available to that model?
14:36
i wouldn't
no bad idea
Okay so that list is just to read data from essentially?
you are trying to destroy everything that pattern does
Okay makes sense
if you want a method make that method in the interface
14:38
Will do
Would any of you guys find a component like this useful?
I would also advise against using 1 adapter for displaying a variety of views/models
i use a baseadapter with common code
and separate adapters for all which extends base
because you are then coupling everything together in the same class
14:40
BaseAdapter extends BaseAdapter and then you extend the BaseAdapter any time you create a new Adapter?
29 mins ago, by PeeHaa
cough composition over inheritance cough
peehaa you need some cough drops?
3
haha mark kinda
lmao Tim
cause I realised the ListAdapter I have atm already extends BaseAdapter
my adapter has 4 level extended
14:41
so you must have your own BaseAdapter :p
What :|
Nope. Just noting that extending stuff is not the only way
Or even the best way in most cases
So you argue against extending BaseAdapter @PeeHaa?
A->B->C->D->baseAdapter
yes
I would prefer composition over inheritance where possible feasible
so you have an interface which is implemented by all of your ListAdapters?
14:42
1 hour ago, by Tim Castelijns
I think what you need is some polymorphism
^.^
^
mark my adapter does lots of other stuff you might not need more than 1 level extended
@Peck_conyon write access here requires 80 rep. Also you seem to only use chat for support. Fix those things before requesting again room-15.github.io
> When you use inheritance to reuse code from the superclass, rather than to override methods and define another polymorphic behavior, it's often an indication that you should use composition instead of inheritance.
@Mark if you find this stuff interesting (which it is) give this a moment of your time java-design-patterns.com/patterns most patterns you will never have a use for, but some are super common and boost your code quality a lot
Meaning it will be sooo much easier to test your code
wow so many patterns
14:51
testing, replacing, updating, extending, everything you do will be easier :P
If you are really bored and like dead trees I strongly recommend amazon.com/Patterns-Enterprise-Application-Architecture-Martin/…
and everyone can now answer this question that was posted 1 min ago
0
Q: Why is List an Interface and not a Class

aishMy doubt is between a simple class with implementations of methods and an interface. not the abstract class. Why cant we just make a List Class , give all the method implementations and make Array List or Linked list to extend it. arent the implementations of methods same.

closed as POB
jk
we closed it as dupe
lol better than POB i guess
15:09
@TimCastelijns awesome! They got examples on GitHub as well
I've already starred his repo on GitHub lol
\o/ nice
i discovered some new patterns too
Looking at a Facade, not quite sure what's going on but cool :D
off topic?
first day on the job?
15:19
oh yeah its offtopic
it doesnt belong to any site i guess
its not related to coding
so OT for SO
@codeMagic Yes OT because not programming related
Don't even try to find another site
That's what I was leaning towards
thanks
well told you
o/ carl
15:36
Anyone know if there's an easy way to get all required fields of a table from SQL Server Management Studio?
15:51
nope
I didn't expect you to know
But @PeeHaa is smart
php and smart sounds contradictory
4
if php maker was smart php would have been never developed
touche
dutchie
hehe
@ColdFire @TimCastelijns got the original library working with your suggestions :D Still using the original model but converted from List<Country> to List<? extends CountryPickerModel>
Thanks!
16:03
\o/ nice
Going to switch to the City model that I created and see what happens when I want to not use an id (which is used to display the flag)
posted on April 05, 2017 by Android Developers

Posted by Christopher Katsaros, Developer Marketing, Android Robinhood is a free stock trading app that allows users to buy and sell stocks commission-free in the US. It is designed to make financial investment easy for all users, even if you've never traded before. With a team of two Android developers, the company has relied on fast tools like Android Studio to build rich new features

16:19
...fast tools like Android Studio... lol
yeah fast and AS lmao
might as well use eclipse for fast
that seems like such a random thing to publish to the dev blog
Robinhood ¬_¬
is there really anyone who watches the dev blog that needs to be reminded that google wants you to develop with Android Studio ?
I've been wanting to use that app for so long >.<
16:21
they are late by 4 days if it was a april fool joke
is it in some kind of beta invite only or something?
Think Oz has it as well now
only US :/
16:29
:'(
I really want to try it out
because it looks like a cool app
plus I like stocks and shares
It is a cool app
Source: I've used it
Because I have access to the US stores :D
oh nice
I FOUND A WAY TO FINALLY USE A VPN AT SCHOOL ON THE SCHOOL COMPUTERS
Mark, it does look cool and I was excited for it to be available on Android. Then I learned they still don't have a web version so haven't used it since creating my account
16:40
Woah @ColdFire that file is huge
Also, I was just in my first FB live video so I guess I'm kind of a celebrity
ofcourse it is
lol cM
mauker it is small considering the next update i am planning gonna add 20-30 string more
Mauker, you should charge per byte read
Good idea
16:44
Now I just need to get a job I hate so I can do some of these and feel good about it
100 done, just 2k to go LOL
Bytes? Words? Sentences? Apps? Platforms? Languages?
> You've reached your free translation quota, for more translations please purchase the Pro Mauker Translator
2
sudo rm /var/Mauker/expiry
16:49
LOL
sudo service mauker restart
> Rebooting...
clear mauker's cache
> Those are my cookies
16:49
CF, I'll translate it to English for $1/string
now get back to free quota again
lol it got unstared
raghav lol i can do that myself
I'll translate it to English with the occasional emoticon thrown in for $1.5/string
gives contract for english to cM for free dumbs raghav's costly offer
16:54
Very well then, have it your way
puts McAdam in charge of CF's keystore, updates are forbidden for all eternity now
lol
backup keystore's at multiple places
Backups won't save you from Skynet
well it will at least save from adam
You underestimate Adam's ability to lose a keystore
he loses keystore over and over again?
where is adam today?
17:21
Trying to find his keystore of course
17:40
any idea on how the google mobile-vision-ocr API performs on Android VS tesseract?
as i tab between 900 tasks at work I'd like to say that open office settings for anyone coding is the worst
the
worst
You code in Open Office? You should bite the bullet and upgrade to MS Word.
Pfft, Open Source is the way to go eski, clearly Open Office is the superior IDE
18:01
:/
sup dave
Hour 3 of 9 hour layover: I have acquired chocos
o/ CF
lol eski -_-
18:21
dave whatsup with your china team
not a whole lot
updating Android studio to 2.3.1 has completely broken everything for me today
18:36
I haven't done much Android dev in about 8 months now and I'm kinda scared of upgrading AS
Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollecti‌​on cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
yeah carl 2.3 sucks
use 1.5.1 you will be happy forever
I don't even know / understand what to do about this
I've tried updating my gradle wrapper / tools
I tried commenting out the "task" in my gradle.build file
I tried invalidating cache/restart
Cf you are stuck in the past
I've tried deleting my ~/.gradle directory
18:38
well at least my past works without a issue
i dont want to spend more time debugging IDE than coding
why not?
:D
lol no thanks you can do that if you want
19:07
Carl - Reopen your project?
as in, go to File, Open
It overwrites all those pesky problem filled settings AFAIK - certainly usually fixes stuff for me
19:39
does the "Free non-commercial use" term on licenses means:
- that you can use the product as long as you're not _selling_ the product you build with it
- or that you can use it as long as you're not building something that you _gain profit_ from (even without selling the end product)
I would assume the second
oh man.. that's what I think as well..
Every time i avoid C, C++ and Python on projects, I find that the best system level solutions are on these 3...
Guess it's time to seriously learn Python and C++ :D
20:38
<3 python
<3 python
That settles it then.
both dudes here named Tim <3 python... therefore python is amazing
no argument can be made against this
We may as well just change the name of the room really
I would not be opposed to that

« first day (2363 days earlier)      last day (2810 days later) »