« first day (634 days earlier)      last day (4296 days later) » 

7:00 PM
@EventHorizon pokit.org/get/img/f83cb3aaa696691cc247518742c22bf0.png factory returns an object so you don't have to write commented line.. but people dislike method chaining also, it really can be PITA... particularly when you write everything in one line and you get error eg fatal error at line 10 and you have 5 chained methods... I've seen 15...
 
I haven't messed around with Pattens or OOP much, I was going to go through some test cases like creating a user, handling a bank account etc, to try and make sure I understand the concepts.
 
@NikiC generating salts
 
@ircmaxell ...
@ircmaxell Rather: When would you use it.
 
generating random strings in a non-cryptographic safe manner that produces a format compatible with crypt()
 
I.e.: When would you need to generate a salt
heh
I don't think that this will turn into a productive discussion, so let's just drop it right away ^^
 
7:08 PM
@EventHorizon you don't have to strictly follow patterns, just write sane PHP code (patterns lead you to that eventually)
 
@NikiC: where are you going with the question?
 
user895378
@Event_Horizon OOP is an organic thing. It is a kind of rocket science learned over a lot of time and a lot of use. Just try to start implementing S.O.L.I.D. OOP principles. Don't fixate on "learning OOP" as a final destination at which you can arrive.
 
@ircmaxell I just don't get what it is good for ^^
 
What would you use in its place?
 
Nothing
 
7:10 PM
@rdlowrey My goal is to be able to use it when I need it, and not make spaghetti code, thats it.
 
Or rather a (non-hash-related) function for generating random strings according to an alphabet. But that's not directly related
 
user895378
@Event_Horizon hehe, well, once you start using it you won't go back and forth :)
 
but there are no such functions in core
 
yes
 
which one?
 
7:13 PM
Does ternary work if you are just doing a simple if check? or do they require the else?
 
they require the else
 
@Event_Horizon I don't even want to know why you're asking that question...
 
Because I've been codegolfing
 
user895378
@Event_Horizon Ternary (from Latin ternarius) is an adjective meaning "composed of three items" (wikipedia). If you only have a binary conditional ternary doesn't even apply ...
 
@Event_Horizon lmao
 
7:16 PM
@Event_Horizon Then you'll appreciate foo() && bar()
 
My goal for codegolfing is to try and learn bitwise operators and any other code shorthand.
 
I.e. if you only have on expression in the if, then if(foo())bar(); is equivalent to foo()&&bar(); ;)
 
wait wha
 
and if you have multiple if(foo()) { bar(); baz(); } you can do: foo() && (bar() | baz())
 
7:18 PM
now we're getting somewhere :D
 
oh lord
 
actually, does | have a lower precidence than &&? if so, you can drop the () wrapper
 
i've seen code with the no if statements in it
figured what it was, but never saw a use for it.
 
it works
 
7:20 PM
@ircmaxell sure
 
can you use comparison though? $var == 'hello'
 
it's always good to have php.net/manual/en/language.operators.precedence.php bookmarkd
 
$ php -r 'function a($a) { echo $a; return false; } a(1) && a(2) | a(3);'
1
$ php -r 'function a($a) { echo $a; return true; } a(1) && a(2) | a(3);'
123
 
therrr we are
 
user895378
@markustharkun Aha, so this is the cool font vector pack that was used to justify the github redesign that I still find aesthetically inferior. I like the icons, I just don't like the visual atrocities github perpetrated in their name.
 
user895378
7:23 PM
Oh, wait, no. That's not right. The github icon confused me.
 
hey guys
is anyone here familiar with drupal?
 
@rdlowrey nope Dave Gandy made those, partially to replace the utter shite that comes with bootstrap
 
user895378
@Mike Yeah I misunderstood what that was :)
 
yeah :)
github's icons are "proprietary"
they aren't sharing them :)
 
user895378
ironic.
 
7:25 PM
isn't it
 
i need help coming up with a solution
 
$solution
 
if I have a method within a class can I use that to validate data for another method or should that become its own class at that point?
 
i have 4 live drupal sites. i want to query the data on those databases and display it on a static html page
 
how are you going to display it on an html page?
if you mean a php page
 
