« first day (1624 days earlier)      last day (3316 days later) » 

12:16 AM
Don't do long operations on the UI thread. You're welcome.
 
mr5
12:26 AM
@codeMagic Hello sir. Do you remember me?
 
Depends on what I did
 
@codeMagic Thank you :D
 
You're welcome
@mr5 ?
 
mr5
Have you seen Cjames, my fellow, here this past week?
 
I have a ton of fucking usb cables and can't find one to just fucking work correctly. gah!
I believe so though he's usually on when I'm getting ready to go to sleep
 
mr5
12:35 AM
That's why Apple made a new kind of USB
 
Yeah, I heard about what Apple has been doing. Lol
 
mr5
lol. we're on opposite timezone. Bed time now there, isn't it?
 
We sure are. Getting close but it's Friday night so probably be up a little later
I'm actually usually up for at least a couple more hours
I don't think I usually see Cjames for at least another 2 hours
 
mr5
You guys are living in a past. We are the future.
 
Haha....I know!
 
mr5
12:37 AM
o.O is that so...
 
I think so though I don't keep a record of his logons :P
 
mr5
But you guys are more advance than us. Past = 1st world country, Future = 3rd world country i cri everitiem
 
Maybe that's because we have time to see what you guys do wrong and learn from it?
 
mr5
It all make sense now...
 
ha!
 
12:47 AM
I love how tilting the screen causes the activity to be stopped and then restarted. Makes it super easy to test that part of the activity's life cycle.
cM, by the way, the UI thread was idle. But it turns out you can make life pretty bad for the UI thread if your background thread runs runs away. Or, at least, that's what I think happened. Who knows. I'm so new at this that it's hard to tell what's happening.
 
If it's waiting on a response from the background thread. Otherwise, it shouldn't really affect it
Then again, I don't know what you're doing so, I dunno
 
I know, it doesn't make any sense. The background thread had an error that caused it to spin, and it was writing to the log every iteration (something that was supposed to take time, wasn't). Maybe it was hammering the log that did it.
In any case, this isn't a veiled request for help. Just yacking while I code.
 
I understand. That helps quite often.
 
It does. I need to send you all rubber ducks.
 
This is a good place for self-debugging if you don't have a rubber duck
haha...you beat me to it
 
1:02 AM
Oh, this is bizarre. It's as though there's only one thread. So here's my background thread, and it's reading two seconds worth of audio samples in a single call AudioRecord#read. So if I wait until I see in the log that that 2-second read has started, and then tilt the screen, the read completes and only then does the UI thread get the onPause() call.
 
I swear, I figure out more of my problems on my drive home from work than I do in the office. If I'm stuck on an issue when leave, I discuss it with myself on the way home and usually at least come up with a different way to test if not figuring out the whole problem
 
Heh, yeah. At my work, we take a walk around the outside of the building. It's about 1/3 mile, takes 5 minutes, and usually we've figured out the problem (or, like you said, a new approach to debugging it) before we're halfway around.
 
I've thought about doing that but, for whatever reason, haven't yet
 
o/
Checking in from a hackathon. Thanks to @Ahmad for convincing me to do this!
 
Why do you expect onPause() to be called before you tilt the screen? Also, are you debugging or running the app? I've noticed thread issues when running through the debugger but if I just run then it's different
yo, Mac
 
1:05 AM
How's it going, cM?
 
Where at? Having fun?
Not terrible, for now
 
I expect onPause to be called as soon as I tilt the screen. Instead, it looks as though I tilt, then wait wait wait until the background thread's read finishes, and then onPause gets called. Hold on, I need to change the timing (do a longer read) so I can confirm that's really what's happening.
 
Michigan State. And yeah, so far. We've got some decent hardware to play with. A Myo (gesture sensing arm band) and an intel Edison. Not sure we'll mix the two but definitely some toys to play with at the start. My group claims they don't know enough android to do it as our project -.-
 
Sounds awesome! Keep us posted on how it goes
Wayne, ah ok. I misunderstood
Still, when you attach the debugger instead of just running, there can be screwy results. So, if you are attaching the debugger and not getting what you expect, sometimes it's good to try just running it
I know you weren't asking for advice but you got some anyway :P
 
