« first day (730 days earlier)      last day (4204 days later) » 

> I can't load it from a file because it is many vars and so on that won't work proper
@PeeHaa That guy is a pure and simple
 
@PeeHaa What caused you to start trolling that guy?
 
@DaveRandom 11k user who still doesn't know how SO works always deserves a visit of the profile. I mean no matter what way you find crap crap should be gone right? :)
huh?
no onebox?
does it onebox for you?
 
No.
Wierd.
 
8:11 PM
strange
maybe because its closed?
 
Both are 404's
 
@Camilo: I suppose people would pick up on that, but it just goes against what I think people have come to expect from ui elements like treeviews. And yeah I know most web buttons use the hand cursor. Just my opinion that it is superfluous... :) — Marjan Venema Nov 8 '10 at 14:32
 
Yeh it's deleted
 
ah right :P
lol
 
8:12 PM
You can't get deleted q's from the API, as we know from
 
@DaveRandom I thought it was still undeleted, but @cHao did his work :D
undeleted = not deleted btw
/me needs some English calibration
 
Now it's unundeleted
 
@PeeHaa needz moar english
 
lol
 
Hopefully it won't get ununundeleted
 
8:14 PM
$('#PeeHaa').teachLanguage('English').toLevel('A+');
 
I'm being unindated!
 
@SomeKittens wow
> to cover with a flood : overflow
nice
beer... check. smokes... check. Let's build some cv plugin
 
(figured I'd provide the definition with the pun due to the ESL'ers here)
 
posted on October 15, 2012 by Chris Shiflett

Last year at Brooklyn Beta, I kicked things off by sharing a couple of lessons I had learned. This year, the first couple of days were pretty hectic, but before I introduced Maciej Ceglowski on Friday morning, I shared a couple of new lessons I've learned: 1. It's okay to miss out. I learned this lesson from my experience reading the responses from our parents, brothers, sisters, BFFs, aunt

 
@Lusitanian You're not qualified to teach English, you're American. You need to learn it first. You have no idea how much it pains me to write CSS. Color/Center indeed.
 
8:16 PM
colour
centre
 
Good boy. Now I want 500 lines of "Queen Elisabeth is my sovereign ruler and I bow to the mighty English." on my desk before lunch tomorrow.
 
@DaveRandom Hard to argue with a skydiving monarch
 
lol
 
@Lusitanian lol
 
8:18 PM
Ahoyt hoy
 
@DaveRandom happy?
 
Sup @ircmaxell heard you were in Manchester recently. How was that?
 
Twas good. The conference was aweosme
Now, sitting in a hotel in Paris...
 
Hope the city wasn't too scary. :)
 
@Lusitanian Your submission is satisfactory. I've got my eye on you boyo...
 
8:20 PM
@DaveRandom div { colour: red; text-align: centre }
 
@GordonM I've seen far scarrier
 
huh
 
@Lusitanian @ShaquinTrifonoff I know it's been posted before but addedbytes.com/blog/if-php-were-british
 
heh
 
@DaveRandom seen it
 
8:22 PM
@DaveRandom I've seen that before too :-)
 
brb fag break
Oh by the way @ShaquinTrifonoff for reference: Chrome (on XP at least) respects the system's ClearType settings, and mine were set to "off". Apparently IE uses ClearType regardless of the OS settings. Now I've turned it on (by use of this my text looks much nicer. Although I hadn't even noticed until you pointed it out.
 
ugh cleartype
 
@GordonM I'm not sure I like that suggestion. I've lived in Manchester my entire life and I've never been knifed once. Not fatally anyway.
 
8:30 PM
@DaveRandom actually, yes. This question is useless.
 
@MatthewMcGovern imho that is terrible practice and I really doubt that being that common. And don't say: "but it is in the manual" because that is something that will be "fixed" soon :-) — PeeHaa 1 min ago
 
@DaveRandom LOL Manchester isn't so bad, just wish it didn't rain so much. and there were fewer ninja cyclists.
 
@GordonM You're in the wrong country for rain, let alone the wrong city. I agree I am getting tired of pulling cyclists out of my radiator grill though.
Where in this fine town are you hiding out then?
 
I cycle. But I do it in the freaking road, obaying the freaking road rules and with some freaking lights on my bike if it's dark.
Don't live in Manchester itself. am out in the sticks
 
user1125394
@DaveRandom city or utd?
 
8:36 PM
Nope
Footballers make me physically ill. :)
 
