PHPSpreadsheet installation and basic usage | Make an Excel File in PHP | PHPSpreadsheet Tutorial #1

PHPSpreadsheet installation and basic usage | Make an Excel File in PHP | PHPSpreadsheet Tutorial #1


Hi everyone. Welcome to my php tutorial video. in this video, i’m about to explain how to use PHP Spreadsheet to generate excel file in PHP. So what is the difference with the PHP Excel library? In fact, this library are made by the same creator of PHP Excel. As the readme says, PHP Spreadsheet is simply the next version of PHP Excel which breaks compatibility to improve the code base quality. and because all efforts have shifted to PHP Spreadsheet, PHP Excel will no longer be maintained. So you should start consider using this library instead of old PHP Excel for your next project. let’s take a look at the documentation. this library supported more file format and also able to make a pdf file out of spreadsheet. You need php version 5.6 or newer to run this library. And also some php extension. For the installation, this library needs composer to manage it’s dependency. For those who are not familiar with composer, composer is a dependency manager for PHP. At it’s getting started page, you can see how to install composer on linux by using the installer. either locally or globally. Or in windows, you can download the executable installer, run it, and it will take care of the rest. Composer is a text-based program so you need to run it from command terminal. In my machine, i already have composer. Before proceeding, make sure that composer is already up and running in your local machine. Now, let’s make a new directory in the root directory. From your terminal, change the current working directory to our new directory by using cd command followed by the path. We can install PHP Spreadsheet by using it’s repo name. The repo name format should looks like the lower-cased github url. For now, let’s just paste the composer command. Composer will make a new json file which contain package name installed in our project. Then composer will try to download the required packages required by PHP Spreadsheet. Looks like we’re encountering a problem here. if we read the message carefully, we’ll see that one of our package requires an php extension called fileinfo, which somehow is not available in my machine. Now let’s make it available. Open the php configuration file. Usually called php.ini find the text “fileinfo”. It seems that the fileinfo extension is commented out in my configuration. So let’s fix it. You may also run through same problem but with different extension in your machine. If that happens, just do a quick google search on how to enable the required extension in your PHP. if nothing goes wrong, the required dependency will be installed without any error. you can also see here that PHPSpreadsheet recommends you to install libraries to handle pdf and render chart. there is a vendor directory created by composer. inside, you will find all package installed in this project and all dependencies. there is a file called autoload. we just need to call this autoload in our script in order to use PHPSpreadsheet. the good thing of using composer is you can add libraries like fpdf, domPDF, or tcpdf with just one command. and use the same autoload file in order to use it in your script. in order to use this library, you can use autoload.php or directly call Bootstrap.php inside PHPSpreadsheet src directory. basically both does the same thing, which is calling the autoload. i recommend you to use autoload.php. so let’s make the spreadsheet script i named it simple1.php. first, just call the autoload file. then to use the spreadsheet library, we call them here using : use PhpOfficePhpSpreadsheetSpreadsheet. for now, let’s just see the getting started page and copy the hello world script there. now let me explain what this codes does. first we call the autoload script. then load the PHPSpreadsheet library by it’s namespace. and also the xlsx writer class to make an excel file. you can read more about php namespace in the link i’ve put in description. then we make a new spreadsheet object. get the current active sheet, which is first sheet. set the value of cell A1 to “Hello World !” next, make an xlsx object with the spreadsheet we’ve just created. save it into a file named hello world dot xlsx in the server. now let’s execute the script in our browser. sorry, seems like i forgot to start the apache server. see there’s nothing happening in browser. because as i’ve said before, the file result is saved in server. now what if instead of saved in the server, i want this file to be downloaded in the browser. to do that, we can simply redirect the page to our file after generation is done. but i don’t recommend this way. let’s just try it out for now. looks like i forgot the semicolon and the name is somewhat wrong. as i have said, i don’t recommend this way. now, the recommended way is to use IOFactory class which came with PHPSpreadsheet. IOFactory are built-in class which allows us to read from and write into files. IOFactory are also shipped with another PHPOffice libraries such as PHPWord and PHPPresentation. now let’s copy our script into a new one. let’s just remove the writing part and use IOFactory instead. we will use createWriter method of IOFactory. also do not forget to load the IOFactory class in our script. we don’t need to save the excel as a file, so we save it directly to PHP output. let’s try it out. it looks scrambled. just alot of strange character. this is not what we expected. this is because what we do is making an excel binary file, yet the server and browser treats it as a normal text file. let’s tell the browser and the server to treat this file as an excel file by changing the header. let’s do google’s magic to see what’s the excel header look like. let’s copy the content type header to define the content type as an excel file. it’s now working. but the file name is somewhat wrong for an excel file. let’s add something to the header. and now it’s working as expected. this concludes this chapter of tutorial. i put the link to the source codes in the description. feel free to ask anything in the comment section. please kindly like my video and subscribe to my channel. see you in the next chapter.