7:27 PM
not static html i meant php
@Mike yeah lol
 
create an admin user thats the same across all 4.
query all 4, compile information and display it
thats one way
just dont give write access to the user
 
yes but on my php page i have to link back to the news articles on the respective sites so how can i access drupals internal alias system to make sure i'm linking to the right page.
 
thats where a drupal guy comes in :)
@MikeB
 
any coda2 users with spontaneous lag issues while typing?
 
@MikeB please come to my rescue
 
7:29 PM
I'm beginning to agree with your removed comments :]
 
@Mike does what i'm trying to do make sense? am i explaining myself correctly?
 
yes it does
you need to create the URLs
 
exactly.
 
the same way drupal does, and im just not sure how it does that
 
sometimes I can type out a whole line, and watch it get typed out over the course of 5 extra seconds
 
7:30 PM
is it a example.com/post/postid/post-title form?
if so you can do that easily.
 
@Mike no. the urls are always generated automatically.
 
yes, but what do they look like
 
and they can change at any time
 
well thats retarded
 
@Mike they are friendly if that's what you mean.
 
7:32 PM
show me one
 
@Mike tell me about it. i'm just a developer though lol our marketing/seo "geniuses" make that call lol
culinary.explorejobtraining.com/industry-news/culinary/restaurant-business-unphased-wisconsin-smoking-ban
you won't be able to browse the site but basically that is the structure of our news article urls
 
jesus
so im guessing drupal takes the categories and the title
so you could build something to do the samething
category/category/url-title
could be done in a few lines of code im sure, but there might be a better way to get to the URL without doing this... again a drupal exp can step in.
 
@Mike yeah but that could also be overwritten because when the page is create drupal has an automatic alias generator but you can click that off and specify your own desired alias. i need to tap into that record whereever the hell it is lol\
 
probably in a table somewhere
unless its done on-the-fly
somehow
 
i think i found the table! hold let me look at it.
 
7:38 PM
can you try doing node/id
can you access those externally?
 
user895378
@LeviMorrison Just as an FYI, I have not bothered to support HTTP/1.0 in the Atreyu code that would be affected. Considerations are only made for HTTP/1.1. I mean, HTTP1.1 has been around since 1999 ...
 
@rdlowrey Sounds fair to me . . .
 
KITTY KAT
 
@Mike let me try that. so you're saying i reference the articles by their node id and have drupal figure out the rest?
 
/shrug
i used drupal once
it ended with me in the alley behind a bar with my pants pulled down. Not a happy time for me.
 
7:40 PM
lol thanks though. i appreciate your help. let me play with it.
@Mike interesting...lol
 
but hey, at least i answered your original question :)
 
indeed. thank you.
 
What would be a good term for something that can either be a whitelist or a blacklist?
 
filter
 
that might be it ^^
 
7:51 PM
saintPeter
 
@NikiC list
:)
 
shindlerslist?
 
A quick question - would it be okay, if I saved the user id in a cookie along with a random key to use as a 'remember me' cookie? Or would it be unsafe to have those together?
 
have a good one guys
 
@Repox You don't need want the userid in the cookie
 
8:02 PM
@PeeHaa I really don't. Is it enough with a random key?
 
@Repox Yes. Random token which changes on each login
 
@PeeHaa Thank you.
 
np
 
rather than storing the userid?
really?
oh you mean as a remember me
 
@Mike ?
 
8:06 PM
what
i was talking to you @PeeHaa
 
Good evening, everyone.
 
afternoon here
 
@Mike If the id is unique why would you need an userid?
 
i love support chats on business that i have service with
id = userid
is what i mean @PeeHaa
you were saying that you dont want the userid in a cookie.. i dont see the reason why you wouldn't
 
@Repox forget what I said :P @Mike looks to be right
meh shit happens :)
 
8:10 PM
@PeeHaa Tasty link :)
 
word
i always do 3 part like that
well then again i use ion_auth or ircmaxells phppass lib
 
