« first day (1774 days earlier)      last day (3184 days later) » 

9:00 PM
No it works fine, the number of rows is fine everything is fine the only problem is: Returning All rows INCLUDING most recent message
 
@Sajad mysql is what you are most likely to end up using at work.
 
@tereško ok, how can I upload my website on my server ?
 
Anonymous
@tereško spot on
 
where is a folder like htdocsin xampp ?
 
@Sajad connect to it using filezilla (you will have to use that PPK key for "sajad" user) and you need to upload files in /var/www
 
9:03 PM
ok
 
@Sajad see this config: gist.github.com/teresko/d5217db617732c4565b4 m the "root: /var/www" defines whewre webservers DOCUMENT_ROOT is
 
I can not connect to filezilla as root ? (without PPK key)
 
Anonymous
@Matthcw simple answer, write another query in that block SELECT .... FROM ... WHERE .. LIMIT 1
 
@tereško it is like htaccess ?
 
Anonymous
yes no
 
9:04 PM
kinda
-ish
@Sajad you cannot connect to your VPS as root directly
 
I have some htaccess code, how should I copypase them ?
 
.. remember .. security reasons
 
@tereško ok
@tereško I see
 
Anonymous
@Sajad this line is more like .htaccess
 
@Sajad you should leave that for tomorrow
 
9:06 PM
@samaYo ok tnx
@tereško yes, I'm agree
 
you sill have to "internalize" what you did today
 
now type init 0 ;p
 
Anonymous
You are lucky btw, I have never been fed this much information since the dawn of time.
 
@AnmolRaghuvanshi not linux
 
really really thanks @tereško and thanks @samaYo !
 
9:07 PM
i tried it works
 
hmm
@samaYo you were really annoying, when you were starting to learn
:P
 
@tereško I fear because I must do all operations (actions) for my real VPS :((
 
Anonymous
@tereško Because I was trolled by you. Got into fight with everyone. I know the internet much better now :/
 
@Sajad since you have done this once, you will have some clue what to google
 
9:11 PM
@tereško yes
 
imagine if you bought your VPS some 5 days ago
 
@samaYo stop fighting ... !! ;-)
@tereško oh oh ! In that case I cried
@tereško did I all security works for my server ?
 
how to google solid?? i am still weak at that
 
Anonymous
@Sajad Keep a note of what you learn, its very helpful. If tomorrow your vbox crashes, or you need to make another one .. you'll walk this step again unless you write down all the codes now, until you feel comfortable enough, then you won't need to write anything.
 
@samaYo you are right ! I will. tnx
bye all !!!
 
9:15 PM
btw, how much did you understand from trying to "debug" the php setup?
 
@tereško me ?
 
yes
 
50 %
or maybe more
 
good enough
 
yes !
bye for tonight ...!
 
9:16 PM
bye
 
oh wait
 
?
 
did I all security works for my server ? @tereško
my server is secure now ?
or there is some work for increase its security ?
 
Anonymous
@crypticツ aloha
 
9:18 PM
@Sajad yes, it always can be improved
 
@samaYo "aloha" is kinda thanking ?
@tereško ah ok !
 
you can make it so that the 22th port (ssh) is not opened to everyone
 
your mean is 22 instead of 80 ?
 
22 port is ssh, 80 port is http, 443 port is https
 
ah ...
you can make "it" so that the 22th port (ssh) is not opened to everyone
what is the refrence of "it" ?
 
9:19 PM
What other way are available to create Live Chat App with Expiry on redis server? (Not Pub/Sub)
 
Anonymous
@tereško did you teach him about guest additions?
 
@samaYo no, only ssh user's private/public keys and some basics of what a drive-by hacker will try
@Sajad do you have a fixed IP at home?
 
@tereško from ISP ?
 
yes
 
yes
or your mean is from my router ?
 
9:21 PM
@NSGod You probably do not want just pubsub, but a combination with other things like storing messages as key / value pairs.
 
@Sajad I mean, if you write in google "what is my ip", does that IP change like weekly?
 
no, it is fixed - it change monthly !
 
then you can restrict it so that only users from your IP can use SSH
OR you can use port knocking
 
@kelunik can i just store it as SET with Expiry and just get it in background?
 
@tereško wikipedia does not support Persian ?
 
9:24 PM
@NSGod "Get it in background"?
 
@Sajad well, try reading anyway (you need the practice)
 
ok !
ok well
I need to some sleep
good night
 
bye
@AnmolRaghuvanshi there are two ways: you either google for a specific error message or you use keywords
 
i just copy paste error on google
 
yes, but what do you do when you need to find something more obscure?
let's say you are trying to find the name of a song, but you know only few of the words in the lyrics
 
9:29 PM
I really need some help here with nusoap before my head explodes
 
once i tried it i just typed those line from song it get me the result @tereško
 
I even went to some tutorial and copied everything exact and there is still an error in the generated XML and I don't know why
 
/me doesnt doe SOAP, it's evil
 
Anonymous
@AnmolRaghuvanshi same here
 
@tereško make it simple ^
:)
so what should be done that case @tereško how to search for that
 
