« first day (1015 days earlier)      last day (4158 days later) » 

20:01
How can I create a button that when clicked can start downloading mp3 file from a link ? Link example: link1.songspk.name/song1.php?songid=8090 I opened up it in tab with anchor tag with target blank but it starts downloading in some browsers but not in others ..
php.net/manual/en/function.header.php first example, Content-disposition
@Danack yo yo yo.
do you run on a mac?
@bizzehdee But, my link is not end link to file. It queries a php file with an id. Will this work ?
@silverflash Do you end up serving the file, and not some HTML that offers a link to the file?
@MadaraUchiha Sorry. I did not get your sentence.
20:10
@silverflash Your PHP script, does it actually serve the file?
i'm using terminal to jump into a mysql db for the first time, would like some feedback on what's going on if anyone is up for it. pic incoming...
Or does it serve an HTML page that gives a link to the file?
when i type a command and hit enter i just get that -> on a new line
no feedback. no error. no success. nothing. what's up with that?
Anonymous
You forgot ; at the end
20:12
@MadaraUchiha I have HTML page that has hyperlink to that link. I want when I click that link, it should not start playing the song in browser but rather offer me to download it.
@silverflash Then header is the one for you, with the Content-disposition, yes.
ahh, i see. two seconds
@MadaraUchiha But, that link is of form link.songspk.name/song.php?songid=1399
@silverflash 1. You should prettify your links, to make them make more sense for the user
2. It doesn't matter. The client cares about the mime headers, not the file extension.
now i just get an error. says my sql syntax needs to be checked :\
Anonymous
20:17
@JohnBlythe post the statement here.
@JohnBlythe why dont you type it ? love images :P ??
Anonymous
@JohnBlythe what are ya tryin to do?
just guessing here, but the -- looks really out of place
@silverflash wanted the error message included w/o typing it all :o
have someon trying to connect via ODBC
and can't any longer (originally could) b/c of an error w/ too many connections
the error message says to do a flush
so i'm trying to do a flush as well as change the max connections and max connection errors
20:20
normally, it's either without -- from there, or with -- when in bash after the mysql command (it might be a syntax I just don't know though, and I don't know which on is correct here)
also, you can use copy-paste to post a message without typing it...
when i skip the -- it gives the same error
just tried w/ mysql prepended
no luck
@JohnBlythe eh... you shouldn't prepend mysql, while in the interactive mysql command line...
mm
all new, no clue what i'm doing :|
clearly
try google, it's probably going to give better results than me going off "that doesn't look right"
meh, been on google the last 30 minutes w/o any luck, that's why i came here
will keep digging
20:25
@JohnBlythe que? top result: forums.mysql.com/read.php?24,15350,28036
m59
m59
I have a cookie that is just totally stuck
What could be happening? It won't update or expire under seemingly any circumstance.
i'm looking for general SSH/mysql command stuff. that is one of 3 tasks, i'd like to get the concept not just a single solution
In other words, the correct thing is SET GLOBAL max_connections = 100; from the mysql interactive prompt. Better yet, is changing it in the settings file
That's a pretty general command, and it's from that page.
@JohnBlythe I use a mac, and have used macports, but prefer using vagrant now to run centos.
@m59 what's da codes?
20:27
@Jasper been on the documentation site: dev.mysql.com/doc/refman/5.1/en/…
posted on July 27, 2013 by Evert Pot

I just released version 3.1 of the sabre/vobject library. It's a minor release, but contains a bunch of features I didn't have time to add to 3.0, namely: You can now parse jCard and jCal. In version 3.0 only generating these formats was supported. Methods to convert between vCard 2.1, 3.0 and 4.0. A whole bunch of bugfixes and smaller features. A fancy new CLI tool, that looks a bit like