Sep 23 at 23:44, by DaveRandom
@vascowhite Honestly, I have searched high and low, I cannot find less of a sh*t to give. I will check again though.
 
user1125394
ur right
 
@DaveRandom BUUUUUUGGGGGG!!!!!!
not really but BUUUUUUG!!!! :P
 
8:40 PM
@PeeHaa NOOOOOOOOOooooooooooo.........!!!!!1
What?
 
Looks like we have to upgrade to extensions v2. I cannot pack it in its current state on chrome v24
Lemme try stable chrome for a sec
Hah. It still works on stable. Will add it to my list though to change the version to 2. Just need to find out whether there will be compatibility issues.
 
@PeeHaa I was looking at all that stuff but I couldn't be rsed sorting it out at the time, you mean chrome.extension.sendRequest() vs chrome.extension.sendMessage()?
 
@DaveRandom Not sure yet. I am being redirected to this when I try to pack on canary build. Meh issue for later. First let's build this one
 
user1125394
@PeeHaa they r not backward compatible?
 
According to that document there are some changes. But nothing to worry about I think
@Jocelyn do you have a cv / devl request ready perhaps?
 
8:48 PM
@PeeHaa not right now. I can suggest some...
 
do your thing. I need to test the latest build of the plugin
 
thanks
 
@PeeHaa OK we should be fairly safe, manifest V2 has been supported since Chrome 18, and specifying minimum_chrome_version: 18 will prevent updates from being pushed to users running older versions. Aside from that I can't see anything in the deprecated features we use but I will double check. This all falls under the umbrella of the refactor for the FF port anyway, which is next on my list.
 
8:57 PM
It's new. It's fresh. It's better. It has less jQuery. It's the new version of the cv-pls plugin: github.com/downloads/cv-pls/cv-pls/cv-pls.0.19.0.crx
7
@DaveRandom I have some uncommitted files of the FF port, but I think they are mostly obsolete by now :| To push or not to push?
 
@PeeHaa I've not really even looked at it properly yet, been busy reading the Moz API docs, so if you think they're worth having as a jumping off point, even if they get totally rewritten then go for it.
 
k done
 
@PeeHaa , you should stop abusing innerHTML
 
@tereško That might have been me, if you're referring to cv-pls
 
@tereško Although I am a abuser of innerhtml this time it is @DaveRandom :)
 
9:04 PM
yes , i am referring
 
@tereško What specifically are you taking about?
 
well .. i would narrow it down to github.com/cv-pls/cv-pls/blob/master/cv-pls/script.js ... as a whole
 
self.element.innerHTML = '<span class="cvhelper-vote-request-text">' + self.element.innerHTML + '</span>'; // Required for strikethrough to work
 
self.element.innerHTML = '<span class="cvhelper-vote-request-text">' + self.element.innerHTML + '</span>';
?
 
y u no create domnodes
 
Should be a document.createElement() I agree. But the whole thing needs sorting out, need to replace some jQuery with XPath
 
this.getOneboxHtml = function(question) {
AUGH MY EYES @PeeHaa shame on you :D
 
@tereško Yeh now that wasn't me :-)
 
That's definitively mine
:)
 
@tereško Those links would have a bigger impact with PR's ;)
 
