Showing posts with label a. Show all posts
Showing posts with label a. Show all posts

Tuesday, March 3, 2015

What Did They Say! Wednesday! A Linky Party!

Kids say the darndest things!


What Did They Say!?

<div align="center"><a href="http://aturntolearn.blogspot.com/" title="What Did They Say!?"><img src="http://4.bp.blogspot.com/-OIhmtxluCS0/ULwEfazkl1I/AAAAAAAADpM/MMMzxm23B0Y/s320/What+Did+They+Say+Wednesday.png" alt="What Did They Say!?" style="border:none;" /></a></div>

This weeks story really makes me question how well my children actually comprehend the stories I read to them!

The kids were listening about dinosaurs which discussed possible causes for extinction.  One theory is that a storm came and killed all the plants, which then left the dinosaurs without food.  The teacher who was reading the book asked, "Who remembers how the dinosaurs became extinct?"  One of my students replied, "A giant storm came and it was really windy, and the wind blew off all of the dinosaurs skin so all that was left was bones!"

I really question her listening comprehension now!!!

Now... its time to share your cute kids story from this week!

Rules for the Linky Party:

  1. Share a story that one of your kids said on your blog!  If you dont have a blog, leave a comment with your story!
  2. Use the HTML code at the top of this post to link back to the post!
  3. Comment on the two blog posts before yours!


);


Read more »

Sunday, March 1, 2015

Select All the Text in a Document or Website!

This is probably one of my favorite tips!  If you want to select all of the text on a website or in a word document, this is the perfect little trick! 


Let me know how you like it!
Read more »

Saturday, February 28, 2015

How to Make Any Picture a Coloring Page!

Its time for another technology tutorial... and this one is super fun (and could make a great gift for the holidays!  This week well learn how to make any picture into a coloring page!


Heres the poll for this week... this one won by a landslide!



The picture that I used for this tutorial is one of my husband when he was 3.  How cute is he!?

This tutorial definitely works best with a picture that has good lighting.  I tried it with another picture that had a dark background and it didnt look as nice... so try it with lots of different pictures!





 You can download this tutorial as a PDF by clicking this picture!
Note: This tutorial is hosted on Google Docs.  To save it from there, just open the file and click File > Download to save onto your computer!

The next poll will be up for two weeks... since next Tuesday is Christmas Day, I wont be posting a new tutorial, but you can definitely expect one the following Tuesday (even though its New Years Day!)

Next week, Ill add how to make a text box transparent or semi-transparent (in Word or PowerPoint).
Read more »

Thursday, February 26, 2015

What Did They Say Wednesday! A Linky Party!

One of the best parts of being a teacher is getting to hear all of the hysterical things that kids say!

What Did They Say!?
<div align="center"><a href="http://aturntolearn.blogspot.com/2013/01/whatdidtheysay1-23.html" title="What Did They Say!?"><img src="http://4.bp.blogspot.com/-OIhmtxluCS0/ULwEfazkl1I/AAAAAAAADpM/MMMzxm23B0Y/s320/What+Did+They+Say+Wednesday.png" alt="What Did They Say!?" style="border:none;" /></a></div>



This weeks story is a reminder that you have to always be careful what you say!

In drawing a picture of myself, I drew flats on my feet.  The kids had asked me why I didnt draw high heels for myself. I said "I usually wear flats so thats what Im going to draw. Maybe two days later, I wore a pair of heels to work. One of my girls comes up to me at the beginning of the day and says "You lied to us." Im shocked... since it was first thing in the morning and I had barely said anything.  I say "What?" not having any idea what she was talking about. She obviously reminded me about the picture I drew of myself the other day (which i had totally forgotten about!) Go figure!  I had to explain that "usually" doesnt mean "always!"



Now... its time to share your cute kids story from this week!

Rules for the Linky Party:
  1. Share a story that one of your kids said on your blog!  If you dont have a blog, leave a comment with your story!
  2. Use the HTML code at the top of this post to link back to the post!
  3. Comment on the two blog posts before yours!


);

Read more »

Tuesday, February 17, 2015