9:33 PM
yea why the hell did I decide to use SOAP honestly
oh that's right bc the API I'm currently working with uses SOAP
what a mess
 
Anonymous
@tereško any good movie recommendation?
 
not really
you could try "Lost Fleet" audiobooks instead
those were awesome
 
Anonymous
Never tried an audio book.
 
Anonymous
Well once, I think .. for 10 minutes.
 
sam
so.....
 
Anonymous
9:37 PM
The narrators voice was too unbearable
 
where exactly wuld I put this said select block?
 
@samaYo Kingsman, maybe?
 
Anonymous
@kelunik saw it,
 
Anonymous
+eww
 
samaYo watch straight outta compton movie, it suits you
 
9:41 PM
The nice thing about "Pixels" is not the actual movie, but the free to play gaming machines (Pacman and some variant of Space Invaders) they set up at the cinema. :-)
 
@samaYo try "The Lost Fleet: Dauntless": audiobookbay.co/audio-books/… (that's the torrent)
 
Anonymous
@Matthcw Not much into gangsta movies.
 
Anonymous
@tereško okay, after one movie
 
any serial suggestions ??
 
@samaYo give an hour for the first book, before you decide
 
9:44 PM
does anyone like arrow
 
Anonymous
@tereško an hour seems reasonable
 
Anonymous
@AnmolRaghuvanshi the rating seems good
 
yup i watched two seasons... it's interesting to see that anybody dies come back in other season ;p
 
Anonymous
spoiler :D
 
Anonymous
Only fine movies I saw past month were pawn shop chronicles, Girl with dragon tattoo, Captain Philips, and filth .. filth being the best among them.
 
9:49 PM
game of thrones becomes very famous in india!!
 
come on samayo, don't we all have an inner gangsta within us?
 
Anonymous
For adolescents or people stuck in that state of mind.
 
Anonymous
@kelunik Something should be said here but my English is weak :/
 
Oh please, come on; even Bill Gates has a little gangsta in him, check this out: youtube.com/watch?v=9bvLn9EPmIw
 
@kelunik This is what i want to do, so each post have array of comments stored, then each key in the array have expiry like 25sec. How can I create this? sorry for misunderstanding
 
Anonymous
9:57 PM
@Matthcw Good point, I'm now convinced :)
 
@samaYo Just another "Invalid cookie string"? ;-P
 
Told you man, you'll enjoy the movie
 
Anonymous
ok, downloading
 
@NSGod I'm not sure, easiest thing would probably be to use a sorted set per post and removing old comments from it on read. Use the timestamp in milliseconds as score. However, that would only allow one comment per post per millisecond.
@samaYo Added a basic message.
 
Anonymous
@kelunik Looks good
 
Anonymous
10:08 PM
Maybe its me or my crappy laptop, but Arya seems to run little slow for me compared to how simple the framework is .. hmm
 
@kelunik yes that work perfect with SADD and SMEMBERS, I just need to add expiry to the each SET. WOW this is exactly what i wanted
 
@samaYo Do other local things run slow, too?
 
Anonymous
@kelunik Yes obviously, but compared to Symfony and Laravel, Arya does not have any noticeable speed. Maybe its the dependencies.
 
@samaYo I don't get what you're trying to say there.
 
Anonymous
Hm, It's slow. It does not feel fast enough for a minimalist framework.
 
10:17 PM
Can't say that for my own projects using it.
 
10:35 PM
I know many folks say "only throw exceptions when truly exceptional". However, doesn't it seem fine to leverage this exception bubbling up on things like validation/etc. as long as we only throw a custom exception type? For example:
try {
    $foo = bar;  // <-- throw an error
    $foo = bar2; // <-- throw another error

} catch (My_Custom_Not_So_Exceptional_Exception $e) {

    // Collected in array and sent to UI later
    array_push($errors, $e->getMessage());

} catch (Exception $e) {
    // Use a generic message or rethrow
    // ...
}
Any thoughts?
 
I don't consider validation errors an exceptional circumstance. You know you're going to deal with them. I'd rather see a few methods that expose the ability to determine if the data is valid and to collect the errors if it isn't
 
@cspray depends on where the validation happens
but yeah, I wouldn't rely on low-level validation exceptions for UI stuff
 
@Ocramius Could you give an example of a validation that should throw an exception?
 
final class EmailAddress
{
    private $emailAddress;
    public function __construct(string $emailAddress)
    {
        if (! (new EmailAddressValidator())->isValid($emailAddress)) {
            throw InvalidEmailAddress::fromString($emailAddress);
        }

        $this->emailAddress = $emailAddress;
    }
    public function __toString() { return $this->emailAddress; }
}
 
Validation errors require a transaction rollback though. I say anything that requires a rollback should be a thrown exception
 
10:45 PM
@prograhammer any usual transactional wrapper does a try-catch-finally with that anyway
agreed btw
 
^ yeah
@Ocramius doesn't the idea of "Common" value objects and "Local" (to the aggregate) value objects remove the need for these "validators"?
 
@Ocramius Ok, yea that does make sense
 
I can use the common when common. Or if there are differences, I can create one for the local aggregate.
 
@prograhammer no, because you want to reuse the same validation both in the domain and in the UI. In the UI you simply add validation to the forms to prevent crashes
 
If I'm using CQRS, and say I have commands with all UI action, then I can do both in the command.
 
10:48 PM
You would still do some validation before building the command object, no?
 
any repeating in domain (stuff not found in Value Objects) is fine
 
well, the point is that the validation should first be in the domain, and then in whatever happens outside it (dupe)
 
The command object can validate the form plus catch stuff when constructing value objects before passing to domain entity method.
 
if you assume the VOs to be valid at all times then that's fine
 
I like to have an alternate constructor "fromForm" in my commands
Keeps repetition to a minimum IMO
 
10:50 PM
That sounds good indeed
 
<-- got 2 approvals from @Ocramius in one day....Woohoosies!
 
Morning guys
I have a question related to SQL
 
alloo Zahid
 
I need to get some sleep
 
I just wish I was building a CQRS app atm, sigh...
 
10:53 PM
oh CQRS is a joy
 
Suppose I have to store user name in datebase.
Question 1) What should be the best data type of that "Name" column that is CHAR or VARCHAR ?
 
