« first day (1769 days earlier)      last day (3194 days later) » 

3:01 PM
anybody know what is the problem of my query ?
`update users set reputation= reputation+2
where users .id = users.(SELECT user_id FROM comments WHERE comments.user_id=new.comment_id);`
 
It's users.(SELECT. You're trying to combine an alias with a subquery
take the users. out and it should work
 
@Machavity like this: user.x (select ...) as x
?
 
@Sajad where users .id = (SELECT
 
ahaa
 
141
Q: mysql update join

RickyI asked a question and got this reply which helped. UPDATE TABLE_A a JOIN TABLE_B b ON a.join_col = b.join_col AND a.column_a = b.column_b SET a.column_c = a.column_c + 1 Now I am looking to do this if there are 3 tables involved something like this. UPDATE tableC c JOIN tableB...

 
3:04 PM
assumes that your subquery returns a value
 
@tereško tnx :-)
 
I assume that's what you were trying to do there
 
@tereško ow, one question: In your opinion, I create a column on Post table named Total_votes and update it via trigger, or I use of SUM() for each post ?
 
@Mr.T is an error reported or just no date echoed out?
 
@Sajad have a "totalVotes" field
 
3:08 PM
@Orangepill please take a look to this ^ !!!
 
@Sajad doesn't change my opinion
 
@Orangepill look, I learned from you several things. and thanks for them. but I have searched, and I'm sure, in this case, trigger is better
anyway thanks for your attention
 
@Orangepill was it about the "caching thing"?
 
@Sajad trigger isn't really better… it depends on how effective your cache is (how often it gets invalidated etc.)
 
When is PHP7 coming out? :D
 
3:12 PM
@teresko he's caching an aggregate of a dependant table on the parent record
 
also known as "denormalization"
 
@Orangepill I get the following: $article_date_date = DateTime::createFromFormat("d. M Y H:i T", "09. Aug 2015 19:30 CEST"); echo date("Y-m-d H:i:s O", $article_date_date);
this is what echo does: 1970-01-01 01:00:00 +0100
 
@Mr.T what does article_date_string have in it
 
@Mr.T try sprinkling it with var_dump()
 
sorry updated it
var_dump($article_date_date); Output is: bool(false)
 
3:16 PM
@Mr.T don't use date to output... use $article_date_date->format("Y-m-d H:i:s O");
 
So, is there any sane way to model a system that is comprised of "transactions", which when applied chronologically yield an "entity"? Consider a series of property set/unset actions, and the aggregate result of those actions is the current state of the entity it represents.
 
@HassanAlthaf Mid November
 
Any sane way to design this? And by sane I mean, reasonably performant and comprehensible.
 
Damn, thats still a long while to go. @Machavity :?
 
@HassanAlthaf For such a major shift in the PHP universe it's pretty quick
 
3:18 PM
@Mr.T I think your environment doesn't understand the CEST
 
@DanLugg you mean something like "activity diagrams"?
 
@tereško Maybe?
No
 
@Mr.T I was able to reproduce that result on 4v3l.org using a nonsensical value instead of CEST
 
hmm .. I will try to read that sentence few more times
 
but if I do echo date('d. M Y H:i T'); I get 20. Aug 2015 17:19 CEST
 
3:20 PM
@DanLugg If you asked this guy he would say just resolve all the events, using stored snapshots if need be to make it performant.
 
I mean, modelling state as being persisted as a series of transactions.
 
