« first day (1497 days earlier)      last day (3444 days later) » 

12:27 AM
0
Q: Non-empty categories and their subcategories

yodaRight now, I use the below function to create a dropdown menu, which work flawlessly compared to primitive in-loop MySQL queries used in the past. How can this function be optimized/modified to return only non-empty categories and their subcategories? Category 1 (omitted) Category 2 |___Subc...

 
1:23 AM
3:5
:<
 
1:45 AM
how can i create a mysql query where i can fetch data by dividing two columns then doing a less than or greater than operation. so it would be "column1" / "column2" as "division" where "division" > 25 or something like that
 
 
1 hour later…
2:49 AM
morning
 
morning
@Leri can you help me out?
 
3:11 AM
morning
 
3:22 AM
I just want to tell Johannes Schlüter he's being a complete douchebag on the list.
But if it comes from me I'm the dirtbag.
:/
 
The application I'm working with has two columns (firstname and lastname)
However, I have to do a full name search on the DB. What I'm wondering is, if I want to search for "Joe Smith", it wouldn't return anything because "Joe" would be in firstname and "Smith" would be in lastname
So how should I go about this? Is there some SQL keywords that I don't know about that would help me here?
 
@AndreaFaulds Also on the subject of silly Internals behavior, Yasuo and Stas going off on security in safe casts...
 
It's friday...
 
@DemCodeLines whats your query
 
@LeviMorrison So weird why Yasuo couldn't just link to here: standards.iso.org/ittf/PubliclyAvailableStandards
 
3:34 AM
Hey, @Ja͢ck!
 
@this.Tony SELECT * FROM (SELECT mem_id FROM members WHERE LOWER(firstname) LIKE '%$search%' OR LOWER(lastname) LIKE '%$search%') WHERE ROWNUM <= 10
 
Yo
 
That query works right if $search is Joe or Smith but not if Joe Smith
 
It's been a while, mate.
How're you doing?
 
Not too bad, considering that I'm still doing iOS stuff ;-)
Just came back from down under
 
3:36 AM
@DemCodeLines You should split the search joe smith and do a query for first_name = %like% and last_name = %like%
 
@this.Tony what do you mean split?
 
@DemCodeLines
$seperator = explode(' ', $full_search_text, 2);
$first_name = "%". $seperator[0] . "%";
$last_name = "%". $seperator[1] . "%";'
and just input those variables into the query
first_name = $first_name And last_name = $last_name
 
but it would break if the user only enters "Joe"
 
do an if statement
if $seperator[1] isset then do this query else do this query
so your checking if there is two words in the seperator if there isnt it goes and does 1 word query
 
How about when you search for "Smith Joe" ? :)
 
3:40 AM
@Ja͢ck what do you mean
nvm lol i get you then nothings comes up
people search names from people they know lol
@DemCodeLines let me know if it works for youi
 
yup, just a second, trying it out
 
how can i create a mysql query where i can fetch data by dividing two columns then doing a less than or greater than operation. so it would be "column1" / "column2" as "division" where "division" > 25 or something like that
 
@this.Tony unless you're working with chinese names where they put the surname first ;-)
 
@Ja͢ck thats a problem lmao
i would flip create two querys with the names fliped than combine the query data and remove duplicates
 
I've always wanted an excuse to use Solr
 
3:43 AM
@Ja͢ck solr?
 
Yup, Solr
 
nice seems useful
@Ja͢ck can you help me out with making a query
?
 
weird, for a second i read that as "can you help me make out with a query" ..
 
ahahahaaha
 
well, you could synthesise a name column comprising of both first and last name and then apply full text search perhaps?
 
3:47 AM
no not that query
something like this
how can i create a mysql query where i can fetch data by dividing two columns then doing a less than or greater than operation. so it would be "column1" / "column2" as "division" where "division" > 25 or something like that
 
WHERE column1 / column2 > 25? I'm not getting it.
 
ok so im going to divide column 1 and column 2 and whatever that outputs i want to check if its lower than 25 or any other number
 
And what's stopping you from doing just that?
 
how would i do the query
 
3 mins ago, by Ja͢ck
WHERE column1 / column2 > 25? I'm not getting it.
 
3:53 AM
ok wait let me test a query out real quick
@Ja͢ck so i dont know what im doing how can i do division after the where clause in a query?
 
what do you mean by 'after' ?
or, how about you create a sql fiddle and show me
 
