« first day (621 days earlier)      last day (4331 days later) » 

1:32 AM
hi all.. I have an idea about how i want to process a form using php, but I need to know if i'm going about it correctly from a coding standpoint. not sure if my question qualifies as an actual question(because i didn't start coding yet) so im wondering if i can ask here...or should i post as question anyway? do i have anyone's ear? i dont want to get down voted..
 
@FabioAnselmo If you have actual code you may want to check out codereview.stackexchange.com
 
No i don't have actual code yet. I didn't start working it. I just want to know if in 'theory' I approaching my problem with a good solution. Make sense?
Can I tell you what I'm trying to accomplish and you can just tell me if I'm going about it correctly or advise me on a better method ?
 
Possibly.
 
Hello again
 
hi
Levi was that directed @me?
 
1:40 AM
@FabioAnselmo Yes.
 
Ok thanks let me tell you..
 
I am building a job application form. At the end of the form (on submit) I want all the data to be generated into a new .html file that would be saved in a secured directory. At the same time I want to link that file for reference in my database. Does my method make sense or is their a better way to do this. make sense?
 
-57
A: How do you use bcrypt for hashing passwords in PHP?

Josh KYou Don't Use hash("sha512", $str); instead. You could also use another hashing algorithm (MD5, SHA1, SHA256) if you like. Also see this related question. The argument that bcrypt is better because it is slower is not smart. You can generate a rainbow table to crack all 6 character passwords i...

 
@FabioAnselmo I don't think that's a very good method, myself.
 
1:45 AM
I figured I could use _POST to echo on a template page and use php to save the page
From a security standpoint or just a coding standpoint.. What is your reason?
 
@FabioAnselmo Eh . . . Let me get this straight . . . you aren't interested in running queries on job applications? Say, get all job applications who have a degree of X or higher? I find it very difficult to believe that you would rather just do an HTML dump and store where that file is located in the database. I think that's a very foolish idea.
Just put all the data into the database. . .
At the bare minimum, store the data as a serialized PHP array or json encode it.
 
I cant put all the data in the db because some questions are open to responses of > 600 chars
Like mini essay answers
 
And why is that a problem?
 
I dont think storing mini essays in a db table is efficent.
or is it
serialized PHP array or json encode it - will look into those..
 
@FabioAnselmo Uh, it's perfectly fine, believe me.
 
1:51 AM
Additionally at the end of the application post submit. The applicant needs to print and sign the finished doc
So thats why i was thinking of dumping to a templated html
I looked into fpdf
 
@FabioAnselmo No, store your data without the markup. It'll take less space and you can change how it looks easily.
 
but my skills in css/html make it easier and faster for me to dump that way
 
Storing HTML markup is a BAD idea.
 
holy 14 hour work day hell
also @FabioAnselmo listen to @LeviMorrison
 
@LeviMorrison So in mysql how would I set the table input for varchar 600? is that right
 
1:54 AM
@FabioAnselmo No, you would probably use type text or maybe something bigger
This page outlines datatype requirements: dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
 
Ok ty for that is helpful
 
user895378
@FabioAnselmo @LeviMorrison is right on. You should implement his advice :)
 
@rdlowrey I have time to talk to you.
 
user895378
@LeviMorrison Hehe, just in time for me to have deprecated what's in the example repo :)
 
2:08 AM
@rdlowrey Well, I can wait :)
 
user895378
If you can give me about 10 or 15 minutes I can get the example into a more representative state. Mind waiting?
 
@ircmaxell And there was talk of us swarming...
 
@rdlowrey Not at all. Just doing things around the house.
 
user895378
@LeviMorrison Okay, I'll ping you in a bit
 
seriously
What are your thoughts on news.php.net/php.internals/61013 ?
 
2:13 AM
@le
 
@ircmaxell Agreed. I think a lot of people would like that API.
 
@LeviMorrison these text size from what i am reading have a min size of 256bytes and a max of 2000 bytes generated in a second hidden table. Each letter is considered a byte in this chart so does this mean that the max size on the user input is limited to 2000 chars?
 
user895378
@ircmaxell Even though I'd generally be against adding constants left and right to the core, IMHO this issue is too important to hold off on. I really like $hash = password_hash($password, PASSWORD_MOST_SECURE); for the purpose it's supposed to serve.
 
