Friday, January 15

Good Marketing is an Efficiency Choice for startups

For startups we have to look for maximum impact by the marketing effort. The key is Efficiency. How much ROI can u get from the single rupee spend.




Site with Brilliant Effective Marketing


This site wanted more new registrations. How can we do that ?

"Create Artificial Scaricity".


Designers of this site have carefully positioned it as "Request Invite" instead of just one common "Register" for all users.

Actual Previous Registered Users may be very less (lets say 50  but no one knows that)

Now all the other users feels insecure for not being part of this Exclusive Club because entry is Invite only.


In normal case with just one "Register" button in the site, it may have lost most users who have visited the site but for "Request Invite" case  most users would definetley hurry to be the part of  the invitation list.


This is a  simple brilliant design to route more users to the targeted action. "Registration"






















Monday, July 20

Ouch! High Salary can Hurt Me!

high salary hurts image

The Story from Employee's Point of View

Its a great joy to work in a place that you are passionate about.

When we join a new company, we are actually both excited and curious to know

  • "How is to work here?"
  • Experience new Culture
  • Meet new people
  • Explore new work place
  • Learn new things
  • New Responsibilities
This is a great time for us, but overtime this joy wont last and you would feel 
  • Its a Boring place
  • Same old people
  • Relatively same Responsibilities
  • Nothing new to learn
  • Same old Customs and Pratices
  • Very Mechanical
Overtime everything becomes opposite of what u felt when you joined. You are no longer motivated to work in that place and you want to migrate to a new company. Ahh! now is the time when High Salary is going to cause you pain. 

If you are receiving high salary then opportunities for a new job is scarce. If you salary is well above the market price then you are going to find it very difficult to bag a job opening. 

High Salary will become the transparent chain enslaving you to do the miserable work.

From Employers point of View

What a great weapon, if we want skilled people to work for us.

For a business to sustain, customers must trust in the service or goods provided. To build the best quality service or goods, we need highly skilled people. Skilled people will find it easy to transition to another company. This is one of the big problem the employers face 'Attrition'. Losing a key employee, will slow or stop the development or business process. To replace the key employee, with the right candidate takes some time and money.
  • Time and Cost to find similarly skilled person
  • Time and Cost to train the domain knowledge
  • Time to get accustomed with the Company Customs and Practices
This time lost to replace a key employee will hurt the business  and its brand very badly.

A employer is afraid to bid for a tender or sign a new business contract  because he is worried what if the key employees migrate to another company during the development phase or later during the support phase. The employer can sleep peacefully only when he knows that his key employees are not going to migrate anywhere. For employers, the human is the only emotional and unpredictable resource needed in the production. So the best tool he has in his arsenal is High Salary.


Tuesday, June 9

Understanding your Business Model

Having a idea is the romantic period but to execute is a lot of effort and work.

For pitching your idea it is essential to know ur  business structure and plan. First entrepreneur must have clear idea of the busines model with all the 9 blocks.




Who is your customer segments ?

Mass Market has more chance to get investment but the segment is highly competetive.

Niche Market is a highly specific customer segment. eg like Defence Fighter Jets, Rolls Royce Car

Segmented Market is a customer base with different needs. eg like Ice cream packaged in cups and family packs.

Diversified Market is diversifying your infrastructure to two unrelated customer segements. eg like post office used for banking service or mobile telecom companies  selling customer data insights, push free partnershippped applications/service


What values can u provide to your customer?

  • Is the product/service a new or unique,
    • improved Performance, 
    • Design and Brand value,
    • less Cost, 
    • more Functional use 
    • and/or Accessible. 
Accessibility is making it more availalbe like Rolls Royce charging only for the number of hours the Jet engine is used instead of selling the engine.

What would be your revenue streams?

  • Sale of items,
  • Usage fee, 
  • Subscription fee, 
  • Leasing, 
  • Licensing,
  • Brokerage 
  • and/or Advertising.

What kind of Customer Relationships ?

  • One to One Assistance
  • Self Service
  • Automated Service
  • Community
  • Co-Creation