(sorry I don't have a better resource on that.).
 
@Danack So basically, cache current state
 
@DanLugg "chronologically" ?
 
@DanLugg sounds like map/reduce
 
3:21 PM
@tereško Yea, in order of creation.
transaction on <date> by <user> {
    set property1 = true,
    set property2 = 42,
    set property5 = "foo",
}
transaction on <date> by <user> {
    unset property2,
    set property4 = "bar",
}
 
where map can be memoized
 
@DanLugg Not necessarily current state - like take a snapshot each week and so to get the current state you only need to replay this weeks events on top of last weeks snapshot.
 
@Danack Ah, okay.
 
@DanLugg what language is that? :P
 
@HassanAlthaf I will call it Flibble, and it shall be good.
 
3:22 PM
@Danack added to "watch later" queue
 
Hey there. Advice needed. I'm making a basic blogging platform (just a personal project, nothing serious) and I really would like users to have some control over their blog themes/templates. I know how to write a parser so creating one is not an issue. Though, I've read on the net that using a self-made parser for template files is a terrible idea. Though would it be an issue if the user would only be able to work with very limited data and only a few loops hence not abusing the server?
 
^^ Likewise; no sound atm
 
Though people are likely to die...
 
@deadsource would using a client side template engine like mustache be an option?
 
@DanLugg Sounds like a one-to-many thing. One record for your Transaction and a table full of changes to the transaction that link to that record. Assuming I understood the question at any rate
 
3:25 PM
@deadsource that way you can dodge the issue entirely on the server side.
 
@Machavity Yes, following a relational model that'd work.
 
I need a gif for when the popular culture reference I have just made is actually older than a significant number of people I'm talking to....
 
But the problem is data types, etc; I'd need a looser persistence implementation like JSON database (I think)
 
sqlite?
 
@Danack Benny Hill would probably be appropriate then
 
3:26 PM
Although, data typing has never stopped anyone from TEXT-ing all the things in MySQL/Maria
 
@Danack "pepperidge farm remembers"
@DanLugg you have json fields in postgresql postgresql.org/docs/9.4/static/datatype-json.html
 
@DanLugg … this sounds suspiciously like event sourcing and CQRS.
 
Almost friday
 
"The data is unsigned 64 bit numeric; what datatype should I use?"
"Use TEXT"
 
@RonniSkansing LOL. What's on Friday? :P
 
3:29 PM
@LeviMorrison @Danack linked to a relevant video
 
@Orangepill I guess client sided means that you send the template and the data and fill the template with data on the client side. The concept is pretty strange to be honest. Also that wouldn't go well with search engines. Is this method commonly used?
 
Okay the error is in that $article_date_string but I echo it and it is 09. Aug 2015 19:30 CEST. So what is wrong? I create that string by node.getAttribute ('title')
 
And a new episode of mr robot .. ☺
 
@Danack Open the zip and do.
 
3:31 PM
 
@deadsource it's the new hot thing for single page application... if seo is a concern then it probably is not a viable solution
 
@LeviMorrison Aaaand now better understanding event sourcing, I believe its exactly that.
 
@DanLugg I was thinking to myself, "That request is so specific it's like he actually formed the question knowing the answer."
 
@Andrea Mmm, EMACS Lisp... and I love how Objective C just ends
 
@LeviMorrison lol, quiz time!
 
3:33 PM
@Machavity weird
 
@Andrea Java ftw lol
 
I did pretty much give a plot summary of ES too, lol
 
@Andrea php seems to exude a "don't give a fuck" attitude according to that chart
 
@Andrea CSS #6? :o
 
I'm familiar with the idea of event sourcing but I have never implemented it nor have I used it.
 
3:35 PM
@bwoebi Lah bootstrap is one of the popular CSS projects my boi. :P
 
Seems like a really good way to design many things.
I can think of several systems here at work where doing them this way would be beneficial.
 
@HassanAlthaf well… but #6…
 
@LeviMorrison Built-in audit trails are a cute feature too
 
@DanLugg Yep.
 
@bwoebi Imagine the number of things you can do in CSS, and think about how much popular websites are now these days in comparison to desktop applications.. :P
 
3:36 PM
@Orangepill Well, let's say I still want to parse the template on my server. So should I write my own parser? Or try finding one that is specifically aimed at giving users the ability to customize their themes/templates?
 
@bwoebi people write a lot of crappy and long css files .. and they are part of every web project
 
Event Sourcing is the best. ^_^
 
Can't wait for iPhone 6S to be out. :P
 
@tereško well…
 
I am just surprised they did have a separate "jquery" position there
 
3:38 PM
lol
 
@bwoebi all the static sites on github.io
 
In that case jQuery would replace JS on place one ;)
 
hehe
 
@deadsource I don't know of any template engines that target the end user as the template creator you might have to write your own.
 
Why is DateTime::createFromFormat ( "d. M Y H:i T", "09. Aug 2015 19:30 CEST" ); working with the direct entered string "09. Aug 2015 19:30 CEST" but not with the var $article_date_string??
 
3:40 PM
@deadsource you could use a client side template for design that can also be rendered on the server side. like github.com/XaminProject/handlebars.php
 
Damn.
No more internet. :(
 
I have always found it to be a strange mentality for apple users
they always want to buy the latest thing .. and not because they actually need it
 
Who said I want the latest iPhone? :P
 
they have to be iCool
 
I am happy because the prices of old iPhones will drop. :P
Hopefully iPhone 6+ drops to something like 60k so that I can buy it. :)
 
3:43 PM
/me is running around with a 2 year old android flagship and it's on par with all the new flagships
 
What phone?
 
xperia z2
 
i'm running a 2 year old samsung flagship .:p
 