@FabioAnselmo So pick a bigger text type if 2000 isn't enough.
 
Yeah, I'm somewhat against adding constants, but not too against it, especially in this case
 
user895378
2:17 AM
I honestly don't think there's a more pressing issue for the language as a whole than doing everything possible to prevent PHP devs from allowing major, newsworthy password leaks. If applications written in a language develop a reputation for security problems, it won't be long before the language falls out of favor. It doesn't matter if the language wasn't at fault.
 
@LeviMorrison looking into it. from what i read so far that appears to be the biggest option LONGTEXT
 
I'll wait until Pierre responds tomorrow, and if all is well I'll make the necessary modifications...
 
@ircmaxell You could even define PASSWORD_MOST_SECURE_PORTABLE or something like that for those concerned about portability.
 
Blob and Text types
 
user895378
And IMHO the opposite is true as well: if PHP can develop the reputation that the language prioritizes strong security it can only improve the public perception.
 
2:19 AM
@LeviMorrison Well, we can't determine that. Since we don't know what version of crypt() the other dependencies are compiled against. If scrypt is implemented in 1.9, we can implement it too (since we're using a fork). But if python links against 1.8, it won't have it, so it won't be portable there. But ruby may link the newest, so...
@rdlowrey that won't happen
 
user895378
@ircmaxell hehe, no, but every little bit helps :)
 
user895378
@LeviMorrison I'm going to go scramble some eggs real quick. My 10-15 minute delay just turned into 30.
 
I'm surprised this hasn't gained more traction:
9
Q: Security Review - password_hash implementation for PHP

ircmaxellI'm currently working on a "helper function" for PHP's core to make password hashing more secure and easier for the majority of developers. Basically, the goal is to make it so easy, that it's harder to invent your own implementation than to use the core secure one. It's also designed to be updat...

Ok, good night. Long day...
 
@rdlowrey I just finished roasting some seasoned hashbrowns :)
 
Ok I found a solution a BLOB as a VARBINARY has no max lenght.
 
2:24 AM
@FabioAnselmo Sigh. . . just limit them to the size of a long text
Trust me, you don't want to read essays longer than that . . .
 
Yeah my only concern is that if the input exceeds the column's maximum length, the value is truncated to fit.
Using the LONG TEXT
method
 
@FabioAnselmo But you know what that size is ahead of time, inform them they have run out of space.
 
@LeviMorrison Yes that makes sense but how do i determine what the character limit of the input field is? according to this mysql table on datatypes - the storage required varies: "M × w bytes, 0 <= M <= 255, where w is the number of bytes required for the maximum-length character in the character set"
Not sure what that means
for longtext
LONGBLOB, LONGTEXT L + 4 bytes, where L < 232
@LeviMorrison Nevermind. Sorry to burden you. Thanks for pointing me in the right direction - I'll figure it out.
 
user895378
2:53 AM
@LeviMorrison Okay, you can now safely do git clone --recursive on the example repo ...
 
user895378
just lemme know when you're ready and I can start talking
 
@rdlowrey Let me boot into Linux. I'm on my wife's OS (windows).
brb
 
user895378
haha that is AWESOME.
 
@rdlowrey . . . And I've got the repo at my finger tips. Proceed with instruction.
Please!
 
user895378
okie dokie. Should we open another room or do we care about spamming this one?
 
2:59 AM
It's pretty dead right now . . .
 
user895378
sold.
 
user895378
Okay, first, I added one very useful feature to the injection container interface (now called Injector) which is the basis for the Provider
 
user895378
I found myself defining injection definitions so I could typehint the same interfaces over and over. So now, you can tell an Injector instance which implementation class you want to use anytime a particular interface/abstract class is typehinted.
 
user895378
You can see an example of this in the Atreyu.php bootstrap file at lines 63-68.
 
user895378
Basically what was happening is I was typehinting Artax\Mediator in tons of class constructors. So instead of having to define a custom injection definition for each one you can now tell the Provider that anytime it sees a particular non-concrete typehint it should use the implementation you've specified.
 
3:03 AM
Jolly good. That will be very useful for me. I have lots of interfaces.
I maybe went a bit too far with them.
I'll see as time goes on :)
 
