« first day (1936 days earlier)      last day (3026 days later) » 

8:14 PM
@YourCommonSense What exactly do you mean, "there is no such thing like displaying a stacktrace"?
Because, frankly, that statement is wrong.
 
@jbafford The php manual says here that "If your application does not catch the exception thrown from the PDO constructor, the default action taken by the zend engine is to terminate the script and display a back trace."
But zend engine never does such a nonsense.
 
... yes, it does.
 
when display_error setting is set to 1.
the default typically is 0
 
is it? That's certainly the recommendation for production systems, but I'm fairly sure the default is 1.
 
8:29 PM
hmmya. maybe the hosts set it manually to 0 then. I wouldn't know what the default really is. just that often, I have to manually set it to 1, when code runs on shared webhosts or things like ampps
 
@jbafford what zend engine really does is converting an exception to a fatal error.
 
ok, so?
the effect is the same
 
no
again, zend engine don't do no such stupid things like displaying anything
like every lame PHP code does
it does emit an error message.
this message could be displayed, if corresponding setting is on.
 
Yes, that's taken as a given. And the default value on that setting is on.
 
8:33 PM
that's another matter.
from this false assumption this manual page goes on:
 
It's not that it's a false assumption. It's that it's the default behavior.
 
stating that " It is your responsibility to catch this exception"
which is bullshit again
 
The manual can't attach a "* when error_reporting and display_errors is enabled" disclaimer every time it documents an error that could be displayed. That's wasteful.
 
it shouldn't attach "always catch an exception" either
and it is not "every time". in this place it rants on this very topic
 
What's bullshit? That it's your responsibility to catch the exception? Or that the manual says that it is?
 
8:36 PM
but offers completely misleading solution
the former one
 
Well, if PDO throws exceptions, and you don't catch it, you're going to have a bad day.
 
oh.
you php guys are really funny
 
So what exactly do you think the programmer should do in this case?
 
in fact, most of php losers having a bad day catching exceptions.
because they have no idea what an exception is and what it's for
 
Catching exceptions is not the problem. Catching an exception and then ignoring it is.
 
8:40 PM
beside ignoring you also handle it wrong way
but let's back to not catching
what kind of a bad day you think it is
@jbafford ok, i have to answer first. A programmer should handle his errors. All errors. Not only one selected kind of errors, but any error. This is what a programmer should do.
 
No disagreement here.
 
so, then it doesn't matter if you catch PDO exceptions or not
then
if you handle errors properly, an uncaught exception will be handled as well
 
How are you suggesting handling errors "properly"?
 
well, this topic is quite irrelevant
 
It's quite relevant when your entire argument is based around error/exception handling.
 
8:50 PM
say, for the different environments I'll use different handling strategies
no.
my argument is simple: despite a widely shared superstition, there is no need to catch every exception. You may, but it's not obligatory. What you really need is to handle errors for your site.
That is all you need. while catching stuff is irrelevant to reporting errors.
tats two completely differnt matters
 
And, now we're going around in circles, so I'm done.
 
but manual entries like this make a strong connection between catching exceptions and reporting errors
while there is no connection at all
but you think there is
that's your problem
 
Yes, there is a connection: If you don't catch the exception, you get an error.
 
it's all right
getting error if there is an error is what you desperately need
 
...
 
8:56 PM
an error message is your friend
not a foe like poor php folks think
 
Ok. My common sense is telling me to stop talking to you, because it's only going to end with a palm-shaped indentation on my forehead.
 
it's ok.
may be with time you will learn
by the way. So, you terrified by the idea of uncaugh exception. Ok, you caught it. What would you do with it now?
 
9:49 PM
@YourCommonSense I couldn't agree with you more about not displaying errors on production. The problem that I see however is that people screw up and are leaking credentials when they don't expect it. I.e. the db server crashed and "oops" you are going to have a bad day.
!!version
8 messages moved to bin
 
So, what is that "bin" room for? Is that just a way for room mods to remove messages without deleting them?
 
> It's a bin, for binning things.
 
You can only delete your own messages (within some time frame)
So it's a way for room owners to remove messages
 
cool. Figured something like that was the case.
 
hey guys, I have to make commenting system with users registrations in PHP+Mysql for some project. I plan to use Laravel. They asking me to use 'binary tree' in this project, so can someone point me to the direction of what excatly is binary tree model in this sense ? Is it about designing database schema in Mysql ? Is there any nice tutorials about this? thanks...
 
10:05 PM
!!wiki binary tree
 