that links???? really ph :(
 
lol OK we get the idea.
 
9:09 PM
.. and i was just skipping over
 
@PeeHaa Your code has ruined my mood :( [not that I haven't abused just as much]
 
@Lusitanian I confess. I am the JS raper
 
it's just that i know that you can do better
 
@PeeHaa Tell me more about this "DOM"
What does it do? Does it enable us to...manipulate what the user sees on the screen without writing HTML in our javascript?
 
There will be a heavy de-jQuery-fication on the cards in the near future, don't worry.
 
9:12 PM
@tereško I do. I don't know how it all got in there. Must be my cat. But seriously you are right. It's just that there are sooo many parts in it that need a lot of love. I promise you once it reaches v1 it will stop hurting everybody's eyes
@Lusitanian Döner Oriented Metatags?
:D
 
lolol
 
DOM: write more, kill less kittens
 
@PeeHaa I think we just got told. Where's @hakre, he should be here to take his fair share of punishment as well.
 
^ not grammatically correct, but wanted to tie kittens in.
 
:)
Damn I lost my dupes list :(
 
9:16 PM
@LeviMorrison Depends how you're killing them. It may be possible to have a non-integer number of kittens, then you can say less.
@PeeHaa Yeh that sort of sucks that it eats the localStorage when you remove it, I've not been able to think of an effective workaround yet.
 
Maybe @Gordon can setup an API to store and retrieve verified dupes. Would be nice to have a central list of dupes
I do think it also wouldn't be a problem if I could get the damn auto update working
 
@PeeHaa How do you define "verified" though? Do you mean a manually maintained list or somehow automated?
I'm hesitant to add anything now until I'm happy that new features will require minimal porting between platforms.
 
@DaveRandom Dunno. Maybe add an option to easily share dupes between users.
@DaveRandom Yup. FF first. new options later
 
@PeeHaa We'd need to be careful. Anything automated would inevitably fill the DB with dupes and it would very quickly turn into something that is no better (or possibly worse) than the site search
 
Something to think about
btw manifest v2 doesn't look that bad at all
 
9:27 PM
No I've just been flicking through it. I don't think there's anything deprecated in use apart from sendRequest() which should be simple to swap out, then the manifest just needs sorting.
 
user1125394
10:02 PM
I bet you can do a mvc cv-pls plugin
 
can someone pls show me easy way to make select option with values from 0 to 36 with those values (0, 0.5 , 1 , 1.5 , .......)
 
@goodmood use a for loop
 
<?php
echo '<select name="foo">';
for($i = 0; $i < 36; $i += 0.5) {
    echo '<option value="' . $i . '"></option>';
}
echo '</select>';
?>
 
@ShaquinTrifonoff thx exactly this :)
 
CAM
MongoDB assistance?
 
10:07 PM
@ShaquinTrifonoff i was litle not sure how to write it in side select tags , thx so much
 
CAM
schema
[code]{
"_id" : ObjectId("507c7888eff8e7b61b000000"),
"company" : "me",
"duration" : [
{
"length" : 0.082
},
{
"length" : 0.012
}
],
"events" : [
{
"user" : "",
"unique" : "a5976f2b0ab6f2923c7d1b0a94229ad6",
"type" : "scroll",
"section" : "Visit the Office",
"time" : 1350334518,
"name" : "n/a",
"scrollDepth" : "0.33"
},
{
"user" : "",
"unique" : "a5976f2b0ab6f2923c7d1b0a94229ad6",
"type" : "click",
"section" : "Welcome",
"time" : 1350334596,
"name" : "n/a",
"scrollDepth" : "0.17"
}
],
"id" : "20",
How can I count the number of clicks?
the mongo MR / Aggregation examples are a lil over my head
 
@CAM I don't understand. Where are the clicks to count? What is the data? An array? An object?
 
CAM
@Jocelyn in the type key
 
DI + Registry, does it make sense?
function do_something($reg){
    $reg->db->prepare('whatever');
}
 
CAM
10:13 PM
I am actually doing so in PHP, I was looking for the alternative in Mongo Syntax
 
I don't use mongo and don't know what it is
 
CAM
Mongodb.org
 
argh!
 
welcome back @hakre
 
I hate that. You've got a library and then it does not work and so what? Original author kills the readme on github and just puts in: Well you should not use my library. No more comment. WTF.
 
10:18 PM
@hakre I think it's short and ... to the point.
 
@Christian Actually I would have known why that guy closed it down. That would be actual some useful info.
I can perfectly understand if an author says: "I'm out". But for the sake of the users, it's good to know why.
 
@hakre And you've got an issue with that? No? Open one. Problem solved. :D
 
lol, yes, I'll try to fix it right away. If it works out I'll fork for sure.
 
Of course proper DI would work with using $this->reg, I just threw that code for the sake of an idea.
 
@Christian Is that a service locator?
 
10:29 PM
@PeeHaa Why, yes it seems it is.
Glad it has a name and it's got some nice text on wikipedia.
 
well I'd say if the $reg parameter has some interface that code would be speaking.
 
Sadly, it seems it's got quite some disadvantages.
 
apart from the high level stuff, this is actually just a function ;)
and the problem is that you don't pass $reg->db directly but indirect.
 
And that then turns that thingy problematic.
 
10:31 PM
@hakre Yes it is. Funny how much of a difference a few lines of code may have.
 
@Christian yes, but still it looks like having lack of an interface.
 
@hakre Well, you could @var IName the reg property or something.
Still this "myth" think seems a practical problem of the concept.
 
The Law of Demeter (LoD) or Principle of Least Knowledge is a design guideline for developing software, particularly object-oriented programs. In its general form, the LoD is a specific case of loose coupling. The guideline was invented at Northeastern University towards the end of 1987, and can be succinctly summarized in one of the following ways: * Each unit should have only limited knowledge about other units: only units "closely" related to the current unit. * Each unit should only talk to its friends; don't talk to strangers. * Only talk to your immediate friends. The fundamental no...
Aaaand I'm out
later all
 
true ™ dependency injection is also inversion of control. if you introduce a layer, you should do that consequentially.
@PeeHaa: Have a good night!
 
Thanks :)
 
10:35 PM
And LoD came to my mind, too ;)
 
