« first day (1072 days earlier)      last day (3892 days later) » 

10:26 AM
@MadaraUchiha a signature provides authenticity of the commit
 
@zerkms Okay
@zerkms And? :P
 
@MadaraUchiha uhm...
what do you want to hear more?
 
@zerkms Would I want to sign every single commit I make?
Are there disadvantages to this approach?
 
@MadaraUchiha how would some one know it was your code?
How would you prove it was you who provided a commit?
How would you prove the content of commit hasn't changed during some malicious actions?
 
@zerkms So I do it when I might need to prove that I made the commit?
 
10:31 AM
@MadaraUchiha that's what authenticity means, yep
it means that the commit have been made by someone who has access to your private key
usually it's only you :-)
 
@zerkms Okay, so is there any downside of making it a standard of mine to simply sign every single commit and tag?
 
I don't think so
if only you don't work with someone who just doesn't like it :-)
git-signature-phobia :-)
@MadaraUchiha when it was a kernel.org hack several years ago, they checked the authenticity using signatures
 
@zerkms I see
 
@MadaraUchiha if they didn't have it - they would have to check every single line of code in every diff
 
Morning
Did you figure out how to change your editor for git @MadaraUchiha?
 
10:34 AM
@Fabien Yeah, it was like you said eventually
I misread the documentation :D
 
Ah cool. I actually had to install Notepad++ to use as an editor myself. Notepad didn't handle EOL's. WordPad was crappy and PHPStorm was too heavy
 
Doesn't msysgit come with vi or something very vi-alike?
 
yeah cim
oh wait windows install of git did
which came with msysgit so I am unsure
 
Hello Everyone!
Is anybody there?
Can any one please give me some ideas for my final year project?
 
@Fabien it actually comes with vim
 
10:38 AM
@JoelKidd Wellcome :)
 
@KamranAhmed Thanks! :D
 
Ah I thought so. I wasn't sure if it was just the Windows GUI or not.
 
@JoelKidd No problem :P
 
@Fabien so presimably you don't need anything else
 
@zerkms It doesn't load vim when using cygwin
 
10:39 AM
If I want a RESTFul API I have made to be only accessible from a iOS app, is there anyway I can do that? Eg, I don't want people on the web to be able to call it, I only want people that are using the app to call it (through a UI obviously)
 
At least it didn't for me
 
Is http auth the best way?
 
@KamranAhmed llvm plugin to convert php into c++
"Eg, I don't want people on the web to be able to call it" --- it's not possible
 
Ahh I see ok
I can add brute force protection though right?
So they can't spam it
 
what do you mean by "brute force"?
they can just take credentials from your app
and use them
 
10:41 AM
Spamming the API thousands of times so that it slows the server down
 
@zerkms thanks.. But I want to develop a pure web based project like some innovative idea related to PHP that you might have?
 
Is what i mean by brute force
 
@KamranAhmed innovative idea...... Let's see. How about a blogging service that allows only posting a short messages limited by 100 characters?
 
Twitter.. cough :p
 
@JoelKidd put "please don't perform too many requests here" label on your server
 
10:42 AM
Ok thanks
 
@JoelKidd really? Haven't heard of it
 
Hahahaha XD
 
@JoelKidd my point is - if someone has some "innovative" idea - you barely will get it
 
Right sure
I'm working on an innovative idea atm, or have been for the last 6 months :)
Building the first live public bus tracking equipment in the UK :D
 
@JoelKidd just create something that scales horizontally and uses queues. It always looks impressive
 
10:43 AM
@zerkms again thanks. But how about some innovative plus challenging task. As it'd be my final year project for FYDP...
 
@JoelKidd there is no one yet?!
 
@zerkms Yes, there is but none of the data is available to the public
 
@JoelKidd Hmmm.. Just the idea that I have had to implement in PAK
 
@JoelKidd who they provide the data to then?
 
Well you'd be implying that you'd have to build your own tracking device
Which is where we come in
We have contacts with local councils
Who have access to ticket machines with GPS's in
We connect to them, rip the location and put it in a sexy UI
Obviously it's a little more complex than that
Got to go now.. nice talking to you guys
 
