« first day (794 days earlier)      last day (4151 days later) » 

4:00 PM
It's an unpopular opinion.. and I want to understand the reasoning behind the meaning. Others are quick to jump on you and make blind blanket-statements: "My mother told me mysql_* was bad so I go around to every forum preaching it without understanding it"
There's only a few people that I've seen consistently stick to their guns with unpopular opinions.. and I try to follow those people as closely as I can
 
@MikeB lol... i did not knew that he is so popular ...
 
@NullPointer Col. Shrapnel was the username I think...
 
@FergusMorrow: ext/mysql was just officially deprecated on December 10th, 2012. So I have no idea where you got June 2011 from. Event the doc "warning" was only put in place on April 2012. And even that was a soft notice with no "official" backing from core... — ircmaxell 14 secs ago
 
Thanks for confirming that June 2011 date was crap :)
 
4:13 PM
0
A: Use PDO or MySQLi instead mysql_*

staticsanTo use mysqli, start with something like this: $db = new mysqli($hostname, $username, $password); // You should add error checking. $db->select_db($default_database); if( $db->real_query('SELECT ...') ) { // I have omitted your full query for brevity $resultset = $db->store_result...

How is this not SQLi vulnerable?
 
mysql_ can only every run 1 query right?
 
because user-input never enters the query...
 
So isn't that an inherent security 'feature'.. it doesn't solve everything but it seems like a +
you could inject some code that would log you in everytime but you couldn't drop a table
 
4:31 PM
@webarto But devs are far more likely to use the familiar query() method by default.. I can't imagine the horror of looking at a project and every single query call was piped through mysqli_multi_query()
As I say it I'm sure it's happened :(
 
0
A: Syntax error in simple Insert Query

JackFirst and foremost - Escape, Escape, Escape OR Learn PDO / mysqli and prepared statements. Second - know what the reserved keywords are that can't be used for column names; those have to be escaped using backticks. $sql = sprintf("INSERT INTO itens (nome, data, cliente, link, `desc`, img) VALUE...

Am I not seeing something obvious? ...
 
@Jack Nothing wrong, you can quote integer too, it will be cast to int probably.
@Sharlike nope, only those who are Reserved keywords must be escaped. — JW. 39 mins ago
 
@webarto That's what I figured as well.
 
He is giving false comments, yes it is common practice to escape field names... and of course you must do it for reserved keywords.
 
4:43 PM
The reserved keywords was a different thing and he's right about that.
 
evening
 
@tereško Hey, the channel came to the conclusion that your downvote / upvote ratio is pretty high :)
 
yeah
it's somewhat related to the fact that i rarely visit good posts
 
@Jack No performance differences (checked now).
 
@webarto Performance? Hmm?
 
4:48 PM
@Jack I'm waiting for someone to say that quoting INT will have performance penalty... man gotta be prepared...
 
@Jack when was it discussed ?
 
@tereško a.k.a 9 to 5 :P
 
i spent last 8 hours immersed in bad code
 
tereško's constant ~ 8.02951388889
 
4:53 PM
There is only code. No bad or good code. Only coders.
 
There's bad code alright.
 
haha
 
But much more of bad coders.
 
foreach ($dataRows as $value) {
	$dataRowsTemp[] = $value;
}
unset($dataRows);
@Prasanth you were saying ?
or ... how about
 
while($row = mysql_fetch_array(..)) {
  $arr[] = $row;
}

$n = mysql_num_rows
return $arr[$n]
get last row from table...
 
5:00 PM
class SomeClassThatIsInheritedByEveryOtherClass{

    function __get($objName) {
        // Try Load dynamic module from disk
        if (!isset($this->$objName)) {

            $fName = strtr($objName, array("." => "", "~" => "", "/" => "", "\\" => ""));
            $fName = dirname(__FILE__)."/modules/".$fName.".php";
            if (!is_readable($fName)) return NULL;

            $this->loadClass($fName, $objName);
            $this->$objName	= new $objName($this);
        }

        // Return pointer on object
@Prasanth , what do you think a code based around this snipped would look like ?
 
i take my word back! there is poor code, bad code and terrible code alright :P
 
notice the $this->$objName = new $objName($this); line ...
 
I can't compute it..
 
and this is inherited by every class in the project
 
Oh my, that's naughty code in my books.
 
5:04 PM
you cannot use var_dump() (at least not the xdebug's version) on it , because it cannot handle infinite (recursive) object trees
 
ok so SO occurs? [sorry noob here :|]
 
no
 
@tereško dafuq
 
anyway sorry that you had to be immersed in bad code.. what do you do at those times? i mean do you have any fascinating codes that you go back to once in awhile when you were immersed in bad code?
 
@tereško "Terrible" does not even begin to describe that code
 
5:08 PM
@NikiC $this->kernel->kernel->path->kernel->__get('user')
oh , did i mention taht all object vars are public in said project ?
 
Stop it!
Stop it now!
 
$fName = strtr($objName, array("." => "", "~" => "", "/" => "", "\\" => "")); What's the point of this ?
Can we even $this->foo/bar->baz() ?
 
(and it is just only slightly exaggerated .. i added one extra "->kernel" )
@Touki $this->__get('foo/bar')->baz()
 
Ho ! That's the point of magic functions then
 
5:13 PM
$class = new A(); $class->__construct(); echo $class->__get('proprety'); $class->__destroy();
 
@Touki not really ... what do you think will happen when i do $object->user->auth() ?
 
Hmmm
 
do you think it matters what is $object an instance of ?
 
As long as it extends SomeClassThatIsInheritedByEveryOtherClass, noes
 
5:16 PM
also , the class is called link (yes, class names are lowercase)
so , guys, how was your day ?
 
meh, our md300i nearly crashed last night due to two faulty drives :) all good n fun.
 
3
Q: I want to have more than 50 Close Votes per day!

hakre Possible Duplicate: What is a “closed” question? Should available close votes be a function of inflation or rep? I just was seeing that I hit a close-vote limit of 50 for today. When my reputation increases, will the number of close-votes per day also increase? No it's said. But I n...

 
A view, in a real MVC would be an instance, which contains UI logic, juggles multiple templates and is able to request data, that it needs, from model layer. But CI does MVC just like religions do morals. — tereško 5 mins ago
 
Hmm, not one of your best analogies.
 
5:32 PM
lets see .. religions talk a lot about the morality , but when you look behind the curtain, there is no morals there
 
but yes ... i was hard pressed to find a suitable analogy .. this seemed it
 
night...:)
i am now
 
Wish I had that kind of reaction speed.
 
5 hours ago, by webarto
http://x.vukajlija.com/var/uploads/reactions/201212/47033/tumblr_mdt5jwejZ51rzsn‌​j7o2_250.gif <3
Copying isn't nice :)
 
5:45 PM
Those who says PHP 5.5 has copied a lot of stuff from python, ruby, perl, they should know that Java, C# copied from C/C++, C# copied from Java, Python copied from Perl
 
I wouldn't even get into that argument .. I would just say "so f-sharping-what?"
 
@Jack after seeing the new php 5.5 syntax I see those blames
 
yes , php copies the good/nice parts from other languages , deal with it
 
"off topic (too old to migrate)" <-- what does it mean?
 
5:56 PM
That a question is too old to be migrated to another SE site.
 
mean that it is to old to be automagically moved to a different site
SO is afraid of dead links in google results
 
I think it's probably to do with relevance as well. If a question is one year old, how big is the chance that the owner is still waiting for an answer? :)
Unless the question was "when is the end of the world?"
 
then i would close it as "not constructive"
the correct form would be "when is next end-of-world"
 
6:16 PM
Alright, here I go, importing years of mess into git...
 
6:29 PM
@MadaraUchiha but it was so sweeeeeeeeeet :D
 
6 hours ago, by webarto
http://x.vukajlija.com/var/uploads/reactions/201212/47033/tumblr_mdt5jwejZ51rzsn‌​j7o2_250.gif <3
 
1
Q: Continue after or die in Php

BoardyI am currently working on a PHP project with MySQL. I have the PHP tag at the top and bottom of the page to start and end the php. In between the php tags I am opening an echo statement output HTML to the browser. In parts of the page where I need to perform PHP I end the echo tag and perform a M...

 
Evening
 
6:45 PM
4,848 questions tagged - yay!
@PeeHaa good evening.
 
jo @hakre
 
Anybody had to work with titanium yet?
 
7:00 PM
@PeeHaa not me. just saw it yesterday for the first time.
 
hmmm. Need to start working with it and wondering how terrified I am going to be :)
 
user1125394
7:13 PM
@tereško the more I see your comments on MVC the more i think I'm doing V-only applications ;)
 
Hi all
@PeeHaa hello
 
hiya @Baba. How's life
 
dam too stressful
i need a vacation
 
Busy on the job?
 
evning @Baba
 
7:23 PM
@NikiC .. how are you doing today
@PeeHaa .. yeah .. developing a payment system
Mobile Banking
 
user1125394
bank shouldn't be something you do from a mobile
 
That's probably just about the most epic movie anyone could think of. Ever.
 
Totally agree but not in the position to advice such
Christmas is coming i need the cash
now someone wants to kill me with Test Cases
@PeeHaa how about your crazy boss
@NikiC .. when do you think SPLData Structure can get a review ?
 
@Baba Bit better. Since I told him to let me just do my job
 
@PeeHaa .. lol .. imagine his face
 
7:30 PM
He was pretty cool about it and kinda agreed :)
 
@cyril that is quite possible
 
@FlorianMargaine That reminds me to start some repwhoring on programmers for moar powers
 
@PeeHaa yeah .. i have something like 300 points
 
7:38 PM
But the years in your example are static. — kylex 14 mins ago
Why do people make such stupid comments .. for a 2k rep user
 
I have a directory structure like /Base/Module, where my base is "Good" and an example of a module is "Friend" (which is in /Good/Friend). In my code I use the module names like GoodFriend, showing that the Good is in fact part of the module name.
However, now I am finally putting things into a git repository and faced with a choice: make Good the root of the git repository (with the problem that it may well not be called Good at other people's places) or making Good the only folder in the root of the repository (which makes me jump through hoops if I want unversioned files in the same directory as the Good folder.
Which of the two would you guys go for?
 
What is the project name? Good?
And what language are you talking about??
 
The Good Suite
And the language is php (modules here are mental concepts, not part of the language)
 
Why aren't you using namespaces?
 
originally, it was because of php 5.2 support, though I suppose I shouldn't really be bothering with that anymore these days, so there is no real reason
however, using or not using namespaces doesn't really change anything, does it?
 
7:48 PM
jump through hoops?
 
@Jasper Nopez. Just wondering why you were developing for something that ancient
 
lets see .. on one hand you have some half-arsed "module system" .. on other - language based construct
.. what to choose .. what to choose
 
14
Q: Are multiple `.gitignore`s frowned on?

Conley OwensUnless a repo consisted of several independent projects, it seems it would be simplest to just have one .gitignore file at the root of the repo than various ones throughout. Is there a standard best practice on this or some analysis online of when one approach is better than the other?

 
@ircmaxwell: I don't see how that's relevant at all
 
which makes me jump through hoops if I want unversioned files in the same directory as the Good folder.
 
7:52 PM
here is what i have been wondering
is putting .gitignore entry IN the .gitignore a bad idea ?
 
well the problem of that is that I can indeed use .gitignore, but I have to ignore .gitignore itself unless I want to have the things I want ignored to become references in the repository after all
@ircmaxell: I wasn't saying it wasn't possible, just that it would get (a little) messy
 
Anime and Manga is now on public beta, everyone are welcome there :)
 
