« first day (406 days earlier)      last day (4542 days later) » 

2:14 AM
anybody here?
 
 
3 hours later…
4:49 AM
Here I am again :)
This time I need to configure PHP to use a remote SMTP server for sending email.
But according to the docs this option is only available on Windows.
 
 
2 hours later…
6:48 AM
Hello everybody
How are you all
?
anybody there???
Hello??
i think nobody here
we can make it a popular chatroom like yahoo chat room for the PHP programmer
can we?
are you all agree with me
?
Hello
uffff.......
bye
 
7:25 AM
this was just sad
 
 
1 hour later…
8:29 AM
guys i am using jquery v1.7, which i use to open tabs and here is what i am using
<script>
$("#galery").live("click", function(){
$("#menu_div1").load("<?=ROOT_PATH?>ajax/div_opengallerypages.php?user_id=<?=$user_id;?>");
// document.getElementById("menu1").load("t.php");

document.getElementById("menu_div2").style.display='none';
document.getElementById("menu_div1").style.display='block';
});</script>
now when page gets loaded i need to show a loader like ajax pages, Where shud i put it??
 
8:42 AM
guys anyone???
 
how is this related to php ?
i see mostly javascript there , and quite horrible at that
 
9:24 AM
hey any body know function name which is used to write image in ./upload folder in wordpress?
 
@Sparkx , wouldn't you be better off by creating a post here : wordpress.stackexchange.com
 
9:40 AM
okz
 
 
2 hours later…
11:56 AM
Hi
 
hi @Robik @Gordon @tereško
 
@NikiC yo
 
good evening , @NikiC
 
12:26 PM
Hi @NikiC
 
 
1 hour later…
1:37 PM
@NikiC are you freelancing? as in available to do remote work for money?
 
1:49 PM
Word
 
@ircmaxell libreoffice
 
@ircmaxell DWORD
 
up
 
2:04 PM
@Gordon I don't think I can.
 
@NikiC how old are you again?
 
@Gordon 17 ;)
 
@NikiC hmm, old enough for holiday jobs, so why not for dev jobs?
 
@Gordon Maybe, I never looked much into the issue
 
@NikiC reason im asking is because i had an inquiry i cannot accept and wondered whether you would like to follow that lead
 
2:36 PM
Afternoon
 
2:53 PM
@Gordon What is it about?
Is there some PHP function that parses it's integer notations correctly?
 
@NikiC ill forward the conversation to you. if you are interested, let me know and ill connect the two of you
 
why I get error?
ALTER TABLE users ADD COLUMN 'id' INT(3) NOT NULL AUTO_INCREMENT FIRST

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''id' INT(3) NOT NULL AUTO_INCREMENT FIRST' at line 1
 
Kev
@Gordon hey Gordon, did you make any headway with those canonical Q&A's we talked about earlier this week?
 
@Templar Try using `id` instead of 'id'
 
Kev
@Gordon - not pressuring you :) just checking in to see if you need any mod help
 
3:03 PM
Is there something available in PHP core language to overload an array of values by making each value an instance of an object (new class) by using the value as that class constructor parameter?
 
@Robik now
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
 
like $new = array_map($array, function($v) use ($class) { return new $class($v); }); just built in?
 
Not as far as I'm aware, no
 
@Templar Then I dunno :P
 
what does it mean auto column?
 
3:05 PM
auto-increment
you need to add an index to your id columnd
maybe even making it a primary key and not just an index
 
yeah, I think only primaries can be A_I
 
@Kev i have a rough draft done. however, it needs reworking.
@Kev its much more difficult to come up with a good digest for debugging actually than it was for the operator reference
let me pastebin what i have so far
 
@CharlesSprayberry how I can use that command together
ALTER TABLE users ADD COLUMN `id` INT(3) NOT NULL AUTO_INCREMENT FIRST
and
ADD PRIMARY KEY(`id`)
 
@Kev the main difficulty is getting this digest focused enough. the current headlines are somewhat unsuited because there really is no clear distinction in the answers
 
Kev
@Gordon ok...I'll have a look with Tim
 
3:13 PM
@Kev btw we definitely need one digest for date questions as well
 
Kev
@Gordon you fancy doing that for C# as well :D
I think half the C# questions must be "How do I format this date" :(
 
