Thursday, July 31, 2014

Why Republic Wireless and net neutrality matter

The Interstate Commerce Clause of the U.S. Constitution basically says that any commerce occurring between states falls under the umbrella of the federal government. This is an important point for a nation which takes states' rights so seriously. Keep in mind, too, the time period in which the Constitution was drafted and the level of interstate commerce at that point.

What can the feds do with the ICC?

Fast forward to the present day. The ICC is how the federal government can prohibit guns within so many feet of a school. Why? Because no gun is made entirely within one state and sold entirely within one state. Hence, the feds can control legislation relating to guns. The ICC is also how many cases are removed from state court to federal court when it is more favorable to the defendant who was sued in state court. What company uses paper made entirely in one state and sold entirely in the same state? Or software? Or office equipment? You get the picture.

The age of the Internet.

I'm a stay-at-home mom to 2 small kids. I can't afford to pay for daycare on top of tuition. So I can only pursue my techie dreams if I can take classes online. Wake Tech is ultra cheap, CodeAcademy introduced me to HTML/CSS/JS and MOOC gave me Python. The point is that we have access to more knowledge (and I don't mean the kind Perez Hilton brings us) than ever before. Access to knowledge = power. Constricting access = power for someone else.

Replace "We the People" with "Comcast/Time Warner Cable"...

...if these giant corporations can control internet speed based on who pays the ransom, then we are not a democracy. And I hope you don't think for one second their lobbyists aren't well paid to attempt to take control of Congress. So if the corporations tell us what we can read and what we can watch and what we can listen to because they have the money to bend Congress' ear...then "adijo" democracy.

It looks like we've won part of the battle,  but they'll be back for more.

Keep the faith, Republic Wireless.

So when a company like RW starts to make a dent in a market and make technology affordable for everyone, it's a big deal. Everyone says the desktop is dying. (Personally, I need a bigger screen for regular reading.) If that's true, outrageous phone bills for smart phones means a lot of people are priced out of accessing information.

This is not a thorough legal analysis, but it is something I believe in strongly. I'm all for making a profit and people who work hard and do a good job should be aptly rewarded. But individuals should not be controlled by corporations. They don't own the internet. They don't own information.

How we practice democracy will change with technology. Companies like RW can push us in that direction while simultaneously pushing back against the corporate giants that want to diminish democracy.

Wednesday, July 23, 2014

Making columns in a listbox in C#

Amended: There is a MultiColumn property I forgot to mention. It didn't work for me with the particular problem I had. Maybe that was my lack of skill. Maybe it was the problem. In any case, try MultiColumn and try my workaround. One of them should do the trick.

This post probably has a very limited audience made up of other students who, like me, are being forced to use Windows Forms and have not yet used WPF. Having not used WPF yet, I don't know if this helpful hint will help outside Windows Forms.

Here was my problem: I had a lab assignment in which I was required to make a GUI in Windows Forms. Random integers were to be created with a button click and the values displayed in a listbox with two columns. I suddenly realized I didn't know how to make columns in a listbox.  Very old versions of Visual Studio had a columns property but since I was using VS 2013, that didn't help. I also read somewhere that listview could be used but it was described as "quirky." I didn't have time for quirky.

So here's how to do it:

        Step 1: listBox1.Items.Add("Index     Values");
        Step 2: Make a for loop
        Step 3:  Inside the for loop, add the output underneath the column headings
                    from Step 1.
                    listBox1.Items.Add(string.Format("{0}           {1}", i, intArray[i]));

That's it. Pretend you're in a Console app but use listbox instead and you've got columns.

Monday, July 14, 2014

Convert string to a char array in C#

It's not complicated. You just have to know how to do it.

   public class ArrayChange
   {
       static char[] charArray;//declare before Main method
       public static void Main(string[] args)
      {
         Console.WriteLine("Enter your name: ");
         string input = Console.ReadLine();
         charArray = input.ToCharArray();
      }//end Main method
   }//end class

This first line, of course, prompts the user to enter a string. The second line stores that input in a string variable called "input". The third line converts input to a char array and stores it in the array called "charArray".

If you try to store the user input directly into a char array, you'll get a red squiggly line telling you that you cannot implicitly convert a string, which is the user input, into a char array. In other words, you can't just say that apples = oranges.

So your next thought is probably to do this:

Convert.ToCharArray(Console.ReadLine());

Good idea. Makes sense to me, but Convert class does not contain a ToCharArray method, just ToChar. So when you want apples = oranges, you need a middleman. In our case, that middleman is string input, which stores the user input as a string. Since strings are made of characters, we can just dump those characters into a char array as we did in the third line.