@tereško it should work quite well, but it might get a little more complicated if a .gitignore is then added to the repository (possibly by someone else) - as such it would mean that the ignored .gitignore would still be enforcing some sort of structure (the lack of a .gitignore in that place)
 
step one , ad to "ignore tags"
 
Aaaah. The joy of android development. You want to make something. Let me sing you the song of my people. A.k.a. let's start the downloading for the next hour
 
8:02 PM
@tereško why are you saying the "module system" is half-arsed? And are you comparing it to the namespaces in php? That makes little sense considering that the "module system" wouldn't go away if I started using namespaces (it would just be reinforced by the namespaces)
 
(╯°□°)╯︵ ┻━┻
 
@ircmaxell are you throwing around the furniture?
 
no, it's actually Indonesian for "i want a hug"
 
@MadaraUchiha Don't you have work to do?
 
8:11 PM
@PeeHaa No actually, it's my free time, and I'm feeding Uni with burned human flash :)
 
actually well cared Uni runs on enriched plutonium
it was covered here :
 
lol
 
@tereško He runs on enriched plutonium, that's what makes his fur shine, and his flames rainbow
 
did i just see // BBC Algorithm
 
Anyone wanna help me with a rather interesting sql question? ;3
 
user986408
8:22 PM
any sql-nerds in this room? .. i want to shorten this but don't know how - i know i can't use where aliases in my select and vice versa .. but do you have any clues: pastie.org/5549051 (i suck in programming but sql is even worse)
 
Trying to figure out if it's possible to put a form of 'filter' on one of the tables in my sql database
 
Why shorten?
 
so that it will only take information into it from x website or x ip, and no where else
is that possible?
 
    public function __get($name)
    {
        return $this->getHeader($name, 'string');
    }
F* U ZF
 
user986408
@ircmaxell no need in your opinion?
 
8:23 PM
I didn't even look at it
but why would you want to shorten a statement?
 
user986408
i have the feeling there's to many subselects
 
user986408
shorten/improve*
 
Anyone know anything to do related to my statement? :/
 
have a feeling, where did you get that from? Is it running too slow?
 
question*
 
user986408
8:25 PM
i don't think so but it looks so ugly lol
 
The identical sub-query 3 times in a single statement certainly does look like there is optimisation to be had somewhere...
(evening all)
 
@skripted: if it's not causing any problems, then you don't need to worry about it. Clean up is one thing, but don't feel you need to...
@DaveRandom MySQL will optiize identical sub-queries
 
@DaveRandom It's optimization, learn English, you Brit.
 
$enemies[] = $webarto;
:-P
 
@webarto as Buffy once said: "Speak English, not whatever they speak in... England"
 
8:30 PM
if ( $DaveRandom instanceof British ) $DaveRandom->__destroy();
:P
 
(not voicing any opinions, just giving a nice quote...)
 
@Jasper :)
 
stackoverflow.com/a/2608166/367456 - if you think like me that it's worth to deletion.
 
class webarto extends BellEnd {
  /* Do irritating, bad practice-y stuff here */
}
OK, enough of this
 
Yes, you are childish.
 
8:32 PM
@DaveRandom hiya
 
@hakre Amazing :)
 
@hakre: It may not have been a good question/answer to begin with, but by changing the question 2 years after an answer was accepted you did just sabotage that answer...
 
> array_walk($array, create_function('$value, &$key', '$key = "prefix" . $key;'));
:\
 
not quite as good as
function doNothing( $value, $key ) {;}
^^ it has arguments!
 
user895378
Moral dilemma. Always hard to burninate a really old answer of mine that's crap but has upvotes (somehow).
 
8:36 PM
create_function?
 
Yup, and it's barely 2 months old answer.
@rdlowrey All my answers are like that.. crappy :)
> class Zend_Mail_Message extends Zend_Mail_Part implements Zend_Mail_Message_Interface
Method I want to overwrite is in Zend_Mail_Part
I want to extend Zend_Mail_Message, right?
 
@webarto ...because you need methods from Zend_Mail_Message?
 
