« first day (1844 days earlier)      last day (3090 days later) » 

1:01 PM
everything that's in the script is what I need, nothing more nothing less
 
header('Content-Type: application/vnd.ms-excel'); isn't the right content type for an xlsx file
You should be using Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
 
@Sherif Thanks for pointing to a page with the correct content types for different filetypes, just to prove my point
How many records in the $verbruiks result set? And are you returning only the columns that you're outputting to Excel?
 
Ahh, there's another x at the end :)
Silly MS
 
PHP project, damn.
;)
 
1:08 PM
@Sherif appending an x for XML did make sense
 
@MarkBaker array of objects, number of rows is variable from 30k - 100k, but I'm making a workaround, I think I know what my problem is, give me a sec, I think you got me on the right direction
 
@Andrea Isn't the difference that it's a compressed archive?
 
@Naruto and what are you getting from $verbruik->getTijd()? Is it a Date string? If so, can't you simply use PHPExcel's built-in date handling functions? PHPExcel_Shared_Date::PHPToExcel($verbruik->getTijd())
 
@Sherif between .doc and .docx? No, completely different formats
 
@Sherif - xls is a BIFF format binary wrapped in an OLE2 object
 
1:10 PM
Are they? According to their specs it's just a zip file.
 
@Sherif - xlsx is a collection of XML files (and a few odd binaries) wrapped in a Zip
 
@Sherif yes and HTML is an SGML document but that doesn't mean much
 
@Andrea It means you'r still living in 1995.
 
it's a completely different format from the pre-2003 one
 
:p
 
1:11 PM
@Sherif well yes because HTML hasn't been an SGML application for a while now
 
MS has backwards compatibility to 1980's
Well, at least if you read the BIFF spec it does.
Who knows what they do now.
 
MS backward compatibility isn't in the file formats, it's in the code that reads those formats..... but even that isn't true
 
@Sherif for Windows apps maybe, not for files
 
Basically they have multiple importers for each of the different variations/versions of file formatss
 
PowerPoint 95, 97 and 2007 use incompatible file formats
 
1:13 PM
No, I mean in the spec for BIFF actually offers backwards compatibility all the way to when Excel wasn't even a thing
@MarkBaker Yea, but it was by design
 
Probably. It's just a container format
 
I mean spreadsheets where the most useful thing since sliced bread back then.
 
in the same way that RIFF is
 
The big bad with BIFF was the switch from OLE to OLE2 for BIFF 5
 
Obviously you didn't want to piss off your best customers.
Ironically spreadsheets still haven't died out.
 
1:16 PM
Ironically?
 
posted on November 03, 2015 by nlecointre

/* by Stefan Ray */

 
Is it not ironic that in the year 2015, where we have so many databases, that people still seek the utility of a spreadsheet?
I find it ironic.
 
@Sherif databases predate spreadsheets
 
It's such a primitive tool. Like the pencil and yet we can't seem to do without it.
 
1:17 PM
they're not primitive at all
 
@Andrea That wasn't the issue. The issue was no one knew how to use them.
 
Spreadsheets are actually pretty sophisticated tools
 
@Sherif huh? I wouldn't say that
 
Yea, what would you say?
 
And how many databases come with built-in (out of the box) financial modelling functions for accountants, or built-in complex number handling for engineers
 
1:26 PM
@MarkBaker that's just a timestamp, I changed my code so that $verbruiks array is only 1 object large.. so basically i'm doing the fetch from the DB and instantly using the object.. but the result is still the same
 
Can you pastebin your current code?
 
Guys,
whats the best length to have in a MySQL database for a PHP generated UNIX timestamp?
 
@HassanAlthaf I find INT(10) UNSIGNED works pretty well
 
@MarkBaker everything is kind of the same, except I pulled the db stuff into the same script: pastebin.com/FVF7n8Ts
 
1:41 PM
Would recommend you use DATETIME tho
 