10:46 AM
@JoelKidd nice talking to you too :P
Although It was just a single message :P
@zerkms what do you do?
 
@KamranAhmed drinking a lemon tea
 
lol, I mean for living?
 
Writing crappy and hard to maintain code
 
OMG, checked your site cv.zerkms.com and have become your fan :O
 
it's actually very obsolete and doesn't include a lot from my current 2 places
 
10:51 AM
Hmmm
May I ask, how did you get your self hired at oDesk, I mean you are from Newzealand and oDesk is from....?
 
oDesk's HQ is in usa
I just got an invitation to interview one day
and I was living in Russia those days
 
Hmmm nice!!
 
and an interview was quite funny. After some personal questions they said there will be no technical part since they already see I'm good enough for them
 
Nice!
I have just chosed to go for the web development in my career..
Will you please give me some advice?
 
As teresko said 21h ago
 
10:56 AM
*advices
 
21 hours ago, by tereško
@Simon_eQ learning PHP is easy, learning programming is quite hard
so just be a good developer
the advice that always works: read A LOT
read other people's code. Try to participate in other products development
 
@zerkms Can you give me a super secret account that automatically wins freelance jobs? Thanks in advance ;)
 
@Fabien :-S
 
What do you say about landing to a job at some reputed organization like you did?
 
@KamranAhmed actually your first and second jobs mean a lot in becoming a professional
so to become proficient it would better to become to a company that does its job well
not just to a company with a name (because you may get into department that produces some shitty code)
 
11:01 AM
It's unfortunate to say, but currently I am working in part time for such an organization :(
 
My first was job was not a good one, now in my second and it's a lot better but still probably not the most fantastic for learning. I had zero experience so I had to accept the first one :)
 
@Fabien the same is the case with me :P
@zerkms why don't you use facebook? O.o
 
@KamranAhmed I do have an account there
 
Can I get your username please?
 
guess it
 
11:04 AM
Wouldn't linked-in be more what you're after? -_-
 
already tried facebook.com/zerkms
it didn't work :P
 
@KamranAhmed "didn't work"?
 
@zerkms I mean didn't find you there.
 
@KamranAhmed it's not possible
 
Does anyone have a good example of MVC PHP application?
 
@zerkms found ya. Actually I was logged out!
 
Checked my feed. There is nothing interesting there
 
Don't you use it often?
 
Don't use it at all
 
I see this works too graph.facebook.com/636774153 yet I haven't found a random value that works yet :P
 
11:08 AM
@Fabien facebook shares the id's across the entities. So you put any entity id there. Like image's id
 
Ah
 
@Fabien found an example: graph.facebook.com/10151509108346729
 
That an image ID?
 
Yep, that's a picture from this album: facebook.com/media/set/…
This is it facebook.com/…
 
Sure seems like a lot of easy information.
 
11:15 AM
yep, and without authentication
 
Private albums are still private though.
 
I would be surprised if private albums were available
 
any1 can help me wd rewrite?
 
Discussion for all things PHP - Don't ask whether someone is here to help you. If someone is around and wants to help they will.
 
"any1" - no1
guys, grow up, "any1" isn't cool but lame
 
11:22 AM
@zerkms is that what's called facebook's graph API?
 
@KamranAhmed what do you refer to?
 
that facebook link graph.facebook.com/10151509108346729 you posted?
 
@KamranAhmed yep, it is a graph API
 
http://localhost/category.php?category=grocery

i wanna show content from category.php bt wanna rewrite the url as http://localhost/grocery

is it possible without .htaccess?
 
@AshikRahman yes, it is possible
oh, without
 
11:24 AM
how may i get help?
 
what is the reason to avoid using convenient tools?
 
@AshikRahman If you're on Apache, I doubt there's a way without .htaccess
 
i tried

if ((n=location.href.indexOf("/category.php")) > -1)
location.assign(location.href.substring(0, n) + "/<? echo $category;?>");
 
what is it?
 