Why do I suck so hard at designing pages :(
 
because youre a logical kind of guy
most programmers suck at design
 
But three parts? I don't get the 'series' part.
 
@Repox 1 sec I have the original link
 
8:14 PM
@PeeHaa I'll read that article - thank you.
 
np
 
what does the series comprise of?
 
Is this readable as blogposts? jsfiddle.net/PeeHaa/Qd2a4/1
 
just a random hashed string?
 
> My solution to this problem is based on the observation that since each token can only be used once, a remembered login session actually consists of a series of such tokens. When an attacker successfully steals and uses T_0 he is issued T_1, but the victim is still holding T_0. The database no longer has a copy of T_0 and thus cannot differentiate it from an arbitrary invalid token.
> However, if the series of tokens is itself given an identity that must be presented along with the current token, the system can notice that the victim is presenting a valid series identifier along with an invalid token. Assuming that the series identifiers are as hard to guess as tokens, the only way a user could present
> a valid series identifier with an invalid token is if some other user previously presented the same valid series identifier with a valid token. This requires that two different users held the same series and token pair at the same time and therefore indicates that a theft has occurred.
 
8:16 PM
@PeeHaa so could would benefit from more contrast.
 
@hakre Any suggestions?
 
contrast
 
@Mike How?
or what?
 
blah
 
change the background color to a lighter color
 
8:19 PM
@PeeHaa have you ever heard of syn-ack?
 
@ircmaxell I would lie if I say yes, but I'm pretty sure you start yelling at me now :)
 
Well, it's similar to what you just quoted
but you use a common session identifier, but you increment another "counter" on both sides
so the session would maintain a counter, and the browser would maintain a separate counter. Each request to the server would include the current counter status (or a hashed version).
then the server makes sure the client counter matches the server one
if they every mismatch, it's a sign that the session has been compromised, and invalidate the entire session (force a re-login
 
Ah right. Think I heard something like that while doing CISCO stuff at schoo;
 
yeah, it's based on the syn-ack system in TCP
The Transmission Control Protocol (TCP) is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol (IP), and therefore the entire suite is commonly referred to as TCP/IP. TCP provides reliable, ordered delivery of a stream of bytes from a program on one computer to another program on another computer. TCP is the protocol used by major Internet applications such as the World Wide Web, email, remote administration and file transfer. Other applications, which do not require reliable data stream servic...
The "sequence number" part of the packet
 
that seems much lighter
than a series, id, token method
and in ways more secure
 
8:24 PM
@Mike why more secure?
 
no?
 
@ircmaxell Great thanks
 
i guess not more secure, as you're still comparing server side series to cookie series
and server side token to cookie token
 
it's not perfect
since an attacker can hijack the session if he learns the sequence position...
and you can only identify the hijacked session when the valid user makes his next request
 
@ircmaxell It's impossible to create a 100% secure solution I think
 
8:26 PM
so an attacker can get in a number of valid requests before it's detected
 
@ircmaxell Damage control
 
i mean thats where remember me expires comes into play
 
Sure. Not arguing that, just pointing out why I haven't written about it...
 
And not give the attacker the possibility to change password or see sensitive info without confirming with password
 
now that i think about it wouldnt aseries hash be better?
instead of a counter ... e.g; c = 1
 
8:27 PM
@Mike the same AFAIK
 
its a hashed string which seems less likely to guess and match
/shrug
 
Well, then it would basically be HOTP
HOTP is an HMAC-based One Time Password algorithm. It is a cornerstone of Initiative For Open Authentication (OATH). HOTP was published as an informational IETF RFC 4226 in December 2005, documenting the algorithm along with a Java implementation. Since then, the algorithm was adopted by many companies worldwide (see below) and became the world's leading standard for event-based OTP authentication. The HOTP algorithm is a freely available open standard. Definition Let: *K be a secret key *C be a counter *HMAC(K,C) = SHA1(K ⊕ 0x5c5c… ∥ SHA1(K ⊕ 0x3636… ∥ C)) be an HMAC calculated with the...
 
6 in one 1/2 dozen in another
@PeeHaa i would make your <body> a lighter color
you ned contrast between your text and your body
 
@Mike k
@Mike What about a completely different color (extreme example)
 
read that article
it explains contrast
believe me, i suck at design which is why my portfolio uses a premade wordpress theme from themeforest :)
 
