« first day (451 days earlier)      last day (4486 days later) » 

12:00 AM
@LeviMorrison i believe it isnt installed, i never didnt see it in my build
 
@JMRboosties But he said it is, correct?
 
@LeviMorrison he told me the module is installed, i dont know anything to the contrary
if i gave the impression that i couldnt find the installed module that isnt what i meant
 
@JMRboosties If the module is installed, asked him why you can't find it.
So you only need to change system settings?
 
i just need to include the path i want to password protect
 
@JMRboosties You want to protect it via htpasswd?
 
12:02 AM
im trying to implement this module
 
Are you on virtual hosting or shared hosting?
 
i wish i knew enough to answer that =/
 
:)
Well, I have to go home. Good luck.
 
thanks, later
 
12:30 AM
Hey folks
 
broke my server wonderful
 
@JMRboosties That might pose a problem
 
well i fixed it
i tried to password protect a directory in htaccess and it didnt appreciate it
 
500 server error?
 
yea
 
12:35 AM
Yea, you didn't break it :P When I was learning mod_rewrite, if I could only count the times I saw 500
 
lol
what did i do wrong?
 
No idea, probably a syntax error
Post it up
 
<Location /ringshare/ringtones/>
AuthTokenSecret "44f2efa0319711e1b86c0800200c9a66"
AuthTokenPrefix /ringshare/ringtones/
AuthTokenTimeout 60
</Location>
was the only stuff i put in (i changed the secret thing to some gibberish just for security)
 
Of course
 
which recommends using httpd.conf but my system admin said i should try doing it in htaccess instead
 
12:38 AM
Hmmm. I'm not much of an Apache hacker, but lemme see if I can find something
You're using this to protect time-sensitive download resources?
 
yessir
 
See, I would've done it from scratch (in PHP)
More overhead and more code, but more control
 
it requires php as well
 
Oh, I mean managing the hashed URIs, timestamp checking, etc., by hand
 
oh yea
 
12:42 AM
You could look into some sort of fuzzy-hashing mechanism, and just roll your own (I'm sure mod_auth_token would save time, but that's the only advice I can tell you for the moment)
 
im gonna see if i can get this to work, but if not i will goof around with it on my own, thanks
 
guys
anyone here who is good in java and knows quick sort algorithm?
i need help
it won't take much time
@JMRboosties, I found the problem. I don't know if you can help though
 
@user1079641 Nobody in the Java room?
 
no
there is one person but unfortunately, he is unable to help me despite trying
 
1:13 AM
Should a factory for a given interface return a NullObject if the requested object doesn't implement that interface?
 
anyone know java here? please?
 
1:28 AM
Quick question, any good ideas for video calling on a php site?
 
1:42 AM
@CharlesSprayberry Why is the factory for a given interface returning an object that does not implement said interface?
 
Guys, please take a look at this question
0
Q: Out of memory issue in PHP

Tural TeyyubogluI'm using Joomla website. Having issue with memory ... $buffer = JResponse::getBody(); $regex = '#href="index.php\?([^"]*)#m'; $buffer = preg_replace_callback( $regex, array('plgSystemSEF', 'route'), $buffer ); ... Last line gives following error. Fatal error: Out of...

thx in advance
 
can someone please come to the java room and help me
it won't take long. Please
 
1:59 AM
anyone?
please, help me someone. Come in the java room
seriously?
no one is willing to help?
 
2:35 AM
sup
 
Hey @Anfurny
What's shakin?
 
not much
just trying to get a good job
and learning zf
and occasional bloons td 5
 
bloons td 5?
 
hehe
 
Ah, tower defence?
 
2:36 AM
yep
you?
 
working on a home-rolled framework
xml schema at the moment
you familiar with XSD @Anfurny?
 
if anyone could help me with java
no one is in the java room
even a little java knowledge is ok
 
@user1079641 Well, this is the PHP room, so as far as Java developers go, you've got just as good a chance here
@user1079641 Have you posted a question yet?
 
i posted in java room
 
No, I'm not familiar @Bracketworks
 
2:41 AM
should i post here?
 
@user1079641 No, I mean, have you posted a question yet?
 
XML makes me want to die inside. It's so unreadable, and verbose, and plus it's semi-ambiguous.
 