It is, but atm I'm working on the usual messy application
@ZahidSaeed do all your users have the same name length? :P
 
@Ocramius of course not !
 
@Zahid
Is it common in mysql to select a bucnh of data and user php to filter the data you want to actually use?
Or am I supposed to filter the data entirely through MySQL
 
@Ocramius My end goal (not with this current app atm) would be to go all the way to Event Sourcing as well as work with something like google's BigQuery or Apache Drill.
 
10:55 PM
@Matthcw I think the best practice is to filter data through MySQL
 
ohh oh thanks
 
@Matthcw depends on how complicated the filtering is.
Simple filtering is most efficient in the DB
 
@ZahidSaeed varchar because it will save you memory in the long run. Char takes up the space no matter what.
 
But you guys still haven't answered my question :P
 
Yeah, my filtering is meant to get the LATEST message in chats between two users,
which is quite complex right?
 
10:56 PM
Is there anyway to prevent redis from outputting the length of list and key (Like $3 $5 etc)?
 
@ZahidSaeed for those situations where you have variable length, of course
 
@prograhammer Well, once you get to ES you can start plugging in any tool to add additional "reporting" or read models
 
@ZahidSaeed I answered it
 
let's say that getting to ES is the hardest part
@ZahidSaeed VARCHAR
 
@prograhammer Question 2) Does VARCHAR users more memory than CHAR ?
 
10:58 PM
@ZahidSaeed a bit more yes, but the tradeoff is for variable length situations you end up saving more
 
@prograhammer ok good
 
I mean, it takes a bit more than the CHAR of equal length
 
it's supposed to use less memory, but ultimately it matters very little unless you're doing really huge datasets
 
but see, if you have a bunch of strings that are less than that length, you save on the long run
yeah, but maybe he is asking "conceptually" :-p
 
Question 3) Suppose I set the data type of "Name" and it's length to 100 chars. Now the question is if I set the length of the "Name" column up to 1000, will it also effect the memory being used !
That's the most confusing point
Or Length is independent of data type
 
11:00 PM
the idea is that CHAR(x) has a fixed length, which means that indexes can be optimized on that, whereas VARCHAR(x) has a dynamic length, which reduces optimizations on indexes but also reduces the memory used per row
 
he also needs to consider "page/leaf". That's deep though.
ie. varchar(250) vs. 500 vs etc.
 
@ZahidSaeed of it's CHAR() then yes, if it's VARCHAR(), then no
 
@Ocramius I got it now.
 
CHAR() uses a fixed amount of memory
 
In VARCHAR() the length doesn't matter
 
11:02 PM
in theory, ofc, because databases are a bit smarter than they used to be in the 70's
 
