« first day (717 days earlier)      last day (4238 days later) » 

user50049
2:25 AM
@ircmaxell Must be contagious. My laptop is now making that signature "kathunk .. kathunk" noise that only failing 2.5" drives can make.
 
user895378
2:45 AM
Oh, no! Don't put the kibosh on my laptop hard drive!
 
user895378
Everyone needs to stop talking about hard drive failures right now.
 
user895378
I just can't deal with having to restore from a backup #1stWorldProblems
 
user895378
RAID is great and all, but if my consumer-grade laptop disk fails I have to whip out the screwdriver and shell out some cash for a new one.
 
3:10 AM
@rdlowrey I think you'll appreciate that video
 
user895378
3:36 AM
@Lusitanian hehe nice
 
is there a efficient way to query the database to get the totals of a field value when you need to check 4 times ? for example... total horses brown, total horses black etc

Currently i do a query for each colour (4 in total) in a loop but would rather the query calculate all four in one query ?
 
 
1 hour later…
4:44 AM
heres my attempt but i got stuck stackoverflow.com/questions/12684591/…
 
Hi PHPians
 
5:38 AM
@Dave check out the GROUP BY clause in SQL 1keydata.com/sql/sqlgroupby.html
 
 
1 hour later…
Sem
6:46 AM
Good morning everyone
 
 
1 hour later…
8:49 AM
@Gordon Worked out why the behaviour changed with that pass by reference function yesterday (it was bothering me)... because it was recursive, and he was array_shifting an empty array it was passing null explicitly to the 2nd param, so the is_null check was being fired for every iteration. The func_num_args() version would have fixed it, because it would have been 1 with the default arg, and 2 with an explicit null passed.
 
and morning all
 
@DaveRandom Any particular reason why? And morning
 
@Leigh Because he randomly requested access to

 cv-pls test room

A room for testing the cv-pls browser extensions
 
okaay ;)
 
Not for the first time I wish I could somehow get chat to make the family fortunes wrong answer noise
 
9:03 AM
morning
 
9:20 AM
Damnit, 16 hours late on creating a new tag :(
 
good morning fellow closevoters ;)
@Leigh which one you had in mind?
 
@Leigh Were you going to create ? :-)
 
@PeeHaa I have something I'm going to call a release candidate, all (known) bugs have been worked out and there is a build on the downloads page of my repo. Needs a couple of days of real-world testing and then I'm happy to merge. We could do with a brief discussion to see if you can come up with a way to remove some code smell that has been introduced in order to handle the error with notifications.
@hakre ^ same @you
 
@Leigh ah I see. yes, too late. I once introduced a new tag, and then got a badge for that after some time :)
 
9:31 AM
@hakre I want a badge! :(
Time to write a new language - who wants to code in boobiescript
 
delete votes are at 5k right?
 
@Leigh Ehm, I think 20k
 
bah
5k is "vote on tag wiki edits", how boring
10k is delete
 
@Leigh You can't cast "immediate" delete votes until 20, you have to wait I think 6 hrs after the question is closed
 
Sem
9:42 AM
@DaveRandom What do you think about TypeScript? Good for the js-only frontend framework idea?
 
morning
 
Sem
Good morning @tereško
 
Hey Marty :D
 
@Sem I think I know basically nothing about it, I also think that <quickly reads some articles> if it essentially spits bog standard JS out the other side that it's CoffeeScript with a different hat on. I'll have a play around with it at some point this week, and then I'll give you a real opinion when I have one worth giving. My gut reaction is one of NONONONONONONO though...
 
It produces nicer output than CoffeeScript tbh
(i.e., it produces readable output)
@hakre browsing my answers... btw, that answer is wrong, I should really delete it.
 
9:54 AM
I currently think that "compiling" to high level languages is a complete waste of time
 
Sem
@DaveRandom Aye, well same goes for me :) I guess the improved OO approach should get the most attention.
 
I'm far more interested in stuff like HipHop and V8
 
@DaveRandom Compiling sounds wrong... transcoding?
 
