« first day (699 days earlier)      last day (4239 days later) » 

5:01 PM
@Madara maybe SELECT * FROM courses FULL OUTER JOIN subjects ON courses.subject = subjects.id
 
@Olli You don't need an outer join
You only want the results that match
 
inner join?
 
(an INNER JOIN)
 
k
now the subjects.name gets "name"
so cannot easily know from what table it comes
 
@Olli Don't select *, select specifically what you need
Then you can name it whatever you want. Also, why do you care where it came from?
 
5:04 PM
ok.
 
@PeeHaa what is cv-pls ?
 
Sep 1 at 12:14, by hakra
Stack Overflow Closevote Backlog | Mirror 1 | What does mean: http://gist.github.com/1689430 | Chrome/Firefox Addon
 
@Olli cv-pls is the reason why "good" questions get closed and deleted :P
2
 
should i vote it for deletion
 
5:07 PM
So right now, I'm looking at: 2 days in Munich, 1 day in Florence, 1 day in Bologna, 1 day in Venice, 1 day in Milan, 2 days in Barcelona, 4 days in Paris...
 
@Olli No, for closing, but you don't have enough reputation for it
Casting delete votes required 10/20k reputation
Close/Reopen votes require 3k
That's why it's not that easy deleting questions
3 high rep users need to agree the question has no value
 
good that all of us in here agree :D
 
5:23 PM
@Madara now I have new problem
I have many courses for one subject
and would have them all in single line
how I could achieve this
?
 
lol
 
Hi Everyone :)
 
5:39 PM
people giving advice to learn a framework ... overkill for a beginner
 
is it correct to use AND like this SELECT * FROM courses WHERE subject = ? AND id = ?
I would like to select row where subject is ? and id = ?
 
Yes, why not.
 
@PeeHaa I would like to say 'Right click white space, select New and select Text file, then rename it to sitemap.xml'
But I'm afraid of flag :(
 
@Robik He wants to create a dynamic .xml file.
He needs to use PHP in an xml file.
 
Question did not include such cases.
 
SQL question: Can SQL be considered as Programming Language?
Because Wikipedia says so.
 
5:58 PM
no, it's not turing complete
 
@Robik You have to consider the fact his English skills are poor and then carefully read this sentence:
> Already, I can create sitemap.php but I don't know how can I create sitemap.xml.
 
I retract that statement
17
Q: Is SQL or even TSQL Turing Complete?

Matthew VinesThis came up at the office today. I have no plans of doing such a thing, but theoretically could you write a compiler in SQL? At first glance it appears to me to be turing complete, though extremely cumbersome for many classes of problems. If it is not turing complete, what would it require ...

 
touring complete?
 
@LeviMorrison Yes, I know. It was not serious.
 
is it possible to delete from database like that : DELETE FROM bug WHERE bugID='(2,4,8,5)'?
 
6:06 PM
You probably want to use IN.
 
oh ofcourse
stupid me
thank you
 
and not put it in quotes
 
i couldnt figure out why this wasnt working
tnx
 
Sometimes questions that are very localized are the only ones that interest me on StackOverflow.
Some people have interesting problems.
 
I like broader more "theory" based questions because there is more than one way to skin a cat.
I still want to know What makes a theme "Premium" but I got voted down.
 
6:29 PM
@SinthiaV I don't see that question
It's probably more suitable to Programmers or Webmasters though
 
user1125394
he please How can I try to json_decode a string and manage when it fails (the string is not a json)
 
> NULL is returned if the json cannot be decoded or if the encoded data is deeper than the recursion limit.
 
0
Q: How does MVC routing work?

Madara UchihaSo I've started studying MVC (real MVC, not framework MVC) a bit more in-depth, and I'm attempting to develop a small framework. I'm working by reading other frameworks such as Symphony and Zend, seeing how they do their job, and attempt to implement it myself. The place where I got stuck was th...

@cyril json_decode returns NULL if the parse failed
 
