Open source thoughts

The Web as I see it

To me, the web is in an exciting transitional period.  I see the web progressing towards shared data.  Allow me to explain myself.  I’m going to use a metaphor to describe what is in my thoughts. The traditional web can be thought as nodes with edges that have branches to other nodes.  Each node is a site (with all of the local pages, directories) and the branches can be thought of as the interconnect to other sites. We’ve understood how the node works, but I think we are really beginning to grasp how the edges works.  The traditional method for creating a branch is to directly link to another node, eg; linking to another website. The transitional element of the web is that there’s more than direct linking, there are edges of the nodes touching each other.

Facebook is the leader of understanding how the edges work.  Almost all websites with a user-centric focus have facebook/oauth connections.  Facebook has essentially become an open data store for these websites to tap into.  The act of tapping into a data store instead of directly linking is the relationship of the edges of these nodes.  This is why I say that Facebook understands how the edges work. So now, data is slowly becoming decentralized, but becoming more open at the same time.  What I mean by decentralized is that the data does not all sit physically in one set of clusters. How the data stored is outside the scope of this post [to be revisited].  The way I view these edges (services) is that websites should become more interdependent.  You can see this with Facebook connect.  You have a site that you want to get user data. Facebook has this data, so you use a service to tap into facebook’s data (facebook connect). You can find Facebook connect anywhere, from simple websites to extensive business web applications.

So, I think to meet the future of the web, it is necessary to integrate services that allow data cooperation across different platforms.  Fortunately, the web architecture is grasping this change.  Look at things like openid and json.  Json is really simple to read, uses less characters (less memory) and is easy to parse. Now, the future of this datacentric web is not just reliant on software.  Something not many people have been paying attention to is the hardware that makes this technology possible.  Computing power is still quite limited (hence why Facebook widened their servers and Google makes software hacks to solve problems) and the hardware behind it is still not ready for the new web architecture.  The hardware is certainly something that somebody should look into 😉

With all of this talk about Facebook, I’d like to throw something in about Google.  Google is almost far beyond the immediate future of the web.  The area they are revolutionizing is web architecture and they are also toying with neural networks and classifiers, something I will be posting about in the future. 


I was not born Yesterday

rsdrefnuvjsawagl.ssqgmjsdaxkswgf’lsydqsuqsex.sastests tvcxjstfwsaysqgmsl afcsqgmsvtfs awxsqgmjsdaxksyjgesex,sqgmstjxsojgfz.

Make your own ThienBot (twitter bot)

I wrote a twitter bot in Python to feed me rss syndications of the different news sources I read regularly. I have the script running as a cron job for every 15 minutes. This bot is largely inspired by my friend, Stuart Powers’ bot: @systown. You can follow my bot on twitter: @ThienBot; it posts news about technology, computer science, physics, and finance/economics.

Here’s the source:

import tweepy
import feedparser
import random
#import bitly_api
#import unicodedata
#import sys

consumer_secret = ""
consumer_key = ""

access_token = ""
access_token_secret = ""

di = {"":" #python", "": " #hackernews #yc", "": " #renewableenergy", "":" #hacks #projects", "": " #semiconductors", "": " #technews #slashdot", "": " #oreillyradar #cs", "":" #finance #economics", "":" #physics #science"}

def post(msg):
    auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
    auth.set_access_token(access_token, access_token_secret)
    api = tweepy.API(auth)
    status = api.update_status(msg)
    return status

def feed_post(di):
     k = random.choice(di.keys())
     d = feedparser.parse(k)
     e = random.randint(0, len(d.entries)-1)
     return post(d.entries[e].title+"\n"+d.entries[e].link+"\n"+di[k])


Be sure to make a twitter account first and get on and setup your app. Allow read and write access and generate your auth keys. Basically, just plugin your api keys, add whatever url you want to parse into the dictionary as a key and add the hashtag keyword as the value. The feed_post() function will assign a random url from the dict to a variable, then feedparser will parse the url and place the elements in a dict. We just need to get random entries from that particular syndicate and return the post with the title, link, and hashtag keywords.




