« first day (1746 days earlier)      last day (3426 days later) » 

08:00
@Leri you could make them in parallel, but if you're getting a lot of data out, it's not really worth it, because of all the copying ... unless you can also deal with the outcoming data in parallel, in the thread that fetched it ...
@JoeWatkins I was thinking of something like "ambient context" (in nhibernate), not sure if it's going to work that way with pthreads though.
@Sajad Lets say you have a User and Article classes, which accept PDO instance as constructor's parameter. Now, let's assume, that user and article needs an access to a different database. How will you know which connection each class needs?
@Leri For async I/O I'd just use a event loop with non-blocking I/O, e.g. Amp.
I'm unfamiliar with it @Leri, can't say
Hi,
We have created the application using cakephp 3.0 that an application runs in an Iframe.

Now the problem is not able to get the session value in the safari browser.

We have tried this solution added header ('P3P: CP="CAO PSA OUR"') --->It works fine in IE browser

Anyone please, help to get the session value in safari browser
08:03
@Sajad That code example there is designed to share a single DB connection between several objects. If you need to share 2+ DB connections, you either need two StructureFactory instances with different providers. Or you need to alter the StructureFactory.
@kelunik Hmm, you don't always need event loop. For instance, you have usual web-app. However, one of the actions need to do several heavy queries and I'd like to make those queries async and then await result.
@PeeHaa Hi are you there
@tereško ah alright then
@Leri Well, theoretically, you could just start a loop for those queries to wait for them in parallel and exit afterwards, but you'll need some sort of task scheduler to make it work.
@JoeWatkins I see. Last question: can I actually share something between pools (I mean safely)?
08:07
@Sajad what problem were you trying to solve there?
@Leri objects that descend from Threaded (a pthreads internal class) are thread safe, you can pass them around multiple contexts and get data in and out, but nothing is really shared, you can't share in a share nothing architecture ....
@tereško actually I did not know what is the performance of your answer. that I know it now, and I think that is not prepare for something that I need.
that's vague
Morning
do you need to connect to more than one database, @Sajad?
08:10
@tereško yes
@Leri
<?php
class My extends Thread {
	public function __construct(Threaded $threaded) {
		$this->threaded = $threaded;
	}

	public function run() {
		while (($member = $this->threaded->shift())) {
			var_dump($member);
		}
	}
}

$shared = new Threaded();
while (@$i++<40)
	$shared[] = $i;