@Sem For improved OO read "an inheritance design tending more toward classical" I'm guessing from a cursory look at it, which as discussed at length by numerous people who are a lot better at JS than I am, is a complete waste of time.
@Leigh It's all "f**king up" in my book. I may live to be proved wrong though - although somehow I doubt it.
 
@Leigh which answer?
 
10:01 AM
here is something you guys need to understand :
 
@hakre The "strange hex date conversion" one, that I posted a cv-pls for ;)
 
does not look that wrong. also some useful comments below.
 
> google, "coffeescript": 2,090,000 results
> google, "coffeescript AND rails ": 1,880,000 results
 
Sem
@DaveRandom Hmm, well don't most epic JS devs advise you to not have a class structured front end in any way?
 
We have different google: 2,060,000
 
10:03 AM
the details my vary
the point is : most of the people who are pushing coffeescript are rails users
learning proper javascript is too hard for them , that's why they use coffeescript with jquery
 
@tereško > google, "php and boobies": 7,590,000 results
so php and boobies is more popular than coffeescript, Q.E.D.
 
you would get a lot of result-poisoning , because of file extension
 
lalalalala, not listening
 
@Sem Not something I've heard being pushed emphatically, surely it would depend more on what you are doing? I can't see how any of the really complicated stuff like FB would be maintainable without classes, but for the simple form validation/nasty little animation stuff that probably accounts for 95+% of Javascript I imagine that a class-based architecture is pointless, I've certainly never bothered.
 
@Sem no sure what is "epic dev" , but JS professionals recognize that trying to force class-based-paradigm on top of javascript is pointless
javascript has objects and prototypes
 
Sem
10:13 AM
@tereško Oh you, saying you don't understand but saying what I meant anyway :) IF Why is a class-based-paradigm so anti-pattern then? If that's the case why the hell are we even applying this theory in PHP / C++ etc.? It's just a way to organize and since domain objects mostly have their own way of showing themselves in HTML why not make a class that does that?
 
@Sem because javascript is not a class-based laguasge
it has prototypes instead
different paradigm
also WTF:
> since domain objects mostly have their own way of showing themselves in HTML
 
Sem
Well the information you're showing in html is related to information from objects most of the time :)
 
@DaveRandom this little raytracer example is nifty: typescriptlang.org/Playground - does not have that many classes.
@Sem or from arrays. or just from json chunks or directly from XML. Depends how you do that I'd say.
 
Sem
@DaveRandom It might be that we're both used to organising more complicated ideas in the back-end. Which doesn't happen as often in the frontend. Mostly just parsing and making things interactive. And because we're relatively unfammiliar with using prototypes for those ideas compared to using classes we tend to use classes. Just basic thinking here :)
@hakre which will be used for HTML eventually, right?
 
10:29 AM
@Sem can be, sure. but I wonder about which kind of domain objects you speak. Those on the server-side?
 
Sem
@hakre yeap
 
Please , explain "domain object" in your own words. What it is supposed to do.
.. while i make breakfast so that i dont the the urge to rip off someones face
 
@Sem then HTML is used for a subset of the data and structure those can provide.
But you should not pass the domain objects themselves into the HTML/browser.
 
good morning
 
@Sem In a way I think what is really required is a definition of terms. A "class" in JS is not declared using the keyword class and in a sense it doesn't exist at all. I incorrectly refer to a JS object constructor as a class, which is a habit I shall try to break immediately. Really the difference is in the inheritance structure, that's where prototype vs class actually matters (as I understand it).
@hakre I'm not really seeing how writing that in TypeScript gives an advantage. The JS isn't any less readable, I think.
@NikiC Good morning and welcome to a heated debate about something that likely none of us will ever use.
 
10:46 AM
i think it's the DOM that confuses him
 
good morning @nikiC
 
@DaveRandom TypeScript?
 
@NikiC TypeScript indeed. Care to offer your thoughts on the matter?
 
Only looked briefly at the spec yesterday
And for the time being I'd say I like it ;)
Mainly because, well, it's typed, and I recently started liking strictly typed languages a lot more than dynamic ones.
Also I quite like how they didn't try to "improve" the JS syntax like CoffeeScript did. Because I really hate CS and how it makes everything very short to write, but very hard to read. TypeScript is much better in that regards. It's not particularly compact, but it's rather clear.
 
