tisdag 29 november 2011

How to print out last accessed files?

Using find command in *nix:


find mydirectory/etc -atime n
Where  n can be one of the following:
+7 = more than 7 days ago
2 = between 2 and 3 days ago
-2 = within the past 2 days
+1 = more than 1 day old
1 = between 1 and 2 days ago
-1 = within the past 1 day
0 = within the past 1 day



Push technologies - Comet server

CometD is based on Ajax Push technology pattern known as Comet. Alex Russel first mentioned about this in his post Comet: Low Latency Data for the Browser
 There are today a list of Comet frameworks or implementations that we can use:
  1. http://www.stream-hub.com - There is a free community edition. But I think this is better to invest time and money in a fully open source framework.
  2. http://www.frozenmountain.com/websync/ -commercial. Not to recommend. You won't want to invest money and time in a framwork that you do not know how long they will last.
  3. http://orbited.org - seems good. Worth to give a try.
  4. https://github.com/Atmosphere/atmosphere - Seems far better than frameworks. This supports sramework like Jersey, GWT, Wicket, Vaadin, Guice, Spring, JSF, Scalatra, Grails etc. You can use Scala, JRuby, Groovy and Java to write Atmosphere application. Mssive scalability with our Cluster plugin architecture (JGroups, JMS/ActiveMQ, Redis, XMPP, etc.) without paying one pence for it!
  5. http://cometd.org/ - CometD Project of The Dojo Foundation. An implementation of Bayeux Protocol 

Push technologies - Comet server

CometD is based on Ajax Push technology pattern known as Comet. Alex Russel first mentioned about this in his post Comet: Low Latency Data for the Browser
 There are today a list of Comet frameworks or implementations that we can use:
  1. http://www.stream-hub.com - There is a free community edition. But I think this is better to invest time and money in a fully open source framework.
  2. http://www.frozenmountain.com/websync/ -commercial. Not to recommend. You won't want to invest money and time in a framwork that you do not know how long they will last.
  3. http://orbited.org - seems good. Worth to give a try.
  4. https://github.com/Atmosphere/atmosphere - Seems far better than frameworks. This supports sramework like Jersey, GWT, Wicket, Vaadin, Guice, Spring, JSF, Scalatra, Grails etc. You can use Scala, JRuby, Groovy and Java to write Atmosphere application. Mssive scalability with our Cluster plugin architecture (JGroups, JMS/ActiveMQ, Redis, XMPP, etc.) without paying one pence for it!
  5. http://cometd.org/ - CometD Project of The Dojo Foundation. An implementation of Bayeux Protocol 

torsdag 24 november 2011

The Share-Nothing Architecture

 Share-Nothing Architecture that scale well. Sessions are shared through file system or database, which are scalable using a networked file system like NFS or SMB or in a database. Using this architecture you can have many copies of this to scale the application to meet increasing demands from users. database server might became bottleneck, however databases usually scale well. If you have money Oracle can scale very well. MySQL may scale well in some circumstances.
Share-Nothing architecture mentioned first by Rasmus Lerdorf, one of the initiator of PHP. PHP has this by default unless you explicitly change it which is not recommended if you want to have a scalable PHP-application.

http://www.playframework.org is a stateless MVC architecture that can be deployed anywhere (application server, Google App Engine, Cloud, etc…).

Javascript Libraries or Frameworks?

With the exception of Dojo/YUI most of Javascripts are libraries, not frameworks. Frameworks involve a little more (architecture + development tools).

For a comparison of different Javascript libraries/framworks, 

MooTools 1.2
MooTools 1.3.1
JQuery 1.5.1
Prototype 1.7
YUI 2.8.2 Selector

onsdag 23 november 2011

Google Webstore

When I today visit the Google webstore I can only see as follows in their browser i.e. Chrome !

Ah, Google, you have a long way to go to get all people into your webstore. Take a look at what Microsoft and Apple store do.

Google Webstore