In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. A recursive definition using just set theory notions is that a (non-empty) binary tree is a triple (L, S, R), where L and R are binary trees or the empty set and S is a singleton set. Some authors allow the binary tree to be the empty set as well. From a graph theory perspective, binary (and K-ary) trees as defined here are actually arborescences. A binary tree may thus be also called a bifurcating arborescence—a term which actually...
 
@Nikanor what context are they asking for you to use a binary tree?
 
ern
Hi I have a question stackoverflow.com/questions/35183286/… ... Which is put hold on as opinion based(I think that's not fair) ..
I usually implement dependency injection/design patterns/etc.. So i never used $GLOBALS or global variables or passing by reference .. But want to learn If there is a scenorio which makes sense to use $GLOBALS or global variables .. Thanks .. Or is it really a personal preference to use them or not ..
 
> Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions,
 
if you need to use $GLOBAL you are doing it wrong in 99.99999999% of the cases
 
10:06 PM
Use globals when you can't be arsed to write any tests...
Or you want to punish your future self.
 
if you think you have a 0.00000001% case you are probably doing it wrong
 
ern
faÅŸr enough thanks..
*fair
 
They ask for 'implementation of binary tree rather then recursion" . That is the only info they gave me. And the project is about making commenting system in MVC framework of choice and MYSQL db.
 
"implementation of binary tree rather then recursion" doesn't make sense. The two are not mutually exclusive concepts.
 
it does....
 
10:10 PM
although it's probably way easier to iterate a btree if you're using recursion.
 
There are a few slides in there that describe several different ways of implementing a decent schema for comments in an SQL DB.
 
thanks man
 
The short version is that with some structures you can write all the queries you will want to write in a way that takes only one query, rather than having to repeatedly touch the DB.
They probably are using the wrong word of 'recursion' rather than repeating, as they probably made that mistake themselves once, and used recursion for the implementation.....but the problem is just the repeating.
Let me see if I have some code....
 
Ok, yes, that makes a lot more sense.
 
No, apparently I don't have any code, that is in any state to be shared. The relevant code is on the slide though.
 
10:21 PM
thanks, i am just going through slide and reading some stuff from google so i will come up with tree like database schema for comments soon. just need some time.
if anybody can share some similar examples from the web i would be thankful
 
You are very likely to want the one that involves "TreePaths" rather than the other ones - if you are having a comment system that involves threading.
 
who wants to create a small team and create a application?
 
what i dont understand is the fact that binary tree has two childs. But what if there is a more child comments below the root comment? I will do it logically..
 
@ShaigKhaligli how much are you paying?
 
nothing
:D
we can get experienced
 
10:25 PM
@Nikanor ....maybe just ignore the binary part of their request......look at the examples on the slides and there is a better implementation that a binary tree.......though it's also possible that they have another reason why they want you to use a binary tree.
 
to store the elements in the binary tree form is not much difficult.
Create table with fields 1)element 2)level 3)parent_id in it
is this the answer?
 
Putting the data into the table isn't the difficult bit. It's getting the comments out in one query that is difficult. I suggest reading the slides or book.
 
If the group noun given to languages like PHP, Javascript, Ruby and Python would be scripting languages, which group noun would be given to languages like Java and C variants?
 
compiled languages?
 
I had the same thought, but isn't PHP technically compiled?
Like, into opcodes or whatever
 
10:34 PM
For some sense of compiled, sure.
"Ahead-of-time compiled languages"
 
That's quite a mouthful
I wonder if there's a more concise way to say it
 
well, Java wouldn't necessarily be in the same bucket as C. Remember that it started out interpreted to begin with, and (never?) compiles directly to machine code (only to Java bytecode)
 
ern
@QuolonelQuestions I'd rather call python and php as Multi-Paradigm Languages..
 
I'm sure you would, but those ones are not really up for debate
 
