« first day (1667 days earlier)      last day (3284 days later) » 
00:00 - 16:0016:00 - 00:00

12:00 AM
@ziGi wanna know what's really bad. when you write "hearth" :| or "mayor" instead of "major"
 
Anonymous
your profile reminds me of the game tekken 2 for some reason.
 
i am from planet kronos @samaYo
and i am a klingon
 
@Worf haha mayor is also a word
 
@ziGi i know. :(
 
it's simple to mayonnaise but it means someone on a high position and usually the guy who is chief of the city
 
12:02 AM
yes i know how to use a dictionary even if it doesn't look so
 
Anonymous
you are from one of those scandinavian countries
 
12 mins ago, by Worf
italy
 
vaj tlhIngan Dayaj'a'
 
i wish i know what that means. i was grown up by humans
let's end this OT
 
Anonymous
so what's the down side of buying a gaming laptop/pc for programing? I can't think of any
 
Anonymous
12:14 AM
 
high end = pumped up = gonna break
imho. buying high end stuff is never a good idea
 
@samaYo and besides it's a bit ugly
 
Anonymous
Isn't high end supposed to mean at the top of all else. @Worf
 
Anonymous
 
Anonymous
@ziGi how about this^^
 
12:23 AM
why do you check prices on digitec.ch? are you swiss?
 
Anonymous
yes
 
@samaYo meh
 
Anonymous
I'm not swiss, but I live there
 
anyway that site prices doesn't seem right
they should be lower
 
Anonymous
maybe quad core is just too much for web development, and more suited for gaming
 
Anonymous
12:25 AM
@Worf in here everything is much more expensive than the rest of EU
 
yeah
 
Anonymous
that comment made me laugh
 
yeah because prices are very pumped up :D
check mediaworld or something?
 
Anonymous
thankfully you get paid here in the same manner, so it's not a big deal for some people
 
I guess the most boring people live in Switzerland
 
Anonymous
12:33 AM
@ziGi why?
 
neutral and stuff
working like Swiss clocks
 
Anonymous
just asked to know your reason for that ... epic fact!!!
 
Anonymous
it's so boring, i can't find the right words to describe it.
 
Haha, man I was just joking, seriously
so why did you decide to go to Switzerland then? Because of the good pay?
 
Anonymous
nah, very strange, long story but never mind, google the boring thing
 
12:38 AM
was there a woman involved :D
 
Anonymous
@ziGi don't try to guess. it's un guessable :)
 
@samaYo actually there was this show called Brickleberry which is a total toilet humor, but there was this Swiss athlete who was perfect in every way but came out to be a terrorist, because he was so sick of his boring country and the fact that they are so neutral
That's why I was making fun of it
I didn't know it's true
 
Anonymous
it's also the most loneliest place on earth. You'll be lucky to make one friend in 10 years..
 
Anonymous
the whole thing just makes me laugh sometimes
 
seriously
so how do you cope with it
 
Anonymous
12:43 AM
google is your friend
 
so why don't you just move out, don't you feel unhappy?
 
Anonymous
it's not easy for me to move out, ill have to suffer for few years before I can change things around.
 
Anonymous
anyway, that's life ... :/
 
Haha, don't worry, I feel the same in the Netherlands
although I have some friends here
so that fixes it
but the lack of mountains and non-stop cold weather gets to me
I've always been so cheerful and I started getting depressed the past few years during winter time
 
Anonymous
I was there three years ago, very multicultural place, wish I lived there
 
12:47 AM
haha seriously :D
so I can now imagine how boring Switzerland is I guess
how do people enjoy themselves in there?
 
Anonymous
think of antartica ...
 
what is something that they do to enjoy themselves in their free time
don't you have colleagues at work that you can go and drink a beer with?
 
Anonymous
looking at mountains
 
Anonymous
nope
 
Anonymous
just forget this, you're making me even more sad :)
 
12:49 AM
sorry, man, if I was there I'd go out with you
where are you from then?
 
Anonymous
But, I wouldn't go out with you.
 
Haha, why?
 
Anonymous
Because I am starting to become Swiss.
 
Anonymous
that is the worst part :)
 
oh, come on, don't be that guy
so what do they do, stay at home?
drink shnapss?
 
Anonymous
12:51 AM
I think you should just google about them, they like their privacy and have many weird rules..
 
Anonymous
 
A man may not relieve himself while standing up after 10 PM. Also, you are not supposed to flush the toilet after 10 PM.
That's just cruel
I guess by reading all those rules, I can assume that they really like having quite and boring life with no sounds what so ever
...
jesus
they really like to restrict you doing things on Sunday
 
