DEFEND THE INTERNET

DEFEND THE INTERNET
Congress wants to censor the web.

In January 2012, Congress is set to debate the Stop Internet Piracy Act (SOPA) and the Protect-IP Act (PIPA), bills designed to let the US government block websites and information from the public.

Not only does this bill let the government restrict free speech, but also does not effectively address the issue of online piracy, the stated intention of the legislation.

Source: http://defendtheinter.net/

Share via email
Share on Tumblr

Frequency Harmonic Calculator in C++

I just came up with a little Frequency Harmonic Calculator in C++. Calculating harmonics isn’t hard, but if your doing a bunch of calculations, this might come in handy. To calculate a harmonic, simply take the fundamental frequency (F) and multiply it by an integer value (i.e. 3). So, for example, if F = 520 KHz, then the 3rd harmonic would be (Fx3) = (520×3) = 1560 KHz.

I also wrote a section of this program to calculate frequencies that have a harmonic of the frequency you enter. So if you enter 520, it will let you know that 260 KHz has a harmonic of 520 KHz. I needed something like this for a project I’m working on, so I decided to share what I came up with.

There is something funny/nice that occurs. If you enter both the value (i.e. 520) and the measurement (i.e. KHz) when it asks for the fundamental frequency, it will somehow write the frequency to the ‘freq’ variable and the measurement to the ‘unit’ variable and skip the step where I ask for the unit of measurement. All the calculations are correct and everything. I might know why this is, but I’m not sure enough to spit it out. Anyway, kinda cool.

I also put up this code here: http://pastebin.com/8y8pcVPr



#include <iostream>
#include <stdio .h>
#include <string>

using namespace std;

class calculator
{
public:

int highArray[15];
int lowArray[15];
int freq;

void harmonics(int);
void lowFreq(int);

};

void calculator::harmonics(int freq)
{

for (int i; i < = 15; i=i+1)
{
highArray[i] = freq*(i+1);
}

}

void calculator::lowFreq(int freq)
{
for (int i=0; i<=15; i=i+1)
{
lowArray[i] = freq/(i+1);
}
}

int main()
{
int freq;
string unit;

cout << "What is the fundamental frequency?\n\n";
cin >> freq;
cout < < "\nWhat unit of measure are you useing? (Hz, KHz, MHz,... )\n\n";
cin >> unit;
cout < < "\n\n";

calculator related_freqs;

related_freqs.harmonics(freq);

cout << "The harmonics of " << freq << " ";
cout << unit << " are...\n\n";

for (int i=0; i<=15; i=i+1)
{
cout << "Harmonic #"<< (i+1) << " " << related_freqs.highArray[i];
cout << " " << unit << "\n";
}

cout << "\n\n\nNow I'll calculate frequencies that have a harmonic of " << freq;
cout << " " << unit << "\n\n";

related_freqs.lowFreq(freq);

for (int i=0; i<=15; i=i+1)
{
cout << "Frequency #"<< (i+1) << " " << related_freqs.lowArray[i];
cout << " " << unit << "\n";
}

cout << "\n\n\nPress any key and hit ENTER to quit.\n";
cin >> freq;
// getchar();    // For some reason or another, this command has never worked for me. That's why I wrote the above line so that the user can actually read the data output. It's not as nice, but it works.
return (0);
}


Share via email
Share on Tumblr

Install Android Market on Coby Kyros MID7012 (or most other tablets running Android 2.3.3)

Coby Kyros MID7012So this Christmas, I put the Coby Kyros MID7012 tablet (which only runs Android 2.3.3) on my wish list. I was surprised when I actually received it! By that time, I had decided I didn’t really need it. I am returning it, but I thought I would share some things I learned through the experience. This mainly concerns installing the Android Market on the Coby Kyros.