@Machavity Does DATETIME support storing UNIX timestamps?
 
@HassanAlthaf Not as integers, no. But it's future-proof and you can always cast the DATETIME back to a timestamp if you need to
 
@Machavity How can I convert it into a timestamp?
Btw, I will be storing Date of registration and Date of Birth
 
@HassanAlthaf SELECT UNIX_TIMESTAMP(your_datetime_field)...
 
Damn, what if I'm doing a SELECT *
Do I have to do it separately?
 
1:45 PM
use PHP's strtotime()
does the same thing
 
Oh, thanks a lot.
Btw, how do I convert a UNIX timestamp to that format?
Or, whats the most efficient way to convert the user input into that format?
 
date() or DateTime object
 
So, $time = time();
$date = date($time);
Am I correct?
 
@HassanAlthaf Hafta pass the format you want to date() but yeah
 
Oh, what format do I set it for storing in a DATETIME MySQL field?
 
1:48 PM
Use the Google format.
 
Google format?
 
Yup.
 
return date("Y-m-d H:i:s", $unixTimestamp);
Thats what I found. So I can just put that, yeh?
 
Why don't you try it and find out?
 
I'm a huge fan of paperbacks, are there any nice resources out there for picking up OOP good patterns and principles? I already have the github repo starred, but I like being productive on my commute :P
 
2:00 PM
What sort of exception should you throw when persisting some data fails?
 
is their any way though which I can find how many tables have been changed since last saturday...?
 
@tibanez PersistingSomeDataFailedException?
 
@nikita2206 I currently have PersistenceException to keep it abstract to not specify what type of persistence mechanism is in use
Let's say you are registering a user, when validating the supplied data and some of it is invalid I would not throw an exception because it is not an exceptional case so I would return null but then if validation passes and then persisting the user data fails I would throw a PersistenceException. Something feels with to me about having a method which returns null when something goes wrong and throws an exception when something else goes wrong
 
@tibanez shouldn't you return a list of validation errors if validation failed?
 
@nikita2206 The thing is though the method will return the newly created user if it succeeds
In PHP i can have the method return whatever type of object I want but in a stricter OO language I wouldn't be allow to
 
2:14 PM
@tibanez you can return a tagged union. PHP doesn't have them, but it has polymorphism for it
 
@nikita2206 Tagged union?
 
Look at Rust's result data type for example doc.rust-lang.org/std/result
You can achieve the same with one abstract Result class and two classes that will extend it: Ok and Err
So in your case you would return Ok(new entity) if it succeeded or Err(list of errors) if it failed
What about exception, I don't think there's anything wrong here, if persistence layer fails it is probably something big
 
What's the best way to store temporary user data?
Like which user is logged in?
 
@nikita2206 Looks interesting thanks.
 
@Naruto - unsure why it should be using so much memory now, especially if you're cell caching using SQLite3
@Naruto Though I would suggest moving the $objPHPExcel->getActiveSheet()->getStyle('B' . $teller)->getNumberFormat()->setFormatCode('dd/mm/yyyy H:m:s'); line outside of your loop, and doing $objPHPExcel->getActiveSheet()->getStyle('B2:B' . $teller)->getNumberFormat()->setFormatCode('dd/mm/yyyy H:m:s'); at the end so that you only have a single call to set the cell styling for all cells in column B, and reduce the number of cell styles to 1
 
2:25 PM
my file_exists doesn't work for php file . Anybody have any idea?
file path is /mydrive1/var/www/development4/includes/cropping/resize-class.php
 