@DaveRandom f* me... I'm creating object from Zend_Mail which extends Zend_Mail_Message which extends Zend_Mail_Part ... I need to replace method in the last one...
 
@webarto Well you extend the thing which provides all the methods you need. Where the method you are overloading was declared isn't relevant.
 
user895378
Or you could break the crazy inheritance chain and inject a Zend_Mail instance into your own class and specify your own method to implement the functionality you want for the method in question. Then, implement __call for everything else and pass those invocations to the underlying composed instance.
 
user895378
8:47 PM
I'm generally anti-magic, but if you're dealing with a crap object over which you have no control, it might make sense.
 
@DaveRandom I have the url as http://localhost/moods/main.php
now i have a code like: <a href="#cool" id="love">love</a><br/>
so on clicking it the url is http://localhost/moods/main.php#cool
but using this:
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;
i can only get the output as http://localhost/moods/main.php how do i get the cool part in the url? actually i need the word cool and write it to database as text.....
 
@rdlowrey Nice info, I'll extend this pokit.org/get/img/95e1918525602c9695182b1de630d6be.png, which extends the class in which I need to replace method (exceptions are thrown if header from mail is missing, and it's using __call to get headers, so, Exceptions everywhere, I'll just set it to false... And you're right, it is kind of crazy :\
@DaveRandom :) Zend_Mail_Message this is what I need to extend. Thanks.
 
@Jasper nothing is for eternity. I would not coin that sabotage.
 
@blackbee fragments aren't sent to the server (unless you are sending it through xhr or something)
 
9:05 PM
yess i just learnt it..... what is xhr
 
XMLHttpRequest (XHR) is an API available in web browser scripting languages such as JavaScript. It is used to send HTTP or HTTPS requests directly to a web server and load the server response data directly back into the script. Development versions of all major browsers support URI schemes beyond http: and https:, in particular, blob: URLs are supported. The data might be received from the server as JSON, XML, HTML, or as plain text. Data from the response can be used directly to alter the DOM of the currently active document in the browser window without loading a new web page document....
 
do you mean ajax like thing?
 
posted on December 18, 2012 by Matthew Weier O'Phinney

Cal Evans has organized another DayCamp4Developers event, this time entitled "PHP Master Series, Volume 1". I'm honored to be an invited speaker for this first edition, where I'll be presenting my talk, "Designing Beautiful Software". Why would you want to participate? Well, for one, because you can interact directly with the various speakers during the presentations. Sure, you can like

 
@blackbee You could call it that yeah
 
:)
 
9:13 PM
anyone notice the dancing psy next to the youtube logo today? >.>
lol
 
Hey....
why would my gitignore not ignore my config directory?
This is what is in my gitignore:
nbproject/
config/
This is what happens in git status:
nlubin@NLUBIN-NEW /v/web (master)
$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   .gitignore
#       modified:   p/smallFry/config/AppConfig.php
#       modified:   p/smallFry/config/config.ini
#       modified:   r/smallFry/config/AppConfig.php
 
It could be because the changes were already tracked
69
Q: Making git "forget" about a file that *was* tracked but is now ".gitignored"

IvanThere's this file that was being tracked at one time by git, but now the file is on the .gitignore list. However, that file keeps showing up in git st after it's edited, so how would you force git to completely forget about it?

 
@ExplosionPills hmmm that makes sense.... but I just want my local config ignored. and i want the one in the repo to stay
 
@Neal Make a config.ini.dist and AppCOnfig.php.dist file
and ignore the config.ini and AppConfig.php files
 