And you could lump python into the same bucket as Java: You wind up with .pyc files that contain the compiled (into python's bytecode) code.
 
10:43 PM
Does Python have to be compiled?
I thought it could just interpret scripts
I used to just call compiled languages "programming" languages and interpreted languages "scripting" languages
 
Python compiles scripts into bytecode and executes the bytecode
 
As if scripting was some inferior variant of real programming
 
same as php. Only difference is, python leaves the compiled bytecode on disk, and PHP chucks it out.
 
I seem to remember you can just feed Python a script and it behaves the same way (chucking out the bytecode)
 
maybe, but that doesn't change the fundamental nature of its execution model (tokenize-parse-compile-execute)
 
10:46 PM
I guess the distinction that's more fundamental is that they're desktop languages
For writing native applications
 
If I were naming things, you'd have: interpreted (e.g. bash: read the file line-by-line and execute as you parse); scripting (anything that compiles to a bytecode); compiled (anything that is intended to target assembly), and then you have sharing of concepts between all three.
well, what does "desktop" and "native" mean when you have things like PHP-GTK?
 
lol what
 
PHP-GTK is a set of language bindings for PHP which allow GTK+ GUI applications to be written in PHP. PHP-GTK provides an object-oriented interface to GTK+ classes and functions. While PHP-GTK partially supports GTK2, GTK3 isn't supported at all. == History == PHP-GTK was originally conceived by Andrei Zmievski, who is also actively involved in the development of PHP and the Zend Engine. The idea was received well by the PHP community, and more people started to get involved with the project. James Moore and Steph Fox were among the first to join in, contributing a great deal to PHP-GTK through...
 
I've heard of things like tcl tk, and I suspected there would be stuff like that for Python and other hipster languages
But I've never heard of something like that for PHP
 
There's nothing stopping someone from writing, say, Cocoa bindings for PHP. Just they'd be insane to do so.
 
10:49 PM
The Julia programming language is an interpreted, just-in-time, machine-code-generating language.
 
@LeviMorrison See, there's bound to be some clown out there who's broken all the rules
 
Well, I don't think Julia is a clown.
 
>Stable release: 2.0.1 / May 16, 2008; 7 years ago
 
@LeviMorrison all at once? Or can be used in all three contexts?
 
10:51 PM
IIRC, Forth is also fairly weird.
 
heh, LLVM is going to eat everything, eventually.
 
What problem does LLVM solve? Cross-processor-architecture instructions?
 
ern
@QuolonelQuestions That was why i put python and php as the same category under multi-paradigm languages..There is differences..Like OO or OO capable.interpreted or compiled..But they are really similar..There is not a really right way to solve a problem for both languages and yes everyone hates python developers..
 
If you'd said everyone hates PHP developers then I would have known where you were coming from. They all hate us cuz they aint us innit xDDDDDDDDDDDDDDD
 
11:01 PM
LLVM is a generic compiler infrastructure tool. Its namesake is a ("low level") virtual machine bytecode that serves as an IR between a compiler frontend and asm generating backend.
IR == intermediate representation
basically, a compiler front-end turns your language (C/Java/Swift/whatever) into an IR, the middle of the stack optimizes that IR, and then the back-end turns the IR into machine code.
 
Isn't that just a fancy way to say what I said?
I prefer to speak in layman's terms because that's what I am
 
Maybe? My brain threw a parse error on "cross-processor-architecture instructions"
 
I mean it's providing a layer to support transforming your language into its intermediate language which is supported on many platforms
So you don't have to compile to many platforms manually
You just compile to their intermediate language
 
actually, no
the LLVM IR is not actually suitable for execution.
 
No, but through another level of transformation, it becomes such
 
11:08 PM
ok, yes, when you look at it that way.
 
Which I presume occurs when you know which processor architecture you want to run on
 
you only have to actually write a front-end to support a new language, and then you automatically can target any architecture for which llvm has a back-end.
 
OK so I'm pretty sure, at this point, we're saying the same thing
 
Likewise, you can write a new back-end, and that architecture now supports all the languages for which you have a front-end
 
Uh huh. Makes sense
 
11:09 PM
yes. I'm just being more verbose for anyone else who wants the extra details.
 
So that is the benefit of providing an abstraction between language and architecture
You don't tie the two together
 
basically, yes.
it would really suck to have to write an entirely new compiler just because intel added some new instructions, for example.
 
But some ubernerd contributing to the LLVM project does just that
 
without proper abstraction, you'd have to, because your FE, IR (if you had one) and BE could easily be too intermingled to handle translating some language construct into improved machine code.
well, originally, to create LLVM, yes.
 
But also today, to keep up to date
With evolving processor technologies
 
11:14 PM
well, all you do now is add support in the relevant back-end, and then maybe add support in the IR if there's some new concept you need to express the cpu capabilities, and then maybe update the front-ends to emit improved (in expressiveness) IR
but that's a much easier task than if it were all one thing
 
Do you consider yourself an ubernerd?
 
no
 
:(
Maybe one day
 

« first day (1936 days earlier)      last day (3026 days later) »