Subscribe. Follow. Stalk.

Wednesday, August 31, 2011

Blogger changed

Ever wondered why 'changed' -c  = 'hanged'? Well, the old blogger layout was killed and now comes this new somewhat not-so-wonderful njew layout.

It truly does feel like a layout that the Google team made not something that the Blogger team made. With the addition of a top bar, pretty soon are essentially looking at the standing "google look" integrated for blogger. It's clean simple and neat; nothing to it.

I'm currently not to fond of the new layout. It's confusing and moves all of the buttons I frequently use to other places so I cannot figure out what goes where. Other than that, it will probably be accepted more or less like one of those Facebook layout changes.

Even then, I prefer to have the old layout. It's familiar and it gets the job done. Although I don't like how they have been changing blogger so much as of late, the overall zeitgeist was quite nice.

I'm thinking of keeping the layout though. I get the feeling that I will be forced to make the switch in the future anyway. I would rather make the switch by choice now than be forced later.

Actually, it works quite nicely on my galaxy tab since it's all google stuff now.

Tuesday, August 30, 2011

I should give more insight on my personal life

It's not all boring. We'll see. We'll all see.

Now, back to listening to this really cool song. (ignore the face. gaga is just weird like that)

Privitizing profits. Socializing losses.

Why did I decide to be a computer programmer? I should be working in the banking industry!! (kidding)

Monday, August 29, 2011

Google Dissident

Today I will be slandering Google. Maybe not a good thing to do on a blog hosted on google servers but Oh Well.

Google, the maker of android and search engine. They pretty much dominate the cloud world. Need to find the weather? a good computer? Objective C documentation? yeah, you can find it all on google, well everything except for stuff that the US government censors cautiously removed to keep us all stupid err... safe.

The problem with google is that they just might know too much about you. Everything that you search on google will be recorded and these records can be accessed by the US government. Sometimes, I worry that the FBI is going to kick open my front door and carry me away never to be seen again just because I may have searched the words "How to build an atom bomb" and "plutonium for cheap" too many times on the internet. (Full disclaimer: I've never actually searched these keywords, but I've wanted to)

Everything about google is kind of like a roomate who goes through all of your stuff when you are not home. While there may not be anything to hide, it's the principle of respecting a person's privacy that truly matters. How can human society even survive without trust. At that rate, we should all be hiding in bomb shelters for the rest of our lives separate from one another. At least the divorce rate would go down.

Take a look at this video that microsoft made talking about the 'GMailman'. It's actually pretty funny and most of it is true.

Imagine if the US postal service decided to open up ever letter they send and skim for keywords, then they start sending ads to you about certain products. (Actually, that might be a way for the US postal service to start making money again, either that or everyone will go to gmail, where they do the exact same thing) It also deters terrorism, sort of. On the other hand, I bet that by 2020 all of our mail will come 'pre-opened' for free. What the people don't know is that they're scanning every letter to check for any details on when the next terrorism attack.

Anyway, back to the topic. Gmail really should not be like this. Pretty soon people will be moving back to Hotmail and that won't exactly good for google. This company truly does enjoy data mining. Remember if you don't have something good to say to a FBI agent's face, then you shouldn't type it into your gmail messages. (little known fact, the government records every email ever written. They even have a backdoor for gmail to get to it. Although google complains when other countries hack through that same back door)

I'm not going to slander anymore google services in this post. Instead I'm going to talk about google in politics. (This should be fun) Google is a strange fellow in politics. The US Justice department is not a big fan of them. They are under quite a bit of danger with their relatively low stock of patents and high number of phones running their OS.

They hire many lobbist firms so that they can sway their way on the web. Once, google and verison teamed up to create a bill for congress to vote on. What happened  to the first three words of the consitution "We the PEOPLE". These are not the people. How come they get to make decisions for the rest of us. At this rate, I think that I should be able to write up a law that congress should approve. How about: Every american taxpayer has to pay a required $4 dollar "Ben's charity fund". Why not? Isn't that what google is doing? I don't care if you say life is not fair. This is not fair and it should be fixed. I hate how google can get its way just because its google. We live in a different world now. The strongest are not going to be able to stomp on the weak anymore.

