Thursday, August 19, 2010

Installing mts mblaze on ubantu lucid lynx and intrepid.

I recently got a new mblaze broadband connection with the wireless data card. This one uses the zte modem model AC2746. I had the older linux ubantu edition called the Intrepid Ibex installed on my Acer 5920 laptop.
The setup on the intrepid was a breeze. I simply inserted the data card into the laptop and went to menu → Computer → ZTE usb drive. There was a file called CrossPlatformUI-V1.0.27-SSTL-i386-ubuntu.deb there. I double clicked on that file and then clicked on next, next etc. It installed a program called ZTEMT UI Common edition in the “Internet” menu. I clicked on that and the following window came up:













From that point on connecting to the Internet was easy as shown here.












Life was good until I decided to upgrade to Linux mint 9[ which is Ubuntu lucid lynx]. I needed to run monodevelop's latest edition and downloading and compiling it on Intrepid Ibex was too much of a pain.

So to cut a long story short, I downloaded the lucid lynx live CD and installed it on the machine.
There's where all my problems started. Due to changes in the usb modeswitch on the new linux kernel I would get a ZTE CD ROM icon on the computer every time I inserted the USB data card. I did the same thing as before, I double clicked on CrossPlatformUI-V1.0.27-SSTL-i386-ubuntu.deb file in the drive. The installation finishes with an error message. I ignored the error message closed the installation program. Then removed the USB card and reinserted it.
The ZTE CD rom Icon came back. The USB device would not switch to the “modem” mode from the “usb drive” mode. So much for mode switch huh?
So I looked on the internet and found some instructions on ZTE modems here : http://www.draisberghof.de/usb_modeswitch/#usage
Apparently simple right clicking and clicking on “eject” switches the mode!!
So I did that, right clicked on ZTE cd rom and clicked eject. Then I restarted the computer.
Then I clicked on menu->Internet-> ZTEMT UI. The same menu came up and I can browse the internet now.
Rather simple huh. It takes some time for the application to detect the usb modem. So wait a few seconds [like 30 seconds] after inserting the USB modem.

There are some sites on the internet which speak about doing this all via the command line, however its not possible to switch from hybrid to broadband using the command line mode. The speed in hybrid mode is much lower then broadband mode.

I have put the deb file on rapidshare in case I need it later: I put the deb file at http://rapidshare.com/files/413879966/CrossPlatformUI-V1.0.27-SSTL-i386-ubuntu.deb/

Wednesday, February 11, 2009

Joins

Union :Works on identical tables only 1.Select * from a union select * from b: Returns non duplicate values 2.select * from a union all select * from b: Returns duplicates as well. 3.select * from A intersect corresponding by (col1)select * from BAbove detects rows in table A that are duplicated in table B. 4.select * from Aexcept Corresponding by(col1)select * from BThis once will return rows from A whose corresponding calues are not present in B. JOINS : Works when the tables are not union compatible or union compatible. 1. select * from A, BJoins every row of table A with every row of table B. 2. select * from A a, B b where a.col1=b.col2Equijoin, only rows which match the condition are returned. 3. select * from A a, B b where a.col1=b.col1 Or select a.*, b.col1 from A a, Natural Join B bNatural Join :In this all columns that have the same name, type and length are compared with the other table. 4. Select * from A a, B b where a.col1 > b.col2Condition Join:Same as equijoin except the condition is something other then equality. 5. Select * from A a Join B b using( col1, col2)Column Name Join :Just like a natural join however we can specify the same-name to be used. 6. Inner Join select * from A inner join B using (col1, col2)Inner join is a join in which the rows in A and B which do not match the condition do not end up in the result. 7. Outer Join : In this the join does not remove the records in table A and table B that do not match the condition. 7a. Left Outer Join: The left outer join presearves unmatched rows from the left table but discards from the right table. Select * from A a, left outer join B b on a.col1=b.col2//There is no left inner join, 7b. Right Outer Join: It preserves unmatched rows from the right table but discards from the left table. select Select * from A a, right join B b on a.col1=b.col2 7c. Full outer Join: Preserves unmatched rows from left and unmatched rows from right. 8. On Clause vs the where clause: Union:Does not have on clause since it does not filter data. Inner Join: The on and where clauses are logically equivalant here. Outer Joins: The where clause only filters the records. The on clause first filter the records and then includes the rejected records, extended with nulls. 9. Clusturing Index: A table can only have one clustering index. The records in the clustering index are situated next to each other on the disk. So pulling the records are much faster. If the on conditions use the same index, then the records will do a merge join which reads both the tables in order.However one disadvantage is that indexes need to be rebuilt after a lot of updates have been performed.

