Sunday, May 29, 2011

Webkit based WebBrowser written in #Mono (C#) + #Firebird Step 2

I have used the funny browser as base for my project

In short i have added in this step main menu (just for example , today browsers don't use a main menu anymore look at google chrome)

For adding the menu items i have found this tutorial
Also the code is hosted in github at this address
https://github.com/mariuz/monobrowser/

ps: it's not a good idea to jump to mono 2.10 yet from debian experimental
I had to remove and reinstall mono 2.6.x and perl just to make it work again

Mono 2.10.x with support for IronPython landed in Debian experimental

I was excited to install a stable IronPython on my Debian sid box , fortunately there is the option to have the Mono 2.10 packages from experimental that contains also support for IronPython

Webkit based WebBrowser written in #Mono (C#) + #Firebird Step 1

I will start with this simple example


Install monodevelop and the mono.webkit (aka webkit-sharp)

sudo apt-get install gtk-sharp2 libwebkit1.1-cil monodevelop

start monodevelop new gtk c# project (copy paste the code from above to match your app main class and namespace my are: coolbrowser,monobrowser)

But i didn't found in the list of installed assemblies
so i use my rusty admin skills and install from git and from webkit-sharp source

git clone https://github.com/mono/webkit-sharp.git

it didn't found the webkit dev libs and the mcs so

sudo apt-get install libwebkit-cil-dev libwebkit-dev
sudo ln -s /usr/bin/gmcs /usr/bin/mcs

./autogen.sh --prefix=/usr
sudo make install

add webkit references to the project


here is the code


I have added the default size to be 800x600

Friday, May 20, 2011

Remote host debugging on android x86

There is a pretty cool way to debug android applications on an android x86 host
when you don't have usb connection between your workstation and the the device (in my case the netbook)

Here is described how can be done
And here is my screenshot with my Eclipse session debugging one remote app (you can even put breakpoints and is quite fast at deploying the app)


Here is the remote breakpoint example



What is next class ? nacl native apps for x86 at last
and maybe qt debugging on the device

Thursday, May 19, 2011

Why should you avoid eucalyptus and mysql too - Open scamware


But Eucalyptus has its own burden to carry. Eucalyptus might be open-source, but it uses something called an open-core model. Translated: There's a free community edition of Eucalyptus for everybody, but more advanced features beyond the basic stuff only go to paying customers.
This is exactly the model Mickos employed at MySQL, and it upset people then too.

http://www.theregister.co.uk/2011/05/19/marten_mickos_a_year_on/page2.html

WebGL around the net

The 3body rendering is looking better and better Thanks for the update now i can run webgl on open source drivers :) both in chromium and google-chrome

Also the google-chrome –ignore-gpu-blacklist really rocks
chromium-browser –ignore-gpu-blacklist
I use nouveau and radeon open source drivers and they are really capable of rendering simple levels from quake3 in webgl

So i keep webgl enabled on all opensource drivers … even on intel ones

What to add in the next update ? Hellknight demo works again

http://blog.tojicode.com/2011/04/hellknight-demo-works-again.html


WebGL Starter Package

http://blog.tojicode.com/2011/04/webgl-starter-package.html


Quake3 , Doom3 demos updated to use requestAnimationFrame

http://blog.tojicode.com/2011/04/requestanimationframe.html



Advanced WebGL – Part 1 & 2 & 3

http://codeflow.org/entries/2011/apr/11/advanced-webgl-part-1/

http://codeflow.org/entries/2011/apr/13/advanced-webgl-part-2-sky-rendering/

http://codeflow.org/entries/2011/apr/18/advanced-webgl-part-3-irradiance-environment-map/


WebGL Capabilities Analyzed

http://codeflow.org/entries/2011/apr/16/webgl-capabilities-analyzed/


ps:For me the above demos didn’t worked on radeon open source driver

lshw -C video

description: VGA compatible controller

product: RV710 [Radeon HD 4350]

The revenge of the RISC - Arm Killing the Wintel Legacy

You know Microsoft learned the hard way a little lesson of history
They had nt ported on diverse cpus : Alpha , Mips , and x86(32 bits) after that
they went full duopoly with Intel (do you remember the Wintel motto) and killed Alpha (the cpu and the port) , Mips support
Mips in a way is too close to arm architecture
in fact i wonder why it didn't displaced Arm ?

Otellini compared Android's current state with Microsoft in the past, which ran on platforms such as DEC's Alpha, IBM's PowerPC, ARM, and MIPS "before settling predominantly on Intel's x86 architecture,"

