Thursday, January 29, 2015

multiple feed in one website using Google API for dynamic rss links

multiple feed in one website using Google API for dynamic rss links

   
    google.load("feeds", "1");

    function initialize() {
      var feedUrl="http://timesofindia.feedsportal.com/c/33039/f/533965/index.rss";
      var feed = new google.feeds.Feed(feedUrl);
      var rssoutput="";
      feed.setNumEntries(3);
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("feed1");
          rssoutput+="
\
";
          for (var i = 0; i < result.feed.entries.length; i++) {
            var entry = result.feed.entries[i];
            rssoutput+="
"
          }
        }
      });
      var feedUrl="http://www.thehindu.com/?service=rss";
      var feed = new google.feeds.Feed(feedUrl);
      feed.setNumEntries(2);
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("feed");
          rssoutput+="

\

";
          for (var i = 0; i < result.feed.entries.length; i++) {
            var entry = result.feed.entries[i];
            rssoutput+="
"
          
          }
          container.innerHTML=rssoutput
        }
      });
    }
    google.setOnLoadCallback(initialize);
 

Monday, January 26, 2015


Facts and figures regarding Bihar  




Area - 94,164 km² (36,357 sq mi)
Capital - Patna
Largest city - Patna
Districts - 38
Population
Density 82,878,796 (3rd) 880 /km² (2,279 /sq mi)
Languages - Hindi, Urdu, Angika, Bhojpuri, Magahi, Maithili
Time zone - IST (UTC+5:30)
Established - 1912
ISO abbreviation - IN-BR


 Rivers: Ganga, Son, Bagmati, Kosi, Budhi Gandak, Chandan, Orhani and Falgu.

                                                    Source: Census of India 2011


Cuisine
Staple food: bhat (rice), dal (lentils), roti (wheat flour), tarkari (vegetables) and achar (pickle), Khichdi.                                                         
Special dish:
  • Litti-chokha: Litti is made up of sattu and chokha is of smashed potato, tomato, and brinjal.
  • Chitba and Pitthow which are prepared basically from rice.
  • Tilba and Chewda 



Sweet delicacies : Anarasa, Belgrami, Chena Murki, Motichoor ka Ladoo, Kala Jamun, Kesaria Peda, Khaja, Khurma, Khubi ka Lai, Laktho, Parwal ka Mithai, Pua & Mal Pua, Thekua, Murabba and Tilkut.

Other: Makhana and Sattu



Festivals in Bihar 
Chatth Puja,
Sama-Chakeva,
Ramnavami , 
Makar-Sankranti,
Bihula,
Madhushravani,
Buddha Jayanti,
Mahavir Jayanti,
Saurath Sabha,     
Teej and Chitragupta Puja


Fairs of Bihar
Sonepur Cattle Fair: http://en.wikipedia.org/wiki/Sonepur_Cattle_Fair
Makar Sankranti Mela,
Gaya - Pitrapaksha Mela.

Monuments in Bihar 

 

Wednesday, October 22, 2014

Create PhoneGap Setup/project in six easy steps.

1. Download latest phonegap release from -> http://phonegap.com/install/
2. unzip and go to android/bin directory of downloaded phonegap zip
3. SET DIFFERENT PATHS:(you can do this in environment also)
    java: set path=%PATH%;C:\Program Files (x86)\Java\jdk1.7.0_21\bin
    ant: set path=%PATH%;C:\apache-ant-1.9.4\bin
    JAVA_HOME: set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_21\bin
Android SDK:set path=%PATH%;G:\android-sdk\tools
4. Create android peoject with command - create destination [package name] [project name]
         create D:\AndroidProjects com.project.example hello
5. Import the android project created in eclipse
6. Download and add cordova-2.2.0.jar in lib of your project.

Run ur first test

Sunday, March 9, 2014

Cmock and Unity - Test Framework

Cmock and Unity

Unity - a unit test framework


Unity
•What is Unity?
–Unity is a unit test framework written entirely in the C language.
–Possesses special features for embedded systems
–can be used for any C project.
–only one source file and a couple of header files
–It uses cross-platform Ruby for all the optional add-on scripts.
•src –This is where Unityheader and source file exists
•auto –This contains a collection of Ruby scripts which helps in using unity
–eg. generate_test_runner.rb
-This script will allows to specify any test file name in project and will automatically create a test runner (which includes “main”) to run that test

