« first day (3334 days earlier)      last day (1615 days later) » 

7:09 PM
@IvanMilisavljevic this is what I ended up with: gist.github.com/MobileOak/450610cfd67fd08b04b9abe1535259df
afk for a bit
 
having an issue where if a query returns to large of a result the app crashes because of too much memory. I have a couple options to remedy the situation. What do you suggest?
1. Let it crash
 
@JBis android app or something else?
 
2. Limit the size of the results of the query
3. Do some crap where I limit it but allow a auto "more results" request that ads an OFFSET to the query so it pulls the next batch of results
@IvanMilisavljevic desktop app
 
yeah thats what i thought you were gonna say
its a pain in the ass tho
 
7:16 PM
delete rows from the DB
 
why? i mean its should be straight forward with LIMIT and OFFSET
 
@IvanMilisavljevic the logic isn't the problem. Its an extreme pain in the ass to integrate with the UI.
 
Usually I just give the user a field where they can input how many rows they want to return
and limit the result based off that number
 
this is the code for the same thing but for messages
  messagesView.addEventListener("scroll", (ev => {
        if (messagesView.scrollTop < 50 && !selectedConvo.conversation.isMaxTop()) {
            selectedConvo.conversation.extend(20, 0);
            selectedConvo.conversation.getMessages();
            selectedConvo.getTargetedMessages();
            updateMessagesView();
        }
        if (messagesView.scrollTop >= (messagesView.scrollHeight - messagesView.offsetHeight - 50) && !selectedConvo.conversation.isMaxBottom()) {
            console.log("down");
 
So if they crash the app because too many rows returned that's on them xD
 
7:18 PM
could i do that?
it would be so much easier
 
@ballBreaker thats like a ddos waiting to happen :D
read more about slow loris attack
 
hahaha yeah it definitely is
 
Use variables @JBis, the code is usually easier and cleaner to read this way
 
@JBis You could you just need to be careful because of what Ivan pointed out
 
@MehdiB. wdym? there are variables there
 
7:20 PM
^ I think he means with the hardcoded numbers 50, 20, etc
 
Its not a webserver so it shouldn't be an issue.
 
Yeah that was my case as well when I implemented the feature
 
still you should really use magic numbers
 
You have 4 lines repeated twice, when only the values change
 
true
 
7:25 PM
Not relevant to the message, lol but it's a good song
 
@IvanMilisavljevic you mean shouldn't?
 
haha yeah actually you shoudn't
 
50 isn't magic
 
20 is something i chose
maybe 50 is magic not sure, i knew when i wrote it/copied it
hmmm
 
7:27 PM
Any of you watched the Irishman?
 
@IvanMilisavljevic what is this?
 
@MehdiB. I was going to, but then it looked like a replica of the godfather which i am yet to see so i figured I would watch the classics first
 
Yeah I heard "Irishmen is a longer, more boring remake of The Goodfellas"
so I decided to pass on it
 
thats the guys who created 2 super super super awesome albums in the ~60's
 
7:28 PM
fine looks like i am redoing my app
 
I don't really remember the godfather tbh but the Irishman is like 3h30 quite good tbh :D
 
and suddenly disappeared
!~wiki magic numbers
 
@IvanMilisavljevic the guy who didn't make a cent out of his unknown fame?
 
Magic number may refer to: == Science and technology == Magic number (chemistry), number of atoms or molecules forming an exceptionally stable cluster Magic number (physics), the number of nucleons that results in completely filled nuclear shells Magic number (programming), either a unique identifier or a literal with unexplained meaning == Arts and entertainment == Magic Numbers (game show), British 2010 television game show Magic Number (game), a pricing game on The Price is Right "Magic Number" (Maaya Sakamoto song) "The Magic Number", a 1990 song by De La Soul from 3 Feet High and Rising The...
 
@MehdiB. yeah
 
7:29 PM
@IvanMilisavljevic wow
 
@IvanMilisavljevic the trailer looked cool, you watch the actual movie?
 
that was just rude
 
@IvanMilisavljevic I only heard about it, is it good?
 
haha
havent seen it yet
 
i mean right in my face
|| wiki magic numbers
 
7:29 PM
Magic number may refer to: == Science and technology == Magic number (chemistry), number of atoms or molecules forming an exceptionally stable cluster Magic number (physics), the number of nucleons that results in completely filled nuclear shells Magic number (programming), either a unique identifier or a literal with unexplained meaning == Arts and entertainment == Magic Numbers (game show), British 2010 television game show Magic Number (game), a pricing game on The Price is Right "Magic Number" (Maaya Sakamoto song) "The Magic Number", a 1990 song by De La Soul from 3 Feet High and Rising The...
 
it's kind of weird that nyconing made a bot out of her actual account lol
 
@JBis hahah sorry, i've seen this couple of days ago
 
and even doubly funny is that I always made fun of her for suspecting that she was a bot
 
magic number is any non constant number in the codebase
 
7:30 PM
question, are these dumb methods?
    isFromMe() {
        return this.message.is_from_me === 1;
    }

    isDelivered() {
        return this.message.is_delivered === 1;
    }

    isRead() {
        return this.message.is_read === 1;
    }
 
@ballBreaker yes, tbh I wasn't very comfortable discovering that :D
 
@JBis not really
 
Is the triple === a replacement for the ? operator
 
would it be better to just make them properties?
@ballBreaker no its javascript for == because the more the merrier!
 
=== should be reference and value equality
 
7:32 PM
ahhhh
fuck JS
 
||> 0 == "0"
 
@JBis true Logged: ``
 
||> 0 === "0"
 
@JBis false Logged: ``
 
7:33 PM
I love JS <3
 
Right, I remember now from the bit of JS I've done about that
I thought it was Java when you posted it up yonder
 
tristaaan
 
ERICCCC
I'VE MISSED YOU
 
SAME
 
How have you been?
 
7:33 PM
@CptEric I can't hear the "eeeooo"s and i'm sad about that :(
 
enable sound
 
not working
 
uhm, i could lie you and tell you i'm good but i'm not
you?
how's it going? still at twitch?
 
Sorry to hear that :(. I'll send some cats in a sec
Going good! Back at school, but I'll be returning for a second internship in the Summer!
user image
3
There <3
 
aww
i missed your cat spam tbh.
you should move to a uni closer to my afternoon depression mood timezone
is checks notes boston ok?
 
7:36 PM
awww that bowtie on the tuxedo cat
 
so cute
 
he looks so close to my little Jabroni :')
 
Boston is in the same timezone :P
 
awesome about the internship part. back to SF?
 
7:38 PM
!~wiki slow loris
 
Slow lorises are a group of several species of nocturnal strepsirrhine primates that make up the genus Nycticebus. Found in Southeast Asia and bordering areas, they range from Bangladesh and Northeast India in the west to the Sulu Archipelago in the Philippines in the east, and from Yunnan province in China in the north to the island of Java in the south. Although many previous classifications recognized as few as a single all-inclusive species, there are now at least eight that are considered valid: the Sunda slow loris (N. coucang), Bengal slow loris (N. bengalensis), pygmy slow loris (...
 
lol @Ivan
 
nice. i'm in berlin working with warren
since may
 
@Dave congratulations my man! welcome back! 🎉
 
o/ all
thanks Mehdi
 
7:40 PM
heya
 
Ouuuf heyoo Daave
Grats maan
 
Hi Dave!!!
 
it's the mad lad dad
 
thanks all
 
you could show some enthusiasm there Dave 😒
 
7:42 PM
it's been a long couple weeks
 
he probably hasn't slept in the past 10 days
 
and I'm back at work
 
already after 2 weeks? :/
 
taking tomorrow and weds off but basically yeah, all I get is 2 weeks paternal
thanksgiving added 2 days
and I'm grateful for the 2 weeks most dads in the US have to use their vacation time
 
ouch
hope you can manage everything well, send us a smoke signal if you need a fake kidnapping.
from work :D
 
7:45 PM
we missed you dave
 
Congrats Dave!!!!!! :D
 
I volunteer Adam as a babysitter...
2
Congrats Dave <3
 
I think these little things such as paternal leave for a couple of months should be considered a basic human right
 
@DaveS that sux
 
you would think Mehdi
 
7:48 PM
Yeah I think we get 8 months here pat leave
Well.. 16 months, but you have to split pat and mat leave
 
in germany i think it's also 16 split
 
(if you take pat leave)
But also, Congrats Davey!!!
 
8:13 PM
possibly dumb question
what is a controller?
I have seen it in multiple languages
 
those are lmgtfy questions :/
 
180
Q: What goes into the "Controller" in "MVC"?

Paul WalkerI think I understand the basic concepts of MVC - the Model contains the data and behaviour of the application, the View is responsible for displaying it to the user and the Controller deals with user input. What I'm uncertain about is exactly what goes in the Controller. Lets say for example I h...

got that, but not sure if that is java specifically or in general
 
it's an architectural pattern, language agnostic
used a lot in stateful server-side web apps, and on mobile
 
you use controllers to control things, for instance a remote control car, or your video game character
you're welcome
 
great thanks david, useless as usual ;)
ok i think i am gonna try it
seems like a good pattern
although i dont really know how
 
8:18 PM
the controller is what's responsible for interpreting the model and providing the relevant information to the view
the model should only care about what data it has, the view should only care about presenting visual information, the controller is what's left
 
yeah also known as a handler in some old school architectural patterns
I like handler better because it reminds me of animals
 
do each have separate classes?
or can a single class transcend?
 
depends on the school of thoughts
Jun 2 '17 at 20:06, by Dave S
Sorry I'm not helpful Graeme, I develop all of my apps in one giant method so I never hit the Dex limit
 
(typically separate)
 
think of MVC as Ingredients Pizza Oven
 
8:28 PM
so i need 2 classes for each thing? unless the model passes a class instead of raw data
 
bad example but i'm hungry so can't do more
N classes as ingredients, a fancy pizza as view that shows results, and the oven/kitchen where the magic happens.
 
why they didn't decide to name it MCV I'll never understand
 
On small / individul projects I'm not a fan of rigid design patterns, so typically I think of it as XML layouts (View) - POJOs / Data Layer (Model) - Activities & Services (Controller)
 
I find ModelViewController confusing when the flow of data is ModelControllerView
 
i'm not sure how i should design this
@ballBreaker but for small projects isn't it useless?
 
8:33 PM
Yep
I use it for EE (enterprise) projects
 
I would think a single class where each one of MVC use it differently
but idk
heres the basic thing
 
model view presenter is mostly how it works on android
 
Everything is stored in a db. I have Conversations, Messages, and Participants. The view displays a list of converstations. When a conversation is clicked, messages are gathered and then past to the ui to be displayed. When a user gets to the end of aval messages it requests more and displays them...etc.
how do you suggest i design this?
using mvc or what?
 
It sounds like you're basically already following the design pattern
conversations, messages and participants are the model
controller passes the messages,etc to the UI
view draws the UI
 
but each of those are a single class
 
8:38 PM
Yeah, are you doing it all in one, or two?
(currently)
 
one
 
Well I would at the least split the model out from it
 
why?
and how?
 
"if tomorrow i woke up with a tremendous hangover, would it be easy for me to find this method"
if not, split.
 
just make a Conversation class w/ getters/setters/etc
if that's the way you want to go
But you could also have the model/controller together and just split the view out
 
8:40 PM
yeah i have like Conversation.getMessages and stuff
 
Gah, I love helping someone with their question on SO <3
 
Ah okay so you have the model then
 
what did you do tristan?
 
if your code currently is calling Conversation.getMessages then you've already split the data/model from the controller/viewer
 
Someone's question was a bit confusing, after a bunch of followup chat we figured it out :)
 
8:41 PM
i'm so confused :(
bb, I have a single class. For example here is code for the client side js (view)
 
OH okay sorry, are you doing the UI stuff inside the Conversation class?
 
Request sent (form submitted: View or api call or whatever) -> interception of request by controller -> controller fetching data from the model (model) -> controller injects the data into a webpage (view) -> controller returns the view to the user
 
switchThread is called when someone clicks on a convo in the side bar
  convo.conversation.getMessages();
also notice how getMessages doesn't return anything
its a shitty naming scheme
really what happens is that messages are gotten and saved to a property
 getMessages(limit, offset) {
         this.messages = /*crap*/
 }
is that good or bad?
getMessage actually queries the db
well technically it calls a different class that queries the db but it creates the actual query
I updated the gist
then the view accesses it by convo.messages
make sense?
@MehdiB. fyi this is all client side, its an electron app
 
It was a conceptual schema to understand the flow of MVC
 
what i can do is create a seperate db class that stores all queries for all classes. It will be called from the different classes which will pass variables. what do you think about this?
 
8:49 PM
yeah this looks pretty dece to me, your switchThread woudl be the controller in this instance
 
but my controller is in the view, so is that bad?
 
combining the two isn't bad if it's a small application IMO
 
and who should store the batch logic?
and sorry for so many questions, i have never properly designed a ui
 
I don't mind, slow afternoon for me here
I'll admit this is a question I would just be guessing at, I've only dealt with web-servers for the past like 5 years
 
ok gimme a sec i'm gonna try this
 
8:54 PM
and nothing that is self contained like this
 
as i said before
in JavaScript, 30 mins ago, by JBis
Lets just say my life would be much easier if I could just data dump shit to the user instead of making it pretty
 
Been using EJBs for longer than I am comfortable with lmao
 
I know I should be taking advice from PHP devs, BUT wordpress is designed this way:
6 mins ago, by JBis
what i can do is create a seperate db class that stores all queries for all classes. It will be called from the different classes which will pass variables. what do you think about this?
 
Yeah that's generally a solid approach
 
@RaghavSood your favorite xkcd was just posted in js chat
 
8:57 PM
It ends up being a sort of MVC design pattern but for the computation of things, in my case they're EJBs (Enterprise Java Beans) which act on the application server
But in yours it could be simply just a class that does the DB queries and returns the results to the controller
 
ok lets do this
oh wait one more question
should all intermediate functions in a class (controllers?) that call the model accept an arg for which model to call
so like:
new Conversation(/* args */, aDBModelThatICanCall);
that would allow me to have multiple db's open at once
 
I'm not exactly sure what you mean if I'm being honest
 
the user chooses the db to use
i need each class to know which db class instance to call which knows which db to access
aDBModelThatICanCall is a instance of a db class that has stored the path to the file the user selected
still not making sense?
 
o/
 
oh I think I understand
In your use case then, yeah you could do that
 
9:08 PM
alright, just seems bad to pass it down all things but whatever
 
What's the difference between the DBs?
Yeah I mean I don't think you need to pass it down all of them if you just had it set as a property inside of the model
that gets set from the controller when the user decides which one to use
 
well i can only do that if the user can open up one db at a time
think of my app as a specific type of db viewer with a really pretty ui
 
You probs should limit them to one, but I'm still not exactly sure on the difference between them
ahhh okay
 
i can restrict the user opening one db or multiple
 
what's the difference between the dbs? Like messages are stored in one, pictures are stored in another, something like that?
 
9:10 PM
no
each db is a collection of everything
 
ohh are they just partitioned by filesize or something then
 
but maybe the user wants to open bob's db and sally's at the same time
 
ahh by user
 
umm sort of, it could be bob's from now and bob's from 3 months ago. Also can be bob's iphone and bob's mac.
 
I think the implementation and keeping track of it would get messy, but what would having 2 open at the same time benefit them, could they query across two databases at the same time and display the results at the same time?
 
9:12 PM
Maybe
 
Ahhhhhh okay so if you wanted to do like "get all messages" then you technically would need to query all of them?
 
Well it would be seperate
 
check sql workbench (not mysql workbench) and see how they do it, 1 session = 1 db connection
 
Apply same query on two different db's but display separately
 
well if you're displaying them separately then I don't see a reason to query them as one
 
9:14 PM
for example
 
It kind of depends on your overarching design, I think I'd rather have it split but in the instance of where you would go in and select "bobs iphone" and then query that, and if I wanted to check bob's laptop I'd have to go back and select that
 
You create a query that says "I want all messages sent to Bob containing a url" you can do that query in janes and in sallys db.
 
But it sounds like the db separation isn't exactly as predefined as it just being different devices
 
99% of the time one device equals one db
 
Don't make your queries so specific to bob's database
 
9:16 PM
thats the entire idea of my app tho lol
 
What I'm saying is make your queries more general
 
ok i think what you have said is helpful, thank you
i am gonna try to make it now
 
but it sounds like you're doing that on the DB level and not the actual query level
 
i think you will get a better idea if i ever finish this
 
bahaha yeah unless you wanna make a design document to send me
 
9:23 PM
@MarkO'Sullivan When I said we shouldn't hire him, I was told "he's cheap". You get what you pay for
 
Heyya cM!
 
Hey, Tristan
 
How's life been going?
 
@codeMagic Operations people always drive me bonkers for this reason
 
It was more of the fact that we were still a startup, there isn't a huge pool of devs around here, and we had been looking for awhile
But I voted against hiring him then suggested he be let go multiple times. It was very frustrating. And even one of the managers we had at one point said to me, "He's just not gitting it, is he?" Referring mostly to git. I of course said "Nope!"
 
9:28 PM
glad you left that weight away.
congrats :D
 
I know git hire me kthx
 
@TristanWiley Depends on the day. How have you been? Are you back in NY now?
 
Yep, back in NY. Doing alright, stressed about finals but super excited to be over with them soon!
 
i'd hire you any day tbh
 
If you know C# or react and want to move to Boston or Mishawaka, we are hiring ;)
Nice
 
9:30 PM
React yes
Moving... not yet :P
 
@codeMagic Ugh that would frustrate the hell out of me, we're experiencing something similarly here but luckily the old coot decided to resign himself
 
We have one open rec here. Hoping to get that filled soon but we'll see
 
how much of uni left tristan?
 
About a year and a half
 
9:35 PM
nice! well done
 
@MwBakker I know you'll like that video
 
well (half) done
 
😃
it was the hardest half
now it's all fun and papers
 
haha
not my experience
 
Yeah... not looking forward to it
Looking forward to graduating and finally being able to work somewhere
 
9:47 PM
i'll let my spanish blood talk and say if y'aever apply where i'm at your cv will magically be on top :D
 
I just hit 3,000 reputation on SO! :D
4
 
#notcurruption
 
pshh
get on my level
 
goodnight everyone
 
I've gained 120 today. Procrastination is healthy, whoop!
Goodnight Eric!
 
Tim
9:49 PM
cya
 
user11867329
Gnight
 
Have a few more cat pics to go
 
but fr congrats
 
Actually just one, that one
 
See ya, cpt
 
Tim
9:50 PM
I got a PA today
 
whats a PA?
 
cM how's the lozenge plan holding up?
 
Pretty well, thanks
 
Tim
personal assistant
 
The real challenge may be if I go to the casino next week as I'm hoping
READ IT WRONG
 
9:53 PM
cool, are they competent?
 
@codeMagic Just get all hopped up on O2
 
Tim
we'll see about that
it's not really a PA but more of a junior dev colleague
is there a difference?
 
I thought you were being funny and said you needed one
I would think there's a difference
wait...does he get you coffee?
 
Tim
well
I did show him where the machine is
 
did you just assume a junior devs gender
 
Tim
9:55 PM
so tomorrow will be a test
 
the better question is, does he write coffee?
 
Is it bad that I thought it was a "she" when you said personal assistant, and then a "he" after you said junior dev
 
Tim
coffeescript?
 
java, cause like coffee is java --- ah its ruined
 
yes bb
 
9:55 PM
okay just checking
 
Why are you going to a Casino??
 
@ballBreaker yes and I'm fine with that
 
so am I
 
Because I need to do something with my bonus and I haven't played blackjack in waaaaaay too long
 
hence why coffeescript is named coffescript, cause javascipt is "Java" + "Script", so they made another name based off of java
whatever
 
9:57 PM
hows quitting cigarettes going cM?
 
did you start vaping?
 
he's being successful on lozenges
 
aw jeeze
 
lol
 
9:59 PM
well congrats on successfully trying to quit :)
 
thanks
 

« first day (3334 days earlier)      last day (1615 days later) »