user1125394
k thanks
 
is there a sanitize flag for filter_var that will strip everything but alphanumeric and whitespace?
whitespace can be gone as well.
 
user1125394
6:44 PM
json_decode($test)==null or json_decode($test)===null
 
user1125394
is_null(json_decode($test)) .. better
 
user1125394
@rlemon like this in python ?
str = "0000000this is string example....wow!!!0000000";
print str.strip( '0' );
 
yea not even close
 
user1125394
I mean just put your regex
 
user1125394
^[0-9a-zA-Z]
 
6:50 PM
I was hoping for a flag
 
Thanks @PeeHaa
 
:)
 
And you couldn't at least upvote?
Everybody's a critic...
 
But I know these types of questions
Until I offer a bounty, nothing will happen
And when I do, lame answers would come up, and the bounty would have to be awarded to a question I don't want to award.
 
7:12 PM
@rlemon niiiiiiiiice SIMON.
 
@Robik Interesting.
 
user1125394
ipv6 will be a pain
 
user1125394
for local configs
 
@cyril It will be. But it makes 127.0.0.1 easier: ::1
 
user1125394
yes but fe80::abc:1:2:3
 
7:17 PM
I have a ipv6 book I have been trying to stomach ~2years
 
Example from Wikipedia: 2001:0db8:85a3:0042:0000:8a2e:0370:7334...
 
user1125394
it's like when you change license plates system
 
user1125394
the benefit will you can address every device
 
@SinthiaV lol wrong chat room but thanks
 
^-- That's funny :-P From the Wikipedia article about IPv6.
> This article may be too technical for most readers to understand. Please help improve this article to make it understandable to non-experts, without removing the technical details. The talk page may contain suggestions. (June 2012)
 
7:33 PM
Yeah ;-}
 
Should "Community wiki" questions be voted for closing them? (when there is a reason to close the question, of course)
 
@Jocelyn I would suppose so, otherwise people would make their questions 'Community Wiki' to avoid being closed.
 
user1125394
Is there something to tranform an array("green", "blue", "yellow") in array("green"=>"on", "blue"=>"on", "yellow"=>"on") quickly
 
@cyril you may loop through the first array and create a new array
 
user1125394
7:40 PM
yes if nothing better
 
user1125394
like an array_magicvaluesmap
 
Possibly.
 
there is better I think
maybe with array_map
or array_walk
 
<?php
$keys = array('one', 'two', 'three');
$values = array_fill(0, count($keys), 'on');
$result = array_combine($keys, $values);
var_dump($result);
?>
 
user1125394
7:44 PM
@ShaquinTrifonoff might be the best thx
 
@Madara It actually happened at wordpress answers wordpress.stackexchange.com/questions/63076/…. I was mistaken. It just didn't get an answer here.
 
is it possible to use the echo command to display certain files or directories?
 
@Beginnernato In what OS? Windows / *nix?
 
@ShaquinTrifonoff Linux
 
user1125394
7:49 PM
@ShaquinTrifonoff @Jocelyn I go for arraywalk finally thx
 
@Beginnernato What do you mean by 'display files or directories'? Display the contents of a file, or do a directory listing?
 
hey all.. how would I write a regex for letters(lower and capital), numbers, dashes, spaces, underscore and ampersand?
 
@ShaquinTrifonoff like what if I wanted to display all the files/ directory names (not content) starting with say, "the" followed by any 2 numbers In the current directory i am in. I'm thinkin echo the[0-9][0-9]* but it doesnt work
 
@Prefix $result = preg_replace('/[^-a-zA-Z0-9_& ]/', '', $text);
Should work.
 
7:56 PM
@ShaquinTrifonoff thank you :)
 
@Prefix You're welcome. codepad.org/sbQZAjyY
 
I am dying to understand html5 semantics and Wordpress-style widgets but no bites for that either.
 
basics of regex
7 videos but good for a start
 