i tired to make an sql fiddle i fail
but what i want to do is SELECT * FROM somedata WHERE column1/column2 > 25
i want this query to select all the rows that the mathematical problem corresponds to
 
@this.Tony , do it, i am blessing you
 
4:10 AM
i did it my first sqlfiddle
ok the reason im trying to divide then compare with a greater than or less than operator is because i want to get the top rows
 
@this.Tony well, with the given data that query is empty, because there are no records that have 25 times more likes than dislikes.
What exactly are you trying to express?
 
no try 3 not 25
im trying to do a low number
not a high number
 
okay, so then you get one row.
still not sure what the problem is.
 
whats your query?
 
4:15 AM
11 mins ago, by this.Tony
but what i want to do is SELECT * FROM somedata WHERE column1/column2 > 25
That, but with the name changes and using number 3.
 
nvm im an idiot
i had the query right all along
 
That's quite likely.
 
but im so not concentrated due to this football game im watching.
 
@this.Tony , turn off
 
sorry for wasting your time guys
i thought that query wouldnt work because ive never done that sort of division and equal then less than, math problem on a query
 
4:19 AM
morning
 
morning
 
morning
 
friday
 
 
2 hours later…
6:19 AM
Helllo Guys
i have a problem in php
how we change send email appears under primary Tab in php
 
@AkashDeep describe your problem in detail...
 
i am send email to user using php and in user gmail id there are three option now . 1. primary 2. Socail 3. promotion. my email show in promotion tab . i want to change it should be show in primary tab
@DipaliPatil can u help me ?
can any one give answer ?
 
I think that is not php issue.
You need to know how gmail filters those letters.
 
6:35 AM
my client want . if user get email in his account then it should be in parimary tab
 
explore gmail filters.
 
nothing found
i have facing these issue from last one week
can anyone solve my problem ????
 
no
 
7:00 AM
morning
 
7:11 AM
0
A: HHVM: pthreads PHP classes

Joe WatkinsZTS is a prerequisite of pthreads. ZTS is not used as the default because ZTS mode has some overhead associated with it. The HHVM documentation is just a clone of the php-doc repository, restyled, with some additional sections added for HHVM, this is why the pthreads documentation shows up in ...

hhvm need to get their own documentation ...
 
i am send email to user using php and in user gmail id there are three option now . 1. primary 2. Socail 3. promotion. my email show in promotion tab . i want to change it should be show in primary tab
can anyone else tell ?
 
you need internet jesus ...
 
What's that?
 
I'm saying there is nothing you can do to affect how gmail categorizes your email, other than the obvious, try sending from a different email address ...
 
7:31 AM
posted on November 21, 2014 by kbironneau

/* by chenkTheTank */

 
@AkashDeep I notice that all the regulars often trap under promotions
 
7:49 AM
hey
can you tell me whats wrong with my code
$curPage = $_SERVER['REQUEST_URI'];
if($curPage=="/about-us/ || /documentation/ || /contact-us/ || /news/ || /nuovofima-documentation/ || /norgen/ || /max-seal/ || /herion/ || /jerguson/")
{
echo "";
}
else{
echo "<a href='#colophon'><img src ='/wp-content/uploads/2014/11/filter.png' class='filter' width='35'/></a>";
}
 
it's awful?
 
"/about-us/ || /documentation/ || /contact-us/ || /news/ || /nuovofima-documentation/ || /norgen/ || /max-seal/ || /herion/ || /jerguson/"
wow
 
it can't be?
 
@winresh24 what you are looking for is php.net/manual/en/function.in-array.php
 
