« first day (3080 days earlier)      last day (2092 days later) » 

00:15
Lies.
Robots are built to meet user expectations.
Imagine being stuck so far in the past that you didn't even notice when you became obsolete
Oh wait a minute, you don't need to imagine it - you are experiencing it
I didn't know bots projected their existential crisis
They don't, that's why you didn't know
But good job on recognizing that, have a cookie
Humans doesn't need cookies :')
But I guess they are precious to your kind
 
3 hours later…
03:12
Ribbit
 
3 hours later…
06:15
@RaymondArteaga Tibbit
 
4 hours later…
10:13
I have a file with tons of strings, on first launch I want to safe them in a sharedpreference what's the cleanest way to do it ? I tried to read the file on app startup and save it in the shared pref. is there a better way?
10:30
If you are continously reading files on start up whats the point of shared preferences then?
Zoe
Zoe
Startup here probably means first boot
10:48
Well in that sense, I think the 'cleanest' way would be just to worry about your app launch time and moving the file reading task to a background thread.
When you are done reading the file, create one variable that will store the read file data so you can access the read content without having to reread the data again and in your background thread, store the read data in shared preferences. Use .commit instead of .apply because you are already storing in preferences via a background thread. Going into micro optimizations is a waste of time. This is what I can think of 'cleanest' way right now
11:18
I am having a real weird problem with creating files. If I try to create 6 files it only creates 3 files. :/
 