I haven’t slept yet, so bare with me. I’ve decided to give functional programming a try in order to learn more about Haskell and expand my problem solving process. My background is dealing with object oriented and some aspects of imperative programming. Object oriented means that the data and functions are encapsulated and put together to form modules, and those modules are thought of as objects. Imperative programming means that the program’s state changes due to side effects. Side effects are the ‘uncertainty’ of the return type from a function. For instance, a print (or System.out.print) function in python and java, respectively, work because of side effects.

print "tomato"
 -> 'tomato'
print 23
  -> 23

Notice how we use the same print function, but the return types are different. This is due to side effects.

Functional programming is different in that it emphasizes procedures and functions over changes in states and mutability. If you’ve ever done calculus and notice that when you pass a parameter to a function, the return type is always predictable. This is the essence behind functional programming. Haskell takes it a step further and goes into verified logic programming, but I’m still wrapping my head around functional programming, so vlp will be the topic of a later discussion.

I have decided to compare and contrast imperative with functional programming through Python and Scheme (a dialect of Lisp used in the SICP book) to find the approximation of a cube root using the newton-raphson method.

Looking at the source codes below, I’m going to explain how the newton-raphson technique works with my imperative background. First, a best-guess for the cube root of n is entered. In our case, we’ll start with 1.0 because we can always assume that most numbers will have a cube root > 1.0. Then, while the cube approximation minus our inputted cube (n) is greater than or equal to epsilon (our precision checker), the guesses are entered into newton’s function for approximating the square root: ((2*y)+(x/y^2))/3 and the guess keeps getting reassigned until the approximation cubed is within a difference of 0.0001 of the actual cubed number. x will then be returned (our approximate cube root).

def newt_cube(n):
    x = n
    g = 1.0
    eps = 0.0001
    if n == 1:
        return 1
    while abs(x**3 - n) >= eps:
        x = ((2*g))
        g = (x+(n/g**2))/3.0
        x = g
    return x

print newt_cube(1232342)

As you can see, what I did with x = n and then set x = g later on is called destructive update. In a functional programming language, this is usually not allowed.

Observing Scheme:

(define (square x) (* x x))
(define (cube x) (* x x x))