Web Development – CSS3 Transform, Transition and Animation

Web Development – CSS3 Transform, Transition and Animation


Web Development CSS3 Transform, Transition and Animation Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Don’t Forget To Subscribe Our Channel Thanks For Watching

JavaScript achievements of the Year 2019 and key Frontend’s trends: FrontEnd news (25 Dec’19)

JavaScript achievements of the Year 2019 and key Frontend’s trends: FrontEnd news (25 Dec’19)


Hi! Let’s talk about JavaScript achievements of
the Year 2019 and key Frontend trends. I’m Anatol, and you are watching the Good
Parts of the Frontend development. If this is your first time here and you want
to learn Frontend and JavaScript, start right now by subscribing, and don’t forget to turn
on the subtitles. [Music playing] Let’s start with the exciting news! According to “GitHub octoverce” and RedMonk’s
Programming Language Ranking, JavaScript is still the #1 programming language! TypeScript is also rocketing up and now sits
at position #12. Bye the way, for the first time, Python has
overtaken Java to take second place. There are several features approved to be
part of the ES2019 specification. Among them are “Array.flatMap”, “String.trimStart”,
and others. JavaScript, as a language, demonstrates continuous
growth. One more feature that is expected to be shipped
in JavaScript is “public and private class fields.” It’s already available in Chrome and Node
and might be delivered to other browsers soon. The project Deno made progress. Therefore, Ryan Dahl presented how to get
started with it. Deno is a safe, secure and reliable alternative
to Node; thus, you might be interested in it. [Music playing] React hooks have been presented as a complementation
to the React context. That might be a game-changer because we can
omit state management libraries (like Redux), and React becomes more framework-ish. Probably, some next year, we will see “react-router”
or “Styled components” to become a part of React. We’ll see. During “Google I/O 2019,” it has been announced
that Googlebot now runs the latest Chromium rendering engine to ensure support for the
newest web platform features. It means that SEO is now becoming much more
comfortable. One more great feature is WebAuthn, password-free
logins API on the web approved by W3C. It is already available in Android, Windows
10, Chrome, Firefox, and Edge. The OpenJS Foundation welcomes two new projects:
AMP and nvm. These are the first projects that are engaged
by the incubation process since the Node.js Foundation and JSF merger! I believe that’s just the beginning. World Wide Web Consortium (W3C) brings a new
language to the Web. Following HTML, CSS and JavaScript, WebAssembly
becomes the fourth language for the Web which allows code to run in the browser. That might change the Web in the following
years. We’ll see. That’s all in my list. What’s about you? In your opinion, what’s the most influenced
on the Frontend this year? Leave your comment down below. [Music playing] If you like this video, give it “thumbs up,”
share it with your friends, subscribe to the channel and watch other episodes. Thanks for watching and Happy New Year!

Basic Tags in HTML – Learn to Code in HTML and CSS

Basic Tags in HTML – Learn to Code in HTML and CSS


– [Voiceover] In this lesson, you’ll create your very first HTML text. And I want to begin by saying that the role of HTML in a website, is to specify the content that you will see in the web browser. You’ve probably visited a
lot of websites in your life and you already know that
a website is not just text. Websites have other elements. They have headings, they have images, they have forms, tables,
and many other things. So how do we tell the browser what it is that we want to show? That’s when tags come into play. For example, I want to tell the browser that this “hello world” text is actually a main heading in my document. In an ideal world, I would
be able to just talk, and maybe that’s where we’re headed. I can just say “Hey
browser” or “Hey computer, “show this text as a main heading”, but that doesn’t work for now. So we need to use tags. The first type we’ll be learning will be the main heading tag. Tags are a bit like a sandwich. A tag has an opening, and then a lot of tags have a filling as well, and a closing. So this example here shows the h1 tag, which is a main heading. And that’s exactly what we’re going to implement in our code. So you begin by opening your tag and just like a sandwich,
you always need to close it. So I’m gonna close it. For that you type the same tag as well, but you add the forward slash before the name of your tag, and then you save. If we look at Google Chrome
and refresh the page, this is now a main heading. What if I want a secondary heading? I can use the h2 tag
and type something like “the sky is blue”. Close my tag just like the sandwich, save, refresh the page, and
we’ve got a second heading. “The water is cold” will be some other text I will be adding. And there we go. So HTML tags are the way for us to tell the browser to tell the page how we want
to display our content.