Creating Cubes with Oracle OLTP databases A test scenario with synonims

This is article is written based on below queries before I explore it.

1) Is it mandatory to have Star Schema based warehouse to create Cubes ?
2) In oracle if you have multiple users(lets say multiple schemes).. Is it possible t design a simple CUBE dimension from schema A of a table and measure from schema B of another table ?

The answer is , NO & Yes.

All the organizations may not maintain complete data ware housing solutions and run their transactional database using normalized OLTP models.

It is not mandatory to have a star schema based ware house to create OLAP cube to analyze your data but you can also use OLTP databases.


The new things I found while demonstrating a simple cube are..

1) Connecting to oracle database.
2) Fetching all the tables of all schemas.
3) Synonyms of a particular schema

 You will find a lot of time taking to load the database into PSW tool once you connected to a schema.. Using FILTER_SCHEMA_LIST at Options section of the database dialogue will take the control to load only specified schema tables.

By default the PSW engine assumes to load all the tables in all the schemes.


A scenario of Dimensions and measures.

Suppose in a case, if you have a measure coming from table defined in SchemaA, measure coming from a table defined in SchemaB... in that case while giving tables for fact and dimension tables, the synonyms will not appear in drop down boxes... 

You need to hard code the tables names ... Of course your dimensions & measures will be in X with red color, it will not affect your definition of hard coded table names.

Save the schema and publish it to the server... have tested it with Saiku plug-in ad-hoc editor and worked nicely.


Thank you.

References :
1) http://jira.pentaho.com/browse/PSW-135

2) http://forums.pentaho.com/showthread.php?162540-OLTP-tables-VS-RDBMS-tables-Designing-OLAP-cubes-Peformance-factors&p=374714#post374714

3) http://forums.pentaho.com/showthread.php?157997-Schema-Workbench-freeze-after-establishing-a-connection-in-db








 
Read more »

Monday, February 16, 2015

A first experiment on D3 bar chart in pentaho CDE Queried output on Bar Chart with few limitations

Hi Guys,

I love experimenting/Playing with Pentaho C-Tools where it took me to explore D3 bar chart with SQL query result set...

Not a big deal in implementing it, but want to share some thing with community folks.

What will you learn in this post ?
You will get an idea on how to implement D3 bar chart.
1) Passing query output to D3 chart code.



Limitations on the Example :
1) Query and Chart is not parametrized yet.
2) Y-Axis labels are not dynamic yet.
3) Tool tip is not implemented.
4) Not tested the bootstrap support.
5)  and more.....

Readers are encouraged add your support to improve the sample of this in comment box...


Software setup :
a) C-Tools(CDE,CDF,CDA,CGG) - Version14.06.18 stable with bootstrap support.
b) Database server for a sample query - In this example postgres - foodmart database.
3) Install D3 components plug-in from market Place


 Example 1 : 

 Step 1 : Layout : Create your layout .... Row---column--Html... Span 24 for this example
 Step 2 : Data Source : 
Driver : org.postgresql.Driver
URL : jdbc:postgresql://localhost:5432/foodmart
UserName/Password : postgres/postgres
Query : query1
select distinct first_name as letter,salary as frequency from employee where salary!=20 limit 20
Step 3: Components
D3 Components - D3 component -
In properties for Custom Chart Script write below code.
Datasoruce : query1


