Sunday, May 10, 2015
Created file in different versions of MS Office

Initially, I wasnt satisfied with this modify. Im usually traditional about well-known and recognized computer file formats--especially those reinforced by a great many application venders--and dont want them to be modified. And almost everyone at work application business has been assisting .doc and .xls for years.
But Microsoft company did an outstanding job creating the conversion as easy as possible, and guaranteeing that both the old and the new types would stay understandable. (If anyone believes Im a shill for Microsoft company, I recommend they study Why you should not update to Microsoft windows 8.)
Youll have no problems running an old .doc computer file into a contemporary edition of Term. (Im talking about Term particularly for comfort benefit. Everything I say here also works for Succeed and PowerPoint.) Just double-click the computer file and it will start.
You can also preserve a .doc computer file, so that people using mature editions can study it. In the Save As discussion box, simply choose the Save as pull-down selection and choose Term 97-2003 Records (*.doc).
Previous editions of Term were published without information of the .doc x structure, so you cant anticipate them to study it without a little help. But the help is there. If youre using Workplace 2003 (or even Workplace 2002 or 2000), obtain and set up the Microsoft company Workplace Interface Package for Term, Succeed, and PowerPoint File Formats. Youll be able to start, modify, preserve, and make the more recent x types.
And yes, the more recent types have their benefits For one thing, the information are small, since the x types have loss less pressure developed in. In common, .docx information are about half the dimension .doc information with the same content, and Ive seen some less than a one fourth of the dimension, creating it simpler to email or back-up the information. According to Microsoft company, theyre also more protected and recoverable, although I havent seen proof of this with my own sight.

Yes, a .docx computer file is really a .zip database (I informed you it was compressed). Most of what you find inside are .xml files--another start conventional. That research will also work on .xlsx and .pptx information.
After youre done testing, dont ignore to modify the expansion back to .docx.
Every well-known and effective application consistently produces more recent editions, usually every season in the case of well-known applications. When Microsoft® produces a program of any office program, they provide frequent up-dates so they do not need to launch one every season. When a significant renovation of the Microsoft company Office® Suite happens in which it is more recent, customized, prolonged, and with a more contemporary GUI (which contains the Microsoft® Term written text editor), the changes are not only developed to the program but also include computer file type and structure changes. This is because the new papers types are developed in the same way as the performance of the program. However, problems may happen when trading documents published in mature editions of an program. In the actions below, you can learn how to preserve Microsoft® Term information to be suitable with previously editions.
Instructions:
Start the Microsoft® Term 2010 program.
Open the computer file in which you want to “re save,” or make a new papers.
Click on the “File” tab in the main routing bar.
Choose “Save As” or “Save” for a recently developed papers.
Write the name of the papers in the “File name” box.
From the “Save as type” drop-down, select the preferred edition (usually “Word 97-2003 Document [*.doc]” version).
Click the “Save” key to preserve in an previously edition of Microsoft® Term.
Tuesday, March 10, 2015
Deprecating ScriptDB and Domain Service in Apps Script
In the last few months, weve added a number of new features to Google Apps Script, including add-ons for Sheets and Docs and 7 new advanced services.
Were eager to maintain that momentum — focusing on new features that help you do more with Google Apps. As a result, were deprecating two Apps Script services for which good replacements exist elsewhere: ScriptDB (a NoSQL database that has been marked as experimental since it was introduced) and the Domain service (which encapsulates the GroupsManager, NicknameManager, and UserManager global objects).
Both ScriptDB and the Domain service will be turned off on November 20, 2014.
Before then, youll need to port any ScriptDB projects to another data store, like Google Cloud SQL or a third-party NoSQL database. Weve created a migration guide that explains how to export your data from ScriptDB and suggests a few alternate data stores. We have also improved the documentation for connecting to external databases through JDBC to make it a little easier for you to set up Cloud SQL with Apps Script.
The Domain service, which only Google Apps domain administrators can use, is replaced by the recently added Admin SDK Directory and Admin SDK Reports advanced services. Those advanced services also provide many new features that the Domain service does not — like managing users devices, OAuth tokens, and application-specific passwords — so we expect that youll prefer using them in the future.
![]() | Saurabh Gupta profile | twitter | blog As the product manager for Google Apps Script, Saurabh is responsible for Apps Script’s overall vision and direction. |
Thursday, February 19, 2015
Installation of Pentaho 5 0 1 CE in windows 7 changes made from previous version
First of all, Id like to thank you to the web details team for the efforts they kept in bringing up the powerful analytical engine(BA server).
The home page itself make you to stick with BA server where you can enter into the server with "admin" and "password" as the default credentials.. Yes, "joe" user is no more but he left with the same password to log into BA server.
There will be NO more admin console ... Now it is very easy and developer friendly to navigate in one console(User Console) to give data base connections and new roles for new users..
A lot of stuff included in the home page itself, giving the blogs links, books on different tools of pentaho family. In a single word I can say , All the stuff related to Pentaho at a single place. A BI developer like me can reduce the time for developing reports, dashboards , jobs.
Market place for installing C-Tools and the installed plug-ins list drop down is one of the good ideas of the team.
As quick as Pentaho released its CE 5.0.1 , I just downloaded and trying to explore the new look and navigating from all the menus, reports, connection places and etc.
Its very easy to install the pentaho CE BA now in windows...
Installation procedure :
1) Down load the software as a .zip file using this link .
2) Unzip it in your fav folder
3) Click on start-pantaho.bat file
Home page :
NOTE: path and class path for java must be set before the installation.
Wednesday, February 18, 2015
Kettle Pass parameters from job to transformation in PDI Retrieve data from table by passing table name as parameter
Software Setup :
PDI 5.1.0 CE
PostgreSQL
Concept : Retrieve data from table by passing table name as parameter.
You will learn below things
1) Table input step & database connections
2) Creating parameter(s) in Transformation(s) & Job(s)
3) Passing parameter(s) from job to transformation.
Lets say in foodmart database you have below tables 1) region 2) product 3) customer and etc.
Every time when you pass different table name as parameter you should able to fetch the data coming from the passed table.
1) Table input step & database connections
2) Creating parameter(s) in Transformation(s) & Job(s)
1) Create a new transformation & drag and drop "Table Input" step from Design Pane.

