Office Hours — Today, July 13

Thursday, July 9

Mark M.
has entered the room
Mark M.
turned on guest access
Jul 13
4:15 PM
EGHDK
has entered the room
Mark M.
hello, EGHDK!@
how can I help you today?
EGHDK
Hey Mark, two questions. 1. I have a sharedprefhelper class. My teammate is developing on the same project via github. Any easy way to make sure he uses my sharedprefhelper class instead of straight sharedprefs? 2. I was watching a video today. The presenter was saying he downloads data from a server then he stores it into a flat file. What do you think he meant by flat file?
For 1. I was thinking custom lint rule or something?
Mark M.
well, then you will be back here with "any easy way to make sure he uses my custom Lint rule?"
and it's turtles all the way down
EGHDK
Gotcha. Just making sure there wasn't something super easy I can do besides code review
Mark M.
you might be able to cobble together something with GitHub commit hooks, but it's probably simpler just to slap the teammate with a trout
log files, CSV files, and the like are all examples of flat files
4:20 PM
EGHDK
Okay. I've done csv file before. Flat file threw me off. Never heard of something described as a flat file. Thanks.
Mark M.
it's an old term
EGHDK
Would you use it to store key Value pairs? Like json or something? Or parsed json into like a csv?
Mark M.
well, nowadays, you would not use it for much
the big advantage over a flat file as opposed to something like XML or JSON is that you can just append new stuff to the end of the file
with XML, to "append" you have to delete the closing tag, add in a new XML element, and add back in the closing tag
that being said, my guess is that you are reading far too much into this presenter's use of the term
4:25 PM
EGHDK
I basically want to convert read this file and make an object out of it. I don't want to serialize it though. Just want to be able to create an object of the type, and then possibly have another application be able to edit the file, then I'll reload my application and it should be able to read the new updated file as the object.
Mark M.
well, "flat file" isn't going to help you there
you would need far more details on the structure of the entries in the file
EGHDK
I guess if a flat file is logs or csv, it can kinda hold whatever?
Mark M.
yes
usually, any given flat file holds onto one type of thing
EGHDK
Alright. Maybe looking to far into it. Thanks Mark.
Mark M.
so, in the case of CSV, usually all the rows have the same number of comma-delimited entries
EGHDK
Gotcha. That's all I need for today . Thanks
Mark M.
OK
EGHDK
Off to work! Till next time Mark!
Mark M.
tell work I said "hi"!
EGHDK
I will!
4:40 PM
EGHDK
has left the room
4:50 PM
ramsey
has entered the room
Mark M.
hello, ramsey!
ramsey
Hi Mark!
Mark M.
there is not a lot of time left in the chat, but if you have a question, go right ahead!
ramsey
I'm trying to position two views on top of each other
The blue one is in the center of the middle Relative layout
And I have to do it programmatically because of some animations I'm doing
But I'm struggling with setY/setTranslationY
And figuring out how to calculate the correct value for Y
Mark M.
why Y?
4:55 PM
ramsey
do I have to always add an onGlobalLayouListener
Mark M.
isn't your problem on the Z axis?
ramsey
Or at least the vertical value
Oh hold on why?
Mark M.
I guess I do not understand your problem
ramsey
Ah no it's the the vertical positioning that I'm struggling with
The z axis is fine
Mark M.
isn't it a matter of doing the RelativeLayout.LayoutParams equivalent of android:alignBottom="@id/blue" on the red widget?
ramsey
I think so but does that work if you've changed the positioning of the view with animations?
Perhaps my question is: do any of the layout params I specify in xml ever get wiped?
Mark M.
if you are using setY/setTranslationY, no
basically, those rules apply first, then the setY/setTranslationY is applied to the results from the layout rules
ramsey
Right so can I add alignBottom as a rule afterwards?
Because it shouldn't always be bottom algined to blue
And if I do would I have to subsequently call requestLayout?
Mark M.
well, what *is* the rule then? I was just going by the diagram
ramsey
It should be bottom aligned after an animation has completed
So it's the end Y value really
Red goes from right of screen, at 90 degrees to the centre
Mark M.
off the cuff, I'd set the bottom alignment rule at the outset, then decrease the Y translation to get to 0 through the animation
ramsey
Ah OK
So have the base as the end result
5:00 PM
Mark M.
right
5:00 PM
ramsey
Then work backwards
OK Thanks mark
I know time's up
So thanks for your time
Mark M.
you are very welcome
the chat transcript will be posted to https://commonsware.com/office-hours/ shortly
the next chat is tomorrow at 9am US Eastern
have a pleasant day!
ramsey
has left the room
Mark M.
turned off guest access

Thursday, July 9

 

Office Hours

People in this transcript

  • EGHDK
  • Mark Murphy
  • ramsey