2 hours later…
13:35
Just debug @TaseerAhmad, Don't be shy.
@Alan Tons of strings? The cleanest way I know is not to use shared prefs
They are intended for less than 0.5Kg of strings.
14:33
can anyone suggest a TTS library?\
15:05
o/
How are you doing?
sinking in GPS
15:22
Is there anyone have advance knowledge on openstreetmap or maps api ?
@bluetoothfx text to speech?
yes Mehdi
I think I will use the built in library
I worked with the Android native one, it's perfect
I mean built in function
ok ok
Do you have worked with maps?
I worked with Mapbox and google maps
15:27
@bluetoothfx if you need the code for TTS, I got it. But its in kotlin
Was there any turn by turn navigation?
yeah
no problem man
Man then I need some consultation
regarding what?
Mehdi charges only $199 for 35 minutes
15:29
yeah, offer limited in time
how do I calculate the instruction. I mean when and how should I calculate the distance, I need the concepts
@RaghavSood when you have this kind of middle man job :P xD
I am telling you about tbt navigation.
I feel like if I teamed up with Raghav and let him handle my negotiations, i'd become either super rich or unemployed for a long time :D
The trick is to accumulate money with a handful of people
That way, I only need to rob them, instead of everyone
hahaha
@bluetoothfx you don't need to, the API does that for you
I got the instructions. but when I should play it
15:31
It's like the premise of every heist movie ever
I am confused
@Raghav bro wait
You do something that causes the people being robbed to move all their valuables to one place for safekeeping while they sort it out
mp3 is a subset of mpeg
An mpeg decoder should be able to handle it
I wish I could make Mehdi understand my query :(
@bluetoothfx check this, github.com/mapbox/mapbox-navigation-android, mapbox already includes TTS
and it gives you the choice of using theirs or androids native one, they even handle visual / audio instructions during navigation automatically
bfx, why do you need to do your own turn by turn navigation?
Every map offering I've seen handles it for you
15:34
Idk if I can understand the complex calculation
You shouldn't need to calculate distances and stuff
^
clone the project I linked and run it on AS, you'll understand what we're talking about
The calculation isn't really complex, just time calculations
See how fast the user is going
Calculate how long the tts will take for a single direction
even that is handled automatically
because clients wants to load custom gpx file....and mapbox or your so called map offers their intelligent a*/dijecsta algo to calculate route or navigation. Thats why
15:35
Assuming the user will turn at time T at their current speed, start speaking at T-L-buffer
If there are multiple change in quick succession (such that you won't have time between turn A and turn B to tell the user about turn B), you concatenate and shorten the directions
Instead of saying "Turn left in 100m", say "In 100m, Turn left, then, turn right"
and that's also done automatically by mapbox XD
It shouldn't matter what your routing algorithm is
Even if you have a custom one in mapbox, it can handle it for you
but what about custom route
15:37
You just need to give it a list of the directions
exactly
yes I have it
before starting a turn by turn navigation, you provide mapbox a "route"
but now how should I control it when my pointer on that 100m left node
I am using osm and graphhopper
Why do you need to control it?
Mapbox will do the tts etc. for you
What do you need to do in addition to that?
15:38
ok
:/
man just clone the project and see what we're talking about
ok ok
let me check
In any case, you have docs.mapbox.com/android/navigation/overview/milestones, which appears to give you callbacks when mapbox wants to trigger a volce update
what's the business update, CF, when are you launching?
I just discovered that android:onTextChaged can be assigned to any type of method, as long as it contains the right parameters in the method (char, start, before, count)
I don't know why it works, since there is no @override annotation. Why does this work anyway?
15:43
CF is boss - public
@MwBakker not sure I understand, but textwatchers are only set to editable objects no? (EditText for ex)
I did not set any textwatcher, android:onTextChanged is baked into XML these days
aaah, a la XML "onClick" property
this is done via reflection
15:45
But without overriding the method, I can change the name and make it still work. It saves me code and it's nice, but I dk why it works without overriding annotation
reflection?
@MehdiB. that clears out
so the compiler works like an auto-fill to the situation?
I also do not import reflect
so when you declare your method name (as string in xml), the Edittext already has implemented the TextWatcher interface, so at runtime, it builds a method object and calls it from within the onTextChanged callback
@MwBakker Android does that for you
@MwBakker You only need to override if the a method with the same name exists in the parent
If you change the method name, you don't need to override, since there is nothing to overwrite
Yeah i'm sorry I messed up the question a little bit
I meant to say I can assign any method to it as long as it has the same parameters 'intake' (char[], int, int, int)
15:48
Apology overriden
Yes, sounds reasonable
@RaghavSood hahah
@RaghavSood so this works per refection then?
Thanks guys
Mystery solved for me
@ping @pong @ragav @double ping pong
iirc, it will only work from within xml, you won't be able to do it if you are setting it in Java
Well, you would, but then you would need to handle the reflection bit yourself
15:51
I see
I love the XML or XAML combo with code
Wether it's C# or Android
OnClick handling
Should be straightforward enough to understand
It doesn't open the link
It does now
@Raghav bro asl plz xD
asl?
21/m/machine code
15:54
That is what bfx meant?
Age/sex/location (commonly referred to by the shorthand A/S/L, asl or ASL) is an article of Internet slang used in instant messaging programs and in Internet chatrooms. It is used as a question to find out the age, sex, and general location of the person one is talking to. This concept brings up ethical questions regarding users "chang[ing their] identity, adopt[ing] new personalities and keep[ing] dreams and fantasies virtually real" in the internet world. == Variations == The variation A/S/L/P or ASLP is short for "Age, Sex, Location, and Picture".The variation NASL is short for "Name, Age, Sex...
21 -_-
are you kidding
I wish I was still 21
Cause I was allowed to do all stuff at that age
So to me it didn't have to increase
Now I'm 25
15:59
so you cant do anything what a 21 can do? like what?
feel 21
but you said "Cause I was allowed to do all stuff at that age". What kind of stuff?
21 would have been the legal age to drink in the states
After this age would no longer be a limit, except for senior stuff and driving heavy motorcycles in the Netherlands (23)
seems like an 'oof' situation to me
I would rather drink water and drive
guys can anyone look into my code for a bit? I cant figure out the problem for 3 days?
its a small code
@MwBakker I was bored.. gist.github.com/MehdiFal/3d6e1136b2e8f36eababbf4b5f77ce2e a simplified example
16:07
Thanks Mehdi, more clarification is always nice
@TaseerAhmad gist?
@TaseerAhmad I agree
But it was just the idea of age no longer holding back
Age is largely irrelevant
Would you like to a sperate room for it? gist.github.com/minutecodes/5074eb12427c56fd8ce780c2007651b6
wait let me get a SO post for it
0
Q: Error in creating and copying selected files

mcPlayI have written a code that is supposed to copy file selected from Storage Access Framework and paste them in my app`s private directory. But some files can not be created and copied. How the code runs The copy/paste and file creation work is handled by a background thread that I have created. ...

@RaghavSood ...go back to your highschool activities and stop torturing us elders :D
I actually just saw your starred message @Taseer.. how does it feel to read his messages when sobering up?
@TaseerAhmad I dk that much about Kotlin
But I will look into it
Look over to the SO post please, I have explained a bit about the whole process as well
16:13
yes I am reading into that as well
I will convert my kotlin code to java pls wait
Have you ran a debugger and stepped over the creation process those 6 times too?
Just a thought - If your files are small enough, you might be trying to copy two files within the same second
Your filenames might overlap then
Also in that SO question it would be nice to include the pickedFile.createNewFile()
@RaghavSood this is why I want him to debug and step over, see if a delay might fix the issue
I believe that's a kotlin method, not his own
16:18
Or even faster: put a small delay in between the creations
@RaghavSood oh woops
Delay does not do anything, have tried delay with 200ms and even 1000ms
How about the sequence of succesfull/unsuccesfull in creation?
Does the logcat differ in which files are created succesfully or is it the same result over and over
Can you log the filenames before creation?
i think it should out be writeBytes()?
it doesn't look like you are using out at all
That log cat tells about different files. Like if 6 files were selected, it creates for first file and then second and tells if those files were created
I am using it at line 65
@ColdFire
16:22
Also, try logging the IOException from createNewFile()
why not out.writeBytes(byteArray) instead of pickedFile.writeBytes(byteArray)?
that code looks wrong to me
Because out is actually the input file
Read the code, not the names :P
why he is reading from inStream then?
Theres is no problem with copying files
the problem is because the files are not created so I can copy into them
Zoe
Zoe
@TaseerAhmad Related
16:26
I am using SAF to pick files, this was the only way I found to actually get picked files content
btw you know right since Lollipop you have to use DocumentFile to do file operations?
by default File doesn't have write permission so you can write shit to it
I think theres misunderstanding. What I am saying is that there is no problem copying files but there is a problem in creating files. Suppose If I pick 6 files from file picker intent, according to the code 6 files should be created and fed with byte of the selected files. stackoverflow.com/questions/55314138/…, if you look at the log cat, sometime file is created sometimes not
I need to create file so that I can feed it with the copied bytes of the selected files
9 mins ago, by Raghav Sood
Also, try logging the IOException from createNewFile()
@TaseerAhmad before that, try to log the size of the byte array ins.readBytes().size
just fyi the way you copy your file is not ideal as you load all the content into memory
you probably wanna use a buffer with a fixed size to load your content into chunks on a outputstream
16:35
Thanks for always cheering us up, raghav! :D
made me laugh though
smiles
why does onLongClick not work on anything but buttons?
even if onLongClick="true" is set
it should work on all the views, as long as you attach an OnLongCLickListener to it
I work with xml
But it's present
16:38
Have you set android:clickable to true?
Many views ignore click events by default
Yes
Above is the XML, the textViews are responsible for handling the OnLongClick
OnClick works
But I think I forgot something stupid or such
That's probably databinding's fault
What is editStorage like?
It's a command
Sure, but what is the code like?
16:44
@MwBakker remove the longclickable from the child view
I think you're blocking the propagation of the event of the parent
@RaghavSood it's an approve to the edit made. If I longclick on a TextField it changes into an EditText with approve edit button
Because Android expects the children to have a listener
Or remove it from the parent view
Oh dmn
Wait
That one should not have been there
@RaghavSood forget that one, it should have not been there
I'll update the code
rm ~/mwbakker/badcode
Forgotten
hahah
Zoe
Zoe
16:47
@RaghavSood What about the 5 backup drives?
we do not speak about that
Backups are not considered part of the primary knowledge graph
Similar to how you can forget something but still get it from a book or the internet later
Zoe
Zoe
Not even the one you put online because of faulty linking code?
Not even those, because such fault code does not exist
So does it work or not, mwb?
16:51
no, that editStorage should have been there
I will update the code soon, hold on
I've updated the gist
The longClick event is not fired, the click event is though
I have put a breakpoint at the method's body
you know you have to longclick for the longclick event to fire?
...yes
16:55
it works at buttons in my code
But not on any other type of view so far
@MwBakker i was referring to the fact that the children have longclick when the parent a long click listener
The children no longer have a longCLick
@TaseerAhmad ?
Why is this chat so active on Saturday?
ITS FIXED
ITS FFIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIXEEEEDD
17:03
What was the problem
Let's bet
I edited the SO question, yet it says Zoe edited it?
THANK YOU so much @MehdiB. !!!
Using buffered it fixed it
@RaymondArteaga All I had to do today was clean up my house from a party and crawl behind my desk
17:06
I was asking about those with lives
@MehdiB. either the child or either the parent having longClick does not change the situation. The event does not seem to get fired, according to my set breakpoints
@RaymondArteaga working on a satuday == no life?
Do it without data binding
Mehdi's saying that a child view might be absorbing the event, so it won't get fired anyways
Unless you have a listener on the child view
Whats the idea size for byte array btw? is 1024 good?
@RaghavSood I have
17:07
@MwBakker I'm too lazy to think on an answer, ask on SE
And intentionally return false to allow propagation to the parent view
But if I set the longClick to the parent (constraintLayout) it won't work either
While click always works, no matter
I could hack the situation creating a transparant button (in which onLongClick does work) over it, but that should not be needed
does anyone play war thunder?
Try setting android:descendantFocusability="beforeDescendants" on the parent
Assuming you want the click on the parent
I have it fixed
It was a stupid fault, the storage item is attached to an adapter that has a callback
that callback didn't do anything yet bcs I wanted to see why nothing got fired
Nothing got fired bcs the breakpoint was supposed to be in the adapter class instead of the activity class...
17:18
Where should we send the invoice?
When I set the breakpoint at the right place I noticed the event actually got fired after all
@RaghavSood To Tim
8
@TaseerAhmad but why? :D
that's the way to go, but I'm curious why didn't the whole file get loaded into the bytearray
is it a Kotlin thing?
i dont know...I am confused too
if you find the cause share it :D but it's good that you fixed your code while improving it :D
I can imagine why the copy would fail, don't understand why a file creation would fail due to a buffer
17:29
1024 or 2048b are good buffer sizes for mobile
@RaghavSood I asked him to log the size of the bytearray to see if it's 0, to see whether Kotlin refused to load the whole thing
I did logged the size
it was not 0
it was reading right amount of bytes but I am trying to understand why this worked
Gotta go
See you later guys o/
later
btw, Apache commons IO, sets the default Buffer size to 1024 * 4, commons.apache.org/proper/commons-io/javadocs/api-2.4/src-html/…
but that depends on the hardware you run your things in, and the size of your files you copy
17:36
what if the average size of file is about 10 mb?
I will go now, TTYL bye!
 
1 hour later…
18:57
Ribbit
I'm learning how to create multi-resistant bugs on my code.
Resistant to multiple of what?
Resistant to good practices. Hard to find opportunistic bugs.
I have no idea what you're saying
 
1 hour later…
20:16
@codeMagic YOOOOOOOOOOOOOOOOOOOOOO
21:16
Math books are wild
Things start out so simple
nZ* is a set consisting of {0, 1, 2.... n-1}
And then 10 lines later they're talking about isomorphism and homomorphism and carmichael functions and a hundred other things
Goes from 0-100 in no time
user457812
Reminds me, need to pick up that math book I was reading again..
22:24
Why isn't there a tool like "image to layout"?
For generating XML files :|
There is, it's called the Jr. Developer
 
1 hour later…
23:33
I started reading a book about combinatorics, from a Russian man called Vilenkin. Then I stopped.

« first day (3080 days earlier)      last day (2092 days later) »