Programatic Accent Reduction in JavaScript (aka text normalization or unaccenting)

/** * Creates a RegExp that matches the words in the search string. * Case and accent insensitive. */ function make_pattern(search_string) { // escape meta characters search_string = search_string.replace(/([|()[{.+*?^$\\])/g,”\\$1″); // split into words var words = search_string.split(/\s+/); // sort by length var length_comp = function (a,b) { return b.length – a.length; }; words.sort(length_comp); // replace … Read more

Explaining why “Just add another column to the DB” is a bad idea, to non programmers [closed]

I tell them I can create a system of tables that allows each client to define their own set of custom fields, but of course that takes more time and money than “just adding a few columns”. I think you should push this option to your bosses since customizability is obviously a feature much in … Read more

Laying out a database schema for a calendar application

I have been struggling with the same problem, and I was actually toying with the “cache table” idea suggested above, but then I came across an alternative (suggested here) that doesn’t seem to have been represented yet. Build a table containing all events EventID (primary key) Description StartDate PeriodType – days, weeks, months, years PeriodFreq … Read more

MongoDB normalization, foreign key and joining

MongoDB doesn’t support server side foreign key relationships, normalization is also discouraged. You should embed your child object within parent objects if possible, this will increase performance and make foreign keys totally unnecessary. That said it is not always possible, so there is a special construct called DBRef which allows to reference objects in a … Read more

In what way does denormalization improve database performance?

Denormalization is generally used to either: Avoid a certain number of queries Remove some joins The basic idea of denormalization is that you’ll add redundant data, or group some, to be able to get those data more easily — at a smaller cost; which is better for performances. A quick examples? Consider a “Posts” and … Read more

Save MinMaxScaler model in sklearn

Update: sklearn.externals.joblib is deprecated. Install and use the pure joblib instead. Please see Engineero’s answer below, which is otherwise identical to mine. Original answer Even better than pickle (which creates much larger files than this method), you can use sklearn‘s built-in tool: from sklearn.externals import joblib scaler_filename = “scaler.save” joblib.dump(scaler, scaler_filename) # And now to … Read more

Normalize data before or after split of training and testing data?

You first need to split the data into training and test set (validation set could be useful too). Don’t forget that testing data points represent real-world data. Feature normalization (or data standardization) of the explanatory (or predictor) variables is a technique used to center and normalise the data by subtracting the mean and dividing by … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)