"Unfortunately, you lack any skill as an Android programmer. Your application has stopped. You should be ashamed, Ruby programmer" <- I'm pretty sure that's what the error dialog just said.
@codeMagic I appreciate it! I'll try that.
 
1:10 AM
Haha, sometimes that error message can be a real asshole
 
:D
Ah, there's a clue. tilt, tilt, tilt, tilt, bang. "startRecording() called on an uninitialized AudioRecord". I've got a race condition somewhere in the thread startup/teardown code.
Chasing race conditions is kind of relaxing, when there's no schedule pressure and no customers calling.
 
1:28 AM
Alright, I'm going cross-eyed now. Been programming for 12 hours (darned day job!). I'll come back to this tomorrow. See ya, and thanks for quacking in all the right spots.
 
1:40 AM
:D
Have a good one, Wayne
 
 
5 hours later…
6:23 AM
Yo People
 
 
4 hours later…
10:51 AM
o/
You're welcome @mcadam!
how is it going so far? :D
 
11:07 AM
@Ahmad I've been up for 24 hours. I've been coding for over half of it, whether at work or at the hackathon. Almost 12 hours into hacking right now.
 
11:33 AM
:D nice!
 
11:51 AM
o/
 
12:08 PM
yo people \o
 
\o
 
12:46 PM
Good #{time_of_day}
 
:D
heya wayne
 
Good to see you, Ahmad.
 
1:27 PM
o/
 
Aha! It turns out that if you don't call AudioRecord.release(), your app ends up leaking resources. Who would have thought?
And, in other news, interrupting the thread does not cause AudioRecord.read() to return early. It won't return until it's read every byte you asked it to read.
In Ruby, we use tricks like closing a file to forcefully unblock a thread. I wonder if that kind of trick will work here.
 
1:44 PM
Coming up on 27 hours awake. Turning to all sorts of distraction at this point.
I've written a decent amount of HTML and am now waiting on other group members to catch up with some JS before combining our work.
 
I probably shouldn't bother with that complication. Reading long frames is an artificial device I've introduced during testing. When live, this app will read perhaps 10 msec at a time. 10 msec isn't long to wait for the thread to die.
@McAdam331 72 hours? Are you part of an evil psychological study?
 
No, Im at a hackathon. Unfortunately the hackathon started at 5:00 PM yesterday, but I've been up since 7:00 AM friday because I had work. We worked straight through the night, and it's now almost 10:00 AM Saturday.
 
how long still to go haha?
 
72 hours would kill me.
 
I had a 36h hour hackathon once, and I was already awake for ~20 hours at the start of the hackathon
 
1:49 PM
27*
 
because I had to catch an early plane to get to the UK and then had to wait 12 hours lol
 
i said 27 lol
 
^^
 
Hacking ends 8:30 Sunday. 23 hours left.
 
haha wow
I would recommend you to take a 2-4 hour nap
 
1:50 PM
Haha, 27. OK. I dyslexed that one.
 
yeah. I feel pretty good but i might. my partners just told me to take a power nap since i've hit a dead end.
 
2:29 PM
Morning!
 
o/
 
@cygery Is that herbal tea?
 
2:44 PM
yup herbal tea
 
I'm at that awkward spot where I've succeeded after several days of struggle, and now I have to figure out what my app should do next. I didn't have to decide what to do next when I had race conditions and leaked resources... it was obvious!
 
Now you need a list of requirments. Pencil time!
 
I think, since I don't know how powerful will be the device that runs my app, and it's going to be CPU intensive, that I want a way for it to know when it's overloaded. It should be able to tell if it's keeping up, or if it's losing audio samples. It could warn the user (an "overload" light!), or even lower its sample rate..
 
I think this is borderline premature optimization.
Can it display WPM in any form yet?
 
Oh, heck no.
 
2:53 PM
WAT
why would anyone even...
 
You might be right there. Truth is, an overload light would be useful for me, too. I don't know what my device is capable of. If it starts dropping audio samples, it will stop decoding properly. So when it does stop decoding properly, I want to know if it's because I've overloaded it and not because of some other error.
 
