8/12/18
It has been over a month and I haven't done much to this website. I still don't know why the blog filter doesn't work and I really need to figure it out aH.
Looking at my code, all the links to the blog actually don't direct to the blog. They just run a javacript function which directs to the blog and then changes which blog posts to show. Maybe those links should direct to the blog, Maybe I should use a global variable (bad coding strategy but I don't care) which keeps the blog posts to show in (either WD, L4C, OT or All) so it'll be like an Elm union type but in strings cuz javascript doesn't support Union types rip.
So I changed the code so that clicking on a blog subsection - while you're in the blog - will filter through the posts. Not when you're outside of the blog page, though, probably because when the page redirects then the functions kinda die. Would the "global" varible even work, then?
Turns out it didn't work, but there's another solution that comes with
window.sessionStorage
. I can store a variable past a page reload! And it works now though it's
really sketchy,
cuz the page would flash a lot when you click directly to a blog tag from outside of the blog page.
Whatever.
Wow it's been a journey. I hope I can look back at this later and laugh - hopefully when I actually have a blog (made in Elm possibly haha). In any case I will not stop my pursuit of learning, but not forget where I have started off at - this very website.
7/11/18
Wow, it has been 3 years since I've worked on this, and I would like to think that I have matured a lot. Of course, I dont code much in HTML, JS and CSS anymore. Right now, I am learning ELM and following a book called Structure and Interpretation of Computer Programs. Wow my coding practises back then sure were...rachet. It really makes me laugh how much I valued stuffing everything in one file (lamo my javascript file called all.js) and how I put all my blog posts in one HTML file (like this one). Like holy cow it lags my editor when I scroll down lmao.
Ya idk man i think I was feeling nostalgic. I looked through my old websites because I wanted to see what I was able to do back then (at the end of Grade 7) and laugh at how bad it was. Surprisingly, it wasn't that bad, even though the aesthetics are very questionable. Of course, I had to change a lot of things, like change all the dependancies to cdnjs and make sure the anchor tags didn't point to links like file:///home/joshua/coding-everything/Blog.html. Ya the website didn't work at all when I first downloaded it from BitBucket lmao.
Sadly, this website isn't complete yet (to be put back on the shelf to be looked at later haha). The subcategories that the blog has doesn't work (idk why) and my code that deals with it in javascript is horrendous. And I have another blog site to revamp. Oh well. It'll be pretty fun, though.
7/8/15
Since Dad told me that coding everything from scratch is good, it is tiring and is not to the potential. With bootstrap, real pro coders actually make the code, so annoying things can be dealt with easier.
7/4/15
In Javascript, when there are situations when you need to perform mathematical
operations on a number you stored
as a string,
parseInt()
and
parseFloat()
come in handy.
This built-in function accepts a string and returns an integer (not a decimal). If the paremeter is a decimal, parseInt() will round the decimal down to the nearest whole number. Remember to put a string that only contains numbers.
var numString = "9001";
parseInt(numString);
//equal to 9001 (without quotes)
var decimal = "2.999999999999";
parseInt(decimal)//returns 2
var notNumString = "qwerty";
parseInt(notNumString);//will equal to NaN
This function is similar to parseInt() except it does not round the number. It
will get rid of excess zero's, but
other than that it returns a floating number.
Parsefloat will only return NaN if the first character at the least is not a number. if you
type
parseFloat("80 year old grandpa")
, parseFloat will return
80
.
var numString = "20000.00000000000000000";
parseFloat(numString)//returns 20000
var decimal = "9.146293";
parseFloat(decimal)//returns 9.146293
var halfNumString = "I an 200000000 years old";
parseFloat(halfNumString)//will return NaN
parseFloat("1*4")
onto the console will result in just
1
.
7/4/15
When making Identifier names, you will have to remember these four laws:
An Identifier must be at least one character in length.
The first character in an identifier must be a letter, an underscore, or a dollar sign.
Each character after the first letter can be a letter, an underscore, a dollar sign, or a number.
Spaces and special characters other than the underscore and the dollar sign are not allowed in any part of the identifier.
7/4/15
Creating variables are pretty handy and useful to make, and well known. They can be changed by the console, but can is there a way to make a variable with a permanent value?
Constants are basically variables that cannot be modified once the script runs. After it is declared, the only way to change it is to edit the text editor itself. Constants use a "const" keyword and it is often named using all capital letters to make it stand out.
//Be careful when declaring constants-it is fairly new to Javascript and not all browsers support it
const ISJOSHUAAWESOME = true;
//can't change it now! :)
P.S., try typing
ISJOSHUAAWESOME
onto the console. If your browser supports the
const
keyword, you will know the truth!
7/3/15
Today Dad is wanting to start to build apps (for phones) using something called ionic.io. This is a front-end SDK (I have no idea what that means) which supposedly makes apps very easy to make. It uses fundemental HTML, CSS, and JS to make their mobile appliations. Dad said I should learn a bit before I can herlp him, so...cool. Lets start.
7/3/15
I have to disagree with my earlier blog post, saying to make insert a code block into the blog, you can follow this code:
<!--html-->
<pre>
<code>
<!--some code-->
</code>
</pre>
Guess what will happen if you actually do that? The turnout will look like this:
<!--html-->
<pre>
<code>
<!--some code-->
</code>
</pre>
See the extra space? <pre> tags displays the children elements with the exact spacing, so to remove all the space around and inside the <pre> tags, you will need to delete all extra space, so your code may look more like this:
<pre><code><!--some code-->
<!--maybe some more code-->
</code></pre>
7/3/15
It is just over one month since my blog post saying I was very lazy; not
putting anything on the canvas section
of my blog. Well, I finally finished a bit if it! I think it is all the canvas in the Javascript for
kids book, and I
will probably add in the last big project, a snake game, onto the website.
By the way, the canvas section takes up a lot of code. For the 14 snippets so far, my js
code boosted from 188
lines to 391 lines. Wow.
7/2/15
Before I would never have thought of successfully making a paragraph indent before my blog post. Now, I still don't-but there's a space before the post, which mimics an indent. Since a paragraph (¶) entity is too ugly, an " " works out fine. It stands for "non-breaking space."
7/2/15
To write certain characters in text form, character Entities will be needed.
For example, lets say you need to
make a <p> tag in the code section. If you type it in with the real tags, HTML will think you
actually mean to
write a paragraph, and it will not turn out as expected in the webpage.
< (remember the semicolin!) is the "<" sign, and ">" is the ">" sign, so
to write a "p" tag
as text, you will need to write <p>. So now writing an html skeleton may look like this:
<html>
<head<
</head<
<body<
</body<
</html>
By the way, any character Entities in the Sublime text I'm using is purple. I think highlight.js just did not add it in yet.
7/2/15
This is so cool! Using something called highlight.js, it automatically highlights the text and makes it perfect when I just do:
<!--html-->
<pre>
<code>
<!--some code-->
</code>
</pre>
Writing < and > in tags will make HTML think they are actual tags, you
will need to write their Entity name
or Entity number. A list of them can be found
here.
P.S; the style of code is called monokai_sublime, the same style on sublime text, the text
editor I use. Now you
know what it looks like! (well, a bit).
7/2/15
I finished the Date decoder! So basically it was a javascript script that changed the date format from numerical to name. That took a long time, and it took me a long time to figure out one small bug in the script.
06/29/15
I am so proud that I finished the blog filter. Now one can separately see blog posts made for the purpose of Website developments, my learning for coding, and other things worth mentioning. I also finished making the triangles as well as the dropdown for the blog a while back, so that is also an achievement for me. I want to make a search bar, as well as tags, so my blog filter may be ruined. oh well. Along with this. I am also planning to add things onto the home page of my website, as well as things on the the canvas I never added since the beginning.
6/12/15
A simple interactive Rock made with Javascript embedded into HTML is what I finished today. I also added a dividing line b/w the dropdown lists in the Snippets section. Cool!! :)
6/12/15
I started the Head-first in Javascript book, and it started with a project; the iRock. Now I am trying to make another dropdown menu for the "Head first in Javascript" book for all the projects, but I need time.
6/11/15
To make the blog hopefully more professional, I am going to change the design. Here is the old blog.
-/-/-
blah blah blah blah blah
So I just changed the background colour and added the box shadow. Does it look
good? I am having second thoughts,
but maybe later.
Btw I am also starting the head-first in JavaScript book! Yay!
6/6/15
So, I am too lazy to put the canvas on, maybe later, so I'm going to start to read the head first in HTML, JS, and CSS (two separate books). I really want to increase my knowledge, so that I can help dad on some coding things. And Dad also gave me a linux course, since I am using Linux on the once-windows computer.
6/2/15
Uh, so, it's been more than a week, but I forgot to make anything in the Canvas section. Oops. That's the problem of being me; I am very lazy. Lol.
5/23/15
So, there's a load of things I learned from the Javascript for kids that is worth keeping, and I put in my windows 8 tablet. Guess what? IT BROKE DOWN! THE HARDWARE CRASHED!!! I DIDN'T SAVE IT INTO BITBUCKET OR GITHUB!!! IT'S LOST!!!111!!!1111111 Boo-hoo. Do I really have to restart? I'll try to stuff the important stuff in the snippet section, and I'll remember to save things in Bitbucket next time.
5/19/15
Finished The Blog! Yay! Maybe I'll add the time I finished onto the blog by Javascript, But I'll need a database to store the info. Oh well. Maybe later.