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
//MainLayout | |
const linkStyle={activeStyle: {color:'red'}} | |
export const MainLayout = props => { | |
<div> | |
... | |
//default Default loser | |
<Link to="/greeting/loser/default" {...LinkStyle}> Welcome,. Loser</Link> | |
//magic taken care of by REACT ROUTER see nested Routes in Router index.js |
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
//actions.js | |
export const ADD_PRODUCT = 'ADD_PRODUCT'; | |
export const CLEAR_FORM = 'CLEAR_FORM'; | |
.... | |
//NB Reducers MUST be pure functions | |
/* action creators */ | |
export function addProduct(product){ |
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
//implements API, looks like a regular R component | |
//just displays data as JSON | |
//uses JSON-Formatter.js https://github.com/mohsen1/json-formatter-js | |
//bundler must have acess to node_modules/dist/bundle.js | |
//bind in HTML via <script) | |
//JSONViewer.js | |
export class JSONViewer extends React.Component { | |
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
// Add all useful state specific functions here | |
export class App extends ReactComponent { | |
constructor(props){ | |
super(props) | |
this.state = {products: [{....}]} | |
// | |
_handleRemoveLast() { | |
this.setState({ |
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
def convert_to_bin_places(seq): | |
rtn = "" | |
if '>' in seq: | |
'''remove > ''' | |
seq = seq.split('>') | |
rtn = list(map(lambda x: '1' if x != '' and x == '1' else '0', seq)) | |
return "".join(rtn) | |
def convert_to_fs_places(seq): |
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
##file 1 | |
http://streaming.hkjc.edgesuite.net/mobile/audio/audio_eng_20150712.mp3 | |
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
http://www.hkjc.com/english/racing/OtherHorse.asp?HorseNo=N159 | |
http://www.hkjc.com/english/racing/horse.asp?horseno=M327 | |
There are two variants above plus a variant for retired horses | |
Each horse has a code a050 to t999 |
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
#1 | |
The data from getdata() is in the data.pkl file. | |
First create the users from tipsters = np.array(<USER.NAME>) | |
Then upload data from data.pkl, one row per user to the | |
TipsterPerformance table. | |
Note the racedate for the INIT data is say AUG 1 2015 | |
All the SQLAlchemy code should be in a separate file. | |
TipsterPerformance replaces UserPerformance. |
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
HKResults project | |
Phase 2 | |
PRELIMINARIES: | |
take hkjc_spider.py from andrey-chabrov/racingpost | |
new repo https://github.com/codervince/hkjcresults.git | |
Add following fields, e.g. | |
http://racing.hkjc.com/racing/Info/Meeting/Results/English/Local/20150524/ST/11 | |
parse_race |
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
https://github.com/codervince/rpostraceday | |
Task: | |
1. if any page (esp. pedigreequery.com) returns 404 ie no item fields matching URL, still collect and return item as before | |
2. RacedayItemLoader should TakeFirst() for [] single element lists or Join for multiple element lists - matching pipeline definitions |
NewerOlder