@NarendraDroidWorm denied for low A:Q ratio
 
I hear you, but you are solving a problem you don't have yet.
Normally this is a good think, thinking ahead, i'd put it on the list of requirements, but probably only start working on once it was needed or the basic functionality is there. But this is a philosophical debate.
 
Yes. But what scares me is that the symptom of "dropped samples" and "my decode algorithm is flaky" will be identical.
 
Lately I lean on the simplest working prototype kind of thing.
Don't let fear control you. :)
Surely your decode algorithm is flaky, but as it stands, you don't have a decode algorithm, right?
 
2:59 PM
I know you're right, but... damn your Vulcan logic!
:D
 
I might not be :)
It's just another opinion.
I just see the pattern and it feels like what I tend to do way too often, feature bloat, over-engineering and premature optimization.
 
@NarendraDroidWorm still denied. If you request again before fixing your A:Q and not seem so much like a help vamp then you will be placed on the ban list
 
Oh yes, I do the same. You should see the brobdignagian design I had for this app before I came to my senses. It was craaaazy complicated.
 
You can still read our rules for what we expect room-15.github.io
 
Thanks for brobdignagian, that's a first!
 
3:03 PM
o/
 
Sup Em! Finally!
How was your holiday?
JW was here asking for you while you were gone.
 
@Ahmad Just took my one hour power nap. Felt like the greatest thing in the entire world.
 
3:39 PM
@nana I am still in Argentina
Coming back to the US on Monday
 
Ah
Is it awesome there?
 
4:18 PM
Food is great!
 
Is that all that is great about Argentina? Are you in Buenos Aires?
 
design patterns are overrated, there is Haskell, and in Haskell these patterns are not needed
 
We don't think about design patterns much in Ruby, either. The language just sort of "does" most of them without any added machinery.
 
that's great
also, Scala does it pretty good too
 
Well, I am looking for a nice way to combine two data streams into one.
 
4:33 PM
@nana I'm not putting design patterns down... especially in a statically typed language, you gotta have 'em. We use them in dynamic languages too, but they're usually subtler, without much machinery, and we often don't think about what pattern we're using.
 
I am just starting to use the consciously now.
 
They're well worth studying.
 
As in, some of these things I have been doing before but now they suddenly have a name, it makes talking about them easier.
 
Oh, yeah. "Why don't you just make this a decorator?" "Let's use the facade pattern here..." easy ways to communicate.
 
Yep
 
4:38 PM
@McAdam331 haha ikr? power naps are awesome :D
 
@SargeBorsch Haha! OK, That is funny.
@nana Here's how I glue data streams together in Ruby.
 
! Thanks Wayne!
 
I doubt it will be any use to you in any other language. Just hoped it would be of some interest.
 
I am sure it will be at least a little bit useful.
In my case I am pulling some pretty deep objects from database and combining them with data I am gettign from API from web, and I need to filter those too.
I need to draw this out properly.
 
4:59 PM
Heya
 
o/
 
Fu Sensei
What's up ?
 
Just work again, looks like I will work for the next 3 weeks without a day off.
 
Ouch.
 
Yeah, I hope it will work out.
 
5:06 PM
I'll cook now. brb
 
bug fixed \o/
 
\o/
I just, too, fixed a bug.
 
Fixed previous bug, creating new one so I'll have something to fix.
 
5:22 PM
still don't know why the bug happened exactly but: if you change layout in onLayoutChange, use a Handler to call requestLayout later
I guess some later layout call fixed it in those cases where the bug didn't occur, anyway, fixed is fixed :D
 
5:45 PM
-4
Q: How to get basic info of a youtube video in andoid

muntasirI want to make a app that could show the like number,dislike number,comment ,post date ,view number of a youtube video using youtube api .but not getting any right example .so it would be very helpful if anyone could help me with sample code

 
6:17 PM
Wow. This 16G box is swapped out to the tune of 13G. No wonder I keep getting these weird pauses then I do things.
OK, AS was using up 2G. Now, who's using the rest?
 