When I today visit the Google webstore I can only see as follows in their browser i.e. Chrome !

Ah, Google, you have a long way to go to get all people into your webstore. Take a look at what Microsoft and Apple store do.

Dynamic textures or dynamic vertex data (skinning / particles)

In OpenGL dynamic textures is like video on object surface and dynamic vertex data  is using for skinning / particles. If you consider using these in NaticeClient use CHROMIUM_map_sub.

Programming the web with Native Client instead of Javascript

Why use NaCl ?
  • Direct CPU and GPU access. Good for games, for example openframes.cc
You can use Google Chrome Frame if you want to use full Web technologies in Explorer.

Resources

söndag 20 november 2011

Which Javascript framework to choose?

Do you have a hard time to choose one of many Javascript frameworks? JQuery? Processingjs? Mojo?
Before you start you can test and play with all these libraries in one place at:
http://jsfiddle.net
Choose which framework you like and test it if this meet your rqeuirement for your web application.

Problem : dynamic function name in MQ4

I have the following example:

if ( expertname == "MFI" && version == "1.0.0.4" ) {
      //Print(" mfi4_0_0_0_0 is entering",expertname, version);
      mfi1_0_0_4(magicnr, istf);
      return;
   }

With this method I have to create for each new version each new if-block. Are there some simple way to create "dynamic function name" so that when I create a new version, I do not need create a new if-block?

Dynamic function name

string s1 = "The"; string s2 = "Method"; 
string methodName = s1 + s2;  // methodName now holds "TheMethod"

Checkout more in this.

What is Closure?

Sometimes it os hard to understand Closure concept for main-stream programmers:
  • a closure is the local variables for a function - keeps alive after the function has returned, or
  • a closure is a stack-frame which is not deallocated when the function returns. This is like this is malloc:ed in C language, not being handles as stack.

fredag 18 november 2011

Good, practical books to get started designing electronics yourself

Good, practical books to get started designing yourself:

The Art of Electronics by Horowitz and Hill.
Good for studying or looking things up, full of examples on how-to (and how-not-to 8-), not overly theoretical, complete and thorough, aimed at designing rather than analysis. The best general-purpose book on the subject I have found so far, and fun to read too.

"Crash Course in Electronics Technology" by Louis E. Frenzel, Jr.

What it says: a crash course in the basic theory of electronics using programmed instruction, a good book to learn the basics quickly. My copy is quite old and from Sams publishers, I don't know if the book has changed much since.


"Microelectronics" by Millman and Grabel.
Thorough explanations, practical, plenty of examples, but not for beginners. This is for designer of electronics whom do it for a living

Free Video composition

Free Wax is a free and high performance and flexible video compositing and special effects software. The idea for Wax is to be very general purpose and flexible in video compositing and effects, so that you can compose your dream video sequence with ease everytime.

Wax can create 2D & 3D special effects and can work in two modes - as a standalone application which would appeal for home users/beginners, and as a "plug-in" to video editors/NLEs which would be more useful for professional editors. Currently Wax can work as a plug-in with Sony Vegas®, Pure Motion EditStudio and Adobe Premiere® and work for integrating with various other NLEs is in progress.

tisdag 15 november 2011

Backup your disk NOW !

Before this is too late, backup your copy of Disk with free open source products Clonezilla Live is a small bootable GNU/Linux distribution for x86/amd64 (x86-64) based computers.

Home theater PC

You can easily set up Home Theater by yourself using XBMC.
XBMC is an award-winning free and open source (GPL) software media player and entertainment hub for digital media. XBMC is available for Linux, OSX, and Windows. With XBMC you can have any look you want however Confluence is used by default,as a greet screen you finish your install.

Is it possible to customize Android Screen?

The answer is yes, here is how to do :
http://www.pcworld.com/article/190257/customize_your_android_phone.html

Or Google at "customize android" and you will have pretty of how-to.
This is possible with widgets. Each home-screen panel can hold any combination of widgets, shortcuts, and folders. You can play around with different setups until you find the configuration that works best for you.


