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. Check if a numbers is prime | |
def midpoint(a,b) | |
(a + b)/2.0 | |
end | |
def shrtcut(low,high,x) | |
guess = midpoint(low,high) | |
e_cmp = (guess * guess) - x | |
[guess,e_cmp] | |
end |
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
def suggest_playlist(track,time): | |
count = len(track) | |
for i in range(count): | |
for j in range(1, count-i): | |
if track[j-1][1]>track[j][1]: | |
(track[j-1],track[j])=(track[j],track[j-1]) | |
sum = 0 |
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
def Subsets(sets): | |
x = [[]] | |
for i in sets: | |
for j in x: | |
x = x + [j + [i]] | |
return x | |
a = [1,2,5,6] | |
print(Subsets(a)) |
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
def sorting_nums(item): | |
item = sorted(item) | |
len_item = len(item) | |
middle = len_item // 2 | |
new_item = [] | |
for i in range(middle): | |
new_item.append(item[i]) | |
new_item.append(item[-1-i]) | |
if len_item % 2 == 1: |
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
TypeError: Cannot read property 'props' of undefined | |
onAddRow | |
src/Components/Dashboard/ManageProduct.js:84 | |
81 | } | |
82 | | |
83 | onAddRow(row){ | |
> 84 | this.props.addNewProduct(row) | |
85 | } | |
86 | | |
87 | createCustomInsertButton = (onClick) => { |
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
import React, { Component } from 'react'; | |
import './../../App.css'; | |
// import afterSearch from './ManageProduct'; | |
import { Table, Button, Modal, ModalHeader, | |
ModalBody, ModalFooter, Form, | |
FormGroup, Label, Input, Col, Collapse, | |
CardBlock, Card } from 'reactstrap'; | |
import { Link } from 'react-router-dom'; |
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
import axios from 'axios'; | |
import * as actionType from './actionTypes/orderActionTypes'; | |
import setAuthorizationToken from '../Utils/setAuthorizationToken'; | |
import localforage from 'localforage'; | |
axios.defaults.baseURL = `https://api.aidahbot.com`; | |
/** | |
* PLAIN JAVASCRIPT ACTIONS | |
*/ |
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
import * as actionType from './../Actions/actionTypes/orderActionTypes'; | |
import _ from 'lodash'; | |
const INITIAL_STATE = { | |
orders: [], | |
orderIsLoading: false, | |
orderFetchSuccess: false, | |
orderStatusChange: false | |
}; |
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
import React, { Component } from 'react'; | |
import './../../App.css'; | |
// import afterSearch from './ManageProduct'; | |
import { Table, Button, Modal, ModalHeader, | |
ModalBody, ModalFooter, Form, | |
FormGroup, Label, Input, Col, Collapse, | |
CardBlock, Card } from 'reactstrap'; | |
import { Link } from 'react-router-dom'; |
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
data-order_items = | |
"[{ | |
"product_id" = "23456782cc823726323", | |
"product_name" = "Straight Hair", | |
"order_qty" = "4", | |
"order_price" = "450", | |
"_id":"655273839cc3883s33" | |
}]" |
OlderNewer