hi ..anyone knows apache solr in php
 
2
Q: What is the semantically correct container for a sideber widget in html 5?

Sinthia VI have a page with no textual type content at all. It is a jquery header, two sidebars and a footer. The secondary sidebar is a dynamically generated column of plug-in Wordpress widgets. The sliders I love are html5, so I am taking the plunge. Here is the xhtml version: // Area 4 home secondary...

You can't have an aside to nothing!
 
8:46 PM
hm so I'm still having trouble with regex. I need to compare a username to a regex statement. The restrictions on the username are that it can only contain: letters, numbers, spaces, dashes, underscores, ampersands. No other symbols. I compare the username to the regex expression, if it != 1 then the username is denied. any help much appreciated :)
*sorry, by "compare the username" I mean run it through preg_match().
 
@Prefix if (preg_match('/^[-\w &]+$/', $username)) { /* valid */ } else { /* not valid */ }
 
@DaveRandom thanks for the help but that's coming up as invalid
with my test string
a to z A TO Z 0 to 9 2429 & - 1234 &
 
@Prefix Just fixed it, try again
 
Codepad doesn't seem to like preg_match: Warning: preg_match(): Internal pcre_fullinfo() error -3 on line X. If it didn't, I would have a working example now :-)
 
@ShaquinTrifonoff There is a problem with PCRE on codepad.org. Works on viper7
 
8:56 PM
YES it WORKS thank you SO much
been trying to fix that all day
:D
 
np
@Prefix Make sure you understand what it is doing though before you use it, if there's anything you don't get then just ask
 
honestly all of regex confuses me...
I try and avoid it when possible :/
would you mind explaining to me what the statement you provided does?
I'd like to learn :)
 
@Prefix Keep plodding on with it, you'll get it one day. It can be very confusing at first, I have been doing it for a long time and I still don't know 3 quarters of it.
OK, let's break it down:
 
Where do you get the Regex coming from?
 
^ asserts the beginning of the string
Everything in the [] is a character class
- & are just treated as literal characters
\w matches any Perl "word" character. It is a shortcut to writing [a-zA-Z_]
 
9:01 PM
-\w means all numbers/letters?
ahhh
 
\w matches all letters/numbers and also underscores
The + after the character class asserts that there will be 1 or more of them (so won't match an empty string)
 
@Prefix What is the source of the regex?
 
$ asserts the end of the string
and that's it.
 
well, it makes a BIT more sense now, thank you :)
I swear learning regex is like learning a new language entirely
*verbal, not programming ;)
thank you for the explaination!
 
No problem :-)
One thing to be aware of, - is technically a special character in a character class, either it should be the first character in the class or it should be escaped with `\`
Damn markdown, that's supposed to be a single backslash
 
9:07 PM
@Prefix I suppose if you are going to ignore me I will keep my idea about your problem to myself and you lose out. It doesn't pay to be rude to someone who wants to help you for free.
 
\
@DaveRandom --^
 
@ShaquinTrifonoff How did you do it?
@SinthiaV I provided the regex, see above
 
I already had a working solution, I thought I replied to you. My apologies, I did not mean to offend :(
 
15 mins ago, by DaveRandom
@Prefix if (preg_match('/^[-\w &]+$/', $username)) { /* valid */ } else { /* not valid */ }
 
Yes but where did you get it?
 
9:08 PM
I wrote it
 
@DaveRandom `\ `
 
The source
 
@ShaquinTrifonoff Nice one. Been trying to get that to work in comments for ages.
 
I wouldn't use a regex because I dont't understand them. I would use the string manipulation functions.
I missed the line before the code.
 
hey guys whats a short hand way to write '$key = $key*2' could i write '$key *= 2' ?
 
9:11 PM
@MattPsyK Try it :-) See? codepad.org/rTNwyYKy
 
I dont have a dev area atm :S
oh snap
Thanks
 
@MattPsyK No offence, but that's a serious
 
@DaveRandom, Well i was self taught, when you learn a language you kind of just stick to the easy to learn long terms, and skip over the shortcuts.
Ive always been told just learn how to do it first, then learn the shortcuts.
 
The only time I use a regex is for client-side validation. Something like strpos() is more straightforward to me.
 
@SinthiaV That would actually depend
Depend on the complexity of the string you're trying to validate that is
 
9:14 PM
@MattPsyK The first language I learned was VBA, where you had to do num = num * 2. It took a while to remember to do `num *= 2' in other languages (VB.NET, PHP).
 