11:27 AM
js
bt it seems redricting to the directory
 
.htaccess is the file into which you put settings, Alias / RewriteRule is the setting
 
and how is it related to apache setup?
 
@zerkms what can we use it for I mean it doesn't show anything except shows the name gender link etc?
@zerkms, again I am talking about Graph API
 
so "without .htaccess" => yes, put it in the config file (httpd.conf, or included from there)
 
11:28 AM
@zerkms thanks.
 
@zerkms its not related to apache

its javascript
 
@AshikRahman is it the second question?
 
It was really really nice talking to you, maybe we would talk another time!
May I add you on LinkedIn?
 
Not sure
 
"Not sure" about me adding you or talking to you?
 
11:30 AM
adding
 
And may I ask. Why is that? :/
 
Why would I?
 
i jst wanna get the value of category in category.php bt wanna show the localhost/category.php?category=something as localhost/something
 
Just to be friends, if you'd like. Otherwise it's OK -_-
 
use mod_rewrite, Luke
 
11:32 AM
monring
 
@KamranAhmed LI isn't about friending, it's not the FB
 
OK. No problem
 
@zerkms "LI isn't about friending" Pretty sure that's how a lot of recruiters use it these days.
 
@Danack you are not required to follow that weird trends :-)
 
mod_rewrite is settings of .htaccess isnt it?

i wanted to know is it possible wdout .htaccess?
 
11:35 AM
@AshikRahman what is the reason to avoid .htaccess?
 
coz im newbie and dont know how to do tht
 
omg
 
good luck then
 
so no1 to help wd tht topics!! :(
 
11:38 AM
The first rule to get an answer - start writing proper english
 
may b thts a bad qstn
 
amagad.
 
is it? @zerkms
 
The question by itself isn't that bad
but:
1. you're using terrible language
2. you're limiting yourself with no real reason
you were given an advice to learn something about .htaccess and mod_rewrite, but you decided you won't follow it
 
@zerkms Stop talking to tiny avatar people...
 
11:40 AM
oh yah which 1 is terrible to u man?
 
so - if you know it better, not sure why you're expecting more help here
@MadaraUchiha yep, I will from now on
@MadaraUchiha btw, your answer got the 6th upvote (mine) already
... with no answers though
 
@zerkms I know
I'll wait a couple days before adding a bounty
This actually has the potential to be quite the rep whooper
(Not that I care much, I'm actually interested in knowing :D)
 
2 things that make me angry today:
1. accident pressing tab when you're reading a reeeeeeeeeeeeeeeeeeeeeeally long html (which scrolls you up)
2. When an opensource product maintainers don't reply on bug reports
 
@zerkms Press spacebar to scroll back down by an equivalent amount?
ooh - no.
 
it is really long
 
11:44 AM
btw thnx guys for the helps
 
so after you lost your position - it will take some time to scroll back
and they don't paged version :-S
 
I know that feel - but still a first world problem.
 
Oh I see a solution
you just click on every header as soon as you start reading it
and it will be an anchored link
 
@zerkms why are you pressing tab in the first place?
 
@MadaraUchiha it was assumed to be a ctrl-tab
with ctrl not pressed fully
 
11:47 AM
afternoon chaps ...
 
monring @JoeWatkins
 
moin @PeeHaa
 
Hello Joe
 
Hi @Fabien
 
A question: how many messages is required for everyone to congratulate everyone
 
12:07 PM
morning @Joe and @PeeHaa
 
moin @NikiC
 
morning @NikiC
 
@AshikRahman there are two parts to making a pretty URL: 1) if you load the "ugly" URL, redirect to the "pretty" URL; 2) if you load the "pretty" URL, serve the right content
@AshikRahman JS can help with (1), but not with (2)
for that you need something on the server-side, which is what mod_rewrite is for
heh, too late
anyone suggest the best place to ask this (or know the answer?):
is there a reason for Exceptions to capture all the arguments in their stack traces?
or is it just an implementation detail?
because it has some unpleasant side-effects
 
12:26 PM
@IMSoP What are those unpleasant side effects?
 