@deadsource in theory that would let you author and manipulate the template on the client but then upload the template and run it on the server.
 
Samsung Galaxy Note 3. :P
Note 5 will be out this year.. and will be officially 2 flagships old for the Note series.
 
3:45 PM
samsungs for long time have had a very "cheap" feel, even thought the internals are alright .. oh .. and the bloatware
 
I still regret for not choosing the iPhone 5S.
Eh, Samsung phones are decent.
But the software... :/
In terms of software and design, iPhone Ftw.
I am so desperate for an iPhone that I'd exchange for an iPhone 5S straight right now.
 
the physical design for sony is pretty nice and the software is 99% vanilla android
 
I know.
Sony has got beautiful designs.
But when it comes to Android,
Samsung ftw.
 
@deadsource and handlebarsjs template format is easy enough that anyone familiar with html would be able to pick it up pretty easily.
 
also, I have played around with all iphones since 3th
 
3:47 PM
guys I Need help... no idea why that is not working :(
 
they always feel extremely brittle
 
brittle?
 
as if a smallest bump might make then shatter
 
Eh, ever since I got this macbook
 
Anonymous
@Mr.T Copy / Paste your code somewhere for someone to take a look :) pastebin etc..
 
3:49 PM
probably because only phones at work with cracks were the iphones
 
I only love apple. fk other brands.
 
.. oh .. so you are one of those people
 
Of course, you can't take an iPhone to work.
 
@Mr.T sourcing from a variable vs a literal shouldn't make a difference... double check that your literal and variable are the same (might be some unprintable characters in the variable one)
 
Although I feel ripped off for the hardware I received for 200k,
I really love the software it comes with, i haven't really experienced lag in this.
 
3:50 PM
how much is that in USD/EUR ?
 
Let me convert.
Oh I forgot, I can't use google lol. I am out of internet. You can just google LKR to USD or EUR
and place 200k
Nvm, it loaded. It's like $1500 USD.
 
@Orangepill well could be, because if I var_dump that var it is two more than it should be...
 
Holly shit! And is that their new macbook? I mean the glorified tablet
 
@Orangepill Hm, I actually dig your idea to generate the actual website on the client side as then the server would be safe (at least safer) than giving users the ability to somehow create infinite loops and such. Though I really think that bloggers might want search engines to index their posts. Would making an /archive/ directory of their blogs that would be safely generated on the server side do the trick somehow? Or do search engines not work in that manner and wouldn't index them?
 
the string
 
3:51 PM
I would never pay that much for a phone unless it had a never ending whiskey dispenser on it
2
 
This laptop comes with a retina display, 8 GB RAM, Intel Iris Graphics card, 128 GB HDD, 2.6Hz Intel Core i5.
 
@tereško if you have free time, please check out this
 
I clearly see being ripped off to hard.
@Sajad Are you trying to create a clone of StackOverflow and compete?
 
@HassanAlthaf yeah, there's 300$ brand fees ^^
 
@bwoebi And you know what? My laptop screen size is only 13 inches.
lol
 
3:53 PM
@HassanAlthaf it is no related to "compete".
 
What?
 
@deadsource you could detect crawlers and offer up an alternate version of the site with the content rendered in a seo friendly template... that way the template authors wouldn't have to worry about accounting for the seo properties in there own templates.
 
Whatever you say doesn't really make sense. You should take some time and also learn an oral language called "English."
 
@HassanAlthaf I created a question on SO for solving my question, just that.
 
@HassanAlthaf if that''s the new MacBook, then the CPU is not actually 2.6GHz .. or to be exact, it cannot sustain taht speed because of the shitty cooling and gets throttled extremely fast.
 
3:54 PM
@Sajad I was just joking a bit.
 
Hello guys.
 
@HassanAlthaf ok
 
@tereško Nah, it is a 2014 Mid MacBook Pro.
I got it back in 2014 October.
 
I don't actually recall the 2014th model's specs. It might be decent
but way too expensive
 
@Orangepill But I heard that search engines "hate" when you show them different pages that what users see and might even blacklist the site for such activity. I remember reading this a good 5-6 years ago so something might have changed. Probably I should Google for this.
 
3:57 PM
@Orangepill well, I paid 650€ for mine. That's about 200€ per year, if the next year's phone lineup is as unimpressive as this year
 
@deadsource It's called cloaking and it's frowned upon, but there's ways to do this without using that
 
I have a menu which changed dynamically, but the issue raises when I select a menu not selected by default, so that I have to select again that menu. I am working on PHP.
 