Sem
@tereško Could you elaborate? :)
 
10:55 AM
you did not answer the question
 
@NikiC That is a solid argument I suppose, but I still can't get past
1 hour ago, by DaveRandom
I currently think that "compiling" to high level languages is a complete waste of time
 
Would you also say that CSS preprocessors are a waste of time?
 
Sem
@tereško Oh sorry, saw no question mark, get your syntax right man! Well as far as I know a domain/business object in the model layer is a class based on a set of properties and links to other domain/business objects. Which you can control with CRUD.
 
@NikiC CSS is not programming language. That said, the only thing that css preprocessors should introduce would be reusable constants .. btw , you might also notice that the whole "css preprocessing" thing is mostly pushed by rails community too
 
Sem
@tereško Like less CSS?
 
11:02 AM
@tereško Sure, it's not a programming language. But CSS preprocessors are very similar in that they provide a rather thin wrapper around a high-level "language".
 
@NikiC It all just smells too much like Wasabi to me. It's only a matter of time before some clever dick at MS says "hey, this seems have become popular" (which I'm sure it will) "...why don't we see if we can embed ActionScript" (or Silverlight or <insert other client-side technology here>) "...into it as well?" and it'll all go to shit very quickly. IMHO.
I am currently out. However I may get in once I've actually properly played around with it.
 
11:40 AM
user image
2
 
Sem
@Gordon Back to topic please
 
@Sem it's spot on ;)
 
Sem
@Gordon Alice in wonderland? I don't think so :D
 
@Sem but aint we all mad in here?
 
There's a saying
If you're in IT, you're either new, or you're nuts. And I've been here for a while...
2
 
Sem
11:45 AM
@Gordon No were talking about PHP here, not MAD en.wikipedia.org/wiki/MAD_(programming_language) <-- needs to be in the URL :/
 
@ircmaxell lol
@Sem but we are mad about php
 
I told that joke on an interview once. I realized half way through that I was about to insult them. I finsihed it anyway. And I've been in that job for 1.5 years, so I guess that's a good sign...
 
Sem
@Gordon No, I'm not mad! (As mad people who think they're mad are not).
 
@Sem :)
Twinkle, twinkle, little bat!
 
@ircmaxell what GPS module did you go for?
 
Aye, ok already looked over that one. It does seem the most convenient to use.
 
It was simple to wire up too. 4 wires. Power, Ground, and two serial pins
 
Not very impressed with the quoted startup times though.. 30 odd seconds for sat aquisition
 
@Leigh if you reduce the distance to the satellite you should be able to reduce the time.
 
@hakre Sure, let me go and dust off my space suit...
 
11:55 AM
yeah, physics is great, right? you have a good solution for every problem then at hand.
 
@Leigh Yeah, but that's all of them...
 
@ircmaxell Looking at using a nano board too, seems to auto select power supplies, but just lacks the DC jack, so can still be powered from a battery pack. Just need to make sure it can still power the motor and display with the reduced number of pins
 
No, you can't
the power supply on board isn't strong enough to power a servo
 
On the nano specifically, or in general?
 
Actually, never mind
I did do that
I would definitely recommend sparkfun.com/products/8904 for controlling power from the battery
 
12:01 PM
Would still be 4x 1.5V cells - and yea that module was mentioned in the article you posted yesterday,
problem is sourcing all of the parts in the UK without having to spend almost the same amount on shipping fees
 
Well, if we thought of it earlier, I could have brought a lot of it over on Thursday ;-)
 
Oh, I have time, I'll never make a November birthday or Christmas, so I have a year to toy with ideas :)
 