VirtualBox? Do you use Genymotion?
But even then, 13GB swapped on top of 16GB, do you have high swappiness or something?
 
Maybe it's VMs. I had started one or two AS CMs that crashed. Maybe they still live.
Closed all browsers and most terms. Now down to 11G used, which is still crazy.
At least no longer swapped out.
 
Did you run out of those 16GB? Or did it just swap out for some crazy reason? Before filling the RAM
 
Oh yeah, was totally overcommitted. Total virt used was about 27G on 16 GB box.
I'm just amazed that the box was so usable
The has shown by ps doesn't seem to add up to what's being used. Fine, whatever, rebooting. Something has clearly gone "all Windows" on this Linux box.
 
6:43 PM
:)
 
6:57 PM
Reboot, started X, started term, started firefox, about 1.5G used (not including buffers/cache). That's more like it.
I had to suffer through an fsck. It's been a while since this box has been rebooted.
AS added a little less than 1GB. I'm putting my money on VM's gone wrong.
My signal processing thread computes results ~100 times a second. I want to update the display a few times a second. I'm thinking of another thread that polls the background thread and shoves that data into the UI. Is that reasonable?
 
7:33 PM
What is the advantage of having another thread?
 
It can run in a much slower loop... no need to update the UI 100 times a second.
 
Smells like premature optimization.
 
Now imagine a dozen UI fields, some of the text, some graphic, and you're going to update them 100 times a second... Is it really premature optimization to suppose that you ought not to do that?
 
You could also just have the main thread poll the signal processing one every so often.
But you don't do that do you, you don't control the refresh rate. Android caps it at 60fps, no?
Ahh, I know what you mean, you would have to recalculate the values for those. I'd probably go with the Hollywood Principle on this one.
 
Hollywood Principle?
 
7:41 PM
The background thread is just a lowly worker, he doesn't call higher ups, he works, head down and when bosses ask he responds :)
 
user457812
Word of warning, folks: if you're my coworker and you tell me you didn't commit something when I've already verified you did in fact commit something, I will make fun of you.
 
"Don't call us, we'll call you"
 
Haha, yep. That's the principle I have in mind.
@nana I didn't know I could set the main thread up to do periodic things. That seems ideal.
@nil :D
 
reading...
 
7:48 PM
...getting there
 
I like that Time class. Since it runs tasks in a separate thread, I will still need to use a Handler or some other mechanism to do the UI updates. I think.
 
That looks like a terrible headache nana.
 
I don't know if it's a headache, but I got a headache looking at it ;)
 
I am trying to make sense out of this Frankestein app I created :)
 
Question
 
7:52 PM
Then there is the Activity.runOnUiThread(Runnable runnable) method
 
I need to set a layout to a View like. View v = R.layout.mylayout or whatever
 
I'm pretty impressed with what my group has done so far at this hackathon. We all went from nearly no knowledge of JavaScript and have creating a functioning event blog (kind of like a twitter feed) in less than 24 hours.
 
Very cool, McA.
 
For the updates, but what I would do instead is this. I'd create a message bus, have it receive messages on any thread but spit them out on main thread. Then I wouldn't have to worry about any of this.
Neither the timers.
That is really good McAdam.
 
message bus? (goes off on another google search)
 
7:55 PM
I use this one square.github.io/otto
 
We just need to set up some google authentication and we'll be live shortly
 
Some people switched away from Otto to the one built in... I can't remember.. Gson?
Throw us a link when ready.
Do you guys think these UML diagrams are helpful?
I, in my wishful thinking, hope it will help me identify which parts of the app needs to be improved.
 
I like UML diagrams for drawing on white boards to communicate with another pgorammer. And sometimes when I'm trying to untangle some tangled code, I draw one.
 
Ok, that'S good enough for me then.
I always plan with them but then I start coding and they disappear. I had the one I posted regenerated from java source actually. I thought that was pretty cool.
And then I spent couple hours formatting it. Still getting there..
 