2) Double Click on "Table input" step & Click on New tab to give database connections as shown in below image

3) Define the parameter in transformation ( in this example the table name should go as parameter).
Image A : Right Click on the empty space to get the transformation settings.
Image B : Database Connection Details
Parameter Name is : tableName


4) Come back to the properties of "Table input" & write select statement to retrieve the data.
Eg : SELECT * FROM product LIMIT 100
In above example "product" is the table name that you have to replace with the parameter.
i.e., SELECT * FROM ${tableName} LIMIT 100
Once you write the query, come down check "Replace variables in script"

5) Take a "Dummy" step and connect it to "Table input step" . Save the transformation & run it on "Dummy Step"( Right click dummy step and click on "Preview".
OUTPUT : Test 1 : With "region" table

OUTPUT : Result 1

OUTPUT : Test 2 : With "product" table
* Right click Dummy step then click on Preview
* Click on Configure & then in parameters tab give "product" for tableName value parameter.
OUTPUT : Result 2

3) Passing parameter(s) from job to transformation
* Crtl+Alt to create a new job
* From the "General" node of Design tab ( Appears left side) drag and drop "Transoformation step".
* Drag and drop "START" step and connect these two as shown in below image.

* Double click on "Transformation" step to set the properties & parameter information.
* Browse for the transformation file and then move to parameters tab
* Click on "Get Parameters" then you can find parameter get apper under Parameter tab.
* Right click on empty canvas of job to get its settings & move to Parameters tab and give parameter name as "tableName" and provide default value.
Save the job and run it.
IMP NOTE :
1) Parameter names in job & transformation should match.
2) You can create n number of parameters in job but can pass as many you wish.
3) In job design you should take "START" step to tell the job to start execution from there.
If you ignore you will get below error ( which took me awhile to solve it for the very first time).
Start of job execution
:A serious error occurred during job execution:
Couldnt find starting point in this job.
org.pentaho.di.core.exception.KettleJobException:
Couldnt find starting point in this job.
at org.pentaho.di.job.Job.execute(Job.java:516)
at org.pentaho.di.job.Job.run(Job.java:422)
Spoon - Job has ended.
References :
1) http://wiki.pentaho.com/display/EAI/Named+Parameters
2) http://diethardsteiner.blogspot.in/2013/07/pentaho-kettle-parameters-and-variables.html
3) http://wiki.pentaho.com/display/EAI/Substituting+variable+references+in+Job+Parameter+values
Hope this helps some one like me for the first time who is looking for parameters(named) concept :-)
Cheers :-)
:-) Happy New Year - Welcome - 2015 :-)
Tuesday, February 17, 2015
Access Control Concept in Pentaho Schema Workbench Saiku Analytics tool Display Restrict Role based Cubes Dimensions Hirachies levels
Here is a small workout on giving access of CUBES, Hierarchies,members to different users based on roles assigned to them.
You may not find what you need exactly in this article but I can say surely that, you will get some idea on below topics
1) Creating Users & Roles in the BA Server.
2) Assigning Roles to Users.
3) How BA server will identify the roles created in PSW with the roles in BA Server.
4) Developing a Schema of 2 sample CUBES
5) Scenario on the schema
Software Setup:
Pentaho BA Server 5.x
PostgreSQL Server 9.x [Food Mart Database]
Pentaho Schema Workbench :3.8.0.0-209
Saiku Analytics : 2.6-PENTAHO5-SNAPSHOT (TRUNK)
Assuming you have initial idea on how to design a sample CUBE..
(For creating sample cubes you can follow this tutorial :
http://pentaho-bi-suite.blogspot.in/2013/12/pentaho-schema-workbench-simple-example.html
)
Concept : Access Control
Problem Statement :
1) Give Access of CUBE 1 to User 1 who is assigned with Role 1
Schema grant, Cube grant, Hierarchy grant, member grant .
2) Give Access of CUBE 2 to User 2 who is assigned with Role 2
Step 1 : How to built role mapper communication in BA Server for created roles in mondrian ?
- Enable mondrian user/role mapper in pentahoObjects.spring.xml
- File location : /Pentaho/biserver-ce/pentaho-solutions/system
<!-- This mondrian user/role mapper assumes that roles from the platform also exist in mondrian -->
<!--
Disabled by default in 3.5.2. In trunk, this should be enabled.
-->
<bean id="Mondrian-UserRoleMapper"
name="Mondrian-One-To-One-UserRoleMapper"
class="org.pentaho.platform.plugin.action.mondrian.mapper.MondrianOneToOneUserRoleListMapper"
scope="singleton" />
NOTE : If your BA server is already running , just stop and restart it.
Thats it.. Now the Roles assigned in schema will mapped to the roles assigned in BA server.(for users).
Step 2 : Creating Schema with 2 CUBES
Let us take food-mart database(modelled for multidimensional database) and design below CUBES.
CUBE 1 ---> Sales
CUBE 2----> HR
Cube Design Image is shown below :