function f(dataset){
   

    
    var data = this.cdaResultToD3Array(dataset);
   
    
    var margin = {top: 20, right: 20, bottom: 30, left: 40},
        width = this.getWidth() - margin.left - margin.right,
        height = this.getHeight() - margin.top - margin.bottom;
   
    var formatPercent = d3.format(".0%");
   
    var x = d3.scale.ordinal()
        .rangeRoundBands([0, width], .1, 1);
   
    var y = d3.scale.linear()
        .range([height, 0]);
   
    var xAxis = d3.svg.axis()
        .scale(x)
        .orient("bottom");
   
    var yAxis = d3.svg.axis()
        .scale(y)
        .orient("left")
        .tickFormat(formatPercent);
  
  
    var svg = d3.select("#"+this.htmlObject).append("svg")
        .attr("width", width + margin.left + margin.right)
        .attr("height", height + margin.top + margin.bottom)
      .append("g")
        .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
       
       
 
   
    // Commenting this out, we have data already
    // d3.tsv("/pentaho/api/repos/d3ComponentLibrary/static/custom/data/data.tsv", function(error, data) {
   
      data.forEach(
                    function(d) {
                    d.frequency = +d.frequency;
                    }
      );
   
      x.domain(data.map(function(d) { return d.letter; }));
      y.domain([0, d3.max(data, function(d) { return d.frequency; })]);
   
      svg.append("g")
          .attr("class", "x axis")
          .attr("transform", "translate(0," + height + ")")
          .call(xAxis);
   
      svg.append("g")
          .attr("class", "y axis")
          .call(yAxis)
        .append("text")
          .attr("transform", "rotate(-90)")
          .attr("y", 6)
          .attr("dy", ".71em")
          .style("text-anchor", "end")
          .text("Frequency");
   
      svg.selectAll(".bar")
          .data(data)
        .enter().append("rect")
          .attr("class", "bar")
          .attr("x", function(d) { return x(d.letter); })
          .attr("width", x.rangeBand())
          .attr("y", function(d) { return y(d.frequency); })
          .attr("height", function(d) { return height - y(d.frequency); });
   
      d3.select("input").on("change", change);
   
      var sortTimeout = setTimeout(function() {
        d3.select("input").property("checked", true).each(change);
      }, 2000);
   
      function change() {
        clearTimeout(sortTimeout);
   
        // Copy-on-write since tweens are evaluated after a delay.
        var x0 = x.domain(data.sort(this.checked
            ? function(a, b) { return b.frequency - a.frequency; }
            : function(a, b) { return d3.ascending(a.letter, b.letter); })
            .map(function(d) { return d.letter; }))
            .copy();
   
        var transition = svg.transition().duration(750),
            delay = function(d, i) { return i * 50; };
   
        transition.selectAll(".bar")
            .delay(delay)
            .attr("x", function(d) { return x0(d.letter); }
           

            );
           
        transition.select(".x.axis")
            .call(xAxis)
          .selectAll("g")
            .delay(delay);
      }
    // });
   
}

NOTE :
1)  As the code is a replica of build in Example in Pentaho D3 plug-in , the code depends on 2 column result set of data.....

Step 4: Save dashboard and test the output
Image 1 : With sort enabled - For this you need to write below HTML code for the column of this chart in layout section .

<label><input type="checkbox"> Sort values</label>  


Image 2 : With sort check box disable


Example 2:

Why to wait ? Lets have a look at this static bar chart example in CDE( check this : http://jsfiddle.net/enigmarm/3HL4a/13/ )

Image 1:  Ascending

Image 2 : Descending
Default:

To get the above static charts on CDE output... lets do this..

Hmmmm...!!! the same  code I used from http://jsfiddle.net/enigmarm/3HL4a/13/ in CDE as an experiment..

Add HTML code at Row-Column-HTML
Add Css code at : Code Sinppet Css
Add D3 chart script code at : Custom chart script for D3 component.
Save your dashboard and preview it..


Are you eager to check it in CDE ? Download the examples here 

Click Me folk...!!! :-) 


References : 
1) http://bl.ocks.org/Caged/6476579
2) http://bl.ocks.org/mbostock/raw/3885705/
3) http://bl.ocks.org/mbostock/3885304
4) http://bl.ocks.org/mbostock/raw/3885304/
5) http://jsfiddle.net/gregfedorov/Qh9X5/9/
6) http://jsfiddle.net/uedatakuya/tXPEV/light/
7) http://jsfiddle.net/weXNd/6/










Read more »

Sunday, February 15, 2015

Not Being A Noob

Not Being A Noob
I m Not a NOOB
"Just Google it!"
"Its written right there!"
"Why cant you just ________?"
"If you cant do it, doesnt mean it doesnt work."