Co-Creation is like a Book selling ecom site Infibeam allowing customers to  write reviews which create value for book readers.

What are the Key Activities ?

  • Production
  • Problem solving
    • Customer Relaionship
    • Product Innovation
  • Platform /  Network

What are the Key Partnerships ?

  • Strategic Partnership with non-competitors
  • Stratetigic Alliance with competitors inorder to devlop a new technology eg. Android OS
  • Joint Venture to devlop new businesses
  • Buyer-Supplier relationship to assure reliable supplies

Characterisitcs of Cost Structure

Fixed Cost : Cost remains same regardless of volume of goods and services like Salaries and Rent.

Variable Cost : Cost remains proportional to voulume of goods and services.

Economies of scale : Cost per unit output decreases as the number of unit output increases

Economies of scope :  Reduce the cost by leveraging on unused infrastructure or operation. like Amazon opened up Cloud Computing Service developed for ecom platform.


References:



Thursday, April 23

Custom Virtual Host in Apache2 in Ubuntu

 
cd ~
mkdir public_html
 
Now for each domain create a folder with following template
 
mkdir -p public_html/domain1.com/{public,private,log,cgi-bin,backup}


 
NameVirtualHost *:80
Listen 80
 
Make sure this setting is set either in ports.conf or apache2.conf or httpd.conf or in sites-available/default
 
Now create the vhost file for domain1.com in /etc/apache2/sites-available/domain1.com

with the following settings

<VirtualHost *:80>
  
  ServerAdmin webmaster@domain1.com
  ServerName  domain1.com
  ServerAlias www.domain1.com


  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html
  DocumentRoot /home/username/public_html/domain1.com/public


  # Custom log file locations
  LogLevel warn
  ErrorLog  /home/username/public_html/domain1.com/log/error.log
  CustomLog /home/username/public_html/domain1.com/log/access.log combined

</VirtualHost>
 
 
Now to enable the site in sites-enabled
sudo a2ensite domain1.com
 
and then restart the apache2 server
sudo service apache2 restart
 
Modify the host file '/etc/hosts' 
 
127.0.0.1    localhost 
127.0.0.1    domain1.com
 
 
 Now set the owner permissions

~/public_html/domain1.com$ sudo chown -R username:www-data cgi-bin log public
~/public_html/domain1.com$ sudo find ./public -type d -exec chmod 775 {} \;
~/public_html/domain1.com$ sudo find ./public -type f -exec chmod 774 {} \;

likewise for log and cgi-bin
 
 

References

1. Apache Virtual Hosts
2. Permissions for /var/www/html 
3. Chmod only to folders and its subfolders 

Thursday, February 12

Wireshark NPF driver isn't working

Wireshark is an network analyzer. Wireshark depends on another utility process called WinPcap.

If the WinPcap service is not running in the background then we get the error "The NPF driver isn't running.  You may have trouble capturing or listing interfaces."



Solution


  1. Open Command prompt by right clicking on it  and "Run as administrator".
  2. Goto "cd Windows\System32" directory
  3. Start the "net start npf"
  4. After the success message, Restart the Wireshark

Friday, October 31

Codenameone Flow Order

This is the flow order of functions that is loaded when an application created using codenameone framework starts

 1. ImmuntiyMeterApp.init(Object context)

 2. ImmuntiyMeterApp.start()

 3. StateMachine.initVars(Resources res)

 4. StateMachine.beforeMain(Form f)

 5. StateMachine.postMain(Form f)

 6. StateMachine.StateMachine(String resFile)

Saturday, October 25

The Web Developer's must have Tool - Firebug



Without Firebug i wouldn't have learned the HTML, CSS, Javascript or the working of Web very quickly.

Firebug is a add-on that is available with  firefox browser and a firefox-lite with chrome.

So what is so great about the Firebug? 

1.  Firebug lets you inspect each HTML elements (like <a>, <div>, <table> ...) and when you inspect the element then the element, its margin, padding, border gets highlighted.