Bundle Optimization, React Hooks and Grid CSS: FrontEnd news (21 Nov’18)

Bundle Optimization, React Hooks and Grid CSS: FrontEnd news (21 Nov’18)


Hi! Let’s talk today about Bundle Optimization,
React Hooks and Grid CSS. I’m Anatol and you are watching the Good Parts
of the Frontend development. If this is your first time here and you wanna
learn Frontend and JavaScript, start right now by subscribing and don’t forget to turn
on the subtitles. Let’s start today with the interactive web
performance docs. It’s a new web portal with tools, courses
and interactive demos. It’s about JavaScript (code-splitting, modern
bundles), images (lazy-loading, compression), performance budgets (webpack, Lighthouse CI),
performance measurement, etc. Jeremy Wagner published a guide, titled “Reduce
JavaScript Payloads with Tree Shaking”. Knowing where to begin optimizing your app’s
JavaScript can be daunting and tree shaking might be a good place to start. Evan You previewed Vue version 3 during his
keynote talk at Vue Toronto. In this article, you can read notes of that
talk. As expected it will be faster, smaller, easier. “Webpack Bundle Optimization Helper” is an
online tool that will analyze your bundle and give you actionable suggestions on how
to reduce its size. “HTML Canvas Guide” or “A Code-Driven Guide
to the HTML5 Canvas”. This is a guide to the Canvas API, one of
the best ways to draw graphics dynamically in the browser. [Music playing] In this talk. Peter Marshall explains the main V8 Garbage
Collector features, its implementation challenges and what benefits developers get. “Key Techniques for Fast Websites” from Chrome
Dev Summit. Here you can learn all the performance techniques
you need to know in order to optimize images, web fonts and JavaScript of your site. You probably saw Dan’s React Hooks presentation,
so did I. Here is the follow-up article that it explains
the React Hooks use case in details. Quite useful, take a look. The next point in my list is “Serving Millions
of Users in Real-Time with Node.js and Microservices”. As the author mentioned: “Node.js as a platform
has a few limitations on its own that we have to accept”. You can read this story at Rising Stack blog. One more article regarding this topic is “The
Easiest Way to Debug Node.js – with VS Code”. A developer makes the case that Microsoft’s
VS Code editor provides the best Node debugging experience right now. Have a look. [Music playing] “Prototyping a Smoother Map” by Antin Harasymiv‏
is an overview of how Google Maps (and most other map) systems work, and some explorations
on making zoom smoother. Nic Raboy posted a tutorial “Building Amazon
Alexa Skills With Node.js, Revisited”. In this tutorial, you can read how to create
a skill for Alexa-powered devices using Node and then test it with Mocha and Chai. “CSS Frameworks Or CSS Grid”. What should you use on your project? In this post, Rachel Andrew writes about a
choice between Flex and Grid and cases when Flex is not convenient. Pablo Stanley in his turn posted an article,
namely: “Designing for accessibility is not that hard”. The author provided seven easy-to-implement
guidelines to design a more accessible web. Among them are color contrast, usable focus
state, labels, etc. The last but not least point for today is
a GitHub’s report: “The State of the Octoverse: top programming languages of 2018”. According to it, JavaScript is still on tops
of the list for the language with the most contributors in public and private repositories. [Music playing] If you like this video give it “thumbs up”,
share it with your friends, subscribe to the channel and watch other episodes. Thanks for watching and stay curious.

Programming Loops vs Recursion – Computerphile

Programming Loops vs Recursion – Computerphile


