« first day (895 days earlier)      last day (4066 days later) » 

6:05 PM
Word
 
To your mother?
 
No, to my homies
@Charles you're in Seattle? I'll be there monday!
 
@Ocramius 15~30% micro optimization isn't important?
 
6:22 PM
So @DaveRandom what say you?
 
@BenjaminGruenbaum 15-30% of micro seconds is still micro-seconds and unimportant
you'd get more return by editing the CPU scheduler
 
hi all
need help working with images
i have uploaded an image path in mysql db and now i want to fetch that path and display image in php
i wrote like this
<img src="<?php echo $thumbimg; ?>">
 
@ircmaxell I think that perhaps one of us is not aware of the that conversation is about. If I understand correctly @Ocramius is running code he is also generating himself, I suggested making the generated code readable and running an external optimizer over making optimizations himself. I was asking him 15-30% was important in his case, not claiming that it was or was not. 15~30% speed boost might be very important in some cases, or not important at all in others.
 
@samir Are you saving absolute path or relative path ?
 
@Rikesh
$uploadDir = $_SERVER["DOCUMENT_ROOT"].'upload/';
$imagePath = $uploadDir . $fileName;
this path
which i m getting like
c:/wamp/www/uploads/xyz.jpg in db
 
6:31 PM
@samir than I guess you are doing wrong
 
oops
y??
 
save image in your project folder
like /project/uploads/xyz.jpg
 
@Rikesh i m a beginner
 
& you can access it like www.example.com/upload/xyz.jpg
 
see i thought i would make a folder like "uploads" on server
and will save the images there
@Rikesh u from ahmdbd ?? nice me frm baroda
 
6:33 PM
That's great
 
how should i upload in my project directory
???????
 
If you upload on server ..which is not poiting to any domain than how you will access the image ?
 
@BenjaminGruenbaum 15-30% relative to if ($foo) { $bar = 1 } vs $foo && $bar = 1;
 
@Rikesh planning to put it on a server with domain
see
even if i get
the path as c:/wamp/www/uploads/xyz.jpg
it should display right ???
 
We need to innovate. In exactly the same ways that other companies have innovated.
 
6:35 PM
@ircmaxell I'm agree that a 15% performance gain is not important at all in 96% of cases, much less than readable/maintainable code for sure. I'm not sure what @Ocramius is doing though so I can't tell if he is in the 4%
 
@samir No it won't
 
so guide me
how will i get the path relative to the project
$uploadDir = $_SERVER["DOCUMENT_ROOT"].'upload/';
$imagePath = $uploadDir . $fileName;
currently i m using this
 
$uploadDir = $_SERVER["DOCUMENT_ROOT"].'project-name/upload/';
 
ok
@Rikesh except that is everything else fine
i mean the way i did in img tag???
 
6:39 PM
@ircmaxell wouldn't the best approach for making some PHP faster be running it through something like HHVM that does JIT optimizations anyway?
 
@samir Ya but you need to save only image name into db
not whole path
 
oooh
 
@BenjaminGruenbaum hell no
 
and i need to get the prefix of path static in php code???
 
the best approach is to figure out what's slow, and fix that
 
6:40 PM
@ircmaxell Why? (I'm really outdated in PHP, I rarely use it nowadays)
 
because it's EXTREMELY rarely the logic of the language
 
I am agree too.
 
@samir yeah just <img src="/upload/<?php echo $thumbimg; ?>">
 
like $_SERVER["DOCUMENT_ROOT"].'project-name/upload/'.$row['imgnamedb'];
 
@ircmaxell Yeah, your program is always as fast as it is at its slowest point, but doesn't a strong JIT like hiphop make PHP code more than twice as fast? I mean, look how fast JavaScript is...
 
6:41 PM
No, it doesn't
 
@samir No just how I show you
 
@Rikesh that worked bro
thanks
 
Your welcome :)
 
@ircmaxell Isn't PHP code still interpreted? Does PHP come with a good VM today?
 
just need to crop resize the image for proper display
 
6:43 PM
give hieght width ito image tag
 
hey rikesh do u knw to implement template in php?
yeah i will do that
 
@BenjaminGruenbaum You're focusing on the wrong aspect of performance
and yes, it uses a VM
 
@samir Are you using any framework ?
 
@ircmaxell I'm focusing on one aspect of performance. I'm focusing on raw speed. While it is not the most important factor, or one of the most important, it's what I'm focusing on. Does PHP have a JIT compiler today?
 
no
 
6:45 PM
ok :/
 
@Rikesh no dear just core php directly in notepad
 
but again, for the VAST majority of use-cases, JIT will not make the application appreciably faster. Nor is it worth the time to implement for all but a few shops (literally, a few)
 
