« first day (1193 days earlier)      last day (3981 days later) » 

19:01
ARGH why is it hexdec but hex2bin?
PHP!
Yeop. I think we refer to that as the "bag of dicks" naming convention.
What is the equivalent of List<Object> (C#) in PHP?
lol, oh boy, here we go. Seriously though, probably just array().
yeah, looking on SO I only found arrays
What are you trying to do? Store only objects, or store only objects of a certain type, or store anything?
19:10
store only objects of a certain type
class MyObject(){}..
List<MyObject>...
You either need to build an ArrayObject with validation on get and set, or do the validation in whatever code expects the array to contain only specific types.
ArrayObjects are a pain in the rear.
Most builtins that want arrays don't like to take ArrayObjects.
This was the C# code: paste.ubuntu.com/6793251
And now I need a similar function for PHP
@Lucio You'd want to do something like this 3v4l.org/mnpV4
user924016
^
user924016
yep, a collection with iterator is mostly what i use
19:13
If you know that the function providing the array is going to always return a list containing the specified type of object, you don't really need any validation though.
And in order to have any strongly typed *Collection class, you'll need to create every type of collection class.
@DanLugg i did not get this.. T-T
@DanLugg yes that is great, but do I need to go so down? Isn't there something already to use
more specifically >> you'll need to create every type of collection class.
@DanLugg exactly, that would be a pain
user924016
19:15
@Lucio you can use a array
Oh ho ho ho... Guess what the topic of the week is? GENERICS! YAY!
user924016
hihi
@RonniSkansing I see, that could be simpler
Honestly I'd sooner:
function is_array_of($array, $class) {
    foreach($array as $v)
        if(!($v instanceof $class))
            return false;
    return true;
}
and use that as validation when you absolutely need it.
@Lucio What you're using in C# is called a generic type; ICollection<T> is a good example. Currently, there's a fair bit of jimmy rustling going down on the topic. I have no idea what's going to happen, but I'm hoping at the end of it all we can expect to see generics in PHP.
user924016
19:17
i would go for x[]
Ok, I'll go for arrays
@RonniSkansing I still don't see the advantage here, over a more robust generics implementation.
BTW, who is Jimmy?
@Lucio He's the one getting rustled.
@Lucio Google: rustle my jimmies
Slang for "makes me upset"
or in this context, "makes other people upset"
Adding type enforcement to a loosely typed language? That's a rustlin'.
19:19
lol
user924016
@DanLugg i think it is simple, readable and makes me get rid (and refactor) of my collections
@Charles Optional type checking.
(pedant: wrong message)
@DanLugg Yeah, but I'd personally sooner just see them fix Traversable / Iterators / ArrayObjects to be used anywhere that the builtins expect an array so we can just do it in userland. :p
@Charles Yea, do it in userland with generics. Traversable<T>
You guys are amazing!
Will try with arrays and see what happens
@DanLugg Yeah, but you still can't pass that to any of the builtins that take arrays.
@HamZa Mind == blown
user924016
object !== array imo..
user924016
Interfaces for specific behavior on objects i think makes sense.
@RonniSkansing Exactly, but we have objects that the language tries to treat as arrays, but it does so in a half-assed way. I'm an advocate of full-assing that problem.
...
@RonniSkansing I don't get what you mean. I don't want object === array.
I just want array === Traversable
user924016
19:25
@DanLugg i agree =] I do not think that a single implementation should be able to make a object act and be usable in native array methods.. like array_merge
I want to be able to pass a Traversable to array_keys for example... Okay, so that'd be an Iterator, whatevs.
Well, unfortunately I'm sure plenty of optimizations have been made around array, therefore expecting to pass your home-brew Traversable into array_* may not be do-able.
user924016
@Charles i think you are right, there a some issues. But is not something i encounter when i use php day to day..
But at least I'd be able to write function f(Traversable $t) and you can call f([1,2,3]) or f(new MyTraversableBanana)
@DanLugg That would be nice, at least...
We have a function in our code called is_valid_array that we use in those cases.
19:28
@Charles is_array($a) || ($a instanceof Traversable) ??
user1994804
Howdy Gang, Im using PHP to generate an XML sitemap but am having difficulties extracting images from pages. Any ideas on how to do such a thing?
@DanLugg basically
@Charles I'd have named it is_foreachable ;-)
@YourAdrenalineFix images or uris?
@DanLugg that's pretty much exactly how it's used, as it happens
user1994804
19:30
Not sure
if (is_foreachable($banana)) foreach ($banana as $peel) ...
user1994804
Is this correct?
user924016
@YourAdrenalineFix do you know the difference between a image and a uri?
user1994804
if (!strpos( $filestring , '<!-- no-rss -->')) {
fwrite($file,'<item>');
$filestring = str_replace("&", "&amp;", $filestring);
$filestring = str_replace("'", "&#39;", $filestring);
$title = GetTextBtwnStrings($filestring, '<title>', '</title>');
$title = '<title>'. $title . '</title>';
$desc = GetTextBtwnStrings($filestring, 'content="', '">');
$desc = '<description>' . $desc . '</description>';
$DisplayImg ='<image:image><image:loc>http://www.your-adrenaline-fix.com/image-files/*.*</image:loc></image:image>';
user1994804
I must not PeeHaw
user924016
19:31
@DanLugg foreachable($banana, function( ...
user924016
=]
♫ Goodness, gracious, great walls of text! ♫
@YourAdrenalineFix Where do you extract anything?
@RonniSkansing Well, you don't peel it all at once, do you? I iterate over the peel segments.
;-)
user1994804
$DisplayImg ='<image:image><image:loc>http://www.your-adrenaline-fix.com/image-files/*.*</im‌​age:loc></image:image>';??
user924016
19:33
@DanLugg hehe, ill go make food for the miss now... ttyl
Later gator!
user1994804
Sorry @PeeHaw I dont know how else to respond
user1994804
Im over my head
user1994804
@PeeHaa This is the complete file your-adrenaline-fix.com/rss.txt
user1994804
If you wouldn't mind assisting me with this I'd be most appreciative
user1994804
19:37
I basically just want this to pickup one image from each page which houses an image so I can include such image with the title and description of each post
user1994804
(Where images are avail)
Use dom document and getElementsByTagName('img')->item(0)->getAttribute('src')
user1994804
Thats JS isnt it?
@YourAdrenalineFix That's DOM
DOM isn't JS exclusive.
user1994804
I dont know how I would incorporate this into my PHP file
user1994804
19:40
Sorry... Im just still at a loss
user1994804
<--- Novice
user1994804
$ImageIWantToUse = getElementsByTagName('img')->item(0)->getAttribute('src');??
@YourAdrenalineFix Read up on DOM and specifically the DOMDocument class.
@DaveRandom that php manual linker is epic
How's that going, not done anything on it? XD
user1994804
Will Do, Thx
@MadaraUchiha you mean php manual links are automatically formated like that?
19:45
@reikyoushin Yes
cool! didn't know that till now
When I type ClassName or FuncName it'll automatically link it
It's an extension
ah,, i thought putting the link will change it from the php.net url into a [Class](URL) format
@reikyoushin No, when I type ClassName it'll automatically link it for me.
how i wish when i put a php.net link it will become a metabox.. >:P
@MadaraUchiha and that is only valid here in room 11?
19:48
@reikyoushin Yes
@MadaraUchiha oh, i thought it's an SO extension.. not a browser plugin..
@reikyoushin Chrome extension
And I think I can make one to onebox php.net manual links as well
user895378
Sorry in advance for testing the php manual linker ... Exception ... hmm ... what did I do wrong?
@MadaraUchiha but, it won't be seen by the other users not using the extension..
@reikyoushin Right, which is a shame
19:50
@rdlowrey have you installed the chrome extension already?
user895378
Just now. Lemme restart my chrome ...
@MadaraUchiha if ordinary people can write SO extensions/plugins.. how i wish..
user895378
:/ not working for me unless I'm supposed to do something other than "ClassName" inside backticks?
Is it active in chrome://extensions?
@rdlowrey Try without the ticks, but with (). Example: substr()
user895378
19:53
substr() and testing without parens: substr <-- nope, only works with parens.
user895378
oh, there we go.
if its a function, you need to append ()?
user895378
I kind of wish it would capture only inside bacticks. Moar test: substr | Exception
@rdlowrey But should work without them if it's in backticks: substr
Auto-linkifier?
user895378
19:55
oh, now it's working ... didn't work for my first test with Exception ... not sure why.
user895378
@DanLugg yeah. Hadn't used it before. This is sweet, @DaveRandom!
@rdlowrey Restarting the tab is a must
> Also converts 'Google "term"' to add a link to the Google search results for 'term'.
^ this one's cool
Yea, I have it on my home-box; haven't bothered here.
19:56
^ nice, love it!
must install... *drools*
I'm insane, and hate the fact that before and after are 6 and 5 characters long respectively. Is there any other reasonable terminology in the context of events? pre/post are the same problem.
Exception ... did not work
enter/leave is the only alternative that comes to mind, but that has fairly a specific use context in my head.
backticks are required?
user924016
I/0
19:59
Google "me"
I/O are a bit too obscure; in/out same problem.
@reikyoushin Either backticks or parenthesis.
user924016
@DanLugg ---oral/anal----
5
user924016
lol
in foreach how to add data from two variable to one variable in each round?
user924016
20:00
how do i strike stuff
---strike---
---strike 2---
@DanLugg What do you want? same number of characters?
user924016
@PeeHaa thanks
20:01
---out!---
@MadaraUchiha Yes, because to partially quote @RonniSkansing, I'm anal about that shit.
user924016
@DanLugg implode/explode
user924016
is a good one
@DanLugg b/a
You can always go retard and do befor/after :P
user924016
20:03
beginnning / endendning
@DanLugg hehehehehe
@DanLugg THERS ERS ERPERC, LERL
foreplay/sleeping
@DanLugg That's a good one
It'll have to be for a very brief event... *ba-dum tsss*
enter   exit
before  after
start   finish
begin   end
end and exit have no same-character compliments, so they're out.
enter
before  after
start   finish
begin
20:13
@DanLugg start stop?
HAMMERTIME!
I'm thinking enter begin and after.
I just don't get it now.. What is the best way doing this.
foreach ($xpath->evaluate('/ICECAT-interface/Product/ProductFeature') as $featureNode) {
$title = $xpath->evaluate('string(Feature/Name/@Value)', $featureNode);
$data = $xpath->evaluate('string(@Presentation_Value)', $featureNode);

echo '<tr><td>' . $title . ':</td><td class="tech_info_table_left">' . $data . '</td></tr>';
$query3 = $connect->prepare("UPDATE tuotteet SET ominais = :ominais WHERE id=:id");
$query3->execute(array(':id'=>$row3['id'],':ominais'=>$title));
@rdlowrey A reddit thread right up your alley
user895378
Oh no, I'm afraid to look.
user895378
20:28
@Fabien Well I've been trying to answer those same questions for about two years now and my mind still changes pretty frequently :)
heh. It was either going to be a nightmare post or not :p Technically still could be.
> The biggest issue, obviously, is the "Referer" header.
^^ lol
The star-board has my name positioned rather closely to the words "anal", "oral", and "feces". Do I need help?
Which option did you choose?
@DanLugg I wonder what kind of help it is that you're looking for...
@Fabien Me? begin/after.
@cspray I'm looking for help picking out a credenza.
20:40
I did finally get the thing working
And the choose for arrays was good
Maybe I should go with enter though. Shit.
This is the final code: paste.ubuntu.com/6793678
See, in my mind, I've modeled the "timing" of events around function invocation like this:
before, (invoke), enter, begin (execute), end, leave, (return), after
Where (invoke), (execute), and (return) are the actual points in the call.
@DanLugg @CarrieKendall @RonniSkansing thx for the advices
random ping is random
20:43
@CarrieKendall is also random...
creeper ;]
Randomly creep-tastic.
~o~o I'm a creep....Im a weirdo ~o~o
Good tune.
not when i sing it ;)
20:46
♫ What the hell am I doing here? ♫
@DanLugg if i had to guess, to enjoy all of the engrish and disruptive comments
@DanLugg phpbarding?
ohhh, rhetorical, right then
My singing has garnered quite the response from the room 11 community.
I should probably do it more often.
@Ocramius Wat?
@phpbard
♫ I am a bard from a land far away, ♫ Where elePHPants frolick, code, and play. ♫ I muse and I croon about frivolous things, ♫ Like PSRs, RFCs, and PHP kings.
23 tweets, 81 followers, following 146 users
20:52
Hi all.
@Ocramius Insta-follow.
user895378
@CarrieKendall Your mom is random. BOOM!
@rdlowrey my mother passed a few years ago.
^ boom?
user895378
@CarrieKendall I know. She exploded into a fine mist of "gotta have @rdlowrey all the time" ...
20:53
@rdlowrey tricky play, gg
Question: How stupid of an idea would it be to create an SSH connection and then put it in a session variable (assuming I'm going to be the only one using the thing that is setting the session)
That rode the slightly-uncomfortable-rail for a few moments.
@krakjoe @philsturgeon $foo = new Map\Tk\Tv(); Overload __autoload to create the collection def on the fly. Could do entirely in userspace.
^ we talked about that yesterday… even Sara would do it that way ;-)
^^ I did that already, it's a borky solution.
@DanLugg good thing me and @rdlowrey are willing to stoop to the same level of shenanigans :P
20:56
;-)
@VoidWhisperer you're trying to store a connection in a session?
Danack: I need to pass it from page to page easily :X
since reconnecting to ssh over and over seems like a rather stupid idea
user895378
It's true: I have little to no regard for anyone's mother. Least of all @Lusitanian's.
@rdlowrey i'd say you've got balls to say something like that but after talking to my mother.. better for your sake we don't go there ;]
3
@rdlowrey what about your own mom?
:p
20:57
@VoidWhisperer I don't think you can store anything 'resource' like in sessions. The connection will be dropped when the current request finishes.
user895378
@CarrieKendall lol nice!
@rdlowrey Considering he's a dog his mom really is a bitch
Same as file handles.
Danack: so I have to keep opening up SSH sessions every time I want to send data to my server.. which is fairly often..
Fun.
@PeeHaa would you say he has tan fur? .. ;]
20:58
:-)
@VoidWhisperer Or have a separate process that is long lived, and each request sends data to that other process, which then passes it through the connection.
user895378
Or use node.js
Danack: How would one go about doing that?
rdlowrey: eh....... sounds complicated. xD

« first day (1193 days earlier)      last day (3981 days later) »