Customizing the LED Light/Flash
Most Android handsets have an LED indicator. By default, the LED usually flashes different colors to alert you to a missed call, to new e-mail, or to a new text message. But you can make the indicator do much more.
Expand your phone's notification functionality with Missed Call, a free app available in the Android Market. Missed Call harnesses the power of your handset's LED, letting you set the light to flash certain colors when specific events happen. You could, for instance, program it to flash orange when you miss a call from your boss and purple when you miss a call from your spouse; you could even set flashing LED colors to alert you to pending calendar events and other customizable circumstances.

måndag 14 november 2011

Web scraper Java ibrary

If you want to get part of the information from any web site, Jsoup is one. For lower level handling, you can use HttpBuilder. This is probably implemented in Groovy.

How to create favicon?

Just use the favicon generator in the following site and upload your picture of choice from your local computer and download and upload to your web server. This could not be more simpler than this.
You can convert between ICO and PNG online using this site.

Multiple Terminals in one Terminal Window in Windows XP/7?

If you are using Putty or Cygwin in Windows, you surely want to use something like Terminator in Linux. You should be able to have multiple terminal open and work direktly. The question is if there is one from Open Source community that we can use ?
There is commercial SecureCRT that allow you to have a tabbed interfac. But what anyone does not know is this is possible to have tabbed interface in Putty. Here is the list of tools avaialble to enable a tabbed intarface to Putty:
  1. Superputty  - what I do not like with this is this require .NET Framework 2.0 or newer as this is written in C#. This is OK if this works properly but you have too keep track of which version of .Net is installed and will not work immediately if you have wrong .Net version.
  2. Kitty - is like Extended Putty with anything you know about Putty.
Which one is best? This is up to your choice.

torsdag 10 november 2011

Depth camera

If you are looking for depth camera for motion sensor the following list will gather all possible specially low cost depth camera:
  • Mesa Imageing Swissranger 4000 (SR4000) , probably teh most well-known and expensive. Costs around $9000. Only laboratories buy it, nothing of choice for home developer.
  • Kinect from Microsoft
  • PrimeSence products that can be sold via Asus/Intel. 
  • D-Imager
There are a lot of open souces software that alraedy exist that can work with Kinect (openkinect.org), PeimeSence (opnni.org).So if you consider seriously developing low cost Interactive applications , conside it.

Kinect is XBOX compatible and there is no guarantee that this will work with your PC without some efforts. However there are great help to get at openkinect.org, I have not tried it. Openkinect.org is an attempt to make it compatibe with your PC, however there are other option if you want to develop immediately instead of trying to make any efforts to workaround with Kinect. Asus offer a kit that is compatible with your PC and you can sell Your Creation on asus@vibe that will be available at 

Sell Your Creation on asus@vibe. Once you've developed your application, sell it on asus@vibe online entertainment content store and make some money!


3 ways to solve Invalid cursor state (SQL -24000)

Today I got the following failure of execution in my perl script:


[Thu Nov 10 09:10:00 2011] [error] [client 192.168.136.176] DBD::ODBC::st execute failed: [FreeTDS][SQL Server]Invalid cursor state (SQL
-24000)(DBD: st_execute/SQLExecute err=-1)

Checking the version of  DBI:
$perl -le 'eval "require $ARGV[0]" and print ${"$ARGV[0]::VERSION"}' DBI

1.14
The latest DBI version is :
1.58

This issue because I use an older version of DBI that has not be uppgraded tio the newer that can handle MAS (Multiple Active Statement)

FreeTDS does not support Multiple active statements . You have to find a workaround If we still want to use our old DBD::ODBC. Solution number one is to use disconnect/reconnect or the second solution is to use one selection for all information.The third is to sett the cursor type to 2 which have to be set on connect call. You can find more workarounds in this link  Multiple Active Statement (MAS) and DBD::ODBC.