TinyMCE Paste As Plain Text

This is what i do to get paste plain text. 1. paste_preprocess setting (in tinymce init) paste_preprocess : function(pl, o) { //example: keep bold,italic,underline and paragraphs //o.content = strip_tags( o.content,'<b><u><i><p>’ ); // remove all tags => plain text o.content = strip_tags( o.content,” ); }, 2. function strip_tags (on the main document) // Strips HTML and … Read more

Array of Matrices in MATLAB

Use cell arrays. This has an advantage over 3D arrays in that it does not require a contiguous memory space to store all the matrices. In fact, each matrix can be stored in a different space in memory, which will save you from Out-of-Memory errors if your free memory is fragmented. Here is a sample … Read more

Required Attribute Not work in Safari Browser

Safari, up to version 10.1 from Mar 26, 2017, doesn’t support this attribute, you need to use JavaScript. This page contains a hacky solution, that should add the desired functionality: http://www.html5rocks.com/en/tutorials/forms/constraintvalidation/#toc-safari HTML: <form action=”” method=”post” id=”formID”> <label>Your name: <input required></label><br> <label>Your age: <input required></label><br> <input type=”submit”> </form> JavaScript: var form = document.getElementById(‘formID’); // form has … Read more

System.Threading.Tasks – Limit the number of concurrent Tasks

I know this is almost a year old, but I have found a much easier way to achieve this, so I thought I would share: Dim actionsArray() As Action = new Action(){ New Action(Sub() DoComputation1()), New Action(Sub() DoComputation2()), … New Action(Sub() DoComputation100()) } System.Threading.Tasks.Parallel.Invoke(New Tasks.ParallelOptions() With {.MaxDegreeOfParallelism = 5}, actionsArray) Voila!

Android Facebook SDK 3.0 gives “remote_app_id does not match stored id” while logging in

Another possible error (which happened with me) is: to set up a “Key Hash” at Facebook App Console and to sign the android app using another keystore. Unfortunately this is caused because Facebook Getting Started Tutorial induces this error. It says that android developers should use default android debug key in your examples and doesn’t … Read more

Save results to csv file with Python

I know the question is asking about your “csv” package implementation, but for your information, there are options that are much simpler — numpy, for instance. import numpy as np np.savetxt(‘data.csv’, (col1_array, col2_array, col3_array), delimiter=”,”) (This answer posted 6 years later, for posterity’s sake.) In a different case similar to what you’re asking about, say … Read more