« first day (944 days earlier)      last day (4230 days later) » 

08:02
@Duikboot Hmm, take a look at how Silex works .. it's a relatively easy to understand code base.
@Duikboot , watch youtube.com/watch?v=RlfLCWKxHJ0 till you understand
> How is it working? It's working well.
lol
@Mr.Alien It's possible .. there's a gender extension for php :) ymmv
08:05
@Mr.Alien of course it isn't
@JoeWatkins Surely a performance killer
also, FYI, in 21st century "gender" is not a binary option
@Jack But some names are used for both, say for example Alex
@tereško lol. Thanks (really). Objectivity is what I need indeed.
08:06
@tereško haha yes :D got that
@Mr.Alien Alex is ambivalent ;-)
@tereško That may be true, but it is the best source out there
@Mr.Alien uk1.php.net/gender NEVER guess ..
Morning all
morningz
08:07
@Jack Yea .. Here in our country, we have many names shared by girls/boys
mornin'
stackoverflow.com/a/16596704/727208 ... also proofreading might be a good option =/
uk1.php.net/manual/en/class.gender.php covers names/variation rather well ... with IS_[MOSTLY]_*
@JoeWatkins I would rather throw a select box with 3 options
@tereško F*ck. After 4 years of kicking around php I realized I know nothing at all.
@tereško "But that orders of magnitude rearer then changing state of model." hmmm~
@Ihsan That's similar to the photographer's curve. :)
08:12
emm ... how to you say that some thing happens a lot less often then other thing ?
@Ihsan Even I've not yet dipped inside much, want to get in some frameworks
@tereško frequently - infrequently
i want to use "orders of magnitude" in that sentence =P
you can. like "infrequently in orders of magnitude blabber"
sounds bad
08:15
@tereško thinking ...
english no more belong to English people.... Bended heavily...
english is my 4th language ;(
@tereško which languages do you know?
Mornings
user652649
morning
08:16
@Jack lol
@uınbɐɥs *which
:-P
@uınbɐɥs latvian, russian, german(badly) and english ... in that order. And kinda am trying to learn japanese when i have time.
user652649
@tereško wow O_O
@DaveRandom jojo
mornings @DaveRandom
user652649
08:18
@DaveRandom which / what is some english difference between uk's english and nz's english?
3 hours ago, by N̨ul̕L͑P̯͍̭ȏͣ͛iƞer
@tereško I know all lang translate.google.com
that would explain why people from india suck at english
@tereško But changes to the state of the model are much more prevalent.
08:19
I would leave the orders of magnitude out.
@Wes No, "what" is just generally incorrect in that context. However it's an incredibly common mistake that I regularly make myself. Much like the difference between "less" and "fewer". It's about scalars vs. vectors.
ok ... gonna reword that one .. somehow
@Gordon It's actually friday? awesome! :D
@dragon112 yeah! celebrate your time. come on!
@tereško haha the town side peeps don't where suburbs side, yes
08:21
@tereško "occurs less frequently in orders of magnitude" seldomly, rarely
@DaveRandom Difference between less and fewer would depend on whether it implements Countable =D
user652649
@DaveRandom interesting! i will try to remember that :P
@Gordon /me dances
@tereško Let me know when you're done editing .. I've got a bunch of small edits ready ;-)
08:24
-3
Q: Error trapping within a large PDO sqlite transaction