@MarkBaker that's actually the solution to the problem >< Why didn't I think of that :(
 
@Hassan Session?
@Naruto - you mean we have a win? We've squeezed a gallon into a pint pot?
 
@MarkBaker putting that out of the loop drastically reduced the memory usage, it's still fairly high, but that single line reduced it dramtically :O
 
THat calls for a ^5 I think
 
Good morning
 
2:32 PM
@MarkBaker I know, but I remember reading somewhere that it is not secure to do that.
@ircmaxell mornin.
 
@HassanAlthaf O.o
@ircmaxell mogguh
 
Hassan - why should your session be insecure? As long as you don't store it in the cookie
 
user895378
@LeviMorrison I haven't yet. I can't decide if I'm okay with void (as opposed to null)
 
@MarkBaker How do I not store it in the cookie?
 
And you can take appropriate steps to pevent session hijacking
The cookie is an ID for a session, it's not the session itself
When you store session data, it's on the server, not in a cookie on the client
Only the session ID sould be in a cookie
 
2:34 PM
I see, in that case, we're safe.
Perhaps I misinterpreted the post.
 
user895378
@Trowski yeah I know ... it's annoying (the reuseport thing on Mac). Haven't had a chance to look into it further.
 
I do make a record in the DB for every active session.
Damn, I hope I can finish this project by December 1st.
#Hackathon2k15
#HellYeahBabes! :]
 
@MarkBaker We have a win, that was a gallon for you? ^^ appreciate the time you took to help me!
 
@rdlowrey It looks like it will pass regardless of your vote. In some ways that's good because you can vote how you want and it probably won't affect the outcome.
I don't think we're in such a rush to get this feature. I really wish Andrea would have waited like I asked her to :/
I really hope we get Foo|null, and then we'll have both null and void.
It really doesn't make sense to me.
 
2:51 PM
@Naruto - no problem, glad to be able to help
Foo|null is the big win that I'm waiting for
 
3:02 PM
@rdlowrey Is provisional here a typo for 'provisionable' ? And does it really mean "the name of a classes instance method" ?
 
posted on November 03, 2015 by nlecointre

/* by Samuel_Vimaire */

 
user895378
@Danack looks like a typo to me
 
does any of you know how big SunshinePHP is? Est. number of developers attending? @ircmaxell maybe?
 
@rdlowrey I'll probably submit a pr....I keep getting caught by having typos/missing functions when I try to execute something. I'll change it so that if it's a string, or [string, string] - for Auryn to say what you actually passe it.
 
github.com/amphp/aerys/commit/… @rdlowrey … I'll just ping you until you answer :-D
 
3:09 PM
@rdlowrey - provisionable is the word in the docblock for the prepare() method, so I suspect a typo
 
@LeviMorrison i don't think these two will harm each other in any way, they both are useful
 
And urgs, who made the favorite-stars on twitter to I-like-hearts? :-( Did facebook buy twitter???
 
@Gordon around 200 IIRC
 
@ircmaxell hmm, that's rather smallish. thanks.
 
@bwoebi admit it, they always were more like 'like' than 'favorite'
 
3:11 PM
@Gordon it's a community conference
 
@nikita2206 is there any real difference?
 
@ircmaxell ah, I didnt know. I thought they are commercial
impressive number of speakers
 
nope, 100% non-profit
 
@bwoebi people usually 'favorite' stuff that they want to get back to later
 
@nikita2206 Well, the real thing bugging me is that it's a heart.
@nikita2206 So, I'm using it correctly…
 
3:14 PM
@ircmaxell thanks
 
@nikita2206 I have like 68 favs in 2 years…
 
@bwoebi usually i retweet in this case :D
but I don't fav at all
 
@nikita2206 RTs are for things which could be interesting for others, I guessed?
 
@bwoebi yes, i break the rules
 
@LeviMorrison Foo|null is fine, but it shouldn't be possible to declare a return type of only null.
 
3:20 PM
@TheodoreBrown And why is that?
 
function foo() : null {}
function logAnything($x) {}
funtion logInt(int $x) {}
logAnything(foo()); //This is fine
 
Because null is meaningless. What is the point of always returning null explicitly? That's what void is for.
 
logInt(foo()); //This is an errror
 
@TheodoreBrown I hope by now you are aware of this, but even in Andrea's proposal these void functions still return null
Just because it is guaranteed to return the exact same value does not make it "useless".
 
@LeviMorrison Yes, but you can't return null explicitly.
 
3:23 PM
Anyone used Mink / Behat quite a bit? Reckon it's theoretically possible to start a session in one script, then at a later time continue using that session with another script simply by re-connecting to the session endpoint?
 
@TheodoreBrown And what difference does this really make?
It still returns null.
And absolutely we should not warn if you use the result of a void function.
So… why void instead of null?
 
@TheodoreBrown As well as the example above, it's useful when you do automatic code generation (which I probably do more than the average PHP programmer):
function foo() : null {}
function bar() : int {}
function fooOrBar($x) : null|int {
    if ($x) {
        return foo();
    }
    else {
        return bar();
    }
}
 
Give me a full-length explanation.
 
fooOrBar gets generated programmatically......and the null return type is useful to help generate the code correctly.
 
So far I have heard the primary two reasons for void to be entirely non-technical, which is just crazy to me.
2
"It's what other languages use."
"It's what our docs use."
It is especially crazy to me because void functions as proposed do not even match the semantics that other languages have for it.
 
3:28 PM
@LeviMorrison Good news! There have already been suggestions to change the behaviour of the language to match the void behaviour!
Wait.
That's not good news.
That's not good news at all.
 
Exactly.
 
@LeviMorrison why is that crazy? The fact that we're using something not just that other languages use, but that every other language which has this concept uses. That doesn't sound crazy to me
if that's crazy, then the argument that 6 is 5 + 1 would be crazy as well.
 
2 mins ago, by Levi Morrison
It is especially crazy to me because void functions as proposed do not even match the semantics that other languages have for it.
 
@LeviMorrison void is useful since it ensures that the function does not explicitly return a value. nullwould allow null to always be explicitly returned, which I don't think is useful. null only makes sense as part of a union type.
 
If we matched the other languages then it would be more understandable.
 
3:30 PM
@LeviMorrison that's not really true. Many languages, when you use void functions in dynamic contexts (function pointers, etc) produce null, just like we do
@LeviMorrison we do already...
 
@ircmaxell None of these languages are dynamic, unless I have missed something.
All compiled languages that I am aware of will not compile the code (they will not allow it and return null).
 
@LeviMorrison they all have some concept of dynamic dispatch (whether function pointer, first class callable, etc)
 
The RFC mentions that TypeScript, ActionScript, and Swift all return a unit type when void functions are used in an expression.
 
@ircmaxell you're arguing that in certain circumstances PHP is similar to other langauges. But in the main case it is not; PHP functions without a return statement return null always. That's the crazy bit, that we're matching the behaviour of other languages in their edge cases, and not following PHPs actual behaviour.
 
@LeviMorrison I strongly feel like we should have return type covariance, even more with union types … like interface specifies Foo|Bar|null, but we always return Foo … it's totally insane to also specify |Bar|null then there.
 
3:33 PM
Go run this in Swift, please:
func foo() -> Void {}

let bar = foo();
And then come back to me and tell me we match their Void function semantics, thank you very much.
Wait, just a moment; made a typo in last edition. Fixed.
 
@LeviMorrison we are talking about dynamic dispatch.
 
@bwoebi My point is we don't match their semantics. We may match it in some cases, but not in all. That means it does not match.
 
@Levi we have a lot of behavior not matching other langs due to our runtime binding of functions.
 
@ircmaxell List them. It's not many. Furthermore, of the ones listed we don't actually match Swift, so…
Sure, there exist other languages with that behavior. Let's not pretend it is common.
Anyway, I'm not discussing it anymore.
Have to get back to other things.
 
I can't seem to find anything but what would be basically "faster" scandir() on a videos directory and return the names of the videos then randomize it in an array or just index the videos over a database and return a random id - vid name from it?
 
3:43 PM
@MikeM. you probably want to still use scandir() but cache the file entries between requests.
And so then you only have to do the 'random pick' during each request.
 
That's actually an interested idea to do indeed.
Thanks for your answer Danack, just got interested in knowing it when this question was pushed on at another forum. :-)
 
Slightly stupidly, caching to just a PHP file is actually quite a good solution...i.e. generating a file that contains an array of the file names, writing it to disk, and then loading it on the next request if it is available.
That works pretty nicely with OPcache, and doesn't require an actual cache to be installed.
 
Ye OPCache is pre-installed right?
 
Since 5.6 yes.
or maybe 5.5.
 
I thought 5.5 not sure tho'
yup 5.5.0 it came with PHP, since 5.2, 5.3 and 5.4 with PECL tho' :-)
 
3:56 PM
@MikeM. no. It's included in the source package, but it's not built by default
 
@ircmaxell uhm, it is… at least in the config.m4 there are only ways to disable it, none to enable.
oh, only since 7.0.
 
it's built by default in 7? Nice
 
bundled since 5.5 and built by default since 7.0
 
though I'm assuming still not statically compilable
 
yeah, but you still have to include it manually in php.ini
yup, only shared build.
 
3:59 PM
booo
also: thanks Zend for not living up to what you promised to do
 
@ircmaxell do you perhaps know why it wasn't at the first place?
 
@bwoebi no
 
I believe it's related to the fact that it's a zend_extension (and not a module), but I don't know for sure…
 
these are rare occasions, but ": Foo|null" or ": ?Foo" really feel like a missing piece of PHP :/
 
@marcio then make an RFC
 
4:15 PM
@ircmaxell they already exist, "union types" and "nullable return types"
 
@marcio yep, void and nullable are the missing things. everything else is secondary
 
4:40 PM
@rdlowrey how do I expose a (same) host on both ipv4 and ipv6?
clone and then alter expose?
oh, there's a TODO :-D
 
user895378
Yeah that's something I meant to get around to (expose a simple shortcut to listen on all IPv4 and IPv6 interfaces)
 
I'm going to do that now…
@rdlowrey I am wondering if I should make expose() chaining instead of setting it… so that we allow multiple ports/addresses
but I'm not sure … maybe I should just have a way to make expose() recognize IPv4 and IPv6 and set two different values
 
user895378
You can't
 
user895378
Because HTTP virtual host rules
 
hmm?
 
user895378
4:52 PM
Actually, disregard that. I misunderstood. Either way is fine.
 
@rdlowrey is there any reason why you would have multiple interfaces to bind the server to?
(except ipv4/6)
 
this thing is improving quickly why-cant-we-have-nice-things.mwl.be/…
 
Hey, I know this is the PHP chat but... there's never anyone on the SQL chat. I've got an SQL table called Template which has some data in it, and another called TemplateI18N which contains the ID of a Template, a locale code ('en_US', 'fr_CA'...) and the template name in that language.

Is there a simple way to create a template and specify its name in at least once language at the same time?
Is there such a thing as joining tables to write in them?
 
Hello guys, i'm having a little trouble with encodings here on my PHP application that got transferred from linux into windows (using default XAMPP config), names like "Preparatório" are appearing as "Preparatório". Page has meta charset as utf-8, data in the MySQL table is appearing wrong too - but I can't for the life of me use a CONVERT USING CHARACTER SET to fix it. Anyone had a similar situation recently?
(data in MySQL looks wrong from Workbench application)
 
posted on November 03, 2015 by nlecointre

/* by r940 */

 
5:10 PM
@ircmaxell The problem is that it is not simple to make code simple :-)
 