I don't treat them as products. Just tools to discard when done.
That reminds me, the first Java job I ever got, I was supposed to be the "RationalRose" guy. The guy whose job it was to update the UML diagrams that nobody actually used but were required by whatever idiot thought up that project's coding standards.
@nana I still think some kind of timer, or a thread with a sleep in it. Because.... update dozens of UI elements 100 times a second... still don't want to do that.
That job actually had a poster of the "waterfall process" up in the team leader's cubicle. That should tell you something.
 
8:04 PM
You could save last update time in the presenter layer, then let the worker shout at you, but only press the update button when you decide the time is right.
@WayneConrad How long have you stayed there?
I haven't had a chance to experience anything like that yet.
 
I was there a few years. This was way back. Before Java had Generic, and Beans had just been invented.
XP was starting to take off about then, and in the intervening years, agile processes have pretty much kicked the stuffing out of waterfall. I don't think anyone seriously considers waterfall anymore.
 
These massive behemoths of projects amaze me, I have a friend that works for PayChex, the stories I hear..
 
@nana Thinking about that. I'm sure I don't like it, but I"m not sure I have a good reason for not liking it.
 
Not too bad, nice and colourful ;)
 
Many lies are.
 
8:08 PM
Ok, if you want it nicer, how about you tell the worker how often you want updates?
How will you present the data? What is the output of the worker?
 
Various numbers and graphs. Most of the data will be able to be shown on an XY line graph. Probably there's a histogram in there. And a few simple numbers.
Who knows? It's still early.
 
Yeah, that sounds wasteful to generate 100 times per second, especially the graphics.
 
Yeah.
So, a thread or Timer (which is a thread in a nice wrapper) that polls the worker and uses a Handler to talk to the UI thread?
 
I guess so
The Timer seems the cleanest, right?
 
I think so. OK, let's write code and see what happens.
 
8:27 PM
I went looking for a good example of how Timer is used, and found an answer that showed it, along side an example showing Handler with postDelayed. Woot. The hander with postDelayed looks much nicer.
204
A: Android timer? How?

Dave.Bok since this isn't cleared up yet there are 3 simple ways to handle this. Below is an example showing all 3 and at the bottom is an example showing just the method I believe is preferable. Also remember to clean up your tasks in onPause, saving state if necessary. import java.util.Timer; imp...

 
8:59 PM
@McAdam331 awesome! :D
 
The Hander with postDelayed works like a charm. I'm seeing the sample rate, being computed in the background thread, displayed on the UI. Woot!
And sometimes displayed with a goofy value. Oh, wait, I didn't synchronize the SampleRate class...
 
:)
Free startup idea: a stool for people with standing desks.
 
Haha!
 
10:08 PM
 
10:19 PM
LOL
 
I looked at all those answers and went "Fuck that"
I needed a countdown timer, so I extended countdown timer and just broadcast an event every 100ms
:shrug: works well enough for me.
afk
 
that's not bad
 
10:42 PM
                       @nana I am saving that GIF
 
You mean that .jpg? ;)
 
Who is that comedian?
Also, f that
 
Slight improvement, that'S enough for today
 
The author of the first tutorial I used had the habit of prefixing instance variables with "m", so I did too. I've just spent a few minutes fixing that mistake (easy with AS's rename tool). The code is much nicer to read now.
 
10:51 PM
:) We had a discussion about the m prefix...
So.. it's the official Android coding standard...
i don't want to stir this up again.
 
No wonder the author used it. No, I'm not trying to stir anything up. Didn't realize... forget I said anything :)
Although a link or synopsis of the different sides of the argument would be very interesting to me.
Never mind, I stfg and found some.
 
It's the standard of AOSP, so I think it only matters if you contribute code (I don't :))
 
When I started with Android I saw the mPrefix everywhere and began using it too. It still doesn't bother me, for me the advantage is that if I know I am looking for a field variable whose name I forgot I type m and hit Ctrl + Space and pick the one I was looking for.
I can also create static ones with prefix s.
Yeas I could just use this.... and I probably should. I might on the next project :)
TL;DR; I did it because he told me to.
 
For today, I'm picking to use this and leave out the prefix, but I can see the argument for the prefix. If it's like any other style choice, I'll change my mind twice in the next year.
 

« first day (1624 days earlier)      last day (3316 days later) »