Anonymous
It seems to me, you have never heard about Switzerland before
 
well I know the country, I've been in Bern once
it seemed really quiet
but I've never been into what people do there
I just imagine them as some robots
and working with money and stuff
I really have no opinion since they are not interesting
it's more like vegetative state rather than living from what I hear
4. Discrimination based on gender, age, or nationality is legal (job applicants have to list all of these attributes on their resumes)
is this true?
 
Anonymous
nope
 
Anonymous
1:01 AM
it's not legal obviously, but the people can be too primitve sometimes
 
Anonymous
so, they may discriminate you ...
 
Anonymous
I am black and I get one of those on weekly basis.
 
Anonymous
also, bern is actually one of the four largest cities, so it is a very vibrant city by our standards.
 
Sorry to hear that man
haha didn't seem vibrant to be honest
then, if I think about it, I was there on a Sunday so maybe that's something to think about it
 
Anonymous
I love France just by hearing about it.
 
Anonymous
1:05 AM
have you been there?
 
yes, my brother used to study in Nice
and I've been there for quite a while and I can say it is really nice, the reviere and the weather and people
it's just nice
 
Anonymous
I hear, it is multi-cultural and you can make friends and blend in, in no time
 
true
if you speak French I guess
 
Anonymous
Yeah, I live in the French speaking part of Switzerland, and close to France.
 
Anonymous
Someday I will just migrate there
 
1:10 AM
I wish you luck man
btw, there is this thing in France that it's more or less something like a law
they require companies to have certain percentage of people working in the company from different races, so they try to prevent discrimination this way. My brother told me about it, I am not sure what the rules are exactly but it sounds cool
 
Anonymous
it's probably or derivative of some sort affirmative action
 
up to 276,000 classes, and counting :-)
 
@ircmaxell what are you talking about?
 
Anonymous
php
 
haha yeah, that much I can guess
but where are those classes, how are they used
@samaYo I checked Leaper, and I have a question
 
Anonymous
1:17 AM
ok
 
when you do $select = $db->select('SELECT * FROM users WHERE id = ?', [145]); why do you have to still give the 145 as an array
isn't it better to allow people to give a single value instead of always expecting the 2nd argument to be an array?
 
@ziGi I'm generating a lexer for JavaScript in PHP using a home-made lexer generator
it's a massive time-memory tradeoff. In the end, it'll take several hundred mb of ram to represent, but will parse strings extremely fast (10x or better faster than a regex based approach)
mostly it's an experiment on how far I can push PHP
 
Anonymous
because the execute() method accepts an array, and second if you have more than 1 value to pass, then you would have a problem passing the argument. @ziGi
 
@samaYo ok I see
@ircmaxell what are you generating basically? A lexer that parses JS or?
 
tokensizes JS
so it turns a JS string into an array of tokens
a separate parser turns the array of tokens into an abstract syntax tree (AST) data structure
 
1:22 AM
I see, I was not aware of how the whole thing goes
and what are those classes that you generate basically?
token classes?
 
Has anyone worked with WSSE authentication before?
 
class S0 {
    public $value = false;
    public $F;
    public function __construct() {
        $this->F = new S1;
    }
}
class S1 {
    public $value = false;
    public $o;
    public function __construct() {
        $this->o = new S2;
    }
}
class S2 {
    public $value = false;
    public $o;
    public function __construct() {
        $this->o = new S3;
    }
}
class S3 {
    public $value = T_FOO;
}
so, $S0->F->o->o->value === T_FOO
so when parsing, looking character by character, we can determine the value of the string
 
@ircmaxell haha cool, nice to see that, are you going to publish it when done?
I mean the generator?
 
no idea
it's amazingly crap code right now, just building a proof-of-concept
 
Ah, I see, still I like the idea though!
 
1:32 AM
thanks, it's been fun playing with it
except for the runtime of the current generator is a bit... long
been running for at least 5-6 hours so far
 
What's wrong with the runtime of your generator… seriously!?
 
