How to bind action creator to component in redux thunk

I’m trying to bind my action creator to react component. Please find below code snippet: import { updateCities } from ‘../../redux/actions/home’; class Home extends React.Component { constructor(props) { super(props); this.updateCities = updateCities.bind(this); this.something = ‘some value’; } render() { const { updateCities, home } = this.props; return ( <div> <div> <input onChange={e => { const…

Details

How to build a regular expression in Javascript that matches 1,234.56 1.234,56 1234.56 and 1234,56?

I am trying to build a regular expression that matches the numbers with “,” and “.” as delimiters of thousands and decimals respectively and vice versa. 1,234.56 1.234,56 1234.56 1234,56 This regular expression: /^(\d{1,3}(?:([,\.])\d{3}){1}(?:\2\d{3})*|\d+)(?:(?!\2)[,\.](\d*))?$/ matches 1 and 2, but not 3 and 4. What I try to do is capture the thousands delimiter and prevent…

Details

How to merge two csv files without duplication one column?

I have 2 csv files ,one contain( UserId,MovieId,Rating ) second contain(MovieId,title,genres).I want to merge them in one file without duplicate MovieId.I used union function but get me only one file. import sqlContext.implicits._ import sqlContext._ case class DataClass(UserId: Int, MovieId:Int, ratings: Double) val Data = sc.textFile(“file:///usr/local/spark/dataset/rating.csv”).map(_.split(“,”)).map(p => DataClass(p(0).trim.toInt, p(1).trim.toInt, p(2).trim.toDouble)).toDF() case class DataClass2( MovieId:Int, title: String,genres:String)…

Details