Al.I am parsing a text file into an empty sqlite database for processing the file data using php. I establish the database connection with: try { $db = new PDO('sqlite:temp.db'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo 'Connection failed: ...

@Jack :-P
The bounty has been assigned ... guess it can be cv'ed now lol
Ok, I know I'll be thrashed now, but how do I secure eval()
@Mr.Alien By sanitizing whatever you put inside.
@Jack the strings to look for?
08:28
@Mr.Alien Realistically you can't secure it. What are you actually doing? If you're just dropping values into strings then you just need to escape quotes, but anything more complex is very difficult indeed/impossible.
What are you doing that requires an eval()? 99.999999999999% of the time there is a better way.
@Mr.Alien whiteslisting
^^ lol
:P
But really good gyu dave is 100% correct. If you think you need eval you are doing it terribly wrong
@DaveRandom I've built a customized ERP system so I need to eval customized form for each, so generally its a framework which consists of general controls like search, search by table fields, sort records, generate auto reports etc
Today is International Day Against Homophobia and World Information Society Day
08:30
@Mr.Alien Nothing in there warrants using eval
@Gordon That's just gay
so general queries are fine, they fetch the real table name, builds queries dynamically, but when it comes to adv search params, I need to use eval to evaluate custom queries
@PeeHaa埽 1 more trouble is I am using sessions to store adv search params, so multiple tab is the game spoiler here, but I'll handle it with a redirection
@PeeHaa埽 There should be something to get is atleast secure, kinda something better than nothing
Can you give an example of such a "advanced search param" which you think you need to eval?
@Mr.Alien you should avoid eval() there is always a better way, always ...
@Mr.Alien eval() is evil()
08:35
Woah, woah! I'm listening to the new Daft Punk. Am at the fourth track and the vocoder in there is mind blowing!
Sh*t i forgot to download it >.<
Is it really that good?
@Gordon link link...(begging)
I am having a framework which I've built myself, that has some features like groups/level users, permissions etc, I can just switch things on/off for permissions, i.e add record/delete records etc, now inside this I build customized logical systems, which works diff for diff business, so say you need a system which will track pending couriers
, now say you need param query where you want to track couriers delivered by say person x, now I carry these params to auto report page, where I use IN to fetch the related records, so query is custom too, for all these, I use eval
@Gordon thx. Your karma points are increased.
08:37
@JoeWatkins I don't have any other way to feed custom queries, I thought to use a page and include, but that will be madness, it will create bunch of pages for a single thing
@Mr.Alien What you want has nothing to do with eval
It's about buidling custom queries not running user supplied code
@Jack done .. also added another section
@tereško okie .. hmm, you know, alterations doesn't really sound like a programmer term though :)
it's what a seamstress would do :)
well .. you have a point there
08:40
us devs change, update and modify :)
@PeeHaa埽 So I store those custom queries inside the database and those queries have PHP variables in it, if you want a demo I'll provide you, system is online, I've changed it a lot, I've removed 9 evals of sorting and made it completely dynamic, only thing sucks is add/update form, and adv search form evals, just wait
@tereško this is the part I like most: MVC is not meant for "hello world" apps.
the rule of hello world is that it can be written in anything.
@PeeHaa埽 Check this out
@Mr.Alien Send it, because having PHP variable in a query doesn't need eval, because you normally dont eval queries
08:42
@Gordon Spotify no service to TR. :( I will try youtube music.
@PeeHaa埽 username: administrator pass: raxnux413
you just go to control panel, things r pending as I've just uploaded that I guess month a go for test
now the system is much much stable
@Jack mvc is the "nuclear option" you cannot make a hello world level nuke .. it just would not work
@PeeHaa埽 Other account to see how it actually works, username: admin password: demo
corpid?
quratek
08:44
@tereško of course you can, it becomes "goodbye world" when you nuke it.
@Jack lol
i assume you have no clue how nukes are actually made
@Gordon I can't begin to explain how much better that album is than I thought it was going to be. After so long away I thought it would be yet another one of those cash-in-on-the-name low-effort jobs, but it really isn't. It's well on the way to replacing Discovery as my favourite DP album.
@tereško I assume you have one in your basement ;-)
@DaveRandom Stop making me want to go home to download it. I've bought it on my work pc, but can't listen to it here =(
@DaveRandom I only know their more famous songs but that's it. But this album is just great so far.
@PeeHaa埽 you logged in with admin account or administrator account?
now with admin
@Mr.Alien make sure to change the pw later.
08:49
@Mr.Alien admin and administrator? :-S
@PeeHaa埽 You should use administrator credentials, what you are logged in will be for client so you wont see any control panel
fail ping
@DaveRandom Just a demo, nothing real ;)
@Mr.Alien kk 1 sec
@PeeHaa埽 cool, go to control panel, the link is on the top bar, there you'll get everything you want ;)
08:50
@tereško How about "It should be noted that although controllers can alter the state of the current view directly, it's more common that these changes are effected through the model."
user986408
@Gordon regarding csrf: forging a post request on my server and triggering it with js shouldn't work because the request would start off my server which doesn't hold the required session, right?
k first example I see: `<?php
$count_row_query = mysqli_query($running_db, "SELECT count(rec_num) FROM tbl_suppliers WHERE group_id_entry={$_SESSION['user_group_id']}");
?>`
@DaveRandom You confused me...
Why would your users have to type in that? Instead of simply the query?
@PeeHaa埽 Yap, but I've removed 9 fields, count query, sort query and general query all 9 are now removed
08:51
With possibly a placeholder
@skripted huh, what?
That sounds like, no offence, a f*cking awful idea
@Mr.Alien But where do you think you still need to eval php
@PeeHaa埽 Now the form starts from Table Field Front Names & Types, above textareas are removed
Also trusting your users won't screw up $supplier_name = htmlspecialchars(mysqli_real_escape_string($running_db, $_POST['supplier_name'])); is naive
Also what should the above do actually?
08:53
@PeeHaa埽 This is just for quratek, if any other system has different form fields, queeries, different database design, so actually this is one example, I can run 1000's of custom system under 1 roof, kinda custom CMS
user986408
@Gordon imagine i want the user to submit a form via post with cross site request forgery - i would bring him to my server with a link and then let him submit the form or even trigger it with javascript automatically
When you see both htmlspecchar and mres on the same line somebody is most likely doing it wrong
@Jack the changes in view are the ones that are completely unrelated to the model. It's for cases when you either change the output format or for fallbacks of JS driven changes: like setting a widget as "collapsed" by default
@PeeHaa埽 Yes, I know many things are hanging in there, I've certainly increased the coding practices which I have on my local
@tereško Yeah, that's what the next sentence says :)
08:54
well .. ok
I'll push the edit in a short while.
@skripted I'm confused. Why did you ask me in particular?! Oo
user986408
@Gordon this shouldn't work if a session is needed for the url (regarles of the http method) because the request is initiated from my server
user986408
@Gordon i just wanted your opinion on that
user986408
08:55
if it's true
@PeeHaa埽 This iss pretty huge system, the queries you build adds to admin account automatically, can be accessed by system defined groups, defined user levels
user986408
i'm doing theoretical security here lol
@tereško done. didn't finish the whole thing ... i have to get back to work ;-)
so actually that's a pretty complicated system, you can get it when you run admin and administrator accounts from different browsers and see what it really do
@skripted from what I understood, this should not work because the CSRF token would be missing
08:57
Also we don't validate emailaddresses using regex (unless you use the regex used in PHP)
user986408
@Gordon you think too far .. drop the token .. there are plenty sites without csrf protection ..
@PeeHaa埽 i told you, it's just a demo system meant fr me :)
By the looks of it you are looking for a template system instead of evalling stuff
@PeeHaa埽 template system hav 1 db, i can have 100
@Mr.Alien Why would a templating system only be able to use a dingle db?
user986408
08:59
owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF) says: "There are numerous methods in which an attacker can trick a victim into submitting a forged POST request, such as a simple form hosted in attacker's website with hidden values."
user986408
this is not true, assuming there's a valid session needed for this URI
@skripted why not?
@PeeHaa埽 never usd any, but i think what i've made is diff frm templating system say fr example smarty
@Mr.Alien Yes the difference is that you eval php code instead (which results in an unsafe application) of using a template system
@Mr.Alien Another drawback of your decision to let people write PHP and queries in code. Is that you made it hard to blacklist queries
@skripted I am not sure I get what you are asking. If there is no CSRF protection, sending a POST request from your server to another should work. It doesnt matter that the session doesnt exist, unless there is something in the session preventing that the associated post request is handled.
09:02
@PeeHaa埽 you are right, but I am so comfy with this lol
@PeeHaa埽 you are wrong here, CPanel is only for me n my employess, that too has access rights
@Mr.Alien So everybody is allowed to see anything?
user986408
but if the user has to be logged in for this request it shouldn't work, right? - it's not like you steal the session by doing that
@PeeHaa埽 nope and can i get ur id? i can explain u in a bettr way, hope u cn suggst me sumtyn good as u r much mre experienced
@Mr.Alien How are you going to prevent user A (which has limited privileges) to add a query to get data which should only be accesable by admins?
@PeeHaa埽 when u go to user level u'l c I am the only superadmin there :)
09:06
@Mr.Alien That doesn't answer my question
so as of now, only administrator has access to cpanel
I don't have more time for this. But let me finish by saying I have seen no reason in there that is a valud use case for eval
@PeeHaa埽 no prob, i'l look forward for a better solution :D
thnk u very much fr ur tym
is it possible with drupal webform to send different emails depending on what a customer write in one of the textfield
09:12
for example if someone type 101 in textfield and submits it sends to [email protected] and if someone types 102 it sends to [email protected]
/me sooo happy... Listening Daft Punk
@Ihsan /me sad I have to wait till I get home
@dragon112 Don't you have the super-invention called headset around?
OMG, they made chorus out of samples !!! how the hell? very goood
Well no, not right now at least:p
0
A: Design Patterns: How to create database object/connection only when needed?