@marcio thanks :D
 
@LeviMorrison some other languages
@TheodoreBrown there's probably others as well
heh, I googled for some and ended up with a page about PHPDoc's void :p
 
5:25 PM
@MaximeFabre :>
 
I've been thinking... is it possible that Laravel is actually amazing, and we're all just butthurt?
 
@DanLugg No.
 
@DanLugg nope
 
@DanLugg this is your first strike
 
But... but... but...
 
5:33 PM
@DanLugg totally…………… NOT.
 
Its the Booze Talking - The Future of PHP Featuring: @adamculp @SaraMG @pmjones @GeeH https://voicesoftheelephpant.com/?p=1136
listening to this just now
 
Anonymous
$ mv @DanLugg /path/to/ignore
 
Anonymous
:p
 
mornings
 
Anonymous
\o
 
5:44 PM
o/
 
@samayo @DanLugg >/dev/null
 
Yea, we're all butthurt.
;-)
 
@DanLugg well. there are lots of worse frameworks
like Yii
 
Yii is appropriately named; it's the sound you make while jumping out the window when someone on your team proposes it.
7
 
For me it says .. Whyyyyyhhhhhhhhhhhhh
 
5:46 PM
@wingleader stackoverflow.com/questions/279170/utf-8-all-the-way-through aka you have some bad config somewhere
 