m59
m59
setcookie('auth', '', time()-3600);
Even on just a page that has that
it won't die
0 rows affected ftl
m59
m59
I comment that out and var_dump it, refresh, and it still has the old value
@JohnBlythe if you want it from that document, it's all there. If you can't understand that page, stop complaining and use an easier page like the one I linked to.
20:30
i wasn't complaining
m59
m59
I bet that one was set with a directory when I was testing it
@JohnBlythe well, it says to use --max_connections=# from the command line (which is exactly what I said before (bash = command line)), it says it is a global variable otherwise and the syntax to set global variables is SET GLOBAL var = value; (I didn't know that by heart, but I can conclude it)
m59
m59
I'm going to clear everything in my browser.
@Jasper not sure how that equals me complaining?? i tried that and then came here for some assistance as it wasn't working how i was attempting.
@JohnBlythe I'm not trying to prove that you were complaining. I am, however, showing that the page contained all the info, yet not in the easiest way. The first google result I had was an easier way, so if between those two pages you couldn't find an answer you liked, I really do not know what you were looking for
20:40
@Jasper cool story bro. i'll stick with google for this one.
...
that's exactly what I recommended (and then showed it was the first google result)
but somehow you had been searching half an hour without result....
I don't have cv powah over there
20:51
@BenjaminGruenbaum many people probably do not have the repz there, so I don't think it's a particularly useful idea
What mean cv-pls?
@Jasper Yeah, I have like 12 answers on Programmers.
Finally, a perfect example of someone copy & pasting some shopping cart code, and refining it with the help of Stack Overflow over the course of several questions.
20:53
In my defense that programmers question is pretty horrible.
Hoho it's works!
@Pekka웃 Ow yeah great finally! We need more of those :D
@Pekka웃 SODD - **S**tack **O**verflow **D**riven **D**esign.
We should do a proof of concept and have a medium-sized application written with the help of SO. Then troll everyone by publishing it
20:55
awesome idea!
@Pekka웃 How do you think Laravel was created?
2
lol @Danack
Specifically the "Meaning/Docs" part.
20:56
Aaaa
Thx
@MadaraUchiha Is that an uncommon speed where you're from? :P
@Jasper I just reached 2MB/s and I came.
@Pekka웃 you know what's best about him: 0 Votes Cast
@MadaraUchiha I get 1.0 Mb/s + all the time (as long as it's not something obscure), so I'm still not all that impressed :P
21:02
@Danack looool
@Gordon yeah. But hey, he's "trying to learn"
Of course, I do live in the country that I believe is second in the world in the number of people that have broadband connections, which also happens to host an endpoint the most important connection between Europe and US, so I'm simply in a good position to get high speeds
@Pekka웃 judging by the previous questions, it's not only the last 4. he's outsourcing the entire project
3
21:25
Always fun: reading your own code and coming across something that makes no sense and shouldn't work... but does
21:43
weather = hate... today i thought "its been warm for a while now, the wife and the little lad are out all day, ill get some stuff done".. cleaned my car, absolutely scrubbed it... was sparkling, even sprayed the tyres to make them all nice and black and shiney, and then sprayed all the black trim on the car to make that look like new.. .and then waxed the entire car. i then patched up some mortar work on the house and patched up the driveway thinking it will remain hot
How to import large sql file to my server ? It is giving Time out error.
started raining about a hour ago, ruined all my work...
Anonymous
Wow, just realized how important array_map() and list() functions are ...
21:57
@Danack are you here?
no?
@Danack i read that github link that you showed me
but was very difficult
and I cant understand it well
Ok - it's not mine and I don't know anything about.
I was just showing you what Madara was referring to.
ooooh you dont understand that syntax?
@Jeremy , no. I instead use "upsert" syntax. In case of mysql that's: INSERT .... ON DUPLICATE KEY UPDATE ...
/me's back from DnD session
22:04
@tereško And in case of postgres it kinda sucks
in case of postgre you create a procedure
cte
But still it's kinda clunky :(
hello everyone
user652649
evening
user652649
22:08
I was about to "ask a question" but it's kind of complicated so I thought it would be better if I could chat to give the details. What you guys think?
user652649
:| i want a yoyo now (i will never grow up)
@Alex If somebody is here and wants to help they will
ok, I'll try it then
22:09
and if they feel it's better suited as a question, they'll tell you.
I created a simple code to generate a random number
nothing too dificult so far
what I want now is to make sure that everytime it generates a number, it doesn't give one that has already been given
by other words, I don't want the numbers to repeat
Only way I see is generating and checking until you have found a fresh one.
although I haven't done this yet, it's nothing too complicated as well
user652649
@Alex how many numbers? range?
the thing is that this generated number is to be sent out in an email and it should be saved to a database along with the email it was sent to
@Wesツ mt_rand(01990, 32000);
22:14
well .. i would generate random numbers and add those values as keys in an array till you have an array with length that's equal to total numbers that you need
user652649
what about an alphanumeric token? ( email + 128 bit token) you don't need to check for collisions
while ( count( $numbers ) < 4 )
{
    $foo = mt_rand(01990, 32000);
    $numbers[ $foo ] = 1;
}
$uniques = array_keys( $numbers );
something like this
@Alex And after it's been sent over email, what's it doing that it can't be the same for different users?
@Jasper It's something like a raffle, so every number should be unique/different
user652649
anyway at some point, when you had generated many numbers, it will be difficult to find an available number... so, create a db table and generate all the numbers once, and randomize them before adding to the table.... then there will be a boolean column in the table "available"... when you want a new number you will simply do "select * from table where available = true limit 0,1"
user652649
22:21
@PeeHaa how's the life going? websockets are fine? xD
@Wesツ I see what you mean. This way it will also be possible to give an error message if there isn't any number available (means all numbers have already been given out), right?
@Alex I still don't really see the point. In real life, when doing start printing tickets with random numbers. You create the number of tickets you want, randomize the tickets and start handing them out. That makes a whole lot more sense to for the digital application as well. (and in fact, it's what @Wesツ is suggesting)
user652649
yes
@Wesツ websockets are always fine :)
@PeeHaa no native support for PHP D:
22:23
@PeeHaa websockets are so 2012. big data is the hype this year.
user652649
lol
@DaveChen ?
@igorw Big data is for pussies. Huge fucking piles of data is going to be teh bomb
@PeeHaa well there are unwrappers and stuff, but nothing like node.js
@DaveChen I fail to see your point tbh :P
user652649
he meant "no noob-proof wrapper in php"
22:25
well it's not like I'm recommending JavaScript as backend :)
@Jasper yeah, you are both right. but how would I create the 30000 fields (one for each number)?
@DaveChen handling websockets is pretty easy.
Argh... my samba shared mounted filesystem in my VM has decided to stop working...
@PeeHaa yep, all you need is 258EAFA5-E914-47DA-95CA-C5AB0DC85B11
@Alex There are several ways (auto_increment, for-loop), but I have feeling there might be a better answer, so I'll see if someone else answers first
22:27
ok, thanks
@DaveChen not entirely but yeah :)
@tereško I don't understand how this is related to what i asked but i maybe missing something
@PeeHaa oh and not to mention unwrapping functions, so easy :P
if I wanted to feel stupid, I would go on mathoverflow.net
Holy shit. It's not even English
@DaveChen so by "unwrapping" you mean "binary protocol parsing"?
22:30
@Jeremy the idea is that when you save an entry, you let the database to determine whether to save it as new one , or update the existing one
usually it is determined by whether ID is set or no in the domain object
@igorw pretty much, and I'm just saying node.js handles this much better (maybe slower, but I'm not using it ... forever PHP <3)
When you say better do you mean it being abstracted away?
@tereško I was under the impression that unit of works are meant to minimize queries by keeping track of changed rows and only updating the database when need be
i was not talking about unit of work
I originally asked about it. Does that mean you don't suggest something like a unit of work?
22:33
@PeeHaa socket.io but imho, working with JavaScript both on client and server side would make me kill myself
@DaveChen there's a few things that help node here: JIT and memory management (fixed-size buffers). apart from that, they do exactly the same. protocol implementations in node can be ported almost 1 to 1.
@tereško sigh, what'd I say?
why do you want to use units of work ?
i got the impression that even data mappers are new concept to you
@DaveChen point being, there is almost no difference in how you'd parse a binary protocol between node and php.
22:35
@tereško They are. POEAA said in general I should minimize requests with unit of works. If you think they're too advanced for me I won't try them atm
@igorw that's good :), that's one less reason to use node.js then
@DaveChen unless you're using erlang, bitwise operations will be pretty much the same as in C.
@Jeremy learn how to utilize simple mappers at first. Then you can look into repositories and units of work.
@tereško okay, thanks
@igorw erlang - strict/strong compared to PHP loose/weak D:
22:37
unless you understand the basics , you wont be able to use more advanced constructs
also, units of work are quite extensively covered in PoEAA
@DaveChen if you're referring to typing, then that is unrelated. while erlang is a strongly, dynamically typed language, that doesn't have much impact on protocol parsing imo.
what does help though: bitwise destructuring, light-weight processes
hmmmn, im considering just begging for rep in chat now... sick of giving nice answers to get to 3k, and not actually getting any votes or accepts for it...
@tereško How come here you have a method create that passes the handler instead of just passing it like new Foobar($factory->getHandler());
Anonymous
@bizzehdee Don't ask me. My contributions to you, already amount 17% of your rep
@Jeremy because the primary purpose of factory is to separate the creation of new instances from rest of the code
it reduces the coupling
22:48
Do you always separate it like that?
when you use new Somethinganywhere in the code, that part of code need a class with name "Something"
that in turn couple you code to that specific name of a class
have you seen "Clean Code Talks" on youtube ?
it's a series of lectures .. i highly recommend them
@tereško Some, are you referring to one in specific?
I'm not sure which ones in particular. IIRC, "Unit Testing" and "Don't Look For Things!" covered some of this
okay, I'll take a look
can anyone have a look to my question please. stackoverflow.com/questions/17902925/…
22:58
just had a look at it, it looks like a question
Anonymous
Same here.
Anonymous
A Question.. Does Auto Loader, load all given classes during run time?
Yep. Seen it
can you solve it ?
There is so much in there that I have no idea what the question is
Anonymous
23:00
Same here. I can't solve it!
i just dont care because im too tired and warm
its about changing background like twitter does
Anonymous
Sorry, I hate twitter
Does twitter load the body with jquery?
Also your indentation is kinda terrible.
And live has been deprectated for some time now IIRC
idk..peehaa i am experimenting to make something like that
23:02
@Simon_eQ autoloader will try to load class if it has not been previously defined
@user2615947 I have no idea how twitter changes the background. But if this is about users adding their own custom background isn't it just a matter of displaying the correct background on page load?
@tereško about what are you talking about ?
hey
can i use html pages with a php login scirpt?
@user2615947 why did you get the impression that i was talking to you ?
like, when i login, it goes to loggedin.html
and if i go there directly, it takes me to the login page
23:04
@tereško sorry my bad
@EliteGamer: no, you need to detect the fact that the user has logged in, which cannot be done in raw html, you need php for this
@PeeHaa that is the problem i am not able to make it correct background on page load
If that is the question what is all the jquery doing in your question?
Anonymous
@tereško Here is a scenario. I want to use AL, instead of specifically telling php, which classes to load, on each page. But, I have a feeling AL, will load all my classes, including the ones that aren't needed.
Anonymous
23:07
Its probably a superstition ...
autoloader loads classes that you try to load, not random ones you dont try to load
just make an experiment with spl_autoload_register()
you will see how it works ans when it gets executed
@tereško since no one else gave a suggestion, would you like to help me further with it?
and why exactly did you ping me ?
Hi. What's new?
23:09
i will not spoonfeed you free code
if you want me to write code for you, you will have to pay for it
3
sure, I can do so
do we keep talking here or?
I want to know from all of you, which is the reason that you like PHP?
@ErmanBelegu It's not ruby
3
@ErmanBelegu Because it is a Pee Ach and Pee
@PeeHaa hahahaha... nice answer!
PHP or any PHP Framework? Which prefere you?
For most projects vanilla PHP with maybe a standard library
@ErmanBelegu I don't like how the question is framed. it's too binary.
Anonymous
@ErmanBelegu I don't like php. I was tricked into it, thinking it was an easy thing to learn.
to rephrase, I don't think it's very helpful to think of "no frameworks" vs "x framework"
because for one, frameworks are quite different. also, there are lots of libraries that generally get out of your way. which I'd usually prefer to a full-blown framework.
Anonymous
23:24
@igorw If one has a personal preference of design, or more precisely one's design pattern. Can that be considered as a framework ?
@Simon_eQ I don't understand the question. do you have an example of what you mean?
Anonymous
@igorw Well, I have a personal choice of ... coding, directory structure, conn and session management, debug in method.. all bundled into classes .. and so on. So, whenever I create a new project, I just follow same steps as the last project and can create a site similar in concept as the others, so can this pattern be considered as a framework in any sense..?
@Maciej do you attain to any result?
@Simon_eQ If you write it again and again no. If you reuse components you may possibly have a library :)
@Maciej someone introduce this github.com/rdlowrey/Amp to me. but I dont understand anything from it!!!
23:31
@saeid I have bug in my codeee...
@saeid I saw this!
ooooh. show me. maybe I could help
@Simon_eQ I guess definitions of these terms will be different depending on who you ask. my take on this is: a library is a piece of code that you can re-use from project to project. a framework is when you add a layer of conventions on top of that. conventions meaning: directory structure, front controllers, configuration, etc.
@Maciej do you know how to use that?
Nooo... i try to rewrite Amp but with smaller code
I newer do async io
Anonymous
@PeeHaa @igorw Yea, I guess it does sound more of a library than a framework. But, if the libraries develop in time to becoming a robust, extensible and portable, It should act very much like a framework than a library imo.
Anonymous
23:39
Just began creating titan classes of all kinds, purposes. Who knows ... I may end up making a cmf one day, purely coincidentally that is
@ErmanBelegu oh .. and we almost universally hate CodeIgniter in this chat room, because of the horrible code quality and bad practices that it spreads
@tereško... Why? $I->love->codeigniter(); :P
@Simon_eQ frameworks tend to market themselves with words like robust, extensible and portable. that does not mean they actually are.
5
@tereško Okay, I think I understand now especially after watching ircmaxell's video on DI. Would I only use the StructureFactory for passing the connection around, or should I write more things into the factory?
@Jeremy each factory should either create instances with same .. emm .. layer or ones that implement same interface
if the instance, that you create has more dependencies, then it should provide them
but do not cram stuff in factories just because you can
m59
m59
23:42
Dudes. Can polymorphism save me here? Does this like a case where I really just have to do this ridiculous amount of conditionals?
@ErmanBelegu which one confused you? The "horrible code" or "bad practices" part ?
m59
m59
I need help oh so bad.
@tereško okay, and from what I understand from talking to you before, I'd pass $factory into every class that has a class that needs it. Like if A has $factory, and D needs it, but I gotta get through B and C, I pass $factory into both of those classes, right?
Anonymous
@igorw Well, if you are talking about limitations I'm with you. I guess the whole idea about a framework may be blurry after-all. I once read this and I agree with it for the most part.
@tereško Both!
23:44
@m59 why are you authorizing the user in a method called getAccessLevel()?
@ErmanBelegu read/watch materials listed here and then read CI's source .. you should have some understanding of why people see it as excessively bad.
m59
m59
@Jeremy I'm not sure how the performance will be just yet, but I want to test not using a session, but having the two tokens be validated on each request. Therefore, I will only need to do that when they make a request AND there is a required access level (non-public info)
If they have a cookie, I look it up in the db, if they don't, I give them one
@Jeremy what do you mean by "if A has $factory"? I have this suspicion that you still don't get the point of DI ... please elaborate
@m59 That's not what the method is for, though.
m59
m59
Hmm. So yeah...
don't let them login there.
Makes sense.
LOL doh.
23:47
@tereško nonon that's not what I meant, sorry
m59
m59
Dude, I'm a hardcore conversational learner and don't get to talk about what I'm doing often enough, lol.
Thanks.
you got confused by reading your own description .. that's not a good sign
@tereško I will real all the list that you write there. Thanks a lot for advice. It will help me to understand a lot of things.
@tereško it's just that that was going to be a second question :), I wasn't ready to ask that yet
@tereško Okay, say I have a class D that needs the connection. D is initialized by C which is init by B which is init by A. Would I pass $factory through the constructors of A, B, C, D?
let's say you have some Authentication service , which need to create instance of Key and Lock
both Key and Lock instances need access to database
23:50
okay
according to law of Demeter, you should not pass a DB instance to Authentication service only for it to pass it along to Locks and Keys
@tereško that's actually why I was asking
instead, you pass a closure, which will create a DB instance to a factory , and you pass said factory to the service
the factory will create the DB connections and inject it all of your Keys and Locks
@tereško what if I already have an instance of StructureFactory? I don't want to make a new one, right?
you can share the same factory between multiple "services"
you give it to any "service" that will need to create entities with DB access
23:55
@tereško when you say factory, do you mean the instance? would you mind drawing me a dummy example?
@m59 not quite
m59
m59
:(
What can I do now?
@m59 Why are you using a cookie for that?
@Jeremy when I say "factory" i mean $factory which might be an instance of StructureFactory class
23:56
@tereško can you bin an example for me?
m59
m59
@PeeHaa Possibly because a lack of opinions, possibly because it has advantages that outweight the performance cost. I'd love thoughts.
or ... it might be an instance of TestStructureFactory
@Jeremy it's 3AM
@m59 really the only thing you should be doing is returning an access level
@m59 Advantages? Performance costs?
Just use the session
@tereško haha... okay. would you do it tomorrow for me, then? :)
m59
m59
23:58
@PeeHaa They could steal the session cookie just as well as any, so I figure it is more secure to look up the two tokens in the db each request, then the hijacker almost certainly gets kicked out faster.
if i get extremely bored
m59
m59
rather than letting the hijacker keep a session for a good long while
though, I'm not sure, what's the part that's confusing you
@tereško okay, I'll ping you tomorrow then. All I want is a few lines so I can say I understand. Thanks for your help so far
@tereško Okay I guess I'm confused about what would be in the callback.
m59
m59
@PeeHaa get what I mean?
23:59
How would the session be hijacked when you are going over tls?
@Jeremy which callback ?
m59
m59
not tls
@tereško The one I'd be passing between classes until I needed to use the connection

« first day (1015 days earlier)      last day (4158 days later) »