These are just some of the replies I frequently come across various blogs, forums and comment sections to questions and posts like:
"Fake.. Doesnt work."
"I tried but wasnt able to do it.."
"How to hack FB easily?"
"Need hacking tool for this online game.."

Amazingly, whether the question is genuine or not almost never seems to matter. On the internet, you come across all sorts of people from all ends of the earth and all walks of life. Most people, at some point or another, encounter someone who, instead of answering or ignoring their sincere query or request, chooses to be rude and mocks them. Most people also come across some others who may be getting stuck in something so basic and seemingly stupid, that they seem to be only doing this just annoy others or spam the website.

Why does this happen? Why do we see so many useless conversations? Why so many questions that have been asked and answered a million times still seem to stagger some? How to get out of this vicious cycle? How to avoid coming across as a noob and how to help others who are in fact not so different than us? Its time someone answered these questions. So, heres my attempt.

NOTE: This article is for anyone who wishes to communicate their troubles efficiently and getting their questions answered without uncalled for rudeness. Obviously, this is not for offending any group of individuals but simply a possible solution to a widespread problem.

Admittedly, this may seem a bit general but not being (or not looking like) a noob holds great importance, especially for beginner hackers. This is because, the only way to get help is from someone who has experience in this field. Getting to the point where one can help others often (seemingly) makes them forget that everyone does not have the same knowledge as them. Meaning, anyone who knows more than the other (especially in hacking) tends to get annoyed and irritated quite easily at the others apparently silly and spammy questions. Again, the question may be genuine and the person may be seriously seeking help. In this case, simply coming across as a noob may leave their questions unanswered.

The world is moving continuously and it is up to us to keep up. Forget "Survival of the fittest", its now "Thrival of the smartest". Humanitys collective intelligence will always surpass any individuals intelligence. It is for this reason, hackers, more than any other groups, should learn to learn from and teach others, peacefully. Exchange of information and ideas are the pillars keeping the hacker community alive, bonded and continually rising to greater heights.

Coming back to the main topic, lets take a look at some of the most common reasons of someone being labeled a "noob".

►Asking Google-able Questions
Theres an awful lot of people on our little planet. Say you want to go out to congratulate everyone who has a birthday today and take 10 seconds per person. Assuming a reasonable average of 20 million birthdays a day, it will take you over 6 years, if you went 24 hours a day, everyday. By that time, of course the last person would have aged 6 years and would not be very happy with you. Whats the point of telling you this? Not only that statistics are fun but more importantly: Theres an awful lot of people here. Not only more than what we think, but much more than we can think. With that in mind, theres a very good chance that if and when you face a problem, someone, somewhere has already faced and overcome that same problem in the past. Theres only so many problems the world can throw at us, but all of us have to overcome most of them. The answers are on the internet, waiting to be googled.

Further, Google has a ridiculously large webpage index (Reportedly, over 50 freaking billion pages). Say you type something in the Google search bar, notice that it comes up with numerous suggestions. That means someone has typed that before. Its like almost everything well ever think, has been thought before by someone else. Consequently, majority of what well ever search on Google has already been searched by someone else and theres a good chance the problem has already been solved.

So, before anything else one should always (ALWAYS!) try to Google out a solution for whatever problems they are facing. Not only is it much more efficient, it saves everyones time. Life is short. So, learn to Google.

►Laziness, expecting magic, asking too much
Recently, a lot of forums and Q/A websites (like www.stackoverflow.com, www.xda-developers.com) have been demanding a specific format for questions and some level of knowledge about the same. This is mainly to keep out spam as well as noobs who want to obtain something for no effort at all. Lets take an example. Try googling: "How to hack Facebook" with the quotes. We get over 20 freaking million results. Thats 20 million pages containing this exact phrase. This is one of the most common queries asked by wanna-be "hackers" (remember script kiddies?) and one of the most annoying questions that easily irritate experienced hackers, on several levels.

