Angular-Fullstack Generator: How to create a persistent file upload using the boilerplate? - angularjs

Thank you for reading this post.
As a newcomer to the programming community, I have what I believe to be a fairly easy question.
How do you implement a file upload (particularly images) using the MEAN stack (yeoman angular-fullstack generator in particular)? An explanation using the yeoman angular-fullstack boilerplate would be appreciated.
In particular, could you please make a step-by-step explanation. This is not recorded anywhere on the internet, so your help will be recognized and appreciated! :-)
While there are numerous explanations out there, those explanations always answer a particular user's question (as do many other questions/answers) and are not applicable to general use cases. Those explanations typically require one to be able to parse through numerous lines of irrelevant code, in order to absorb the information that's relevant. As such, a "noob" is not able to utilize the part of the code that is applicable to him/her. That is why I'm asking for an explanation using the boilerplate of a generator, so that myself and others may use this information -- now and in the future.
Using search engines and research, I have come across the predominate answer that ng-file-upload and multer can accomplish this task. However, there is no rudimentary explanation of how this used implemented within a MEAN stack together (particularly, angular-fullstack -- the predominate MEAN stack implementation at this time).
Today, any general non-static website requires a file-upload implementation, and it seems extremely odd that there is very little documentation on this issue. I've read numerous O'Reilly books on MongoDB, but this issue is not addressed. Images and Videos are essential to commercial-grade websites, and these topics should be documented in a way that is digestible for newcomers to MEAN programming.
Thank you for your time, and I appreciate any and all helpful answers and comments.

you can use my code which is MEAN project for image upload
https://github.com/RohitShedage/image-upload

Related

How to understand the differences of Web Frameworks, Databases, and Libraries?

Where I stand: I am a junior in college. I have a solid background in Java and C++. I've been coding websites in JavaScript, HTML, CSS, and PHP (using MySql databases) since middle school. I have only just uncovered the magical box filled with these mysterious "frameworks."
My Predicament: After reading in my spare time wikis, blogs, and StackOverflow questions week after week for the past few months, I feel that I am no closer to understanding the items in this ominous list and how they relate to one another.
Yeoman, Grunt, Linemanjs, Bower
Nodejs, Go, PHP
Mongodb, Couchdb, MySql
Angularjs, Ember, Backbone
Terms like: boilerplate, scaffolding, frameworks, etc...
What I am asking: I understand that explaining any one of the above would be a question too big for a single Stack Overflow question, but that's not what I'm looking for. What I am looking for is a guide that explains in-depth what each of these groups are used for and if/how they can be combined (ex: using Angularjs with Nodejs). I am happy with a link if an article already exists, but I have yet to find an article that covers all of the above.
El Fin: I love learning new languages (especially for the web), but right now I feel like I'm blinded, running around in circles like a chicken with its head cut off. A shove in the right direction would be great :)
I'll put this in as an answer to help clarify why this is too broad.
I think that the GREAT BIG point you are missing is that there are specific reasons someone chooses a particular framework or server environment when they start a project.
This is all dependent of a boatload of things that like budget, knowledge, availability, expected scope of the project, etc... It also may come down to, "I'm starting this new project, what is available in this work environment for me to use?"
Then you don't really get to choose. You get what you get.
So what's the best package of technologies to use? That SO depends on what you're doing.
Example: If you are building a simple site for a local store that just needs a few pages, and you want to keep your costs low. A simple LAMP solution would work fine. But if you want to design the next Facebook, even though the core of the system could be build using all LAMP (and it in fact IS), you will need MUCH more powerful servers, and MUCH better and more efficient coding. Not to mention a boatload of server space for both the site AND the database.
In many cases, when you see people pooling together what might be considered obscure technologies, all they really break down to are collections of libraries. It's like choosing JQuery over some other JS library that essentially does the same thing. One may be better than the other. But you go with what you are comfortable with.
So, when you are asking about how, why, and in which way, do people combine technologies together, there is no way to answer that at all. Other than to say, it's specific to their needs. And that's about it.
Reading articles that compare all these different things together will only give you an idea of what they are capable of, and what their limitations are. In the end, it's always a matter of opinion what is better. Otherwise we would all be coding with the same thing.
For my part, I prefer PHP over ASP. I prefer working straight out of a text editor than using an IDE or any MVC framework. I use jQuery where it's needed, but don't over use it.
But that's just me.
And I'm sure this still didn't answer your question.

Blog on Google App Engine for Java

I am considering to add a Blog on my GAE/J application and wondered what is the best way to do so.
Are there any implementations I can use?
Should I write something on my own?
I read about Microblog but it is written in python, I am not sure it will co-exists with my Java app.
Appreciate your thoughts.
While I don't know any implementations that you can use, this question is very broad and there are a lot of different things that you could do, and writing your own is one of them.
Just to begin with you could use the Blogger API to read the posts and present them in your app. By doing that you're able to add/modify/delete posts using the Blogger's UI and in your own app you will only present the posts. The only problem with this solution is regarding the comments, where you could implement your own (just to start somewhere) or include maybe the Facebook's Comments Box.
I did exactly that for the kiebdoj.com/blog/ and it saved me a lot of time for not implementing my own WYSIWYG editor or a post manager. That was written in Python, so I can't provide any examples, but in either case it wasn't written to work on it's own.