@Orangepill thank you very much!!! Solution was to $article_date_string= preg_replace('/[[:^print:]]/', '', $article_date_string); before parsing. Source(stackoverflow.com/a/8781968/1414315)
 
@deadsource with the popularity of single page apps and client side "MVC" type constructs there must be a endorsed way to present the site to crawlers
@deadsource stackoverflow.com/questions/18530258/… may be helpful
 
uh
we can't run assignments with php -r?
i.e. php -r "$foo = 'bar';"
 
4:11 PM
'"' . $content . '"'
<script type="text/javascript">

	var x = "nothing";
	var phpContent =
	"<?php
		$content = "<script> document.write(x); </script>";
		echo $content;
	?>";

</script>
why wont this code work
i am trying to put script inside of php inside of script
 
@FlorianMargaine We can
 
@Orangepill Somehow that link you posted seems like an advanced cloaking technique. Though you said that cloaking is frowned upon, so that means it's not entirely a bad thing? Need to Google some if that's the case
 
Take care about your quote types
Bash does string interpolation as well
 
duh
php -r "\$foo = 'bar'; echo \$foo;"
that works
 
what do u mean NikiC
 
4:13 PM
@NikiC yeah, forgot that
 
I just use single quotes
 
I am lost
on all of it
 
Though iirc on windows it's the other way around and you have to use double quotes ... or something like that
 
??
<script type="text/javascript">

	var x = 'nothing';
	var phpContent =
	'<?php
		$content = '<script> document.write(x); </script>';
		echo $content;
	?>';

</script>
so like that??
 
@SharathZotis Sorry, those messages weren't referring to your code
But I don't get what you're trying to do there
 
4:15 PM
oh ok
 
Your code is equivalent to this:
<script type="text/javascript">

	var x = 'nothing';
	var phpContent =
	<script> document.write(x); </script>

</script>
And that doesn't make much sense, does it?
 
yes
howev er I need to integrate php
because this is just sort of a "test"
I am working on another project that is very complicated that requires script to be nested in php which is nested in script
 
doesn't eval() execute php?
 
I am trying to make this simple code work so I can implement in my complex project
 
@SharathZotis I feel like this might help: stackoverflow.com/questions/13840429/…
 
4:18 PM
so anybody have some thoughts on how i do this
 
You seem to have some misconceptions about how PHP and JavaScript interact
 
@deadsource this might provide an endorsed means to accomplish what you want
 
Yes I agree
 
I know javascript is client side
and php is client side
basically the dilemma i am in right now
 