user895378
Well, it makes it a snap to always typehint interfaces and not concrete classes. Ok, proceeding down the Atreyu.php bootstrap ...
 
user895378
Actually, proceeding up a few lines to 35-50 you'll see the first thing that happens after the Atreyu lib autoloader is registered is that we load the user specified config directives from the config file specified by the new required constant: ATREYU_CONFIG_FILE
 
user895378
If you look at the myapp-config.php file in the base of the example app repo you'll see a brief example of a config file.
 
user895378
This is where you specify all of your routes, any listeners and any user-specific implementations (what I just talked about) you use in your classes.
 
@rdlowrey Interesting, I just removed that "feature" from my own Provider class.
 
user895378
3:09 AM
The other thing to notice from the config file is the $cfg->bootstrapFile directive ... you basically need to specify a boostrap file to define any autoloaders you need. There's no built-in autoloader right now (maybe there won't ever be?), so this is how you'd need to do that right now. You can see a simple example in the myapp-bootstrap.php in the base of the example repo.
 
I found it made me require a certain state. Without my interface router I know that the code I write will always run the same way.
 
@rdlowrey Yeah, your example autoloader is an example how easy it is to write one from scratch.
 
user895378
The way I have mine implemented doesn't have anything to do with state ... it's the same as specifying a custom definition on a per-class basis ... it's just a time-saver.
 
(Btw, how were your eggs?)
 
user895378
Delicious :) Okay, moving on ...
 
3:13 AM
Do you have an ekiga account? It's sort of like open-source skype.
We could, you know, actually talk. It'd be faster.
 
user895378
It would. Sadly, I broke my webcam yesterday and haven't gotten another one yet or I would've already suggested something like that :)
 
Okay then. Moving on.
 
user895378
In the Atreyu.php bootstrap you'll see that after all user-specified listeners are registered with the event mediator (lines 77-79), a default error event listener is registered if none were specified by the user. This default throws the ErrorException object for all PHP errors. If someone doesn't want that behavior, they just need to specify their own error event listener in the config file.
 
user895378
Immediately after that you'll see three other important event listeners unshifted to the front of the queue for their respective events. These are important, but I'll come back to them in a minute.
 
user895378
lines (84 - 86)
 
3:16 AM
By the way, unshift is such a terrible name. It's not your fault, but man, I swear whoever name shift and unshift got them backwards. Shift undoes unshift. WTF?
 
user895378
I agree, it always seemed backwards to me too ...
 
UNshift? anyway. I digress.
 
user895378
After all that, the router is instantiated and populated with routes from the config file (if no user-specified listeners already did the job).
 
user895378
The router broadcasts events all throughout it's execution flow. So a userland event listener can do things like cache the fully populated RouteStorage object used by the Router to hold Route objects and reload it routes from memory when the Router is instantiated.
 
user895378
Events are AWESOME
 
3:19 AM
I agree. It makes workflow simpler.
> '500 responses arise from runtime errors and cannot be manually initiated'
 
user895378
I'm going to have to write up a system event reference once everything gets really stable.
 
user895378
@LeviMorrison Let me explain that.
 
I'm not entirely sure how I feel about that quoted part. I think you maybe made the right decision.
Because if some service goes down, it should be a 503
If an error is known it probably shouldn't be a 500.
 
user895378
Okay, so one of my big things was having the ability to jump out of normal execution contexts.
 
user895378
The easiest way to do that is to throw an exception, obviously.
 
user895378
3:21 AM
The HttpException is a bit different from how I had it before.
 
user895378
At any time during the normal program flow you can throw an Atreyu\Http\Exceptions\HttpStatusException whose constructor requires a status message and a status code (between 100 and 599)
 
user895378
The try/catch block at the bottom of the Atreyu.php bootstrap then determines what needs to happen with that exception.
 
user895378
There are two specific built-in handlers: Atreyu\Handlers\Http404 and Atreyu\Handlers\Http405. These exist explicitly because the routing process can throw either type of HttpStatusExceptions.
 
I don't know about http-general doing everything else.
 
user895378
@LeviMorrison Here's the good part:
 
user895378
3:25 AM
It doesn't do anything.
 
user895378
Go ahead and open up Atreyu\Handlers\Http405 if you don't mind.
 
user895378
You'll see that the built-in Http status handlers prepare the important bits of the request for you and then broadcast the request to user-land listeners if the user wants to add anything (like body content) to the response object.
 