And client-side has string functions as well
@MattPsyK $var *= 2 just made sense to me, I tried it and it worked, so I stuck with that :D
 
In all honestly ive only just learnt about += so my guess was the multiplication version exists as well, but i didnt have anywhere to test ( didnt know about codepad or anything similar )
 
@MattPsyK Best way to teach yourself how to do something is to RTFM and/or try it an see what happens ;-)
 
Exactly, there is more than one way to string a cat. If you don't like or can't figure out regex, then you don't have to. I don't have to very often at all.
Skin a cat I mean
 
@MattPsyK Well, there is also .= and -=.
 
9:17 PM
What's .= for?
 
concat shorthand
 
$string = $string . 'blah';
$string .= 'blah;
@MattPsyK These two lines are equivalent. --^
 
@MattPsyK String concatenation. It's like $str = $str."other string";
 
Ah i get it.
 
All of those assignment operators where the last character is an = do the same thing as the early part to the left operand rather than with it.
 
9:19 PM
@MattPsyK -= example: for($i = 100; $i > 0; $i -= 10) { ... }
 
So you can also do /=, +=, -=, %=, <<=, >>=, &=, |=, ^=
 
I think im going about my project the wrong way, i have an array which i'm trying to reassociate to have a kind of binary key?
Eg running from 256 512 1025 ... ect

Any easy way to do that? Instead of a foreachloop and just reassigning a new array?
 
@MattPsyK Prime candidate for bitwise operation. Starting from what value?
 
1
1,256,512 onwards.
Also any idea on how i style code in chat? I thought it was ' ?
 
user1125394
how to prevent a form submit to transforms '+' in %2B
 
user1125394
9:23 PM
+ are valid url characters?
 
user1125394
 
Looking at it now, you might as well just $i *= 2
 
user1125394
I'm using a simple html <form> <input name="stuff" value=this+is+test" /> and I end up with this%2Bis%2Btest in URL
 
<input type="hidden" name="stuff" value="this is a test" />
@cyril --^
 
user1125394
I had type="hidden"
 
user1125394
9:31 PM
so the space ok
 
@cyril It is, as long as the value is in quotes.
 
The browser deals with urlencoding when sending data back to the server. If you escape it it will be double-escaped. You need escape a full URL used in a src or href attribute and you need to make sure you htmlspecialchars() everything, but you don't need to urlencode form field values.
 
user1125394
@ShaquinTrifonoff @DaveRandom I'm looking for a non alphabetical separator, which will not be encoded in %
 
@cyril Well - will do - but why does it matter that it gets encoded? PHP will decode it on the server side
 
9:33 PM
@DaveRandom because my roles, for some reason, seem to skip 1 to 256 i had to use this...
$key = 1;
foreach ($_rolelist as $k=>$role) {
if($key!=1)
{$rolelist[$key] = $k;}
else
{$rolelist[1] = $k;$key=256;}
$key<<=1;
}
 
@cyril What is the hidden field for?
 
user1125394
well u'r right, it's stupid, it's just more visual
 
user1125394
@ShaquinTrifonoff putting a string separated list of my checkbox values
 
@cyril From the current form or a previous form?
 
user1125394
the current, I'm tranforming it before submit with jquery
 
9:35 PM
@cyril Most "SEF friendly" URLs use a dash, that's mainly for visual/readability purposes
 
user1125394
good idea
 
@MattPsyK Sounds like it might be easier to just have a static list
 
Most likely, but i just couldnt be bother to maintain the list, ive got the array just without keys.
 
I know this isn't php, but... Are 2d and 3d css transforms dependent on supporting canvas?
 
But i have over like 40 values that need keys.
 
9:38 PM
I think I have to shim it at the server side.
 
@MattPsyK Be aware that the size of the numbers will grow exponentially if you use that system. It also sounds like you are using, effectively, boolean fields to store relational data. I suspect you need an intermediate table in the DB
 
@cyril Don't do that. Use, for instance, name="values[]", for all of the checkboxes, and then they will be transformed into a PHP array.
 
user1125394
 
But then I can't use modernizr. Uh oh javascript alert.
 
user1125394
@ShaquinTrifonoff a right I saw that, but never tried thx much for the advice
 
9:40 PM
@DaveRandom The reason it has to be like this is due to the nature of the project. Im creating an app for eveonline which in the api uses those key values for its titles.
 
@MattPsyK The thing is you might as well maintain a static list since the system has no consistency - it just skips 7 bits at the beginning, then increments by 1. With irregularities like that already in the system, chances are more will pop up eventually.
 
user1125394
@ShaquinTrifonoff you saved me at least 2 Hrs ;)
 
Does anyone know a shim/polyfill for ie css transitions?
 
@SinthiaV I wish I did, it would be very useful.
 
hi gentlemen. I need some help writing the regex. I've no idea how to do it, and the only response that I received does not work. Can you please have a look here: stackoverflow.com/questions/12421422/…
please....
 
10:02 PM
@UnoMeinAme I'll have a look, but I can't guarantee that I will be able to help.
 
thank you @shaquin
 
@UnoMeinAme I've left a comment on your question.
 
it is annoying to see that as soon as someone posts a comment saying "Duplicate question", most people post an answer instead of flagging the question as duplicate...
 
@Jocelyn It's because they get +15 rep for an accepted answer, and +10 for each upvote. If rep was not earned, they wouldn't post an answer.
 
When a question is closed as duplicate, it should automatically remove the reputation earned by all answerers.
 
@Jocelyn That's a good idea.
 
10:24 PM
It would be an excellent way to stop that behaviour
 
@Jocelyn ...as long as it's within a certain period of time (say, a week after posting). After some time the rep should be locked and/or not be removed if the question is closed as a dupe of a newer question.
 
in the case I was discussing, it is a new question that is an exact duplicate of an older question
I posted a comment saying "exact duplicate of...", and 1mn later there were 3 new answers to the question
 
Some people just ignore the comments
 
@Jocelyn Oh yes I'm not talking about that specific case, it's just that there are a lot of requests that pop up on here for questions that are like 6mths old or even older, I wouldn't want peoples rep to be removed in that instance.
 
My comment did not get ignored, it helped them answer
@DaveRandom in that case I agree with you
 
10:29 PM
oh, sorry then
 
I'm already out of closevotes
 
"already"? There's only 90mins left of today :-P
 
@DaveRandom I'm saying "already" because I am still seeing lots of questions worth closing (in my opinion)
 
Yeah, but I guess removing rep kinda goes against the flow; maybe making it so that there's no answer to the question (as in, none of the answers can be picked), and link to the old question
 
there is some change here: stackoverflow.com/review
 
10:31 PM
Throw me a ;-)
 
"First Posts"
it got moved to beta
 
@DaveRandom I'd need more than 1 ;-)
 
Well you can as many times as you like without voting yourself, that's perfectly fine if you've run out of votes.
which reminds me
(my own stupid question)
 
you are cleaning your own questions?
 
10:35 PM
Only that one. It represents a moment of stupidity on my part and brings no value to the site.
 
http://stackoverflow.com/questions/12429400/i-need-drop-down-list-for-countries-and-cities
http://stackoverflow.com/questions/12429419/php-server-crashed-when-download-too-many-images
 
