This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let async = require('async'); | |
async.autoInject({ | |
a: test1.bind(null, 1), | |
b: test2.bind(null, 2), | |
c: ['b', (b , cb)=> { | |
test4.bind(null, 3)(cb); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const errorResp = function (err) { | |
return { | |
message: 'Unable to connect to DB', | |
errorCode: 40 | |
}; | |
}; | |
// Export DB Connection function | |
mongoose.Promise = global.Promise; | |
module.exports = function (options, callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Insert into CUSTOMER (CUSTOMER_ID,FIRST_NAME,LAST_NAME,MIDDLE_NAME,ADDRESS_LINE1,ADDRESS_LINE2,CITY, COUNTRY,DATE_ADDED,REGION) values (10,'JOHN','AMIRTHRAJ','T','2345 PETERDRIVE',null,'Atlanta','USA', to_date('12-JAN-15','DD-MON-YY'),'SOUTH'); | |
Insert into CUSTOMER (CUSTOMER_ID,FIRST_NAME,LAST_NAME,MIDDLE_NAME,ADDRESS_LINE1,ADDRESS_LINE2,CITY, COUNTRY,DATE_ADDED,REGION) values (11,'TOM','JOSEPH','A','123SANDY DRIVE',null,'New York','USA', to_date('12-JAN-15','DD-MON-YY'),'SOUTH'); | |
Insert into CUSTOMER (CUSTOMER_ID,FIRST_NAME,LAST_NAME,MIDDLE_NAME,ADDRESS_LINE1,ADDRESS_LINE2,CITY, COUNTRY,DATE_ADDED,REGION) values (12,'PETER','MANN','J','3456 GATES DRIVE',null,'Washington','USA', to_date('13-JAN-15','DD-MON-YY'),'NORTH'); | |
COMMIT; | |
Insert into PRODUCT (PRODUCT_ID,PRODUCT_NAME,STANDARD_COST,COLOR,LIST_PRICE,PRODUCT_SIZE,WEIGHT, PRODUCT_CATEGORY) values (100,'Mobile Cover',30,null,35,10,100,'Mobile'); | |
Insert into PRODUCT (PRODUCT_ID,PRODUCT_NAME,STANDARD_COST,COLOR,LIST_PRICE,PRODUCT_SIZE,WEIGHT, PRODUCT_CATEGORY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE CUSTOMER ( CUSTOMER_ID NUMBER, FIRST_NAME VARCHAR2(50), LAST_NAME VARCHAR2(50), MIDDLE_NAME VARCHAR2(50), ADDRESS_LINE1 VARCHAR2(80), ADDRESS_LINE2 VARCHAR2(80), CITY VARCHAR2(40), COUNTRY VARCHAR2(50), DATE_ADDED DATE, REGION VARCHAR2(10) ); | |
CREATE TABLE PRODUCT ( PRODUCT_ID NUMBER, PRODUCT_NAME VARCHAR2(100), STANDARD_COST NUMBER(10,2), COLOR VARCHAR2(20), LIST_PRICE NUMBER(10,2), PRODUCT_SIZE NUMBER(8,2), WEIGHT NUMBER(10,2), PRODUCT_CATEGORY VARCHAR2(20) ); | |
CREATE TABLE SALES ( SALES_DATE DATE, ORDER_ID NUMBER, PRODUCT_ID NUMBER, CUSTOMER_ID NUMBER(5,0), SALESPERSON_ID NUMBER(5,0), QUANTITY NUMBER(4,0), UNIT_PRICE NUMBER(10,2), SALES_AMOUNT NUMBER(10,2), TAX_AMOUNT NUMBER(10,2), TOTAL_AMOUNT NUMBER(10,2) ); | |
CREATE TABLE SALES_HISTORY ( SALES_DATE DATE, ORDER_ID NUMBER, PRODUCT_ID NUMBER, CUSTOMER_ID NUMBER(5,0), SALESPERSON_ID NUMBER(5,0), QUANTITY NUMBER(4,0), UNIT_PRICE NUMBER(10,2), SALES_AMOUNT NUMBER(10,2), TAX_AMOUNT NUMBER(10,2), TOTAL_AMOUNT NUMBER(10,2) ); | |
CREATE TABLE SALESPERSON ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const zmq = require('/usr/local/lib/node_modules/zmq'); | |
sub = zmq.socket('sub'); | |
sub.subscribe("dat"); | |
sub.on('message' , function(topic , data) { | |
let msg = JSON.parse(data), | |
date = new Date(msg.time); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const zmq = require('/usr/local/lib/node_modules/zmq'); | |
sub = zmq.socket('sub'); | |
//subscribe to only cat topic | |
sub.subscribe("cat"); | |
sub.on('message' , function(topic , data) { | |
let msg = JSON.parse(data), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'), | |
zmq = require('/usr/local/lib/node_modules/zmq'), | |
filename = 'pub.txt'; | |
const pub = zmq.socket('pub'); | |
//watch the change in the file. | |
//when you want to sned the message make change in pub.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(sequlize, DataType) { | |
return sequlize.define('todo', { | |
description: { | |
type: DataType.STRING, | |
allowNull: false, | |
validate: { | |
len: [1, 250] | |
} | |
}, | |
completed: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Can you get the process running for specific user | |
ps –u username | |
2. What is system call | |
In computing, a system call is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on. This may include hardware-related services (for example, accessing a hard disk drive), creation and execution of new processes, and communication with integral kernel services such as process scheduling. System calls provide an essential interface between a process and the operating system | |
3. What is kernel panic | |
A kernel panic is a computer error from which the operating system (OS) cannot quickly or easily recover. The term applies primarily to Unix-based systems and to Mac OS X. In other systems, the equivalent of a kernel panic is known by slang terms such as blue screen of death, sad Mac or bomb | |
4. Can u tell me how to check system call are being made by one process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b(main):001:0> Problem.all | |
NoMethodError: undefined method `all' for Problem:Module | |
from (irb):1 | |
from /home/abuzar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/console.rb:110:in `start' | |
from /home/abuzar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/console.rb:9:in `start' | |
from /home/abuzar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:68:in `console' | |
from /home/abuzar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!' | |
from /home/abuzar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>' | |
from /home/abuzar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require' | |
from /home/abuzar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in |
NewerOlder