2. On inspecting a element, you can also the view the CSS used to style that part. You can also manipulate and tweak the css to view the result on the fly.

3. To see what all resources are loaded when a page is requested.To find out the time taken and the order in which the resource is loaded. To find out the status, url, domain, ip, size and Header info.

4. To debug JavaScript, to trace the stack flow of the script, to break the script and inspect the DOM and other elements at that time.

Tuesday, July 29

Irony of Science in Eid al-Fitr

In today’s world, the science has grown incredibly that we have Hubble Space Telescope  launched into space watching the universe in different spectrums. We have satellites for weather predictions; we have Terrestrial Space observatory Telescope's watching for flares in sun and climate in Jupiter. We have even accurately and safely landed man on the moon. 

We can even accurately predicate solar and lunar eclipse, the exact points in earth where it would be visible. We have even predicated the next arrival of Halley's Comet  and also the distance away from the earth. The next arrival of Halley's Comet is on 28th July 2061, and then on 7th May, 2134  and it will pass within 13.9 million km from earth.

Halley's Comet May 29 1910


In spite of all these feats, we still haven’t been able to predicate accurately the Eid al-Fitr. In India, all banks and govt office calendars marked 28th July as Eid al-Fitr holiday but it was predicted a day earlier.

The date of Eid al-Fitr for a region is confirmed by the sighting of the new moon.in that particular region. In countries like India, where even the whole nation has same time-zone can't still predicate when the new moon will occur.

Saturday, July 26

How much is the Advertisment Revenues in Media


Advertisment is the primary revenue for most media.


Industries that are spending  in online medium.
  • Electronics
  • Fashion - Men
  • Fashion - Woman
  • Baby Care
  • Video Games
  • Fitness
  • Health Care
  • Car
  • Bike
  • Jewellery
  • Dating

Sunday, July 13

To insert debug code in all functions using regular expression


Lets illustrate with a Javascript  Source Code and Notepad++ IDE

Regular Expression to Find functions

((\w*)\s*[:|=]\s*function\(\w*\)\s*\{)

Debug Code to insert inside each functions

console.log("functionName");

Regular Expression to Insert Debug Code inside Functions

$1 \n\tconsole\.log\("$2"\)\;

Note: Please enable "Regular expression" and ". matches newline" in Search Mode in Replace box in Notepad++ for inserting inside more than 1 function using regular expression.


A sample Javascript before inserting Debug code

var SyntaxHighlighter = function() {
    var sh = {
        all: function(params)
        {
            attachEvent(
                window,'description'
            );
        }
    };
}();

Javascript code after inserting Debug code using Regular Expression

var SyntaxHighlighter = function() {
      console.log("SyntaxHighlighter");
    var sh = {
        all: function(params)
        {
            console.log("all");
            attachEvent(
                window,'description'
            );
        }
    };
}();


To know more about How this Regular Expression Works and Customisation


Saturday, June 21

Eclipse IDE Shortcuts

1.   System.out.println();


syso + Ctrl + Space

2.  Toggle Comment

Ctrl + Shift + C

3.  Run Application

Ctrl + F11

4.  Import all packages

Ctrl + Shift + O

5.  Auto Complete

Ctrl + Space

6. Generate Getter and Setter

Ctrl + Shift + G

But this shortcut is not default one, so you have to set it in eclipse.

Steps to map a command to desired key combination:
  1. Goto 'Windows' menu -> 'Preferences' ->'General' -> 'Keys'
  2. In 'type filter text', type 'getter'
  3. Select command 'Generate Getters and Setters'
  4. Below in 'Binding' field, press CTRL + SHIFT + G
  5. In 'When' selection below, select 'In Windows'
  6. Click 'Apply'.
  7. If in any case there shows Conflicts then either unbind the old one or change your key combo.
  8. Click 'OK'


Saturday, May 31

Protect your Privacy in Internet from Google and other Service Providers


DNS Servers
Usually there are two DNS Servers

Prefered  DNS server : 5.135.165.179
Alternate DNS server : 8.8.8.8

Here 8.8.8.8 is the Public DNS service provided by Google.


So best way to protect yourself is by using DNS servers of your ISP or OpenDNS

BSNL DNS Server 1 :  218. 248.240.208
BSNL DNS Server 2 :  218. 248.240.23

or

OpenDNS Server1    :  208.67.222.222

OpenDNS Server2    :  208.67.220.220



More detailed reasoning at How you have no privacy from Google and other service providers



Sunday, May 25

Install LAMP (Linux Apache Mysql PHP) in ubuntu

 

Step 1 : Install Apache2

sudo apt-get update
sudo apt-get install apache2
To check the installation,try the following address in the browser
http://localhost:80/ 

Step 2 : Install Mysql

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
Enter the mysql root password,when promted during installation To do simple auto configuration of mysql follow these commands

sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
Then enter the mysql root password entered earlier
press 'n' to not change the current password

Remove anonymous users? [Y/n] y 
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] n
Reload privilege tables now? [Y/n] y
For Production machines, press 'y' for option 'Remove test database and access to it?'