Ok, just to give you a little background info, the Kyros 7012 and others don’t have the Android Market installed out of the box. It would seem like all you’d need to do is install a few .apk files and you’d be good right? Well all but 2 articles I read online were not like that at all. Most required you to root the device. Although rooting itself can be undone, certain things done with rooting privileges cannot. Not to mention the fact that “rooting” the tablet most likely voids the warranty on the device. So, in short, it doesn’t seem like “doing it right the first time” is very popular with people installing the Android Market. That is why I wanted to throw in my two cents about this so that more people can do this right and not mess up their devices.

After a good amount of research, I found a method that actually worked for me. It is based off of a YouTube tutorial. If you go on YouTube, it’s the first one that pops up if you search “install android market on coby” I believe. Here’s the actual URL: http://www.youtube.com/watch?v=6BrWSC2uiAg

NOTE: I, NORTHWEST TECH EXPERIENCE, AND ANY OTHER INDIVIDUAL OR COMPANY ASSOCIATED WITH THEM SHALL NOT BE HELD RESPONSIBLE FOR ANY NEGATIVE OUTCOMES BY FOLLOWING THIS TUTORIAL. WE PROVIDE THIS INFORMATION TO YOU FREELY. IN FOLLOWING THESE STEPS, YOU AGREE THAT YOU AND YOU ALONE ARE TO BE HELD RESPONSIBLE FOR ANY NEGATIVE OUTCOMES.

I have to put that there in case someone messes up their device by following this, although I doubt they will. OK, here we go.

1. Download the “Android Market_install_files.zip” below with your PC and unzip all the files to a convenient location (say, your desktop).

Android Market_install_files.zip

2. Now connect the tablet to your PC and put these files on your tablet’s SD card or internal memory. If your not sure how to do this, consult your product manual (on page 30 I think). I stuck the files in the “downloads” folder on the device itself.

3. After the files have finished transferring, disconnect the tablet from your PC.

4. Go to your file viewer app. On my tablet, they installed “ES File Explorer”. Yours should have a similar file explorer program.

5. Now find where you put those .apk files. I put mine in the “downloads” folder.

6. Ok, now you are going to install them in a specific order. (Just tap on the file to install. Hit “Done” after each one. DON’T RUN THEM AFTER THEY INSTALL!) Here is the order:

a. OneTimeInitializer.apk
b. SetupWizard.apk
c. GoogleServicesFramework-signed.apk
d. com.android.vending.3.3.12.apk

7. Ok, this step is important. DO NOT GO TO THE HOME SCREEN!!!!. Press and hold the power button on the tablet and turn it off.

8. Now turn it back on!

9. After start-up, you will see a menu with two options. Check the “Use this as default” box on the bottom, then select the option on top (“Launcher”). You don’t want to set up anything. You just want to use the regular initializer.

10. Make sure you are connected to a wireless network (WIFI). If not, get your tablet connected.

11. Now that your connected, go to the Apps list (by tapping the box made of little squares that’s either on the bottom or right hand side of your screen).

12. You should see the Android Market icon in this list. Go ahead and open it. Since this is the first run, you’ll need to enter your Google Account information and accept the license agreement.The Android Market will filter out most apps that won’t work with your tablet.

You should be good to go. Enjoy your new apps!

Share via email
Share on Tumblr

Age Calculator in C++

This is my first program in C++ that truly uses object oriented programming capabilities. Some of the code is a little redundant. I wrote it this way to help me understand what is really going on when your passing data around.

I thought I’d throw the code up here for anyone who would like to use it. Here you go.

If you find an error/bug, please leave me a comment!

Age Calculator.txt



#include <iostream>
#include <stdio .h>
#include <time .h>
#include <string>

using namespace std;

class date
{
public:
int day;
int month;
int year;
int daysold;
int monthsold;
int yearsold;

//I defined two methods. The "birth" method and "age" method both accept three integer variables.
void birth(int, int, int);
void age(int, int, int);
};

void date::birth(int b_day, int b_month, int b_year)
{
// This mearly takes the birthday (DD MM YYYY) entered and writes it to the class's variables for the other method to use.

day = b_day;
month = b_month;
year = b_year;

//cout < < day << "/" << month << "/" << year << "\n";           // This was for me to test what data is really reaching those three variables.

}