I Need A Tutorials Coz I Dont Know How To Start — Zeroic 5 hours ago
 
cv-pls?
 
I Need To Write In Title Case All The Time Because I Like My Text To Be As Unreadable As Possible
 
:-D
 
@DaveRandom that's interesting
 
@DaveRandom You really want your own question to be deleted?
 
@drderp the tag is used here to tell the people "Please have a look at the question, and vote to close it if you think it should be closed"
I saw the link too late
 
oh yeah i lost my ability to vote to close when i gave 50 of my rep away for a bounty :(
 
@ShaquinTrifonoff Sure, why not? It was a stupid question that takes a very long time to get to a simple point, I did not RTFM, and there are several dupes. I don't see it as bringing any long term value to the site.
 
10:41 PM
@drderp your current reputation is 406, you need at least 3000 to cast closevotes
 
@DaveRandom The answer-er would be disappointed, losing their +90 rep.
 
@Jocelyn Hmm, I was able to for some reason
 
@ShaquinTrifonoff I didn't think of that. Is it possible to retract a ?
 
@Jocelyn That's odd, oh well
 
10:43 PM
@Jocelyn I was just looking at that, I had only asked two questions so far and I hadn't voted on those I'm pretty sure... I guess I must be mistaken
 
What time do we get our new closevotes?
 
@Jocelyn Every day at +0:00 UTC, I think. At lunchtime for me.
 
OK. For me it is at 2am then
We are not exactly sharing the same timezone, @ShaquinTrifonoff :-p
 
@Jocelyn at 0:45? You crazy Frenchman you.
2
 
:-D
 
10:48 PM
Is it common for people not to read the whole question?
 
Futurama FTW!
@drderp Depends how long it is. If you write a really long essay it's a good idea to include a TL;DR because a lot of people wont bother
 
@DaveRandom it seems so, it's kind of annoying
 
@drderp Yes. Also common: not reading the manuals, not using Stackoverflow search engine before posting another duplicate question
 
@Jocelyn 1/2 the time it's probably because someone didn't read the manual...
 
There really should be an tag, most questions in really do need one.
 
10:51 PM
@DaveRandom Then we could retag questions with it :-)
 
almost everyday there is a new question about a syntax error in a mysql query, and the cause is almost always lack of escaping
@DaveRandom I had considered creating this tag
 
@Jocelyn ...or unquoted reserved words
 
@Jocelyn ... and the function that is throwing the error is mysql_query.
 
but this tag would probably be considered offensive
 
@ShaquinTrifonoff why do people still use this
 
10:53 PM
thank you @DaveRandom it works like a charm
 
@drderp Because most online tutorials teach them that.
 
@Shaquin true, and it is a shame
 
We would have to create heaps of PDO tutorials to push the other ones off the results.
 
there are so many outdated or dangerous tutorials
 
@ShaquinTrifonoff There should be a not-terrible tutorial for this stuff
 
10:54 PM
@UnoMeinAme No worries, it does have some potential holes, which hopefully should be fairly obvious from the comments/spacing
 
Compile a bunch of tutorials on how to do stuff in PHP right, and then publish it, and make the site popular
 
such as tutorials saying you should use addslashes to escape data before using it in a query
 
thanks shaquin for your help as well. didn't notice your comment when you posted it
 
@drderp this site already exists, it is called php.net
 
@Jocelyn apparently, php.net isn't popular enough
 
10:55 PM
ircmaxell proposed something like that, separate from the main php.net, hang on let me find the link
 
works like a charm! /me happy
 
/me ?
 
How can i search by random existing number in mysql which is not an id?
 
10:58 PM
@JamaicaBob ORDER BY RAND() LIMIT 1?
 
can i use rand as where?
where something=rand()?
 
post your query so we can see better
 
@DaveRandom His idea seems simple enough, but I don't know if the PHP community would be too happy about it
 

« first day (699 days earlier)      last day (4239 days later) »