Jimbo I'm going to explain a little more in-depth about Dependency Injection Containers, and how they can help your specific situation. Note: Understanding the principles of 'MVC' will help significantly here. The Problem You want to create some objects, but only certain ones need access to the d...

I put effort into that :) ^ hint
09:22
Yes you did :)
can some wonderful person can help me with 1 drupal question
@Jimbo i'm not sure you are actually solving his problem
@tereško I will always defer to your expertise teresko, is there anything I can add?
naah .. it's just that i got the impression that he already uses dependency injection
@tereško I'll add your link to my post
09:27
no
he is already injecting a "db class" .. the point was the he did not want to establish the connection before it is needed
seems to me like he has an SRP problem there
Closures do that though, right?
nope
that link is only for a fancy way to make factories
@Jimbo , he has an xy problem, he wants to defer the connection, because classes that should not be aware of DB end up containing the connection .. at least that's what i see in his post
@DaveRandom the DaftPunk gets a bit less interesting towards the end. But all in all pretty good. The real gems are in the beginning though. I'd say up to "Get Lucky".
@Jimbo Sorry but why all that complication? jazz.
@Gordon +1...
@Ihsan Well, if I wanted to switch from a MySQL DB to MongoDB or PostgreSQL, I change the code once in the container to return an abstracted class for that instead, and the whole application will still work :)
@tereško Fair point, I'm not at the level yet to spot these things, I'll get there eventually...
09:33
@Jimbo Do it with simple DI. Stop boggling my microscopic brain... .<-there it is.
@Gordon my only encounter with duft punk has been via Interstella 5555
I use global dependency injection...
8
@Ihsan Lol. I try hard to explain things as simply as possible - if you read the post fully, word-for-word, it may explain more :)
@webarto You know, in order for me to find that funny, I must be a BIG nerd :P (not ashamed)
@webarto try sexy dependency injection... better...
@Jimbo nerd life bro all the way...
09:35
@Ihsan I almost googled that, not sure that'd look nice in my search history..
Anyone knows an advanced system to build rental websites/
@Ihsan now, that's just naughty :P
Maybe ubercart ( drupal ) or something like that? :)
lol...
naughtyshan?
09:37
@Duikboot Now I have to invent the sexy dependency injection (SDI) pattern...Busy. Can't answer.
@tereško try the new one. its good.
hey does someone knows if is possible to make users remove their account on external website using the same facebook login api?
i mean they can register but how can they remove account via fb?
@okok I doubt this is possible.
09:39
@okok Have you googled it?
@Ihsan Suction Diesel Direct Injection
@dragon112 me too :/ could be great to specify some remove account url
@webarto Woa :D
@Ihsan sure
i guess is not possible, bad thing cause if i remove the app from the facbook settings page the external website account persist
really they should introduce sort of redirect url in case of app removal
or kind of url ajax call
@webarto I use a Balanced Instruction Set Computer Unit Integration Technology (BISCUIT) cpu.
09:43
That's awesome Xd
@dragon112 The setback is sometimes I forget its use and eat it... ;)
Whoa, I suck.
Zend Twitter channel is full of buzzwords...
@webarto buzzzzzzz
It is not a Z rather close to 'A'
09:50
@Ihsan How is that a setback, must taste really good...
My BISCUIT melted :P
@dragon112 Integrated with wheat and dry grapes....
Only need 1 more +1 and I'm level with top poster (I've never won a bounty before).
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer Guess who is not going to ever work there? Me and you :P
09:51
@webarto yup :D
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer Haha, unicorn :D
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer Bananas in the 1st image are rotten
quicker session storage perhaps ... github.com/krakjoe/apcu-ps
i dont understand why they are using bulb when they can use led or cfl
It's nice when they rot a bit.
09:53
@Jimbo What does a DiC have to do with persistent db connections?
@Jimbo I can't vote twice on a post sorry.
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer What character has you got on the end of your name that <--causes the message text to go weird like this
@PeeHaa埽 Didn't want a persistent connection - wanted specific objects to have access to database class
> What you're currently doing is creating the database object / connection on each request, which is totally unnecessary, and also totally common before using things like DiC containers.
The above reads like persistent connections
Because of the "/ connection"? - removed :D
09:54
@DaveRandom i.sstatic.net/fhgHX.png i cant see any difference
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer I think it is CFL in disguise, LED is expensive atm.
@Jimbo Because you say you don't need to cnostruct the db object on every request anymore when using a DiC
You don't, using pimple and it's closures means that you aren't constructing the object until you ask for it from the container: from their site: "Notice that the anonymous function has access to the current container instance, allowing references to other objects or parameters.