[There’s] a lot of interesting stuff both from the
point of view of the content but also the historical context between, y’ know
“When were `for’ loops invented?”. Well that’s what Algol called them but prior
to that FORTRAN called them DO loops. And prior to that they existed in assembler.
So, first of all, what’s the history and what does it get you when you can do
loops, but when do you run out of steam, even with loops, and you have to use this
shock! horror! Pure Mathematicians thing – that computer scientists have to learn
about – recursion?! It was a real culture shock, it really was, in the roughly
1940s, 1950s to suddenly find out that what the theoreticians had been
drivelling on about for years – about recursive functions in mathematics – actually was of
massive, massive importance for computer science. Back in the ’40s and early
’50s it was all Assembler – or a slightly dressed-up thing called a macro
assembler, where you can have little routines full of, y’ know, packaged
assembler instructions which could be called up, as and when needed. So, that
sort of served people for quite some time. But probably one of the first
high-level languages to introduce loops was good old FORTRAN [shows textbook]. Even though
that was published in ’65 Fortran itself goes back, I think, for almost ten years before
that. It was invented by John Backus and a large team of people at IBM in the
1950s. Many of you will know it. It’s an excellent language for engineering and
scientific calculations. It is low level. I mean, when you look at the nature of a
FORTRAN loop it’s almost like doing it in assembler – but not quite. They didn’t
call them for loops – they called them DO loops. What I’m saying here is – you package all this
up – where you’re saying repeat the following sequence of
instructions, which I’ve done with my wavy lines here. Keep doing them until
you hit the statement with a numeric label on it of 180. The loop back from
the statement labelled 180, back up to here to increment the loop counter, which
you’re all familiar with in languages like C. It wasn’t done, as it would
be in C, by saying: “Here’s my block of stuff to be repeated it’s inside these
curly braces”. Here you can see it’s a lot more like assembler, a lot more low-level.
I mean there’s nothing magic about “180”; it could be “72”; it depended on your labelling
system. Implicitly here, in a simple thing like this, you’d start off [with the counter]
at one and every time I returned back here it would reset [the counter] to be 2, 3, 4 and so on up to
and including 10. It’s comforting for those who were coming from assembler
into a higher-level language to see something that was only slightly higher
level, in sophistication, than assembler was. How did loops become more “powerful”,
if you like? Well, again, even in assembler and even in
FORTRAN, there’s no reason why you couldn’t have a loop within a loop. So I
might have, outside of all this code, yet another layer of DO. What shall we say:
“DO 200 J=1, 20”. So, there might be some more statements between 180 and
200, who knows, but again, you see, a numeric label. And can see what’s
happening is that for every setting of J, which will start at 1 and go up to 20,
for every single one of those J settings the inner loop will be running through
the complete spectrum of settings of I going from 1 to 10. So you will have 200
locations [that] are being affected here. Basically going through the rows and
columns of a matrix. All sorts of calculations in physics, chemistry and
particularly engineering just rely on two-dimensional arrays full of numbers
– either integers or scientific numbers with a decimal point. and so on. Even hard-core assembly programmers had to admit if you were
doing heavy scientific programming it was nice to be a little bit more abstract
and to have this sort of facility available to you. Now you might say: “Well,
what came along to spoil the party then ?” or “How did people realize that this was
wonderful but not quite enough?” The compiler of course has got to be
tolerant and has got to be capable of compiling nested DO loops correctly but
how deep would it let you nest them? Well, I’m guessing, I would suspect that
the early FORTRAN compilers probably wouldn’t allow you to go more than about
10 deep, maximum. And I think you and I Sean have just been looking up what are the
current limits in C? I seem to remember the earliest `gcc’ was something like 32
But Ithink we looked up this … some C++ nowadays allows you to do nested loops
256 deep! And, of course, there are multi-dimensional problems that might
actually need that, because it it doesn’t take much knowledge of higher maths to
realize if you’ve got a loop within a loop the outer loop goes around n times; the
inner loop is going around n times, you are then coping with an n-squared
problem. If you put the third loop inside the other two you’re coping with a cubic,
three-dimensional, problem. So what we’re saying is all these multi-dimensional
polynomial-going-on-exponential problems, that come up quite naturally, you can
cope with them in nested for-loops so long as they don’t need to be more than
power-32 or power-256 or whatever it is. And you think, well, that should be enough for
anybody! There’s these multi-dimensional problems you can just do them by nesting
`for’ loops and surely [a depth of] 256 is enough for anybody? What kind of problem
wouldn’t it be enough for? Well, a lot of theoretical computer scientists of my
knowledge amused me greatly when – those of them that will own up to this – back in
the 60s. People started going to lectures from mathematicians, theoreticians, people concerned with “Godel Computability” and so on. And
of course, those sort of people, were very familiar indeed, at a mathematical level,
with Ackermann’s function. Now, as you know – you and I – we’ve done that one:
>>Sean: Was that “The most difficult … ?”
>>DFB: “The most difficult number to compute, question mark”
“We set this going four weeks ago
nearly now the first few are vanished …”
video insert>So what made it so difficult?
well you write down Ackermann’s function and it very clearly ends up with routines
calling themselves recursively in a very very complicated way. Now I think your
average sort of engineer would be happy to say that there’s this thing called `factorial’
which is 5 times 4 times 3 times 2 times 1, or whatever. And you could do that in a
loop as well as doing this fancy recursion thing, but a lot of
theoreticians admitted to me they saw a Ackermann’s function and said: “I could try that
out in FORTRAN !”. Now what they perhaps didn’t realize – but it became famous by 1960 – is: FORTRAN is wonderful, but original
FORTRAN did not do user-level recursion You could write a thing called ACK.
You could actually get it to call itself in FORTRAN. But you might have been
expecting that every time it called itself it would lay out a data area for
each recursive call they’re called “stack frames” – we know that now. You get lots of
stack frames, one on top of another and as you come back through the recursion
they’re deleted and thrown away and you climb back into your main program.
FORTRAN doesn’t do that. It sets aside one stack frame. You keep calling
yourself recursively it just tramples in its muddy gumboots over all your
data area and you end up with total garbage. It no more gives you values of the
Ackermann function than fly to the moon! And people said: “I then realized the
importance of having user-level recursion, in programming languages, to
cope with those really hard problems that fell outside nested for-loops”.
Algol was famous in that its routines could call themselves recursively and
could get the right answer and, for limited low-order values of Ackermann’s
function – very slow, very slow indeed – but it would come out with the right answer.
>>Sean: Is there any need to think of an example of a problem, or program, because Ackermann
feels to me like it’s the test-bed. You know, when you’re testing out a
motor-car you might take it on the track and see how fast it can go.
But in day-to-day life that car might only get half that speed. What’s the
real-world kind of equivalent? Is there such a thing?
>>DFB: Real world equivalent?
>>Sean: … of something that might need to use recursion … ?
>>DFB: … of that complexity? Not many things is the answer to that. I mean, yes, it’s
true that Ackermann, as you know, was David Hilbert’s research student. And the
challenge was on to find something that was so innately recursive that – remember
it was “generally recursive”, they called it – as opposed to “primitive recursive”. And
simple things like factorial and indeed indeed Fibonacci, are primitive recursive.
So I think you’re right that you really are just making the point that
eventually there are things that will kill you. I think the question in the
middle is: “Is there something out there – pieces of program you need to write –
where non-trivial recursion, in a sense, is needed but not quite to the
horrendous degree that Ackermann did. And the answer is: “Yes, compilers is where it hit
people”. Because although early FORTRAN did not provide user-level recursion, for
you and me, nevertheless John Backus and his team implemented it in the middle
1950s I think at IBM. And Backus wrote articles afterwards
basically saying: “We didn’t know enough about recursion and even though we
didn’t provide it for the users of our language, boy did we need it in the
compiler! And we ended up inventing it in all but name”
The syntactic structures of what is legal, in a language, even at the level
just of arithmetic statements can be quite recursive. Because you end up with
brackets within brackets within brackets all with a multiplier outside. And which
order do you do the brackets in? And, you know, how how many levels of bracket
nesting can you have. And if you don’t get things sorted out correctly then
you’ll get the wrong answer. But once again the problem could be that your users
would come up to you and present you with a problem just designed to test out
your compiler, and whether it was robust enough to be able to cope with a high
degree of nesting even just in arithmetic statements. So by 1960 in
Algol, yeah, the there were enough users, at the user level, who could see that a
modicum of recursion, perhaps more complicated than factorial but not quite
up to full Ackermann capabilities would be very nice indeed to have within your language.
Again referring back to that original video, I had a lot of really
interesting mail from various people who said to me: “OK, you said that this is an
innately recursive problem and it just had to have general recursion capabilities?
Well I …. ”
of trailer>