I used radioshack.com/product/index.jsp?productId=2102845 to hold the electronics. The center two busses were +5 and Ground (+5 off of the arduino's regulator)...
Then I mounted the polo over the bus (straddling it), and the servo control header on the side of the board (crossing both busses and a normal pad for the control header)
I also implemented dual inputs for power using a diode isolator that both fed into the POLO's input...
 
I don't think I'll be using a breadboard. I think I want to keep everything low profile so I can put a fake bottom in the box (aside from the servo)
I'm favouring the nano for the micro usb that I can expose as the emergency/backdoor directly, as well as doubling up as the external power supply
 
Well, it's not a breadboard. It's a solder prototype board. It adds trivial depth, but makes organizing SO much easier...
@Leigh I did the same thing. I exposed a B USB. And I had it listening for debug on the serial interface. You entered the password, and then it would accept commands such as "Unlock", "Lock", "Reset", "Status", etc)
 
12:09 PM
will probably go for a clone board though.. £33 for official, £10 for clone
 
sure
And do use a breadboard while you get it all wired up and tested.
 
hah, you should have seen my setup with my last usb dev board, it was just a ball of wires
 
The circuit needs some things, such as a capacitor (for preventing the spike in current draw from the servo from knocking out your board), and resistors for the LED. It's better to play on the breadboard as you get it wired, and then transition to the prototype board...
 
I didn't even solder them, twist+tape
I have a decent stock of resistors, plenty of dead hardware laying around I can probably salvage capacitors and diodes from, if I can identify them
modtraders.co.uk/… - I have one of these, and I was also using the 16K version, which were £5 (!), but don't seem to be stocked anymore
 
Interesting
One thing, the CPU uses single precision floats. So you will lose a lot of info in any floating point arithmetic. So be careful... I found the maximum accuracy I could get between the GPS and the floats was about 50 meters...
 
12:17 PM
@ircmaxell Why the sigh?
 
I'll have to see if I can find the old code, I set it up as an emulated keyboard and used the EEPROM to store a seed/count. was basically a DIY yubikey
 
@NikiC Eih, I don't know...
 
12:34 PM
@ircmaxell just found this by accident kickstarter.com/projects/kenburns/… slightly cool :P
 
interesting
 
Hi all
 
good morning for those in america
good evening for all others
Can someone tell me if it's really good to use a ORM like redbean?
 
@MikeBoutin for most of europe its about 1445 right now, so more afternoonish
@MikeBoutin that depends on what for. but why not use doctrine2 like everyone else does?
 
12:47 PM
is it fast?
 
Sem
@MikeBoutin ORM is not made to be fast.
 
ok
is it very slower
 
Sem
@MikeBoutin Depends, but if you're not familliar with ORM it might be best to do what @Gordon said since it's one of the most populair at the moment.
 
ok
i'm learning Yii framework at the moment
So ill keep the query builder and the normal sql queries
ty for your answers ^^
 
1:01 PM
> The global namespace also holds all internal PHP definitions, like echo(), mysqli_connect(), and the Exception class.
 
The link slug is misleading, namespacing in PHP 2 ...
 
@Leigh I suppose they edited it or something.
Still, the whole article is somewhat misleading.
 
@Christian Why do all of their namespace declarations under "Defining a namespace", include curly brace syntax, and no file-scope syntax.
 
Lots of small errors everywhere.
 
.. and they then use the file-scoped syntax later on, misleading indeed.
and the comments.. oh the comments... If they don't see any use for namespaces, they're obviously working on tiny codebases.
 
posted on October 02, 2012 by Qafoo - PHP

Features of object oriented languages are often use from a purely technical perspective, without respect to their actual semantics. This is fine as long as it works for you, but might lead to problems in the long run. In this article I discuss the semantical differences between abstract classes and interfaces. I also outline why following the semantics of those language constructs can lead to b

posted on October 02, 2012 by Henri Bergius

The new stable series of the Midgard2 Content Repository library was released recently. This series builds on the long-term supported Ratatoskr series, adding some new features: Asynchronous I/O operations with the content repository Easier migration from the Midgard1 series Asynchronous I/O is important when the content repository is used in persistent applications like desktop softw

 
@MikeBoutin you might find this relevant stackoverflow.com/a/7767323/727208
the bottom line is this: ORMs are good when you need to write something quick , simple and with no intention of expanding or maintaining it
 
Maintaining it?
 
@Christian Write and forget.
 
1:18 PM
@MadaraUchiha Yeah, I have a dictionary too.
 
