Saturday, January 23, 2016

MongoDB Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused

mongo
MongoDB shell version: 3.0.7
connecting to: test
2016-01-23T21:14:51.955+0530 W NETWORK  Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
2016-01-23T21:14:51.957+0530 E QUERY    Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
    at connect (src/mongo/shell/mongo.js:179:14)
    at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed
     [initandlisten] 


***aborting after invariant() failure



Solution:

Run mongodb with sufficient permissions.


$ sudo mongod



Sunday, December 27, 2015

Xcode issue related to bitcode

a(GGLContext+CloudMessaging.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

Wednesday, December 23, 2015

Thursday, December 3, 2015

_handleNonLaunchSpecificActions:forScene:withTransitionContext:

 ** -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] ** unhandled action -> <FBSSceneSnapshotAction: 0x15fb3d290> {
    handler = remote;
    info = <BSSettings: 0x15f9fbe50> {
        (1) = 5;
    };

}




This info is for iOS during screenshot, you can safely ignore.

Tuesday, November 17, 2015

Cordova iOS - NSAutoresizingMaskLayoutConstraints should not be in there.

Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. 
Try this: 
(1) look at each constraint and try to figure out which you don't expect; 
(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x1265957d0 V:|-(20)-[UIInputSetContainerView:0x126570180]   (Names: '|':UITextEffectsWindow:0x126530b20 )>",
    "<NSLayoutConstraint:0x1265a81e0 'UIInputWindowController-top' V:|-(0)-[UIInputSetContainerView:0x126570180]   (Names: '|':UITextEffectsWindow:0x126530b20 )>"
)

Will attempt to recover by breaking constraint 

<NSLayoutConstraint:0x1265957d0 V:|-(20)-[UIInputSetContainerView:0x126570180]   (Names: '|':UITextEffectsWindow:0x126530b20 )>

Saturday, October 10, 2015

Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating

 [initandlisten] exception in initAndListen: 98 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating


Got this issue in mac


Mongoldb instance is running in the system.


Stop the server

$mongo admin --eval "db.shutdownServer()"










Saturday, October 3, 2015

Types of Variables in Java


Based on type of value represented by a variable,


Two types of variables:

1. Primitive variables : Used to hold primitive values.

Ex:  int a = 100;


2. Reference variables : Used to hold Objects.

Ex: A a = new new A();

a -> reference


Based on Purpose and position of declaration of variable,

Three types of variables:

1. Local variables  : These variables are declared inside a method or block.

2. Static variables  : Value of  a variable does not varies from object to object.

3. Instance variables : Value of a variable varies from object to object. These are created at the time of Object creation and these are saved in heap area.







Data Types in Java

Primitive Data types are divided into two categories:

1. Numeric data type : byte, short, int ,long, float
2. Non Numeric data type : char, boolean

byte: 

1 byte = 8 bits
Range from -128 to 127

short:
1 short = 2 bytes

Range -32768 to 32767

int:

1 int = 4 bytes

long :

long = 8 bytes

char :

char = 1 byte

boolean :

boolean test = 1;      -> wrong
boolean test = true;  -> correct

Keywords in Java

The following are keywords in Java.


Keywords For Modifiers:

public
private
protected
final
static
abstract
native
synchronized
static
transient
volatile

Keywords for Data types:
char
boolean
byte
short
int
long
float
double

Keywords for Controls:

if
else
do
while
for
switch
break
continue
return

Keywords for Object related:

new
this
super
instanceof

Keywords for Exception handling:

try
catch
finally
assert
throw
throws







Identifiers in java

Identifiers:

Identifier is used to name a class, variable, method etc. A name in java program is called Identifier.


Example:

    class MyTest {
   
     }

Rules:

1. Identifier must not start with a digit.

    Sri462 -> valid
    123Sri -> Invalid

2. Identifiers are case sensitive.

Example:

class MyTest {

String name = "Srinivas";
int NUMBER = 100;

}

3. Allowed characters in java program

A to Z
a to z
0 to 9, _, $

4. Reserved words should not use.

 int for = 100;

5. All predefined class names and interface names can use as identifiers.

class MyTest {
int String =100;

public static void main(String [] args){

System.out.println(String);
}

}


6. It is not recommend to use too lengthy identifiers.