Error: Cannot unpack array with string keys … that … was unexpected now.
 
@bwoebi once I expected this to work too
 
I wanted to array_map(...$array) to flatten an array…
Well, added an array_values() command.
hmm, exceptions do not seem to like \0 bytes.
 
6:04 PM
@samayo is this yet another analyzer that tells you "An if expression with an else branch is never necessary. You can rewrite the conditions in a way that... blah blah"?
 
… anyone please remember me how to array_unique on an array containing arrays? … or do I need my own routine there? :-(
ah, right, SORT_REGULAR flag…
 
user895378
@bwoebi not that I know of. The only sane use-case I can think of is to listen on both IPv4 and IPv6 at the same time.
 
@rdlowrey Well, maybe you have multiple IPs on a server…
 
user895378
Hmm ... maybe
 
user895378
6:19 PM
But will you ever need to host the same domain on multiple IPs but not all IPs on a single machine?
 
Anonymous
@marcio Yes. I hate to say this, but these things are becoming annoying.
 
Morning team 11
 
Anonymous
I highly doubt there exists a PHP package that complies with all the SRP, SOLID, and other good practices while perfecting a scrutinizer, php sniffer, coverage scores, passing tests,
 
Those things aren't really related :P
 
@PeeHaa Morning Mr Haa
 
6:27 PM
ohai Mach
 
Anonymous
@PeeHaa good argument :)
 