WEB2 CSS – 1. 수업 소개

WEB2 CSS – 1. 수업 소개


Let’s start the ‘WEB2 – CSS’ course This course relies on ‘WEB1 – HTML and the Internet’ If you don’t know what HTML is, I recommend you study WEB1 first before this course If you know quite well about HTML, you can skip WEB1 and continue with this course If you are ready, let’s talk about the purpose of this journey When the Web came into the world, there was only one technology, which is, “HTML” People could use HTML to create an electronic document In other words, they could express information using computers And the ability to make information available to anyone in the world through the Internet – that was a revolution Naturally, people got excited about the Web But human desires are infinite Initially when people first learned how to create documents using HTML, they were simply happy with the fact Soon after, various discontent started to bubble up Among many discontent, this course deals with the kind of discontent about ways to make a web page look nice and beautiful Now, we’re going to talk about why CSS had to be born, and decorate the web page we created in WEB1 only using HTML so that we can fulfill our desire about beauty one by one During the process, we will cover simple yet most important principles that control CSS Also we will study most frequently used features, based on statistics Once you have finished this course, you should have developed interest in beauty and also have energy to seek knowledge and experience needed to obtain beauty on your own Of course, this course doesn’t teach you about beauty itself because I’m not an artist nor a designer Alright, let’s set off for this new journey!