(I guess Intel really hopes to be the dominant marchitecture for the Androids)



So they went in bed with Intel and thought Duopoly would last forever
but it didn't went that well because there is a new monopoly Arm + Android Linux and Windows doesn't have anything to do on it
yes they will try and fail again with Window8 , why fail ? because all the backward compatible features are lost that means all the windows software (written for 32 bit x86 ) it belongs to ... wine or linux emulators (something like qemu).
On Windows + ARM all your beloved spyware will not work.

"Microsoft's move to put Windows on ARM processors will result in a fragmented set of four environments, none of which will run legacy PC Windows apps, said Intel executive"

That is the best way to shoot yourself in the foot Epic way

http://www.theregister.co.uk/2011/05/18/james_on_arm_and_windows/

The lesson , keep your os and applications ported to multiple cpus don't lock yourself to only one vendor like Microsoft , A good example is how linux did it and like Debian is doing with it's ports

creating firebird/flamerobin incomplete project for qtcreator

One way is to generate using the script from haiku create_project_files.pl

This simple script traverses the firebird/flamerobin sources and creates (incomplete) *.pro files in order to make the project sources available within the qt-creator IDE. Additionally, it will add those files to svn:ignore of their parent directory

run it in the firebird/flamerobin source directory
cd firebird_trunk
or
cd flamerobin

perl ../create_project_files.pl .

it will create haiku.pro , name can be changed later
qtcreator haiku.pro
and you can write c++ code with a cool ide with very good svn integration

For flameobin i have added the wx include files so the wx headers can be parsed by the ide

INCLUDEPATH += /usr/lib/wx/include/gtk2-unicode-release-2.8
INCLUDEPATH += /usr/include/wx-2.8

It would be nice to have a bakefile2qmake
or at least an Makefile importer in qtcreator
then if debugging will work from within the ide i will call it complete c++ ide for firebird, flamerobin :)

Sunday, May 15, 2011

firebird benchmark test suite from svn trunk

svn co https://firebird.svn.sourceforge.net/svnroot/firebird/qa/trunk/benchmark firebird_benchmark

create empty db with flamerobin
in
/tmp/firebird_benchmark.fdb

or use this python script
cat create_test.py 
import kinterbasdb

con = kinterbasdb.create_database(
    "create database '/tmp/firebird_benchmark.fdb' user 'sysdba' password 'masterkey'"
  )
The run the test suite

cd firebird_benchmark
python iibench.py --db_password=masterke --max_rows=500000 \
--rows_per_report=10000 \
--setup --max_table_rows=20000 --with_max_table_rows --db_name=/tmp/firebird_benchmark.fdb

Tip: url rewrite in docuwiki

if you want nice urls in dokuwiki http://example.com/dokuwiki/ (no .php ending in urls) then in conf/dokuwiki.php
you need to enable nice rewriting for .htaccess and useslash

$conf['userewrite']  = 1;                //this makes nice URLs: 0: off 1: .htaccess 2: internal
$conf['useslash']    = 1;  

also in .htaccess uncomment the related lines about rewrite rules
## Uncomment these rules if you want to have nice URLs using
## $conf['userewrite'] = 1 - not needed for rewrite mode 2
RewriteEngine on
#
## Not all installations will require the following line.  If you do, 
## change "/dokuwiki" to the path to your dokuwiki directory relative
## to your document root.
RewriteBase /dokuwiki

#
RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&id=$2  [QSA,L]
RewriteRule ^$                        doku.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
RewriteRule ^index.php$               doku.php


Wednesday, May 11, 2011

using apitrace to trace opengl api in !debian / !ubuntu

More about api trace here https://github.com/apitrace/apitrace
git clone https://github.com/apitrace/apitrace.git
cd apitrace
leafpad README &

It needs cmake, qt , qjson:
apt-get install cmake libqjson-dev libqt4-dev

cmake -H. -Bbuild
make -C build
LD_PRELOAD=build/glxtrace.so glxgears
build/tracedump glxgears | less -R


The logs are pretty detailed :)

you can use the nice build/qapitrace that does have opengl.org help links for the functions traced






