text:
Q: Regex to Match only language chars (all language)? I need to restrict  users input only to alpha numeric chars.
If it was only in English It would be easy $[a-z]^/i
But I need to do it global, e.g. for every language. Is there a sequential Unicode range that include all "chars" ? If not, how can I do it?
p.s. I saw this answer but the answer was for python.

A: If you use Steve Levithan's XRegExp package with Unicode add-ons, then it's easy:
var regex = XRegExp('^\\p{L}*$');

(Note that ^ is the start-of-string anchor, and $ is the end-of-string anchor, not vice versa)
In plain JavaScript, you need to construct the ranges yourself. I've taken the liberty to construct a plain-JavaScript regex from Steve's source code:
/^[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/

So you can use that instead, if you just need exactly that feature and not the entire XREgExp package.

*

*Working jsbin.

A: With Unicode Property Escapes, you can match a letter from any language with the following simple regular expression:
/\p{Letter}/u

Or with the shorthand
/\p{L}/u

Unicode Property Escapes can be transpiled down to ES5 with a tool called regexpu.
transpiled code for all language char with space :
/(?:[^A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\s]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])/gi

transpiled code for all language char and numeric digit:
/(?:[^A-Za-z0-9\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\s]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])/gi

this question was answered here by(Loilo) i have added some modification for space and number
Regular expression to match non-ASCII characters?

A: I used this Regex to allow English, Kannada alphabets and only spaces.
    ^[0-9a-zA-Z\s\u0C80-\u0CFF]+$


text:
Q: Matplotlib cmap only showing grey I'm plot with matplotlib on python using 'tab20' color map with the following code:
colors=[str(float(year-1980)/(2017-1980)) for i in years];
fig,ax = plt.subplots()
ax.scatter(Topic[:,0],Topic[:,1],c=colors,cmap='tab20')

but the plot I get is completely grey. What could be the reason?

A: By passing a list of strings to c in your ax.scatter call, you're telling matplotlib to treat them as color format strings. Since the strings look like they represent floats, it treats them as grayscale values. If you pass a list of floats instead, it should use the colormap correctly:
colors = [float((year-1980)/(2017-1980)) for year in years]
See the docs for more details, in particular:

cmap : Colormap, optional, default: None
A Colormap instance or registered name. cmap is only used if c is an
  array of floats.