Most importantly, this single line is, almost always, all there is. A question on Yahoo answers, a comment on a blog or maybe a post on a forum simply stating: "How to hack Facebook?" Imagine a total stranger coming up to you and saying "Hi! I dont want to work, but I want a billion dollars and youre gonna tell me how." The obvious and justified reaction would be just staring at them and walking away silently. Although this may not be a perfect metaphor, it shows how experienced hackers look at "noobs". Hacking is not magic. When a problem presents itself, a hacker should break it down into logical steps and find a solution. Movies have engraved in the minds of naive viewers that expert hackers are practically magicians. According to movies, an expert hacker might as well be typing any nonsense on his/her keyboard (while blindfolded, of course), and the greatest glories and accomplishments shall be achieved (example: Die Hard 4.0). Entire nations can be supposedly hacked, quadrillions of dollars await hackers just a few keystrokes away and what not. According to movies, tomorrow we may even see evil hackers burning our morning toasts and remotely hacking into our mobile phones and programming them to grow wings and fly off. Just NO. Not in this universe.

Holding down the sarcasm, lets return to the question at hand. To the perplexing astonishment of "noobs", there is no top-secret software toolkit that every beginner hacker must discover to truly be an expert. When performing any hacking technique, there are a set of general steps and methods one must (usually) carry out to attempt to hack something. Further, the majority of the tools used are actually free (some even open-source) and are easily available in several places around the internet (Remember Google-able questions? This is one of them).

When a person asks a question about which they have little or even no knowledge at all, it is obviously going to drive away potential respondents. What the person needs to understand is that the respondent is doing them a favor. Nobody is going to sit down and happily write a custom tutorial, so that the person can then mindlessly follow it and obtain something they clearly do not deserve. Everyones time is valuable and if the person is asking a total stranger for a big chunk, they are going to be ignored. Google is going to come up again and again and the inquirer needs to understand this. If a common question like "how to hack Facebook?" gives dozens of search results, it is justifiably going to be ignored or even rudely mocked.

So what should be done? Does this mean one cannot even ask any questions?
No, it simply means that the respondent requires the inquirer to have a certain level of knowledge about the problem, they need to see some effort done by the person, a reason why they are worth the time. Before anything else, one should always try to figure out a solution on their own with whatever they find on a search engine. If they do that, it might directly solve their problem while earning them useful knowledge. If they fail, then simply asking "Why did this not work?" instead of "How to do this?" will differentiate them from the noobs and almost guarantee useful replies.

►Overconfidence or too much whining
Nobody likes a show-off. Dont be one. The problem with most forums and Q/A websites is that those seeking help always outnumber those providing it. It is up to the person asking the question to prove that they are worth the time. Showing off too much, being rude, "demanding" and not "asking" are sure-fire ways to get muted, ignored and even banned in some websites. On the other hand, too much whining can be equally detrimental. Admittedly, this may seem like "tough love", but you need to put yourself in the others position to understand why this happens and how to avoid it. Everybody does not have the same amount of patience, politeness, and general attitude. This difference is why, what may be right and reasonable for one, may be shockingly rude for someone else. Knowing these thin boundaries and staying well clear of them is the key to not looking like a noob.

So that covers up majority of what may make one look like a noob. If all these points are kept at the back of your mind, hopefully, youll be able to have more efficient conversations and exchange of information.

  



Read more »

Saturday, February 14, 2015

C program to write student record to a binary file


C program to write student record to a binary file

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

struct student
{
int rollno;
char *name;
int m1,m2,m3;
}s1;