8:41 PM
@Mike Believe me when I say I suck more at design stuff. Sometimes I see something cool which I want to "steal". I start with it and building it into a page for example. Only to come to the realization I screwed up a perfectly find design and have a turd :)
 
same
 
find == fine
 
and i'm sure most progammers are the same way as you and me..
we write beautiful code, but shitty graphics is what i say.
also why i sub my design work out
great article on faux weights of fonts from ieshit
 
user895378
@Mike I'm not entirely sure ... all (good) design is an iterative/emergent process. It takes time. Whether you're designing code or page layouts. You can't expect to do good page layout design if you can't devote all your time to doing it.
 
@Mike Thanks for the headsup
 
user895378
8:44 PM
I'd venture to say that if you started working on your design skills all day long instead of coding, your design would start to get pretty good.
 
user895378
My code was pretty terrible when I started. Does that mean I could never be a good programmer? I hope not. I think the same mostly goes for aesthetic design too.
 
user895378
There are some people who just aren't cut out for certain things, but most have the inherent ability to be passable/good at something if they spend enough time on it.
 
Hmm dunno whether it is the same. I think I really just don't see how bad things look
 
user895378
@PeeHaa lol, well I'll refer you to my last statement :)
 
:)
 
user895378
8:47 PM
For the record, there's no amount of exercise or weight-lifting I could do to get large enough to play rugby. So there's that.
 
user895378
I don't know. It's the end of the day and I'm just rambling :)
 
user895378
^ When I stop being productive I know it's time to take a break instead of wasting time. Peace out homies.
 
ciao :)
 
Hello everyone!
 
@rdlowrey My typography skills are much improved, that's for sure. (Although I'm sure they are still quite bad)
 
8:52 PM
Guys, there is a syntax error in this code but my eyes seem to be missing it. gist.github.com/07b4dfb1771590e5ed42
 
@Gaurish You cannot do that with an array
concatenate it
 
@Gaurish This code is only eight lines long.
 
@Whi
 
logActivity("[Cactiapc] Monitor created. id=" .$data['monitor']['id']);
 
@Whisperity, @PeeHaa so error is with $data['monitor']['id] part?
 
8:54 PM
And of course, modify the second instance with the same method: logActivity("[Cactiapc] Monitor NOT created. Error Details:" .$data['message']);
 
@Whisperity Thanks, you are awesome! :)
 
@Gaurish :) As @PeeHaa said, you can't 'fetch' the value of an array key using the variable inside quotes. func("string $var"); will properly send the content of $var along, but it's a no-how if $var is an array.
 
@Whisperity what it I use {} brackets, would it work then? or concatenation is only way to do it?
 
@Gaurish Would work although would not be my preference
Note that you can only do that in a double quoted string
 
@Gaurish Would work, as $var = array("foo" => "bar"); echo "baz {$var["foo"]}"; produces the expected output: baz bar. But it just does not feel right.
By the way, how far does this foo-bar-baz kind of example-giving notes back in time? It seems to be pretty common over the internet.
 
9:08 PM
foobar is REALLY common, so not sure where did it came from
 
that's meme material
 
lol
 
So is Hello world. and calling the for-cycle's internal count variable i.
 
The terms foobar , fubar, or foo, bar, baz and qux (alternatively quux) are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation. They have been used to name entities such as variables, functions, and commands whose purpose is unimportant and serve only to demonstrate a concept. The words themselves have no meaning in this usage. Foobar is sometimes used alone; foo, bar, and baz are sometimes used in that order, when multiple entities are needed. The usage in computer programming examples and pseudo...
 
increment, integer, internal... I have no idea, but I see it commonly.
 
9:11 PM
iteration
 
when I was learning programming, our teacher taught us all loops with variable i. when guess, why only i, & not a,b,c. she said, her teacher taught her with i as well.
 
41
Q: Why do most of us use 'i' as a loop counter variable?