0 glXChooseVisual(dpy = 0x1749010, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, GLX_USE_GL, GLX_GREEN_SIZE, GLX_USE_GL, GLX_BLUE_SIZE, GLX_USE_GL, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, GLX_
USE_GL, 0}) = &{visual = 0x1754b40, visualid = 297, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
1 glXCreateContext(dpy = 0x1749010, vis = &{visual = 0x1754b40, visualid = 297, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size =
 256, bits_per_rgb = 8}, shareList = NULL, direct = True) = 0x17b2b00
2 glXMakeCurrent(dpy = 0x1749010, drawable = 41943042, ctx = 0x17b2b00) = True
3 glXQueryExtensionsString(dpy = 0x1749010, screen = 0) = "GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_copy_sub_buf
fer GLX_MESA_swap_control GLX_OML_swap_method GLX_OML_sync_control GLX_SGI_make_current_read GLX_SGI_swap_control GLX_SGI_video_sync GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_pbuffer G
LX_SGIX_visual_select_group GLX_EXT_texture_from_pixmap GLX_INTEL_swap_event "
4 glXQueryExtensionsString(dpy = 0x1749010, screen = 0) = "GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_copy_sub_buf
fer GLX_MESA_swap_control GLX_OML_swap_method GLX_OML_sync_control GLX_SGI_make_current_read GLX_SGI_swap_control GLX_SGI_video_sync GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_pbuffer G
LX_SGIX_visual_select_group GLX_EXT_texture_from_pixmap GLX_INTEL_swap_event "
5 glXGetProcAddressARB(procName = "glXGetSwapIntervalMESA") = 0x7f4c952c53e0
6 glLightfv(light = GL_LIGHT0, pname = GL_POSITION, params = {5, 5, 10, 0})
7 glEnable(cap = GL_CULL_FACE)
8 glEnable(cap = GL_LIGHTING)
9 glEnable(cap = GL_LIGHT0)
10 glEnable(cap = GL_DEPTH_TEST)
11 glGenLists(range = 1) = 1
12 glNewList(list = 1, mode = GL_COMPILE)
13 glMaterialfv(face = GL_FRONT, pname = GL_AMBIENT_AND_DIFFUSE, params = {0.8, 0.1, 0, 1})
14 glShadeModel(mode = GL_FLAT)
15 glNormal3f(nx = 0, ny = 0, nz = 1)
16 glBegin(mode = GL_QUAD_STRIP)
17 glVertex3f(x = 1, y = 0, z = 0.5)
18 glVertex3f(x = 3.65, y = 0, z = 0.5)
19 glVertex3f(x = 1, y = 0, z = 0.5)
20 glVertex3f(x = 3.54915, y = 0.852076, z = 0.5)
21 glVertex3f(x = 0.951057, y = 0.309017, z = 0.5)
22 glVertex3f(x = 3.47136, y = 1.12791, z = 0.5)


Thursday, May 05, 2011

Android x86 and grub2 - peace at last


I found a way to add android to the grub2 menu from debian on my eeepc laptop and on my debian/ubuntu workstations
Thanks for this page http://www.ceh-photo.de/blog/?p=357 I have downloaded the latest nightly for
eeepc http://android-x86.moonman.dk/
downloaded and created a usb disk
http://android-x86.moonman.dk/files/eeepc/eeepc-20110505_usb.img
dd if=eeepc-20110505_usb.img of=/dev/sdb
or if you use generic
dd if=eeepc-20110505_usb.img of=/dev/sdb
booted installed (without the grub installation option)
added android to the grub2 menu (debian sid, it should work on natty
too) and all worked without issues after that 




for me the system dir was /android-2011-02-xx and the
androidboot_hardware=eeepc
or if you run a genric pc
androidboot_hardware=generic_x86
please verify your dirs and mount your android partition to check the
dir name before running update-grub
mount /dev/sdb4 /mnt
ls /mnt/
android-2011-02-20  lost+found
Here is the full custom grub

And don't forget to update the grub2 config
update-grub



ps: now i should create a fake sdcard so applications can be installed

Wednesday, May 04, 2011

opengl context in lazarus ubuntu debian

Lazarus includes a TOpenGLControl - a LCL control with an OpenGL context. The lazarus package LazOpenGLContext can be found in /usr/local/share/lazarus/components/opengl/lazopenglcontext.lpk. An example can be found in /usr/local/share/lazarus/components/opengl/examples/testopenglcontext1.lpr
From the menu install the context package
Package -> open package and browse to
lazopenglcontext.lpk
in /usr/local/share/lazarus/components/opengl/
press install and then lazarus will be restarted after finish and you will have a
copy the example project from
/usr/local/share/lazarus/components/opengl/example
into a local dir
mkdir lazarus_opengl
cd lazarus_opengl
cp -rp /usr/local/share/lazarus/components/opengl/example .
open the project
openglcontext1.lpr and press run from the menu

you will have a nice spinning cube :)
what is next continue with nehe tutorials , lazarus ones
There are full complete headers up to opengl 4.1
So the sky is the limit