4:20 PM
javascript in a javascript
`?
 
I need to run a sql query in php with the .innerHTMl of a javascript variable
 
thats invalid js syntax
 
@NikiC I prefer single quotes in the php code
 
wait let me rephrase
I need to run a sql query in php with the content of a javascript variable
 
@SharathZotis The google term you are looking for is AJAX
 
4:21 PM
@SharathZotis In that case you should look into AJAX
lol
 
I'm tempted to do a pull request to it with an empty lex file
 
@Orangepill I need to better think about what I actually need to search about. I went directly to check if I can cloak websites instead of "How to make AJAX websites SEO friendly" or something like that. Thanks for all your input. I especially like the client-sided generating of the website's layout. I wonder how that never had crossed my mind (probably because of my ancient understanding of SEO if it can be said like that).
 
does anybody know ajax
 
4:24 PM
@Orangepill Say, is there some sort of system here that I can "reward" you for your input? I'm new to this chat.
 
must people in the room @SharathZotis
 
@deadsource No need to but I appreciate the offer.
 
so how do I go about passing a javascript variable to php in the same .php file using ajax
 
@Orangepill Thanks again. Have a nice day c:
 
@SharathZotis from the browser you can do a ajax request (sending the clientside data) to the server (php) and send a response back again
(which is the javascript part)
 
4:29 PM
@Ro
@Ronni
 
SO did it. 10M questions stackoverflow.com/10m
 
@ Sh
@SharathZotis
 
@RonniSkansing will ajax keep the javascript on same page as php
because i need script and javascript in same page
 
@SharathZotis the javascript is executed in the browser
 
and php is actually nested into script
 
4:30 PM
the php is executed on the server
the server sends back a request
 
so do I just add the ajax code into my script??
 
hmm
you want to send php from a javascript to the server
and then execute it on the server?
What will stop anyone from sending evil code to the server?
 
other way around
I want to send javascript variable to php
then execute a sql query with that variable
 
Few seconds ago I clearly heard ping from here. Am I going crazy or just random bug?
 
ok, like find user with id 4
and you want to send like id = 4 to the server?
 
4:32 PM
no like
<script> var x = 10 </script>
then i send variable x to php
where
 
mysqli_query( Select user where id = x
 
you should make a new project to learn the basics
make like a index.html (with html and js)
 
a test.php
in the js (in the index.html) you can make a ajax request to the test.php and get data send (like the x variable)
 
4:33 PM
hi
 
ok
but is there anyway where i can have everything in one file
 
Hey @HassanAlthaf
 
Sup @RonniSkansing
 
have that html and js in the index php
 
@SharathZotis yes, but you should not do that, it is bad practice
@HassanAlthaf just got home from work
 
4:34 PM
I already have it set up that way
 
you @HassanAlthaf ?
 
@RonniSkansing Just finished dinner and got back on my laptop
 
@SharathZotis try writting some code to make a ajax request
wb
 
ok
<script type="text/javascript">

	var x ="hi"

</script>
ok so thats my index.html
where do i write ajax request
in index.html or php file??
 
in index.html
 
Anonymous
4:37 PM
I found a bug in php, it turns out php was the bug :/
 
Time to get #SOreadytohelp tag trending on Twitter.
 
ok
how do i write ajax request??
so I am requesting the php file???
 
read the material... then read it again .. then attempt to do what you want and then ask any questions you have
 
@HassanAlthaf I looked abit on your page, do you want feedback here?
 
4:40 PM
@SharathZotis look at the links I gave you earlier
 
@RonniSkansing Yeah, sure man. ;)
 
and yes you a requesting the php file
 
user895378
morning
 
Mornings
 
@HassanAlthaf I like the top, its minimalistic, clean and nice. But I do not think the rest of the page follows that clean cut design, the rest is missing all the air/space around it.
Mornings rdlowrey and PeeHaa
 
4:42 PM
Hey @RonniSkansing
 
MGE
Hello I'm trying an INNER JOIN for the stats of some events. The problem is that, when there are not codes for an event, it can't get anything. I want to get values to 0 when an event have not codes
SELECT  events.id as eventid, COUNT(codes.id) AS sales,events.name AS eventname,SUM(codes.passes) AS passes,SUM(codes.amount) AS amount,events.currency AS currency,events.date AS eventdate FROM codes INNER JOIN events ON events.id=codes.eventid WHERE events.property=:idproperty GROUP BY codes.eventid ORDER BY codes.id DESC
 
@rdlowrey @peehaa \o/
 
@RonniSkansing Where about exactly?
 
MGE
I want to get the eventname as well, and the rest of values to 0
 
@rdlowrey @peehaa o/
 
user895378
4:43 PM
@Orangepill Two-hand wave. Well done :)
 
@MGE then you want a left join
 
@HassanAlthaf the About me
 
@RonniSkansing Oh.. It's difficult to design that part... :L
If I remove those side parts, it gets ugly like sht.
 
MGE
@Orangepill with LEFT JOIN returns the same
 
yea, I myself is real bad at design, you might need some help from someone with more design experience
 
MGE
4:44 PM
0 records
 
<script>
	var url = sample url;
	var flag_to_set = value of the flag;
	//use $.get or $.post or $.ajax if you use jquery. For traditional javascript use  XMLHttpRequest. You will get code snippets for the same. I am using jquery $.post for the same as example.
	$.post(url,{flag: flag_to_set},function(data)
	{
	// callback for success.
	}
</script>
 
Yeah, okay. Let me check.
 
is that good for the index html file
 
are you using jquery?
 
MGE
@Orangepill left join return:
 
4:46 PM
of course he is using jquery :D
 
MGE
eventid
sales
eventname
passes
amount
currency
eventdate
NULL
0
NULL
NULL
NULL
NULL
NULL
 
@NullPoiиteя =p
 
@MGE switch the order of the tables in the left join and think you are going to want to group on the events.id instead of the codes.eventid
 
MGE
yes, solved, there is any option to get NULL as 0?
 
ugh, everything got an update today
nginx, php, root certs, tmux, mysql
 
4:50 PM
@MGE COALESCE(fieldname,0)
 
@tereško mysql, nginx and tmux should be fairly painless.
 
I am running irssi on my VPS
 
switch to znc
 
I don't think it's the same functionality
I am not using VPS to (only) hide my real IP
 
MGE
@Orangepill thank you very much
 
4:57 PM
also, I really don't like the irssi's windows port
 
@tereško znc is a bnc... so it's always connected, and you connect to it using any irc client
 

« first day (1769 days earlier)      last day (3194 days later) »