varchar has 2 things going on....there is a variable length, but also some chunk allocation going on
 
It only matters the data stored in it
 
the length still matters for the engine, but ultimately it matters little to you (except that it's a hard limit)
 
Question 4) What are the benefits of indexes ? :P
I never used them
I have heard that it benefits performance
Which columns should I index ?
 
@tereško When you write your memoir you should title it "I need to sleep"
 
11:05 PM
@ZahidSaeed eh... that's a bit basic and you should know it anyway. I'll try summing it up but then you should search for an article
 
@ZahidSaeed think of indexes like you do a dictionary or phone book
if someone says "go to the letter P page" you can quickly find the P's right?
 
exactly as @prograhammer said: an index gets you where you want to go quickly
 
Yes
 
without it, you'd have to "search" or "scan"
 
They are like lookup tables hidden in mysql. Mysql uses them to do a lookup and then grab at your data using the primary key it looks up.
 
11:05 PM
but an index also takes a few pages of your book
 
Question 5) What is the difference between unique key and primary key ? :P
 
@ZahidSaeed are we doing your homework?
 
@prograhammer Hehe. No
I couldn't find the answer so I came here
 
oh ok
Sounds like you need a good link
or beginner php/database/mysql book
 
@ZahidSaeed no real difference except for the fact that one has a more specific meaning
 
11:09 PM
I have heard that Primary key are only 1 column in the table
 
they are the same stuff, but one is supposed to make you "identify" a record
@ZahidSaeed nah
 
i need it too suffering from it many days link to some specific advanced tutorial also
 
Is there anyway to prevent redis from outputting the length of list and SET (Like $3 $5 etc)?
 
@NSGod Haven't used Redis yet. But maybe someone else can help
 
So what's the main difference ? :P
 
11:10 PM
@prograhammer Sure, Thanks anyway.
 
<-- looking for good php/mysql toooot....
 
i find mysql more typical than maths ;p
 
Yeah ! :P
 
I remember "tizag" being something I went to, back in the day
It's quick, has code examples
Honestly, it seems like a good book is the way to go
work your way through a good beginner php/mysql book
 
and what's that page/leaf concept @prograhammer
 
11:14 PM
oh that was deep sorry. It's been awhile since I looked at it. But totally not a beginner thing to worry about. It's just talking about how stuff is physically stored on disk
 
what something like pagination ;p
 
When you are ready (after beginner php/mysql book) you can get "High Performance Mysql" book
it will really guide you into making more advanced index decisions/etc.
Highly recommend it. It's not too tough to read.
then when you are done, come back to this room and everyone will tell you to leave Mysql. LOL
But the knowledge you learn will transfer in many ways.
 
;p that i already know
 
Leave MySQL ?
But why ?
 
^ opened a can of worms
 
11:19 PM
:D
 
mysql is good for you to get a footing/foundation with
Then you'll have enough "know how" to compare it with other choices. Like postgres and mongodb.
Trust me on the "get a book" recommendation. As programmers with think we can just rummage through the internet and pick up all the learning we need. No, save yourself the frustration.
@Ocramius how was FROScon?
 
@prograhammer I didn't see much, I pretty much hopped in, did my talk and then left
6 hours of driving, 2 hours of conference
 
surely an interesting conference btw, wished I had time to go watch some of the linux networking talks and some of the java concurrency talks
 
What is the difference between mysqli_store_result() and mysqli_use_result() ?
Have anyone used them before ?
 
I searched
 
Is today "no one read the manual day"?
 
But no one gives a code example !
 
@Danack lol
 
Not even php.net
 
11:36 PM
Sometimes certain optimizations just suck :x
 
@ZahidSaeed where did you go and see "mysqli_store_result()"?
 
yeah, but what made you go there?
where did "mysqli_store_result()" enter your mind from?
 
cause I remember that I got an error called:
"Commands out of sync"
Something like that
And someone told me to store the result
using mysqli_store_result()
 
@ZahidSaeed what kind of tutorial are you following?
Use a php/mysql/pdo tutorial like I linked above
 
11:40 PM
@prograhammer Currently I'm using mysqli
 
My personal recommendation is go for PDO
 
comparison of the two: code.tutsplus.com/tutorials/…
The "named parameters" part will be your best friend, later on.
 
pdo elephant has more load over it ;p
 
that's one way to put it
 
11:44 PM
All optimisations that are not just avoiding doing unnecessary work suck, it's just that their trade-offs are sometimes worth it.
 
@Danack "are not just avoiding doing unnecessary" that is hard to read like that, lol
 
yep
^would you make it easy danack
 

« first day (1774 days earlier)      last day (3184 days later) »