@user1079641 Perhaps you should do that first, and then see if it gains attention.
 
i.e. <person firstname="joe"> or <person> <Firstname = "joe"/> or "<person ><firstname><joe>
sorry <person><firstname>joe</firstname>
 
2:43 AM
@Anfurny Well, like anything else, that comes down to a schema design choice. If the schema is designed poorly, the documents can/will be ambiguous.
@Anfurny I'm reasonably inexperienced with it, but with IDE assistance, I'm finding it pretty easy to build a well-structured document design. One that doesn't permit over-verbosity, or mixed and mashed element organization.
 
I think programmers shouldn't even be aware of how their data is stored, it should be transparent. Much as it's transparent to me if I'm coding on a NTFS or XFS or FAT32 drive, the only way I should interact with how my data is stored is a simple parameters 1 time in the whole app in the config (dataStorageTyep = xml/yaml/json/whatever)
 
@Anfurny True, but you need a template or grammar to which your data structures conform.
whether it's XML, yAML, json, or plain-text
 
But my data should be automatically translatable into any format.
And if the format is too ambiguous (i.e. there's more than 1 way to encode/decode an object) then that's a major flaw.
Like in php I can say class waffle { var $syrup = 3; } and convert it to JSON in 1 and only 1 way, automatically. I'm not sure if the same can be said of XML (I may be wrong).
 
user1385191
JSON is brilliant because it just feels natural
 
@Anfurny Perhaps, but despite the verbosity and ambiguity that can be introduced with XML, by defining a well structured document definition, the generated or consumed documents can be tested and used with ease. Furthermore, the flexibility afforded by XML (while that being the inherent cause of ambiguity in some cases) allows for ease of extensibility
 
user1385191
2:49 AM
what I like is how I can utilize objects to quickly grab data via hashes
 
JSON is great, especially as a data transfer language, but I find the verbosity and human-readability (because of the verbosity) of XML to be a better configuration language
 
Ponders
 
Besides, taking advantage of XML parsing engines that recognize processing-instruction nodes, allows you to inject PHP snippet scripts into an XML document. You read through the document, and can extract -> eval() the contained code, like a selective include from a single file
That's what I'm using it for at least :)
 
Okay, after pondering, I disagree with the idea of the XSD.
 
@Anfurny In what way?
 
2:53 AM
Because I believe an objects structure needs to be defined in exactly 1 place total, and an XSD isn't gonna be it.
Instead of putting validation checks in the XSD, why not put them in your class object constructors that generate with XML data
 
@Anfurny Perhaps no, but the flexibility of XML is not intended for that purpose entirely, JSON is.
 
JavaScript Object Notation
 
and this way, when validation fails, you can catch it and report "Invalid markup" regardless of language.
 
eXtensible Markup Language
There's a reason for json being the prime candidate for cross-system object serialization
 
2:54 AM
I don't find that distinction meaningful.
you can extend JSON and you can put objects in XML.
 
Yes, absolutely, but the entire purpose behind JSON was object serialization. XML's inception wasn't.
 
So?
What it's intended for isn't the question. What it can do, and what it can do well are the questions.
 
Yes
JSON trumps XML for many purposes, namely object serialization. I personally find XML a better candidate for arbitrary data storage, though against a document definition.
 
And then I said I disagree with the idea of document definition files.
Unless you're going to have multiple different such files pertaining to 1 schema.
Under differing circumstances.
 
Well yes, I wouldn't define a schema for a one-off document.
 
3:01 AM
no one is answering the question and i need it fast
 
I'm quite confident we're misunderstanding each other.
 
can anyone here please answer my question and help me in my problem
 
user1385191
Oh, goody. A Java question in a PHP room.
 
Sounds like a homework problem...
 
user1385191
quick, flail your arms around some more
 
3:02 AM
no it does not
i have been waiting in the java room since the last 3 hours
 
Perhaps; all I mean to say is, while JSON is a well defined and extensible language, I find XML a better candidate as an extensible meta-language, one against which multiple documents will need to be generated or validated.
 
Well you clearly don't need it for a job.
 
and no one helps there
I am stuck on a problem that I don't understand
 