$my = new My($shared);
$my->start();
$my->join();
?>
$member is not the same physical memory as $shared[$i] in the parent context, it's a copy ...
@JoeWatkins Basically, copying happens every time. Well, in that case parallel querying is better done with event loop. Bad thing is that if you want to make just a little code part async, you need to start event loop multiple times.
here is my codes:
class DB
{

private static $instance = null;

public static function getInstance()
{

if (null === self::$instance) {
return self::$instance = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
return self::$instance
}
but that is just for one database name, how edit it for several database name ?
08:13
ouch
how do you know which DB you need to use?
@Leri You can put the whole logic into the event loop instead of starting it multiple times.
@tereško why you ask that ?! that's very clear, I want to send the database name as a parameter and then use of it
DB::getInstance($databasename);
Hi,
We have created the application using cakephp 3.0 that an application runs in an Iframe.

Now the problem is not able to get the session value in the safari browser.

We have tried this solution added header ('P3P: CP="CAO PSA OUR"') --->It works fine in IE browser

Anyone please, help to get the session value in safari browser
@kelunik Makes sense, however, for low traffic project sounds like waste of cpu...
@Sajad that is not what I am asking
08:16
0
Q: 'Plus' keyword is not working on mysql fulltext searching

Mahedi HasanI am using a keyword like 'iphone 6 plus' or anything including 'plus' keyword for mysql full text searching on my local database, but its return empty result. Its only for plus keyword cause when i was using a query like match('keyword_map') against ('plus' IN BOOLEAN MODE). This query returns...

help me
Lets say you have DB1 and DB2. How do you know that you need to do $user = new User($db1); instead of $user = new User($db2);?
@Sajad how do you choose which DB will be used by an object?
@Leri I don't think it's that expensive. But you won't get the real benefit with the web SAPI anyway, because you can't do other things (handle other requests) while your loop is waiting for a query result.
@tereško ah well, I have several class (contact_us, search, login, register). now, some of them need to the separated database, and for answering to your question, I want to define in the each class, the name of database that it needs.
@tereško ow wait, let me think for a monument ...
@tereško ok, I don't know how should I choose whice database will be used by an object.
I think that I need to a trick
ok .. then answer this: why do you need different databases there?
Anonymous
Ugh, mornin o/
08:25
@tereško because I have several database
that explains nothing
@Sajad Then: Why do you have several databases?
database1[table1(users),table2(admins)]
database2[table1(posts),table2(votes)]
@Sajad Those four tables should just be in the same database.
@tereško ok, you tell me, when a project has several database, how should I use of them ?
08:28
Hi,
We have created the application using cakephp 3.0 that an application runs in an Iframe.

Now the problem is not able to get the session value in the safari browser.

We have tried this solution added header ('P3P: CP="CAO PSA OUR"') --->It works fine in IE browser

Anyone please, help to get the session value in safari browser
@kelunik why ?
@Sajad that explains nothing
why cannot you have posts, users, admins and votes in same database?
@tereško I can, but I think that is not standard, is it not ?
lol?
just you tell me when should I use of several database ?
08:29
@Sajad do you store your clothes in different houses?
like socks in this one, pants in another one
@anyone pls ans my question
@SergeyTelshevsky this more of a case for having two houses: one for people and other one for the clothes
@SergeyTelshevsky :-))) no, but I store them in the different commode
table = commode
1 min ago, by Sajad
just you tell me when should I use of several database ?
08:31
@tereško ?
when you are working with two separate systems
@tereško then each project just have one database ?
99.99% of time
@SergeyTelshevsky interesting
@tereško interesting !!! really I did not know that !
besides, @Sajad, you will want the posts to be associated with users
08:33
you can have multiple databases, but use the same dbms server @Sajad
@Sajad think about it this way
Why would you want two databases for the same project?
Can you think of a reason?
@MadaraUchiha for more regular
I think @Sajad needs to learn about "foreign keys"
two databases are perfectly legit. it's using two connections that is strange
@RonaldUlyssesSwanson It's actually the other way around...
08:35
@tereško I know what it that and I used of it
@MadaraUchiha why?
Using a connection pool with 10~15 connections open simultaneously and ready to provide with queries is what's normally done.
8 mins ago, by Sajad
database1[table1(users),table2(admins)]
database2[table1(posts),table2(votes)]
But those 10~15 connections are generally to the same database
then why wouldn't you have foreign key relation between posts and users?
08:36
@MadaraUchiha i meant two pdo instances
@RonaldUlyssesSwanson I'm sure this is what a lot of beginners don't understand. And all because of the word database. Perfectly legit is having 2 schemas
@RonaldUlyssesSwanson PHP's web SAPI is extremely bad in the sense that there is no memory persistence between requests
@tereško I have not between posts and users, I have between posts and votes
@MadaraUchiha ah, I see, thanks
Aren't the posts made by users?
In most other languages, you maintain a connection pool and and ask for available connections from that to be used for database operations.
08:37
@tereško no. I have a dictionary (for example)
var connectionPool = mysql.createConnectionPool(config);
connectionPool.getConnection().then(conn => { do whatever you want; });
That's (approximately) how it's done in node
Java has a similar (albeit more verbose) approach
Putting it all together: I will create one database contained maybe 40 tables. just tell me one database including 40 tables is ok ?
@Sajad yes
@Sajad Sure.
@SergeyTelshevsky ok, thanks
08:40
you may put 4000 tables
@MadaraUchiha ok thanks
If you actually need 40 tables to store your data, it's fine
@Sajad if they are part of the same schema, otherwise you can separate them in multiple databases
@Sajad that's what you will usually have for a small-to-medium size project
user924016
lol
08:41
@RonaldUlyssesSwanson waht are you talking about ?!?!?
@SergeyTelshevsky when you said 4000, I'm sure that one database is true
oh I remember shared hosting times.. one database, prefixed applications..
@tereško set of tables that arent necessarily interconnected (no references to each others, but only within tables of the same set)
@RonaldUlyssesSwanson That's generally true for large applications.
Very large ones.
@tereško He think as I previously
08:43
@RonaldUlyssesSwanson so if you have a news site, then you would put articles in one database and UI translations in another database? That's fucking retarded.
@MadaraUchiha very large is more than 40 table right ?
"very large" is 100TB+
@Sajad Very large is more than one project that use the same data
as in terabytes
@tereško It's not a question of size
It's a question of complexity.
Also, good luck having 100TB of data with MySQL, lol XD
08:44
I would go with 200+ tables for "very complex"
@tereško There is such a project?
@tereško no, that's the same project, probably
13 mins ago, by Sajad
@tereško then each project just have one database ?
i assumed from that it's two entirely different projects
@tereško Depends, if you have an entire set of things based on the articles
IIRC in MySQL, a database(schema) is only a namespace without any additional functionality, correct me if I'm wrong here
I can only imagine there's a lot of useless data and back-peddling going on in a 200+ table DB.
08:45
@RonaldUlyssesSwanson when you say "not interconnected" I understand it as "has no direct relations between table keys"
if that's the case you can use multiple databases. but you must be sure you aren't going to need anything referencing anything in other databases
Connections and aggregations and more connections, it may make sense to separate other things to a different schema.
@tereško exactly
MySQL doesn't differentiate "database" with "schema" IIRC like PostgreSQL does.
@RonaldUlyssesSwanson UI translations will usually have nothing to do with Articles table (or it's connected tables)
08:46
@Sajad facebook has 30+ PB, that's 30.000+ TB, and facebook is nominally a PHP project
@MadaraUchiha exactly
@JoeriSebrechts all of tables are in the one database ?
In Postgres, you'd have one database per application, but could have many schemas.
(Which is one of the many reasons PostgreSQL is almost strictly superior to MySQL)
@MadaraUchiha that's what I called a problem earlier, the fact that in mysql people mix database aka schema with database aka dbms
@Sajad no, it's a hadoop cluster, no database can store that amount of data
08:48
@JoeriSebrechts ah ok
so .. to bring this to a close, @Sajad: you were solving the wrong problem
@Fabor our DB is ~ 1100 tables, all interconnected. it's not that bad, beyond a certain size the connectedness does not increase, because many pieces are orthogonal (only connect through a central set of tables)
@tereško well, absurdly yes, you can separate that in two databases. but it must be worth it :P
@JoeriSebrechts Got a lot of devs?
40 tables are just nothing @Sajad
08:49
somewhere around 50, don't know the exact number
@RonaldUlyssesSwanson they are not nothing, they are a bit !
@RonaldUlyssesSwanson if you want a "rule of thumb" then I would go with: you should usually have one DB per business domain
My rule of thumb, use Mongo unless it seriously makes sense to use something else :P
my rule of thumb would be to use mongo only after trying everything else :p
if you are doing some system integration project (like assembling shared system for all insurance providers) you might have multiple DBs to work with
08:51
@JoeriSebrechts I honestly don't know why people hate on mongo so badly. It's not that hard to configure, and its querying interface is one of the best out there.
@MadaraUchiha it's a poster child of rails "culture"
many bad (and later - rewritten) projects have used mongodb
ok, To make sure, when I install phpmyadmin on my laptop, and when I go to localhost/phpmyadmin, I see several database: cdcol (1), information_schema (17), mysql (23), phpmyadmin (8) and .... . Now I want to know that I should just create 1 database like them for all of my project, that's right ?
e.g. mywebsite (40)
@MadaraUchiha i don't hate it, it's just that i've read too many deep dives into how it works a technical level to trust it for anything, it doesn't seem soundly architected
@JoeriSebrechts 1 DB for 1 project. Usually people pick the DB name the same as the project's name.
@tereško imagine you have 90 sites all different but using the same data. wouldn't you have a "site_x" database for each site? i think one could apply the same business domain/application domain separation to databases
08:53
Hi,
We have created the application using cakephp 3.0 that an application runs in an Iframe.

Now the problem is not able to get the session value in the safari browser.

We have tried this solution added header ('P3P: CP="CAO PSA OUR"') --->It works fine in IE browser

Anyone please, help to get the session value in safari browser
@tereško I need to hear that ! thanks
@tereško and thanks for your point (project's name)
@KarthikKeyan Have you tried Symfony?
Anyone else hungry?
@RonaldUlyssesSwanson only case when you will have multipole databases on same server will be in development environments
@Jimbo No i using Cakephp 3.0
08:56
my condolences
@tereško I should to go now, But I have a question about your answer. usually what time you are online in the room ?
@Fabor Hey! Posting porn isn't allowed!
@Sajad "most of the time", I think
@tereško what if application has entirely different schemas. i wouldn't pollute the actual "data" database with all that. just for the sake of cleanness, not for performances or anything
:P
08:57
@tereško good, bye (all) for now !
I've been on bloody rewrite rules for 2 days now and no progress, bloody subdomains. Might even make a question on it it's peeing me off that much
@Jimbo brohug
try asking here?
Probably too complex
@Jimbo Stop using apache
@PeeHaa Company currently locked into it, not my choice
08:59
Can't you just route using php at least?
you still have to do the domain related stuff mostly in apache
Doesn't REQUEST_URI also contain domain? Not sure
Ah damnit
@PeeHaa o/
09:03
\o
@RonaldUlyssesSwanson phsadness I kinda worked on a simple request class last 2 days, but forgot whether it was in :P
@kelunik Honestly, I want to be sure that it worth starting big web-app on php without creating maintenance hell. :-)
@Leri You want to start a new project?
Yes and I have to choose between php and asp.net mvc 5.
@MadaraUchiha anyway, the connection pool imho should be handled by the dbms itself, not the application. which you can do in php using persistent connections settings
but not sure about that, never tried
talking of, allow_persistent, max_persistent etc ini settings
user924016
09:09
yep persistence is real fun until you lock a table and get stuck =]
@RonaldUlyssesSwanson No...
Opening a connection is expensive.
A connection pool on the database's side doesn't really make sense
Because it's making the connection between your application and the dbms that's expensive...
@MadaraUchiha I think the main reason for lack of connection pool in php is the TTL of php scripts
and isn't that solved by persistent connections? i thought yes
@tereško Yes, exactly
The lack of persistent memory between sessions
you are not supposed to deal with lose of connection
09:12
@RonaldUlyssesSwanson Persistent connections? How? There's no shared memory between PHP processes....
PDO::ATTR_PERSISTENT @MadaraUchiha
@RonaldUlyssesSwanson And when the PHP script dies?
just because there is a feature does not mean that you should use it always
connections will remain active, if at least 1 other php process is active as well, no?
@MadaraUchiha Its' called persistent for a reason ;)
09:14
The canonical way of doing things is for data to exist in two places, the relevant portion in the application's memory, and all of it in storage, and the application occasionally syncs data to/from storage
PHP can't really do that
"persistent" is just a politically correct way of saying "annoying"
It has to build the memory model from scratch every time, and persist it every time.
@PeeHaa Reading the manual, it sounds like PHP shooting itself in the leg, and then treat the wound.
@MadaraUchiha i don't believe so, otherwise it wouldn't make much sense
@MadaraUchiha Why?
@PeeHaa "Let's make a special case for database connections!" and also, it seems you can only do that with one connection per credential set
09:18
What does that last part mean?
Also note that I don't care about the special case argument, but rather the stupid people going to do stupid stuff argument
@MadaraUchiha we use persistent connections with oracle, but the only thing it does is keep the network connection open to the oracle server. on every request the oracle session is reset to its defaults. so it's just a perf optimization to avoid unnecessary TCP handshaking
Although tbh sql has never been the bottleneck for me and if it were I would fixed it in another way than persitent connections
@PeeHaa ,Hi the session id not another action
What?
fml
0
Q: Apache dynamic wildcard host rewrite with dynamic subdomains