Step 3 : Install PHP

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
Then after installation, open below file and edit with sudo privelege.
etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>

          DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

</IfModule>
To install other php modules or extension, first find it
apt-cache search php5-
Then install that required module
sudo apt-get install <module_name>
The default server public folder is in the below path
/var/www/

Step 4 : Restart Apache Web Server

sudo service apache2 restart 

Friday, April 11

String is immutable in java


Yes, it true that string is immutable in java which means that the String object doesn't change.
But that can't be true because we have seen many occasions in the program where the String variable is changed.

Yes its true, but we have our understanding of String a bit wrong here. Actually unlike C program, in Java, String is not a primitive variable but a special Class. So in our code  actually we are creating a String object for new character sequence.

For more understanding go to this link String can't be immutable in java

Friday, April 4

Neo4j Community Build Error


To build the neo4j community,  I am following  the steps as done in Travis CI link here.

But i am getting the error below
[ERROR] Failed to execute goal org.neo4j.build.plugins:license-maven-plugin:3:check (check-licenses) on project neo4j-kernel: Some files do not have the expected license header -> [Help 1] 
To solve this "Build the community/license-check submodule first." as suggested in SO link here.

But still i am getting the same error.

Please check whether my steps taken are correct or not.


/$ mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.6.0_30, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-60-generic", arch: "amd64", family: "unix"



/$ cd ~/Workspace/neo4jdev/community-experiments/licensecheck-config/
~/Workspace/neo4jdev/community-experiments/licensecheck-config$ mvn install

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.239s
[INFO] Finished at: Fri Apr 04 15:06:07 IST 2014
[INFO] Final Memory: 14M/148M



~/Workspace/neo4jdev/community-experiments/licensecheck-config$ cd ..
~/Workspace/neo4jdev/community-experiments$ MAVEN_OPTS="-Xss2m -Xmx1G"
~/Workspace/neo4jdev/community-experiments$ mvn install -DskipTests

[INFO] --- license-maven-plugin:3:check (check-licenses) @ neo4j-kernel ---
[INFO] Checking licenses...