Open it with your PSW...
The design has the following concepts :
i) Dimension Usage :
Create a dimension outside the CUBES( i.e., Right Click Schema -> Create Dimension) and make use of it in CUBES as Dimension Usage.
(i.e, If 2 CUBES use the same dimension, we need not to create it 2 times. We can create one time and use that dimension which ever the CUBE needs for its specific purpose).
In this example schema : I made use of two shared dimensions as Dimension Usage. Those are Store and Time
ii) Calculated Member(CM).
To calculate the measures.. for example : To find profit in this example.
It will results as a new measure in the output.
Step 3 : How to create Users & Roles?
Users :
- Log-in into your server with Admin/password first(login as Administrator).
- In BA Server Click on "Administration" from the dropdown Home menu.
- Create 2 Users as shown in below image.

Also create 2 Roles in Manage Roles Tab
Sales User and
HR User as shown in below image.

Step 4 : Assign roles to Users
As shown in below image
i) HR user is assigned with "HR user" role.
ii) Sales user is assigned with "Sales user" role.

Scenario :
CASE1) Give Access to CUBE 1 to User 1 who is assigned with Role1
i) Schema grant
ii) CUBE grant
iii) Hierarchy grant

Notes :
- Role Name in PSW should match with the role name in BA Server.
- Role Creation: In PSW "Sales User" role is created for Sales CUBE.
- Cube Grant: Right click on " Sales User" role and select "Add Cube Grant", give attributes : access =all , Cube=Sales
- Hierarchy Grant: Find below image.

- Member Grant: access=all , member=[Store].[USA].[CA]
- Another Member Grant: access=none , member=[Store].[USA].[CA].[Los Angeles]
- USA country in current example is having 3 states, CA,WA,OR.
- Out of these 3 states the access is given to only CA state.
- The cities other othn "Los Angeles" will be displayed with the other member grant.
1) login to the BA Server as "Sales" user.
2) New -> Saiku Analytics

CASE2) Give Access of CUBE 2 to User 2 who is assigned with Role2
As a demonstration just given CUBE Grant to "HR User".
"HR User" is the role name given in PSW as well role created in BA server.
For this role the user is "HR" in this example.

References :
1) http://mondrian.pentaho.com/documentation/schema.php#Defining_roles
2) http://infocenter.pentaho.com/help/index.jsp?topic=%2Fanalysis_guide%2Ftopic_mondrian_security.html
:-)
Sadakar
BI developer
HowTo Install Epson L110 in Fedora
Step 2: select your system architechture (download only .rpm files)
Step 3: open your terminal
Step 4: su -
Step 5: cd Downloads (or wherever you placed your downloaded files)
Step 6: yum localinstall your-downloaded-file.rpm
(ex. yum localinstall epson-inkjet-printer-201207w-1.0.0-1lsb3.2.x86_64.rpm)
Step 7: tada! your Epson Printer Driver is now installed! You can now see the Epson L110 driver when you are installing your printer!
** Notes **
You need to install the driver for the printer to work properly, before I used Epson NX100 driver on an Epson L100 printer and it works fine, if you used the same driver on the L110, when you are printing a document, it will simply feed and eject your paper for many many times, maybe infinite!
If somehow you cannot download from the link above, leave a comment and your email and ill email to you a copy of the files, both i486 and x86_64
Monday, February 16, 2015
Fill Colour of bar s based on a condition in Pentaho CDE
Sample Scenario :
Print bar color as red when bar value <=2000
Print bar color as green when bar value >2000 and <10000
Print bar color as black when bar value>=10000
Scenario 2 :
When representing -Ve values on charts .. this kind of representation is preferable.
Code is Taken from Reference links :
function changeBars(){
var cccOptions = this.chartDefinition;
// For changing extension points, a little more work is required:
var eps = Dashboards.propertiesArrayToObject(cccOptions.extensionPoints);
// add extension points:
eps.bar_fillStyle = function getColor(){
var val = this.scene.vars.value.value;
if(val > 0 && val <= 5000){
return red;
}
else if(val > 5000 && val <= 50000){
return green;
}
else{
return black;
}
};
// Serialize back eps into cccOptions
cccOptions.extensionPoints = Dashboards.objectToPropertiesArray(eps);
}
NOTE : I have tried directly in Extension points but it did not work.
Sample output 1 :
function changeBars(){
var cccOptions = this.chartDefinition;
// For changing extension points, a little more work is required:
var eps = Dashboards.propertiesArrayToObject(cccOptions.extensionPoints);
// add extension points:
eps.bar_fillStyle = function getColor(){
var val = this.scene.vars.value.value;
if(val == 26297.2900){
return black;
}
else{
return blue;
}
};
// Serialize back eps into cccOptions
cccOptions.extensionPoints = Dashboards.objectToPropertiesArray(eps);
}

References :
http://translate.google.com/translate?&ie=UTF-8&sl=&tl=en&u=http://www.redopenbi.com/group/ctools/forum/topics/colores-en-bar-chart?commentId=2400100%3AComment%3A103280&xg_source=activity&groupId=2400100%3AGroup%3A73260
OR
http://www.redopenbi.com/group/ctools/forum/topics/colores-en-bar-chart?commentId=2400100%3AComment%3A103280&xg_source=activity&groupId=2400100%3AGroup%3A73260
OR
http://forums.pentaho.com/showthread.php?150582-Bar-chart-colors-dynamically-changed-based-on-data-value-Along-with-JavaScript-vars
switch statement in C Part 2
In the last tutorial I told you about the syntax and working of a program using switch keyword. Well in day to day programming we generally don’t use that syntax in C. This is because if we use the earlier method then it will execute all the subsequent statements after the condition turns true.
switch statement in C
So we need a syntax that will execute only a certain set of statements when the condition turns true. So lets checkout the advance modification of switch statement with break keyword.Syntax
switch(integer expression)
{
case constant 1: Statement 1;
break;
case constant 2; Statement 2;
break;
. . . . . .
. . . . . .
default: Statement 3;
}
Explanation of the above syntax
Well the whole syntax is almost same. But in the above syntax we have added break keyword after the cases. Remember we generally do not use continue keyword with switch.
Working of break keyword in switch statement
As you can see I have given break keyword after every case. Its working in switch case is almost same as in loops. If the compiler encounters break keyword in switch then it will take the control to the outside of switch block.
![]() |
| Flowchart of switch statement in C - Image Source |
The perfect way to understand it is through a program.
#include<stdio.h>
void main()
{
int i=10;
switch(i)
{
case 1: printf("Hey its 1");
break;
case 10: printf("Hey its 10");
break;
case 7: printf("Hey its 7");
break;
default: printf("Hey its default");
}
}
Output

