Showing posts with label web development. Show all posts
Showing posts with label web development. Show all posts

Sunday, April 30, 2017

Negatives of React and Angular

Both React JS and Angular JS are great frameworks; however, they both focus on the one page app, which works with phone specific devices but it doesn't work as well with web apps which want to have multiple pages. Additional packages needed to be downloaded to make the frameworks work with multiple pages.

In React JS, the lingo used to make multiple pages is called routing. The two main ones recommended in the Meteor guide are kadira: flow-reactor and react-router. The first router is a Meteor specific one; the second one is a react specific one. Other ones are IronRouter and BackboneJS. But, BackboneJS is considered by some to be outdated now.

Routing is where you dictate where React routes traffic to your app. It is mostly done by mapping files with words used to reference those files. For example if you want to make error pages such as 500 or 404 then you can map those files/pages to the word, 'error' then specify where it goes depending on which kind of error it is.

Hopefully this article helps you properly prepare for the limitations when making web apps in React or Angular, especially in React since that was mentioned the most.

Saturday, April 8, 2017

MongoDB

MongoDB is a NoSQL database. It is pretty easy to use on the command line interface.

So far my favorite aspect of NoSQL is making collections (tables in SQL) and entries on the fly. It doesn't require a schema, although a schema still helps organize and validate Mongo databases. If you don't have a collection then it makes the collection for you to put in your new data entry. SQL is a lot harder to modify without massively disrupting existing tables and code.

I recommend you try MongoDB the next time you need a database.

Sunday, September 6, 2015

Saving Order of Pages on Tumblr

On tumblr, users can make pages and rearrange them by moving them around on the Edit Theme sidebar. However, after rearranging the pages to an order you like, tumblr's save button doesn't popup. So, you can trick it into popping up by going in and editing in an inconsequential line break into one of your pages. Then, the page order you had made, will also be saved.

Happy tumbling!

Thursday, May 15, 2014

SQL Column Name Differences

In MySQL, column names are escaped using the back tick like `miles/hour` but double quotes can be used, "miles/hour" when ANSI mode is enabled. This is important because regular SQL does not support back ticks and PostgresSQL only supports double quotes.


So, when setting up your database to be ported into any language, make sure to enable ANSI mode in MySQL and use double quotes around any column names with special characters.

Wednesday, April 30, 2014

PHP time and SQL time

In SQL there is the option to use datetime as a format. However if you insert data in, it is hard to format it correctly from PHP on the first try. So it is better to use TIMESTAMP for your SQL column and use now() to insert the correct time.

mysql_query("
            INSERT INTO users (first, last, timenow)
            VALUES ('$first', '$last', now())");

Thursday, April 24, 2014

render PHP files

PHP files will not be loaded properly and will show echo and the <? ?> symbols if they do not run through an Apache server beforehand. If you are using something like Xampp which is all in one then you'll need to put your php files in the htdocs folder. Then, they can be run and processed when accessed using this url: localhost/filename.php
You might also need to add a folder name if you put the file in a folder within htdocs.

Wednesday, April 23, 2014

Installing Django on Windows 8

First, install python, preferably the newest working version for Django.
make sure the option to install python to PATH is selected. On default  it is not selected.

Next, add or make sure python is in your PATH.
Go to Computer.
Right click and select Properties.
Next, go to environment variables and look for the variable which says PATH.
Edit it by adding C:\Python34 and C:\Python34\Scripts
Next, open PowerShell.
Type python in the shell. It will show you the python version that is installed.
 
Now install get-pip.py.
Download it then open PowerShell again.
Then change cd Downloads because you're likely in your home folder and you downloaded get-pip.py into your downloads folder.
Once there, enter the command python get-pip.py. This might take awhile.  It will also install setuptools for you if your computer does not have it yet.
 
Then install Django via pip.
In PowerShell, enter pip install django.
Then pip should install Django for you.

To start your first Django project in the powershell prompt, type:
django-admin startproject projectName


If you have python associated with another version of python then django-admin might not work for you.
You'll have to change the file associations within regedit, root, python, shell, open, command

Potentially install virtualenv to also deal with different versions
 
Alternate instructions from the Django site are also here: https://docs.djangoproject.com/en/dev/howto/windows/
 

Tuesday, April 15, 2014

First Bootstrap Website

Storyboarding was getting a bit difficult. Outlines of a mobile app were already made, with some illustrations of the most important screens. There was even a use case of the crucial part of the app.

But I still felt like I didn't know what was going on. The client kept changing minor requirements on us. One day the client says they're willing to pay monthly hosting fees. The next day the client buys a one time setup fee without even informing the coders.

So out of frustration and no access to reliable ad-free webhosting for scripting languages like python and PHP, I finally downloaded Bootstrap. The website's directions were simple and easy to follow.
All I did was download the file and unzip in my desired website folder. Bootstrap also gave starter templates.

Unfortunately one of the templates I copied did not have the jQuery and bootstrap links on the bottom so my navigation bar did not work, especially on mobile, nor the dropdown feature in any version of the site. Googling and looking at the differences between my copied templates I realized that I might need the links to Bootstrap (in the right folder) and jQuery. So, I added them in and the navigation bar worked everywhere.

I made a single step form and converted it to a multi-step form when it was completely finished visually. Then I added and linked other more simple splash pages and whatnot.

The website consisted of 10 pages and 5 hrs and 30 mins of my time plus an hour break in between. I took the break because I felt like a lot of the work was pointless but then I worked on it again after the break because I really needed to finish the most important page on the website.

Now it looks like a real website with proper formatting and linking. However it only uses HTML, CSS, and JS (from jQuery and Bootstrap). Therefore the form doesn't save any of the inputs to a database or use any scripting languages. But it serves as a much better visual storyboard to show the clients than the use case and storyboards we drew up. Those make perfect sense to us but are hard for clients to truly criticize.

Another factor in making this website was to not use a localhost but some format to show the clients that the pages/screens were something they could see and use themselves from any computer. I do not have webhosts where I can upload PHP or python so I used Dropbox to host the whole website. All in all, the website only requires a little less than 1 MB of space.

Also, I finally had a chance to use Bootstrap.

P.S. It is not linked here because of the Dropbox factor. Once I have another more public place to put it, I hope to link to the website in this post.

Saturday, January 18, 2014

Making a basic website on a school computer science account

Assuming you already have an account with your school's computer science department, running linux,
1. Open Terminal

2. In terminal execute the following commands:
chmod 711 ~
mkdir public_html
chmod 711 public_html
cd public_html
 
3. Now, you are in you public_html folder, while in there make a new index.html file:
option 1:
vi index.html
press the i key
type "Hello World"
press esc then :wq
proceed onto step 4
option 2:
go to your regular file system and create a index.html doc with your favorite basic editor then save it into public_html
 
option 3:
cat > index.html
type "Hello World"
press ctrl+D
proceed onto step 4
 
4. In terminal
chmod 744 index.html
Now you have your first empty webpage!

5. For more webpages, repeat steps 3 and 4 but with a name other than index