user895378
So essentially all you need to do to handle ANY HTTP status message at any time is throw an HttpStatusException with the appropriate status message and status code. The built-in handlers will then broadcast the app.http-405 or app.http-403 or whatever and your listeners populate the body of the response.
 
user895378
You aren't required to specify listeners for app.http-404 and app.http-405 ... they have default behavior wired in if no custom listeners exist because they can be thrown by the routing process.
 
(As a side note, setBody should probably auto-magically populate Content-length)
 
user895378
3:30 AM
@LeviMorrison I thought about that ... I didn't know if the magic side-effect would be good to have or not. I liked it too but I wanted to get confirmation.
 
I mean, it's only a place for a mistake, unless the body is type chunked or something.
I'd have to think about it more.
 
user895378
the Http500 handler works the same as the others, with the difference being that it broadcasts the app.http-500 event with the additional exception object parameter (the reason for the 500) and the app-wide debug flag so listeners can display a message appropriate to the debug level.
 
user895378
the 405 handler works with the required Allows header because the routing process throws a subclass of the HttpStatusException, MethodNotAllowedException that requires an array of available resource methods in it's constructor. A user should never need to throw their own 405 exception.
 
By the way, found a simple namespace mistake.
 
user895378
@LeviMorrison please share
 
3:34 AM
HttpGeneral.php, line 73.
 
user895378
aha, thanks
 
I might do a push for general docblock stuff that annoys me :) We'll see.
 
user895378
Feel free.
 
Okay, so what's next in the lesson material?
 
user895378
So all of your user-land controller code executes inside lines 114 - 122 of the Atreyu.php bootstrap. Simply throw an HttpStatusException with the appropriate status message and code to switch to a special HTTP response context at any time.
 
user895378
3:37 AM
Also note that if you do, for example, throw new HttpStatusException('Not Authorized', 403); without having specified an app.http-403 listener, you'll create a 500 error as per line 72 of the HttpGeneral handler.
 
Haha, awesome. 100% agree with that behavior.
 
user895378
If you throw a status exception, you've got to have a listener specified for it.
 
I am a little confused on lines 118-120. Why am I invoking a resource?
 
user895378
@LeviMorrison ohhh, lemme explain
 