kprobstHas anyone thought about why so many of us repeat this same pattern using the same variable names? for (int i = 0; i < foo; i++) { // ... } It seems most code I've ever looked at uses i, j, k and so on as iteration variables. I suppose I picked that up from somewhere, but I wonder why...

 
so i guess variable i is something we all pickup early on
 
Public Function func_do_progress_bar()
for i from 1 to 100 step 1
for j from 1 to 50000 step 1
k = i + j
DoEvents()
next j
pbar_Bar.Value = i
End Function
These kinds of standards are the type of standards I love. Because they were never forced into you, never really written down anywhere. It's just became common and (unfortunately almost) everyone uses it.
I am, apparently, in a chatroom named Tu Daal Daal Me Pant Pant and I am like... what?
 
@CharlesSprayberry lol :)
 
9:25 PM
@PeeHaa :P
 
Looks like we are both curious creatures ;)
 
@PeeHaa Indeed
When it all started looking like gibberish I lost my curiosity
 
haha...its a hindi proverb, if anyone is curious
 
same here :P
 
A room on my favourite rooms list got suspended today and I am looking at the transcript at the moment. Not much more to dev as I'm too tired.
Speaking of which, how would you check for all the $_POST variables (that they have something value, not just default '') without making your code look like copy-paste?
 
 
@Whisperity foreach?
 
0
Q: PDO 2300 upon insert though no rows exist

ert3$compost = $dbh->prepare("INSERT INTO `table` (`PRIMARY`, `some`, `content`, `rows`, `and`, `boolean`) VALUES ('', :binded, :param, :inputs, :blah, 0)") ; the primary key iterates automatically and clasicaly this means my inserts do not need to give actual input for that column just ' ' is...

 
Please always post the full error output you receive. — rdlowrey 3 hours ago
 
yeah i get that but im not sure how to get bigger errors
anyone have some script lying around for verbose error reporting
 
error_reporting(-1);?
 
9:34 PM
i got my error via
echo "\nPDOStatement::errorCode(): ";
print $query->errorCode();
and setting error reporting to -1 didn't do the trick
 
Instead of erroCode to errorInfo()
 
@PeeHaa Now that you're, I'd like to know what you wanted: chat.stackoverflow.com/transcript/message/4484440#4484440 :)
 
Ah right. Let me think
 
@NikiC Seems to be an awesome extensions. Shame I use Firefox.
 
Right... What FF version are you on? @NikiC
 
9:38 PM
@Whisperity Was that the right ping?
@PeeHaa nightly
 
@NikiC Good. You may have to do some testing soon ;)
 
@PeeHaa You aren't serious, are you?
You mean
Does that mean
 
@NikiC I think so. You linked the transcript I found the extension in. I just checked I have Firefox 4.0...
 
maybe :)
It's not full blown, but I started working on it. And I think I almost got the basic ping and onebox functionality working
 
Great :D
 
9:41 PM
AH HA
figured it out big verbose error now i know whats wrong
 
It's way overdue (for which I'm sorry) ;-)
 
field that is not null is receiving null input
so i need to screw around in my DB
 
Hi all. I'm trying to get websocket (or similar bidi socket functionality) on Android Browser.
My current implementation also has a Flash polyfill/shim, so if the browser doesn't have websockets, it fallbacks to trying with flash.
 
@PeeHaa btw, re stackoverflow.com/questions/11437141/…. PHP does know what it should use, as the feature exists for internal code ;)
 
The problem, however, is the fact that Android phones almost always have a vendor-specific flash app installed. This flash plugin doesn't support sockets at all.
So, apparently, it's either using a different technology (BOSH, comet etc)
or telling the user to switch web browser (since chrome/firefox/opera mobile all support websockets) or install the real adobe flash plugin.
 
9:49 PM
@NikiC I read that as: I want to throw stuff into my method (say a variable of type string) and sometimes I want it to be by ref and sometimes I want it to be byval
mini mega ultra double ping
 
@PeeHaa That's probably how it was meant :D
 
:)
 
I also tried the java+applet route. But Android, as much as it's built on Java, doesn't allow applets in websites.
Unless there's a google/android-specific technology which I don't know about, there is no viable solution.
 
I tried to read his "use case", but my eyes just don't want to do it
 
Guys, any suggestions? Please be objective, I'm dead tired and anything fun right now sounds like insults.
 
9:52 PM
@PeeHaa I also had that problem :D
 
whoo new error code
00000Array ( [0] => 00000 [1] => [2] => )
now i just have no rows reaffected
 