- In the beginning of the program I have declared an integer variable with value 10.
- After that I have written switch keyword with integer expression i. It means the compiler will check the value of i (which is 10) with all the cases.
- In the first case I have written integer constant ‘1’ which turns false. So compiler will skip that case.
- In the second case I have written integer constant ‘10’ which turns true. So compiler will execute the statements under that case.
- Now just after the printf() function I have written a break keyword. So it will take the control of the program outside the switch block.
Points to remember
- You can also write multiple statements under each case to execute them. And you will not need to give separate braces for them, as the switch statement executes all statements once the condition turns true.
- Remember default keyword is optional. Its completely depend on us whether we want it or not in our program.
- The order of cases and default in the switch block do no matter. You can write them in any order but you must take care of proper use of break after each case.
Sunday, February 15, 2015
How to Make a Notepad in VB Net
Also Read: How to Create a Web Browser in Visual Basic

How to Use?
- Unzip the rar file we have provided to your favorite folder
- Open Visual Studio, go to File > Open > Project/Solution
- Navigate to the folder where you have extracted the rar file
- Open Notepad.sln file
- Now you can make changes in the program
- Download Notepad Source Code -
Functions in C Programming Part 4
Rules for using functions in C
1. The variables that are passed by main() function are called actual arguments or parameters and the variables in which the user defined function receives those values is called formal arguments or parameters.2. We can pass any number of actual arguments. But it should be in the same number and order to the formal arguments.
3. We can also use the same variable name for both formal and actual arguments but the compiler will treat them different.
4. Compiler automatically passes the control to the calling function when it encounters the closing brace of user defined function. There is no need for some return statement for it.
5. However if you want to return some value to the calling function then you should use return statement for it.
6. You can use any number of return statements in your program. There is no restriction for that.
7. Some variations while using return statement
return(b);
return(4);
return(2.67);
return;
Last return statement will return any garbage value to the calling function. And we can drop the parenthesis in that case.
8. We can only return one value at a time. It’s a restriction in C. So below statements will not work.
return(x, y);
return(6,4);
9. IMPORTANT – When we change the value of formal arguments then those values will not change in actual arguments.
E.g. Suppose we pass two variables to some function. And in that function I received the values in that variables in some local variable. So when we change the values of those local variables the it will not affect to the values of actual variables.
Scope Rule of Functions
In this rule I will tell you about the reason behind point number 9 in above rules. Till now you must be asking that why we should pass the values to some function explicitly?The simple reason is that the default scope of variables inside some functions is local to it. It means the variables inside main() function can only be accessed in main() function. We cannot access them in any other function. So that is why we have to pass values to the user defined functions explicitly.
C Program to Count no of alphabates digits and spaces present in a file STORY TXT
#include<fstream.h>
#include<conio.h>
void main()
{
clrscr();
ifstream fin("STORY.TXT");
char ch;
int i,a=0,s=0,d=0;
while(fin)
{
fin.get(ch);
i=ch;
if(i>63&&i<91||i>96&&i<123)
a++;
else
if(ch== )
s++;
else
if(i>47&&i<58)
d++;
}
cout<<"No. OF Alphabates:"<<a;
cout<<"
No. Of Digits:"<<d;
cout<<"
No. Of Spaces:"<<s;
getch();
}
Saturday, February 14, 2015
C program to count number of words in a string