I havne't optimized it at all
it's a depth-first search through a GIANT tree
and does quite multiple depth-first searches through it at the same time (for reasons that eased development)
though this did give me a really interesting idea on how to simplify it a lot (should cut generated classes by a few orders of magnitude
 
1:48 AM
@ircmaxell it's been like that for aaaaaages
 
obviously, still weird tho
 
it's mainly weird when you plug it into a code generator for a class constant
thankfully, we now have constant expressions
 
that's pretty easy to solve: return '"' . preg_replace_callback('([^a-zA-Z0-9])', function($v) { return '\\x' . str_pad(dechex(ord($v)), 2, '0', STR_PAD_LEFT); }, $value) . '"';
and by "pretty easy" I mean idiotic
 
/me writing the most boring talk either
 
@ircmaxell This is weird.
 
2:01 AM
@ircmaxell "([^\x20-\x7e])" is a saner range ^^
 
and excluding " and \\
 
do an addcslashes later. I don't want to guess that \x22 means " …
 
you can't, because you can't escape \ without escaping \x
 
return '"' . preg_replace_callback('([^\x20-\x7e])', function($v) { return '\\x' . str_pad(dechex(ord($v)), 2, '0', STR_PAD_LEFT); }, addcslashes($value, "\\\"")) . '"';
 
2:21 AM
It is okay to ( int ... $x ) to hint int[] ? or is that abuse
nevermind..
 
How can I post form with search query string?
So I have a form element and search textbox and submit button, when I press enter it sends form to www.mywebsite.com/searchProduct but I would like something www.mywebsite.com/searchProduct?searchQuery=shoes
 
Bleh, finally done with homework assignment 3 for CS 252.
 
it generated 254,000 classes, and fatal errored just before writing them to disk
 
@ircmaxell Have you ever done this kind of stuff ^
 
what stuff? I don't see any questions, just question numbers
 
2:28 AM
> Construct the state-transition diagram of a DFA that accepts
the following language over the alphabet { 0, 1 }:
The set of all strings when interpreted as a binary integer is a multiple of 6,
e.g., strings 0, 110, 1100, and 10010 are in the language
 
@ircmaxell that's a pain :-( What stupid mistake was it?
 
@bwoebi ran out of memory doing a string concatonation with long strings
I changed it to use a file descriptor instead
@LeviMorrison I have done that before
 
I wish we'd just get to the part about grammars already.
 
19
A: Can I use regular expressions to search for multiples of a number?

ircmaxellHere you go (In PHP's PCRE syntax): ^(0*|(1(01*?0)*?1|0)+?0{4})$ Usage: preg_match('/^(0*|(1(01*?0)*?1|0)+?0{4})$/', decbin($number)); Now, why it works: Well we know that 48 is really just 3 * 16. And 16 is just 2*2*2*2. So, any number divisible by 2^4 will have the 4 most bits in its b...

 
Anyone know anything about getting codeassist to work on remote files in aptana? Specifically with wordpress functions
eg: I'm working with aptana 3, editing remote files, but codeassist only seems to work properly when Im working on files locally
 
3:04 AM
@ircmaxell brilliant
my body is really strange. got fever (38°c). took aspirin. fever gone in just a couple of hours. i could run a marathon right now :| or maybe it's the symptoms of a premature painful death
 
anyone familiar or skilled with programming of php extensions?
 
@Pankrates If you ask during UK day-time, there will be. Also, if you just ask a question, instead of asking to ask - someone might respond when they see it.
 
3:19 AM
do you mean a question in chat or an actual question on SO?
because the issue I have is not really suited for an SO question
 
I meant here ....people who come online seem to scan the chat history.
 
ok perfect, thanks, I will do that
For anyone reading this, I just started working with the extension php-git which serves as a php extension around the libgit2 library. I am familiar with coding in php and in c but this is the first time working with a php extension. Now development by the original author has been halted for quite some time but the extension crashes for some functions.
My problem is that I do not really know how to debug an extension. I know how to debug a pure c program from cli or debug a php application running on apache. But in this case the browser just crashes and I get no information
How is an extension typically debugged?
 
3:38 AM
@Pankrates why not get it working using the PHP cli first rather than trying to get it to work through a browser?
But the general way would be to attach gdb to the PHP program - or to just use valgrind to find where it is crashing.
 
ok I guess that is exactly the part that I am not seeing how to do
 
Getting it working with the CLI?
 
would I write a simple php script that calls the extensions function that causes a crash and then call that from cli
how would I connect a debugger
for a c program I would valgrind program.exe
for php the same? valgrind php script.php?
 
yes, or more likely valgrind /usr/bin/php script.php
 
ok that seems like a good starting point
thanks a lot
 
3:54 AM
i'm writing an extension that uses an external library it segfaults when i use it with valgrind because it does some kind of magic that valgrind is not happy about. how do i test my code only without the external library any ideas ?
i thought of using macros when debugging in valgrind change all function calls to that library with dummy functions not sure if this is possible but is it a good idea ?
i need either some kind of abstraction. or write a memory allocation tracker. i think i prefer the first
 
@CodingInsane What message does Valgrind give saying that it doesn't like the magic?
 
actually it's mono guys who are saying this. i'm using Mono CLR it's a self-modifying program and valgrind does not like it
it's a bug and i don;t think they will fix it soon
versions 3.0 up to 4.0 and valgrind still does not work with mono
@Danack do you have an idea of what i can do about it ?
 
Not really.
 
i'm going with macros and see what happens. just waiting for microsoft to open source more stuff and leave the whole mono thing
 
 
2 hours later…
5:46 AM
user image
2
 
 
3 hours later…
8:57 AM
@DaveRandom morning, here's an interesting article for you sciencealert.com/…
 
@MieerDarwesh I disagree. X Series thinkpads are the bomb
 
@DaveRandom here's a more real article nasaspaceflight.com/2015/04/…
@Gordon I have an E series laptop and it's pretty decent for the money it costs
 
 
2 hours later…
10:43 AM
morning
 
Anonymous
morning
 
user1804599
11:10 AM
@Worf Oh my, that's even worse than your average Node.js code.
 
it's so worse that i wouldn't touch node.js not even with a 20 foot long pole
 
11:21 AM
Mornin
 
@Worf How to avoid this?) Use ready validators from frameworks?)
 