void main()
{
FILE *fp;
clrscr();
fp=fopen("Record.dat","wb"); //opening binary file in writing mode
if(fp==NULL)
{
printf("File could not open");
exit(0);
}

printf("Enter student details
");

printf("Roll No:");
scanf("%d",&s1.rollno);
printf("Name:");
scanf("%s",s1.name);
printf("Marks in three subjects:");
scanf("%d%d%d",&s1.m1,&s1.m2,&s1.m3);

fwrite(&s1,sizeof(s1),1,fp);     //writing to binary file
printf("
Record has been added successfully...!!");

fclose(fp);
getch();
}
Read more »

Friday, February 13, 2015

Java program to check whether a given number is palindrome or not

Java program to check whether a given number is palindrome or not

class Palindrome
{
public static void main(String...s)
{
int n,m,rev=0,i;
n=Integer.parseInt(s[0]);
m=n;

while(n!=0)
{
i=n%10;
rev=(rev*10)+i;
n/=10;
}

if(m==rev)
System.out.println("
Number is 


palindrome");
else
System.out.println("
Number is not 


palindrome");
}
}
Read more »

C Program to reverse a string

C++ Program to reverse a string

#include<iostream.h>
#include<conio.h>
#include<stdio.h>

void main()
{
clrscr();
char a[20],a1[20];
int i,j;
cout<<"Enter any String:"<<"
";

gets(a);    cout<<"Reverse of the string is: ";

for(i=0;a[i]!=
Read more »

Thursday, February 12, 2015

C program to find whether a given number is an Armstrong number or not

C program to find whether a given number is an Armstrong number or not

#include<stdio.h>
#include<conio.h>
#include<math.h>

void main()
{
int n,m=0,x,y;
clrscr();
printf("Enter any three digit numnber:");
scanf("%d",&n);
y=n;

while(n!=0)
{
x=n%10;
m+=pow(x,3);
n=n/10;
}

if(y==m)
printf("The given number is an Armstrong number");
else
printf("The given number is not an Armstrong number");
getch();
}
Read more »

Fixing a Map Projection Issue for the Next SAR Toolbox

In the Nest Sar Toolbox you have a choice of coordinate systems:

For some of these, however, Nest reports the error "Axis Too Complex".

I compared a map projection that works with one where “Axis too complex” error is reported. Map projections that work contain these lines:
 
AXIS["Easting", EAST],
AXIS["Northing", NORTH]

While the non-working ones contain these lines, which apparently are wrong or unprocessable by NEST
  AXIS["Easting", "North along 90 deg East"], 
AXIS["Northing", "North along 0 deg"],



If you use the graph builder or command line (gpt) where the parametres are defined in an XML-file, you can manually replace these lines in the graph file (xml file) for the projection definition, then it works! An example for such an XML-file used by NEST is here.

Another example, this one works

 PROJCS["WGS 84 / Australian Antarctic Lambert", 
  GEOGCS["WGS 84", 
    DATUM["World Geodetic System 1984", 
      SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
      AUTHORITY["EPSG","6326"]], 
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic longitude", EAST], 
    AXIS["Geodetic latitude", NORTH], 
    AUTHORITY["EPSG","4326"]], 
  PROJECTION["Lambert_Conformal_Conic_2SP", AUTHORITY["EPSG","9802"]], 
  PARAMETER["central_meridian", 70.0], 
  PARAMETER["latitude_of_origin", -50.0], 
  PARAMETER["standard_parallel_1", -68.5], 
  PARAMETER["false_easting", 6000000.0], 
  PARAMETER["false_northing", 6000000.0], 
  PARAMETER["scale_factor", 1.0], 
  PARAMETER["standard_parallel_2", -74.5], 
  UNIT["m", 1.0], 
  AXIS["Easting", EAST], 
  AXIS["Northing", NORTH], 
  AUTHORITY["EPSG","3033"]]


EPSG3031 works not: 
  PROJCS["WGS 84 / Antarctic Polar Stereographic", 
  GEOGCS["WGS 84", 
    DATUM["World Geodetic System 1984", 
      SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
      AUTHORITY["EPSG","6326"]], 
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic longitude", EAST], 
    AXIS["Geodetic latitude", NORTH], 
    AUTHORITY["EPSG","4326"]], 
  PROJECTION["Polar Stereographic (variant B)", AUTHORITY["EPSG","9829"]], 
  PARAMETER["central_meridian", 0.0], 
  PARAMETER["Standard_Parallel_1", -71.0], 
  PARAMETER["false_easting", 0.0], 
  PARAMETER["false_northing", 0.0], 
  UNIT["m", 1.0], 
  AXIS["Easting", "North along 90 deg East"], 
  AXIS["Northing", "North along 0 deg"], 
  AUTHORITY["EPSG","3031"]]
Read more »