Why don't you debug it on your own, it would take less than 3 hours @user1079641
 
and when I ask, people say I am asking homework
Exactly
 
3:03 AM
@user1079641 Well, are you?
 
what do you think i was doing?
 
/ignores user...
 
@user1079641 Well, barking about it in the PHP room isn't going to do anything.
 
I am not barking
I just said could anyone please help me if they know even a little java
 
user1385191
no, you're just pestering
 
3:04 AM
and then these people come and start accusing me
 
Well, you've been asking for help on a Java question in the PHP room for quite some time now.
 
because no one is in the java room
 
@user1079641 If nobody can assist you in the Java room, or on the SO board, perhaps try another forum or board (though, I haven't used another forum since I came to SO for the obvious reasons)
 
Okay, so I'm not sure I disagree with either of those points. The points I was making is 1) data storage and transmission should be transparent (you have data in form X, you send it over the wire in ANY format, it shows up in form X on its own) and 2) Business logic rules must stay consolidated.
 
user1385191
another option is possibly a newsgroup
 
user1385191
3:06 AM
they tend to handle questions from beginners well
 
user1385191
surely there's a java one that's active enough
 
stop being so mean, I asked a simple question, I am very new to java and I thought that the experts on SO will be able to help me. I come here, and people say I am asking for answers to homework. That is not true.
 
user1385191
ta-da
 
@Anfurny Absolutely agree. My choice of XML as a format was because the files will (at this point) experience no transmission, and will be consumed within a local system. System-agnostic transmission is best left to JSON (often)
 
user1385191
3:08 AM
(I'd advise you to use a pastebin link instead of pasting the entirety of your code to a newsgroup)
 
@user1079641 Well, homework help is a regular inquiry here. People frown on it a bit. If your question looks like homework, it's going to be treated as such. Nobody is trying to be mean or unhelpful. It's just policy.
 
I am not asking for homework
 
@Anfurny Actually, my reason for going with XML over the others, is because the parsing of processing-instructions lends itself quite well to conditionally extracting PHP snippets from a document; but remote/local consumption is a definite consideration.
 
@user1079641 Are you trying to implement your own quicksort? If so, this is why people think it is homework. Why not just use Java's built-in sorting?
 
I understand that there is a policy and many people do that but i am not doing that
I am writing an algorithm for the quicksort so i can learn sorting through recursion in arrays
 
user1385191
3:11 AM
click the link I posted
 
user1385191
you can get help there as well
 
@MattMcDonald, why? do you not want me here?
0
Q: java quicksort array

user1079641public class Main { public static void main (String args[]) { int nums[]= {2, 3, 4, 5, 6, 7, 8, 9, 0, 1}; for (int index = 0; index < 10; index++) System.out.print(" " +nums[index]);; System.out.println(); quickSort(nums,0,9); for (int index = 0; index < 10;...

 
@user1079641 Then it's not so much a problem requiring immediate attention. If you have a deadline, use built-in libraries. If not, keep reading, and post a more specific question that doesn't appear to be masquerading as homework once you have exhausted all options (not accusing you of posing a homework question, but if people think it is, people think it is)
 
user1385191
you wanted Java help, so I linked you to Java help
 
if you look there, you can see in the code that when the array's first number is smaller than its last, it give an index out of bounds 10 exception
 
user1385191
3:13 AM
your question would be amongst far less noise, making it more likely to attract help
 
I have no intent to annoy you
In fact I truly appreciate that you help others but I am stuck on a very frustrating problem
 
Cools.
 
Guys please help. I'm currently using shared hosting with 256 mb memory limit. (I schecked it with phpinfo too) but this line $buffer = preg_replace_callback( $regex, array('plgSystemSEF', 'route'), $buffer ); gives error message Out of memory (allocated 52953088) (tried to allocate 14681491 bytes Any suggestions? maybe I'm mistaken?
 
user1385191
Anyways, can I get some quick thoughts on HTML Purifier? OWASP's XSS article is telling me to use a library for encoding.
 
What kinda thoughts? @MattMcDonald
 
user1385191
3:22 AM
well, implementation advice, experiences, and possible alternatives
 
By the way, apparently, if the first number of the array is less than the last number of the array, it gives out of bounds exception of 10
 
@MattMcDonald I've never had the opportunity to use it, I've always just rolled my own unfortunately.
Are you looking to filter from a WYSIWYG like TinyMCE?
 
user1385191
3:44 AM
no, I'm just looking for something to sanitize data
 
4:02 AM
does anyboyd know if PHP 6 will support strong typing?
for int/string/array
 
@Anfurny It very well could, if it ever comes out
SplString, SplInt, SplFloat, etc., appear to be heading in that direction
but from what I've been led to understand, the Zend engine isn't optimized for handling trillions of objects, so making objects out of all scalar values in an application may not still be feasible, even with the Spl* classes
 
hmm
 
Speaking of wish-lists, what are your thoughts on namespace-based autoloading?
 
Sounds like it would be theoretically handy for something I might someday do...
not something that I consider a constant issue though... like strong typing.....
and is there a way to make PHP escalate all undefined variables to fatal.... (like option explicit in VB) ?
 
Since PHP is still quite multi-paradigm (functional, OO) and the consensus is that static classes (with no instantiation prospect, as merely function wrappers) are bad, it seems logical that namespace-based autoloading would be handy, to require in all files (procedural library collections) from a directory mapped to a namespace.
@Anfurny Well, error_reporting(-1), and then use an error handler that throws ErrorException exceptions. Exceptions are pretty fatal.
Notices caught will turn into exceptions that way, I pretty much do all work in such an environment. It's useful and enforces good behaviour :)
 
4:15 AM
You know, now that I think about it.... php is a little bit shit.
Don't get me wrong, it's my #1 language specialty, and I love it, and have used it for many years.
but the whole developer experience is... awful. And part of that is that we don't hold web development IDE / language experiences to the same standard we do for offline code.
 
@Anfurny If we didn't agree on the serialization discussion, we certainly do here :P
 
So what's your real wish-list, then?
 
- optional strong typing (default to `object` or mixed or whatever)
- better autoloading features
- consolidation of core functions/classes into appropriate namespaces
- more powerful/efficient reflection
there's probably more, but that's a good start
 
what's the big deal about reflection?
 
Oh, one more big one: optional implicit scope cascading, so that anonymous functions don't need to use in everything
something like function($arg) use implicit { /* do stuff*/ }
(cascading isn't the right word, but it's late.. inheritance? that's not right)
As far as reflection goes, being able to programmatically examine function definition bodies, etc.
 
4:22 AM
At runtime?
 
Why would you want to do that?
 
Serialization of functions for transmission, etc.
 
have you ever needed to use that?
 
I know, that's a bit of an edge case, but the introspection features are nearly there as far as robustness goes
I've wanted to
 
4:24 AM
1. An auto-escaped output call.
 
Ooh, nice one
ob_start() with a handler, but you mean built into core obviously
 
Yeah
or obviously you can just make your own function in 1 line
 
yea, I tend to do _e()
 
and preferably combined with tags in the way ruby does
<?PHP_out "blarge <script> alertz and stuff '!@" ?>
 
4:26 AM
but more like <?PHP_out $unsafe_variable; ?>
2. Strong type checking, with the option of adding validators (I know speed cost) that could be set to always/development/never
 
Always strong typing with a catchall like object?
 
so instead it would be like alexFactorial(positive int x not null) { }
a catchall like variant
 
Alrighty
 
except I wouldn't make the user type variant, this would reduce backwards compatibility
correction: alexFactorial(positive int $x not null) { }
 
lol, funny how much we don't want PHP to be like PHP that we omit the $
 
4:29 AM
and moreover
alexFactorial (...) must return (positive int not null) { }
and these validators can be executed at run time, but can also hook into unit-tests.
 
Yea, I heard return type checking was actually on the maybe/possibly list
 
oh sweet
not just type checking though, validators. Even dynamically defined validators.
 
At this time, I'm sure only for array/object, but still
 
oh
 
Oh I hear ya. It would actually be pretty easy to hack one out with annotations
 
4:31 AM
and I want seemless array_walk with punctuation
array_of_one_hundred_people.~str_to_upper()
would call string to upper on the whole array of 100 names
and return the array
and also, I want object oriented notation, not just join(array, seperator) but array.join(seperator)
or I guess myArray->join(seperator)
 
I agree, but the transition to strong typing would require that scalars (and arrays) be transformed into objects under the current engine
 
You're right, I do keep forgetting $... because I don't feel like I'm writing PHP
 
So that would be an easy follow
 
no it wouldn't.
 
No it would require transform, or no it wouldn't be an easy follow-up feature?
 
4:34 AM
it wouldn't require a transform
you could just check that things called an int aren't string, don't have "12.23" etc
it could be done implicitly after the call and throw an exception when not true
(or immediately before the call)
 
Well, my guess is that if the devs were to introduce strong typing, they go about it like the Spl* typing they have in progress. Scalars will still exist as "untyped" values, but wrapper classes will exist to encapsulate those values for applications that want to take advantage of it. The wrapper classes could just alias the existing procedural code to methods, passing the encapsulated value to the appropriate parameter
 
shrug I get the distinct impression the that PHP developers are too OCD and not in touch enough with the EXPERIENCE of the people who use their software.
I feel like php is slowly walking toward java hell.
 
Perhaps, I think there's a definite breakdown in communication between the developer community using PHP and the developers writing PHP
 
for example the whole SPL ordeal
it was announced, has like 0 documentation on the site! (I loved PHP for its documentation, that's why I learned it, it had so many great free examples in a time when you had to buy several 50 dollar books)
and it's just not that much more efficient.
PHP's philosophy used to be "get it done elegantly with less writing, especially by providing an outstanding integrated library"
 
No, but it introduces some otherwise non-existent functionality
 
4:41 AM
Now it's going all OOP.
 
ArrayAccess was a part of (or is, can't remember) Spl at one point
 
If you want introspection, why can't you just do it javascript-ishly, like echo myclass.__AllFunctions[0].source;
 
Well, it isn't now
Well. If that worked, I certainly would :P
 
I know, they should make THAT work
not some weird way of inheriting a class with a subclass instance blah blah blah
 
Well, I think they need to fix what they have first, before adding new features, nice as it would be to see some profound additions to the core -- namespace and alias everything to a standard, as to keep backwards compatibility
 
4:45 AM
PHP used to be a badass. A renegade, you could bitch all day about global scope, but PHP has super-global scope (session) right there.
And you know what, Never Ever once in half a decade have I fucked up my session variables and been like "Oh noez shit, my session variables are being screwed up and I have no idea where, my life is ruined! If only I had not used global scope!"
 
Of course not, me neither, but managing session data becomes easier (I think) when isolated
 
If you want to isolate it just do $_SESSION['section1'][...... other stuff here just pretend there wasn't a section 1 before this....]
 
I think the OOP trend of PHP is great, but like I said, fix the mess that exists first, then and only then, begin adding in a plethora of new stuff
 
which is negligible inconvenience.
 
No, I meant, isolate the session data interaction to a session managing class
Pass an instance of that around where needed
 
4:47 AM
Why? How would that ever help me?
 
I find it helpful, namely because I can add utility functions to said class, and the object is self managing
 
Exapmle
 
Don't get me wrong, I understand what you're saying; alot of people bitch about global state and for no good reason as often there is no negative side-effect
But encapsulation of session data/logic to a class, I find to be a good practice in code organization in general
Hell, keep global state, make the class a collection of statics
(are you providing the example, or am I :P)
 
You, I'm trying to understand what you're saying. But if you're not arguing against global state, then don't worry about it.
?
 
5:45 AM
Is any one knows how to share a link on facebook friends using facebook graph api?
 
Isn't api any one nows link share a graph open facebook
 
$ret_obj = $this->facebook->api('/friend_id/links', 'POST', array(
'link' =>'http://www.yahoo.com'
));
But it is giving an error...
 
6:42 AM
Since when did PHP start trying to reproduce? stackoverflow.com/search?q=%2Bfetal
 
elaborate
lol
Why would you even be searching for 'fetal' ?
 
ahh. I wonder what some of the other commonly misspelled words are
Should investigate
 
@Bracketworks we bitch about global state because it had negative side effects - harder to mantain code, and if 80% of project development is keeping it alive... :)
 
7:01 AM
morning
 
good morning
 
very good morning :)
love, hugs and kisses for the new day!
 
Someone's in a very good mood I see :P
 
the coffee is in the making
 
7:25 AM
@KamilTomšík Global state is simply a reality. While I make efforts toward eliminating it in any work that I do, favoring dependency injection over registries, service locators over singletons (and IIRC, I can say with confidence that I've never actually used the global keyword, in PHP) it doesn't surprise, nor irritate me when I see it in client code or third party libraries.
I wouldn't do it, but it's a solution to a problem that somebody, either out of ignorance, time-constraint, or having eliminated all other options, has decided to implement.
I'm glad, even in my early naivety, I have never used global! I hadn't thought about it :)
 
@Bracketworks It's more a question how you code. When you started with singletons, it needs refactoring to get them out again. I won't say that DI is more complicated than Singleton, but you need to know where the place is to create the objects instead.
 
@hakre I agree entirely; the discussion earlier was merely over sessions, and whether using the native superglobals directly throughout your codebase was an appropriate solution to managing sessions.
I don't think it typically is, as I prefer to have the surrounding logic consolidated; classes offer an appropriate construct. Managing the instance is now the issue, but is much less one than managing code duplication and a sort of global state introduced through direct manipulation of the superglobal throughout the codebase
 
7:42 AM
Actually, your application code should not even know that something like a session exists.
Or at least only a minimal part.
The rest should just have the object to operate with, like the userobject.
 
Well yes, some sort of interface to persisting data
 
That's far more convenient.
@Bracketworks I would go even a step further.
Only a very limited fraction of application actual needs to deal with session-management.
 
Typically yes
 
Many PHP frameworks already encapsulate the session superglobal.
But, many coders still just the encapsulated stuff as-is in their application controllers.
That's just similar to using the $_SESSION superglobal.
Instead have business models that are persistant.
Not all need to be, but some could be.
Then just use the models.
You don't need to care about session at the level of access any longer.
Controller can be much smaller.
There is less code-duplication as well and you know which models are persistent and which are not.
good morning gordon.
 
Certainly; I was more concerned with the prospect of superglobals (for instance), and managing them effectively, rather than letting them run rampant throughout and ending up with testing difficulties. Massage the data into appropriate places; classes designated to work with the data. Instantiate, and manage the instances.
Mornin @Gordon
 
7:53 AM
@Bracketworks hi
 
I had an idea earlier; namespace-based autoloading -- When a namespace is used, it triggers (*not unlike class-autoloading*) some user-space callback, giving you an opportunity to include files.

Thoughts?
 
@Bracketworks This needs the encapsulation, which is good if you want to mock session out. But you could also use the $_SESSION as seam (not that I really suggest it, it's hard to do, PHP does not offer much interface).
@Bracketworks How could that work? You need to override class definitions for that or use aliases.
 
The alias would trigger for the fully qualified, given it hasn't been used.
Not on the class though; you'd have 2 triggers occur given you had a class autoloader and a namespace autoloader
 
But you would use the alias to align an include to the namespace that is being autoloaded with your namespace aware autoloader overwrite mechanism.
 
new \Foo\Bar\Baz() triggers namespace with \Foo\Bar and class with \Foo\Bar\Baz
 
7:59 AM
Ah okay, I thought you want to enable aliasing while autoloading: \Foo\Bar\Baz will enable an alignment of \Vendor\Bar\Baz.
@Gordon: I wrote a short description about "Architecture the lost years":
 
@hakre No no; the purpose in my idea, is because PHP is multi-paradigm. For instance, I used to use static classes, with no prospect of needing instantiation to group related functions. Autoloading was a benefit here; but having since transitioned to namespaced functions, I realized that namespace-based autoloading would give opportunity to load the libraries of unclassed functions. It would be nifty.
 
8:16 AM
@hakre nice
 
8:29 AM
Computers suck
 
@Gordon thx.
@Greg energy.
 
I wanted to see it get starred with the others
 
@Bracketworks ive used two all static classes that served as gateway to a session and and xml file. pure pain when it comes to testing and made the application an unmaintainable mess
 
I've managed to remove all static dependencies within my application framework now, even from the parts taken from ZendFramework.
 

« first day (451 days earlier)      last day (4486 days later) »