user895378
Remember how I was saying I'd like for a resource method to return the Response object in case I want to do stuff and you were saying you thought it was the resource's (I've started calling them resources and not controllers in our context) job to output the Response?
 
user895378
3:40 AM
Well, I've implemented the best of both worlds.
 
user895378
The router returns a match object (when a match is found in your defined routes). The match object is used by Atrey\Routing\RoutedResourceFactory to instantiate the Resource class. This is where validation for 405 problems takes place and the Resource class and the relevant method signature is provisioned.
 
hey fellas making a PHP mailer wondering about email formatting anyone have an idea?
 
user895378
The RoutedResourceFactory just wraps the callable resource ($resourceInstance, 'post') in a wrapper class (RoutedResource) so that when the RoutedResource is invoked, it invokes the actual resource method (so you don't have to fiddle with arguments) AND broadcasts the return value of the invoked resource method.
 
user895378
In that way, you can have your resource method output the response if you'd like.
 
user895378
Also, it makes it trivial to register event listeners to do things like cache the response body.
 
3:44 AM
And makes it easier to test, anyway.
 
user895378
Yes.
 
Good testing cures bad design, sometimes painfully.
 
user895378
So all that to say:
 
user895378
Atreyu\Routing\RoutedResource just wraps the callable resource that we routed to to make invocation and notification of the results really easy.
 
user895378
And the RoutedResource is (obviously) what gets created by RoutedResourceFactory
 
user895378
3:48 AM
So your app.http-1xx listeners should just typehint Atreyu\Http\Request in their constructors so that they can access the request that caused the status response and then do whatever you want to the Response instance passed to the listener's invocation method. These listeners can optionally output the response themselves. The wrapper built-in listeners will do it for you if the response hasn't already been output.
 
user895378
The shared request instance is also passed with the notifications in case someone wants to use closure listeners as well ... so you don't have to specify the request in the listener constructors.
 
Jolly good.
 
user895378
Like I said, you should never need to throw your own exception for a 405 because the routing process handles that for you.
 
user895378
let's see what else ...
 
user895378
The route shortcuts are accomplished by a simple listener specified in the listeners section of the config file.
 
user895378
3:53 AM
Any time a route is registered with the router, the router broadcasts an event with the new route object as the data parameter. The Atreyu\Plugins\RouteShortcuts listener just converts our shortcut characters into usable patterns and calls the Route::setUriPattern with the transformed value.
 
This is all fine and dandy . . . but . . . where's the database access object and the form generator?
 
user895378
hehe
 
user895378
OH, I added another route shortcut for convenience, but I'm not married to it. Tell me your thoughts on ...
 
user895378
instead of this for custom regex in the routes:
 
user895378
/widgets/(?P<myParam>[\d.,]+)
 
user895378
3:55 AM
just use:
 
user895378
/widgets/<myParam|[\d.,]+>
 
user895378
basically, you're just doing:
 
user895378
<param|pattern>
 
user895378
Makes it slightly easier to specify custom regex patterns ....
 
Instead of all the PCRE template
 
user895378
3:57 AM
yeah
 
You can still use the PCRE stuff, right?
 
user895378
Yes.
 
It's probably fine. I can't imagine anyone using that pattern in their URI.
 
user895378
Oh yeah, no, it's just the first thing that came to mind :)
 
user895378
Anyway, that's in there currently, but it's a one line removal if necessary.
 
user895378
3:59 AM
Also, it's a one line addition for any other shortcut patterns we want to add. Or someone could do their own plugin to do whatever shortcuts they wanted and register that instead in their config file.
 
user895378
The whole thing is totally customizable.
 
user895378
If you look at the front controller file /www/front-controller.php in the example repo, you'll see that it's pretty basic. That's all anyone needs to specify. That and their config file to define their application and a boostrap to autoload or do anything else.
 
user895378
And just direct all traffic to the front controller, obviously.
 
I like this.
I wonder how the PHP documentation would feel if I . . . nevermind.
 
user895378
lol
 
user895378
4:03 AM
As for the content negotiation stuff, it's obviously not pushed yet, but I just have an Atreyu\Http\Negotiation namespace where the relevant classes sit. Eventually it will be as simple as asking for something like RequestNegotiator in your resource constructor and calling RequestNegotiator::negotiateContentType($this->request, $availableTypes);
 
user895378
And you'll either get back text/html or the method will throw an HttpStatusException('Not Acceptable', 406) for you :)
 
Content negotiator! (Priceline? Anyway)
 
user895378
haha that hadn't occurred to me
 
user895378
But anyway, all the parsing stuff for content negotiation is tested and working right now ... I'm just massaging and polishing the architecture. Should be pushed and reviewable before the end of the weekend at the latest.
 
Jolly good.
Thanks for walking me through it.
 
user895378
4:06 AM
No problem. The example actually works too :)
 
I only have about 70% of my codebase to refactor before I can use it . . . :)
 
user895378
Okay. Now my keyboard is on fire. I'm gonna take a few minutes to unwind then come back for more programming (I'm in the zone on this content-negotiation stuff). If I miss you I'm sure you'll be around in the future :)
 
user895378
Oh, and congratulations on the official site launch at work
 
Thank you.
 
user895378
4:08 AM
Final summary:
 
I made it in time. First deadline I've made in a long time. I've learned that refactoring code takes longer than predicted by a factor of 3x.
 
user895378
Yeah, I've been trying to make my time estimates more accurate lately ... I'm getting better at it
 
user895378
Still always seems to take longer.
 
user895378
Anyway: Code your Resource classes. Specify your routes. Specify app.http-123 handlers. Run the app, throw status exceptions as needed. That's the whole Atreyu summary.
 
First PHP framework I'm excited about in 2 years.
Congratulations.
 
user895378
4:13 AM
Hey, it's a collaboration :)
 
user895378
Maybe we'll actually get the thing finished one of these days :)
 
user895378
The best part? It lets you write 100% testable code, uses dependency injection for everything, no static, etc.
 
I'm curious, what changes did you make to Artax?
 
user895378
@LeviMorrison Small ones -- a lot of naming changes and similar improvements after I read Clean Code. The provider implementations I talked about. Also some informational methods on the mediator like being able to get aggregate counts of how many times an event has been notified or how many listeners have been invoked for a given event. Those were actually really helpful for Atreyu to allow default behavior if no user-specified listeners are registered for important events.
 