1) it prevents the refcount of anything used as an argument in that stack from reaching zero
apart from the obvious memory disadvantages, this can prevent destructors from firing in the expected order when using the RAII Pattern
2) it means that Exceptions can't be reliably serialized - the Exception itself is serializable, but the stack trace might include objects which aren't
 
E_USING_EXCEPTION_FOR_PROGRAMMING_LOGIC
 
for instance, if a SimpleXMLElement was passed in as a parameter somewhere in the stack, serialization fails, loudly
 
Why would you want to serialize an Exception? They are fundamentally tied to the stack that produced them.
 
Yeah, serializing an exception doesn't make sense to me
 
12:30 PM
@Danack it's not the exception that's being used for programming logic, it's the destructor
i admit serializing is kind of edge-case-y, but if so, Exception should deny it directly, not allow it then break sometimes based on hard-to-predict factors
i was using it in a "poor-man's threading" implementation: farm a callback off to another process, and capture the result; to make it more transparent, i wanted to re-throw exceptions in the parent process
 
Yeah - don't do that.
However there may be a bug still in that demo.
 
yeah, RAII and memory management is the bigger issue
i can see the occasional use for debugging
 
The destructor should be called before the "Unsetting..." shouldn't it @NikiC ?
 
@Danack it can't if it's used in the stack trace
otherwise you'd get some kind of wacky null-pointer-error
 
The stack trace is stored in the exception which has lost it's reference by the "Unsetting" shirley ?
 
12:35 PM
@IMSoP I can see that it's a bit ugly, but I don't see how it would make a practical difference
 
no, i stashed it in $stored_exception just to extend its life a bit
 
ah fark. - missed the bit where you're storing it.
/gets more coffee
 
@NikiC it means that a set of destructors will fire in a different order depending on whether they were used as a parameter somewhere vs just a local variable
@Danack to be fair, i made a typo in that sample which may not have helped; corrected 3v4l.org/ME4i8
slightly better example: 3v4l.org/RQuZd
 
I'm going to go back to E_USING_EXCEPTION_FOR_PROGRAMMING_LOGIC then.
 
@Danack and i repeat that it's the destructor which has the programming logic
it's just that that programming logic suddenly behaves differently in the presence of exceptions
even without storing the exception: 3v4l.org/Yr7AR
there's no logical reason for $not_a_parameter to fall out of scope before $parameter
i dunno, it just seems like this is a pattern people often suggest for RAII and as an alternative to finally, and this makes it really unpredictable for no apparent gain
 
for instance, if you used RAII to claim a lock of some sort, it's hard to predict whether the lock will be released when an exception is thrown, or after it has been dealt with
 
@IMSoP I think in PHP people just don't care
 
@NikiC well, they should :P
 
We have little use for fully deterministic destruction
 
well, it's a non-GC language, destructors are normally deterministic, and that's a Good Thing
in that it allows patterns to be adapted from other languages with deterministic destructors
 
1:02 PM
@NikiC how did the compile time vs runtime conflict with conditional definition work again?
 
I fear I screwed up by deciding not to sleep on the plane over. Really hurting now. 1 hour left until next flight..
 
Sleeping on flights is tough.
 
@igorw hm?
 
1:25 PM
when using mysqli prepared statements, do I need to make the connection again each time I use a prepared statement? It seems like I can only get it working once in a page... or maybe I'm having a variable scope issue. New to doing it OOP way instead of procedural
 
@red6 No - you can reuse the connection. You probably need to close the previous statement though.
What error message are you seeing?
 
@Danack Undefined variable: mysqli
except I defined it on an include that worked for one function and not the other
 
"defined it on an include" - you mean like "include 'database_connection.php'"?
 
@red6 Then you've just got a simple programming error.
 
@IMSoP yes
@Danack methinks
 
1:29 PM
@red6 That's most likely a scoping issue
 
:11938630
 
yay 3 pings
 
yay...
 
@red6 don't do that; global variables are a pain to debug - as you've just discovered
 