Unity Test API

RUN_TEST(func)-Each Test is run within the macro RUN_TEST.Thismacro performs necessary setup before thetest is called .
TEST_IGNORE()-Ignore this test and return immediately
TEST_IGNORE_MESSAGE (message)-Ignore this test and return immediately. Output amessage stating why the test was ignored.

Unity Assertion Summary

TEST_ASSERT_TRUE(condition)-Evaluates whatever code is in condition and failsif it evaluates to false
TEST_ASSERT_FALSE(condition)-Evaluates whatever code is in condition and fails
if it evaluates to true
TEST_ASSERT(condition )-Another way of calling TEST_ASSERT_TRUE
TEST_ASSERT_UNLESS(condition)-Another way of calling TEST_ASSERT_FALSE
TEST_FAIL(message)-This test is automatically marked as a failure. The
message is output stating why.

Numerical Assertions:


TEST_ASSERT_EQUAL(expected, actual)-Another way of callingTEST_ASSERT_EQUAL_INT
TEST_ASSERT_EQUAL_INT(expected, actual)-Compare two integers for equality and display
errors as signed integers.
TEST_ASSERT_EQUAL_HEX8(expected, actual)-Compare two integers for equality and display
errors as an 8-bit hex value
TEST_ASSERT_EQUAL_INT_ARRAY(mask, expected, num_elem, actual)-compares 'num_elem' elements of the integer arrays and reports if there are any differences.
TEST_ASSERT_BITS(mask, expected, actual)-Use an integer mask to specify which bits should
be compared between two other integers. High bits in the mask are compared, low bits ignored.
TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual)-Asserts that the actual value is within plus or
minus delta of the expected value.
TEST_ASSERT_EQUAL_STRING(expected, actual)-Compare two null-terminate strings. Fail if any
character is different or if the lengths are different.

How To Use Unity
•Assume a C source file
unity_example.c
#include"unity_example.h"
int sum(int a, int b){
return a + b;
}
int multiply(int x, int y){
return x*y;
}
And......
unity_example.h
int sum(int, int);
int multiply(int, int);
8
Create example test as below.....
unity_example_test.c
#include"unity_example.h"
#include "Unity.h"
void setUp(void)
{
}
void tearDown(void)
{
}
void test_sum(void){
TEST_ASSERT_EQUAL_INT(0, sum(0, 0));
TEST_ASSERT_EQUAL_INT(5, sum(5, 0));
TEST_ASSERT_EQUAL_INT(10, sum(5, 5));
}
void test_multiply(void){
TEST_ASSERT_EQUAL_INT(0, multiply(0, 0));
TEST_ASSERT_EQUAL_INT(0, multiply(5, 0));
TEST_ASSERT_EQUAL_INT(25, multiply(5, 5));
}

Note:
-setup() function is called at
the start of each test function.
-teardown() function is called at
end of each test function.

Create test runner
Create Test runner using generarte_test_runner.rb in auto directory of unity

Generated runner
Generated runner look like this (it includes "main" having all the tests)
unity_example_test_Runner.c
/* AUTOGENERATED FILE. DO NOT EDIT. */
#include "unity.h"
#include
#include
char MessageBuffer[50];
extern void setUp(void);
extern void tearDown(void);
extern void test_sum(void);
extern void test_multiply(void);
11
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
setUp();
test();
}
if (TEST_PROTECT())
{
tearDown();
}
}
void resetTest()
{
tearDown();
setUp();
}
int main(void)
{
Unity.TestFile = "unity_example_test.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_sum);
RUN_TEST(test_multiply);
UnityEnd();
getch();
return 0;
}


Running generated test runnner
The generated test runner are build and run to perform the test.
Result of the test :

Cmock-a mocking framework

CMOCK -module/object mocking framework for C projects
What is Cmock ?
–takes header files and creates a Mock interface for it so that you can
more easily Unit test modules that touch other modules.
–uses Ruby to auto-generate C source code mock object modules conforming to the interfaces specified in C header files.
How it works ?
–searches header files for function declarations
eg. int sum(int, int); (in header file CmockTry.h)
-creates a set of Mock objects and helpers
eg. void sum_ExpectAndReturn(int cmock_arg1,
int cmock_arg2, int toReturn);
in file:-
MockCmockTry.h
MockCmockTry.c
-mock are generated using command
ruby cmock.rb CmockTry.h

Write a test ...
CmockTryTest.c
#include"CmockTry.h"
#include"unity.h"
#include"MockCmockTry.h"
void setUp(void)
{
}
void tearDown(void)
{
}
void test_sum(void){
sum_ExpectAndReturn(5, 5, 10);
TEST_ASSERT_EQUAL(10, sum(5, 5));
sum_ExpectAndReturn(1, 1, 2);
TEST_ASSERT_EQUAL(2, sum(1, 1));
}


•Create a test runner using generate_test_runner.rb file in auto directory
ruby generate_test_runner.rb CmockTryTest.c

Generated Mock Module

void func(void)-------void func_Expect(void)
void func(params)--------void func_Expect(expected_params)
retvalfunc(void)------------void func_ExpectAndReturn(retval_to_return)
retvalfunc(params)----------void func_ExpectAndReturn(expected_params, retval_to_return)

Expect:
Note: The expect functions are always generated. The other functions are only generated if those plugins are enabled:

Generated Mock Module

Original Function Generated Mock Function
void func(void)---(nothing. In fact, an additional function is only generated if the paramslist contains pointers)
void func(ptr* param, other)----void func_ExpectWithArray(ptr* param, intparam_depth, other)
retvalfunc(void)---(nothing. In fact, an additional function is only generated if the paramslist contains pointers)
retvalfunc(other, ptr* param)---void func_ExpectWithArrayAndReturn(other, ptr* param, intparam_depth, retval_to_return)

Array:
Note: An ExpectWithArray will check as many elements as you specify. If you specify zero elements, it will check just the pointer if :smart mode is configured or fail if :compare_data is set.
19
Mocking from the Command Line
Example:
•this will create mocks using the configuration specified in MyConfig.yml:
ruby cmock.rb -oMyConfig.yml super.h duper.h awesome.h
•this will create mocks using the default configuration:
ruby cmock.rb ../mocking/stuff/is/fun.h ../try/it/yourself.h
•inject options directly to the command
ruby cmock.rb --mock_path=”build/mocks” blah.h

Mocking From Scripts or Rake
•default settings:
cmock = CMock.new
•Specify a YAML file containing the configuration options you desire:
cmock = CMock.new('../MyConfig.yml')
•Specify the options explicitly:
cmock = Cmock.new(:plugins => [:cexception, :ignore], :mock_path => 'my/mocks/')

Thursday, January 5, 2012

AAKASH TABLET PC


The Aakash is an Android tablet computer jointly developed by the London-based company DataWind with the Indian Institute of Technology Rajasthan. It is manufactured by the India-based company Quad, at a new production centre in Hyderabad — under a trial run of 100,000 units. The tablet was officially launched as the Aakash in New Delhi on Oct 5, 2011. A substantially upgraded second generation model called UbiSlate 7+ is projected for manufacture beginning in early 2012.
The 7-inch touch screen tablet features 256 MB RAM memory, uses an ARM 11 processor with the Android 2.2 operating system, has two universal serial bus (USB) ports and delivers high definition (HD) quality video.For applications, the Aakash will have access to Getjar, an independent market, rather than the Android Market.
As a multi-media platform, the Aakash project was beset by delays and setbacks. The device was developed as part of the country's aim to link 25,000 colleges and 400 universities in an e-learning program. Originally projected as a "$35 laptop", the device will be sold to the Government of India at $50 and will be distributed at a government subsidized price of $35. A commercial version of Aakash is currently marketed as UbiSlate 7+ at a price of $60.
By January 3, 2012 1.4 million online orders for the Aakash had been received.
  • Earlier it was referred to as the Sakshat table. Later the name has been changed as Aakash.
  • Aspiration to create a "Made in India" computer was first reflected in a prototype "Simputer" that went into production in a small way. Bangalore based CPSU, Bharat Electronics Ltd manufactured around 5,000 Simputers to Indian Customers during 2002-07. In 2011, Kapil Sibal announced an anticipated low-cost computing device to compete with the One Laptop Per Child (OLPC) — though intended for urban college students rather than the OLPC's rural, underprivileged students.
  • The device was projected to be designed by the students of Indian Institute of Technology Rajasthan – at the time uncredentialed in research or product development. The announced computer had been purchased off the shelf. The project remained dormant for about a year.A year later, the MHRD announced that the low cost computer would be launched in 6 weeks. Nine weeks later the MHRD showcased a tablet named "Aakash", not nearly what had been projected and at $60 rather than the projected $35. "NDTV" reported that the new low cost tablet was not a patch that was shown as a prototype and was going to cost about twice as much.
  • While it was once projected as a laptop computer, the design has evolved into a tablet computer. At the inauguration of the national Mission on Education Programme organized by the Union HRD Ministry in 2009, joint secretary N. K. Sinha had said that the computing device is 10 inches (which is around 25.5 cm) long and 5 inches (12.5 cm) wide and priced at around $30.
  • Doubts about the tablet were dismissed in a television program "Gadget Guru" aired on NDTV in August 2010, when it was shown to have 256 MB RAM and 2 GB of internal flash-memory storage and demonstrated running the Android operating system featuring video playback, internal Wi-Fi and cellular data via an external 3G modem

Specifications

As released on 5 October 2011, the Aakash features an overall size of 190.5 x 118.5 x 15.7mm with a 7 inches (180 mm) resistive screen, a weight of 350 grams (12 oz) and using the Android 2.2 operating system with access to the proprietary marketplace Getjar (not the Android marketplace), developed by DataWind.
The processor is 366 MHz with Graphics Accelerator and HD Video Co-processor and the tablet features 256 MB RAM, a Micro SD slot with a 2 GB Micro SD card (expandable to 32 GB), two full-size USB ports, a 2100 mAh battery, Wi-fi capability, a browser developed by DataWind, an internal cellular and Subscriber Identity Module (SIM) modem, using a power consumption of 2 watts with a solar charging option. The device features 3.5 mm audio output and input jack.
The Aakash is designed to support various document (DOC, DOCX, PPT, PPTX, XLS, XLSX, ODT, ODP,PDF), image (PNG, JPG, BMP and GIF), audio (MP3, AAC, AC3, WAV, WMA) and video (MPEG2, MPEG4, AVI, FLV) formats and includes an application for access to YouTube video content.
Specifications Aakash UbiSlate 7+
Price Rs.2,500 Rs.2,999
Central Processor speed Arm11 – 366Mhz Cortex A8 – 700 Mhz
Random Access Memory (RAM) 256 MB RAM 256 MB RAM {http://www.ubislate.com/specifications.html }
Battery 2100 mAh 3200 mAh
OS Android 2.2 Froyo Android 2.3 Gingerbread
Network WiFi WiFi & GPRS Phone network
Made in India Taiwan
Rebate 50% off for Indian Students Foreign product
Storage: Both tablets will have a micro-SD slot, and a 2GB micro-SD flash memory card, upgradable to 32GB. This is the storage for documents, photos, music, videos, etc. Used in Android devices, it is also a good substitute for USB flash memory drive. In Gingerbread, part of applications and data can be moved to the SD card, from the RAM.
Memory: ROM is a device's main memory, and is unannounced by Datawind, estimated to be the same ammount: 256MB. RAM is the secondary memory. It is used to run the Operating System and it's applications. In Android devices, all applications are installed on the RAM. Graphics/Video memory is the tertiary memory, is also unannounced. Both tablets do have graphics processing card(GPU).
Google Android Market: Aakash-1 has too little processing power and no SIM card, therefore no access to Google's Android Market. It will have to suffice with GetJar Marketplace. UbiSlate-7+ does have access to Google's Android Market.
Network: Aakash-1 does not have Direct Internet connection, it only has a Wireless Local-Area Network(WiFi). UbiSlate-7+ has GPRS Internet connection, a 1st generation internet connection, which most Feature phones can access through WAP Browser. Both tablets support external 3G USB modem (dongle).

 Browser

Datawind announced their GPRS modem and browser will use compression technology to speed up Data Transmission (Download/Upload) Rate. Theoretically, if we assume a base speed of 5KB/s, that means already-compressed files(ZIP files, JPEG images, MP3 audio, MPEG video) will transmit at the 5KBps normal speed, uncompressed files at 15KBps (3x base speed), and pure text files at 30KBps (6x base speed).[23] If and when sucessfully combined with Server-side web compression, 1G analog Internet service might actually be able to compete with 3G digital internet service.

 


Development and testing

Kapil Sibal has stated that a million devices would be made available to students in 2011. The devices will be manufactured at a cost of INR1500 (€23 Euro) each, half of which will be paid by the government and half by the institutions that would use it. In January 2011, the company initially chosen to build the Sakshat, HCL Infosystems, failed to provide evidence that they had at least INR600 million (INR60 crore) ($12.2 million) in bank guaranteed funds, as required by the Indian government, which has allocated $6.5 million to the project. As a result, the government put the project out for bidding again.
In June 2011,the HRD announced that it received a few samples from the production process which are under testing. Also it mentions that each state in India provided 3000 samples for testing on their functionality, utility and durability in field conditions.
The Government of India announced that 10,000 (Sakshat) tablet will be delivered to IIT Rajasthan in late June and over the next four months 90,000 more would be made available at a price of INR2500 device. Government will subsidize the cost by about 50%, so a student would have to pay less than INR1,500 for the device.
35% of hardware components were sourced from South Korea, 25% from China, 16% from the USA, 16% from India and 8% from other countries.
Software Development DataWind, the maker of Aakash, has announced a contest for students wherein their best applications will be embedded in the Ubislate(Aakash Tablet). Top 5 application winners will be awarded Rs. 1 Lakh each.
Nasscom Foundation has partnered with DataWind and announced a contest wherein 10 NGOs will have an opportunity to win 20 tablets each, mainly to improve their operations and programme implementation.
Indian Ministry of Education is releasing educational videos in conjunction with IGNOU and IIT at sakshat.ac.in. This preparation of content is meant for students with access to the Internet, India's first law-biding Online Video Library.

Reception

Problems such as low memory, frequent system freezes, poor sound quality, absence of support for all formats and inability to install free software available online were also cited by users. Technical commentator Prasanto Roy criticized issues such as a low battery life, an insufficient 7" screen and absence of training and support infrastructure, especially in rural areas.UbiSlate 7+ will be released by 2012. IIT Rajasthan has finalized the improvements of Aakash-1.
After receiving feedback of the early release model from over 500 users from IITs and other institutions, DataWind announced the next iteration that will have a new microprocessor of 700 megahertz as compared to the present 366 megahertz processor. This will improve the speed of the tablet and solve the existing problems of quick overheating, frequent system freeze, poor sound quality, absence of support for all formats and inability to install free online software. Amount of memory, storage, and USB ports will remain the same.
On 16 December 2011, DataWind opened Aakash ordering online in their Official website at INR 2500 with one week Delivery time and Cash on Delivery facility and its upgraded version Ubislate 7+ is available for pre-order at INR 2999.
On 19 December 2011, DataWind reported that the first phase of Aakash-1 tablet has been sold-out completely, just three days since it was opened for Online order. UbiSlate 7+ production capacity of January and February has already been sold. Now, March production is open for pre-Booking.
By 3 January 2012 1.4 million orders had been received since the Aakash was put up for sale online.

Future plans

Made in Taiwan, the UbiSlate 7+ will be launched between January and February of 2012.
DataWind is already working on giving the device a capacitive touch screen and 3G connectivity. This version will be priced around Rs.7,000, making it, when it releases, the cheapest 3G tablet in the market. The aim thereafter is to bring down the price - through sheer volume sales - to INR 3,000.
Reliance Industries Limited (RIL) has announced the plan to launch LTE(4G) Tablet between 3500-5000 Rupees, with low cost Internet service. This tablet will be an upgraded version of Aakash developed by DataWind.
Datawind had also announced an upgraded verison of Aakash with a front-facing camera and 1GB RAM.