gae-boilerplate documentation

In my search for a good social login package for App Engine, I am giving gae-boilerplate a try. But I find there is no documentation except the readme file, which I think it is not enough at all.
I have many questions, among them:
Should the boilerplate be used as a library or download and modify as needed?
How should the boilerplate be updated?
What does each model do?
Where should my templates go?
Should I have a different routes file?
Should I derive my Handlers from BaseHandler?
In general, what things should I implement in my pages? For example, I found out that I have to include a csrf_token in all POST requests. It would have been nice to know this in advance, and the many other things that I'm having to find out along the way, and which I implement without being sure if I'm supposed to be doing that.
And some more...
My biggest problem is that Social login is not working, and I feel this boilerplate is a big monster with which I don't know where to start. To make things worse, it is hard to debug social auth from any machine that is not the production one. Thats why I'm desperately looking for some docs.
I have not found anything in SO, and I guess there must be more people in my situation. So, any pointers to documentation that could help to understand gae-boilerplate a little bit better would be very appreciated.
EDIT: I switched to gae-boilerplate in a site that I had previously working. Maybe most of my problems come from the way that I have tried to integrate gae-boilerplate and my existing site. As a result I have tried to treat gae-boilerplate as a library, and keep my own templates, handlers, static files and such.
Thank you guys!
EDIT 2: After trying other options, I have to say that I am very happy with gae-simpleauth. It works really well, and Alex's support is superb.
I will try to answer most of your questions below:
Should the boilerplate be used as a library or download and modify as needed?
You can modify it as needed based on your specific requirements.
How should the boilerplate be updated?
What do you mean?
What does each model do?
User and SocialUser are pretty self explanatory. LogVisit and LogEmail are used for auditing purposes.
Where should my templates go?
In the templates directory
Should I have a different routes file?
No, you can use the existing file for all your routes.
Should I derive my Handlers from BaseHandler?
It't not mandatory but I would recommend to do so. BaseHandler is very handy and provides a lot of good stuff.
In general, what things should I implement in my pages?
What exactly do you mean?
In general, you can use gae-boilerplate as a reference on top of which you will built your own project. Study the code step by step, try to figure out what is the purpose of each file and library used and how they work together. This way you will gain good knowledge of a lot of things like jinja templating, oauth2, etc.
Hope this helps.

Guide to scala.io and simple IO for Scala 2.9?

Does anybody have a guide to this, containing code samples, tips and an outline of the different IO approaches?
I have checked out the the API documentation. There are also some basic examples with scala.io.Source in Programming in Scala.
There are some pretty basic questions already answered here on SO.
I'm looking for something more in depth.
Alternatively, any tips on exactly which bits of the API documentation to focus on and which Java libraries? I'm familiar with System.IO in .NET land, but not so much Java.
Scala's standard library is currently pretty limited for I/O, so you'll probably want to dig into Java's libraries. Oracle's Basic I/O tutorial, covering java.nio, looks like a reasonable starting point.
A while ago there was some discussion about a community driven redesign of Scala I/O called scala-io, but I'm not sure the official status. The mailing list hasn't seen much recent activity, but the code in Github is being actively developed (incubator mailing list and Github project). In his answer, hishadow gave a link to scala-io documentation.
My tip is to look also at tools Path,File and Directory.
They have little sugar (that everyone has in their little utils library) like:
val writer = File("/my/file").bufferedWriter
File.closeQuietly(writer)
Directory("myDir").walk
Then have a look at Process like here
There is an in-development IO library with documentation available at http://jesseeichar.github.com/scala-io/. Included are examples for different usages.
The source repository is at https://github.com/jesseeichar/scala-io.
I recommend looking at java.nio.
Due to technical limitations of the underlying Java platform implementing IO in Scala wasn't a good idea.
This has changed with Java 7, which provides good Java APIs for everything related to file management.
There are some thoughts about an IO library for Scala, but no decision about that yet.
The author of scala-IO, Jesse Eichar, has recently began a series of articles about using Scala-IO on his blog: here's the 'getting started' entry.

Extracting semantic data from webpages

I'm interested in extracting semantic data (simple template stuff) from webpages and other sources that aren't currently semanticly aware. I've written crawlers and manual parser before in a bunch of different languages, but there always seems to be a lot of boilerplate and page specific code, and was wondering if you guys knew of any platforms or frameworks that simplified the process (open source only please).
I'll be writing one if I can't find one, so links to similar systems or framework suggestions would also be appreciated.
The field is known as "automatic wrapper extraction" and is an active area of research, but I haven't seen a good open source toolkit. A company called lixto makes a commercial tool that may be of interest to you. I'd love to see an open source project that tackles this problem.

Resources