Jimbo I'm currently in the process of converting an old apache vhost, where one is currently created for each new release, to a dynamic host that can handle all the subdomains so we don't have to create a new one all the time. I need some help! We're using apache v2.2. The Goal To have a single v...

09:23
@PeeHaa ,Hi the session id not get in another action using safari browser
@tereško yea, you don't need a pc because bananas
btw, how's your box serving ?
exceptionally good
the only thing that bothers me is that case is fairly hot, but probably that's something I must get used to. temperature monitoring shows ~70 in games
you could add few fans, to improve the airflow
fans cost from €7 to €30
you probably have a bit limited airflow
which case did you pick in the end?
I'm gonna make a quich ckeck
the heated parts are the side from the middle where the VGA is located up to the place where CPU is
@SergeyTelshevsky did you take out the middle HDD cage?
09:34
Now I really should write some more chapters...
@CapDroid mind your words. :P
/cc @DaveRandom I know you love rewrite rules :-)
Morning
WAHT THE FUCK
09:37
why am i here?
wtf is happening
@AshishKakkad : why did u invite me honey??
@PeeHaa get your hammer!
@AshishKakkad you are a fucking asshole. Please stop dumping your shit in this chat room
@RonaldUlyssesSwanson Please remove all this stuff. sorry
09:37
yay
it's soo room-elevenish here
Good morning
I have no idea what is going on, but I see a lot of angry people.
@PeeHaa could you please clean up the room and ban @AshishKakkad ? chat.stackoverflow.com/messages/24715420/history
WTF.
may be kind of miss click
no please
dont ban him..
he will not bother u again..okay?
09:39
@PeeHaa you bastard :) wake up :p
take my word
ok people. WHo made this and crap and who do I have to kick?
@PeeHaa I linked you
/me hides and covers.
PeeHaa...please let go
09:40
18 messages moved to bin
@PeeHaa : Please sir.. last chance for him
14 messages moved to bin
@PeeHaa Don't do it sir!
Kicked and kicked
09:41
@Patrick IMHO, you should revisit the "routing" and "dynamic pages" chapters and then do a chapter on DB handling
Dude. Equal opportunities and all
16 messages moved to bin
Whoever moved that crap: you are a fucking moron
10 messages moved to bin
@PeeHaa I linked you to the "moved" message .. which the guilty person quickly tried to hide by editing
@AshishKakkad I hope you get aids
@tereško What do you mean by revisiting? I definitely want to go into some DB stuff and auth, that's what a lot of people requested
09:45
@PeeHaa rude.
@PeeHaa by mistake
I have moved the messages to your room
@Patrick for example, the routing chapter never really explains what routers are supposed to do
@Epodax how can one move a gillion messages accidentally?
^ that
09:46
v this
@RonaldUlyssesSwanson What? I don't know? I never commented on what he did (I didn't even know before you said it).
But wanting some one to get aids? I mean, common.
getting flag in this room
@Epodax it's like first aid, only several
@tereško lol!
@tereško the structure of your answer should be like this ? (two script)
09:48
lol where ? @cap
@SilentKiller. @CapDroid, @Epodax GTFO
you have done harm enough
now fuck off
@tereško wtf did I do? - Don't lump me in with the twats who did all that shit.
it's mayhem here today
@Epodax .. oh .. sorry, you are not one of the invaders
@tereško keep ME away from the crap. if you dnt know anything then should stay quite and not include others
09:51
@SilentKiller the second "script" would be in a separate class file, which would be managed by an autoloader
(if you know how autoloaders work)
what ? @tereško that must be for @Sajad i think
@tereško I'm just here because someone is flagging here
the first script would most likely be in bootstrap stage of your application
what/who's this @CapDroid and why is @PeeHaa saying modflagworthy things?
@tereško thanks for the feedback. opened a ticket for myself and will see what I can do when I find some spare time
09:52
@Gordon chat.stackoverflow.com/messages/24715420/history thjis shithead caused it and then tried to hide the evidence
@Gordon that's long story
@Gordon @AshishKakkad have been p[ooring crap in here like a madman
@PeeHaa yeah, well flag him but dont let him drag you down on a level that makes you say things like that
@Gordon if someone flagged on message then obviously 10k user comes in that room
@Gordon Yeah ofc you are right
09:54
@Gordon do you have any tools to remove all "Professional Gujarati" members from this room?
;(
@tereško no
@Sajad the second "script" would be in a separate class file, which would be managed by an autoloader. (if you know how autoloaders work).
The first script would most likely be in bootstrap stage of your application.
@Gordon that's a shame :/
@tereško ok, so, I have a class named 'test', how can I use of database in my class now ?
ThW
ThW
Morning
so can we go back to normal now, please?
09:58
@ThW morning ? where are you?
@Gordon Friday normal or regular day normal?
@Gordon have a nice day, Bye...
@Sajad did you understand how StructureFactory thing works?

« first day (1746 days earlier)      last day (3426 days later) »