@samir Ok.
 
actually am a beginner. currently working on j2ee and android but trying to taste php
;)
@Rikesh can i have ur gmail id if u dont mind ???
 
@ircmaxell I already reverted that one :)
 
6:48 PM
@ircmaxell You're preaching to the choir :) I'm well aware that most small websites that use PHP don't really care about that sort of thing since the traffic they're getting isn't worth the hassle/money/developer hours adding such a layer into the system introduces. One of the big selling points of PHP imo is keeping it simple. I think a JIT in PHP 6 would be awesome for PHP though, it should be a part of the interperter/vm, in JavaScript it really helps in some cases.
 
@samir sure Rikesh.18@gmail.com
 
@ircmaxell it's ironic
 
@samir but about to fall on bed now
 
LOL
 
sent you invitation
sure same here
 
6:49 PM
Good Night
 
gn bye
 
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better.
 
Uby
I currently have a rep of 999
so close!
 
Not anymore.
 
Uby
6:56 PM
wow
 
Pisa, eih? I almost went there last fall...
 
Uby
really?
Internet Festival?
 
Yeah, stayed in Northern Italy for a week
Bologna, Venice, Milan, Torino
 
Uby
cool :)
 
Alba
 
Uby
6:58 PM
Alba is really nice :)
Tuscany is also great
ok, gotta go out for a special dinner
see you later!
 
yeah, went for the Truffle Fesitval
 
@Uby costs also "un occhio della testa"
 
This explains it nicely.
 
blah
RTFM should be a valid close reason. And this comic should be injected at the top of every question closed as it:
 
7:17 PM
@ircmaxell Somewhat reminds me of this: youtube.com/…
 
@ircmaxwell Agreed.
 
great movei
 
good evening
@ircmaxell that would so useful for lots of questions
 
@DaveRandom, how come the linkifier doesn't auto-link RTFM? ;)
 
@ircmaxell Next to Snatch and Lock, Stock and Two Smoking Barrels I'd say.
 
7:22 PM
good point @Alexander :))))
 
@Alexander try rtfmfm...
 
@webarto Snatch is #1 by a long shot, but LS&TSB I wasn't a huge fan of. It was ok, but not awesome
 
Tonight on repertoire Bronson
 
Anonymous
We should draw an image, about how everyone stars, what ircmaxcell thinks in funny in the PHP room :p
 
7:26 PM
@kaᵠ :D
 
Some context:
Knuth reward checks are cheques awarded by computer scientist Donald Knuth for finding mistakes in, or making suggestions for, his publications. In the preface of each of his books and on his website, Knuth offers a reward of $2.56 (USD) to the first person to find each error in his published books, whether it be technical, typographical, or historical. Knuth explains that $2.56, or 256 cents, corresponds to one hexadecimal dollar. Valuable suggestions are worth 32 cents. In his earlier books a smaller reward was offered. For example, the 2nd edition of The Art of Computer Programming, Vol...
 
@all hello. I have PHP-MySql API. But i want my database to be SQL. Can just changing connection string to target SQL database work?
What is the best alternative for this situation if anybody could suggest would be great help
 
@mann Say again? You lost me there
 
7:39 PM
@Alexander Basically as i said i got API which is in PHP-MySQL right?
 
By SQL, do you mean MSSQL?
 
But i want to use MSSQL
Yes sorry MSSQL
Can you please suggest me what is the best way to do it. Because i am iPhone developer so not very much into PHP-MSSQL.
 
why would anyone want to switch to MSSQL
.. it's not even Sparta
 
Because rest of the website uses MSSQL
This API just deals with one Functionality
 
7:46 PM
teresko Can you please suggest me something?
 
Hi can anyone can check out this stackoverflow.com/questions/15668225/…
 
@mann what exactly you want suggested ? Is the search broken again in php.net ?
 
@tereško i Just want to know how can i change my API's Mysql database to MSSQL
If my qustion makes sense?
 
no , it does not make sense
you either do not know php or you do not know mysql/mssql
 
Yes i don't know much. As i said i am iPhone developer and strugling with this problem. Thats why asking suggestion here mate
Because you guys know better
 
7:54 PM
@ircmaxell, man, I wish we could meet up. Unfortunately all day and most of the evening is going to be consumed doing a huge office rearrange.
Mutter mutter mutter IT IS NOT FACILITIES DAMNIT mutter mutter
 
Fair enough. Going out for business, late Sunday until Thursday morning
 
@ircmaxell Cool, might still be able to pull it off.
@MadaraUchiha Wasn't that like one of the canonical "do it with jQuery" answers? Makes me a bit sad...
 
nice!
 