As objects are only created when you get them, the order of the definitions does not matter, and there is no performance penalty."
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer i.sstatic.net/xnuDg.png <-- that's what I see
Windows 95 much?
N\u0328ul\u0315L\u0351P\u032F\u034D\u032D\u020F\u0363\u035Bi\u019Eer
09:56
@DaveRandom You are missing out fonts!
@Jimbo In that case. Wouldn't a simply closure (without using DiC) act exactly the same?
@DaveRandom which os do you use ?
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer Blocks
@Jimbo "Here's a really simple pimple example, that you create in your boostrap" ... did you have to misspell bootstrap here? ;-)
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer This is WinXP Chrome, it was happening last night on Win7 Chrome at home as well
09:57
@Jack Boostrap ftw.
boobstrap ftw
@Jack Haha, I clearly got excited about "simple pimple"
It seems to be everything up to the first punctuation char
@webarto i.sstatic.net/YnPEF.jpg those are using blub here and and i dont think cost of led does matter for them
@Jimbo :)
09:58
@N̨ul̕L͑P̯͍̭ȏͣ͛iƞer Ah, I see... hipsters :)
@PeeHaa埽 But you're going to have to pass this closure around somehow, so only specific objects get the db when they need it. Shove it in a container and selectively choose!
@Jimbo Also what you do is not really DiC btw :)

« first day (944 days earlier)      last day (4230 days later) »