@Kev i dont know any c#. but i figure Ill learn how to format dates in C# just by collecting the answers ;)
 
Kev
@Gordon - I have to run. My contact details are on my profile if you need any advice and guidance etc
 
@Kev thank you :) take care
 
@CharlesSprayberry might it be because table already has some rows?
@CharlesSprayberry I tried to do same thing with phpmyadmin code was same and of course with same error
 
3:19 PM
ALTER TABLE users ADD COLUMN id INT(3) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY(id)
 
you don't even have to 'id' or id?
and yeah it's worked
is it ok id to be primary?
 
@Templar it isn't that you don't have to
i just suck at chat
@Templar if it is AUTO_INCREMENT it has to be primary
 
really? I think when i was creating table from scratch with id it wasn't primary
i will go check it :D
ah yeah it automatically adds primary
 
Hm, looks like libxml isn't binary safe :(
 
@CharlesSprayberry , please stop using columns named "id"
 
3:31 PM
it's me using column id
 
@tereško This was example code for somebody else
 
why i shouldn't use id?
 
Preach your gospel to somebody who wants to listen :)
 
@tereško We already had this discussion...
 
then you are suggesting a bad practice
 
3:32 PM
he didn't suggest anything just made my code work :D
 
Look, the guy wants to use id as a column name. It is no skin off my back if he uses id or snooglewoogleboggle
 
hello
which is more safe:`$act = $_GET["act"]; if($act == "something"){ // something }`
or
`$act = strip_tags(addslashes($_GET["act"])); if($act == "something") { // something } `
 
what do you mean by 'safe'?
 
or what is better
or can php execute any code there
if I only check its contents
 
@Olli no, it cant
 