[INFO] [INFO] Missing header in: /~/Workspace/neo4jdev/community-experiments/kernel/src/test/java/org/neo4j/unsafe/batchinsert/BatchInserterImplTest.java
[INFO] Missing header in: /~/Workspace/neo4jdev/community-experiments/kernel/src/test/java/org/neo4j/kernel/RaceBetweenCommitAndGetMoreRelationshipsIT.java
[INFO] Missing header in: /~/Workspace/neo4jdev/community-experiments/kernel/src/main/java/org/neo4j/tooling/GlobalGraphOperations.java

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Neo4j - Graph Database Kernel ..................... FAILURE [1.719s]
[INFO] Neo4j - JMX support ............................... SKIPPED
[INFO] Neo4j - Usage Data Collection ..................... SKIPPED
[INFO] Neo4j - Graphviz generation ....................... SKIPPED
[INFO] Neo4j - Lucene Index .............................. SKIPPED
[INFO] Neo4j - Graph Algorithms .......................... SKIPPED
[INFO] Neo4j - Graph Matching ............................ SKIPPED
[INFO] Neo4j - Cypher .................................... SKIPPED
[INFO] Neo4j Community ................................... SKIPPED
[INFO] Neo4j Community ................................... SKIPPED
[INFO] Neo4j - Generic shell ............................. SKIPPED
[INFO] Neo4j Examples .................................... SKIPPED
[INFO] Neo4j Server API .................................. SKIPPED
[INFO] Neo4j Server ...................................... SKIPPED
[INFO] Neo4j Server Examples ............................. SKIPPED
[INFO] Licensing configuration ........................... SKIPPED
[INFO] Neo4j Community Build ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.427s
[INFO] Finished at: Fri Apr 04 15:08:26 IST 2014
[INFO] Final Memory: 14M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.neo4j.build.plugins:license-maven-plugin:3:check (check-licenses) on project neo4j-kernel: Some files do not have the expected license header -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


Resolved

The license check is failing may because of some repository url may have changed,  which we have no control of so its better to skip the license check.

The following command will help to skip license check and build sucessfully.
$ mvn install -DskipTests -Dlicensing.skip

In linux os, it build successfully but in windows there were some issues in project "neo4j-browser" so i skipped that project to successfully  build in windows too.

Below is the error in windows in project neo4j-browser
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Licensing configuration ........................... SUCCESS [  2.796 s]
[INFO] Neo4j - Primitive Collections ..................... SUCCESS [  0.794 s]
[INFO] Neo4j - Graph Database Kernel ..................... SUCCESS [01:34 min]
[INFO] Neo4j - JMX support ............................... SUCCESS [  1.362 s]
[INFO] Neo4j - Usage Data Collection ..................... SUCCESS [  3.880 s]
[INFO] Neo4j - Monitor Logging ........................... SUCCESS [  1.120 s]
[INFO] Neo4j - Graphviz generation ....................... SUCCESS [  1.592 s]
[INFO] Neo4j - Lucene Index .............................. SUCCESS [  4.390 s]
[INFO] Neo4j - Graph Algorithms .......................... SUCCESS [  2.070 s]
[INFO] Neo4j - Graph Matching ............................ SUCCESS [  1.230 s]
[INFO] Neo4j Community Cypher Build ...................... SUCCESS [ 11.080 s]
[INFO] Neo4j - Cypher Commons ............................ SUCCESS [ 50.804 s]
[INFO] Neo4j - Cypher Compiler 2.1 ....................... SUCCESS [03:45 min]
[INFO] Neo4j - Cypher .................................... SUCCESS [ 37.636 s]
[INFO] Neo4j Community ................................... SUCCESS [  1.420 s]
[INFO] Neo4j GraphGist ................................... SUCCESS [  6.780 s]
[INFO] Neo4j - Cypher Documentation ...................... SUCCESS [ 36.070 s]
[INFO] Neo4j Community ................................... SUCCESS [  0.750 s]
[INFO] Neo4j - Generic shell ............................. SUCCESS [  3.550 s]
[INFO] Neo4j Examples .................................... SUCCESS [  1.790 s]
[INFO] Neo4j Server API .................................. SUCCESS [  1.920 s]
[INFO] Neo4j Browser ..................................... FAILURE [  0.430 s]
[INFO] Neo4j Server ...................................... SKIPPED
[INFO] Neo4j - Server Plugin Tests ....................... SKIPPED
[INFO] Neo4j Server Examples ............................. SKIPPED
[INFO] Neo4j Community Build ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 08:15 min
[INFO] Finished at: 2014-04-11T17:08:08+05:30
[INFO] Final Memory: 54M/302M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (default) on project neo4j-browser: An An
t BuildException has occured: unless=cmdsuccess -> [Help 1]

Now if you want to continue by skipping the project "Neo4j Browser", follow the below command
$ mvn install -DskipTests -Dlicensing.skip -e -rf :neo4j-server