(define (cbrt-iter guess x)
 (if (good-enough? guess x)
     (cbrt (improve guess x)

(define (improve guess x)
 (/ (+ (/ x (square y)) (* 2 y)) 3))

(define (average x y)
 (/ (+ x y) 3))

(define (good-enough? guess x)
 (< (abs (- (cube guess) x)) 0.001))

(define (cbt x)
 (cbrt-iter 1.0 x))

it is noticed that instead of destructive update, the cubed root approximation is found through procedures. Also, notice that instead of using a loop (the while loop in Python above) we just use a procedure called cbrt-iter and successively find the approximatino through a series of procedures. Still, much to learn with functional programming! But I’m tired now, and shall go off and nap.

First Milestone Reached

I’ve reached my first milestone! Today, I’ve completed the mockups for the idea I’ve had.  There are about 40-something pages, in which I’ve completed all of them in a week’s time.  The next steps are: organize them, organize the docs, make changes, and pick features for the beta.  Thank goodness I’ve setup a code repo all ready! A couple of friends (and myself) cannot wait to get started on the programming. 

Previous Post was a Lie

I lied about not making a blog post.  As I was laying down to take a 15 minute nap, my mind traced back to a meeting I had with Dr. Stefanakos, the Director of CERC (Clean Energy Research Center) at USF.  I had described to him my intentions to further research with sustainable technologies and my interests in computer science/engineering.  I had told him I’m an autodidact (self-learner) and most of the skills I’ve acquired are from my own thirst for knowledge.  While I believe I am an effective self-learner, comprehension-wise, I know that the way I approach self-learning is like a shotgun.  I tend to go off on a tangent instead of remaining laser-focus.  The only pro to the way I teach myself in this manner is it allows me to view the information from a different perspective.  I rose the awareness of, let’s call it; ‘tangential-learning’ to Dr. Stefanakos.  The reason why I’m writing this post is that I wish I had told him of my personal beliefs on learning.

Here is my lesson.  To me, nothing is impossible or too difficult.  The majority of people view electrical engineering, computer science, and just about any other science that requires a substantial comprehension of mathematics as being outside the realm of their knowledge/abilities. If they are truly dispassionate about this field, then I will say no more.  However, I have heard people telling me they want to be doctors; they are passionate about wanting to become Doctors and curing people.  A few months go by and their plans have completely changed.  It was either because they did not believe they can accomplish an advanced chemistry or mathematics course. This implies that they’ve already admit defeat, and their learning capabilities are quickly restricted.  To be an effective learner, I truly believe that it takes vision, and a vastly strong will power.  I also believe it is healthy to simplify the field you want to get into.  For instance, the field of electrical engineering in academia is fundamentally the study of the electrons: the flow of electrons and how we can manipulate the flow of electrons. That is basically it.  The mathematics just proves these concepts.  Computer Science can also be stated fundamentally as how we give instructions to computers and the response of the computer to those instructions. Simplifying the subject can turn roadblocks into minor cracks in the pavement. In order to ascend self-doubt, I also believe it is important have a strong vision as to what you want to become/accomplish.  It is painstakingly difficult at first (I am not a master of this method, yet) but once you reach it, you will find that what was once impossible subjects, are now just challenging subjects.  I wish I could go back in time and explain my reasonings to Dr. Stefanakos, in order to receive more of his support.  It is 3:11am and I need to take a quick nap to finish my wireframes.  I just felt like writing my thoughts.

No Update

I have a busy morning ahead of me, so no blog post today.  I have to finish these wireframes for an idea I’ve had stewing for a while.  I’ve completed 27 pages thus far.  I have approximately 4-5 more pages to complete before I meet a designer tomorrow (today) at 11:00 am.  I also have an academic paper on piezoelectricity I have to review by the day’s end.  When I have some spare time, I’ll find something to program for fun and keep you guys posted.


No, not the drug Molly, but a material I’m spending time to do research on: molybdenite…also known as Molybdenum Disulfide (MoS2).  Today, I found out that I will be doing research in the characterization of mono-layer MoS2!  More importantly, I am looking into revolutionary applications (more efficient semiconductors and other ideas I had in mind).  I will continue to post about this exciting development as my discoveries progress.

The importance of MoS2, especially in the semiconductor industry, lies in its bandgap.  Currently, many scientists have been researching the uses of graphene (which does not have a bandgap, essentially making graphene a superconducting material, and not semiconducting).  The reason why having a small bandgap is necessary is because it is what defines a semiconductor.  If the bandgap is too large, then, the material is an insulator (does not conduct electricity).  Although, MoS2 by itself has a pretty wide bandgap, about 1.8 eV (electron volts), and a pretty low electron mobility, it has been discovered that applying a Halfnium Oxide dielectric gate to the discrete device makes the mobility increase 2000 times!  This is similar to graphene applications!

The applications for a highly powerful, low energy device are endless.  We are living in times where it is necessary to remain conscious about our power consumption and wasteful releases (both chemical and atmospheric).  I believe with further research into the applications of MoS2, we will be able to drastically reduce power consumption in the realms of: computing, energy grids, and logistics.  This will help us to hopefully reverse the damages we have done to the environment and to allow the environment to continue in an ecological and natural state.

Strange: 5M334HUPY5TU

5M334HUPY5TU Definitely a strange string of digits and characters.  I’m off to the nanotechnology labs!