Anonymous
nope
 
I love try and catch, it does it job with this @dns_project
 
@dns_project idk, using hand grenades?
 
xD
 
user1804599
11:26 AM
Is there an RFC for attribute type hints?
 
How to make this work in php 5 ? 3v4l.org/Rn7T4
 
@rightfold What's that?
 
user1804599
Like, class A { public Foo $x; }.
 
@VeeeneX Write $tmp = $this->$where; return $tmp[$key]
@rightfold ah, no
 
user1804599
There was one for readonly right IIRC?
 
user1804599
 
@NikiC Thanks, btw php7 is amazing it works with this: $this->{$where}[$key], too.
 
user1804599
Doesn't say why it was withdrawn though.
 
@VeeeneX that worked also in php 5 :P
 
@rightfold Probably says it somewhere in here: markmail.org/message/7l3ci3sboma2nlzq ^^
 
or maybe i am an incompetent fool
 
11:35 AM
@Worf Why it outputs error 3v4l.org/kuu6i?
 
i am an incompetent fool :D
 
@Worf why? it works for all relevant version right?
 
oh yes it works with php 5.4+ :D so i'm not an incompetent fool :D
 
user1804599
PHP 5.4 is ancient!
 
Anonymous
5.4 is the best version of php I have used so far.
 
11:44 AM
@samaYo php7 \o/
 
user1804599
I like PHP 4.2.3 a lot.
 
Anonymous
aside from the said performance boost, what's new in from 5.6 > php7 is not akin to that of to 5.3 > 5.4
 
user1804599
5.6 didn't skip version numbers.
 
Anonymous
the leap to 5.4 was like the leap from tekken 2 to tekken 3
 
Anonymous
:)
 
11:48 AM
@samaYo yield from and Generator returns.
 
@samaYo 5.4 only added short array syntax, really
 
user1804599
And f(…)[…] (lol).
 
user1804599
Also traits though nobody uses that.
 
Anonymous
@NikiC refering to the backported features of php6. I thought it was 5.4.
 
Anonymous
@rightfold how about built-in web server
 
11:54 AM
@rightfold Traits are only useful in very specific use cases, but they're used.
 
@samaYo that's mainly 5.3
 
user1804599
@kelunik coooooool
 
@kelunik yeah, that's my one use case for traits as well ^^
 
The other valid use case I know are tests, because inheritance in tests sucks.
 
user1804599
Inheritance sucks in general. :P
 
11:56 AM
@rightfold Depends on the use case, but if you want to reuse code.. ;-)
 
user1804599
Inheritance is for is-a relationships, not for code reuse.
 
user1804599
Functions are for code reuse.
 
Yes, sure, just ignore that wording. :)
 
12:30 PM
 
user1648409
12:41 PM
Hi, what can i do, if "Object of class XXX could not be converted to string" occurs in a simple setter like $this->name = $name ?
 
@Shiuyin Do you own the object, as in, it's yours and you created the class?
 
user1648409
@Jimbo yes i did
 
user1648409
@Jimbo its a simple "model" class for holding some data in a given structure
 
user1804599
SSCCE.
 
Add an __toString() method that returns the name, but it seems like the problem you're describing is not actually because of the setter.
@Shiuyin The object is in the model layer, you don't need to call it a "model" class :-)
(makes no difference)
 
user1648409
12:43 PM
@Jimbo just added that for clarification reasons so you understand what i mean :D
 
