View setStateCallback.js
function handleChange(value) {
this.setState({
value: newValue
}, ()=>{
console.log(this.state.value);
});
}
View setState.js
function handleChange(value) {
this.setState({
value: newValue
});
console.log(this.state.value); //Why is my state not updated?
}
View gist:0a1e2c7dc4671735504912f83b44cf67
codemod "expect\((.*?)\.hasClass\(('.*?')\)\)\.to\.equal\(true\)" 'expect(\1.classes()).to.include(\2)'
codemod "expect\((.*?)\.hasClass\(('.*?')\)\)\.to\.equal\(false\)" 'expect(\1.classes()).to.not.include(\2)'
codemod "expect\((.*?)\.hasAttribute\(('.*?'),('.*?')\)\)\.to\.equal\(true\);" ''
View fibonacci.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="thengascript.js"></script>
View javascriptreact.json
{
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');"
],
"description": "Log output to console"
},
"Bind Function": {
"prefix": "bind",
View style.css
.container {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
View img_as_float.py
import cv2
import numpy as np
from skimage import img_as_float
#Read image from given direcotory
image = cv2.imread('C:\Python27\images\pic.jpg')
#Print pixel at (100,100)
print image[100,100]
#................ image converted to float.............
View database.py
import MySQLdb
# Open database connection
db = MySQLdb.connect("localhost","root","","dbName" )
# prepare a cursor object using cursor() method
cursor = db.cursor()
# execute SQL query using execute() method.
cursor.execute("SELECT VERSION()")
View MainActivity.java
final Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent (MainActivity.this ,DisplayActivity.class);
EditText editText = (EditText) findViewById(R.id.editText);
message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE,message);
View activity_main
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="agney.alpha.com.helloworld.MainActivity">