« first day (3320 days earlier)      last day (1629 days later) » 

10:00 PM
o/ cM
 
like '%bobs%'
 
@IvanMilisavljevic 1. ew 2. I'm not writing the query. If i was writing it i could optimize it but i'm not. The user is using regex.
 
@CarlAnderson i still think it would be faster than the regex
@JBis ah
 
that was just an example maybe you want all emails
 
right
maybe create a specific dsl for this
 
10:01 PM
 message.text REGEXP ^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$
 
... message LIKE "%@%"
and then validate the results
 
@IvanMilisavljevic i've never done that and it seems a bit over engineering don't you think
 
not really
 
your use case is already over engineered though
 
and my lang won't be half as powerful as regex
@ballBreaker how?
regex isn't an unreasonable requirement
 
10:02 PM
@IvanMilisavljevic uhh did you mean to reply to me?
 
yes it is
 
nope carl, sorry for the ping
 
if you wanted all emails
select * from emails
boom, done, no regex
 
@CarlAnderson I had hoped to be at less by now. Still 3-5 a day but 4 weeks today without inhaling cancerous chemicals so there's that
 
bb, sigh, i don't make the db!
 
10:03 PM
dsl as in predefine all the stuff users can filter/search with and build query optimizations around it
 
I know that's why I said the use case and the problem in general is kind of over engineered to me
 
or maybe over engineered for the particular problem
that is in itself under engineered
 
what?
 
you heard me
lmao
 
10:04 PM
@IvanMilisavljevic again its not gonna be as powerful
@ballBreaker yes i heard your gibberish
 
I think he just wants to use regex :D good luck JBis, you can do it!
 
@codeMagic slow and steady wins the race.
 
I tool today off and all I've really done is two loads of laundry
 
I'm try to squash his dreams
 
10:05 PM
Well, one is in the dryer and the other is still in the washer so I'm not sure that really counts. Lol
Carl, that's right :D It's still progress so I'm happy with it
 
thanks @MehdiB.
 
through the power of jibberish anything is possible
 
Maybe i'll just use blockchain, that seems to solve everyones problems
 
user image
8
 
@JBis deployed on a quantum cluster for efficiency
 
10:06 PM
I can't wait until boomer is considered a hate crime
 
lol
 
It'll be like the "nagger" episode of south park
 
@JBis now on a serious note, convert your regexes into sets or LIKEs and then filter the output programmatically, but giving the user a way to use a regex is basically asking the user to stress and destroy your database
 
> [SQLITE_ERROR] SQL error or missing database (no such function: REGEXP)
welp there goes that idea
 
@codeMagic I'd say you tool every day.
 
10:08 PM
so glad we spent an hour discussing the details of the idea without even seeing if it's possible
 
also are we talking mobile or server side?
 
@DaveS the internet said it was so i trusted it
@IvanMilisavljevic client side (computer). I don't do android.
 
In that case... if you send at least 1 bitcoin to my address you will have 10 yrs good luck in life, career and romance
 
rigth, regex is supported on sqllite v3
 
@DaveS we've been through this, i need your account user and pass so i can give it to you
 
10:12 PM
send me the bitcoin and I'll provide it
 
deadlock
 
and now we're learning multithreading!
 
Tim
livelock
 
@DaveS now were talkings
 
@CarlAnderson I think you mean I am a tool everyday
But I also took today off
 
10:16 PM
@MehdiB. well they have the option. In my mind the dev should give the most functionality possible. Even if its gonna take forever to do, let the user make the decision not to do it.
I can add a custom SQL input so they can optimize if they know how
 
@JBis this is why I just give my users sql db credentials and let them figure out the front end
 
they have access to the db, my app adds a ui
 
they can do whatever they want with the data, I don't understand why they are complaining
you know, now that I think about it, they'd have the MOST functionality if they just built the app themselves
then they can really do whatever they want
 
i can't tell if you are serious
i mean thats the same thing with every app
 
I'm taking the logical fallacy to its extremes
as someone who works with really stupid users and client projects all the time, as a dev you should shoot for as simple and intuitive as possible
focusing on being feature rich just leads to bloat and a poor UX
 
10:22 PM
the logical fallacy is restrained by the "possible" clause
i don't think regex is extreme
 
when most developers can't use it well, its likely to just confuse users
 
it doesn't matter
 
k :)
 
For example, Google Docs. The Ctrl + F supports regex. Why? because its useful to super users regardless if most users no what the hell regex is
 
I mean everyone in this room told you it's probably a bad idea and inviting trouble, but you're pushing on it with it anyway. So, go for it and good luck
 
10:26 PM
Thanks :)
we'll see how it turns out, i assume its gonna take a long time but it will work
 
10:38 PM
LIES
 
Don't listen to them, JB, I believe in you
 
LIES
 
10:52 PM
its weird, you did it once in 2013 then took 4 years off
seems like an old bug got reintroduced into your programming
 
@codeMagic thanks!
anyone smart know how to do this better?
 
 let query = `
        [...]
        WHERE 1 = 1
    `;

    if (obj.before) {
        query += ` AND message.date <= ${dateToCocaEscpae(obj.before)}`;
    }
    if (obj.after) {
        query += ` AND message.date >= ${dateToCocaEscpae(obj.after)}`;
    }
   [...]
basically so i don't need a dumb 1 = 1 clause
 
obj.before && query += ` AND message.date <= ${dateToCocaEscpae(obj.before)}`
I know in javascript short circuiting will cause that to act like a ternary with only 1 result
otherwise a ternary
 
davis yes, but wrong issue.
:)
If I just do AND's the first one will be WHERE AND ... which is invalid. So i have 1=1 so its WHERE 1 = 1 AND .... which is valid. But that seems stupid
 
11:02 PM
try WHERE 1
 
ok will do
 
50
Q: Why use WHERE 1 or WHERE 1=1?

ursitesionUsually, if conditions are not required in our query statements, we don't use a WHERE clause. But I've seen a WHERE 1 clause being used in many places, even where other conditions are not present. Why is this done? Are there specific benefits to the execution time? Does it enable other function...

 
ok so 1 = 1 is fine thanks
 
well you could optimize 3 less characters out of memory ;)
 
gotta save those cpu cycles
 
11:16 PM
No.
 
(removed)
 
Its difficult to articulate what i am trying to do
 
then draw it
 
alright i guess i can
 
(removed)
 
11:23 PM
for some reason webstorm isn't letting me :(
brb
 

« first day (3320 days earlier)      last day (1629 days later) »