Monday, February 09, 2015

Getting back into some coding; LOOPS

Started small today to jump back into programming. I started off with some simple loops lik

(Oh also i'm going back C#)

using System

class Forever
{
        public static void Main ()
       {
             do
             Console.WriteLine ("Heya");
             while ( true );
        }
}

Is an infinite loop that will keep going while the word Heya is true. While it's continously true the loop will keep producing the line of text Heya infinitely


Then there is the while loop

using System

class While
{
              public static void Main ()
              {
                      int i;
                      i = 1;
                      while ( i < 11)
                       {
Console.WriteLine("Yo");
i = i + 1;
                       }
              }
}


In the while loop you set up the variables and give the variable or the control variable (i) a starting point. Then as the while loop progresses it adds +1 to the counter. 1 becomes 2 and increments with each passing.

This always got me though. The for loop always seemed to confuse me as it was so nested and i really couldn't make heads or tails of it but i finally got it down...

using System

class forLoop
{
public static void Main()
{
int i;
for (i = 1; i < 11; i = i +1)
{
Console.WriteLine("Sup");
}
}
}


that 3 part right there was what confused me. But it's basically the setup, when to end, how to get to the ending.


Also i really need to think of the reverse of a problem instead of gunning towards it. I have noticed a lot of my programs i did in high school involved how to NOT accept the bad values and accept the ones we want to be validated.

i won't be loading this into github as it's really not worth uploading some loops. I'll wait for a bigger program for it.

Tuesday, May 20, 2014

Murrrgghhh I fell off!!!

Well i fell off again on programming...but i've been picking that back up with LSDJ at least. I just lost focus on java programming man...it didn't have that same impact as C# was having for me despite both being essentially the same thing...

I've been diving more into tables, wave forms, grooves, and transposing and they make the world of difference and it's such a verbose and small program man...i love it.

Like in a table i transpose it like so

TSP CMD
00    --
05    --
07    --
    H --

Gives me this very cool melodic C Chord.

Then i toyed around with envelopes where i would do

E 88
    --
     |
     |
    --
E 18

(Sorry i'm quick hand writing this at work. Basically it's every other step is an Envelope decreasing by 10. So 88, --, 78, --, 68, etc...)

And it gives me a nice fade out effect i've been looking for. I feel i've used it before but it feels good to know what the heck i'm doing now.


Another neat treak i've noticed an0va use was the W |¯|_ adjustments. I actually did this before! And thought it was actually a useless tactict and apparently it is not! Imagine how i felt when i found out an0va used this and i'm like o_o. He used it in such an amazing way however XD.

Let's see...what else....OH IMPORTANTLY! Fucking...Groove.

Groove on the LSDJ is probably the most genius thing on that piece of software. it gives you that element of full control of how many ticks are played in your phrase.

Phrases go by the usual 1/4 notes, 1/8 notes, 1/16 notes and then even smaller. The ticks. Each note gets 6 ticks. Think of it this way...

When you strum a guitar you can either do it note by note 1/4 note or as fast as you can. 1/16.

So i kinda was mashing things together and i got some VERY surprising and smile worthy results out of it. I love this damned program...it's versatile yet so small and limiting. It's great =3. Okay back to work for me.

Tuesday, March 25, 2014

Back into Java!

Soooo it has been quite awhile since i last updated this. I hit a bit of a rough road and well i had actually was supposed to be practicing java instead of C# like i had originally been doing.

I'm not sure why but i was definitely having a lot more fun with C# than i was with Java. Java despite doing pretty well in it in the beginning...it just seems so...not fully functional i guess? It's the curly braces that get me! i love visual studios way of doing it where as soon as you type { it auto-completes it with } where as in eclipse when you type the { it stays...nothing happens until you press enter! C'mon give an option with that!!!

Anyways! I did two programs for java!!! The first one is the classic 99 bottles song and there was an intentionally left out a part to the program to make it fully functional. So a while statement around the actual beerNum = beerNum - 1; before it would do 99 minus 1 and stop at 98.

So i added while (beerNum > 0) which concluded the program and i felt great for actually solving that. Thanks Head First ;).

https://github.com/s0nlxaftrsh0ck/Bottles

Secondly is a random buzzword generator that uses an array of words that i've added and uses a random number generator by grabbing the length of the array. Since it grabs the length of the array it has the numbers and it can dump it into random number generator pool. Thanks  to .length

https://github.com/s0nlxaftrsh0ck/Phrases

So far...i'm getting back into the groove of programming ^_^

-Ron

Wednesday, March 12, 2014

Oops..kinda forgot i was supposed to be practicing in java...

Wellll i kinda forgot i was going to be refining my skills and helping my friend code for a potential game he may be doing? I'm going to be freelancing it of course So at the moment this is going to be my final C# project for now. Honestly i'm glad i stopped early enough to not be in toooo deep with C#. So after this we're going back into java!!!

GlazerCalcUltra

https://github.com/s0nlxaftrsh0ck/GlazerCalcUltra

This is a heavily modified version of the original GlazerCalc in that it adds const which is a static value that is can never be changed. It's honestly a very handy tool to use for when you add final type values throughout your program. If an enemy is only 100pts and you have to code that 100pts 300 times...you don't wanna go and change 300 lines of code.

No, so all you have to do is make the const and change the const value and everything else in your coding that correlates to that const value is changed.

This also includes a do -- while loop which does an action while it is still valid. One thing i have noticed in programming is to code in reverse. It's that i have to code for what i DON'T want not what i want it to do.

So in this case instead of searching for values within my range i look for values OUTSIDE of my range which is easier to catch and a little bit neater from the looks of it. But that is something i really should take into consideration however. Sometimes you gotta see from the reverse...or make it an impenetrable fortress perhaps? But yeah. So for now...that is my last C# project.

At least with C# this taught me some fundamentals that i was a little hazy on before. Like operands and expressions, variables. And the likes. But yeah. Good times!

-Ron

Tuesday, March 11, 2014

Finally got in some coding geez...and its tuesday lol

Finally got to do some coding and reading today. Added two different programs this time

https://github.com/s0nlxaftrsh0ck/BottlePrice

basically the same as Glazing calc but calculating bottle amounts. The 99 is to offset the division so as to not give me a 0 as it divides anything less than 100 wil be 0....a bit of a better explanation...

 "If you just divide the number of tablets by 100 an integer division will give you the wrong answer (for any number of tablets less than 100 your program will tell you that 0 bottles are needed). One way to solve this is to add 99 to the number of tablets before you perform the division, forcing the number of bottles required to "round up" any number of tablets greater than 0."

and

https://github.com/s0nlxaftrsh0ck/FloatTest

This is a  program for testing out casting where you tell the program you are sure you are changing it from a larger variable to a smaller one. Something like changing an int into a float.

A float is bigger than an int. If it was int > float there wouldn't be a problem.

But since its float we need to compact it i guess you could say into the int.


Thats...what i gathered so far anyways...

Next time will be if else statements. This refresher course is pretty damned helpful and im glad im taking it back from step one to solidify my understandings of what the hell i was doing in programming. That tis be it for now

Monday, March 10, 2014

Craaaaaaaaap!

Saturday no program studying as well as Sunday...i tried to read a bit on both days. Got a little far on Sunday morning...

As for saturday i put my A+ certification to use and actually opened and closed up my laptop successfully without fucking anything up. Ok, that's a lie, i messed up one of the screws so that doesn't go in correctly. So i did something at least a little productive during the weekend. My reading is slacking again. I need to pick up the pace again...

At least now i know my iFixit kit isn't a total useless purchase. I felt like a loser completely messing up my wifes Note 3 during the screen replacement....i think from now on i'm just gonna replace the digitizer and replace that.

I still feel incompetent however that someone else whose not so tech savvy was able to replace an iPhone screen and i couldn't for the Note 3. I'm guessing it's two completely different methods of screen removals but man...*sighs* still doesn't make me feel any better. Always time to practice with messed up ebay ones right?

-Ron

Saturday, March 08, 2014

Trying to read while sleepy does not work at all...

No coding and very little bit of reading last night. But, i'm still insanely proud of my github and accomplishment ;p. Gonna try to get some reading and coding in today however.