Guys, I'm after some simple advice. I'm using a <textarea> and saving to a database. There will probably be line breaks in the content entered. I'm wondering what the best was is to cope with this. Would you trim, strip tags and then save, and when calling the data use nl2br() or perhaps insert paragraph tags with a regex?
 
1:31 PM
@IMSoP well I started this app doing it procedurally rather than OOP, and a header include for the DB connection seemed to be how it worked before. So I went through and rewrote enough stuff to use mysqli prepared statements and just converted things in place
 
what does ":11938630" mean? is that a question number? you have to paste the URL
 
@Dan Don't trim, strip or whatever before storing it
 
@PeeHaa What about storing any harmful data?
 
Just use prepared statements and bound params and store it
 
I don't know much about security, but I thought some of this was necessary?
 
1:31 PM
@PeeHaa yes, that's what I am doing. I ran into the error above, hence the questioning.
 
No it isn't @Dan
@red6 Your issue has to do with variables out of scope or horrid global state
@red6 pastebin your class please
1911
Q: How can I prevent SQL injection in PHP?

Andrew G. JohnsonIf user input is inserted into an SQL query directly, the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO table (column) VALUES ('" . $unsafe_variable . "')"); That's because the user can input s...

And when you are going to display the data use htmlspecialchars()
 
@Dan escape only as necessary for the context you're using the data: pushing into a DB, SQL-escape it (or use parameterised queries); echoing to an HTML page, HTML-escape it; etc
strip_tags would mainly be useful if you were displaying it in plain-text, e.g. in an e-mail - not for security of any sort, but just because it will look nicer than a load of HTML source code
 
@red6 your connection() function returns something, but you're not assigning that result to a variable
> $connection = connection();
> $mysqli = connection();
or whatever you want it to be called within the makedropdown function
 
ohhhhhhhhhhh yeah. ::smashes face on table::
 
1:44 PM
@red6 there's also a neat trick to let you reuse the connection with only a few lines of extra code, by using a "static variable"
 
Anonymous
@PeeHaa Is using traits to import settings for a class a bad idea?
 
@Simon_eQ what would "settings" constitute?
 
@Simon_eQ I don't like traits for most things. So I would say no
You most likely just want to inject it
 
Anonymous
 
Anonymous
and injected those to the class
 
Anonymous
1:46 PM
I am not sure what traits are used for
 
Anonymous
so, I got confused in the process
 
Sorting out folder structure for lamephp.com. I have an application folder and a library folder. Application I presume should only contain stuff which actually makes my site run? So if I have a common functions file that should sit in the library? Or better yet, know any good places to read about directory structure of websites?
 
@Simon_eQ Traits == copy paste
5
 
@IMSoP that broke more things
 
@red6 hm, i'm not familiar with mySQLi; maybe there's more housekeeping you need to do between statements
 
1:49 PM
I reverted back to what I pasted, but the while loop is never executing at all
I did a var_dump on $mysqli in the makedropdown function and every value is null...
 
@red6 you have the $mysqli = connection(); line in now, though?
cos without that, you ain't going nowhere
 
Anonymous
@PeeHaa does that nonsense about one-file-per-class apply to traits too :p ?
 
@Simon_eQ really trust me you don't have a need for traits in the code you just shared
 
Anonymous
@PeeHaa Nope, I have extended it. I found it to be really helpful, to import settings to the main class pastebin.com/7u7ajn59
 
shivers
 
1:55 PM
@IMSoP yes, it cleared the error, but it's accomplishing nothing atm... im trying to see where its getting lost here
 
@Simon_eQ that looks like data to me, not implementation
 
Anonymous
that is why I don't trust you. You shiver so easily :p
 
You only have to use traits when you have for example some method which does exactly the same in multiple classes
And even than you most likely still don't need / want traits
 
@red6 one thing i notice is that your connect() function has a procedural call to $mysqli_connect_errno(); maybe try $mysqli->connect_errno instead? not sure if the two styles can be mixed like that
 
Anonymous
too late I pushed it :p
 

« first day (1072 days earlier)      last day (3892 days later) »