#include<stdio.h>
#include<conio.h>
void main()
{
int i,words=1;
char str[100];
clrscr();
printf("Enter a string:");
gets(str);
for(i=0;str[i]!=
C Program to Print an Alphabet from A to L of s in Capital Letter

#include<iostream>
using namespace std;
int main()
{
int i,j,k=1;
char ch;
cout<<"Input an Alphabet in capital letters that you want to print:";
cin>>ch;
cout<<"
";
switch(ch)
{
case A:
cout<<" ";
for(i=1;i<=40;++i)
{
for(j=0;j<=22;++j)
{
if(i==1||i==2||i==21||i==20)
cout<<"*";
else
{
if(j==0||j==20)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
break;
case B:
cout<<" ";
while(k<=2)
{
for(i=1;i<=9;++i)
{
for(j=0;j<=i;++j)
{
if(j==0||j==i)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
}
for(i=1;i<=10;++i)
{
if(i==1||i==10)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
for(i=1;i<=10;++i)
{
if(i==1||i==10)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
for(i=9;i>=1;--i)
{
for(j=0;j<=i;++j)
{
if(j==0||j==i)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
}
++k;
}
break;
caseC:
cout<<" ";
for(i=1;i<=40;++i)
{
for(j=0;j<=22;++j)
{
if(i==1||i==2||i==39||i==40)
cout<<"*";
else
{
if(j==0)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
break;
caseD:
cout<<" ";
for(i=1;i<=18;++i)
{
for(j=0;j<=i;++j)
{
if(j==0||j==i)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
}
while(k<=4)
{
for(i=1;i<=19;++i)
{
if(i==1||i==19)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
++k;
}
for(i=18;i>=1;--i)
{
for(j=0;j<=i;++j)
{
if(j==0||j==i)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
}
break;
caseE:
cout<<" ";
for(i=1;i<=39;++i)
{
for(j=1;j<=20;++j)
{
if(i==1||i==2||i==20||i==21||i==38||i==39)
cout<<"*";
else
{
if(j==1)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
break;
caseF:
cout<<" ";
for(i=1;i<=40;++i)
{
for(j=1;j<=20;++j)
{
if(i==1||i==2||i==18||i==19)
cout<<"*";
else
{
if(j==1)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
break;
caseG:
cout<<" ";
for(i=1;i<=25;++i)
{
for(j=1;j<=20;++j)
{
if(i==1||i==2)
cout<<"*";
else
{
if(j==1)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
for(i=1;i<=10;++i)
{
for(j=1;j<=20;++j)
{
if(i==1||i==2)
{ if(j==1||j==14||j==15||j==16)
cout<<"**";
else
cout<<" ";
}
else
{
if(i==9||i==10)
cout<<"*";
else
{ if(j==1||j==18)
cout<<"**";
else
cout<<" ";
}
}
}
cout<<"
";
}
break;
caseH:
cout<<" ";
for(i=1;i<=40;++i)
{
for(j=1;j<=21;++j)
{
if(i==20||i==21)
cout<<"*";
else
{
if(j==1||j==19)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
break;
caseI:
cout<<" ";
for(i=1;i<=40;++i)
{
for(j=1;j<=30;++j)
{
if(i==1||i==2||i==39||i==40)
cout<<"*";
else
{
if(j==15)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
break;
caseJ:
cout<<" ";
for(i=1;i<=30;++i)
{
for(j=1;j<=28;++j)
{
if(i==1||i==2)
cout<<"*";
else
{
if(j==14)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
for(i=1;i<=10;++i)
{
for(j=1;j<=15;++j)
{
if(i==10||i==9)
cout<<"*";
else
{
if(j==1||j==13)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
break;
caseK:
cout<<" ";
for(i=20;i>=1;--i)
{
for(j=0;j<=i;++j)
{
if(j==0||j==i)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
}
for(i=1;i<=20;++i)
{
for(j=0;j<=i;++j)
{
if(j==0||j==i)
cout<<"**";
else
cout<<" ";
}
cout<<"
";
}
break;
caseL:
cout<<" ";
for(i=1;i<=40;++i)
{
for(j=1;j<=25;++j)
{
if(i==39||i==40)
cout<<"*";
else
{
if(j==1)
cout<<"**";
else
cout<<" ";
}
}
cout<<"
";
}
break;
}
return 0;
}
Cascading parameters example in Pentaho CDE
It is quite easy to learn about cascading parameters in pentaho CDE dash boarding.
Example below teach you how to give cascading parameters on CDE dashboard.
Environment :
C-Tools 13.09
Pentaho BA Server 4.8 stableb
DB : postgreSQL foodmart ( jasperservers database)
IDEA of cascading parameters:









Friday, February 13, 2015
switch statement in C Part 1
switch statement in C
This is the decision control instruction which allows the programmer to build a menu type program, so that the user can choose one options from multiple choices. It is also called switch-case-default instructions too because these are three keywords involved in making this instruction. Now lets head on to the syntax of switch statement.Syntax
switch(integer expression)
{
case constant 1: do this;
case constant 2: do this;
case constant 3: do this;
default: do this;
}
Explanation of this syntax
integer expression: It is used to check if programmer wants to execute the set of statements under switch or not. It works similar to conditions but we can only give integer expressions insider. It means an expression which is a integer or which evolves an integer.
case: It is the keyword to show multiple conditions inside switch statement. We can have any number of cases.
constant 1,2 and 3: As its name suggests these values should be either integer constant or character constant. Each value must be unique.
do this: We can use any legal C programming statement at that place.
default: It is another keyword which is used to execute some default statements if all conditions fails inside switch.
Now lets apply the above knowledge in some program.
#include<stdio.h>
void main ()
{
int i=2;
switch(i)
{
case 0: printf("No Message");
case 1: printf("No Message");
case 2: printf("This will print.
");
case 3: printf("Even This will also print.
");
default: printf("Default will also print.");
}
}
Output

- The program starts with integer variable i with value 2 in it.
- After that I have written a switch keyword with one integer expression. i.e. switch(i). It means full switch statements will get executed if i=2 turns true.
- I think you should have an idea that case 2 will get executed.
- Now the turning point is after case 2, every statement get executed.
- Even the last expression under default is also get executed.
Now an obvious question which should hit your mind.
Why is it so?
Well this is not the demerit of this program. In fact it’s the speciality of switch statements. It means if one condition turns true then all the subsequent conditions will also get executed inside switch statement. This is because it does not check any condition after getting a true value with one condition.
Switch statements are used very frequently in C programming. So I would recommend you to go through this tutorial at least once and make some programs by using switch keyword. In the next tutorial I will tell you about the method by which we can stop executing all the statements inside switch.
Operators Rivisited Hierarchy of Operators NOT and Conditional Operator in C
Why? Ah… it’s a bit confusing and I don’t want to ruin the next important topics due to that operator.
NOT Operator (!)
The NOT operator (!) is used to reverse the results. This operator is mainly used as a key in big complex programs. By using this operator we can reverse the condition easily. Lets try to understand it with an example.If ( !(y>6) )
In the above statement I am writing a condition that y should be lesser than or equal to 6. I can also write the same condition as
If (y<=6)
Both the statements will give the same results. You can use anyone of them.
Hierarchy of Operators
I have given the hierarchy of operators after arithmetic operators. Now we have learnt about the logical operators (AND OR NOT) too. So the new hierarchy of operators is given below.
Conditional Operators
They are also called ternary operators. As we have to use three arguments to use this operator.General form of Conditional/Ternary operator
(Expression 1 ? expression 2 : expression 3)
It is generally used to avoid small if-else statement. Remember it is not the alternative of if-else clauses. It can used at some places.
Lets try to understand it with some simple example.
if (x==10)
Y=3;
else
Y=9;
In the above we are basically checking if x is equal to 10. If condition turns true then it will assign y as 3. Otherwise it will assign y as 9. The same task can be completed using ternary operator.
Y=(x==10 ? 3 : 9);
I hope everyone will agree with the fact that above example is very much compact than the earlier version.
Another example to use ternary operators is given below.
( x > 4 ? printf ( "Value is greater than 4" ) : printf ( "Value is less than 4" ) ) ;
Nested Conditional Operator
Well nested conditional operators are used very rarely but they are good to make the program compact.A small example of nested ternary operator is given below
Small = ( x < y ? ( x > z ? 9: 10 ) : ( y > z ? 14: 16 ) ) ;
In the above example small is the variable and it will store
9 if x<y and x>z
10 if x<y and x<z
14 if x>y and y>z
16 if x>y and y<z
Sounds confusing? Well that’s why they are used rarely. But like our example, it can sometimes make the program compact.
So that’s all for decision control instructions. I recommend you to make programs and practice for at least 2 days before proceeding further. In the next tutorial I will cover an overview to loops in C programming.
HowTo Play sounds in ActivePerl using Win32 Sounds
If the perl script terminates, the playing of sound also terminates.
The sound plays in this example because we are inside the Gtk2 main loop, the script does not terminate instantly because we are waiting for user inputs.
Please take note of the difference between the 2 buttons, SND_ASYNC allows the Gtk2 to loop without waiting for the sound to finish playing.
On the other hand, the one without the SND_ASYNC does not allow the Gtk2 loop to proceed until the sound has finished playing.
#!/usr/bin/perl -w