:-)
 
@rdlowrey don't know… maybe if you're shifting around with DNS due to TTL etc
 
reddit.com/r/PHP/comments/3rccm3/… <-- way to miss the point
7
 
Anonymous
^ 1 downvote from me just for creating laravel
 
Abe
6:43 PM
@ircmaxell what does that even mean
lol
 
@rdlowrey what's that $defaultHost property in VhostContainer.php … it's nowhere set?
 
@ircmaxell Shocker.
 
@rdlowrey this VhostContainer::getDefaultHost() is a bit bogus in general… default hosts actually are the wildcards … not sure why you just fetch the first one if no host matches?
is this… get the host if only one host is there?
 
Abe
6:58 PM
i'm pretty sure most of people using laravel are just doing basic crud, and unlikely they need a container
 
I'm not sure if this points to a bigger error or not, but I keep receiving: PHP Startup: Unable to load dynamic library 'C:\php\ext\msql.ddll' - The specified module could not be found. Is this indicative of a different problem because I don't even use msql and it the error is produced when I run anything php? (windows, php 5.6)
 
Abe
also, not using a container would be a good way for them to actually learn how to properly wire up dependencies
 
@rdlowrey there at least something is a bit bogus… it should just use a host in case there's one single host with no name?
 
user895378
@bwoebi Because there's supposed to be a server option so you can specify which named host is the default
 
user895378
@bwoebi nope, http/1.1 disallows that
 
7:00 PM
@rdlowrey what exactly does it disallow?
 
user895378
if it's a 1.1 request and the Host header is missing or doesn't match a specific name exposed by the server we have to 400
 