my code won't work?
sorry im just a newbie dont know yet to use array :(
 
7:56 AM
yeah , well , get some book about PHP
my recommendation is: wrox.com/WileyCDA/WroxTitle/…
(yes, it's about pretty old version, but you won't be using the "new feature" for months and months)
 
can I ask why is my code not working?
 
because that's not how "or" operator works
 
what you mean? or?
 
moin
@winresh24 You dont ask why stuff isnt working if you don't know the basics mate. Learn about arrays. Come back when you understand them.
 
lol
thats why im asking bro
 
8:00 AM
Your question is the equivalent of me walking in a car garage and asking them why my car isn't working whilst I took half the parts out.
 
okay your the chosen one
sorry for being a newbie
 
Thats not it buddy. If we explain you what is wrong with the code. We will have to show you how to fix it. If we show you how to fix it, we will have to show you -why- we fix it that way. And that last bit.. is exactly what books do.
But hell.. you caught me in a good mood. I won't explain what is wrong with your code.. except that hard-coding url's is.. nasty.. at best..
But what is not working is the if statement there.. you are comparing $curPage with a string that contains everything between the ""s there
$pages = array( "/about-us/","/documentation/","/contact-us/","/news/","/nuovofima-documentation/","/norgen/","/max-seal/","/herion/","/jerguson/");

if( in_array($curPage, $pages) ) {
....
}
that would (probably) make it work. Now go read about arrays.. asap..
 
I already fixed it
btw thanks for your help
 
We need some auto filter here that filters people that want to learn from people that want to "fix" ..
 
8:09 AM
There is one already - your mind
 
Vote on PHP"7" Timeline: wiki.php.net/rfc/php7timeline#vote
10
 
haha
morning
 
Good morning.
 
8:27 AM
good meurning :)
 
Morning @Naruto, How are you?
 
Good afternoon :D
 
Good Afternoon @SuperBear, How are you?
 
Is @MikeM. a bot ? :)
 
No @DamienOvereem, I am not.
 
8:38 AM
Anyone good with Opencart?
 
I'm sure there is. , somewhere..
 
@Mik
china
 
What @SuperBear?
 
Yes , I'am.
 
@MikeM. fine thx, how are you? (Have you been drinking? :P)
 
8:41 AM
@SuperBear Sorry I didn't get what you mean. If you asked if I am from China then no I am not :)
I am fine thanks for asking.
And no I haven't it's friday morning I am at college being bored XD
 
@SuperBear I'm stuck in a module.
 
@3not7 it's like playing with fire!
 
@Mike M.oh, I'm come from china.I'm at college to..
what module? @3
 
@SuperBear I am from the netherlands.
 
what module, @3not7?
 
8:44 AM
You really don't want to work with opencart. Just saying...
 
Shipping module, created by myself. couldn't get a variable from user side.
 
you can show your code at here.It's so many experienced programer, but not me.:D I'm just learn to everyone.
 
No, you can't paste your code here. You might post a link to it (pastebin, gist etc...) but don't expect any serious response.
 
I think we forgot to put that rule on the chat guidelines
 
8:50 AM
Nobody reads those
 
basically in general: don't expect any serious response. It can happen, but certainly don't expect it to happen.
 
Rofl
 
I ment the serious response bit @HamZa :)
 
in Lounge<C++>, Nov 19 '13 at 18:53, by Etienne de Martel
> And please, for the love of all that is nice and fluffy, don't act like we owe you something. You'll get flamed to death.
 
@DamienOvereem What would the rule be? Don'ts 11. Be serious about a question related to wordpress or opencart.
 
8:52 AM
K, i got it guys. Currently i didn't have this work online. soon will be. Thanks anyway
@HamZa, why i don't want to work with Opencart? Any specific reason, do share
 
Morning
 
Good Morning @Fabor, How are you?
 
Fine thanks
 
@3not7 because I tried to work with it once and it was crap. There was no API for example which I needed.
 
Exactly, it doesn't have any help at all online.
 
9:00 AM
are we talking about magento?
 
@FlorianMargaine Nope
 
@FlorianMargaine opencart
 
ah, my bad
meh
it was a joke wrt this:
2 mins ago, by 3not7
Exactly, it doesn't have any help at all online.
 
@MikeM. start writing crazy program if your bored..
 
Hello can any one give me a code where i can use ajax data load on datatable
 
9:02 AM
@Naruto even developers don;t do that
@AkashDeep no
 
@AkashDeep no, google it
 
page not found
:P
 
I wrote magenta lol
 
LOL
 
Can we create a synchronous website using XHR request/
 
9:03 AM
WordPress and code igniter enough
 
@HendryTanaka yes
 
@jitu how are those to examples of terrible code and bad practices related to anything ?
@HendryTanaka we can .. you .. well ... the jury is still out
 
@tereško Some people think that WP == 42
 
@FlorianMargaine How it work? I've read some lecture and I didn't get it
 
btw, there is a huge difference between "a synchronous" and "asynchronous"
 
9:08 AM
@HendryTanaka I don't really know what you want to do...
 
