This file contains hidden or 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
// Filepath: models/genre.js | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var GenreSchema = Schema({ | |
name: {type: String, required: true, min:3, max: 100, unique: true}, | |
description: {type: String, max: 500}, | |
}); |
This file contains hidden or 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
I am using Django version 1.11 | |
In the created app, add directory to store (static) JavaScript file(s) in it. | |
In my case I have created "div_showhide.js" file in this location- | |
MY_APP_NAME/static/MY_APP_NAME/js/admin/div_showhide.js | |
New directories are: | |
static/ | |
MY_APP_NAME/ |
This file contains hidden or 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
Problem Scenerio: | |
================ | |
A) System add new records to be processed for futher into another database table. | |
B) System update exiting records to be deleted from the current database table. | |
The process A and/or B can be happened any number of times. So system needs to | |
process each record for an entity depending on it is recently added or deleted. | |
SQL: | |
==== |
This file contains hidden or 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
<?php | |
// File: module/Tld/src/Tld/Module.php | |
namespace Tld; | |
use ZF\Apigility\Provider\ApigilityProviderInterface; | |
use classes\TldMaster; // this class is simple class outside ZF2 | |
class Module implements ApigilityProviderInterface | |
{ |
This file contains hidden or 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
$api_records = getDataFromAPI(); // Fetchh data from DB/ or from another API | |
$keys = array('productID' => '', 'code' => '', 'parentProductID' => ''); | |
$product_ids = getArrayFrom2dArray($api_records, $keys); | |
/** | |
* | |
* @param array $records [2 dimensional associative array] | |
* @param array $keys |
This file contains hidden or 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
Ensure that you have installed library as given below; this will solve error "OSError: mysql_config not found". | |
sudo apt-get install libmysqlclient-dev | |
Thanks: http://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found | |
In your python environment install mysqlclient as shown below- | |
pip install mysqlclient |
This file contains hidden or 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
public class AsyncCallDvcsApi extends AsyncTask<String, Void, String> { | |
private Activity mActivity; | |
public AsyncCallDvcsApi(Activity activity) { | |
this.mActivity = activity; | |
} | |
protected void onPreExecute() { | |
dialog = ProgressDialog.show(this.mActivity, | |
DvcsConstant.MSG_TITLE_LOADING_DIALOG, |
NewerOlder