Saturday, January 24, 2009

Parryware flush valves.

the flush valves in the parryware systems are different from regular american flush valves. They need to be turned[the entire flush cone] and lifted to expose the flush valve below. Otherwise the videos on "how to fix a leaky flush" are very helpful here as well.

how to create a home file server/

The idea is to create a home file server using two computers and a regular Lan cable without a router.
1. Connect the monitor, keyboard, mouse and power to the tower.
2. Download Linux mint.
3. Burn the iso file to a cd.
4. Put the cd in the tower,
5. Boot from cD.
6. Click next, put your time zone etc, click next finish the installation.
7. Mount the required drive from the /etc/fstab using ntfs -3g
8. Reboot
9. Share the drive.
10. Fix the IP address of IP4[Exactly the same way as in windows…click on the network icon, click properties of eth0 etc]
11. Set up the tower to forward
Add the following to the /etc/sysctl.conf
net.ipv4.ip_forward = 1
12. Setup IP forwarding and Masquerading (to act as router), you need to use NAT option of iptables as follows (add following rules to your iptables shell script) :# iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE# iptables --append FORWARD --in-interface eth1 -j ACCEPT
[ If there are only two computers, then add only # iptables --append FORWARD --in-interface eth0 -j ACCEPT]
13. Connect the cable from one computer to other[lan to lan]

Saturday, July 12, 2008

Broadband benefits

Have converted my internet connection to broadband. It absolutely rocks!!

Sunday Musings

Sunday morning, am sitting at the computer thinking about all the progress that has happened in the last few years. Have finally been able to reduce the amount of money being spent and reduce the amount of frivolous expenditure.

When I look back at how my expense and income has been distributed over the last couple of years, a few things become evident:

  • Spending on video games and other entertainment was more expensive then I imagined. Its always better to put that money into other investments.
  • Its more fun to spend money when there is someone to spend it on. Being alone is more expensive then being a couple, there is someone to talk to and you can always share your emotions and thoughts.
  • Its always a good idea to invest in a good music device when you are alone. However its a better idea to invest in a multi-function device. Once you are no longer alone, a standalone mp3 player does not make so much sense anymore.
  • On the other hand a mp3 player is indispensable when on a long flight. The alternative is a good book that engages your mind. Flights are not the same as train journeys, wherein you can always look outside the window. In an airplane, there is nothing to look at outside.



Wednesday, July 02, 2008

Limited Accounts and windows.

Looked for quite a while on the internet.
A limited account is extremely useful to prevent most spyware from hooking on to the computer. Since my last spyware infection, I removed windows, reinstalled it, moved on to NTFS, updated my antivirus, did the windows update via the windows update feature. Took all night but then I use the computer for a lot of work and its useful to have it as up to date as possible.

And of course, moved to a limited windows account. No more admin accounts for me in windows.

Tuesday, July 01, 2008

windows problems

The computer finally had a virus. Was able to "heal" it with AVG.
However decided to reinstall windows anyways so as to completely cure
the system.
Took a day to install after upgrading the file system to ntfs. Also
decided to stop using the admin account for anything other then well
"Administration".
Had to install everything again and also removed ability to execute exes
for the limited accounts from the data drives by using polsec.msc.
Hmm I guess it is almost as secure as linux. The limited accounts and
the new file system should prevent files from getting hit by viruses.
But still I have an updated antivirus and am also updating the windows
updates to prevent issues with the computer.

Saturday, June 28, 2008

Running Windows On a reduced account.

This morning as I was reading my regular news feeds, I realized that the home computer did not have a spyware detecter anymore.
 
I downloaded spybot. And lo and behold, there are 10 spyware on my machine. Got to stop using the admin account going forward.

Sunday, June 22, 2008

Tuesday, June 03, 2008

Switched down cable service.

Switched out premier channels from cable. Instead subscribed to a online video and book library. It will be cheaper then cable.

Thursday, May 29, 2008

Structures in C#

Structures:

 

Points:

1. Its a value type so if we assign a value to another struct then it is stored at two different point in the stack.

2. We cannot have a explicit empty constructor in a structure.

3. Structure cannot have constructors that do not completely initialize all the variables in it.

4. There is a 16 byte size limit to structure's instance. All value types are 16 bytes or shorter.

5. It is logically a single value.

6. It will not be cast to a reference type.

7. If a copy of a structure is passed to another procedure or function then the original will not change after the call. This is because a copy is passed to that procedure or function.

8. Value types are far more efficient then reference types however there is a instance size limit.

Strategy Pattern Part-2.

Tried to create the strategy pattern example as a vehicle that can fly or a drive on the road.
Intreastingly the go method that is implemented in each of the vehicle sub classes is not hard coded into the subclass itself.
That means that a car go method is not very different from a helicopter go method. And here is the kicker: The method is not implemented in the car and vehicle classes.

The go method is instead created in an interface.
So whats the big idea? We could as well create an interface and then implement it there.

ah but the interface is implemented in two classes GoDriving class and GoFlying class.

The abstract Vehicle class has a method that takes in an interface and decides what function to call. And then takes that interface and decides what go method to call.

Its easy to understand because an interface in the Vehicle class is replced by the actual class(goFlying or goDriving is used) that implements that interface in the car class. Then the go method of

And all that is there in the car class is a call to GoDriving class to intantiate a variable.
The helicopter class therefore has only a call to GoFlying. This ensures that the go method can be modified without modifying the Car and Helicopter classes.

The advantage becomes apparent when there is a huge number of classes and they may keep changing over time.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{

public interface goInterface
{
void goMethod();

}

class goDriving : goInterface
{

#region goInterface Members

void goInterface.goMethod()
{
System.Console.WriteLine("Go Driving");
}

#endregion
}

class goFlying : goInterface
{
#region goInterface Members

public void goMethod()
{
System.Console.WriteLine("Go Flying");
}

#endregion
}

public abstract class Vehicle : goInterface
{
public goInterface travelMode;
public void setTravelMode(goInterface x)
{
travelMode = x;
}
public void goMethod()
{
travelMode.goMethod();
}


}

public class Car : Vehicle
{
public Car()
{
goDriving drx = new goDriving();
setTravelMode(drx);
}


}

public class AeroPlane : Vehicle
{


}



class Program
{
static void Main(string[] args)
{
Car x = new Car();
x.goMethod();
System.Console.ReadLine();
}

}
}

Why use design patterns

1. they are a quick and easy way to benefit from the knowledge of others.
2. There is no point in reinventing the wheel.

Have been reading some books to increase my awareness of the subject.
Design Pattern in C# by Steven John
and Design Patterns for dummies.
The dummies book is in java so that is fine.

Strategy Design Pattern

Strategy Design Pattern:
Have been reading Strategy design pattern from various books including Design Patterns in C# and Design Pattern for dummies.

Use when there is a section of code that will change frequently.
1. Instead of modelling is a relationship

like Class Vehicle
then Class car:Vehicle
        Class plane:Vehicle,

        We do class Vehicle:IDriving;
                so car:Vehicle, IDriving
                and plane:Vehicle, IDriving
           which is not so good because if something changes then it has
           to be changed in each class file.


                               so

1. Create a n interface that the subclasses will use
        in this case

 public Interface Igo{
                        public void  go();
                                              
                        }


2  public class goDriving: Igo
  {

   go(){
   System.Console.Writeline("Driving");
   }

  }
3.
  public class goFlying: Igo
  {

   go(){
   System.Console.Writeline("Flying");
   }

  }


4.
  public abstract class Vehicle
  {
     private Igo goMethod;
          
  }


Database Access in ADO.NET

Database Access in ADO.NET

Data providers:  Set of classes that allows us to
access a particular database, execute commands and
retrieve/update data.

Data providers generally have the following classes
1. Connection   : use to connect
2. Command      : used to execute commands or stored procs
3. DataReader   :Object that provides read only,forward
only access
4. DataAdapter  :Object that is used to populate the
dataset(disconnected tables). Or used to apply changes
to  a database.

There are four providers
1. SQL Server Provider  : Access to sql server
2. OLE DB Provider      :Access to data sources which
provide ole db drivers
3. Oracle provider              : Optimized access to Oracle
database.
4. ODBC provider                :access to an odbc data source.


Try Catch Throw

Throw Catch Exceptions
1. Try the block
2. Catch the exception.
3. Cleanup any remaining issues within the finally section.

Filtering Exceptions: We can use multiple catch for a single try section.
Only the first catch will be executed and then it will switch to finally.

The finally section cannot access variables declare in the try section.

If we want to create a variable declaration and make sure that it is cleaned
up even if an error occurs, then use the "using" keyword.

Tuesday, May 13, 2008

Asp.Net

Say wonder what is the need of the reusable property in i http
handler? It enables sharing of the instance with other requests so
what? Whats the advantage in using that?

--
Sent from Gmail for mobile | mobile.google.com

Wednesday, April 30, 2008

Trying to join a group.

--
Sent from Gmail for mobile | mobile.google.com

Storm aftermath

After the storm last night, the power is back up again. Its amazing
how fast things moved.

--
Sent from Gmail for mobile | mobile.google.com