I was asking @tereško why it is expected to not maintain an ORM
:5593182 Again why is that code unmaintainable?
Of course depends on how it has been written...
 
because in everything but the simplest applications you will start hacking around the ORM
 
But that doesn't mean any code that merely touches an ORM is magically unmaintainable, is it?
 
also , you have to keep in mind that almost all ORM systems in php use activerecord pattern
 
1:22 PM
@tereško really?
Last I checked, mine was nearest to what you call activerecord.
 
Sem
@Christian The more abstract you make things, the less flexible it will be. That's all to it.
 
http://stackoverflow.com/questions/12691084/period-counter-app
 
The rest of the big guys out there use all sort of buzzwords and deception even when all the talk is unrelated to what they do.
 
@Christian , only popular PHP ORM system that does not use activerecord pattern is Doctrine2
also , it seems that you do not understand the difference between pattern and implementation
 
@tereško Anyway, my point is, if you use ORM correctly, the code can still be maintainable.
 
1:23 PM
@Christian what did you mean by "Last I checked, mine was nearest to what you call activerecord." ? Care to elaborate ?
 
Simply refrain from using the orm interface when it comes to complex queries.
 
@Feeds Thanks! You just found me a new blog post topic!
 
It got deleted, the comment was funny :(
 
@tereško Nothing much, most framework's AR pattern implementation is awry.
 
1:25 PM
awry from what ?
 
What I wrote in the past is smaller in features but more elegant and to the point than say, CI's crap.
 
Sem
@ircmaxell W00t! With the title you're either new, or you're nuts about abstract classes and interfaces can't wait :D
 
@Christian it has nothing to do with continuous integration
 
@tereško XD I meant CodeIgniter :D
 
martinfowler.com/eaaCatalog/activeRecord.html < this is as much as activerecord pattern definition is ... you seem to be missing that point @Christian
 
1:27 PM
:-X
 
@ircmaxell lol
 
off to work, later
 
@ircmaxell The interface vs abstract class one? I just scanned the article, it's pretty terrible.
 
@Leigh my point indeed
later
 
"Their only "benefit" over abstract classes is that you can implement multiple of them in a class" - sadface
 
1:28 PM
@Leigh wow .. this is usually the point where i hand the person more rope , with "please, elaborate"
 
@tereško I said implementation. Just because some says he's following the standard doesn't mean the gray areas are well thought out.
@tereško ok, I'll be short.
 
@Leigh WHAATTT?? I'm not exactly brilliant at OOP but even I know that's a complete load of bollocks. People like that should be banned from owning blogs.
 
@DaveRandom I'm not sure if he's trying to say it's an example opinion, or his own. The quality of English is somewhat lacking.
 
@DaveRandom that's the most common answer in interviews when asked "explain difference between interfaces and abstract classes" .. it as soundbite-level answer , which is usually given because person rushed things
 
@ircmaxell Kore says you are very welcome to write a blog post and he's well aware that it's a controversial topic
 
1:33 PM
@teresko I consider an orm to be a solution to a specific problem, not to completely replace(hide) the database interface. Lots of the implementations out there took it to the extreme, giving them a bad reputation. AR? Same thing. I think my implementation is to the point, predictable and easy to use. It doesn't pretend to do anything more than that, unlike the competition. Then there are AR implementations which simply suck.
 
@tereško Really? If I was going to sum it up in a sentence I would say "Abstract classes can provide method implementations and interfaces cannot.", multiple inheritance seems like a secondary consideration to me. (although like I say "I'm not exactly brilliant at OOP" so please correct me if I'm wrong in any way there)
 
With that, I think I'm off to finish another blob of work. :) cya later.
 
Sem
@DaveRandom , what would you say you're best at? :)
 
@DaveRandom Multiple inheritance isn't really secondary.. implements ArrayAccess, Countable, Iterator
 
@Christian the significant feature of AR is that you get domain logic and storage mechanism in same class. The AR-implementing ORMs usually provide the "storage logic: part in a class that you have to extend.
@DaveRandom , interfaces describe contract, that object has to fulfill to be used by structure (another object of function). Abstract classes provide partial implementation, that has to be completed
 
1:37 PM
@tereško Indeed, no reason why your abstract class can't also implement the interface
 
@tereško Exactly. If every PHP AR out there did just that, why you could just copy+paste the code around. Except they don't.
You could say I kept to the significant feature of AR.
 
that does not make you implementation in any way "superior"
 
@tereško Define superior.
 
1:41 PM
@tereško Hmm, didn't say anything about PHP or the art of programming.
 
19 mins ago, by Christian
Last I checked, mine was nearest to what you call activerecord.
this is actually quite astonishing level of arrogance
 
@Sem I don't even know. I come from a telephony and network engineering background so probably that, most of the programming work I do is sys maintenance scripts and small internal systems. I quite like network programming which I suppose may be a little telling.
 
@tereško Arrogance? I'm just proud of what I did.
Wouldn't you be when the rest of the codebase out there just isn't up to that level?
 
i find it hard to be proud of any code that i have written more then a month ago
5
 
Sem
@DaveRandom And are you hired as a programmer or as some sort of all-rounder?
 
1:46 PM
@tereško Well, take it this way. It's old, it's starting to stink, and it's still better than the competition out there. If I had to go back on that code, why I'd rewrite it completely different. Still I think it's the kind of code where the concept is perfect.
 
@Leigh What I meant by "secondary consideration" is that it seems to me to be quite clear cut. If you want multiple inheritance, you probably want it for type hinting, so you definitely need an interface. If you want to provide method implementations you want an abstract class.
 
Sem
@tereško hope you're at least proud of your helpfull answers here on SO :)
 
Sure there are bugs lurking in there, but it's the concept of it all.
 
@Sem I am hired as "IT guy" and it's pissing me off dealing with end users and not being able to concentrate on anything for more than 5 minutes at a time. Also I'm currently try to rationalise a system which cannot be rationalised as I'm fighting 15 years of ridiculous paper "systems" and users who do not wish to do it any other way.
 
As an analogy, 4 years ago I wrote this stupid PHP function to convert an integer in bytes to a human-readable form. Over the years, it changed very little. Yet I'm amazed to see that most implementations out there don't perform that much, or are seriously flawed. Well, I'm kind of proud to see that function top ones in popular frameworks.
 
Sem
1:50 PM
@DaveRandom I can recognize a pattern there :)
 
You'd think all this bullshit about community and open source would change the quality of software. :)
 
@Christian Isn't that just unpack()?
 
... seems to me quite good definition of "arrogance" , I would be surprised in anyone else in this channel would hold up a 4-year-old piece of his/her code as an example how good he/she is at programming.
 
@DaveRandom unpack?
 
@Christian "convert an integer in bytes to a human-readable form" - unpack()?
 
1:52 PM
@DaveRandom lolno
10 => 10 bytes 1024 => 1kb
@tereško Oh, no. I don't show it off around. I'm just comparing the quality of code.
 
@tereško yeah, should wait til it's five years old. you know the whole Gran Reserva thing …
 
lol
which reminds me that i need to create an X.O. folder in the "old code" directory , for the sake of my own sanity
 
@tereško wait, you don't rm code? Thought you said you threw away your code a month after it's written.
 
@Christian Oh right. Well, when you say yours "[tops] ones in popular frameworks" how do you determine it to be better?
 
@DaveRandom Simplicity of use.
 
1:57 PM
@Christian , and that's where it gets thrown into .. i tend to raid that folder for css and sql tricks .. and for forgotten lessons , like "stop making form generator, you already tried that once !"
 
@tereško XD
Well, form generator doesn't top the competition.
 
@Christian Well a) that's a very subjective criteria, and you will be naturally biased towards your own work and b) how complicated can it be? You pass an integer, you get a string back. I'm not saying your code is rubbish, I'm just pointing out that you will not be your own harshest critic.
 
in my experience the CSS and SQL code is much more rot-resistant then PHP and JavaScript
 
@DaveRandom Wait, what are we talking about here, my AR implementation or the 4-year-old function I mentioned?
@tereško Well, you hit a point there. It's mostly tricks that are rot resistant.
 

« first day (717 days earlier)      last day (4238 days later) »