Atlas, successfully build
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Neo4j Server ...................................... SUCCESS [01:55 min]
[INFO] Neo4j - Server Plugin Tests ....................... SUCCESS [  3.482 s]
[INFO] Neo4j Server Examples ............................. SUCCESS [  1.880 s]
[INFO] Neo4j Community Build ............................. SUCCESS [  0.440 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:05 min
[INFO] Finished at: 2014-04-11T17:20:07+05:30
[INFO] Final Memory: 46M/227M
[INFO] ------------------------------------------------------------------------


Saturday, February 16

Difference between public, private, protected and default



 

  Access Modifier Visibility


Modifier
Class
Package
Subclass
Everywhere
public
Yes
Yes
Yes
Yes
protected
Yes
Yes
Yes
No
default
Yes
Yes
No
No
private
Yes
No
No
No

public  - Members are visible in same class, same package, sub classes and in other classes.

protected - Members are visible in same class, same package, sub classes but not in other classes.

default - Members are visible in same class, same package but not in sub classes and other classes.

private - Members are visible only in same class but not in same package, sub classes and other classes.

  

  Access Modifier Level Applicability


Modifier
Member Field
Member Method
Nested Class
Top Level Class
public
Yes
Yes
Yes
Yes
default
Yes
Yes
Yes
Yes
private
Yes
Yes
Yes
No
protected
Yes
Yes
Yes
No
 
 public, default  - These modifiers can be applied to members of the class and also to the top class. 

 private, protected  - These modifiers can be applied to member of a class only but not to the top class.



Simple Inheritance

parent.java
package r1;
public class parent
{
        int x;
      
       public parent()
       {
              x=10;
       }
             
       public static void main(String args[])
       {
             
              parent p = new parent();
              System.out.println("parent main x="+p.x);
       }
}

Output
parent main x=10


sub1.java
package r1;
public class sub1 extends parent  // a subclass of parent
{
       sub1()
       {
              x=20;
       }
      
       public static void main(String args[])
       {
              sub1 s1 = new sub1();
              System.out.println("In r1 pckg, sub1 class, main fn, sub1.x = "+s1.x);           
       }     
}

Output
In r1 pckg, sub1 class, main fn, sub1.x = 20


Examples of  Access Modifiers

Following are the errors that occurs if access modifiers are not used properly:


private - The field parent.x is not visible

parent.java
package r1;
public class parent
{
        private int x;      // private access modifier
}

sub1.java
package r1;  // same package as the parent
public class sub1 extends parent  // a subclass of parent
{
       sub1()
       {
              x=20;
       }
      
       public static void main(String args[])
       {
              sub1 s1 = new sub1();
              System.out.println("In r1 pckg, sub1 class, main fn, sub1.x = "+s1.x);           
       }     
}
Output
The field parent.x is not visible

Because: sub1.java is not the same class where x is declared.



default - The field parent.x is not visible

parent.java
package r1;
public class parent
{
        int x;  // no access modifier is default
}

sub2.java
// sub2 class is not part of r1 package
import r1.parent;   // so  its imported
public class sub2 extends parent  // a subclass of parent
{
       sub2()
       {
              x=30;
       }
      
       public static void main(String args[])
       {
              sub2 s2 = new sub2();
              System.out.println("In no pckg, sub2 class, main fn, sub2.x = "+s2.x);
       }     
}

Output
The field parent.x is not visible

Because: sub2.java is not in the same package of parent where x is declared.



 protected - The field parent.x is not visible

parent.java
package r1;
public class parent
{
        protected int x;  // protected access modifier
}

some1.java
// some1 class is not part of r1 package
import r1.parent;
public class some1 // not a subclass of parent
{            
       public static void main(String args[])
       {
          parent p = new parent();
          System.out.println("In no pckg, some1 class, main fn, parent.x = "+p.x);
       }     
}

Output
The field parent.x is not visible

Because: some1.java is neither in the same package nor in subclass of parent  where x is declared.