OK, let's try to solve a practical problem.
So, I have user class with a method that calculates whether it can do something with a particular application.
in the application class, I would have an event (method) which calls the user method for checking this role thing.
Something like so:
class MyApp extends App {
    public function on_load(){
        if(!$current_user->can('load', $this))die('Access denied');
    }
}
So, I suppose that $current_user should be passed to the app instance on creation - through regular DI.
The problem is, how do I know the application might need $current_user or not?
 
@Christian Ask it politely?
3
 
@SomeKittens That deserves a vote :D
As I get it LoD specifically says I shouldn't be doing what I just did.
So I suppose something in between these two objects should be doing it instead?
 
@Christian exactly :)
@Christian you can put that into a layer of it's own, yes, however, the furthermost problem I spot here is the use of die.
 
10:43 PM
@hakre Well, how on Earth would I do this instead? :/
@hakre Oh, die just an example.
 
there's a problem with die()?
 
There's better ways.
Such as invoking $this->unload() with an error code.
Or just throwing an exception (depending on how bad the situation is).
 
@SomeKittens there is always a problem if you terminate the execution of application in the middle of it
 
oh, ok. I assumed there was some broader issue. Carry on!
 
use of die() is a code smell
 
10:45 PM
@tereško depends on context, but here it is obviously wrong.
 
/me comes from Joomla background, where every file has a die() at the start
 
@SomeKittens Oh, that's the old fashioned way.
 
@Christian misko.hevery.com/2008/11/11/… - Don't look for things.
 
@hakre well .. as rule of thumb , die() signifies design issues in code
 
^- again this is Law of Demeter.
 
10:46 PM
The new way's with an .htaccess denying everything.
 