user1648409
@Jimbo I dont think a __toString() would help here. I have about 4 of those model layer classes. Also i have a super class which has instances of those other 4 classes as attributes which i am setting via normal setters. I then can work with that structure like $mapping->getDocument()->getName(). So what i am trying to do (for example) is setting the Document of $mapping
 
good morning
 
user1804599
Make an SSCCE. Without one people can only guess why your program fails.
 
user1648409
nevermind guys - i found the mistake :D
 
user1648409
12:51 PM
thanks for your help
 
did you people see this
 
that's a really nice article everyone should read
 
user1804599
1:13 PM
no nested classes :( ideone.com/KMlpVB
 
2:02 PM
Mornings
 
@ziGi that's about 300 times cheaper than what I have
=)
 
2:23 PM
but is it as fast as the one you have
 
@RonniSkansing morning o/
 
2:36 PM
Hey @kelunik =]
 
Anonymous
2:48 PM
todays top laptop choice digitec.ch/en/s1/product/…
 
Anonymous
if this laptop supports virtualization, I'm going with it.
 
Anonymous
@tereško ping
 
just read the reviews
and I thing that they shouldnt call it it a "gaming laptop", because it obviously isn't
 
Anonymous
3:03 PM
@tereško would it be ok for programming though? I get the feeling a gamming laptop/pc is superior to a programming laptop/pc so, by that account alone, it should fare well for programming or atleast do better than the dell xps which only has dual core, 8gb ram, while this one has quad core, 16gb ram. So, I am not buying it for gamming but rather for the specs, but if I can play atleast more games in it, than the xps can handle all the better.
 
Anonymous
in other words, if someone had a gun to your face to choose between the two, which one would you go for?
 
how tethered will you be ?
because reviews say that MSI has issues with battery life
 
Anonymous
@tereško yes, I read that one, but that is for gamming (i think) for programing it should be more or less same as others. I don't have the need to play games on the go. I can do that at home. I only need one VM, phpstorm and firefox to last more than 5 hours while on battery.
 
@tereško you are popular in this chat)))
 
Anonymous
actually I don't see the point of playing games out of my home.
 
3:16 PM
@samaYo then I would go with MSI
but read some reviews
and take a close look at the keyboard, because that is not changeable for a laptop
 
Anonymous
yeah, I'll check it out.
 
user1648409
Hey guys - i am using $_SESSION["user"] = $name, to log in users. How can i check now, if a given user is online? Run a foreach on $_SESSION["user"] and check if the name is in that array?
 
@Shiuyin No. The contents of $_SESSION are specific to the current session (user) - they are not shared. You would need to store that information in a shared data store such as a database table
 
user1648409
3:31 PM
@AllenJB so each $_SESSION["user"] is stored in somewhat tmp dir on a users pc?
 
Anonymous
store in database user session/id with timestamp, and ajax to check if user session exists at the interval of 10 seconds, then update or remove session timestamp @Shiuyin
 
@Shiuyin No, it's stored on the server. But each session has its own identifier (which you can see in the php_session cookie on the visitors machine. The PHP manual explains how sessions work better than I can
 
user1648409
@samaYo Is there no other way than timestamps in db's to determine if user X is currently online based on the $_SESSION["user"] that is saved server side as AllenJB pointed out?
 
Anonymous
I had made a chat script using that trick 2 years ago, if only the src wasn't too crapy I would os it.
 
Anonymous
@Shiuyin yes, it is possible. But, I would not recommed it.
 
user1648409
3:36 PM
@samaYo why? :)
 
Anonymous
because I said so :)
 
user1648409
that not quite a good explanation :D
 
user1648409
my problem is that when an admin deletes a user, that user may be logged in currently. and even when deleted the session data stays and he can perform actions, so i want to unset() the session data - yet i need to check first if that user is currently online?
 
Anonymous
The only problem I see here is; not wanting to use a database.
 
user1648409
okok
 
user1648409
3:43 PM
got ot
 
user1648409
it
 
3:56 PM
@Shiuyin you put the timestamp of user's last activity in the database and consider all that are less than 2 min old as "online"
and you can do it even without registered accounts
 
I am new to PHP I have a lame question that cannot be asked in the questions section, When we add Javascript in the middle of the HTML it is called as a bad practice but is it bad practice to add PHP in the middle of PHP like,adding an error msg in the forms using PHP inside the form element?? Does using PHP extensively make our page slow ?? like Javascript ??
 
Anonymous
@CoDINGinDARK one word. JSON
 
@CoDINGinDARK the short answer is "it depends"
 
00:00 - 16:0016:00 - 00:00

« first day (1667 days earlier)      last day (3284 days later) »