This made my day:
-2
Q: Allow trusted users (20k+) to convert answers which indicate 'duplicate' to comments

Richard J. Ross IIITo start, I'd like to say that this is not a duplicate of this question: Can we make Convert to a Comment a 10k/20k user tool? So, let's get started. Earlier today, as I did a run of flagging, I came across an interesting search query, that turned up an abnormal amount of hits: "check" "this" "a...

^ You gotta read the first comment
 
8:01 PM
@Charles It's exactly that
 
@Alexander mate still looking for reply
 
@MadaraUchiha that one is a fake though
 
@ircmaxell Yeah, it is, unlike this other one that I've seen
 
@mann I can't be of help there. I don't use MSSQL at all
 
1
Q: jQuery round function

SergioHow can I round the number using jQuery? If the number is 3168 I want to print it as 32. Or if the number is 5233 the result should be 52. How can I do that? Should I use the Math.round function?

 
8:04 PM
@Alexander oh ok But any overview how can we achieve it?
 
@webarto tried to tag is but then some other user was a party pooper
 
@MadaraUchiha, technically, the 2nd answer is the better answer in that question. there needs to be a way on SO for the "crowd" to vote to strip the award for correct answer, and reattribute it to another
 
@MadaraUchiha :p
 
@mann Not really because I'm unaware of the support for MSSQL
 
@webarto, please refrain from creating joke tags. — Charles Jul 28 '12 at 21:48
 
8:05 PM
I wish I could be of more help
 
@Charles , it's from time when you were not so jaded
 
@MadaraUchiha LOL
 
@tereško I've always been jaded, I'm just better at expressing it now.
 
@Alexander no problem mate. thank you so much for your time. Atleast you bother to consider it :). Cheers
 
8:07 PM
also, is there really any point in any of us doing anything to further anything anymore, it seems the majority of the planet will be uninhabitable soon anyway bbc.co.uk/news/world-asia-21972936
 
Then let's all repwhore
 
@bizzehdee As someone in the theoretically reachable range of NK's missiles, I really wish they'd knock it off already...
 
@mann Most likely your biggest problems are going to be quoted identifiers and SQLServer's total lack of support for LIMIT or a sane alternative. You'll need to take it on a query-by-query basis though
(evening @all)
 
I also wish I understood what Kim Jong-un's problem is. I mean, he's freaking western educated, he knows damn well what kind of horrible regime is being run there...
y0 @DaveRandom
 
SQLServer is, frankly, a load of bollocks though
You could really do with moving the entire app away from it, rather than the other way around.
 
8:10 PM
@Charles Just wants to show off.
he know the west will WTFBomb him out of existence if he pulls the trigger.
 
@Charles what i dont get is, the majority of the west, and the east, and all other directions, have methods of knocking any missile out of the air without it detonating. and at the same time, turn NK in to a large sheet of glass. and im not so sure its about showing off, im not entirely sure its him. i think hes more of a figure head than his father was and someone else is controlling his actions from back stage
 
@Pheagey Exactly, so wouldn't the most logical course of action be, oh, I dunno, not sabre rattling?
 
For those of us who can't see it
This ^ is a real capturing plugin, by the way
Not the crap that gives you a x100 magnification by default
 
@MadaraUchiha Awesome!
 
@bizzehdee Feh, yeah, he's probably a figurehead...
 
8:13 PM
@Charles From his stance, the more he rattles off the more nationalistic his people are. The more nationalistic the less they inside revolution for basic needs, like, food.
nationalism > all else.
 
I guess I'm just not the right guy to run a brutally despotic dictatorship.
 
why else would he look, sound, act and generally just BE his father?
 
<- steps back from the ranting/trolling ledge...
 
    var Unit = function(value) {
        var elements = [];
        if (value instanceof Array) {
            elements = value.slice();
        } else {
            for (var i = 0; i < value; i++) {
                elements.push(1);
            }
        }
        this.getValue = function() {
            return elements.slice();
        }
        this.toPrimitive = function() {
            return elements.reduce(function(left, right) { return left + right; }, 0);
        }
        return this;
    };
 
I'm sick of getting revenge downvotes in my freaking old questions!
 
8:23 PM
Yes! Weekend motherfucker, do you speak it?!
 
ok glass, google weekend
@ircmaxell needs moar XOR
 
hrm.... How can I do bitwise XOR via set operations...
is that even possible...
 
@ircmaxell eeeehw. That looks an awful lot like javascript. Here's soap go wash you mouth
Also your lack of semicolons make me tweak
 
tweak tweak
 
is it tweak?
neh that doesn't look right
1 sec
 
8:29 PM
tweek tweak
 
@PeeHaa what lack of semicolons? I use a semicolon on every line
except one
 