Joomla is Phoenix oriented :P
 
@Christian no , the "new" way is to keep stuff out of DOCUMENT_ROOT
 
@tereško Absolutely. Especially as it's worth to refactor that out of the code. If you can't you spot a lot of interesting areas to refactor.
 
@hakre Is there a particular part I should watch? I mean, so far, it's quite obvious. Except the edge cases where you actually need something that you can't have because the idiot that coded it (that would be me) didn't think you would need such a thing.
 
@Christian If comment that way I'd say whatch the whole video ;)
 
10:52 PM
@hakre uhm, mkay.
Damn
I think I've found my issue.
I've been looking at it the wrong way all along.
My problem is instantiation.
 
@Christian yes, that is a central part to make one's mind about.
 
@hakre Well, I didn't realize. The system was being designed to instantiate applications automatically.
As such, it can't "customize" what the constructor needs
 
Divide and conquer. Misko Hevery names that the "Two piles" of objects. youtube.com/…
So you have one part of your system that takes care of the instantiation and the other part that does "the work".
 
@hakre Yup, that's how it was.
 
Hey people, I saw the description so I'll just shoot!

This is sort of PHP(or webdev) related, if it doesn't fit here, just tell me and I'll leave quietly, no escorts needed!

Alright, recently I've been messing around with some web programming for phones and stuff and in one instance noticed that loading loads of youtube vids on multiple devices kills your bandwidth

Can anyone put some perspective into me on how much bandwidth the popular web integrated things take?

EG:
Youtube
Facebook chat/comments
 
11:13 PM
@Hobbyist Media streaming (audio/video) eats bandwidth. All the rest of them are text based so should use peanuts
sorry, x-room fail
 
Thanks for the quick response!
A few other things came to my mind just a second ago, lol

What about things like RSS feeds?
 
@DaveRandom well the fun starts extending that list I'd say. That were only some examples, but at least @Hobbyist should filter the top 1k of Alexa ;)
@Hobbyist feed them in. Just feed them in.
 
Haha, maybe I should ask for the blacklist instead, what other dangers are there other than streams?
 
Misko's saying I don't trust my self. /cries
 
Tek
Anyone know basic python? I have a very basic question
 
11:17 PM
@Tek Basic python is like PHP. Shoot.
 
Tek
Yeap but the scope is confusing me
def string_to_list ( text_lines ):
    "Inserts lines into a list."
        mixed_data_list = []
           for data in text_lines:
            mixed_data_list.append( data )
        return mixed_data_list
err
basically it says mixed_data_list is undefined
Wish I could indent here lol
 
you can, just click "fixed font"
 
Tek
ah, thanks
 
def string_to_list ( text_lines ):
    "Inserts lines into a list."
    mixed_data_list = []
    for data in text_lines:
        mixed_data_list.append( data )
    return mixed_data_list
 
Tek
Yeap, anyways I'm getting a name 'mixed_data_list' is not defined
 
11:19 PM
^ say, my indentation guess is good! First Python badge acquired!
 
@Hobbyist Just XML, text based. Consider this: If you go download, say, an episode of some TV show that's ~22 mins long. If you go for the old-style scene xvid avi they will be ~175MB and mediocre quality. Well, there's not that much to be gained in efficiency terms from switching to FLV like Youtube uses. Now consider that 100KB is very big for your average rich HTML page, and a lot of it can be cached. It doesn't take much consideration to see where this is going...
 
@Tek I just checked the docs, it should work.
 
Tek
Right? Not sure why I'm getting that
 
Tek
lmao I made some dumb mistake
I was printing it in the wrong scope
sorry, my bad
 
11:22 PM
:D told ya
 
Tek
I had to scroll all the way down
I forgot I had it at the bottom and not in the function
Thanks
 
Welcome
 
Alright, thanks Dave and thanks hakre, I'll be off!
 
no it's not :)
ah wait, there is maybe something in that direction, rdlowrey has some library offering dependency injection based on parameter hints.
 