(Also, you don't need the ; after your first line.)

A: Solved by using
    colors=[cm.RdYlBu(float(year-1980)/(2017-1980)) for i in years];
because I need to convert the float number to the colormap I wanted to use.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Install R in docker image How do I install R version 3.4.0 in my docker image. I've installed python using:
RUN yum -y install https://centos6.iuscommunity.org/ius-release.rpm \
  && yum -y install python36u \
  && yum -y install python36u-devel \
  && yum -y install python36u-pip \
  && yum -y install python36u-tkinter.x86_64

Similarly I need to install R:
I've specified following things in file so far for R:
ENV R_BASE_VERSION 3.4.0
RUN Rscript -e 'install.packages("devtools",dependencies=TRUE)' \
    &&Rscript -e 'install.packages("methods",dependencies=TRUE)' \
    &&Rscript -e 'install.packages("jsonlite",dependencies=TRUE)' \

Please suggest .I'm new to docker
I think I need to do something like below:
ENV R_BASE_VERSION 3.4.1

## Now install R and littler, and create a link for littler in /usr/local/bin
## Also set a default CRAN repo, and make sure littler knows about it too
RUN apt-get update \
    && apt-get install -t unstable -y --no-install-recommends \
        littler \
                r-cran-littler \
        r-base=${R_BASE_VERSION}* \
        r-base-dev=${R_BASE_VERSION}* \
        r-recommended=${R_BASE_VERSION}* \
        && echo 'options(repos = c(CRAN = "https://cran.rstudio.com/"), download.file.method = "libcurl")' >> /etc/R/Rprofile.site \
        && echo 'source("/etc/R/Rprofile.site")' >> /etc/littler.r \
    && ln -s /usr/share/doc/littler/examples/install.r /usr/local/bin/install.r \
    && ln -s /usr/share/doc/littler/examples/install2.r /usr/local/bin/install2.r \
    && ln -s /usr/share/doc/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
    && ln -s /usr/share/doc/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
    && install.r docopt \
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
    && rm -rf /var/lib/apt/lists/*

But I do not know what is this litter and all. I just need R to be installed and then i will install required packages as I have specified above.
Edits : First line in my docker file installs node4.

A: Here are two DockerFile to install Python, R and NodeJS
The first one installs Python 3.4.2, R 3.1.1 and nodejs 4.8.4:
From node:4
RUN apt-get update && apt-get remove -y python && apt-get install -y python3 r-base
RUN cp /usr/bin/python3 /usr/bin/python

This second one installs Python 3.5.3, R 3.4.1 and nodejs 4.8.4:
From r-base:3.4.1
RUN apt-get update && apt-get install -y python3 nodejs
RUN cp /usr/bin/python3 /usr/bin/python

Choose the one that best fits your needs.

A: If your public base image (the base image of your own image) is really node:4, then it is not yum based but apt-get based to manage packages.
Thus you shoud install R the following way:
RUN apt-get update && apt-get install -y r-base

A: You should use some R images, like
https://hub.docker.com/_/r-base/
or some oher image in this list
https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q=R&starCount=0


text:
Q: Read and change combo-box selected item with 4 different possible values I have a multi-line textbox that the user can type into; the contents of which are supposed to drive the currently selected item in a combobox.
I have existing code that works for two items currently (Yes & No); however, I now need to make this extend to supporting four items. This is also updated by a timer every 3 seconds, in case if the user manually updated the text. The combobox cannot be typed in, instead it has preset selections.
Also the program is designed to edit properties files.
I'm a little unsure on how to go about doing so.
This is what works for 2 item changes:
    Dim lines as Textbox1.lines()
    Dim ach_tr As String = "announce-player-achievements=" 'stuff to be replaced by string ach_ttr
    Dim ach_ttr As String = "" 'empty string to delete string ach_tr
    Dim ach As String = lines(My.Settings.AnnouncePlayerAchievements)'line of string ach_tr
    ach = ach.Replace(ach_tr, ach_ttr)'removes string ach_tr and leaves the value
    If ach = "true" Then
        achievements.SelectedItem = "Yes"
    Else
        achievements.SelectedItem = "No"
    End If

I've tried these for 4 items:
    Dim lines as Textbox1.lines()
    Dim diff_tr As String = "difficulty="
    Dim diff_ttr As String = ""
    Dim diff As String = lines(My.Settings.Difficulty)
    diff = diff.Replace(diff_tr, diff_ttr)
    If diff = "0" Then
        achievements.SelectedItem = "Peaceful"
    End If
    If diff = "1" Then
        achievements.SelectedItem = "Easy"
    End If
    If diff = "2" Then
        achievements.SelectedItem = "Normal"
    End If
    If diff = "3" Then
        achievements.SelectedItem = "Hard"
    End If

And This one:
    Dim lines as Textbox1.lines()
    Dim diff_tr As String = "difficulty="
    Dim diff_ttr As String = ""
    Dim diff As String = lines(My.Settings.Difficulty)
    diff = diff.Replace(diff_tr, diff_ttr)
    If diff = "0" Then
        achievements.SelectedItem = "Peaceful"
    Else
        If diff = "1" Then
            achievements.SelectedItem = "Easy"
        Else
            If diff = "2" Then
                achievements.SelectedItem = "Normal"
            Else
                If diff = "3" Then
                    achievements.SelectedItem = "Hard"
                End If
            End If
        End If
    End If

A: You could do something akin to:
var difficultyMap = new Dictionary<string,string>
{
    {"0", "Peaceful"},
    {"1", "Easy"},
    {"2", "Normal"},
    {"3", "Hard"}
};

difficultyCombo.Items = difficultyMap.Values;
updateTimer.Tick += (s,e) => {
    var text = inputTextBox.Text;
    string found;
    if (!difficultyMap.TryGetValue(text))
    {
        MessageBox.Show("unknown difficulty");
        return;
    }
    difficultyCombo.SelectedItem = found;
};

This is in C# as I don't know VB very well, but the core concepts should map, I'm also not sure of your exact implementation or requirements, in essence I've done the following:

*

*Created a dictionary that goes from the "numeric" difficulty type to the display type for the combo

*Populated the combo using the display values from the dictionary

*Whenever the update timer fires, I:

*

*Get the text from the textbox

*Try to find the matching difficulty in the dictionary

*Display an error or update the combo

Adding n number of items to the combo and text input is trivial now, as you just add a new entry to the dictionary.

A: Edit: For future reference Heres a more compact version which works as well:
Public LineNum As Globals.LineNumEnum
Dim serveriptr As String = ("server-ip=")
    Dim sipc As String = PropView.OutputRTF.Lines(LineNum.SerIP)
    sipc = sipc.Replace(serveriptr, Nothing)

I found my problem. I was trying to change the wrong combobox lol. well at least I learned about dictionaries and the select case. Well thanks for your time.
This is the correct code lol:
Dim diff_tr As String = "difficulty="
    Dim diff_ttr As String = ""
    Dim diff As String = lines(My.Settings.Difficulty)
    diff = diff.Replace(diff_tr, diff_ttr)

    If diff = "0" Then
        difficulty.SelectedItem = "Easy"
    ElseIf diff = "1" Then
        difficulty.SelectedItem = "Easy"
    ElseIf diff = "2" Then
        difficulty.SelectedItem = "Normal"
    ElseIf diff = "3" Then
        difficulty.SelectedItem = "Hard"
    End If


text:
Q: fetch_field() function in Zend to get metadata result set In PHP, there is fetch_field() function to get metadata from a result set.
php-manual-mysql_fetch_field
Is there a similar function in Zend Framework,.?
but, in this case I'm using PostgreSQL.

A: Zend_Db_Table has a method info() which returns an array with metadata of the table.
Example:
    $table = new Zend_Db_Table(array('name' => 'table_name'));
    $tableInfo = $table->info();
For more information, go to http://framework.zend.com/manual/en/zend.db.table.html#zend.db.table.info


text:
Q: Why is it that aa full deployment will require a minimum of 10 servers? I wish to try MaaS, and there's only two machine, could I install one with MaaS service, and use MaaS and juju to deploy the other bare machine with openstack nova-compute?
Thank you so much for answering.

A: The reason for this is that OpenStack is not really meant for a 2 node cluster. It is meant to scale to thousands of nodes. It has many disconnected components, including mysql, rabbitmq, several API services, etc. For your case of "just trying openstack out" you can simply use the local provider to install everything on one box rather than MaaS which wants to put every component of OpenStack on its own machine (and there are about 9 components, plus 1 for juju/maas).
Have a look at this page to help configure the local provider:
https://jujucharms.com/docs/stable/clouds-LXD
And then follow these instructions:
https://help.ubuntu.com/community/UbuntuCloudInfrastructure
Except instead of setting up MaaS, and generating/downloading the environments.yaml from MaaS, you just put this in:
default: local
environments:
  local:
    type: local
    default-series: precise
    data-dir: /home/youruser/.juju/data

All of the services will end up in their own containers on the same box, which will have some limitations (like nova volumes not working right).

A:
Beside that can you please explain what exactly MAAS gonna install on each server?

You can use community contributed charms where each service like MySQL or RabbitMQ requires dedicated node or write yours where you can combine them.

Does it has some RAID kind of mechanism inside?

You can utilize RAID when deploying node into MaaS.

If one or two servers go down and it may handle everything?

MaaS doesn't provide built in reservation or High Availability for deployed services. If you are talking about OpenStack, the answer is yes: nova-compute can relaunch instances from failed nodes. Best practices for Swift requires 3 copy of your data, so 2 failed nodes is not a problem.

My final question is it says somewhere on Ubuntu docs that each server should
  have at-least 16GB RAM ? Is it Must or optional ?

No, this is not required. Probably, you've mentioned this statement from Mark's blog: "Add another node to the Hadoop cluster, and make sure it has at least 16GB RAM".


text:
Q: o.lettuce.core.RedisException::io.netty.util.internal.OutOfDirectMemoryError while retrieving a big object(2MB)from Redis I  have a Springboot application that connects to Redis cache ( Azure redis) and retrieve an object . The object size is 2MB . I am getting the following error some times .

io.lettuce.core.RedisException:
  io.netty.util.internal.OutOfDirectMemoryError: failed to allocate
  524288000 byte(s) of direct memory (used: 553648128, max:
  1073741824)"}.

It is not happening every time .  Why it is allocating 524288000 byte(s) to retrieve a 2MB object ? When it is working , I get the response in 1 sec .
Details :
Spring boot version : 2.1.5
Spring data redis : 2.1.8
Lettuce core : 5.1.6
io.Netty : 4.1.36
Deployment environment Deatils :
Enviornment: Pivotal Cloud Foundry environment
Memory : 2GB with a direct memory of 1GB
Redis :
Azure Premium Redis with 6GB memory.
Code snippet :
To retrieve the object , I am using the following piece of code :
redisTemplate.opsForValue().get(keyname);
and then convert to the Object using an ObjectMapper.
and all default properties .

A: As the allocation seems to happen as part of lettuce I would suggest opening a bug report there. This does not sounds correct.


text:
Q: How to create a generic function to load a view controller? I have been trying to write a function that works with 3 parameters in order to load a view controller but I haven't been able to make it work.
I'm new into coding and I am reading a tutorial that uses 2 view controllers (login & chat). In order to go from one to the other, the guide tells me to use this whether I want to log in or log out:
@IBAction func loginDidTapped(_ sender: Any) {

    // A
    let storyboard = UIStoryboard (name: "Main", bundle: nil)
    // B
    let logVC = storyboard.instantiateViewController(withIdentifier: "LoginVC") as! LoginViewController
    // C
    let appDelegate = UIApplication.shared.delegate as! AppDelegate
    // D
    appDelegate.window?.rootViewController = logVC
}

If I want to log in or log out I have to change 3 things:

*

*logVC , which I'd call var1, used in // B , // D

*"LoginVC" , which I'd call var2, used in // B

*LoginViewController , which I'd call var3, used in // B

In my newb mind, I imagined that I could create a function that contained the "A, B, C, D" lines and let me call it anywhere later just by changing "var1, var2, var3" parameters

This is what I first created using just var1 and var2:
import Foundation
import UIKit
import FirebaseAuth

    class Helper {
        static let helper = Helper()

        func loadView (var1 : String , var2 : String) {

            let storyboard = UIStoryboard (name: "Main", bundle: nil)
            let var1 = storyboard.instantiateViewController(withIdentifier: var2) as! LoginViewController
            let appDelegate = UIApplication.shared.delegate as! AppDelegate
            appDelegate.window?.rootViewController = var1
         }
    }

I called it this way and it worked:
Helper.helper.loadView(var1: "logVC" , var2: "LoginVC")

Now, when I tried to use var3 in line //B, inside the same function, Xcode underlines var3 and displays this error:
Use of undeclared type 'var3'
This is how it looked after adding a the var3 parameter:
    func loadView (var1 : String , var2 : String , var3 : String) {

                    let storyboard = UIStoryboard (name: "Main", bundle: nil)
                    let var1 = storyboard.instantiateViewController(withIdentifier: var2) as! var3
                    let appDelegate = UIApplication.shared.delegate as! AppDelegate
                    appDelegate.window?.rootViewController = var1
}

This is how I would have called it if it had worked:
Helper.helper.loadView(var1: "logVC" , var2: "LoginVC" , var3: "LoginViewController")

I'd like to know if is it possible to do what I am imaging since I see functions as equations in which I can replace variables with the information I need.
Thank you all in advance.

A: You are overthinking. Do you really need 3 variables?
Actually, you just need one.
Let's see why.
Does the name of the variable really matter in B? Does the LoginViewController at the end of B really need to be there? No. The variable name is just a variable name. Changing it changes nothing about your code. It might make your code more readable though. The same goes for the LoginViewController as the end. That just causes var1 to be of type LoginViewController. But this is unnecessary because you are assigning it to rootViewController later anyway. rootViewController is of type UIViewController, so you can just pass any variable of type UIViewController. To learn more about this behaviour, look up polymorphism.
Thus, your method is just this:
func presentVC(name: String) {

    let storyboard = UIStoryboard (name: "Main", bundle: nil)
    let vc = storyboard.instantiateViewController(withIdentifier: name)
    let appDelegate = UIApplication.shared.delegate as! AppDelegate
    appDelegate.window?.rootViewController = vc
}


text:
Q: Android - setContentView doesn't find R layouts So i'm having some problems, my setContentView(R.layout.activity_interface_gps); doesn't seem to find the xml file, though it's there, and also it is in the R layout procedure:
public static final class layout {
    public static final int activity_gps_interface=0x7f030000;
    public static final int activity_gps_log=0x7f030001;
    public static final int activity_main=0x7f030002;
    public static final int map=0x7f030003;
}

It was all working fine, untile i updated android tools in the sdk manager, so far i reinstalled the adb, but now, this seems to be the new problem. All my project gone error. Any ideas? :(


text:
Q: PineScript v2 to v4 conversion, Cant Convert with Self Referencing Variable I'm trying to convert my Pine script version 2 indicator to version 4 so I publish it, but it uses a self-referencing variable which they got rid of in version 3. To solve it it needs to be wrapped as stated in the reference page I will link at the bottom, but I cant figure out how to properly wrap it. If anyone could help me wrap this formula it would be greatly appreciated. Thank you in advance. https://www.tradingview.com/pine-script-docs/en/v5/migration_guides/To_Pine_version_3.html#
Here is the code. The self-referencing variable is on line 33 (BSsum) and uses line 9 as part of its formula.
// © OasisTrading

//@version=4
study("Rotation Factor: Buy/Sell Pressure", shorttitle="Rotation Factor")

interval = security(syminfo.tickerid, input("1D", title="Reset Interval"), time)

newSession = iff(change(interval), 1, 0)

one = (high > high[1]) and (low > low[1])
two = (high < high[1]) and (low < low[1])
three = (high > high[1]) and (low < low[1])
four = (high < high[1]) and (low > low[1])
five = (high == high[1]) and (low > low[1])
six = (high > high[1]) and (low == low[1])
seven = (high < high[1]) and (low == low[1])
eight = (high == high[1]) and (low < low[1])

//formula
onex = +2
twox = -2
threex = 0
fourx = 0
fivex = +1
sixx = +1
sevenx = -1
eightx = -1

formula = (high > high[1]) and (low > low[1]) ? onex : (high < high[1]) and (low < low[1]) ? twox : (high > high[1]) and (low < low[1]) ? threex : (high < high[1]) and (low > low[1]) ? fourx : (high == high[1]) and (low > low[1]) ? fivex : (high > high[1]) and (low == low[1]) ? sixx : (high < high[1]) and (low == low[1]) ? sevenx : (high == high[1]) and (low < low[1]) ? eightx : 0
BuySell = sum(formula, 1)

BSsum : iff(newSession, BuySell, BSsum[1]+BuySell)

Kolor1 = (BSsum > 0)==true
Kolor2 = (BSsum < 0)==true

plot(BSsum, style=plot.style_columns, color=Kolor1?color.green:Kolor2?color.red:na, linewidth=3, transp=0, title="Buy/Sell Pressure")```

A: It doesn't have to be wrapped, wrapping variables inside functions is necessary if you want to pass these mutable variables inside the security(). Your variable is based on data from security, but it isn't passed to it.
To make the script work in v4, you need to first declare the variable, and then assign it a new value via the := operator:
// © OasisTrading

//@version=4
study("Rotation Factor: Buy/Sell Pressure", shorttitle="Rotation Factor")

interval = security(syminfo.tickerid, input("1D", title="Reset Interval"), time)

newSession = iff(change(interval), 1, 0)

one = (high > high[1]) and (low > low[1])
two = (high < high[1]) and (low < low[1])
three = (high > high[1]) and (low < low[1])
four = (high < high[1]) and (low > low[1])
five = (high == high[1]) and (low > low[1])
six = (high > high[1]) and (low == low[1])
seven = (high < high[1]) and (low == low[1])
eight = (high == high[1]) and (low < low[1])

//formula
onex = +2
twox = -2
threex = 0
fourx = 0
fivex = +1
sixx = +1
sevenx = -1
eightx = -1

formula = (high > high[1]) and (low > low[1]) ? onex : (high < high[1]) and (low < low[1]) ? twox : (high > high[1]) and (low < low[1]) ? threex : (high < high[1]) and (low > low[1]) ? fourx : (high == high[1]) and (low > low[1]) ? fivex : (high > high[1]) and (low == low[1]) ? sixx : (high < high[1]) and (low == low[1]) ? sevenx : (high == high[1]) and (low < low[1]) ? eightx : 0
BuySell = sum(formula, 1)

BSsum = 0.0
BSsum := newSession ? BuySell : BSsum[1] + BuySell

Kolor1 = (BSsum > 0)==true
Kolor2 = (BSsum < 0)==true

plot(BSsum, style=plot.style_columns, color=Kolor1?color.green:Kolor2?color.red:na, linewidth=3, transp=0, title="Buy/Sell Pressure")


text:
Q: How to fetch just a single build/dist file, when installing with NPM, rather than the full repo? What if one needs to just rely on a single file from a repo?
Is package.json supporting any way to fetch a single distributed build file, rather than downloading the whole repository?
Or should this possibility be provided by the repo's maintainer? (e.g. providing a bundle version of the repo, with just the distributed file)

A: Yes, it's up to package owner to specify particular path patterns in files section of package.json. Just like
"files": ["dist/*"]

Alongside files that lists including patterns there .npmignore and .gitignore can be applied for exclusion.
I don't believe there is anything you can control on your side.


text:
Q: Question about amplifier design I'm somewhat new to analog circuit design, and I have some questions about this circuit, which I came up with trying to understand how transistor amplifiers work:

simulate this circuit – Schematic created using CircuitLab
Q1 is an emitter follower. When the input voltage is higher than the output, current flows through R1, which turns off Q2 through Q3 and Q4. But if the input is lower than the output, Q1 turns off, the voltage across R1 becomes zero, and the pullup R3 turns on Q2 just enough for Q1 to conduct again and regulate the voltage.
In the simulation it seems to work well, but the problem with it is that if a low-impedance load needs to be driven, R1 needs to be very small (around 1 or 0.47 ohms), and so that the constant current isn't huge, the threshold for it needs to be much less than a diode drop, and I can't figure out how to do that. Are there any good solutions? And if it can be fixed, are there any other serious flaws with it that I'm missing, or good reasons why I haven't come across anything that looks very similar to this?
EDIT:
This is the simulation output I get. The horizontal axis is V(in):

Q2 is meant to turn off completely just above the halfway voltage.
The nonlinearity and sudden drop in current at around 30V input is the voltage divider created by R1 and the load being hit, and the only way I can see to prevent it is to use a much smaller resistance, but a feedback network which can detect voltages smaller than a diode drop would be necessary, and I'm not sure how to do that.

A: The reason you haven't seen anything similar is that it's mostly pointless — and a waste of power.
Ignoring the signal variations on V2 for a moment, the action of Q2, Q3 and Q4 is to maintain a constant voltage drop across — and therefore a constant current through — R1.
Now, when the signal voltage rises, there is a need for load current to flow, and this current is diverted from Q2 — its collector current is reduced. Similarly, when the signal voltage falls, additional current must be drawn from the load — Q2's collector current is increased.
So, instead of a normal emitter follower, in which Q1 provides current gain for the signal, you have this bizarre situation in which Q1's current is held constant, and the load current variations are driven by Q2 through your elaborate feedback mechanism.
In this design, the quiescent current (the current through R1 and Q1) must be higher than the peak current required in the load, and this current must flow at all times, regardless of the actual load current required at any given moment. This is not only much worse than a normal "class B" amplifier, it is also worse than a conventional "class A" amplifier.
I would also expect this circuit to be rather unstable. There is a lot of gain around the feedback loop, and at some frequency it will oscillate. Note that with no signal applied, you can consider Q1 to be a common-base amplifier with regard to any variations at the output node. At low frequencies, the feedback is negative, but at some high frequency, the phase shifts through the four transistors will add up to the point where it effectively becomes positive.

A: As a push-pull amplifier your circuit has two major errors.

*

*The input to Q2 is referenced to a voltage 5V lower than the output. I suspect your intention was that V3 would create a 'virtual earth' at +5V, in which case the input should also have been referenced to +5V.

For simulation it may be easier to put the earthing point at V3's positive terminal, making the most negative part of the circuit -5V.

*Q1 does a reasonable job of amplifying the positive half cycle, but during the negative half cycle the output is simply pulled down to ground (-5V). A push-pull circuit needs to amplify both half cycles.

Apart from not working properly, Your complicated method of splitting the positive and negative half cycles is unnecessary. All you need is one NPN and one PNP transistor, connected like this:-

simulate this circuit – Schematic created using CircuitLab
This simple circuit amplifies both positive and negative half cycles equally. However it has a small problem - each transistor needs about 0.6V of bias voltage before it begins to turn on. As a result the output will have a 'flat spot' when the input is less than 0.6V above or below ground. This is called cross-over distortion - a major annoyance in audio applications because it produces harmonics which are very noticeable at lower volume levels.
To eliminate cross-over distortion you must provide each transistor with a bias voltage high enough to just start turning it on, but not high enough to cause excessive quiescent current flow. The bias voltage is usually generated using diodes or another transistor, thermally coupled to the output transistors so that their voltages track with temperature changes.
Here's an example:-

simulate this circuit
Resistors R2 and R3 provide enough bias current to develop ~0.6V across each diode, and also provide Base current to the transistors as the input voltage goes up and down (since the diodes block the signal).


text:
Q: CSS calc() function doesn't work in Chrome I wanted to set a specific width in columns, but the calc function doesn't work. It shows error in Chrome dev tools.

Code:
.row {
  max-width: $grid-width;
  background-color: #eee;
  margin: 0 auto;

  &:not(:last-child) {
    margin-bottom: $gutter-vertical;
  }

  @include clearfix;

  [class^= "col-"] {
    background-color: orangered;
    float: left;

    &:not(:last-child) {
      margin-right: $gutter-horizontal;
    }
  }

  .col-1-of-2 {
    width: clac((100% - #{$gutter-horizontal}) / 2);
  }

  .col-1-of-3 {
    width: clac((100% - 2 * #{$gutter-horizontal}) / 3);
  }
}

A: The code that you posted in the comments, has clac() instead of calc()
{ width: clac((100% - 2 * #{$gutter-horizontal}) / 3); } }

A: spelling of calc is wrong it's clac in your code


text:
Q: Link an image to a list item in sharepoint2007 good day,
I have a custom list that manages disputes in my company.
What i am trying to do is have a "preset" field that contains a link to an image (or file). This image/file can be clicked and the image would open in a new windows.
The purpose of this is to provide a hierarchy of the company so that people know who to assign the dispute to.
Is this even possible?
Possible Solution: I have tried to do this in a workflow but it only works "AFTER" the item is created, which for me does not serve the purpose.
Thanks in advance


text:
Q: glBufferSubData() and glBindArray() I have two methods:

*

*opengl_init()

*opengl_draw()
In the first one I initialize an empty GL_ARRAY_BUFFER because I want to update my point coordinates each frame.
Everything works if in opengl_draw() method I keep commented out //glBindBuffer(GL_ARRAY_BUFFER, 0)
Normally I use this function when I draw elements statically in the last line of the opengl_init() method.
Question:
Could you explain why commenting out glBindBuffer() function positions are updated every frame, and if I use glBindBuffer() function objects are draw statically (no change of y coordinate) even if I use glBufferSubData() in a while loop every frame?
I also do not understand why I need to write glBindVertexArray(0); in the last line of opengl_init() method. I used this line from learnopengl tutorials.
My working code:
    void opengl_init()
    {
        //vertex array
        glGenVertexArrays(1, &vao);
        glBindVertexArray(vao);

        //vertex buffer
        glGenBuffers(1, &vbo);
        glBindBuffer(GL_ARRAY_BUFFER, vbo);
        //-> keep this function NULL to dynamically draw vertices glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(vertex), &vertices[0], GL_STATIC_DRAW); // target | size | data (poinnting to first element e.g. glm::value_ptr(vertices[0])) | usage
        glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(vertex), NULL, GL_STATIC_DRAW);

        //set attributes that corresponds to layout id in the vertex shader
        // set the vertex attribute pointers
        // vertex Positions
        glEnableVertexAttribArray(0);
        glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(vertex), (void*)0);
        // vertex normals
        glEnableVertexAttribArray(1);
        glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(vertex), (void*)offsetof(vertex, color));

        //bind buffers vao | vbo | ibo
        glBindVertexArray(0);
        //glBindBuffer(GL_ARRAY_BUFFER, 0);
    }

    // render the mesh
    void opengl_draw(opengl_shaders::shader& shader)
    {
        for (auto& v : vertices)
            v.position.y += 0.001;
        glBufferSubData(GL_ARRAY_BUFFER, 0, vertices.size() * sizeof(vertex), &vertices[0]);
        glBindBuffer(GL_ARRAY_BUFFER, 0);

        glBindVertexArray(vao);
        glDrawArrays(GL_POINTS, 0, vertices.size());
        glBindVertexArray(0);
    }

A: glBufferSubData requires that GL_ARRAY_BUFFER is bound to a buffer. glBindBuffer(GL_ARRAY_BUFFER, 0); binds it to nothing.
Assuming nothing else in this code touches GL_ARRAY_BUFFER, commenting that line leaves it bound to vbo, which means that the glBufferSubData call knows which buffer to update.
It is best to be explicit and bind the correct buffer before you touch it. In this case, inside opengl_draw.
If you find all of this confusing, know that modern OpenGL also has direct state access, which does not require a separate glBindBuffer:
// Note we pass vbo directly instead of GL_ARRAY_BUFFER
glNamedBufferSubData(vbo, 0, vertices.size() * sizeof(vertex), &vertices[0]);


text:
Q: pods file with multiple platforms for iOS I want to combine 2 pods in my project. One is :
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'DJKFlipper'

and the other is:
platform :ios, '9.0'
pod 'HQPagerViewController', :git=> 'https://github.com/quangpc/HQPagerViewController.git', :branch=> 'master'

The issue is that one is asking for platform 8.0 and other is 9.0
I tried changing the whole file platform to 8.0, but get the following error: Specs satisfying the HQPagerViewController (from https://github.com/quangpc/HQPagerViewController.git, branch master), HQPagerViewController (= 1.0) dependency were found, but they required a higher minimum deployment target.
And if keep the target to 9.0, I get above 100 issues in the app after installing pod, as the target platform is incorrect.
I also tried this:
target 'Bhaskar' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks

 platform :ios, '9.0'
  use_frameworks!

  pod 'HQPagerViewController', :git=> 'https://github.com/quangpc/HQPagerViewController.git', :branch=> 'master'

end

target 'Bhaskar - FlipView' do
  source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'DJKFlipper'
end

but getting an error here too. I have used pods maybe for the second time ever, and always worked with same platform. How can I combine these both?
Any help will be appreciated!
Thanks!

A: It's because your 'Deployment Target' in your project settings is lower than 9.0 (which is the minimum required by HQPagerViewController), so you'd have to change that to 9.0.

A: Since you have a minimum requirement of ios 9 for one pod your target platform should be 9. You could change the deployment target as mentioned by RJiryes above.  Since one of your pods is base 8, in most cases it should support ios 9 to. But in case your ios 8 pod has deprecated code from ios 9, in that case you will have to pork your pod and change it to support ios9. And It is important that you use up to date pods as using older version of pods are not good practice and may end up having issues.


text:
Q: How many ways can one rearrange the letters in the word ATTENTION such that the first letter is a T but the second one isn't? The number of arrangements of all letters in the word ATTENTION that can be arranged so that each arrangement begins with a T, and the second letter is not a T is
my work:
There are $9$ letters in the word ATTENTION so that means there are nine spaces
so you would do
$9!=9\times8\times7\times6\times5\times4\times3\times2\times1=362880$ of arrangements
Is this the correct way to do this problem? If not, how do you do it?

A: Approach via rule of product.

*

*Choose the three positions of the $T$'s

*Choose the two positions of the $N$'s from those remaining

*Arrange the remaining letters

Note that when choosing the three positions of the $T$'s, the first position must be included and the second position must not be included.  So... this is effectively the same as choosing two positions from the last seven positions.
Note that regardless what choice was made in this first step, although the types of choices change for the later steps the number of choices is always the same.
$$\binom{7}{2}\times\binom{6}{2}\times 4!$$

A: Here is an alternative way to compute it
The first letter need to be a "T": $3$ possibilities
The second letter is not a "T": $6$ possibilities.
The we put the remaining letters, giving
$$3\times6\times7\times6\times5\times4\times3\times2\times1$$
But this number consider the "T"s and the "N"s to be distincts. Since they are not, we need to divide this number by $3\times2\times1$ for the "T"s and $2\times1$ for the "N"s
Final answer:
$$\frac{3\times6\times7\times6\times5\times4\times3\times2\times1}{3\times2\times1\times2\times1}=7560\text{ possibilities}$$

A: Your work considers all the possible cases without any restrictions, so, unfortunately, it's not correct.
In order to reach the solution, notice that there are 9 letters, and you have 3 T's, 2 N's and 1 of each for the rest. The first letter must be a T, so you can think of this as an 8 letter problem. In order to figure out all the cases where the second letter isn't a T, think about all the possible cases and subtract them by the cases where the second letter is a T. So, there are
$${8 \choose 2} \times {6 \choose 2} \times 4! - {7 \choose 2} \times 5! = 7560   $$
possible cases.


text:
Q: Why are the manually added notification icons don't hide when using workspace switcher? For Example; notice emesene and desktopnova before and after clicking  SUPER+S

A: Fixed in CCSM; Compiz config settings Manager.
Go to  Expo - Appearance - Check hide panels/dock:

Here is a new screenshot without the manually added notification icons :


text:
Q: How to change view of number(CallIntent) to simple writing? Now I have here code for callIntent and in my app is showing number and onClick it is calling, nothing wrong about this, all is fine, working. But I don't want that in app there will be seen number, instead I would like that there will be just simple view like "Call". But I have to setText to this numbers for callIntent. But How to change its view? Please can someone help me to do it.
public class Info extends ActionBarActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.info);
        String[] tels = { "90 212 345 5555", "90 212 317 5330" };
    final TextView tel = (TextView) findViewById(R.id.tel);
    if (selected.equals("Istinye Park")) {
        tel.setText(tels[0]);
        infoText.setText(R.string.istinye);
    } else if (selected.equals("Kanyon Istanbul")) {
        tel.setText(tels[1]);
        infoText.setText(R.string.istinye);
    tel.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            Intent callIntent = new Intent(Intent.ACTION_CALL);
            callIntent.setData(Uri.parse("tel:+"
                    + tel.getText().toString().trim()));
            startActivity(callIntent);
        }
    });
 }

A: try this:
public class Info extends ActionBarActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.info);

    string[] tels = { "90 212 345 5555", "90 212 317 5330" };
    final TextView tel = (TextView) findViewById(R.id.tel);

    infoText.setText(R.string.istinye);
    tel.setText("Call");

    tel.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            String number;
            if (selected.equals("Istinye Park")) {
                number = tels[0];
            } else if (selected.equals("Kanyon Istanbul")) {
                number = tels[1];
            }

            Intent callIntent = new Intent(Intent.ACTION_CALL);
            callIntent.setData(Uri.parse("tel:+"+ number));
            startActivity(callIntent);
        }
    });
 }

Update Solution with HashMap
public class Info extends ActionBarActivity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.info);

        final HashMap<String, String> myMap=new HashMap<String, String>();
        myMap.put("Istinye Park","90 212 345 5555");
        myMap.put("Kanyon Istanbul","90 212 317 5330");
        // add the rest of your items here

        final TextView tel = (TextView) findViewById(R.id.tel);
        infoText.setText(R.string.istinye);
        tel.setText("Call");

        tel.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                String number = myMap.get(selected);
                if(number!=null){
                   Intent callIntent = new Intent(Intent.ACTION_CALL);
                   callIntent.setData(Uri.parse("tel:+"+ number));
                   startActivity(callIntent);
                }
            }
        });
 }


text:
Q: Eclipse EGit: fetch/push never ends I use EGit 2.2 with Eclipse Juno.
So far everything has been more or less all right.
But once my team-mate has uploaded a number of large files (over 2 Gig) fetch and push operations never end for me. (My network connection is fast.)
How can I troubleshoot/resolve this?

A: Well, I'm not a very experienced git user. So I resolved the problem a straightforward way: created a new Eclipse workspace and cloned the remote repository to the new workspace. Fetch and push operations work okay now.


text:
Q: What is the difference between style prop and general props of View in react native? I put "what is the difference" in the title meaning how exactly they are similar and how they are different. Basically, how does the style prop work on View?
There are some keys that can be put either into style or into props. For example, <View shadowRadius={3}> vs <View style={{shadowRadius:3}}>. Does this choice affect anything? If not, what is the point of this?


text:
Q: Condition number of a given linear system $Ax=b$ varying $A$ How would you solve this excersize? I have tried it but I am not posting my calculations since it is wrong and I would spend a lot of time writing it in latex.
The problem.
Find the condition number with respect to $\Vert \cdot \Vert_{\infty}$ of
\begin{equation*}
 \begin{pmatrix}
  1 & d \\
  d & 1
 \end{pmatrix}
 \begin{pmatrix}
  x \\
  y
 \end{pmatrix}
 =
 \begin{pmatrix}
  1 \\
  0
 \end{pmatrix}
\end{equation*}
supposing $d \neq \pm 1$.
It should be
$K_{\infty}(A) = \left\vert\frac{\left\vert d\right\vert + 1}{\left\vert d\right\vert - 1}\right\vert$.
I found two different values depending on $\left\vert d\right\vert < 1$ or $\left\vert d\right\vert > 1$, more specifically if $\left\vert d\right\vert < 1$ I found
\begin{equation*}
 \left\vert \frac{2d}{1-d}\right\vert
\end{equation*}
while if $\left\vert d\right\vert > 1$ I found
\begin{equation*}
 \left\vert \frac{2}{1-d}\right\vert.
\end{equation*}
EDIT
In the two solutions given you use $K(A) = \Vert A^{-1} \Vert \Vert A \Vert$.
My result is different because I used a different definition of $K$ i.e.
$K(d) = \left\Vert G'(d)\right\Vert \frac{\left\Vert d\right\Vert}{\left\Vert G(d)\right\Vert}$ where $G$ is the function $d \mapsto x(d)$ which gives the unique solution depending on the parameter $d$.
In the case in which I want to solve $A x = b$ and $d$ it is contained only in $b$ we have $$x = A^{-1}b$$ so $$G(d) = A^{-1}b \quad \text{and} \quad G'(d) = A^{-1}.$$
We so obtain $$K(d) = \left\Vert A^{-1}\right\Vert \frac{\left\Vert b\right\Vert}{\left\Vert A^{-1}b\right\Vert} = \left\Vert A^{-1}\right\Vert \frac{\left\Vert Ax\right\Vert}{\left\Vert x\right\Vert} \leq \left\Vert A^{-1}\right\Vert \left\Vert A\right\Vert.$$
But I don't understand why in the case in which it is $A$ (not $b$) depending of $d$ we can still use the defintion $K(d) = \left\Vert A^{-1}\right\Vert \left\Vert A\right\Vert$.

A: I have never delved into this material, but I did some wikipedia-ing.
$$\kappa(A) = ||A^{-1}||\cdot ||A||$$
We first find $A^{-1}$:
$$A^{-1} = \begin{pmatrix} \dfrac{1}{1-d^2} & \dfrac{-d}{1-d^2} \\ \dfrac{-d}{1-d^2} & \dfrac{1}{1-d^2}\end{pmatrix}$$
Since the rows contain the same entries for both $A$ and $A^{-1}$,
$$||A^{-1}|| = \left|\dfrac{1}{1-d^2}\right| + \left|\dfrac{-d}{1-d^2}\right| = \dfrac{1+|d|}{|1-d^2|} = \dfrac{1+|d|}{|(1+|d|)(1-|d|)|} = \dfrac{1}{|1-|d||}$$
and
$$||A|| = \left|1\right| + \left|d\right| = 1+|d|$$
So
$$ \kappa(A) = ||A^{-1}||\cdot ||A|| = \dfrac{1 + |d|}{|1-|d||}$$

A: The relevant definitions are
$$K_{\infty}(A)=||A||_{\infty}||A^{-1}||_{\infty}$$
and
$$||A||_{\infty}=\max_{i=1,2}\sum_{j=1}^2|a_{ij}|$$
Since
$$A^{-1} = \frac{1}{1-d^2}
    \begin{pmatrix}
  1 & -d \\
  -d & 1
 \end{pmatrix}$$
you have $||A||_{\infty}=1+|d|$ and
$$||A^{-1}||_{\infty} = \frac{1}{|1-d^2|}(1+|d|)=
\frac{1}{|1-|d|^2|}(1+|d|) =
\frac{1+|d|}{|(1-|d||)(1+|d|)|} = \frac{1}{|1-|d||}
$$
and therefore
$$K_{\infty}(A)=||A||_{\infty}||A^{-1}||_{\infty}=\frac{1+|d|}{|1-|d||}$$


text:
Q: Read to CSV Parser Error, Workers when I resave I am trying to read a CSV to a pandas df. I get an error when I do this. However, if I open the csv in excel and do a save as with a new name, it works flawlessly. I can't do this every time, but if I can write code to do it, that would work for me.
for file in os.listdir(downloadsdir):
    if 'SalesByInvoiceType' in file:
        file = os.path.join(downloadsdir, file)
        df = pd.read_csv(file, delimiter=',')

Error:
ParserError: Error tokenizing data. C error: Expected 13 fields in line 11, saw 15

I changed my code to include some read_csv parameters
for file in os.listdir(downloadsdir):
    if 'SalesByInvoiceType' in file:
        file = os.path.join(downloadsdir, file)
        df = pd.read_csv(file, encoding ='cp1252', sep='delimiter', header=None)

df

output from above statement
    0
0   "Set. Officer","Case #"...
1
2   "TJ Stephens","10043","...
3
4   "Lindsay Anderson","103...
5
6   "Fred T. Rogers","10460...
7
8   "Fred T. Rogers","10484...

when I try to grab one of the rows with
df[0][0]

the output is
'"\x00S\x00e\x00t\x00.\x00 \x00O\x00f\x00f\x00i\x00c\x00e\x00r\x00"\x00,\x00"\x00C\x00a\x00s\x00e\x00 \x00#\x00"\x00,\x00"\x00I\x00n\x00v\x00o\x00i\x00c\x00e\x00 \x00T\x00y\x00p\x00e\x00"\x00,\x00"\x00I\x00n\x00v\x00o\x00i\x00c\x00e\x00 \x00T\x00y\x00p\x00e\x00 \x00G\x00r\x00o\x00u\x00p\x00"\x00,\x00"\x00Q\x00u\x00a\x00n\x00t\x00i\x00t\x00y\x00"\x00,\x00"\x00U\x00n\x00i\x00t\x00 \x00P\x00r\x00i\x00c\x00e\x00"\x00,\x00"\x00A\x00m\x00o\x00u\x00n\x00t\x00"\x00,\x00"\x00C\x00l\x00i\x00e\x00n\x00t\x00 \x00S\x00t\x00a\x00t\x00u\x00s\x00"\x00,\x00"\x00D\x00a\x00t\x00e\x00"\x00,\x00"\x00D\x00e\x00s\x00c\x00r\x00i\x00p\x00t\x00i\x00o\x00n\x00"\x00,\x00"\x00T\x00e\x00a\x00m\x00 \x00N\x00a\x00m\x00e\x00"\x00,\x00"\x00C\x00r\x00e\x00a\x00t\x00e\x00d\x00B\x00y\x00"\x00,\x00"\x00i\x00n\x00v\x00o\x00i\x00c\x00e\x00 \x00C\x00r\x00e\x00a\x00t\x00e\x00d\x00 \x00B\x00y\x00"\x00'

Instead of what is seen when I just pass the df.


text:
Q: JSON to Spark RDD in Python I am very new to Spark and I have been trying for a while to get Spark to understand my JSON input but I haven't been managing. In summary, I am using Spark's ALS algorithm to give recommendations. When I provide a csv file as an input, everything works fine. However, my input is actually a json, as follows:
all_user_recipe_rating = [{'rating': 1, 'recipe_id': 8798, 'user_id': 2108}, {'rating': 4, 'recipe_id': 6985, 'user_id': 4236}, {'rating': 4, 'recipe_id': 13572, 'user_id': 2743}, {'rating': 4, 'recipe_id': 6312, 'user_id': 3156}, {'rating': 1, 'recipe_id': 12836, 'user_id': 768}, {'rating': 1, 'recipe_id': 9237, 'user_id': 1599}, {'rating': 2, 'recipe_id': 16946, 'user_id': 2687}, {'rating': 2, 'recipe_id': 20728, 'user_id': 58}, {'rating': 4, 'recipe_id': 12921, 'user_id': 2221}, {'rating': 2, 'recipe_id': 10693, 'user_id': 2114}, {'rating': 2, 'recipe_id': 18301, 'user_id': 4898}, {'rating': 2, 'recipe_id': 9967, 'user_id': 3010}, {'rating': 2, 'recipe_id': 16393, 'user_id': 4830}, {'rating': 4, 'recipe_id': 14838, 'user_id': 583}]

ratings_RDD = self.spark.parallelize(all_user_recipe_rating)

ratings = ratings_RDD.map(lambda row:
  (Rating(int(row['user_id']),
   int(row['recipe_id']),
   float(row['rating']))))

model = self.build_model(ratings)

This is what I came up with after seeing some examples, but this is what I get:
MatrixFactorizationModel: User factor is not cached. Prediction could be slow.
16/12/21 03:54:53 WARN MatrixFactorizationModel: Product factor does not have a partitioner. Prediction on individual records could be slow.
16/12/21 03:54:53 WARN MatrixFactorizationModel: Product factor is not cached. Prediction could be slow.
16/12/21 03:54:53 WARN MatrixFactorizationModelWrapper: User factor does not have a partitioner. Prediction on individual records could be slow.

And
File "/usr/local/spark/python/pyspark/mllib/recommendation.py", line 147, in <lambda>
user_product = user_product.map(lambda u_p: (int(u_p[0]), int(u_p[1])))
TypeError: int() argument must be a string or a number, not 'Rating'

Can someone give me a hand? :) Thanks!

A: Well,
Your error happens due to one thing.
This exception that you are suffer is about the function predictAll of ALS function.
The issue here is that you are trying to send a Rating object to a function that need to receive a RDD<int, int>
I took your code and build what you need:
>>> from pyspark.mllib.recommendation import Rating
>>> ratings = ratings_RDD.map(lambda row:
...   (Rating(int(row['user_id']),
...    int(row['recipe_id']),
...    float(row['rating']))))
>>> model = ALS.trainImplicit(ratings, 1, seed=10)
>>> to_predict = spark.parallelize([[2108, 16393], [583, 20728]])
>>> model.predictAll(to_predict).take(2)
[Rating(user=583, product=20728, rating=0.0741161997082127), Rating(user=2108, product=16393, rating=0.05669039815320609)]

Your JSON is not wrong, what you are having is a problem when you call predictAll that you are sending a Rating object instead of a RDD<int, int>


text:
Q: Informatica job scheduling scripting in unix There are 4 shell scripts:

*

*Migrate a file from path-A to path-B (unix).

*This script triggers one powercenter work flow.

*This script triggers one IDQ job.

*This script deletes the file from path-B (refer point-1 script)

Now I need to create a shell script to call above mentioned scripts in sequence (Any script shall not start before previous is completed successfully).
I am absolutely new to unix.

A: #! /bin/sh -
script1 &&
 script2 &&
 script3 &&
 script4

cmd1 && cmd2 runs cmd2 only if cmd1 succeeds. The exit status of a script is the exit status of the last run command.
Or:
#! /bin/sh -
set -e
script1
script2
script3
script4

set -e tells the shell to exit whenever a command fails (with the exit status of the failing command).
Or:
#! /bin/sh -
script1 || exit
script2 || exit
script3 || exit
script4

cmd1 || cmd2 runs cmd2 if cmd1 fails. exit exits the shell with the exit status of the last command (so here of the failing script). You can use exit 1 to force the exit status to be 1.


text:
Q: Linear algebra, semi-positive matrix If $A\in\mathbb{M}_n(\mathbb{R})$.Show that $C=A^tA$ is a semi-positive matrix if only if A is a singular matrix.
What I did
$$x^tCx=x^tA^tAx=(Ax)^t(Ax)=||Ax||_2^2\geq0$$
That's right?
I think what you need to prove is:
If C is a positive semi-definite matrix, A is singular then
If A is singular matrix then C is a positive semi-definite matrix

A: For any matrix $A \in M_n(\mathbb{R})$, $C = AA^T$ is positive semidefinite.


text:
Q: Why kafka-python fails to connect to Bluemix message hub service? I'm trying to connect to a Bluemix Message Hub instance on http://bluemix.net. This simple script
#!/usr/bin/env python

from kafka import KafkaProducer
from kafka.errors import KafkaError

kafka_brokers_sasl = [
  "kafka01-prod01.messagehub.services.us-south.bluemix.net:9093",
  "kafka02-prod01.messagehub.services.us-south.bluemix.net:9093",
  "kafka03-prod01.messagehub.services.us-south.bluemix.net:9093",
  "kafka04-prod01.messagehub.services.us-south.bluemix.net:9093",
  "kafka05-prod01.messagehub.services.us-south.bluemix.net:9093" ]
sasl_plain_username = "xxxxxxxxxxxxxxx"
sasl_plain_password = "xxxxxxxxxxxxxxxxxxxxxxxxx"
sasl_mechanism = 'SASL_PLAINTEXT'

producer = KafkaProducer(bootstrap_servers = kafka_brokers_sasl,
                         sasl_plain_username = sasl_plain_username,
                         sasl_plain_password = sasl_plain_password,
                         sasl_mechanism = sasl_mechanism )

ends with the exception below:
Traceback (most recent call last):
  File "./test-mh.py", line 12, in <module>
    producer = KafkaProducer(bootstrap_servers = kafka_brokers_sasl, sasl_plain_username = sasl_plain_username, sasl_plain_password = sasl_plain_password, sasl_mechanism = sasl_mechanism )
  File "/usr/local/lib/python2.7/dist-packages/kafka/producer/kafka.py", line 328, in __init__
    **self.config)
  File "/usr/local/lib/python2.7/dist-packages/kafka/client_async.py", line 202, in __init__
    self.config['api_version'] = self.check_version(timeout=check_timeout)
  File "/usr/local/lib/python2.7/dist-packages/kafka/client_async.py", line 791, in check_version
    raise Errors.NoBrokersAvailable()
kafka.errors.NoBrokersAvailable: NoBrokersAvailable

I've got kafka_brokers_sasl, sasl_plain_username, and sasl_plain_password from messagehub service credentials object.
I'm using kafka-python 1.3.1, which seems supporting SASL authentication mechanism.
Any idea of what am I doing wrong? Thanks.

A: Message Hub requires that clients connect using a TLS 1.2 connection.  This means specifying a security_protocol parameter to KafkaProducer and also a ssl.SSLContext via the ssl_context parameter - as it appears that the Python Kafka client creates a SSLv23 context by default.
Here are the changes required to connect:
import ssl
from kafka import KafkaProducer
from kafka.errors import KafkaError

kafka_brokers_sasl = [
    "kafka01-prod01.messagehub.services.us-south.bluemix.net:9093",
    "kafka02-prod01.messagehub.services.us-south.bluemix.net:9093",
    "kafka03-prod01.messagehub.services.us-south.bluemix.net:9093",
    "kafka04-prod01.messagehub.services.us-south.bluemix.net:9093",
    "kafka05-prod01.messagehub.services.us-south.bluemix.net:9093" ]
sasl_plain_username = "xxxxxxxxxxxxxxx"
sasl_plain_password = "xxxxxxxxxxxxxxxxxxxxxxxxx"

sasl_mechanism = 'PLAIN'       # <-- changed from 'SASL_PLAINTEXT'
security_protocol = 'SASL_SSL'

# Create a new context using system defaults, disable all but TLS1.2
context = ssl.create_default_context()
context.options &= ssl.OP_NO_TLSv1
context.options &= ssl.OP_NO_TLSv1_1

producer = KafkaProducer(bootstrap_servers = kafka_brokers_sasl,
                         sasl_plain_username = sasl_plain_username,
                         sasl_plain_password = sasl_plain_password,
                         security_protocol = security_protocol,
                         ssl_context = context,
                         sasl_mechanism = sasl_mechanism)


text:
Q: Daylight Saving Time vs. Javascript Ok, I know how to check if a certain day is inside the DST-frame. But is there any way to get the information if the system providing the Date-object already IS in DST-mode and you dont know the 'normal' time-zone? A user might turn of that feature or still has to reboot or something like that. Most systems provide some kind of flag in the SysAPI to check that… is there any way to get that info from js?

A: Probably not.
The JavaScript language (ECMAScript 5th Edition) doesn't provide any such functionality.
You might be able to access it from an extension such as an ActiveXObject but I doubt that there is any reliable, cross-browser/cross-platform way to detect if the OS or user is using any daylight savings time settings.
This Microsoft Technet article demonstrates how you could detect DST on a few versions of Windows using VBScript (which is likely analogous in JScript) but, again, this isn't likely something you could do reliably (if at all, depending on the specifics of your use case).

A:
is there any way to get the information if the system providing the
  Date-object already IS in DST-mode and you dont know the 'normal'
  time-zone?

Not sure whether i got the question right. Basically I see only two possibilities:
a) The DST feature is turned off or the timezone has no DST-frame at all: we always know the standard time, since there is no DST time.
b) The DST feature is turned on and a DST-frame exists for the timezone: the UTC-offsets of summer- and winter-solitice are different and the standard offset is that of winter-solistice, which is in december (northern hemisphere) or in june (southern hemisphere).
This should give us the information:
function checkDST() {

  var
    now = new Date();
    year = now.getFullYear(), // current year
    june = new Date(year, 5, 21, 12), // solistice 1
    december = new Date(year, 11, 21, 12); // solistice 2
    decTzo = december.getTimezoneOffset(),
    junTzo = june.getTimezoneOffset(),
    nowTzo = now.getTimezoneOffset(),
    dstDiff = decTzo - junTzo,
    msgNoDst = "Your system does not observe Daylight Savings. UTC offset: " + nowTzo,
    msgDstN = "Northern hemisphere. UTC offset: " + nowTzo + ", standard offset: " + decTzo,
    msgDstS = "Southern hemisphere. UTC offset: " + nowTzo + ", standard offset: " + junTzo;

    if (dstDiff === 0) { return msgNoDst; }
    if (dstDiff > 0) { return msgDstN; }
    return msgDstS;
}

alert(checkDST());

– If the difference in offset dec-jun is positive – e.g. for Berlin -60-(-120) = +60 – then the location is on the northern hemisphere and the standard offset is that of december.
– If the difference in offset dec-jun is negative – e.g. for Adelaide -630-(-570) = -60 – then the location is on the southern hemisphere and the standard offset is that of june.


text:
Q: Can mods work with the GOG version of Fallout 3, and if so, how? I just performed a clean install of Fallout 3 GOTY edition (version 1.7.0.3) on Win10. I want to use mods with it, but can't get a single one to work. It might be important to know that I got it from GOG, not Steam.
I have tried to follow numerous online guides, but none of them helped. I never see any error messages or crashes, the game just starts up with no mods present no matter what I do. All of the guides I could find were for the Steam version of the game. Any time the guides referenced a Steam-based file path, I changed it to my best guess at the equivalent path on my machine, but otherwise I followed the instructions as stated.
To make matters worse, most of the guides I found contradicted each other or even themselves. For example, some said to use Fallout Mod Manager and not bother with Nexus Mod Manager, while others said to use Nexus Mod Manager and not even install Fallout Mod Manager. At this point, I've tried most combinations of Fallout Mod Manager, Nexus Mod Manager, Fallout Script Extender and LOOT. Also, some of the guides were very old and included steps for dealing with obsolete features like Games for Windows LIVE or UAC, which did not seem to apply to me. It's also very possible that some of the changes I made for one guide inadvertently caused problems for my attempts with later guides.
The actual mods I was trying to use tended to be from the group of all-time most popular on Nexus Mods, so they should be relatively stable and trustworthy. I did notice one other weird thing that might or might not be relevant. Multiple guides said it was important to start the game once before doing any modding, so that a base ini file would be present. I did that, and changed a few game options during that first game, like HUD color. After my (failed) attempts to install mods, when I checked the game options, the HUD color and other options were always set back to their default values.
How can I get mods working with the GOG version of Fallout 3? I'm willing to uninstall everything and start from scratch at this point if that would help.
EDIT:
I intentionally did not list the exact steps I took. In addition to being really really really long, I thought they would be too specific to help anyone else. And I might want to change up my mods in the future anyways. This question is intended to be "what are the general steps for installing mods with the GOG version of Fallout 3", not "how do I fix my specific setup".
In particular, is there one mod manager that is known to work well, or one that should be avoided, with the GOG version of the game? Are there instructions that show up in guides that are obsolete and now cause problems (possibly having to do with Games for Windows LIVE) or that are somehow important for the Steam version but end up breaking everything if you follow them for the GOG version?


text:
Q: Build to executable jar I'm doing my first java project and would like to use the JavaFX GUI. I was able to compile it to the executable jar, the problem is that the only one way to run it is to have the jdk-14 computer on my computer( because I use java 14) and use the command "java -jar NameJar.jar". However, I would like to open it by double-clicking the program icon, but I have not found how to do it.I would like to know how to do it so that it opens by double clicking on the icon.

A: Take a look at jpackage, a new standard tool in Java 14 for packaging self-contained Java applications. It looks like this is exactly what you need.
Command to build (roughly):
jpackage --name <name here> --input lib --main-jar NameJar.jar --main-class <main class here> --type app-image

A: JSmooth - Java Executable Wrapper is a possibility. It is a tool that turns your java applications into .exe files, which is one way to do it.
If you want to have an executable .jar file then check the accepted (ticked) answer to this post out How to make an executable jar file?
This is the 2 ways I know and both of them work. However, JSmooth is easier and more straightforward if you are fine with the final file being a .exe


text:
Q: How to get host name in flutter for windows? I am working on a flutter application that connects to the MQTT client on the desktop it is opened on. I want to dynamically get the host name of the desktop and connect to it instead of the user having to enter it manually.
Thanks in advance.

A: https://api.flutter.dev/flutter/dart-io/Platform-class.html
import 'dart:io' show Platform, stdout;

void main() {
  // Get the hostname as a string.
  String hostname = Platform.localHostname;

}

A: Solution for Flutter Web
import 'dart:html' as html;

final hostname = html.window.location.hostname;


text:
Q: QTableView: Best way to change activation-trigger to double-click In my application, I have one tableview of items, and a side-panel "preview":ing the latest selected item.
I want clicking on an item to change the selection, and double-clicking to cause a "run"-action to be performed. More specifically, I want the "run"-action (including key-navigation and pressing enter) to be bound to the "activation" of the item in the table-row.
My problem is; single-clicks does not only change the selection, but fires the "activated" signal on the item. I would like to tweak it such that:
Navigation Keys, Single Mouse Click: Selection-change, update preview-panel
Enter Key, Double Mouse Click: Activate/run/open action triggered.
Is there a nice clean way to do it, or are overriding the onclick/doubleclick events my best option? Or is there some other tabular list-widget better suiting my needs?

A: I would connect the slot for the preview action to the currentChanged() signal of the table view's selectionModel(). This covers single clicks and key navigation.
Then there's two options for the double clicks and Enter key presses:

*

*Subclass your tableview, override doubleClickEvent() and keyPressEvent() and fire your custom signal in there, with maybe the model index or something else as an argument. Then just connect your run method to your own signal as you have full control over when it is fired.

*If you don't want to subclass, you can use the installEventFilter() mechanism.

A: Either I'm getting your approach wrong or I'm too tired, but if you want to trigger a run event you should avoid the activated signal completely. Set the signal slot mechanism so that your double click and Enter key press event trigger your run() function, and then the single click/nav buttons should trigger the 'activated' slot which will return your index in the tableview.
I'm pretty certain Qt wants you to be explicit about which signal points to which slot or it'll ignore it or point to a default.


text:
Q: Math symbols are not loading In my document, I am trying to get some math symbols to load, but it is not doing so. Here is a line of code I'm having trouble with, for example.
\item Know (or be able to compute by hand) the values resulting
 from inputting $\frac{k\pi}{12}, \, k \in \Z$ into the $/sin ,
/cos , /tan , /sec , /csc , /cot , /cis$ functions.

However, this is the result I am getting. Notice how the well-known integer set is missing, the trig functions are not configuring, and the 'element' symbol looks kind of weird.

In the preamble, I included the packages I want to use. These are the ones I have: {ifthen,amsmath,amssymb,amsthm,bm,graphicx,color}. I have been able to get the symbols to show in every single document I've made, but don't know what I'm doing wrong right now...

A: You need to use the backslash consistently. Also \Z and \cis are not predefined and you need to define them.
Also be aware that a list of formulas is not a single formula. So you should separate the two parts of the initial formulas into two distinct ones. Feeling the need of \, after a comma is a clear sign that you should consider two formulas instead of one.
\documentclass{article}
\usepackage{amsmath,amssymb}

\DeclareMathOperator{\cis}{cis}
\newcommand{\Z}{\mathbb{Z}}

\begin{document}

\begin{itemize}
\item Know (or be able to compute by hand) the values resulting from
  inputting $\frac{k\pi}{12}$, $k \in \Z$, into the $\sin$, $\cos$,
  $\tan$, $\sec$, $\csc$, $\cot$, $\cis$ functions.
\end{itemize}

\end{document}

A: Please use \ instead of /
\item Know (or be able to compute by hand) the values resulting from inputting $\frac{k\pi}{12}, \, k \in \mathbb{Z}$ into the $\sin , \cos , \tan , \sec , \csc , \cot$ functions.


text:
Q: detecting lane lines on a binary mask I have a binary mask of a road, the mask is a little irregular(sometimes even more than depicted in the image).
I have tried houghLine in OpenCV to detect boundary lines, but the boundary lines are not as expected. I tried erosion and dilation to smooth out things, but no luck. Also since the path is curved it becomes even difficult to detect boundary lines using houghLines. How can I modify the code to detect lines better?
    img2=cv2.erode(img2,None,iterations=2)
    img2=cv2.dilate(img2,None,iterations=2)
    can=cv2.Canny(img2,150,50)
    lines=cv2.HoughLinesP(can,1,np.pi/180,50,maxLineGap=50,minLineLength=10)
    if(lines is not None):
        for x in lines:
            #print(lines[0])
            #mask=np.zeros(frame2.shape,dtype=np.uint8)
            #roi=lines
            #cv2.fillPoly(mask,roi,(255,255,255))
            #cv2.imshow(mask)
            for x1,y1,x2,y2 in x:
                cv2.line(frame2,(x1,y1),(x2,y2),(255,0,0),2)

A: You say that Hough is failing but you don't say why. Why is your output "not as expected"? In my experience, Hough Line Detection's critical points are two: 1) The edges mask you pass to it and 2) how you filter the resulting lines. You should be fine-tuning those two steps and Hough should be enough for your problem.
I don't know what kind of problems the line detector is giving you, but suppose you are interested (as your question suggests) in other methods for lane detection. There are at least two things you could try:  1) Bird's eye transform of the road – which makes line detection much easier since all your lines are now parallel lines. And 2) Contour detection (instead of lines).
Let's examine 2 and what kind of results you can obtain. Listen, man, I offer my answer in C++, but I make notes along with it. I try to highlight the important ideas, so you can implement them in your language of choice. However, if all you want is a CTRL+C and CTRL+V solution, that's ok, but this answer won't help you.
Ok, let's start by reading the image and converting it to binary. Our goal here is to first obtain the edges. Pretty standard stuff:
//Read input image:
std::string imagePath = "C://opencvImages//lanesMask.png";
cv::Mat testImage = cv::imread( imagePath );

//Convert BGR to Gray:
cv::Mat grayImage;
cv::cvtColor( testImage, grayImage, cv::COLOR_RGB2GRAY );

//Get binary image via Otsu:
cv::Mat binaryImage;
cv::threshold( grayImage, binaryImage, 0, 255, cv::THRESH_OTSU );

Now, simply pass this image to Canny's Edge detector. The parameters are also pretty standard. As per Canny's documentation, the ratios between lower and upper thresholds are related by a factor of 3:
//Get Edges via Canny:
cv::Mat testEdges;

//Setup lower and upper thresholds for edge detection:
float lowerThreshold = 30;
float upperThreshold = 3 * lowerThreshold;

cv::Canny( binaryImage, testEdges, lowerThreshold, upperThreshold );

Your mask is pretty good; these are the edges Canny finds:

Now, here's where we are trying something different. We won't use Hough's line detection, instead, let's find the contours of the mask. Each contour is made of points. What we are looking for is actually lines, straight lines that can be fitted to these points. There's more than a method for achieving that. I propose K-means, a clustering algorithm.
The idea is that the points, as you can see, can be clustered in 4 groups: The vanishing point of the lanes (those should be 2 endpoints there) and the 2 starting points of the road. If we give K-means the points of the contour and tell it to cluster the data in 4 separate groups, we should get the means (location) of those 4 points.
Let's try it out. The first step is to find the contours in the edges mask:
//Get contours:
std::vector< std::vector<cv::Point> > contours;
std::vector< cv::Vec4i > hierarchy;

cv::findContours( testEdges, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0) );

K-means needs a specific data type on its input. I'll use a cv::Point2f vector to store all the contour points. Let's set up the variables used by K-means:
//Set up the data containers used by K-means:
cv::Mat centers; cv::Mat labels;
std::vector<cv::Point2f> points; //the data for clustering is stored here

Next, let's loop through the contours and store each point inside the Point2f vector, so we can further pass it to K-means. Let's use the loop to also draw the contours and make sure we are not messing things up:
//Loop thru the found contours:
for( int i = 0; i < (int)contours.size(); i++ ){

  //Set a color & draw contours:
  cv::Scalar color = cv::Scalar( 0, 256, 0 );
  cv::drawContours( testImage, contours, i, color, 2, 8, hierarchy, 0, cv::Point() );

  //This is the current vector of points that is being processed:
  std::vector<cv::Point> currentVecPoint = contours[i];

    //Loop thru it and store each point as a float point inside a plain vector:
    for(int k = 0; k < (int)currentVecPoint.size(); k++){

       cv::Point currentPoint = currentVecPoint[k];
       //Push (store) the point into the vector:
       points.push_back( currentPoint );
    }
}

These are the contours found:

There, now, I have the contour points in my vector. Let's pass the info on to K-means:
//Setup K-means:
int clusterCount = 4; //Number of clusters to split the set by
int attempts = 5; //Number of times the algorithm is executed using different initial labels

int flags = cv::KMEANS_PP_CENTERS;
cv::TermCriteria criteria = cv::TermCriteria( CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, 10, 0.01 );

//The call to kmeans:
cv::kmeans( points, clusterCount, labels, criteria, attempts, flags, centers );

And that's all. The result of K-means is in the centers matrix. Each row of the matrix should have 2 columns, denoting a point center. In this case, the matrix is of size 4 x 2.  Let's draw that info:

As expected, 4 center points, each is the mean of a cluster. Very cool, now, is this approximation enough for your application? Only you know that! You could work with those points and extend both lines, but that's a possible improvement of this result.


text:
Q: What does "OEM strings" mean in dmidecode output? When I run the command sudo dmidecode, OEM Strings entries change everyday. Yesterday, they were like the following:
OEM Strings
String 1: 2WYGio4ByI3fS
String 2: Mqd4eRO2YezsP
String 3: 3N0poAdRciCcs

Now, they are like the following:
OEM Strings
String 1: VNJq-77fKzTx+
String 2: h+8cgFuyKXP-o
String 3: 2l25nHrRCEgKb

What does "OEM strings" mean in dmidecode output?

A: OEM Strings are free-form information stored in the System Management BIOS (see the spec for details). The values themselves don't matter (much), however you wouldn't expect them to change when fans are cleaned.
There is probably a simple explanation though: part of the service process might involve updating the firmware to the latest version, which could change the OEM Strings; or perhaps the technicians replaced the motherboard (which happens quite often during laptop servicing).


text:
Q: How to set page jumps to work on all browsers I have recently completed a Shopify website and all works fine. I am now going through the different browsers to make sure works fine for everyone and I have noticed a few issues regarding page jumps that I have within my site.
For example on the following page:
https://prontaprint247.com/pages/price-list
the page jumps work fine and go to the correct sections that I need in Firefox but when I do the same in Safari and Chrome, the jumps work but there are taking me to the wrong section and I am not sure what I need to do to fix this as not sure if its a browser issue or what.
Would really appreciate it if somebody could advise, as I have checked the tags and they all appear correctly for each page jump so a bit confused.

A: thanks to the following post and Per I was able to resolve the issues with the anchor links (page jumps) now this works the same in all browsers...
http://www.coffeecup.com/forums/designer/anchor-links-in-google-chrome/?page=2
Thought I would post this for anyone else who runs into this issue.


text:
Q: Проблема с рекурсивной lambda Пишу функцию по поиску директорий в поддиректории. Выбор пал на рекурсивную lambda функцию.
Код такой:
void dirListFind = [&dirListFind](const QString &directory, QStringList &dirList)
    {
        QDir dir(directory);

        dirList = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);

        for (auto i = 0; i < dirList.size(); i++)
            dirList.push_front(dirListFind(dirList[i]);
    };

А вот ошибки:

Почему такое поведение? Вроде саму лямбду захватил, но, видимо, как-то не правильно.
И почему странно на void ругается?..
P.S. Методы поиска поддиректорий эффективнее с удовольствием выслушаю, но проблема в данном вопросе имено с лямбдой, прошу учесть.


text:
Q: stderr and stdout - not buffered vs. buffered? I was writing a small program that had various console output strings depending upon different events. As I was looking up the best way to send these messages I came across something that was a bit confusing.
I have read that stderr is used to shoot messages directly to the console - not buffered. While, in contrast, I read that stdout is buffered and is typically used to redirect messages to various streams?, that may or may not be error messages, to an output file or some other medium.
What is the difference when something is said to be buffered and not buffered? It made sense when I was reading that the message is shot directly to the output and is not buffered .. but at the same time I realized that I was not entirely sure what it meant to be buffered.

A: Typically, stdout is line buffered, meaning that characters sent to stdout "stack up" until a newline character arrives, at which point that are all outputted.

A: A buffered stream is one in which you keep writing until a certain threshold.  This threshold could be a specific character, as Konrad mentions for line buffering, or another threshold, such as a specific count of characters written.
Buffering is intended to speed up input/output operations.  One of the slowest things a computer does is write to a stream (whether a console or a file).  When things don't need to be immediately seen, it saves time to store it up for a while.
You are right, stderr is typically an unbuffered stream while stdout typically is buffered.  So there can be times when you output things to stdout then output to stderr and stderr appears first on the console.  If you want to make stdout behave similarly, you would have to flush it after every write.

A: When an output stream is buffered, it means that the stream doesn't necessarily output data the moment you tell it to. There can be significant overhead per IO operation, so lots and lots of little IO operations can create a bottleneck. By buffering IO operations and then flushing many at once, this overhead is reduced.
While stdout and stderr may behave differently regarding buffering, that is generally not the deciding factor between them and shouldn't be relied on. If you absolutely need the output immediately, always manually flush the stream.

A: Assume
int main(void)
{
    printf("foo\n");
    sleep(10);
    printf("bar\n");
}

when executing it on the console
$ ./a.out

you will see foo line and 10 seconds later bar line (--> line buffered).  When redirecting the output into a file or a pipe
$ ./a.out > /tmp/file

the file stays empty (--> buffered) until the program terminates (--> implicit fflush() at exit).
When lines above do not contain a \n, you won't see anything on the console either until program terminates.
Internally, printf() adds a character to a buffer.  To make things more easy, let me describe fputs(char const *s, FILE *f) instead of.  FILE might be defined as
struct FILE {
    int fd;   /* is 0 for stdin, 1 for stdout, 2 for stderr (usually) */
    enum buffer_mode mode;
    char buf[4096];
    size_t count; /* number of chars in buf[] */
};
typedef struct FILE *FILE;

int fflush(FILE *f)
{
    write(f->fd, f->buf, f->count);
    f->count = 0;
}

int fputc(int c, FILE *f)
{
    if (f->count >= ARRAY_SIZE(f->buf))
        fflush(f);
    f->buf[f->count++] = c;
}

int fputs(char const *s, FILE *f)
{
    while (*s) {
        char c = *s++;

        fputc(c, f);

        if (f->mode == LINE_BUFFERED && c == '\n')
            fflush(f);
    }

    if (f->mode == UNBUFFERED)
        fflush(f);
}


text:
Q: How to query table meta data in Cloudera impala Is it possible to query table meta data in Cloudera Impala?
for example, I want to get list of tables which are created after a specific date?
OR I want to know list of tables which are created with parquet storage format.
OR I want to know list of tables with a specific column name.
Are there any meta data tables that I can query for this?

A: No, it is not possible today. You can track this feature via IMPALA-1761, though it is not currently committed to one of the upcoming releases.


text:
Q: How do I complete Build.gradle missing code blocks I want to use my android studio project on firebase platform, but there are missing code lines in the build.gradle file, normally there should be dependendies and ather code blocks, but there is none, so I cannot complete the necessary installations.ty.
i tried to add manually but i got a lot of errors