@NikiC BTW best advice ever:
> My suggestion: Don't use references altogether. You'll only have problems with them.
 
Sometimes I really do wonder why I bother stackoverflow.com/questions/11432705/…
 
wow... post in the js room... nothing... 10 minutes later post it in here... closed in seconds.
due diligence at it's finest.
 
@rlemon You should know that by now ;)
ha. misping
 
9:59 PM
What would be awesome is a StackOverflow chat API. So we could chat here from empathy instead of needing the browser.
 
@PeeHaa What's a misping?
 
user557846
i like destroying some ones hopes and dreams by closing their question, but i'm not a nice person.
 
I pinged rdlowrey when trying to @rlemon
 
ahh mis-ping
 
@Whisperity stackoverflow chat makes it harder for trolls, skiddies, pervs and peds to join in (unlike IRC). That's enough reason to stay web-based.
 
10:01 PM
I see lol
 
Potato Potahto ;)
 
@Christian I'm all of those and I'm here :)
maybe not a ped!
 
@vascowhite Not for long.
 
lol
 
Anyhow, I'm off the websocket business. Some good night's sleep might clear the ideas.
 
10:03 PM
I'm off people. later
 
nite
 
@PeeHaa nooo
You have to work!!!
 
wow cool, phing has a trycatch task :)
 
@ircmaxell , have you read "Ranger's Apprentice" ?
(and I am asking you , because you are only one who might have)
 
The fantasy series?
 
user895378
10:16 PM
Apparently now I get pinged when someone pings @rlemon ... Dear Stack Overflow chat developers: that doesn't make any sense at all.
 
user895378
@PeeHaa Oh wait, never mind.
 
@rdlowrey Well indeed it does not.
Good night for now folks, see you later.
 
@rdlowrey How was your break?
 
10:36 PM
don't install flash debugger player if you want to be able to watch pr0n
@rdlowrey it's probably because you have 127.0.0.1 in your profile and it loops back to you
 
in Lounge<C++>, 10 mins ago, by Cat Plus Plus
http://piotrl.pl/2012/07/let-s-mock-php-users.html
^ just saying
 
@sehe this guy is mocking the wrong person... I guess he should have read up on fabpot before doing that ... snicker
 
@PeeHaa I meant code. The code could benefit from a little bit more contrast.
 
@sehe @CatPlusPlus seems legit
 
@markustharkun You know, I didn't even notice it's Symfony author. It makes it much more hilarious.
 
10:48 PM
@CatPlusPlus the problem is, you picked the wrong guy which makes you look stupid
you'll see, I hope
 
No, I picked the guy who wrote an adorable blog post.
 
@CatPlusPlus yeah, but many of your assuptions, which would have had quite a high probability to be true, are now completely wrong
 
@markustharkun ...like?
 
like How many languages do you actually know? Let me guess, PHP and JavaScript. and everything along that line
 
That's how that post reads.
 
10:52 PM
well... you're biased :)
 
Let's see. Blog. Posts about PHP. More posts about PHP.
I'm biased how?
 
oh, so you're the 1 person on the planet who isn't :)
 
@CatPlusPlus You are just as biased as fabien ;) He has the pro-php bias, you have the contra-php bias ^^
 
Right.
 
@CatPlusPlus yourlogicalfallacyis.com that's how...
@CatPlusPlus yep, right, show me what you've written in PHP and I'll tell you if you have any right to bash the language
anyways, I'm hoping for fabpot to write up some response, that's all, because the fact that you picked him, is most funny :)
 
10:57 PM
Sorry, my only remaining online PHP thing is crappy even for PHP standards.
It's a funny argument, though. Show me what you've written in few languages that are not PHP, and maybe I'll treat you seriously.
 
well then, I think the right to bash comes with experience in a certain language...
 
we all agree that PHP sucks, but you are pointing at people...
 
I think that's true for every language
 
You're adorable, too.
 
10:58 PM
@CatPlusPlus Hey, you're the cat!!! You must be the one being adorable!
5
 
cat, what's your aim?
 
Please tell me more about my inexperience with PHP. :allears:
 
to be an elitist asshole?
 
@markustharkun Fun.
Always.
 

« first day (634 days earlier)      last day (4296 days later) »