void date::age(int c_day, int c_month, int c_year)
{
//This method actually does something useful! Useing both the current date and the birthdate, it will calculate "monthsold", "daysold", and "yearsold."

//NOTE: THESE ALGORYTHMS DO NOT CURRENTLY RETURN ACURATE VALUES AS THEY DO NOE ACCOUNT FOR LEAP YEARS. Hmm... mabe something to change when it's not 11:53 pm

monthsold = (((c_year*12) + c_month) - ((year*12) + month));

daysold = (monthsold*30) + day;

yearsold = monthsold/12;
}

int main()
{
// -----------------   VARIABLES   -------------------
int b_day;
int b_month;
int b_year;
int c_day;
int c_month;
int c_year;

//------------------ GET SYS TIME  -------------------

time_t tim;  //create variable of time_t
time(&amp;amp;amp;amp;tim); //pass variable tim to time function
cout << "Program initiated on " << ctime(&amp;amp;amp;amp;tim) << "\n\n"; // this translates what was returned from time() into a readable format

time (&amp;amp;amp;amp;tim);
struct tm * ptm= localtime(&amp;amp;amp;amp;tim);
c_day = ptm->tm_mday;
c_month = (ptm->tm_mon)+1;
c_year = ptm->tm_year + 1900;

//------------------ START ASKING QUESTIONS -------------------

cout < < "In what year was the subject born? (i.e. 1982)\n";
cin >> b_year;
cout < < "\nIn what month was the subject born? (i.e. 09)\n";
cin >> b_month;
cout < < "\nOn what day was the subject born? (i.e. 27)\n";
cin >> b_day;
cout < < "\n";

//------------------ VERIFY INFORMATION ------------------
//Define an object from the "date" class. I'll call my object "human."
date human;

// Send the collected data to the "birth" method
human.birth(b_day, b_month, b_year);

//Put a confirmation message up.
cout << "You said that the subject was born on " << human.month << "/" << human.day << "/" << human.year << " if I'm not mistaken.\n";

//Send current date to AGE method to run calculations
human.age(c_day, c_month, c_year);

//------------------ DISPLAY CALCULATIONS --------------------

cout << "\nOk. In case you were wondering, the subject is somewhere around\n\n";
cout << human.yearsold << " years \n\n";
cout << "...or...\n\n";
cout << human.monthsold << " months \n\n";
cout << "...or...\n\n";
cout << "aprox. " << human.daysold << " days old\n\n\n";
cout << " - - - | - - -\n\n";
cout << "Sorry, that's my best extimate.\n";

//---------------------- QUIT MAIN PROGRAM ----------------------cout << "\n Press any key and hit ENETER to close." << endl;

cin >> c_day;
//int getchar();    // For some reason or another, this command has never worked for me. That's why I wrote the above line so that the user can actually read the data output. It's not as nice, but it works.
return (0);

}

Share via email
Share on Tumblr

Light in Web Design

A few thoughts about building a good web experience with light.

First off in the real world I found it light is everywhere! When you see light your eyes automatically are attracted to it so how can I bring that into web design?

With call to action buttons!

Naldz Graphics has a great rundown on call to action.

Check it out.

15 Tips in Making an Effective Call to Action

Websites have their own calls to action which are manifested by a button which urges you to perform an action and brings you to a different page after clicking. It could ask you to purchase an item, to subscribe to a newsletter, to give information, to download something and many others. No doubt, having a call to action is an important part of any website for it provides focus from the users and it directs the users, too. It is also a tool to measure your effectiveness and success as a website.

Hence, it would really be necessary to make your calls to action effective. If not, you will fail to achieve your purpose. For designers, here are some tips for you in making an effective call to action. Try to take note of these points for it will not only help you create effective calls to action but it will also help you have a more successful site.

From Naldz Graphics.net

 

Share via email
Share on Tumblr