9:29 PM
I just did this:
    $ git update-index --assume-unchanged */smallFry/config/*
seemed to work
@Lusitanian ^^^
 
user1125394
HHm never tried to do a Gist markdown , but whenever I try on gist.github.com/gists It says: Something went wrong with that request. Please try again.
 
user1125394
but I clearly name the file doc.md and put simple lines in it, and I'm using my github account
 
user1125394
well it fails for text Gists also..
 
user1125394
contact email to the rescue
 
Wouldn't surprise me if they also killed that because nobody uses it ;)
 
9:37 PM
@PeeHaa Nobody uses repositories do they? How about issues? In fact this whole website thing was a step in the wrong direction.
 
:P
Not so loud. You might only give them moar ideas :(
 
@DaveRandom, he has wrong html syntax ... — cristi _b 50 mins ago
^^ certified genius right there
 
Grr
I'm building an alienware and i have a set price.. but they get so expensive so quickly x.x
 
Oh wow, it's voidwhisperer.
 
(waiting for crap about getting alienware and not buying a pc)
Oh wow, It's me.
 
9:45 PM
hah
I remember you from somewhere, just not sure where.
 
Lets see
Where do you go, i can tell you where probably :P
 
user1125394
possible to do mardown footnotes?
 
Bukkit?
 
YES
I am a bukkit coder ;)
 
thar we go
 
9:48 PM
Don't you make plugin metrics?
;p
 
nah, other random weird plugins.
 
or no, i could be mistaken :L
 
I made a mob plugin where a bunch of blocks would chase users around and eat them.
in any case. I'm retrofitting a website right now to make it look like it didn't come from the 1990's. There are 47,000 files to edit and I don't want to have to run my converter program every time we need to make changes to the design so I'm going to be including php inside the html files. (by editing the .htaccess file as well)

That being said, php is more dynamic than html. Even if the website page files will end in .html, there could be a chance of php injection, right? I need to protect against that.
kind of jumped right in there. sorry about that.
 
pangamma, what do you mean, php injection?
 
I have no idea what I mean.
There's SQL injection, right?
 
9:50 PM
Yes.
 
according to some other sites, PHP injection is also possible.
 
That can easily be avoided
 
excellent
 
@Pangamma those are the sites you should be adding to your block list.
 
so far I believe you need to chmod everything to 644, but I'm not sure if I need to do anything else to
 
9:51 PM
easiest way to prevent that
 
I would if I knew which sites weren't protected.
 
don't pass urls through post r get
:L
 
user895378
Pray tell, what is PHP injection?
 
that makes things really easy then. Only PHP feature I need is
<?php include ('header.html'); ?>
 
eval()?
:)
 
9:52 PM
inclue($_GET['page']
 
user895378
Oh, I just assume people aren't using eval() in web code, because there's almost no way that's a good idea ever.
 
ifa nyone uses eval in web code
I need to hurt them
 
But it's super useful
 
user895378
totally
 
user895378
like Super::static()
 
9:53 PM
yeah, but not unless used VERY carefully
 
I'll be sure to stay clear of the eval(). lol.
 
god dell has shitty service...
building a laptop preliminary ship date
1/14/2013
....
 
The only situation I can think of is //eval(""); :D — Petruza Jan 4 at 15:30
 
user895378
eval(var_dump((bool) 'Am I stupid for using eval?'));
 
haha
 
9:56 PM
looking to see if i can pay for faster shipping
hell, I'm not waiting a month to get a 2.8k USD laptop
>.>
 
I dislike dell, personally
 
For 2.8k they should fucking ship it next day delivery
Ow wait it is USD
:P
 
user895378
And tell the delivery man to give you a rim job in the parking lot.
 
lol
 
lol
 
9:57 PM
so I am new with mysqli, and I'm having trouble looping through results. It's only giving me a single result, and I know he query returns 3 resuts. I'm trying to use: while ($row = $result->fetch_array()) { } but clearly this is wrong.
 
peehaa nub :P
still, 2.8k usd is alot >.<
I mean.. your paying that much.. the least they could do is force you to not wait a month to get the damn thing
 
Yup
 
0
Q: How do i tell git not to track the changes to my local config file?

NealI have the production config in the git repo, and I do not want to track changes of the config files when I am working on development? How do I do that? I searched online to no avail. I tried doing: git update-index --assume-unchanged <config directory>/* and it seemed to work.... but...

 

« first day (794 days earlier)      last day (4151 days later) »