I don't see how Google can stay like this without reform. Being aggressive with business is one thing. Controlling the mindset of the entire US and beyond is more of a stepping stone to taking over the world. Besides, times have changed. There will be a new era of computers. Nothing lasts forever, even the sun is one day going to blow up and end life on earth for us all.

I'm not saying that everyone should flock to Bing right now. I will still be using google search (and blogger) for quite some time into the future.

Note to US government: complain about my article (you're violating my first amendment right) and I will start talking about the fallacies of democracy and this 'capitalism' thing we have.

Sunday, August 14, 2011

What the [removed] is R??

So, I said that I am going to make more posts and I told myself that these posts would have less complaining. Thus, I made this little tutorial...

What is R?

To start, R is an automatically generated class which allows you to access your resources (that's why it's called R, not L). Every file you put into your resources folder will have an int variable assigned to it which you can access when you want to use this resource.

For example:
Let's say that we have an image named "Ben.png" Now, in order to use this image we are going to have to write something like this:


Like I've said before, this returns an int. The drawable part of the syntax is because I put my image into one of the drawable folders (there are multiple folders due to how android handles varying pixel densities on different phones) Now, many of the functions in android will take this int and use it accordingly. I may or may not write more on this topic later on in a different blog post. We'll see.

Unfortunately, this isn't a very good way to get a large number of resources through something like a loop. We could record down the ints that are generated by going through the gen folder and looking at what the compiler has generated them to be. Instead of trying to get the ints through calling the variable, we get the ints through a string. This way you can number your images a1 a2 a3 a4 a5 a6 etc. (since the image names are made into variable names, there is no way you can add images to the res folder with names that start with numbers) To save and time and frustration in the future, let's write a function to do the work for us (again, I'm focusing on images in the drawable folders, adapt and adjust this as needed):

public static int GetIntFromString(Context context, String name) {
    return (context.getResources().getIdentifier(name, "drawable", context.getPackageName()));

There isn't much to explain with this function but if you don't understand it, don't worry. Place this function in one of your classes and then you are able to access your drawables through a string.

While you may say that this is too simple to be worth making into a function, it's worth it. This is a little known way of getting your android resource through a string. If you are developing for iOS and figuring out how to get images or other files, through strings, now you know.

That's it for this time. Now you know the basics of R and what it does.

Thursday, August 11, 2011

I'm coming back to post on this blog, seriously

I know that I have said that I was going to post on this blog quite a few times, but this time is real. Over the past few weeks I have been moving away from web development to app development. While for many this is a big leap I find this not be be since I've done a lot of programming before I decided on settling down with web development. I personally consider myself a black belt PHP programmer but I want a change. I mean sure: I can answer any PHP question you have at the top of your head but I'd rather be doing something a bit more sophisticated for a change.

Imagine you ate ramen 3 meals a day, everyday (Disclaimer: I have not thought of doing this..) After a while of boring noodles, chemical flavoring, MSG, and a greater cancer risk it gets kind of boring. Ramen is pretty simple but it just gets so boring so quickly.

So what am I doing now? Well I'm focusing on some Android and iOS development (Yes, there is a reason I put them in that order) I like Java; I find it to be a better language than Object-C. Garbage collection is a very big deal to me. While Object-C is going to have automatic reference counting, there are still things to think about when messing with memory management. Personally, I'd rather have some fun programming a language like Fortran where you don't get any dynamic memory at all. While it would be hard to think about when and where and how much memory you are going to need for the entire runtime, it also promises zero memory leaks and far better performance than something like c, where I've typed the function malloc more times than I can count.

Alright, that's enough for now