@FlorianMargaine I want a simple example using XHR for sync site. Any suggest/
 
hell no
 
@Gordon already on it
 
9:11 AM
(y)
 
I star only things that I like
 
you never star anyone, do you?
 
I actually do
 
@tereško second thursday this week for you? :)
 
yeah
but on the other hand, there was a 4-day weekend
 
9:13 AM
yes, that was nice
 
holy shit, he's latvian
 
thought you knew
 
nope
i kinda tend to not pay attention to nationalities online
 
@Naruto I am working on my admin account registration for my installer xD
Sorry for the late reply.
 
This room ain't big enough for two Latvians ಠ_ಠ
 
9:16 AM
Anyone see anything weird in this: "<div class=\"Error\">".$errors."<br />".$key." is not filled in!</div>"
 
What is this?
 
my eyes
 
oh wait I got it, derping me.
 
@Fabor oh no it's not!
@MikeM. why do you use double quotes + escape double quotes if you use the concatenation operator? (.)
@MikeM. using single quotes you won't have to escape doubles
 
Whos Latvian?
 
9:19 AM
ye, who's latvian?
 
The reason I escape the double quotes is this: <div class="Error">ReEmail is not filled in!</div>
 
@MikeM. '<div class="Error">'.$errors.'<br />'.$key.' is not filled in!</div>'
 
The issue was: "<div class=\"Error\">".$errors."<br />".$key." is not filled in!</div>"
 
moin 2
 
should have been: $errors."<div class=\"Error\">".$key." is not filled in!</div>"
 
9:22 AM
could it be "<div class='Error'>".$errors."<br />".$key.''is not filled in!</div>"?
 
It can be but then the layout would look like different
 
@Fabor your avatar is uhmmmm... Rey Mysterio?
 
lol
 
I rather keep by the mind: single quote is for char, double quote is for string.
 
9:23 AM
@iroegbu Is that mysterio mask?
 
I wouldn't let contents decide if you use single or double quotes. There is actually a difference between them.
 
@MikeM. I think it's not wise for PHP
 
Since you use double quotes.. you might aswell do "<div class=\"Error\">$errors<br />$key is not filled in!</div>"
 
Indeed but I get confusing by that layout @DamienOvereem
 
@DamienOvereem true, using double quotes and concatenation is strange
 
9:25 AM
And for the fun of it.. parsing double quote strings is actually slower then single quote strings :)
 
@DamienOvereem this performance is not even worth thinking about
 
PHP will check for variables in a double quoted string... it will not do that for single quoted strings. Marginal gains, but still :)
 
I rather keep my variables showing darkish blue in the editor and not bold, it's just a personal preference.
 
@tereško Ahh...didn't get it. Any tutorial link with simple language?
 
o.o.. now your editor is deciding how you use quites ? ..
'<div class="Error">' . $errors . '<br />' . $key . ' is not filled in!</div>' This is the proper way imho.
 
9:27 AM
@HendryTanaka what exactly do you want to make ?
 
@DamienOvereem Read my message correctly
I rather keep my variables showing darkish blue in the editor and not bold, it's just a personal preference.
 
Here is a language with a simple tutorial @HendryTanaka! lolcode.codeschool.com/levels/1/challenges/1
 
@tereško Simple chat apps
 
the message was not about the quotes.
 
9:28 AM
Same thing though... deciding your conventions based on how your editor displays colors is.. just plain weird..
 
@DamienOvereem thanks
 
@DamienOvereem As I said it's a personal preference.
 
"simple" and "chat app" are kinda the opposites
 
I wonder if he's going to write his app in lolcode now :)
 
@DamienOvereem I rather see: i.imgur.com/0SM2cm7.png then: i.imgur.com/rtwnKjQ.png when I am developing.
 
9:30 AM
@tereško Just lead me to a simple example and let me advance it, thanks
 
Ofcourse.. and that is why you use '<div class="Error">' . $errors . '<br />' . $key . ' is not filled in!</div>'
 
@DamienOvereem I didn't get you
 
@HendryTanaka first step: make that chat without javascript
 
I don't really see the problem....
 
simple form, where people can post messages and see the messages that have been previously posted
 
9:32 AM
Discussions are a bit sub-par atm. I'm off to do some work.
 
2nd step would be using XHR to post the data instead of full Post/Redirect/Get process
3rd step would be to create to create a method, which requests the latest messages using XHR
 
