follow me on Twitter

    Subscribe to
    Posts [Atom]


    All Things Software

    Friday, April 25, 2008


    JAVA, Web Services, Open Source . . . these are the real greatest things since sliced bread.

    Serializable - is an object that is able to be saved or transmitted in binary form.
    SWING - the GUI widget toolkit developed by sun microsystems. My problem with it is that it is super slow because the widgets are not native. That means that every time they are viewed each pixel of every widget needs to be redrawn instead of calling prestently existing widgets innate in the operating system.
    Java Web Start - a solution to java applets. Applications can be executed from the web but are not run in a browser but on a local machine. This fact solves the issue of browser plugin compatibility.
    JPA - Java Persistence API. Java classes represent persistence entities which are related to other persistence entities and emulate relational tables. Entity instances relate to actual rows in a database.
    JMS - Java Messaging Service. a middle ware for sending message between different client applications.
    OC4J - Oracle Containers for Java is the core runtime for oracles application server.
    GlassFish - Sun microsystems Java system application server 9.x. It is derivative of apache tomcat.
    Servlet - an object that receives requests and generates responses in the form of mostly but not limited to html.


    Configuration Management - the management of security features and security features for all elements of an application throughout its lifetime.

    Configuration has 4 elements:
    Configuration identification
    Configuration change control (or change management)
    Configuration status accounting
    Configuration verification and auditing


    CORBA - Common Object Request Broker Architecture. A standard that allows applications written in multiple languages to work together.
    Sandbox - a scratch space on the disk or in memory where untested applications can be run with guest privileges and no harm can be done.
    Application Server - a software engine that delivers applications to client computers most often by means of http.
    Web Server - is responsible for accepting requests from client browsers and returning responses via http.

    Application vs. Web Servers - Application servers handle dynamic functionality and communicate with databases.

    Web Services

    Web Service - a software system that provides interoperable machine to machine interaction.

    3 Styles of Use:
    RPC - a process by which procedures and methods can be executed in another address space.
    SOA - an architecture where the basic unit of communication is a message call and not an operation.
    REST -(representational state transfer) a simpler and less robust approach to SOAP. its an approach to get website content by reading designated web page content that contains XML.

    WSDL - web service description language. an xml based language for describing web services.
    RMI - JAVA remote method invocation. The object equivalent of RPC
    UDDI - a platform independent xml based registry where business and web services are listed on the internet.
    ESB - Enterprise Service Bus. An ESB is a software architecture construct. It adds a layer of abstraction on top of the enterprise messaging system.
    AXIS - an implementation of SOAP

    Labels:


    Qualcomm

    Thursday, April 24, 2008


    The telecom industry is not unlike every other technology industry. Large corporations own patents. From these patents they attempt establish standards. Competitors have opposing technologies. Constituents and implementers of the technology pick a side. Big players attempt to use their hegemony to create a monopoly within the industry. VHS vs. Beta, Blue Ray vs. HDDVD, Osh Kosh vs. Levis, and CDMA vs. GSM.

    CDMA - code division multiple access. CDMA allows many transmitters on the same frequency.
    GSM - Global System for Multiple Communications. GSM uses different 4 different frequencies.

    GSM vs. CDMA - I postulate that cdma is faster because they can utilize bandwidth with more efficiency because they can allow more transmissions on the same frequency. Where as, GSM has to place different transmissions in different frequency to establish its autonomy.

    An analogy to the problem of multiple access is a room (channel) in which people wish to communicate with each other. To avoid confusion, people could take turns speaking (time division), speak at different pitches (frequency division), or speak in different directions (spatial division). In CDMA, they would speak different languages. People speaking the same language can understand each other, but not other people. Similarly, in radio CDMA, each group of users is given a shared code. Many codes occupy the same channel, but only users associated with a particular code can understand each other.

    Labels:


    Blogger Bug: Posts display below side bar

    Wednesday, April 23, 2008


    After nearly throwing my Mac Book Pro through a wall I finally found the answer to my problem with a little bit of googling. I was manipulating the blogger template in which you are now enjoying. My new template appeared with the posts lying below the side navigation which includes posts, archives and the rss atom hyperlink.

    If you are having the same problem in blogger you can:

    Go to Settings on the dashboard.
    Go to Formatting
    Scroll down to Enable Float Alignment and choose "NO".
    Save Settings and republish.

    Prior to finding this out I reviewed the source code of the page and it revealed that the following div tag was being inserted: >div style="clear:both;">

    Labels:


    Shopping For A Camcorder

    Sunday, April 20, 2008



    I've been doing the usual dance when it comes to buying any sort of new electronic device. Go to CNET.com, find the latest models, read about all the existing technologies and standards, and lastly try to make a decision on a model that won't be obsolete the day after you buy it.

    Here are a couple of terms / acronymns that one might familiarize themself with before making a camcorder or video camera purchase.

    SDHC Cards - Secure Digital High Capacity it's a specific format in the flash drive market. They are used in pdas, camcorders, and digital cameras. SDHC cards are designed for devices that are compatible with the SDHC 2.00 specification. Devices built for the 1.0 and 1.1. specification are not compatible.

    DTS - Data Transfer Speed. SDHC 2.0 has 3 classifications for DTS including:

    • Class 2: minimum sustained DTS of 2MB/sec

    • Class 4: minimum sustained DTS of 4MB/sec

    • Class 6: minimum sustained DTS of 6MB/sec



    AVCHD - Avanced Video Codec High Definition. A high definition video recording format introduced by sony and panasonic. AVCHD uses an MPEG-4 AVC (H.264) video code. It competes with HDV and MiniDV.

    HDV - High Definition Video. An inexpensive ecording format which uses MPEG2 compression to fit HD content onto the same DV or MiniDV tapes originally developed for standard definition recording.

    CMOS Sensor - complimentary metal-oxide semiconductor. It converts light into electrons. The sensor uses 2-D array of thousands or millions of tiny solar cells, each of which transforms the light from one small portion of the image into electrons. There are several transistors per pixel which magnify the charge in analog to digital format using traditional wiring.

    CCD Sensor - does the same process of light to electron conversion but uses a special process to move the charge across the chip from which less distortion ensues.

    Labels:


    LDAP

    Friday, April 18, 2008

    Lightweight Directory Access Protocol
    DIT - Directory Information Tree Entries are in a tree like structure

    Directory Levels:
    dc - domain component or organization
    ou - organization unit
    cn - common name
    dn - distinguished name

    slapd - stand alone ldap daemon
    slurpd - stand alone ldap update replication daemon

    Labels:


    Java Class To View A Directory

    Wednesday, April 16, 2008

    This static class will let you view the contents of a directory. The file you will pass the listPath method will look like "/File/File" for unix, linux, and mac or "c:\\" for those Windows losers.

    public class Dir {
    static int indentLevel = -1;

    public static void listPath(File path) {
    File files[];
    indentLevel++;

    files = path.listFiles();

    Arrays.sort(files);
    for (int i = 0, n = files.length; i < n; i++) {
    for (int indent = 0; indent < indentLevel; indent++) {
    System.out.print(" ");
    }
    System.out.println(files[i].toString());
    if (files[i].isDirectory()) {

    listPath(files[i]);
    }
    }
    indentLevel--;
    }
    }

    Labels:


    how to create basic authentication in tomcat

    Monday, April 14, 2008

    in your applications web.xml file place the following code:

    (switch > to < to enable code)

    >security-constraint>
    >web-resource-collection>
    >web-resource-name>
    Entire Application
    >/web-resource-name>
    >url-pattern>/*>/url-pattern>
    >/web-resource-collection>
    >auth-constraint>
    >role-name>user1>/role-name>
    >/auth-constraint>
    >/security-constraint>
    >!-- Define the Login Configuration for this Application -->
    >login-config>
    >auth-method>BASIC>/auth-method>
    >realm-name>your application name>/realm-name>
    >/login-config>

    In the tomcat-users.xml create the following entry for the user1 user you created above:

    >tomcat-users>
    >role rolename="user1"/>
    >user username="user1" password="user1password" roles="user1"/>
    >/tomcat-users>

    Labels:


    The Unified Theory

    Tuesday, April 08, 2008

    After reading some words of Stephen Hawking I attemped to repeat back to myelf his inferences in addition to asking a few of my own questions.

    The universe is either unchanging or eternally expanding. If the universe is unchanging then it doesn't necessarily need a beginning. It very well could have always been or have been created. If the universe is eternal there are physical reasons where there has to be a beginning. This is largely where our existence branches into creation or the big bang. If there is no beginning then there would be an infinite amount of time before any event. On the other hand if the universe has a beginning then before that there is an infinite amount of time. Would there even be time at all? Is time only a property of this universe we live and not God's realm?

    Answers to these questions are based on theory and mostly partial theories. We live in the information age. This is an epoch where we have created the internet and cracked the human genome. Our greatest search is for the unified theory. A theory that will describe everything in the universe. It's prudent to note that God could have created an arbitrary universe not subject to any laws. It's obvious that we live in a very calculated and unaccidental world in which that unified theory could very well exist.

    Natural selection and survival of the fittest theory would suggest that as us humans progress we would become increasingly intelligent and have access to much more information we would come closer and closer to this theory. There is also the idea that we are actually working counterproductive to natural selection through antibiotics, well fare, and many other forms of coddling. If there is in fact a complete unified theory there would be an calculated determination of our search for such a theory. In this instance this calculation could lead us to the wrong answer or even never reaching the theory in the first place?

    Labels:


    Create a sample java facebook application


    This is a spring controller class which I created to use the java facebook api. This works as is and can be dropped into a java class and jsp file. This basically brings all the users info from the api to the jsp page. If you need help about about how to setup a spring framework application you can click here.

    This class looks like:


    package facebook;

    import org.springframework.web.servlet.mvc.Controller;
    import org.springframework.web.servlet.ModelAndView;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;

    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;

    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.EnumSet;
    import java.util.List;
    import java.util.Map;
    import java.util.HashMap;

    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;

    import com.facebook.api.FacebookException;
    import com.facebook.api.FacebookXmlRestClient;
    import com.facebook.api.ProfileField;

    public class FaceBookController implements Controller {


    public String apiKey = "ba2c5adb61c1d6d4fbc9a9fb566806e4";
    public String secretKey = "c44a45272b18cbedeb145a4d1e80b719";

    FacebookXmlRestClient frc;

    protected final Log logger = LogFactory.getLog(getClass());


    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException, FacebookException {
    Map myModel = new HashMap();

    HttpSession session = request.getSession();
    String sessionKey = (String) session.getAttribute("facebookSession");
    String token = request.getParameter("auth_token");

    try {

    if (sessionKey != null && sessionKey.length() > 0) {
    logger.info("session is not null: "+sessionKey);
    frc = new FacebookXmlRestClient(apiKey, secretKey, sessionKey);
    //this.doTheThing(request, response, frc);

    // put into model
    int myid = frc.users_getLoggedInUser();
    EnumSet fields = EnumSet.of(com.facebook.api.ProfileField.NAME, com.facebook.api.ProfileField.PIC, com.facebook.api.ProfileField.PIC_BIG, com.facebook.api.ProfileField.PIC_SMALL);
    Collection users = new ArrayList();
    users.add(myid);

    // Get my information
    Document d = frc.users_getInfo(users, fields);
    String myname = d.getElementsByTagName("name").item(0).getTextContent();
    String mypicture = d.getElementsByTagName("pic").item(0).getTextContent();

    // Get my friends id
    Document d2 = frc.friends_get();
    String s = d2.toString();
    NodeList userIDNodes = d2.getElementsByTagName("uid");
    int fcount = userIDNodes.getLength();

    Collection friends = new ArrayList();
    for (int i = 0; i < fcount; i++) {
    Node node = userIDNodes.item(i);
    String idText = node.getTextContent();
    Integer id = Integer.valueOf(idText);
    friends.add(id);
    }

    List l = new ArrayList();
    Map m = new HashMap();
    Document d3 = frc.users_getInfo(friends, fields);

    // Get my friends information
    for (int j = 0; j < fcount; j++) {
    String name2 = d3.getElementsByTagName("name").item(j).getTextContent();
    String picture2 = d3.getElementsByTagName("pic").item(j).getTextContent();
    String picture3 = d3.getElementsByTagName("pic_small").item(j).getTextContent();
    String picture4 = d3.getElementsByTagName("pic_big").item(j).getTextContent();

    MyFriend mf = new MyFriend();
    logger.info("friends: ");
    logger.info("friends: "+name2);
    mf.setName(name2);
    mf.setPictureURL(picture2);
    l.add(mf);

    }
    myModel.put("friends", l);
    myModel.put("friends2", l);
    myModel.put("myname", myname);
    myModel.put("mypicture", mypicture);
    myModel.put("numFriends", new Integer(fcount));

    //me
    myModel.put("myname", myname);

    } else if (token != null) {
    logger.info("token is not null: "+token);
    frc = new FacebookXmlRestClient(apiKey, secretKey);
    session.setAttribute("facebookSession", sessionKey);
    sessionKey = frc.auth_getSession(token);
    session.setAttribute("facebookSession", sessionKey);
    logger.info("return to facebook.htm");
    return new ModelAndView("redirect:/facebook.htm?auth_token=" + token);


    } else {
    logger.info("redirect to login: "+apiKey);
    response.sendRedirect("http://www.facebook.com/login.php?api_key=" + apiKey + "&v=1.0");
    }
    } catch (FacebookException fe) {
    } catch (IOException ioe) {

    }

    return new ModelAndView("facebook", "model", myModel);
    }


    }


    The JSP page looks like (add to < to all tags because I'm unable to post tags):
    html>
    head>title>facebook test/title>/head>
    body>
    H1>View All of Your Friends/H1>

    I know this isn't very mind blowing but I was testing out using the facebook api and here's what I created!
    /br>
    c:forEach items="${model.friends}" var="friend">
    c:out value="${friend.name}"/> /br>img src=""/>br>br>
    /c:forEach>
    /body>
    /html>

    Cal Poly Alumni Dinner Speech

    Sunday, April 06, 2008



    Greetings everyone.

    When I was asked by George to come and speak I was honored. He asked me to speak to you about ambition. Everything I do is so deeply rooted in the subject that I figured whatever I spoke about would contain the essence of it.

    I mulled over the subject and I decided the best way to illustrate my experience was to relate to you a story.

    You've all heard of the ancient israelites 40 year plight in the desert. Similarly, I was thrown into the desert for an undetermined amount of time. My task was to get software that I collaborated in writing at arguably one of the largest institutions in the country. I showed up purely based off of faith and the hope that I could tackle this lofty task. On day 1, I was the only person I knew in the whole IT department let alone the whole state. I was introduced to everyone on the team that I would now be working with. I went into the introduction with an open mind and warm heart. Over the years I've learned to appreciate people of all temperaments, talents and convictions.

    At the end of each day I would go to my new home one of my bosses properties some 40 miles outside the city. It was extremely lonely at first but I wouldn't trade that time of introspection for anything. After some time of making this commute back to an empty house I decided to stop feeling sorry for myself and start making the best of the situation. I began to draw on everything I've ever learned from my family, my Christian faith, and Sigma Chi. I evaluated, set goals, and strategized how I would make the best of my time in the desert. Abe Lincoln once said that “I do not think much of a man who is not wiser today than he was yesterday”. Committing myself to constant improvement is one of the core values of my personal mission statement. It was the means by which I would walk away from this experience having gained something.

    I found out that two alumni from this chapter lived in the area. I got ahold them and we immediately took our fair weather friendship to the bond of brothers. Every other week we met for sushi and cigars. Those similar values that we shared allowed us to all gain that immediate acceptance.

    At the time I was reading the autobiography of Benjamin Franklin. I was intrigued by the fact that he was a group mogul. He joined and started every group available. He started the first public library, the first fire department, and obviously our own nation. I went on to do the same . . . well join several groups that is. I joined the fraternity alumni chapter. I joined a church and began running the video portion of the service. I even attempted to join the volunteer fire department.

    The progress of the implementation began to resemble a roller coaster. I would make a huge break through one day and be greeted by the entire staff mutanizing against my idea the next. Instead of reacting to every single dip in the road I stayed constant and acted based on the foundation I spoke of previously. If someone stabbed me in the back, I would still say hi to them the next day because I smile and greet everyone everyday.

    My best of friends came out to visit me. Most of them are in this room right now. We hit the bars outside the university. We visited the local Sigma Chi house and were shown the hospitality I was shown when I first showed up on their doorstep. We went to the super bowl and tailgated in the freezing cold. And a little farther away camped at the grand canyon and became closer than we ever have been. We made memories that I wouldn't trade for any amount of money or any other opportunity cost.

    Back at work I was now several months into my journey I began to figure out the dynamics of the institution and more specifically the team with whom I worked. They were seen as the youngest and most talented of the groups in the organization. These two factors also lead them to be the most controversial. This didn't affect my view or treatment of them because this was my team. I was taught by my best friends growing up that you don't ever leave any man behind.

    I did everything with my new work friends:. I did a triathalon in Mexico, A news televised urban idiotarod, 2 year old birthday parties, all nighters at the bars, leans on shoulders, debates over faith, Baby's births, and finally good byes to all my friends first and co-workers second.

    My loneliness turned to busyness in the instance of a spiritual awakening and a conscious decision to use all that I've learned to not be the effect of a situation but instead affect my situation.

    You ask how this relates to you as a rushee and future brother. Or as a fraternity man, husband, sister or friend. Each time you heard these men snap tonight was a time my journey contained a value of sigma chi. What would my destination look like with out these snaps? I wouldn't even be speaking to you tonight.

    Thank you again for this opportunity to speak to you tonight and I look forward to greeting you as brothers.

    Labels:


    Mac OS X show hidden folders

    Wednesday, April 02, 2008

    In Mac OS X you can you can show all hidden folders by entering the following in the terminal:

    defaults write com.apple.finder AppleShowAllFiles TRUE

    killall Finder

    Labels: