Sunday, September 4, 2011

Social networking

Social networking is the grouping of individuals into specific groups, like small rural communities or a neighborhood subdivision, if you will. Although social networking is possible in person, especially in the workplace, universities, and high schools, it is most popular online.

Cloudy combo Google App Engine and Amazon S3 combo pack:

Cloudy combo Google App Engine and Amazon S3 combo pack:

Google App Engine provides you a ready to use environment to build and host web applications. The hosting environment is secure and made highly available by the google’s cloud computing infrastructure.
While GAE provides you such a strong platform to build and host web applications, it has it’s own limitations as well. While Google’s infrastructure gives you abundant computing power but not the  case with storage which you would expect if you are developing web applications which require a large amount of flexible secondary storage as well, for that even the applications requiring moderate amount of secondary storage to store the files.
Coming to the actual point, GAE has a limitation of allowing applications to store not more than 10MB of a single large file on it’s server. This may not be a problem for some of the web applications. This is a serious issue for many web applications which assume sufficiently large underlying storage, given these days secondary storage is available in abundance at cheap rates. Some of the developers and users are shying away from using GAE as a platform for their web application development and hosting only because of this reason. And to make life hard google does not have a paid service either to work around this issue.
What are these web application developers supposed to do? Switch to something else which offers sufficient storage along with computing power. The other better options available are Amazon EC2 and VPS. Give me a break. Why do we want to run away from the problem? Well, look around. Amazing Amazon is there to help you out. We need to think creatively and be selective when making decisions about technology these days. There are a bunch of technologies lying around. It is just a matter of selecting and integrating the two technologies and using them to satisfy needs. I am not trying to promote any specific cloud here, but to highlight the fact that GAE and Amazon S3 work really well. And it turns out to be a cost effective solution.
GAE provides the development and hosting platform for you web applications at free of cost while Amazon S3 provides you reliable, powerful and abundant storage at cheaper rates. GAE and Amazon S3 together can do wonders

Click here to find out more! Why Cloud Computing is the Future of Mobile

The term "cloud computing" is being bandied about a lot these days, mainly in the context of the "future of the web." But cloud computing's potential doesn't begin and end with the personal computer's transformation into a thin client - the mobile platform is going to be heavily impacted by this technology as well. At least that's the analysis being put forth by ABI Research. Their recent report, Mobile Cloud Computing, theorizes that the cloud will soon become a disruptive force in the mobile world, eventually becoming the dominant way in which mobile applications operate.
You may be wondering: what does the term "mobile cloud computing" really mean? Basically, it refers to an infrastructure where both the data storage and the data processing happen outside of the mobile device. Today, there are already some good examples of mobile cloud computing applications including mobile Gmail, Google Maps, and some navigation apps. However, the majority of applications today still do most of the data storage and processing on the mobile devices themselves and not in the cloud. In a few years, that could change.

Why Mobile Cloud Computing?

With a Western-centric view of the world, it can sometimes be hard to remember that not everyone owns a smartphone. There are still a large number of markets worldwide where the dominant phone is a feature phone. While it's true that smartphones will grow in percentage and feature phones will become more sophisticated in time, these lower-end phones are not going away anytime soon. And it's their very existence which will help drive the mobile cloud computing trend.
Not only is there a broader audience using feature phones in the world, there are also more web developers capable of building mobile web applications than there are developers for any other type of mobile device. Those factors, combined with the fact that feature phones themselves are becoming more capable with smarter built-in web browsers (and more alternative browsers available for download), will have an impact on mobile cloud computing's growth.

How Will Mobile Cloud Computing Become a Disruptive Force?

There are two primary reasons why ABI believes cloud computing will become a disruptive force in the mobile world. The first is simply the number of users the technology has the power to reach: far more than the number of smartphone users alone. The second reason has to do with how applications are distributed today. Currently, mobile applications are tied to a carrier. If you want an iPhone app, for example, you have to first have a relationship with the mobile operator who carries the iPhone. If you want a Blackberry app, the same rule applies. But with mobile clouding computing applications, as long as you have access to the web, you have access to the mobile application.

Moves by PaaS Players Could Change Everything

When you think of Plaform-as-a-Service (PaaS), one of the first companies that springs to mind is probably Salesforce. With their Force.com platform, business applications can be built and run "in the cloud." But Salesforce is not the only major PaaS player out there today - Amazon Web Services (AWS) and Google's App Engine are also two platforms that could have a major impact on this trend.
Currently, AWS is used by over half a million developers and Google's App Engine hosts 45,000 applications. Now imagine if those two companies along with Force.com all of a sudden started aggressively marketing their mobile capabilities. Today, neither AWS nor Google offers this, and Salesforce's mobile offering is limited to smartphones (Windows Mobile, Blackberry, and iPhone). But if the companies decided to make building for the mobile web as easy as building for the web, you could have a mobile revolution on your hands.

But People Like Apps!

Saying that "mobile cloud computing" is the future doesn't mean phones will be filled with links to websites that work in any browser instead of special, downloadable applications, some of which you can even purchase. Instead, mobile applications will exist in both formats. As for the downloadable applications themselves, they will still appear to be your typical mobile app - end users won't even notice a difference. However, there will be a difference - it will just be on the back-end. Mobile applications will begin to store your data in the cloud as opposed to on the mobile device, and the applications will become more powerful as processing power is also offloaded to the cloud.
The first mobile apps powered by the cloud will likely be business-focused mobile productivity applications where collaboration, data sharing, multitasking, and scheduling are key factors. For consumers, though, navigation and mapping applications will be the most obvious examples of the trend. Plus, there are some specialty applications today which already function as mobile cloud apps - for example, Schlage offers a remote keyless entry system which lets you mobilely control your home from a distance. You can let someone into your house, manage your lights, your thermostat, your camera system, etc. There are also a few applications in the iPhone app store that let you remotely manage your PC and your DVR, too.

Potential Problems

Of course, there are some potential issues that could be barriers to this shift in mobile computing. The most notable problem is the lack of speedy mobile Internet access everywhere. Here in the US, for example, 3G coverage is spotty outside urban areas, leading to intermittent connection issues and slow speeds. Other markets may have it even worse.
However, new technologies like HTML5, which does local caching, could help mobile cloud apps get past those sorts of issues. And there's even a chance that the browser could one day be replaced - at least in some markets - with another technology altogether which provides a better way to access the mobile web. ABI Research mentions initiatives like OMA's Smartcard Web Server, essentially a souped-up SIM card that connects directly with the carrier to push applications to mobile phones. There's also TokTok, a technology that allows access to web services like Gmail and Google Calendar by voice. With voice-enabled search like this, mobile apps could talk directly to the service itself which sits on the edge of the network, as opposed to needing the user to launch a web browser and navigate through the mobile web.

When Will Mobile Cloud Computing Really Take Off?

According to ABI, this change is only a few years away. By 2010, we'll see one or all of the major PaaS players marketing their mobile capabilities, they say. But first, API standards from open-source mobile collaboration group BONDI will go into effect. Later, in 2011, we'll see more of HTML5, and the OneAPI standard will come into play. (OneAPI involves standardized apps for networks allowing developers to consistently access parts of network providers' capabilities, such as location services). All these factors combined will help drive the move to the cloud.
The changes will occur with differing speeds depending on the market. Markets with higher Internet participation will obviously lead the way, as will markets with higher subscriber penetration. That includes Western Europe, North America, and parts of Asia. Other markets will then follow. By 2014, mobile cloud computing will become the predominant application development strategy. By that time, our PCs will be more like thin client devices than they are today, and now it seems our phones will too.
from  http://www.readwriteweb.com/archives/why_cloud_computing_is_the_future_of_mobile.php

Saturday, May 14, 2011

10、OpenGL中的帧缓冲

1、颜色缓冲区
通常用于绘图的缓冲区,包含了颜色索引或RGB颜色数据,还可能包含了alpha数据。如果opengl系统支持立体图,则有左右两个缓冲区。双缓冲系统提供了前后缓冲区。每个opengl实现都必须提供一个前左缓冲区。
2、深度缓冲
Z-BUFFER,保存每个像素的深度值,用于保存像素Z方向的数值。深度通常是根据物体和观察点的距离来测量的,较大深度值的像素可能会被较小深度值的像素所覆盖。但这只是一种约定,可以改变这种行为。
3、模板缓冲区
把绘图限制在屏幕中的某个区域,就像用纸板和喷漆实现精确的绘图一样。用于保持屏幕上某些位置图形不变,而其他部分重绘。例如模拟驾驶的程序,可以只绘制车内的仪表和其他物体1,当汽车开动时,只有车窗外的场景需要更新。
4累积缓存
只保存RGBA数据,用于合成图像累积缓冲区通常用于把一系列的图像合成为一副图像。通过这种方法,可以对图像进行超量采样,然后对样本求平均值,并将结果写入到颜色缓冲区中,从何实现场景的抗锯齿处理。我们不能把数据直接写入到累积缓冲区,累积操作总是以进行快块为单位idui数据进行操作,通常是把数据移入或移出颜色缓冲区。
指定清除值:
void glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
void glClearIndex( GLfloat index );
void glClearDepth( GLclampf depth );
void glClearStencil( GLint s );
void glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
GLclampf/d 经过截取的GLfloatGLdouble都限定在0.01.0的范围之内。默认的深度缓冲区清楚值是1.0(表示与观察点尽可能远的距离),其他所有缓冲区的清除值都是0.0然后进行清除:
void glClear(GLbitfield mask);
mask: GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_ACCUM_BUFFER_BIT

9、二次曲面的绘制

首先定义一个GLUquadricObj对象;
其次创建一个曲面对象gluNewQuadric;
再次设置二次曲面的特性(gluQuadricDrawStyle, gluQuadricTexture)
绘制二次曲面(gluCylinder,gluSphere,gluDisk, gluPartialDisk)
关于二次曲面的过程
gluNewQuadric 创建一个新的二次曲面对象
gluDeleteQuadric 删除一个二次曲面对象
gluQuadricDrawStyle 指定要绘制的二次曲面类型
gluQuadricNormal 设置二次曲面的法矢量
gluQuadricOrientation 设置二次曲面是内旋还是外旋转
gluQuadricTexture 设置二次曲面是否使用纹理
二次方程对象 gluQuadricObj
Ax2+BY2+CZ2+DXY+EXZ+FYZ+GX+HY+IZ+J=0
圆柱
gluCylinder( GLUquadricObj qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint
slices, GLint stacks )
qobj指定一个二次曲面,baseRadius为所绘制圆柱的底半径,topRadius为所绘制圆柱的上顶面半径,height为圆柱的
高,slices为绕Z轴的分割线数,stacks为沿Z轴的分割线数。
圆环
gluDisk(qobj:GLUquadricObj,innerRadius:GLdouble,outerRadius:GLdouble,slices:GLint,
loops:GLint);
半圆环
gluPartialDisk(qobj:GLUquadricObj,innerRadius:GLdouble,outerRadius:GLdouble,slices:GLint,
loops:GLint,startAngle:GLdouble,sweepAngle:GLdouble);
startAngle,sweepAngle是半圆环的起始角与终止角
球体
function gluSphere(qObj:GLUquadricObj,radius:GLdouble,slices:GLint,stacks:GLint);

8、Opengl动画(编程指南有详细的解释)

动画:通过快速的吧看似连续的画面一幅幅的呈现在人们面前,一旦每秒钟的画面超过24幅,人们就会错以为它是连续的。
假设某动画一共有n副图片,则它的工作步骤是:
显示第1幅图片,然后等待一小段时间,直到下一个1/24
显示第2幅图片,然后等待一小段时间,直到下一个1/24
……
显示第n幅图片,然后等待一小段时间,直到下一个1/24
结束
如果用C语言伪代码来描述这一过程,就是:
for( i=0; i<n; i++ )
{
     DrawScene( i );
     Wait();
}
双缓冲技术
实际的动画是先画好了,播放的时候直接拿出来现世就行,但计算机动画则是画一张,就拿出来一张,再画下一张,再拿出来。如果所绘制的图形简单,那么这样也没什么问题。但一旦图形比较复杂,绘制所需要的时间较长,问题就会变得突出。让我们把计算机想象成一个画图比较快的人,假如他直接在屏幕上画图,而图形比较复杂,则有可能在他只画了某幅图的一半的时候就被观众看到。而后面虽然他把画补全了,但观众的眼睛却又没有反应过来,还停留在原来那个残缺的画面上。也就是说,有时候观众看到完整的图象,有时却又只看到残缺的图象,这样就造成了屏幕的闪烁。
如何解决这一问题呢?我们设想有两块画板,画图的人在旁边画,画好以后把他手里的画板与挂在屏幕上的画板相交换。这样以来,观众就不会看到残缺的画了。这一技术被应用到计算机图形中,称为双缓冲技术。即:在存储器(很有可能是显存)中开辟两块区域,一块作为发送到显示器的数据,一块作为绘画的区域,在适当的时候交换它们。由于交换两块内存区域实际上只需要交换两个指针,这一方法效率非常高,所以被广泛的采用。
要启动双缓冲功能,最简单的办法就是使用GLUT工具包。我们以前在main函数里面写:
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
其中GLUT_SINGLE表示单缓冲,如果改成GLUT_DOUBLE就是双缓冲了。
当然还有需要更改的地方——每次绘制完成时,我们需要交换两个缓冲区,把绘制好的信息用于屏幕显示(否则无论怎么绘制,还是什么都看不到)。如果使用GLUT工具包,也可以很轻松的完成这一工作,只要在绘制完成时简单的调用glutSwapBuffers函数就可以了

7、Opengl中模型视图 投影 视口

opengl中不设置模型,投影,视口,所绘制的几何图形的坐标只能是-11(X轴向右,Y轴向上,Z轴垂直屏幕)
产生目标场景的过程类似于用照相机进行拍照:
(1)把照相机固定在三角架上,并让他对准场景
   从不同位置观察场景(视图变换)
(2)对场景进行安排,使各个物体在照片中的位置是我们所希望的
   移动,旋转或者放大缩小场景中的物体(模型变换)
(3)选择照相机镜头,并调整放大倍数(调焦)
   显示物体时,可以选择物体是如何投影到屏幕上(投影变换)
(4)确定照片的大小,放大照片还是缩小照片
   把图形画下来,是要占据整个屏幕还是屏幕的一部分(视口变换)
三大变换:(都是通过操作矩阵来实现的)
1、模型视图变换
在进行模型视图变换之前,应先设置当前操作的矩阵为"模型视图矩阵",通过设置glMatrixMode( GL_MODELVIEW ),在进行变换
之前把当前矩阵设置为单位矩阵glLoadIdentity();如果不进行单位化,所有的后续操作都是在当前矩阵的前提下进行的。
2、投影变换
投影变换即定义一个可视空间,可视空间以外的物体不会被绘制到屏幕上(从现在起,坐标不在是-1.01.0)
opengl支持两种投影,透视投影和正投影,通过设置glMatrixMode( GL_PROJECTION )来操作投影矩阵。
透视投影的主要函数
1glFrustum()
2glPerspective( GLdouble fovy, GLdouble aspect, GLdouble near, GLdouble far)
创建一个表示对称透视视图平截头体的矩阵,并把它与当前矩阵相乘。fovyYZ平面上视野的角度,范围【0180】。aspect是这个平截头体的纵横比,也就是宽度除于高度。nearfar值分片是观察点与近侧裁剪平面以及远侧裁剪平面的距离(沿Z轴负方向)这两个值都是正的。
正投影的主要函数
1glOrtho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
创建一个表示正交平行视景体,并把它与当前矩阵相乘。
2glOrtho2D( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top)
创建一个表示把二维坐标投影到屏幕上的矩阵,并把当前矩阵与它相乘,裁剪区域为矩形。
把像素绘制到屏幕上glViewport()定义视口,前两个参数最左下方,后两个参数宽度和高度。
3、视口变换
在窗口中定义一个像素矩形,最终的图像将映射到这个矩形中。
glViewport( Glint x, Glint y, GLsizei width, GLsizei height );XY指定了视口的左下角,WH指定了视口的高度和宽度。在默认情况下,视口的初始值是(0,0,winwidth,winheight)
视口的纵横比一般和视景体的纵横比相同。当窗口的大小发生变化时,并不会自动影响视口,应用程序应该检测窗口大小改变事件。