3:40 PM
ok
so its totally safe to use
if($_GET[""]) {
 
@tereško why you told him to stop using id's but didn't tell me why?
 
because i was not curious enough to scroll back or repeat the same statement twice
 
so now you know that I used it, or only Charles shouldn't use id and everyone else should?
 
@tereško Ok, I just joined, and now I am curious, what's wrong with using ID as a column name? :)
BTW I just went through stackoverflow.com/questions/208580/… after reading your message, and it seems most people prefer naming their PK field as ID, instead of tablename+ID.
 
3:57 PM
there are two main reasons why people prefer ID : ORM they use demands that or they have been taught to do that
 
Sep 24 at 13:52, by tereško
@genesis , stop using name "id" for columns
 
reasons for using tablename + id for column would be :
1. they become unique in database , in complicated selects you do not have to explicitly tell from which table to use the column ( if you are using simply ID in combination with ALIAS for table , it becomes extremely confusing )
2. if foreign key column has the same name as referenced table key, then you can in `JOIN` statements use `USING ( foo_id )` instead of `ON Foo.id = Bar.id`
3. you can at a glance tell from which table the column comes from ( again , the ALIAS thing )
 
@AqeelZafar Read starting from the message I linked above
 
@tereško @NikiC Thanks, reading.
 
4:14 PM
@tereško I honestly understand your position, but the contrary position is neither wrong nor bad. It's different yes, but not "wrong".
 
4:24 PM
can i ask question here? (i'm affraid if i ask a question it will be rejected on SO)
 
I think that question has been posed wrong. You either need il.IDs or i.ID but not both. i.ID is even already named invoiceID in that example. The question looks bogus, not a good example.
 
@zackaryka taken from chat room heading "Don't ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will."
 
i am trying to look for "::" vs "->" on SO but I can't find anything, i was wondering if it'S better to use :: or -> for methods
 
5
Q: In PHP, whats the difference between :: (double colon) and -> (arrow)?

JoeNoob to PHP here, I've come across 2 distinct function calls which I'd like to clarify... Whats the difference between $response->setParameter('foo', 'bar'); and sfConfig::set('foo', 'bar'); I'm assuming -> is used for functions for variables, and :: is used for functions for classes...

 
oh nice thanks
 
4:29 PM
if you are writing a good OOP code , you should only use :: for accessing class constants
 
yes i'm writing oop code (well i'm trying)
 
177
Q: Reference - What does this symbol mean in PHP?

What is this? This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list. Why is this? StackOverflow does not allow searching for particular characters. As a consequence, ...

 
@tereško parent::__construct() off limits?
 
ok .. i admint , i forgot parent, @CharlesSprayberry , that too
maybe because i rarely extend classes
 
but, yea, i don't use :: very much
@Gordon thanks for the link
 
4:32 PM
is :: faster or better than -> ?
i have a parent class with common functioanlity (eg: isValidZip)
should I use :: or ->
it requires a zip and return true of false
 
@zackaryka Parent Class with common functionality is usually an antipattern
 
what do you mean?
 
> In general, the Blob is a procedural design even though it may be represented using object notations and implemented in object-oriented languages. A procedural design separates process from data, whereas an object-oriented design merges process and data models, along with partitions.
 
so i should create function that i include instead?
 
@zackaryka No, you should create Zip Class with a method isValid
 
4:36 PM
i mean i have a file with functions and i `require('libraries.php');
oh i see
but i can endup with lots of classes to include? isnt worse than just include 1 class?
 
more like require 'functions.php , but yeah
 
@zackaryka you should not worry about performance. write clean and maintainble code. when you are done, profile your application and then optimize for speed.
 
problem is that either way your code gets tied to the name of the function
thus creating issues when you have to expand or modify the functionality ( also known as maintenance )
understandable > maintainable > fast
if you write a well understandable code ( without global state and other kinds of magic ) , then changing it a bit to make it easier to maintain , would be simply
if you code is understandable and maintainable , optimization is just matter of free time
 
thanks everyone
 
4:55 PM
ehh ... should people with 80k+ rep really answer on such questions ?!?
0
Q: Why can't I use $this->static::PK

jx12345I'm playing around trying to write a class for handling orm / database connectivity. My plan is to have each model class extending an underlying class that has basic crud functionality. I'm storing the table name and primary key name in static constants as PK & TABLE. The problem is I can'...

 
Hi @user791022
 
5:39 PM
@Gordon At least you should link to questions with correct answers :p
 
@Artefacto you cant expect me to go through the answers of a hundred duplicates.
 
Sure, that's I don't when it's easier to answer
:p
 
@Artefacto that will only increase the vicious circle because there is even more duplicates to look at now
added search link now
 
Good afternoon
 
Good evening @ircmaxell
 
5:46 PM
hi @ircmaxell
 
How's it going?
 
Whatever I try to write, it's written, better and probably works faster. :(
 
@Robik if you are writing it for learning purposes it doesnt matter. writing is the goal then.
 
Good point
 
what name would you guys choose for a general programming blog?
im fishing for ideas here
 
5:59 PM
/* todo: think of a name*/
Or some other variation that attempts to be funny
 
@Daveo you are doing it wrong
 
the trouble is so many domains have been registered its actually hard thinking up one that is available. my real name is already taken too.
@Gordon Doing what wrong? :-P
 
@Daveo thats the title
 
Hah. Good thinking I like it Gordon.
 
6:14 PM
@Gordon Uhm, that's reserved for @tereško I think.
 
lol
 
@NikiC I thought @tereško will use "Thou Shalt Not"
 
evening :-)
 
@KamilTomšík hi
 
@KamilTomšík Hello
 
6:21 PM
CLI interfaces in PHP suck
 
how are you guys?
 
Can we have an SplConsoleOptParser please?
 
@Gordon hehe :-)
 
OptParser?
Like, getopt?
 
@Robik yes
 
6:24 PM
Why not use it?
 
@Gordon just thought about it... what about parse_str("?" . str_replace("-", "&", implode("", $argv)))
 
@Robik getopt leaves a lot to be wishing
 
Lao
Hello
 
@Gordon Sounds like it's easy to make :)
 
@Gordon command line options have similar syntax to GET params :)
 
6:26 PM
@Gordon If you have nothing against, i can wrie one :)
 
@Robik there is already a number of them. Have a look at Zend_Console, ezcConsoleTool, Pear_Console or Sf2 Console.
 
Ow, okay
I gtg, laters
 
@KamilTomšík its somewhat more complex than get params imo. besides its not the parsing but rather the definition of a cli client with predefined options and descriptions and stuff. that would be nice to have natively
 
@Gordon yeah, I think you're right, at least command line options do not usually contain "=" :-)
 
7:02 PM
I'm happy, I finally got a print made of my favorite picture
(I'm on the right walking away)
 
@ircmaxell So you're a programming firemen, or you used to be a firemen? :D
 
I was for about 6 or 7 years. I ran out of time and was sick of the politics
(volunteer)
 
 
2 hours later…
8:43 PM
If i created a singleton class then only one object of that class can be created,now what if two request trying to instantiate the same class,php is a shared nothing architecture so it can not create single object for both request,will it wait for one request to be completed before serving the another or anything else?
would someone like to help me,please ?
 
@ircmaxell nice :)
 
> i created a singleton class
@fluty , this is where it all went wrong
 
sorry,i am not good at english
 
user1385191
if you want to instantiate something once, instantiate it once
 
ok thanks Matt but thats not a answer
 
8:51 PM
@fluty , for your edification youtube.com/watch?v=-FRm3VPhseI
 
user1385191
it's my answer to singletons
 
user1385191
yep, great video
 
@ircmaxell What is A.S Mathematics?
 
thanks teresko
 
@NikiC Huh?
 
9:02 PM
@ircmaxell I looked at your Careers profile and it says something about A.S Mathematics. So I wondered what that is (the A.S part of it)
 
Oh. Associates of Science
 
@ircmaxell Ah, so that is something below Bachelor, right?
 
9:17 PM
Anways, is math nice? My choice currently would be physics but I am considering math too.
 
@NikiC correct
 
9:54 PM
Hey @ircmaxell
Thx for great blog goo.gl/1kUaI . Really awesome job.
 
though , "read one book per week" is kinda harsh
 
Can someone give me some advice on improving the performance of my page script?
 
in which lang your script?
 
The script grabs a load of data (~10K rows) from the database - that's fine. But appending the data to the DOM as select options is taking about 10 seconds.
@TuralTeyyuboglu um, PHP
I was wondering if this could be done asyncronously ... or if somehow it could be output after the buffer had been flushed - something like that?
Or if my DOM manipulation could be improved... any ideas really
 
while nice in theory , in the reality it's almost impossible ( work , 8h , getting to to/from work ~3h , sleep 6h , eating 2h , hygiene and stuff 1h , this leaves less then 4 hours to do something else ( including shoping , cleaning up , physical activities , read incoming materials , making some food ) , @ircmaxell
to read one book per week you have either sacrifice either sleep or work
 
10:07 PM
@tereško If you can use the 3h for getting to/from work like @ircmaxell does, then it should work out ;)
 
not really an option in my case
you cannot "read" technical literature in audiobook format
 
@tereško Was just explaining why @ircmaxell can. I think that most other people can not ^^
 
@Greg , you are putting all the 10k options in a select ?
 
uh, programming audiobook ^^ curly brace open variable a object operator b parenthesis open variable b parenthesis close semicolon curly brace close
 
well .. you can listen tu UncleBob's audiobooks .. or maybe get Mythical Man-Month in audio format , but that's about it
 
10:10 PM
@tereško It's a product database, there are about 10K products, all in different categories, sub-categories, etc.
 
user1385191
use a combo box
 
I think the problem I'm having is that I'm updating the DOM each time I add an array element ...
 
user1385191
use one select for categories
 
@MattMcDonald , isn't that <select> ?
 
user1385191
a "combo box" is utilization of multiple selects
 
user1385191
10:11 PM
the result of one will populate another
 
oh
 
@MattMcDonald yeah I'm doing just that
 
user1385191
so what's the average amount of options for each category?
 
@Greg , well , you said that it takes 10sec to build dom
 
Pretty sure updating the DOM each time an <option> is added is my problem actually... just noticed that :/
 
10:12 PM
it seems to me that you are just creating ALL the items at once and then hiding them
 
@tereško ah man, yeah it was as simple as moving the domUpdate() to the end of the loop :/ ahh I need some sleep
 
user1385191
you may want to consider calculating a ceiling
 
user1385191
so the biggest category's length
 
user1385191
and add that number of blank options at the beginning
 
user1385191
and then just manipulate their text/values
 
user1385191
10:14 PM
therefore bypassing reflows
 
@MattMcDonald I'm not following you, can you expand? ping just understood.
 
@Greg An additional optimization would be to insert the options into a DocumentFragment and then insert that into the DOM tree.
 
user1385191
he'll get killed by reflows
 
user1385191
hiding/showing unused options is a possibility as well
 
@MattMcDonald @NikiC Thanks guys but its not as big of a problem than I thoght - simply doing one DOM update did the trick - loads in ~20ms now
 
10:17 PM
without seeing his current code , it is pretty impossible to suggest any exact solutions for optimization
 
@Greg great ;)
 
@tereško I think I panicked and came here for a magic solution, but then actually thought about it and saw it wasn't as critical as first thought :D
 
user1385191
reflows are a big deal in older browsers
 
@MattMcDonald This was taking 10 seconds on the server side
never really dealt with reflows in the server
but basically my script was reflowing the whole DOM each node (10K times!!)
 
10:33 PM
@MattMcDonald , it is a big deal in all the browser , especially when you start doing fancy animations
 
user1385191
well, in more forgiving browsers you can get away with it
 
user1385191
but older browsers can visually "freeze"
 
well .. when browser freezes , people blame bowser , when animations are not smooth , people blame page
 
@tereško Afaik all modern browsers will accumulate several changes before applying them. (Not saying that it isn't a problem, just saying that it got less)
 
@tereško It's a guideline. And I think it got the point across
 
10:36 PM
@ircmaxell , that it does
 
By the way, I think animations freezing suddenly is more a side effect of GC, not of reflow. Though browser will soon have incremental GC against that too ;)
 
:-D
Actually, I do think 1 per week is good. If you really want to get better, you should be spending 20 to 40 hours per week on it outside of work
 
10:56 PM
now you are just trolling
 
uh huh....
but I'm actually serious
 
11:11 PM
@ircmaxell I'm reading Paul & Harvey Deitel's book about C++. Is there any usefull book about PHP, and what do you recommend?
@ircmaxell ...
 
I don't believe in language-specific books
 
@ircmaxell then how to learn language?
 
11:30 PM
@ircmaxell is suspect that you really are , but thats the amount one spends ( or should spend ) on learning while studying in university
 
@tereško I'm working on my C++ for now. But want to improve my php too. That's why asking if he/you know some usefull book about php
 
on what level , @TuralTeyyuboglu ?
 
hi folks; I've only been working with PHP for about 6 months, but I have an application that requires me to host it on a dedicated server....I'm just seeking tips of what pitfalls to avoid
 
advanced
or maybe something like "from scratch to advanced". I already know basic things, oop but I think there are quite a lot of things that I don't know.
 
@TuralTeyyuboglu , then from php specific book i would recomend "PHP in Action" and "PHP Object-Oriented Solutions" but both books are a bit dated ( 3+ years old )
but that is about it
the rest would be stuff from Martin Fowler and Robert C. Martin
oh , and the mandatory "SQL Antipatterns" book
 
11:38 PM
For ex. I found 8th ed. of Deitel's book (about C++) very useful. It covers nearly "all" c++.
 
Last time i saw C++ book , you could kill a horse with that brick
 
Lool. Actually. I want to learn one by one most popular languages: php->c++->java. First step done about 50-60% (i mean php). How do you think, is it good idea? any other suggestions?
BTW. i'm learning and practising at the same time.
 
I think whether it's a good idea depends what you mean by practicing
 
working on projects (in php)
 
personally, I have little difficulty learning new things but I don't spend at least a few months working with it, 3 months later I remember nothing
 
11:46 PM
@Artefacto I mean, is this way: php->c++->java good in your opinion? (sorry for my English, if you can't get my question)
 
Java is much simpler than C++
 
really?
php->java->c++??
 
I think that's up to you
I'm not a teacher, I don't know what makes more sense pedagogically...
 
@Artefacto, @tereško I want to be, "universal" developer and work with both: web and local platforms. For now I know, JS - 50-60%, HTML & CSS - nearly 100%, PHP - 60-70%. Want to learn another lang, but need suggestions from professionals like you. Which way to choose, don't know. Btw I'm student of applied math fac.
 
probably the best choice would be python
first of all , it lets you build both web and desktop applications
and it originates in completely different "bloodline" of languages
there would be better choices for "next language" but you will be able to actually use python more often
and i bet you actually know ~20% of javascript , because JS is not a c-like language
 
11:59 PM
maybe.
 

« first day (406 days earlier)      last day (4542 days later) »