user895378
We aren't supposed to choose one
 
user895378
But: meeting for the next half hour or so
 
@Programmer Take a very, very, very close look at the file name it's complaining about, and then take a very, very, very close look at the file that should be loaded, and at the configuration file mentioning that filename.
 
7:06 PM
@rdlowrey Enjoy your meetings.
 
@Charles I can literally just call 'php' from cmd and I will receive that error. I know this driver isn't in the directory, but I don't need it anyway.
 
@Programmer PHP loads extensions specified in your loaded configuration files (e.g. php.ini). Look at phpinfo() or php --ini from command line to find your loaded configuration files and remove extension=msql.ddll
FYi, @Charles was just pointing out that you may have had a typo there as it should probably be msql.dll and not msql.ddll
 
I meant dll, sorry. Also, you were right. I don't remember how exactly I managed that, but thank you.
Now to fix this database driver problem. :p
 
7:26 PM
Sometimes you start something and it turns out you'll have a diff of more than ±100 lines…
 
I have a one to many relation , say an attribute alphabets is related to an attribute number , such that the given value alphabet has an array of values associated with it , say a->1,4,7,9
b->2,4,5,6
c->1,2,3,4

what would be the most efficient way to store them in a database, is it alphabet->number, such that

a->1
a->4
a->7
a->9

or is it better to store as json encoded alphabet->numbers

a->[1,4,7,9]

I am using mysql database
 
If it's one to many, why is 4 appearing under multiple letters?
Or is your example just arbitrary and we should assume that the actual data is adhering to a one to many constraint?
 
yes, its arbitrary
 
The problem with storing relationships in a string is that you can't use JOINs. If you're not going to actually use the relations to reference and retrieve other data in the database, then you might as well not use relational databases.
Chances are, you're going to want to use at least one JOIN somewhere in your application. (That's like saying that chances are, multicelled organisms are going to want to respirate...)
 
Thanx @Ghedipunk
 
7:36 PM
@JibinMathew Alphabet -> Number since a json would violate 1NF.
 
Also, if you're using a no-SQL database, you want to denormalize your data... And yes, that's even more painful than it sounds.
 
Ok, I get it, Database method is better..
 
Well, what you mean to say is "data normalization is better for a relational database". Not all databases are relational. But you did say mysql.
But whether or not you need normalized data really has very little to do with how you store that data and a lot more to do with how you access it.
You can look at it like this: denormalization is for speed and normalization is for maintaining a source of truth.
... generally speaking.
Which means you may actually need both in some cases.
 
That's where things like memcached come in... It'll provide speed, so long as your invalidate the cache intelligently when the truth of your data might come into question.
 
Memcached is just an in-memory key/value store. Denormalization is a process by which you speed up data retrieval. That can take many forms (e.g. using your dbms to create logical tables for you to store joins for future retrieval, or by denormalizing the data design yourself).
Don't get caching confused with denormalizing. They actually tend to serve different purposes in the long run.
 
7:49 PM
Meh, I'm paranoid about my data. The closest I like to get to having denormalized data stored at rest is to have a pre-rendered page with edge-side includes... which, again, is just caching.
 
Yea, caching is not necessarily a form data denormalization. In fact, the only thing they have in common is that they are redundant forms of data.
But that's about it.
Data denormalization has logical consequence. Meaning, you can cache data that isn't normalized just the same as you can cache data that is, but you can't denormalize data that isn't already normalized.
It's a subtle, but important difference.
 
@rdlowrey I noted that some things go wrong when you use 0.0.0.0 as address in expose() … a consequence of using "*" for IPv4. … I think I need to change that too, to use 0.0.0.0 for IPv4 and * for both interfaces…
 
Lovely old ipv6 making a mess as always :)
 
nah, IPv4 is… If it didn't exist, we would have a lot less issues.
 

« first day (1844 days earlier)      last day (3090 days later) »