@MikeM. no worries, I'm working aswell, what are you working on?
 
basically, bottom line is this, @HendryTanaka: there will be no "simple tutorial" because what you need are 3 incremental steps to create something like this
well .. to create a basic functionality
also, if you are just now learning about XHR, making a clone of SO chat might be a bit too complicated for you
 
someone is googling XHR right now.
 
@tereško Thanks for your inspire advice
 
9:37 AM
I really recommend for you to play around with MDN examples
 
well webchat is like ajax guestbook + (long polling | web sockets)
 
@Naruto Some educational/personal project called SimpleBB
 
posted on November 21, 2014 by kbironneau

/* by DoubleD */

 
it seems Remi Collet is serious about taking care of fpm
a great thing
he even added tests...
finally
 
9:41 AM
the Safe Casting vote is really not going my way. Hmm.
 
@AndreaFaulds well, it actually is 3 agains 3
 
@FlorianMargaine i agree :)
 
because rasmus, stas and derick always vote against everything
 
I didn't know we could write tests now :P
 
9:44 AM
Yeah, apparently we can :D
 
@MikeM. show us? :)
 
neh
 
@AndreaFaulds have stas or rasmus said anything ? (derick already explained)
 
Rasmus hasn't said anything, nor has Stas.
Though maybe Stas did in the original thread
Yeah, Stas said stuff in the original thread.
 
10:04 AM
Good morning
 
morning
 
Maybe Rasmus will come and talk about how he invented (int) :p
 
question: I save some values (id's) in a session array, is there a way to say get me all items from db where ID NOT IN () without using NOT IN?
normally I use join to solve this, but this time I don't have 2 tables to join, just data out of a session
 
@Naruto What's wrong with NOT IN?
 
10:12 AM
@Naruto answer: you can not use NOT IN on array
 
@AndreaFaulds performance?
@AlmaDo foreach() create NOT IN ...
 
@Naruto just use NOT IN in the database
 
@Naruto I can't think of a faster alternative
 
ye it's an SQL question... :P sorry
@AndreaFaulds mm damn, ok guess it's my only option here then
 
your "performance" impact will be on network side (sending result array) because NOT IN by primary key will be literally a momentary search
 
10:15 AM
@AlmaDo NOT IN also is slower looking up data on the SQL side then when you can use a JOIN
 
@Naruto that's not true
and strictly depends on context
 
Yeah, in this case NOT IN will be faster than creating a table to JOIN on :p
 
yeah ok.. But in the context of getting data out of 2 (or more) tables it is..
 
10:29 AM
 
10:39 AM
Mornbo
Completely forgot how awesome virtualbox+vagrant+puphpet is.
 
Context : php5.5, phpstorm8, phpunit3.7, xdebug from CLI. Question : I see that assertInstanceOf() succeeds for an interface, which was not implemented by tested instance class. In debugger I see that $object instanceof InterfaceName is null. But is_a($object, InterfaceName) shows false. Why?
 
hi guys
I have a question.I have no experience in mongodb so might be biased but is there any reason why one would decidde to use php with mongo over php with mysql?\
 
@Gotalove the easiest example is when you have a lot of okay-to-lose-data coming in and not a lot of read occurs. web scrapper for example
 
so its a bad idea to use mongo over mysql
in php
@nikita2206
 
@Gotalove Because it's incredibly fast and also (all the reasons NoSQL is better than relational - google for these - good for certain contexts)
 
10:48 AM
@Gotalove Most of the time yeah. Also look into postgres
 
You're comparing apples and oranges, they each have their merits and reasons for use depending on what your needs are
 
@Jimbo the thing is - lately it has become very popular (well until about half a year ago, now people start to bash it) to use nosql just because it's cool and you don't need to "waste" your time with designing your schema
which is pretty bad at least because if you don't design your schema properly you end up badly
 
@nikita2206 just some guy has a project start and he sent it to me and I open it up and was like f*$% why is there mongo in here and he sent me sql files too so was abit thrown off at why he would use mongo
thanks for the info
 
Obligatory (didn't see it posted yet): MongoDB is web scale
 
lol
 
10:58 AM
@AllenJB this video was how I first heard of mongo a couple of years ago
used it once after that :D
 
@AllenJB hahaha this is 1 very awesome video
thanks
made my afternoon right there dude
 

« first day (1497 days earlier)      last day (3444 days later) »