ok glass, google tweak or tweak
 
this.getValue = function() {
return elements.slice();
}
this.toPrimitive = function() {
return elements.reduce(function(left, right) { return left + right; }, 0);
}\
 
@ircmaxell Don't mind him, he's bat shit drunk already probably.
 
8:30 PM
@PeeHaa blah
 
Google glass convert that ^ to a code block please
 
@PeeHaa I may actually say that but for this lack of newlines :)
 
is that not javascript?
 
I don't put semi-colons after } because it's not ambiguous without a terminator (it's 100% consistent unless there's a radical , lurking somewhere
 
@webarto yes I am, but still it's an assignment
 
8:31 PM
@PeeHaa I meant that in a positive way :P
 
@ircmaxell And JS is full of it
@webarto <3
 
No, it uses ambiguous rules... I use ; everywhere it MAY be ambiguous...
 
What does it hurt to add it?
 
portability with writing style to other languages
 
meh that's a weak point imho
 
8:34 PM
@ircmaxell I don't think you strictly follow that
 
I don't
 
the closures are worse. how often are you skilled php people using closures? i do not like them in my php
 
I always try to separate the actual implementation details based on the language because of the fact they are different languages.
 
@webarto i don't get it
2
 
8:40 PM
I use them all the time
 
@ircmaxell i do too; just in javascript, bc i'm dumb and always associate javascript with a visual effect. educate me and convince me to like them in php, too. is there a performance benefit? is it just easier for you to write, instead of having to keep track of 50 methods you've defined?
 
@dyelawn I am sorry.
 
Let me introduce to you the best operator ever, the goes-to-operator: $i --> 0
 
@ircmaxell "learn for themselves ... implement a solution": i didn't ask for a solution. my question suggests that i know what closures are. let me know if i should provide more support for this.
 
8:50 PM
@ircmaxell Old news.
 
con't: "the ability to figure something out": i now know how to fish pretty well.
 
@ircmaxell that's too true !
 
@ircmaxell False! The best operator is $x ^ $y!
 
con't: "five minutes on google": not a whole lot of quality results for 'language construct adaptation + supporting examples for the usefulness of closures in php'
 
@dyelawn I didn't mean it as an insult. I meant try playing with it. And in the cases where you don't see an advantage, work yourself until you do...
 
8:51 PM
@dyelawn Your google skilld are weak o young one
 
my $0.02 at least
120
A: Find first character that is different between two strings

ircmaxellYou can use a nice property of bitwise XOR (^) to achieve this: Basically, when you xor two strings together, the characters that are the same will become null bytes ("\0"). So if we xor the two strings, we just need to find the position of the first non-null byte using strspn: $position = str...

 
"i'm not suggesting people never ask questions": no, but posting this video in response to my question is, because my question wasn't seeking an 'easy' answer, or even pointed to whether something will work. i wanted to get some opinions from experts about something that they appear to be using on an increasing basis, so i might better understand the practices of the community
 
@MadaraUchiha YEAH $x to the power of $y !!!
 
Not sure if troll or just loool
 
@MadaraUchiha seriously, what are some useful cases for XOR on a 'daily basis'
 
8:53 PM
@PeeHaa lol + o/
 
@kaᵠ Ask @webarto
 
strspn($string1 ^ $string2, "\0") <-- headshot
 
@webarto I summon you
 
@kaᵠ thee*
 
i don't know, i thought this would be a decent environment for asking questions about developments in php
 
8:54 PM
@kaᵠ one or the other but not neither or both
 
@MadaraUchiha that was actually what i was looking for :) thee :))
 
@kaᵠ Don't look at me, I'm lost too :P
 
@dyelawn It often is. However if you were looking for quick answers you may end up disappointed... only advices
 
I was told "who needs XOR" anyways
 
@PeeHaa i don't come in here with "find the syntax error in my mysql_query()" nonsense
 
8:56 PM
BTW: for (var i = 0; i < 32; i++) { console.log(Operations.power(2, i).toPrimitive()); } still hasn't gotten to 2^20 yet... :-D
 
@ircmaxell in php a optimum implementation would take a blink of an eye ^
 
@dyelawn In all honesty. I have no idea what you are here for :P I'm too wasted to read moar than 3 messages back so I just act on those three messages :D
 
maybe it's just that no one has a good answer...
 
@webarto XOR might be one of those things that when you learn it you can't live without, but most programmers never heard of & or ^ so that code will be 'harder to maintain?'
 
8:58 PM
@PeeHaa meh, quitting time here, maybe i'll just forget it and join you in incoherence
 
@dyelawn It works for me ;)
 
/me serving 2nd beer
 

« first day (895 days earlier)      last day (4066 days later) »