Yeah, found some hints around. not really what I was hoping for.
Another question
Misko mentioned several times the fact that with DI, you start with one small object and it keeps growing - creating different dependencies at each level.
With the first object possibly being a factory.
That sounds sensible to me, but I'm curious about one thing.
At some point a lot of services need to be created at the same time since they depend on each other.
The problem I'm seeing is that two classes might expect each other's instance in their constructor
Effectively, a deadlock.
 
11:33 PM
actually you never should have a situation with circular dependencies
it means that you did something wrong
 
@Christian a true deadlock is more with threads which is not a problem with standard PHP.
 
Probably if it the classes got broken further down it would get fixed. Actually, that's probably the problem - they weren't designed correctly in the first place.
 
if A depends on B and B depends on A , it means that your abstraction is wrong
not "flawed" ... simply "wrong"
 
@Christian yes, shift the problems out there. A and B depend on C, inject C firsthand.
 
Ok, adding to this.
Let's say there's this DI (class, left depends on right):
A > B > C
D > E > A
So there's kind of two instances of A.
And D isn't supposed to pass A because of LoD
 
11:38 PM
I'd say that is much too theoretical. Like what @tereško wrote, if there is a circular refenece (not in that example), then you did something wrong.
 
Well, I'm kind of concerned about this:
Let's say there's a DB instance which some developer really needs somewhere.
But it doesn't usually pass through to there normally.
You could create a new instance, but that means a new db connection.
 
then you smack around said developer and ask him/her , why he/she wants to cause the layers to leak
 
Can I put that in the code comment? :D
 
no matter what pattern you are using , you usually will have a set of storage abstractions which interact directly with database
those abstraction all would be same "level" structures , usually created by same factory to facilitate the sharing of DB instance
 
@tereško In my case, I had 3 levels. Low level access to dbi (core set of functionality to call db, think pdo). Mid-level access to dbi (with some predefined statements and easy object-to/from-db). High-level access to dbi (activerecord etc)
 
11:44 PM
well ... active record, IMHO, is an antipattern .. at least in the common implementation
 
@tereško Glad it's your HO :D
I'll try to not force anyone to use it.
The end developers of my system see that as an advantage, so unless there's a good alternative, I can't just throw it away.
 
i think you cold mitigate some of the inherit flaws of AR by introducing DAOs in it
the rails-like interpretation of AR has been rotting code in almost every community
 
@tereško That actually made me think about something.
 
the pattern is acceptable only in two cases :
- fast prototyping
- extremely simple domain entities with no joins
 
If Product extends DatabaseRow, I can't make it somehow extend FileDatabaseRow or something, which might be required in some specific case.
 
11:48 PM
extends means IS-A
 
@tereško Exactly. So I'm tightly couple Product class with DB system. That can't be good, right?
@tereško I guess that has something to do with LSP?
 
yeah , it's bad , especially for something called Product ... that structure maps to multiple tables in database
 
@tereško Several? Why is that? It only maps to a product table.
 
and how many other entities are tied to it ?
 
Anything else, like categories and stuff is coded by the developer inside that class, but it is external to it.
Something like so:

class Product {
    public $categoryId;
    public function category(){
        return $this->categories->find($this->categoryId);
    }
}
I don't see it break LSP though, can you explain how?
I mean product acts exactly as its parent class....except that data is saved somewhere else... is that wrong?
Then again, whoever is calling load/save/delete shouldn't really care where the stuff is going or indeed what is going on.
 
11:57 PM
ehh ..
 
I think I'm gonna get a shower and an espresso. 2 am is feeling a bit blurry. :D
 
you have Product instance , searching for categories and returning instance of Category
does it really seem right to you ?
 
When you put it like that :D
Good point there.
On the other hand, if I did provide the category, I would unnecessarily run SQL code to get data that might not be needed.
 

« first day (730 days earlier)      last day (4204 days later) »