user895378
Nothing crazy.
 
user895378
4:18 AM
Although I still want to work over the unified error handling system to make it a little less magical.
 
user895378
That's the only thing I'm not totally happy with right now.
 
What, magic isn't good? ;)
 
user895378
Well, you almost have to use black magic to turn fatal errors into handle-able exception objects, but I think I can improve on my implementation.
 
user895378
There are bug workarounds and things like that you have to deal with in the nether regions of fatal error handling ...
 
user895378
4:21 AM
Going to revisit that after content negotiation and a bit more Atreyu stabilization.
 
By the way, I figured out why I like Atreyu and don't like Symfony and ZF: the latter want you to build your application from it, Atreyu just wants to deliver your application.
Well, I'm going to bed. Have a great night!
 
user895378
@LeviMorrison That's why I wanted to do it in the first place. I don't want a framework to tell me how I have to write my application. I just want it to be a scaffold ... a lowest-common denominator that gives me everything I need and then sends me on my way.
 
user895378
There's a reason why it's called a Framework and not Application-in-a-Box
 
user895378
And also I need a framework not to force me into bad OOP habits like static and service locator and ORM and totally untestable controllers. Yeah, those are the other reasons I can't use any of the popular frameworks.
 
user895378
> Nothing is going to build your application for you, no matter what it promises. You are going to have to build it yourself. Instead of starting by fixing the mistakes in some foreign framework and refactoring all the things that don't apply to your environment spend your time building a lean and reusable pattern that fits your requirements directly.
 
user895378
4:27 AM
-- Rasmus
 
4:57 AM
Holy crap, I need to change my naming convention. Mind you I'm tired, but HostSegmentRouteRequestAdapter just seemed plausible.
 
 
2 hours later…
user895378
6:48 AM
@LeviMorrison I gave a bit more thought to the idea of automagically setting a Content-Length header. I think a better solution than StdResponse methods having side-effects is what I just pushed. The StdReponse constructor now takes a Mediator instance and broadcasts events on potentially interesting invocations.
 
user895378
Instead of hard-coding in a potentially unexpected side-effect, you could do something as simple as this if you wanted to ensure your responses always used a Content-Length header:
 
user895378
$mediator->push('sys.std-response.before-send', function(StdResponse $response) {
    if (!$response->hasHeader('Content-Length')) {
        $response->setHeader('Content-Length', strlen($response->getBody()));
    }
});
 
user895378
(Or use a similarly suitable, more easily tested class listener instead of a closure and specify it as a listener in your config file)
 
7:28 AM
'Morning all
I've got a mysql table with a text column using utf8_general_ci collation.
There's some text that looks like "€5 ..."
When I json_encode the text, I get an error, 'invalid utf-7 sequence'.
What I did, I printed out each byte, which looks like: 128,53,32
Since 53,32 is a '5' and a space, I presume the 128 would be the euro sign.
But that's not valid utf-8, obviously.
So I'm thinking the DB (or DB client?) is somehow messing up. I'm using mysqli, by the way.
 
morning
 
morning? I have no idea why i'm still awake..
1:33AM, haven't been to bed yet
 
@PeeHaa morning. back soon, off to work :)
 
OK, I had to use $mysqli->set_charset(). :/
 
morning / evening all
 
7:42 AM
@Paul morning.. I guess it's technically morning..
 
8:12 AM
hello
want to have your recommendation
i want to send data between browser
should I use websocket , Node.js or read from the last entry in db?
a real-time application
 
@Gordon a chat time system? which does not need data to be stored on server
how would you implement it? sockets? or storing the message into a file and sending it to another browser?
 
8:33 AM
how can we create a word document in landscape format!
 
@PeeHaa tempted to answer with implode($splitup) + DomDocument :P
 
@Leigh OP is an idiot doesn't want to look further than his broken "solution"
 
@PeeHaa I know, but I need to rep-whore so I can actually cast CVs :P - I guess the fact is I'm lazy, I just come to SO to troll on peoples terrible questions and answers
 
@Leigh :)
Another team member of the cv-ring would be nice :)
@Leigh you are almost there though. Only 1k needed
 
Well, I've been on SO for around 18 months, and managed 2k rep = lazy
And I got like 1600 of it in the first month or something... there's just no interesting questions anymore :(
 
would you use node.js or websockets for a real time chatting app?
 
@meWantToLearn Since neither of them are PHP, probably neither
 
so what would u use?
 
@meWantToLearn have you researched any of the two yet?
 
@meWantToLearn for real-time chat? probably my phone
 
8:46 AM
@Gordon I did
i dont want to store the messages in db
i did implemented one using db and ajax request every sec
 
@meWantToLearn any what did you learn about the availability of websockets in today's browsers?
 
websockets dont work in IE
 
@meWantToLearn and which browsers do you need to support?
 
every browser
 
@Gordon not to mention the adequacy of using PHP as a long-running real-time request serving daemon ;)
 
8:48 AM
@meWantToLearn then by requirement, you cannot use websockets, which leaves nodejs as a option
 
can we print web page without prompting printer dialog box using javascript ?
 
@Gordon so how would implement?
 
@Ashu How would you know which printer to use?
 
would you
 
Sam
Morning guys and girls
 
8:50 AM
@meWantToLearn if I'd need to build a chat system that works with most current browsers, i'd probably do what SO does and use good old polling instead of server push
 
@Leigh isn't the one attached will get used
 
@Ashu do people still have printers actually attached? wow... been a while
 
wait, its for the admin part only
 
@Gordon the data will then get stored in a db or a file right
 
@Leigh so not require each one to have printer attached
 
8:52 AM
0
Q: javascript print without print dialog box

BharanikumarThe below snippet working fine, but it opening the dialog box window, but i dont want to open the print dialog box , just print should done without dialog box, what snippet i should add in the below snippet , And also one doubt, i want to take print out in DOT Matrix Printer, the below s...

 
from what I understood from long polling, is that client keeps on requesting server, once server has new data it sends it back
 
@meWantToLearn yes
 
the server will check db or a file for a new entry
but over-here it doesnt has to store data anywhere
 
@Ashu think about it. if one could bypass the printing dialog it would mean any webpage on the web could print lots of nonsense without me being able to decide whether i want that or not.
 
how can i create a word document in landscape format with php
 
8:55 AM
@meWantToLearn look into xmpp
 
@Gordon yea i know, but one of my client asking for same
 
@Gordon thanks but that has not helped me
 
@Ashu then ask him whether s/he wants to print 500 pages of nonsense on his/her printer the next time she visits $randomWebsite.
@pbvamsi its impossible then obviously
 
@Gordon sorry are you serious!
 
@pbvamsi yes, it must be impossible when google doesnt know the answer
 
9:03 AM
hey all
`define ("filesplace","./images/logos");
move_uploaded_file($_FILES[$name]['tmp_name'], filesplace."/".$name.".".$type`
have a question regarding this.
script is in admin folder.. I want to upload to /images/logos/
they are not in the same folder
how must I modify the define statement so that it works??
 
@Gordon thanks
 
else.. how can I get to know the error message from move_uploaded_file () ??
 
morning, everyone
 
morning @tereško
Forget that I even mentioned the question :)
 
morning @tereško
 
9:15 AM
my bad
:(
 
Have I mentioned lately how much i hate the white label theme from themeforest?
 
@tereško morning
 
morning
 
good morning everybody. what a great day today!
 
I just woke up so can't really say that :D I guess it's good thing I woke up
 
9:22 AM
I can't realistically say "good morning" even... Still haven't been to bed yet ;\
 
It's a figure of speech :P
 
Well I know that much.. and it's still technically morning... But, I've been cracking out on this damn Task Manager and Bug reporting system...
 
wow
 
9:39 AM
@Gordon damn.. wonder if he dies int the movie if he killed here :P
okay.. bummer.. another question. how to use the file_exists() function to check for another file in another folder.. ??
 
hello friend i need some help in the zen cart any one like to help me??
 
@JalpeshPatel If you send me a photo of yours and you look beautiful I might consider that, yes.
2
 
Are there plans to ever migrate pecl modules to github? Or is there just too many maintainers for it to be feasible?
 
@PeeHaa was yesterday already though
 
9:59 AM
morning
 

« first day (621 days earlier)      last day (4331 days later) »