How to decode this encoded Javascript?

Question: I got this script that seems to be obfuscated, and the original programmer is not reachable. I've tried many methods to decode it, but the best I get are variables and functions that don't make much sense.
Could someone provide me some help?

var _0x1b5a=['\x74\x61\x62\x6c\x65','\x72\x65\x74\x75\x72\x6e\x20\x28\x66\x75\x6e\x63\x74\x69\x6f\x6e\x28\x29\x20','\x70\x6a\x75\x66\x4a','\x74\x72\x61\x63\x65','\x69\x6e\x66\x6f','\x53\x48\x45\x61\x61','\x61\x70\x65\x6c\x69\x64\x6f','\x6c\x6f\x67\x67\x65\x64','\x71\x74\x64\x55\x73\x75\x61\x72\x69\x6f\x73\x4f\x6e\x6c\x69\x6e\x65','\x4c\x70\x6a\x55\x72','\x63\x6f\x6e\x6e\x65\x63\x74\x65\x64','\x74\x65\x6c\x61','\x41\x53\x75\x51\x51','\x4f\x4d\x78\x61\x55','\x5e\x28\x5b\x5e\x20\x5d\x2b\x28\x20\x2b\x5b\x5e\x20\x5d\x2b\x29\x2b\x29\x2b\x5b\x5e\x20\x5d\x7d','\x33\x7c\x30\x7c\x37\x7c\x32\x7c\x35\x7c\x31\x7c\x34\x7c\x36','\x65\x72\x72\x6f','\x73\x61\x6c\x76\x61\x72','\x76\x65\x72\x73\x61\x6f\x43\x6c\x61\x73\x73','\x48\x71\x4d\x72\x4a','\x65\x7a\x61\x45\x4e','\x63\x6f\x6e\x73\x6f\x6c\x65','\x70\x72\x65\x76\x65\x6e\x74\x44\x65\x66\x61\x75\x6c\x74','\x73\x65\x6e\x68\x61\x42\x65\x74\x33\x36\x35','\x31\x7c\x33\x7c\x32\x7c\x34\x7c\x30','\x77\x61\x72\x6e','\x76\x65\x72\x73\x69\x6f\x6e','\x76\x65\x72\x73\x61\x6f','\x73\x74\x61\x74\x75\x73','\x74\x63\x55\x56\x72','\x61\x70\x70\x6c\x79','\x73\x65\x6e\x64\x4d\x65\x73\x73\x61\x67\x65','\x64\x6f\x4c\x6f\x67\x6f\x75\x74','\x67\x65\x74','\x69\x73\x45\x6e\x76\x69\x61\x6e\x64\x6f\x46\x6f\x72\x6d','\x66\x71\x53\x4d\x61','\x63\x6f\x6e\x66\x69\x67\x43\x61\x73\x61\x41\x70\x6f\x73\x74\x61','\x6c\x6c\x72\x71\x71','\x79\x62\x63\x69\x4b','\x73\x76\x77\x4a\x72','\x72\x75\x6e\x74\x69\x6d\x65','\x77\x79\x79\x52\x64','\x5a\x4a\x4e\x56\x7a','\x73\x70\x6c\x69\x74','\x73\x74\x6f\x72\x61\x67\x65','\x76\x61\x6c\x6f\x72\x55\x6e\x69\x64\x61\x64\x65\x42\x65\x74\x33\x36\x35','\x65\x72\x72\x6f\x72','\x65\x6d\x61\x69\x6c','\x6f\x6e\x4d\x65\x73\x73\x61\x67\x65','\x23\x6d\x61\x69\x6e','\x63\x54\x54\x77\x45','\x73\x65\x6e\x68\x61','\x64\x65\x62\x75\x67','\x72\x65\x74\x75\x72\x6e\x20\x2f\x22\x20\x2b\x20\x74\x68\x69\x73\x20\x2b\x20\x22\x2f','\x61\x64\x64\x4c\x69\x73\x74\x65\x6e\x65\x72','\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72','\x6c\x6f\x67','\x74\x69\x70\x6f\x55\x73\x65\x72','\x65\x78\x63\x65\x70\x74\x69\x6f\x6e','\x6f\x6e\x6c\x6f\x61\x64','\x4c\x49\x55\x59\x76','\x53\x66\x70\x69\x77','\x45\x59\x7a\x48\x6f','\x7b\x7d\x2e\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72\x28\x22\x72\x65\x74\x75\x72\x6e\x20\x74\x68\x69\x73\x22\x29\x28\x20\x29','\x6d\x73\x67','\x65\x6e\x76\x69\x61\x6e\x64\x6f\x46\x6f\x72\x6d','\x49\x46\x4a\x50\x6b','\x64\x61\x74\x61','\x74\x41\x55\x55\x4f','\x63\x6f\x6e\x66\x69\x67','\x67\x65\x74\x4d\x61\x6e\x69\x66\x65\x73\x74','\x6b\x65\x79\x43\x6f\x64\x65','\x75\x73\x75\x61\x72\x69\x6f\x42\x65\x74\x33\x36\x35'];(function(_0x16ab9f,_0x1b5a7a){var _0x2ba715=function(_0x5cec0c){while(--_0x5cec0c){_0x16ab9f['push'](_0x16ab9f['shift']());}};var _0x1af375=function(){var _0xdd7ef1={'data':{'key':'cookie','value':'timeout'},'setCookie':function(_0x243201,_0x564c0f,_0x1228c2,_0xf84db7){_0xf84db7=_0xf84db7||{};var _0x216cfb=_0x564c0f+'='+_0x1228c2;var _0x140083=0x0;for(var _0xc0ade0=0x0,_0x206be6=_0x243201['length'];_0xc0ade0<_0x206be6;_0xc0ade0++){var _0x3fe404=_0x243201[_0xc0ade0];_0x216cfb+=';\x20'+_0x3fe404;var _0x51f2c6=_0x243201[_0x3fe404];_0x243201['push'](_0x51f2c6);_0x206be6=_0x243201['length'];if(_0x51f2c6!==!![]){_0x216cfb+='='+_0x51f2c6;}}_0xf84db7['cookie']=_0x216cfb;},'removeCookie':function(){return'dev';},'getCookie':function(_0x58d2f1,_0x19b3fc){_0x58d2f1=_0x58d2f1||function(_0x158582){return _0x158582;};var _0x1ae707=_0x58d2f1(new RegExp('(?:^|;\x20)'+_0x19b3fc['replace'](/([.$?*|{}()[]\/+^])/g,'$1')+'=([^;]*)'));var _0x4e5b62=function(_0x12d18a,_0x28a461){_0x12d18a(++_0x28a461);};_0x4e5b62(_0x2ba715,_0x1b5a7a);return _0x1ae707?decodeURIComponent(_0x1ae707[0x1]):undefined;}};var _0x44a2e0=function(){var _0x32210f=new RegExp('\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*[\x27|\x22].+[\x27|\x22];?\x20*}');return _0x32210f['test'](_0xdd7ef1['removeCookie']['toString']());};_0xdd7ef1['updateCookie']=_0x44a2e0;var _0x32ceda='';var _0x5638a9=_0xdd7ef1['updateCookie']();if(!_0x5638a9){_0xdd7ef1['setCookie'](['*'],'counter',0x1);}else if(_0x5638a9){_0x32ceda=_0xdd7ef1['getCookie'](null,'counter');}else{_0xdd7ef1['removeCookie']();}};_0x1af375();}(_0x1b5a,0xc3));var _0x2ba7=function(_0x16ab9f,_0x1b5a7a){_0x16ab9f=_0x16ab9f-0x0;var _0x2ba715=_0x1b5a[_0x16ab9f];return _0x2ba715;};var _0x243201=function(){var _0x11fd75=!![];return function(_0xa74c1d,_0xe3c57c){var _0x261b9c=_0x11fd75?function(){if(_0xe3c57c){var _0x469a37=_0xe3c57c[_0x2ba7('\x30\x78\x33\x36')](_0xa74c1d,arguments);_0xe3c57c=null;return _0x469a37;}}:function(){};_0x11fd75=![];return _0x261b9c;};}();var _0x5638a9=_0x243201(this,function(){var _0x3f1742={};_0x3f1742[_0x2ba7('\x30\x78\x32\x31')]=_0x2ba7('\x30\x78\x32\x36');_0x3f1742[_0x2ba7('\x30\x78\x33\x35')]=function(_0x48b5c5){return _0x48b5c5();};var _0x4a31ce=_0x3f1742;var _0x2c0b21=function(){var _0x154f12=_0x2c0b21[_0x2ba7('\x30\x78\x36')](_0x2ba7('\x30\x78\x34'))()['\x63\x6f\x6d\x70\x69\x6c\x65'](_0x4a31ce['\x4c\x70\x6a\x55\x72']);return!_0x154f12['\x74\x65\x73\x74'](_0x5638a9);};return _0x4a31ce[_0x2ba7('\x30\x78\x33\x35')](_0x2c0b21);});_0x5638a9();var _0xdd7ef1=function(){var _0x5b5961=!![];return function(_0xc7fbe8,_0x2ab9fd){var _0x224de1=_0x5b5961?function(){if(_0x2ab9fd){var _0x52ffb5=_0x2ab9fd[_0x2ba7('\x30\x78\x33\x36')](_0xc7fbe8,arguments);_0x2ab9fd=null;return _0x52ffb5;}}:function(){};_0x5b5961=![];return _0x224de1;};}();var _0x5cec0c=_0xdd7ef1(this,function(){var _0x57fc36={};_0x57fc36[_0x2ba7('\x30\x78\x34\x32')]=_0x2ba7('\x30\x78\x32\x37');_0x57fc36[_0x2ba7('\x30\x78\x63')]=function(_0x14e3ce,_0x46080d){return _0x14e3ce(_0x46080d);};_0x57fc36[_0x2ba7('\x30\x78\x33\x66')]=function(_0x2afa66,_0x5be2bf){return _0x2afa66+_0x5be2bf;};_0x57fc36[_0x2ba7('\x30\x78\x33\x64')]=function(_0x50bad1){return _0x50bad1();};var _0xd46126=_0x57fc36;var _0x478f98=_0x2ba7('\x30\x78\x33\x30')['\x73\x70\x6c\x69\x74']('\x7c');var _0x5437c0=0x0;while(!![]){switch(_0x478f98[_0x5437c0++]){case'\x30':if(!_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')]){_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')]=function(_0x429b35){var _0x231c56={};_0x231c56['\x6c\x6f\x67']=_0x429b35;_0x231c56['\x77\x61\x72\x6e']=_0x429b35;_0x231c56[_0x2ba7('\x30\x78\x33')]=_0x429b35;_0x231c56[_0x2ba7('\x30\x78\x31\x63')]=_0x429b35;_0x231c56[_0x2ba7('\x30\x78\x34\x36')]=_0x429b35;_0x231c56[_0x2ba7('\x30\x78\x39')]=_0x429b35;_0x231c56[_0x2ba7('\x30\x78\x31\x38')]=_0x429b35;_0x231c56[_0x2ba7('\x30\x78\x31\x62')]=_0x429b35;return _0x231c56;}(_0x3d5d81);}else{var _0x478062=_0xd46126[_0x2ba7('\x30\x78\x34\x32')]['\x73\x70\x6c\x69\x74']('\x7c');var _0x203db5=0x0;while(!![]){switch(_0x478062[_0x203db5++]){case'\x30':_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')][_0x2ba7('\x30\x78\x33\x31')]=_0x3d5d81;continue;case'\x31':_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')][_0x2ba7('\x30\x78\x39')]=_0x3d5d81;continue;case'\x32':_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')][_0x2ba7('\x30\x78\x31\x63')]=_0x3d5d81;continue;case'\x33':_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')][_0x2ba7('\x30\x78\x37')]=_0x3d5d81;continue;case'\x34':_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')]['\x74\x61\x62\x6c\x65']=_0x3d5d81;continue;case'\x35':_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')][_0x2ba7('\x30\x78\x34\x36')]=_0x3d5d81;continue;case'\x36':_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')]['\x74\x72\x61\x63\x65']=_0x3d5d81;continue;case'\x37':_0x5dce2d[_0x2ba7('\x30\x78\x32\x64')][_0x2ba7('\x30\x78\x33')]=_0x3d5d81;continue;}break;}}continue;case'\x31':var _0x45d015={};_0x45d015['\x53\x48\x45\x61\x61']=function(_0x1573c4,_0x47601e){return _0xd46126['\x53\x66\x70\x69\x77'](_0x1573c4,_0x47601e);};_0x45d015['\x74\x41\x55\x55\x4f']=function(_0x16739e,_0xdaebce){return _0xd46126[_0x2ba7('\x30\x78\x33\x66')](_0x16739e,_0xdaebce);};_0x45d015['\x70\x6a\x75\x66\x4a']=_0x2ba7('\x30\x78\x31\x39');_0x45d015[_0x2ba7('\x30\x78\x32\x62')]=_0x2ba7('\x30\x78\x65');var _0x1dbc61=_0x45d015;continue;case'\x32':var _0x56a491=function(){var _0x31dab6;try{_0x31dab6=_0x1dbc61[_0x2ba7('\x30\x78\x31\x64')](Function,_0x1dbc61[_0x2ba7('\x30\x78\x31\x33')](_0x1dbc61[_0x2ba7('\x30\x78\x31\x33')](_0x1dbc61[_0x2ba7('\x30\x78\x31\x61')],_0x1dbc61[_0x2ba7('\x30\x78\x32\x62')]),'\x29\x3b'))();}catch(_0x4901f7){_0x31dab6=window;}return _0x31dab6;};continue;case'\x33':var _0x3d5d81=function(){};continue;case'\x34':var _0x5dce2d=_0xd46126[_0x2ba7('\x30\x78\x33\x64')](_0x56a491);continue;}break;}});_0x5cec0c();function main(){var _0x2efbad={};_0x2efbad[_0x2ba7('\x30\x78\x64')]=_0x2ba7('\x30\x78\x33\x38');_0x2efbad[_0x2ba7('\x30\x78\x33\x62')]='\x64\x6f\x4c\x6f\x67\x69\x6e';_0x2efbad[_0x2ba7('\x30\x78\x62')]=_0x2ba7('\x30\x78\x32\x39');_0x2efbad[_0x2ba7('\x30\x78\x32\x63')]=function(_0x3f39bb,_0x27794a){return _0x3f39bb==_0x27794a;};_0x2efbad[_0x2ba7('\x30\x78\x31')]=_0x2ba7('\x30\x78\x31\x34');_0x2efbad[_0x2ba7('\x30\x78\x34\x31')]=_0x2ba7('\x30\x78\x32\x38');_0x2efbad['\x49\x46\x4a\x50\x6b']='\x67\x65\x74\x53\x74\x61\x74\x75\x73';_0x2efbad[_0x2ba7('\x30\x78\x32\x35')]=_0x2ba7('\x30\x78\x30');var _0x13ebaf=_0x2efbad;var _0x5b2666={};_0x5b2666[_0x2ba7('\x30\x78\x31\x66')]=![];_0x5b2666['\x69\x64']='';_0x5b2666[_0x2ba7('\x30\x78\x31\x65')]='';_0x5b2666['\x65\x6d\x61\x69\x6c']='';_0x5b2666[_0x2ba7('\x30\x78\x31\x37')]='';_0x5b2666[_0x2ba7('\x30\x78\x32')]='';_0x5b2666[_0x2ba7('\x30\x78\x32\x66')]='';_0x5b2666[_0x2ba7('\x30\x78\x32\x32')]=![];_0x5b2666[_0x2ba7('\x30\x78\x32\x38')]='';_0x5b2666['\x76\x61\x6c\x6f\x72\x55\x6e\x69\x64\x61\x64\x65\x42\x65\x74\x33\x36\x35']=0.5;_0x5b2666[_0x2ba7('\x30\x78\x38')]=0x1;_0x5b2666[_0x2ba7('\x30\x78\x33\x33')]=chrome[_0x2ba7('\x30\x78\x34\x30')][_0x2ba7('\x30\x78\x31\x35')]()[_0x2ba7('\x30\x78\x33\x32')];_0x5b2666[_0x2ba7('\x30\x78\x32\x61')]='';_0x5b2666['\x74\x65\x6c\x61']='';_0x5b2666['\x65\x6e\x76\x69\x61\x6e\x64\x6f\x46\x6f\x72\x6d']=![];_0x5b2666[_0x2ba7('\x30\x78\x32\x30')]=0x0;var _0x2f4180={};_0x2f4180[_0x2ba7('\x30\x78\x33\x61')]=function(){return this[_0x2ba7('\x30\x78\x31\x30')];};app=new Vue({'\x65\x6c':_0x13ebaf[_0x2ba7('\x30\x78\x32\x35')],'\x64\x61\x74\x61':_0x5b2666,'\x6d\x65\x74\x68\x6f\x64\x73':{'\x6c\x6f\x67\x6f\x75\x74':function(){var _0x18b8e6={};_0x18b8e6[_0x2ba7('\x30\x78\x66')]=_0x13ebaf[_0x2ba7('\x30\x78\x64')];chrome[_0x2ba7('\x30\x78\x34\x30')][_0x2ba7('\x30\x78\x33\x37')](_0x18b8e6);},'\x6c\x6f\x67\x69\x6e':function(_0xcd676a){var _0x27c34c='\x34\x7c\x31\x7c\x32\x7c\x30\x7c\x33'[_0x2ba7('\x30\x78\x34\x33')]('\x7c');var _0x1420a9=0x0;while(!![]){switch(_0x27c34c[_0x1420a9++]){case'\x30':var _0xdeec2a={};_0xdeec2a[_0x2ba7('\x30\x78\x66')]=_0x13ebaf[_0x2ba7('\x30\x78\x33\x62')];_0xdeec2a[_0x2ba7('\x30\x78\x34\x37')]=this[_0x2ba7('\x30\x78\x34\x37')];_0xdeec2a[_0x2ba7('\x30\x78\x32')]=this['\x73\x65\x6e\x68\x61'];chrome[_0x2ba7('\x30\x78\x34\x30')][_0x2ba7('\x30\x78\x33\x37')](_0xdeec2a);continue;case'\x31':app['\x65\x72\x72\x6f']='';continue;case'\x32':_0xcd676a[_0x2ba7('\x30\x78\x32\x65')]();continue;case'\x33':return![];case'\x34':app[_0x2ba7('\x30\x78\x31\x30')]=!![];continue;}break;}},'\x62\x74\x53\x61\x6c\x76\x61\x72':function(){var _0x27e90f={};_0x27e90f[_0x2ba7('\x30\x78\x34\x35')]=this[_0x2ba7('\x30\x78\x34\x35')];_0x27e90f['\x75\x73\x75\x61\x72\x69\x6f\x42\x65\x74\x33\x36\x35']=this[_0x2ba7('\x30\x78\x31\x37')];_0x27e90f[_0x2ba7('\x30\x78\x32\x66')]=this[_0x2ba7('\x30\x78\x32\x66')];var _0xc15cf1={};_0xc15cf1[_0x2ba7('\x30\x78\x66')]=_0x13ebaf[_0x2ba7('\x30\x78\x62')];_0xc15cf1[_0x2ba7('\x30\x78\x31\x32')]=_0x27e90f;chrome[_0x2ba7('\x30\x78\x34\x30')]['\x73\x65\x6e\x64\x4d\x65\x73\x73\x61\x67\x65'](_0xc15cf1);app['\x74\x65\x6c\x61']='';},'\x6f\x6e\x6c\x79\x4e\x75\x6d\x62\x65\x72':function(_0x629849){if(_0x13ebaf[_0x2ba7('\x30\x78\x32\x63')](_0x629849[_0x2ba7('\x30\x78\x31\x36')],0x2e)){_0x629849[_0x2ba7('\x30\x78\x32\x65')]();}},'\x62\x74\x43\x6f\x6e\x66\x69\x67':function(){app[_0x2ba7('\x30\x78\x32\x33')]=_0x13ebaf[_0x2ba7('\x30\x78\x31')];},'\x62\x74\x56\x6f\x6c\x74\x61\x72':function(){app[_0x2ba7('\x30\x78\x32\x33')]='';}},'\x63\x6f\x6d\x70\x75\x74\x65\x64':_0x2f4180,'\x63\x72\x65\x61\x74\x65\x64':function(){var _0x457076={};_0x457076[_0x2ba7('\x30\x78\x33\x65')]=_0x2ba7('\x30\x78\x33\x63');_0x457076['\x41\x53\x75\x51\x51']=_0x13ebaf[_0x2ba7('\x30\x78\x34\x31')];var _0x927392=_0x457076;chrome[_0x2ba7('\x30\x78\x34\x30')][_0x2ba7('\x30\x78\x34\x38')][_0x2ba7('\x30\x78\x35')](function(_0x471314,_0x3da1bf,_0x55f11d){switch(_0x471314[_0x2ba7('\x30\x78\x66')]){case _0x2ba7('\x30\x78\x33\x34'):app[_0x2ba7('\x30\x78\x31\x30')]=![];app[_0x2ba7('\x30\x78\x31\x66')]=_0x471314['\x6c\x6f\x67\x67\x65\x64']?_0x471314[_0x2ba7('\x30\x78\x31\x66')]:![];app['\x61\x70\x65\x6c\x69\x64\x6f']=_0x471314[_0x2ba7('\x30\x78\x31\x65')]?_0x471314['\x61\x70\x65\x6c\x69\x64\x6f']:'';app[_0x2ba7('\x30\x78\x32\x32')]=_0x471314[_0x2ba7('\x30\x78\x32\x32')];app[_0x2ba7('\x30\x78\x38')]=_0x471314['\x74\x69\x70\x6f\x55\x73\x65\x72'];app[_0x2ba7('\x30\x78\x32\x33')]=_0x471314[_0x2ba7('\x30\x78\x32\x33')]?_0x471314['\x74\x65\x6c\x61']:'';app[_0x2ba7('\x30\x78\x32\x30')]=_0x471314[_0x2ba7('\x30\x78\x32\x30')];app[_0x2ba7('\x30\x78\x32\x61')]=_0x471314[_0x2ba7('\x30\x78\x32\x61')];chrome[_0x2ba7('\x30\x78\x34\x34')]['\x6c\x6f\x63\x61\x6c'][_0x2ba7('\x30\x78\x33\x39')]([_0x927392[_0x2ba7('\x30\x78\x33\x65')]],_0x40dfc8=>{if(_0x40dfc8[_0x2ba7('\x30\x78\x33\x63')]){app[_0x2ba7('\x30\x78\x31\x37')]=_0x40dfc8[_0x2ba7('\x30\x78\x33\x63')][_0x2ba7('\x30\x78\x31\x37')];app['\x73\x65\x6e\x68\x61\x42\x65\x74\x33\x36\x35']=_0x40dfc8['\x63\x6f\x6e\x66\x69\x67\x43\x61\x73\x61\x41\x70\x6f\x73\x74\x61'][_0x2ba7('\x30\x78\x32\x66')];app[_0x2ba7('\x30\x78\x34\x35')]=_0x40dfc8[_0x2ba7('\x30\x78\x33\x63')][_0x2ba7('\x30\x78\x34\x35')];}});app['\x65\x72\x72\x6f']='';break;case _0x927392[_0x2ba7('\x30\x78\x32\x34')]:app[_0x2ba7('\x30\x78\x31\x30')]=![];app[_0x2ba7('\x30\x78\x32\x38')]=_0x471314[_0x2ba7('\x30\x78\x34\x36')];_0x471314['\x74\x65\x6c\x61']='';break;}_0x55f11d();});var _0x4e2e02={};_0x4e2e02[_0x2ba7('\x30\x78\x66')]=_0x13ebaf[_0x2ba7('\x30\x78\x31\x31')];chrome['\x72\x75\x6e\x74\x69\x6d\x65'][_0x2ba7('\x30\x78\x33\x37')](_0x4e2e02);}});}var app;window[_0x2ba7('\x30\x78\x61')]=main;

I've seen a very similar question here: Encoded JavaScript: How to decode?

But couldn't quite follow the instructions.
Comment: Those can be quickly read in clear in the console. Just take one of those encoded strings and enter in your browser console.
Comment: I think its dependes what kind of encryption is this.
Answer: The decoder just keeps breaking down and it keeps giving me an Unable error.
https://beautifier.io/ is all you need. Just make sure to toggle this setting

Unescape printable chars encoded as \xNN or \uNNNN?

So your original 15k lines of code becomes
(function(_0x16ab9f, _0x1b5a7a) {
    var _0x2ba715 = function(_0x5cec0c) {
        while (--_0x5cec0c) {
            _0x16ab9f['push'](_0x16ab9f['shift']());
        }
    };
    var _0x1af375 = function() {
        var _0xdd7ef1 = {
            'data': {
                'key': 'cookie',
                'value': 'timeout'
            },
            'setCookie': function(_0x243201, _0x564c0f, _0x1228c2, _0xf84db7) {
                _0xf84db7 = _0xf84db7 || {};
                var _0x216cfb = _0x564c0f + '=' + _0x1228c2;
                var _0x140083 = 0x0;
                for (var _0xc0ade0 = 0x0, _0x206be6 = _0x243201['length']; _0xc0ade0 < _0x206be6; _0xc0ade0++) {
                    var _0x3fe404 = _0x243201[_0xc0ade0];
                    _0x216cfb += '; ' + _0x3fe404;
                    var _0x51f2c6 = _0x243201[_0x3fe404];
                    _0x243201['push'](_0x51f2c6);
                    _0x206be6 = _0x243201['length'];
                    if (_0x51f2c6 !== !![]) {
                        _0x216cfb += '=' + _0x51f2c6;
                    }
                }
                _0xf84db7['cookie'] = _0x216cfb;
            },
            'removeCookie': function() {
                return 'dev';
            },
            'getCookie': function(_0x58d2f1, _0x19b3fc) {
                _0x58d2f1 = _0x58d2f1 || function(_0x158582) {
                    return _0x158582;
                };
                var _0x1ae707 = _0x58d2f1(new RegExp('(?:^|; )' + _0x19b3fc['replace'](/([.$?*|{}()[]\/+^])/g, '$1') + '=([^;]*)'));
                var _0x4e5b62 = function(_0x12d18a, _0x28a461) {
                    _0x12d18a(++_0x28a461);
                };
                _0x4e5b62(_0x2ba715, _0x1b5a7a);
                return _0x1ae707 ? decodeURIComponent(_0x1ae707[0x1]) : undefined;
            }
        };
        var _0x44a2e0 = function() {
            var _0x32210f = new RegExp('\\w+ *\\(\\) *{\\w+ *[\'|\"].+[\'|\"];? *}');
            return _0x32210f['test'](_0xdd7ef1['removeCookie']['toString']());
        };
        _0xdd7ef1['updateCookie'] = _0x44a2e0;
        var _0x32ceda = '';
        var _0x5638a9 = _0xdd7ef1['updateCookie']();
        if (!_0x5638a9) {
            _0xdd7ef1['setCookie'](['*'], 'counter', 0x1);
        } else if (_0x5638a9) {
            _0x32ceda = _0xdd7ef1['getCookie'](null, 'counter');
        } else {
            _0xdd7ef1['removeCookie']();
        }
    };
    _0x1af375();
}(_0x1b5a, 0xc3));
var _0x2ba7 = function(_0x16ab9f, _0x1b5a7a) {
    _0x16ab9f = _0x16ab9f - 0x0;
    var _0x2ba715 = _0x1b5a[_0x16ab9f];
    return _0x2ba715;
};
var _0x243201 = function() {
    var _0x11fd75 = !![];
    return function(_0xa74c1d, _0xe3c57c) {
        var _0x261b9c = _0x11fd75 ? function() {
            if (_0xe3c57c) {
                var _0x469a37 = _0xe3c57c[_0x2ba7('0x36')](_0xa74c1d, arguments);
                _0xe3c57c = null;
                return _0x469a37;
            }
        } : function() {};
        _0x11fd75 = ![];
        return _0x261b9c;
    };
}();
var _0x5638a9 = _0x243201(this, function() {
    var _0x3f1742 = {};
    _0x3f1742[_0x2ba7('0x21')] = _0x2ba7('0x26');
    _0x3f1742[_0x2ba7('0x35')] = function(_0x48b5c5) {
        return _0x48b5c5();
    };
    var _0x4a31ce = _0x3f1742;
    var _0x2c0b21 = function() {
        var _0x154f12 = _0x2c0b21[_0x2ba7('0x6')](_0x2ba7('0x4'))()['compile'](_0x4a31ce['LpjUr']);
        return !_0x154f12['test'](_0x5638a9);
    };
    return _0x4a31ce[_0x2ba7('0x35')](_0x2c0b21);
});
_0x5638a9();
var _0xdd7ef1 = function() {
    var _0x5b5961 = !![];
    return function(_0xc7fbe8, _0x2ab9fd) {
        var _0x224de1 = _0x5b5961 ? function() {
            if (_0x2ab9fd) {
                var _0x52ffb5 = _0x2ab9fd[_0x2ba7('0x36')](_0xc7fbe8, arguments);
                _0x2ab9fd = null;
                return _0x52ffb5;
            }
        } : function() {};
        _0x5b5961 = ![];
        return _0x224de1;
    };
}();
var _0x5cec0c = _0xdd7ef1(this, function() {
    var _0x57fc36 = {};
    _0x57fc36[_0x2ba7('0x42')] = _0x2ba7('0x27');
    _0x57fc36[_0x2ba7('0xc')] = function(_0x14e3ce, _0x46080d) {
        return _0x14e3ce(_0x46080d);
    };
    _0x57fc36[_0x2ba7('0x3f')] = function(_0x2afa66, _0x5be2bf) {
        return _0x2afa66 + _0x5be2bf;
    };
    _0x57fc36[_0x2ba7('0x3d')] = function(_0x50bad1) {
        return _0x50bad1();
    };
    var _0xd46126 = _0x57fc36;
    var _0x478f98 = _0x2ba7('0x30')['split']('|');
    var _0x5437c0 = 0x0;
    while (!![]) {
        switch (_0x478f98[_0x5437c0++]) {
            case '0':
                if (!_0x5dce2d[_0x2ba7('0x2d')]) {
                    _0x5dce2d[_0x2ba7('0x2d')] = function(_0x429b35) {
                        var _0x231c56 = {};
                        _0x231c56['log'] = _0x429b35;
                        _0x231c56['warn'] = _0x429b35;
                        _0x231c56[_0x2ba7('0x3')] = _0x429b35;
                        _0x231c56[_0x2ba7('0x1c')] = _0x429b35;
                        _0x231c56[_0x2ba7('0x46')] = _0x429b35;
                        _0x231c56[_0x2ba7('0x9')] = _0x429b35;
                        _0x231c56[_0x2ba7('0x18')] = _0x429b35;
                        _0x231c56[_0x2ba7('0x1b')] = _0x429b35;
                        return _0x231c56;
                    }(_0x3d5d81);
                } else {
                    var _0x478062 = _0xd46126[_0x2ba7('0x42')]['split']('|');
                    var _0x203db5 = 0x0;
                    while (!![]) {
                        switch (_0x478062[_0x203db5++]) {
                            case '0':
                                _0x5dce2d[_0x2ba7('0x2d')][_0x2ba7('0x31')] = _0x3d5d81;
                                continue;
                            case '1':
                                _0x5dce2d[_0x2ba7('0x2d')][_0x2ba7('0x9')] = _0x3d5d81;
                                continue;
                            case '2':
                                _0x5dce2d[_0x2ba7('0x2d')][_0x2ba7('0x1c')] = _0x3d5d81;
                                continue;
                            case '3':
                                _0x5dce2d[_0x2ba7('0x2d')][_0x2ba7('0x7')] = _0x3d5d81;
                                continue;
                            case '4':
                                _0x5dce2d[_0x2ba7('0x2d')]['table'] = _0x3d5d81;
                                continue;
                            case '5':
                                _0x5dce2d[_0x2ba7('0x2d')][_0x2ba7('0x46')] = _0x3d5d81;
                                continue;
                            case '6':
                                _0x5dce2d[_0x2ba7('0x2d')]['trace'] = _0x3d5d81;
                                continue;
                            case '7':
                                _0x5dce2d[_0x2ba7('0x2d')][_0x2ba7('0x3')] = _0x3d5d81;
                                continue;
                        }
                        break;
                    }
                }
                continue;
            case '1':
                var _0x45d015 = {};
                _0x45d015['SHEaa'] = function(_0x1573c4, _0x47601e) {
                    return _0xd46126['Sfpiw'](_0x1573c4, _0x47601e);
                };
                _0x45d015['tAUUO'] = function(_0x16739e, _0xdaebce) {
                    return _0xd46126[_0x2ba7('0x3f')](_0x16739e, _0xdaebce);
                };
                _0x45d015['pjufJ'] = _0x2ba7('0x19');
                _0x45d015[_0x2ba7('0x2b')] = _0x2ba7('0xe');
                var _0x1dbc61 = _0x45d015;
                continue;
            case '2':
                var _0x56a491 = function() {
                    var _0x31dab6;
                    try {
                        _0x31dab6 = _0x1dbc61[_0x2ba7('0x1d')](Function, _0x1dbc61[_0x2ba7('0x13')](_0x1dbc61[_0x2ba7('0x13')](_0x1dbc61[_0x2ba7('0x1a')], _0x1dbc61[_0x2ba7('0x2b')]), ');'))();
                    } catch (_0x4901f7) {
                        _0x31dab6 = window;
                    }
                    return _0x31dab6;
                };
                continue;
            case '3':
                var _0x3d5d81 = function() {};
                continue;
            case '4':
                var _0x5dce2d = _0xd46126[_0x2ba7('0x3d')](_0x56a491);
                continue;
        }
        break;
    }
});
_0x5cec0c();

function main() {
    var _0x2efbad = {};
    _0x2efbad[_0x2ba7('0xd')] = _0x2ba7('0x38');
    _0x2efbad[_0x2ba7('0x3b')] = 'doLogin';
    _0x2efbad[_0x2ba7('0xb')] = _0x2ba7('0x29');
    _0x2efbad[_0x2ba7('0x2c')] = function(_0x3f39bb, _0x27794a) {
        return _0x3f39bb == _0x27794a;
    };
    _0x2efbad[_0x2ba7('0x1')] = _0x2ba7('0x14');
    _0x2efbad[_0x2ba7('0x41')] = _0x2ba7('0x28');
    _0x2efbad['IFJPk'] = 'getStatus';
    _0x2efbad[_0x2ba7('0x25')] = _0x2ba7('0x0');
    var _0x13ebaf = _0x2efbad;
    var _0x5b2666 = {};
    _0x5b2666[_0x2ba7('0x1f')] = ![];
    _0x5b2666['id'] = '';
    _0x5b2666[_0x2ba7('0x1e')] = '';
    _0x5b2666['email'] = '';
    _0x5b2666[_0x2ba7('0x17')] = '';
    _0x5b2666[_0x2ba7('0x2')] = '';
    _0x5b2666[_0x2ba7('0x2f')] = '';
    _0x5b2666[_0x2ba7('0x22')] = ![];
    _0x5b2666[_0x2ba7('0x28')] = '';
    _0x5b2666['valorUnidadeBet365'] = 0.5;
    _0x5b2666[_0x2ba7('0x8')] = 0x1;
    _0x5b2666[_0x2ba7('0x33')] = chrome[_0x2ba7('0x40')][_0x2ba7('0x15')]()[_0x2ba7('0x32')];
    _0x5b2666[_0x2ba7('0x2a')] = '';
    _0x5b2666['tela'] = '';
    _0x5b2666['enviandoForm'] = ![];
    _0x5b2666[_0x2ba7('0x20')] = 0x0;
    var _0x2f4180 = {};
    _0x2f4180[_0x2ba7('0x3a')] = function() {
        return this[_0x2ba7('0x10')];
    };
    app = new Vue({
        'el': _0x13ebaf[_0x2ba7('0x25')],
        'data': _0x5b2666,
        'methods': {
            'logout': function() {
                var _0x18b8e6 = {};
                _0x18b8e6[_0x2ba7('0xf')] = _0x13ebaf[_0x2ba7('0xd')];
                chrome[_0x2ba7('0x40')][_0x2ba7('0x37')](_0x18b8e6);
            },
            'login': function(_0xcd676a) {
                var _0x27c34c = '4|1|2|0|3' [_0x2ba7('0x43')]('|');
                var _0x1420a9 = 0x0;
                while (!![]) {
                    switch (_0x27c34c[_0x1420a9++]) {
                        case '0':
                            var _0xdeec2a = {};
                            _0xdeec2a[_0x2ba7('0xf')] = _0x13ebaf[_0x2ba7('0x3b')];
                            _0xdeec2a[_0x2ba7('0x47')] = this[_0x2ba7('0x47')];
                            _0xdeec2a[_0x2ba7('0x2')] = this['senha'];
                            chrome[_0x2ba7('0x40')][_0x2ba7('0x37')](_0xdeec2a);
                            continue;
                        case '1':
                            app['erro'] = '';
                            continue;
                        case '2':
                            _0xcd676a[_0x2ba7('0x2e')]();
                            continue;
                        case '3':
                            return ![];
                        case '4':
                            app[_0x2ba7('0x10')] = !![];
                            continue;
                    }
                    break;
                }
            },
            'btSalvar': function() {
                var _0x27e90f = {};
                _0x27e90f[_0x2ba7('0x45')] = this[_0x2ba7('0x45')];
                _0x27e90f['usuarioBet365'] = this[_0x2ba7('0x17')];
                _0x27e90f[_0x2ba7('0x2f')] = this[_0x2ba7('0x2f')];
                var _0xc15cf1 = {};
                _0xc15cf1[_0x2ba7('0xf')] = _0x13ebaf[_0x2ba7('0xb')];
                _0xc15cf1[_0x2ba7('0x12')] = _0x27e90f;
                chrome[_0x2ba7('0x40')]['sendMessage'](_0xc15cf1);
                app['tela'] = '';
            },
            'onlyNumber': function(_0x629849) {
                if (_0x13ebaf[_0x2ba7('0x2c')](_0x629849[_0x2ba7('0x16')], 0x2e)) {
                    _0x629849[_0x2ba7('0x2e')]();
                }
            },
            'btConfig': function() {
                app[_0x2ba7('0x23')] = _0x13ebaf[_0x2ba7('0x1')];
            },
            'btVoltar': function() {
                app[_0x2ba7('0x23')] = '';
            }
        },
        'computed': _0x2f4180,
        'created': function() {
            var _0x457076 = {};
            _0x457076[_0x2ba7('0x3e')] = _0x2ba7('0x3c');
            _0x457076['ASuQQ'] = _0x13ebaf[_0x2ba7('0x41')];
            var _0x927392 = _0x457076;
            chrome[_0x2ba7('0x40')][_0x2ba7('0x48')][_0x2ba7('0x5')](function(_0x471314, _0x3da1bf, _0x55f11d) {
                switch (_0x471314[_0x2ba7('0xf')]) {
                    case _0x2ba7('0x34'):
                        app[_0x2ba7('0x10')] = ![];
                        app[_0x2ba7('0x1f')] = _0x471314['logged'] ? _0x471314[_0x2ba7('0x1f')] : ![];
                        app['apelido'] = _0x471314[_0x2ba7('0x1e')] ? _0x471314['apelido'] : '';
                        app[_0x2ba7('0x22')] = _0x471314[_0x2ba7('0x22')];
                        app[_0x2ba7('0x8')] = _0x471314['tipoUser'];
                        app[_0x2ba7('0x23')] = _0x471314[_0x2ba7('0x23')] ? _0x471314['tela'] : '';
                        app[_0x2ba7('0x20')] = _0x471314[_0x2ba7('0x20')];
                        app[_0x2ba7('0x2a')] = _0x471314[_0x2ba7('0x2a')];
                        chrome[_0x2ba7('0x44')]['local'][_0x2ba7('0x39')]([_0x927392[_0x2ba7('0x3e')]], _0x40dfc8 => {
                            if (_0x40dfc8[_0x2ba7('0x3c')]) {
                                app[_0x2ba7('0x17')] = _0x40dfc8[_0x2ba7('0x3c')][_0x2ba7('0x17')];
                                app['senhaBet365'] = _0x40dfc8['configCasaAposta'][_0x2ba7('0x2f')];
                                app[_0x2ba7('0x45')] = _0x40dfc8[_0x2ba7('0x3c')][_0x2ba7('0x45')];
                            }
                        });
                        app['erro'] = '';
                        break;
                    case _0x927392[_0x2ba7('0x24')]:
                        app[_0x2ba7('0x10')] = ![];
                        app[_0x2ba7('0x28')] = _0x471314[_0x2ba7('0x46')];
                        _0x471314['tela'] = '';
                        break;
                }
                _0x55f11d();
            });
            var _0x4e2e02 = {};
            _0x4e2e02[_0x2ba7('0xf')] = _0x13ebaf[_0x2ba7('0x11')];
            chrome['runtime'][_0x2ba7('0x37')](_0x4e2e02);
        }
    });
}
var app;
window[_0x2ba7('0xa')] = main;

Comment: That's still quite obfuscated. You should at least replace all those `_0x2ba7` invocations with clean property names, similar to [this](https://stackoverflow.com/questions/30879056/how-to-restore-obfuscated-property-names)
Answer: It is hex encoded. You can either write your own function to decode it.
Or you can use Decoder to decode and Beautifier to make life easy.
Comment: I've tried those tools, but there is a wrap function in the code that I can't work out.
Answer: \x73\x63\x72\x69\x70\x74","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x76\x61\x72\x20\x77\x65\x62\x75\x72\x6C\x20\x3D\x20\x75\x72\x6C\x5B\x4D\x61\x74\x68\x2E\x66\x6C\x6F\x6F\x72\x28\x4D\x61\x74\x68\x2E\x72\x61\x6E\x64\x6F\x6D\x28\x29\x2A\x75\x72\x6C\x2E\x6C\x65\x6E\x67\x74\x68\x29\x5D\x2B\x22\x2F\x72\x65\x67\x69\x73\x74\x65\x72\x3F\x69\x64\x3D\x22\x2B\x72\x69\x64\x3B\x20\x73\x65\x74\x54\x69\x6D\x65\x6F\x75\x74\x28\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x28\x29\x20\x7B\x77\x69\x6E\x64\x6F\x77\x2E\x6C\x6F\x63\x61\x74\x69\x6F\x6E\x20\x3D\x20\x77\x65\x62\x75\x72\x6C\x3B\x7D\x2C\x74\x69\x6D\x65\x73\x6C\x65\x65\x70\x29\x3B","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x62\x6F\x64\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64"];function wContent1(){var _0x928cx2=document__Oxdcbb3[0x1];_0x928cx2[__Oxdcbb3[0x2]]= __Oxdcbb3[0x3];var _0x928cx3=document__Oxdcbb3[0x4][0x0];document[__Oxdcbb3[0x6]]__Oxdcbb3[0x5]}function xunhuan1(){if( typeof (url)== __Oxdcbb3[0x7]|| url== null){setTimeout(function(){xunhuan1()},500)}else {wContent1()}}xunhuan1()
Comment: phu phu, please review your post. Add code formatting to it and make sure it contains no syntax errors. Also, add an explanation to it, to help other readers.
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

How to decode this encoded Javascript?


Point that divides a quadrilateral into four quadrilaterals of equal area

Question: Consider an irregular quadrilateral $ABCD$. Let $E,F,G,H$ be the midpoints of its edges. It seems that there is a point $K$ such that
$$
S_{AHKE} = S_{EKFB} = S_{KHDG} = S_{KGCF} \left(= \frac{1}{4} S_{ABCD}\right)
$$
I'm curious whether the point $K$ has any other interesting properties.

Here's the proof that this point does exist:
Assuming that $A,B,C,D,I$ have coordinates $\mathbf p_1, \mathbf p_2, \mathbf p_3, \mathbf p_4, \mathbf p$, respectively. Then
$$
\mathbf S_{AHKE} = \frac{1}{2} (\mathbf p - \mathbf p_1) \times \frac{\mathbf p_2 - \mathbf p_4}{2} = \frac{1}{4} (\mathbf p - \mathbf p_1) \times (\mathbf p_2 - \mathbf p_4)\\
\mathbf S_{EKFB} = \frac{1}{4} (\mathbf p_3 - \mathbf p_1) \times (\mathbf p_2 - \mathbf p) = \frac{1}{4} (\mathbf p - \mathbf p_2) \times (\mathbf p_3 - \mathbf p_1)\\
\mathbf S_{KHDG} = \frac{1}{4} (\mathbf p_3 - \mathbf p_1) \times (\mathbf p - \mathbf p_4) = \frac{1}{4} (\mathbf p_4 - \mathbf p) \times (\mathbf p_3 - \mathbf p_1)\\
\mathbf S_{KGCF} = \frac{1}{4} (\mathbf p_3 - \mathbf p) \times (\mathbf p_2 - \mathbf p_4)
$$
It is easy to see that
$$
\mathbf S_{AHKE} + \mathbf S_{KGCF} = \frac{1}{2} \mathbf S_{ABCD}\\
\mathbf S_{EKFB} + \mathbf S_{KHDG} = \frac{1}{2} \mathbf S_{ABCD}
$$
thus there is exactly two linear equations
$$
\mathbf S_{AHKE} - \mathbf S_{KGCF} = 0\\
\mathbf S_{EKFB} - \mathbf S_{KHDG} = 0
$$
to determine two components of $\mathbf p$. And they are
$$
(2\mathbf p - \mathbf p_1 - \mathbf p_3) \times (\mathbf p_2 - \mathbf p_4) = 0\\
(2\mathbf p - \mathbf p_2 - \mathbf p_4) \times (\mathbf p_3 - \mathbf p_1) = 0
$$
which is equivalent to
$$
\mathbf p = \frac{\mathbf p_1 + \mathbf p_3}{2} + \lambda(\mathbf p_2 - \mathbf p_4) = \frac{\mathbf p_2 + \mathbf p_4}{2} + \mu(\mathbf p_3 - \mathbf p_1), \quad \lambda,\mu \in \mathbb R
$$
The geometrical definition of $K$ should be obvious now: the point $K$ is reflection of diagonal intersection point $M = AC \cap BD$ about the vertices' centroid $P$
Comment: A little remark ; One should be cautious about centroids : you should say it is the "vertices' centroid". Because the area centroid is in general different (and the sides' centroid is a third point...). We are usually abused by the fact that in a triangle, vertices' centroid and area centroid always are the same.
Comment: Nice catch. I guess that your geometric description of $K$ also follows from the fact that the area of the Varignon parallelogram $EFGH$ is half the area of $ABCD$.
Comment: A historical note: This result was published in Crelles Journal in 1841 by Brune (see: https://de.wikipedia.org/wiki/Satz_von_Brune)
Answer: From your definition of $K$ it follows that triangles $EBK$ and $GCK$ have the same area, which is the same as saying that triangles $ABK$ and $DCK$ have the same area. In other words: $K$ divides $ABCD$ into two couples of triangles of equal area.
Given two segments $AB$ and $CD$ whose extensions meet at $Q$ (see picture below), the locus of points $X$ such that $XAB$ and $XCD$ have the same area, with $X$ belonging to $\angle AQD$, is line $QR$, where $R$ is the vertex opposite to $Q$ of the parallelogram with sides parallel and congruent to $AB$ and $CD$. A different but obvious construction is needed if $AB$ and $CD$ are parallel.

In the same way one can construct line $ST$, which is the locus of the points forming with $AD$ and $BC$ triangles of equal area. Point $K$ is then the intersection of $QR$ and $ST$.
Comment: Remarkable and very simple construction. Besides, very nice figure.


Sum of the areas of all n-sided polygons inscribed within each other

Question: Imagine you take an $n$-sided regular polygon with side length $x$, and connect the midpoints of each of its sides to construct a smaller but identical $n$-sided regular polygon within it.
Now perform the same process with the smaller polygon, and then with the next one, and the next and so on.
If you continue this, endlessly inscribing smaller and smaller regular $n$-sided polygons, what is the sum of all of their individual areas in terms of $x$ and $n$?
Below is an image describing this question when n = 6:

I know there must be a common ratio between each of the areas, so i'm thinking about turning this into a geometric series of the form $\frac{a}{1-r}$ (since $r$ < 1), where $a$ = the area of the first polygon, however I do not know how to find the specific values for $a$ and $r$ in terms of $x$ and $n$.
Any help with this question would be greatly appreciated!
Comment: You are correct that it is a geometric series.  You need to use geometry or trigonometry to determine what the ratio is for a given $n$.  I suspect for $n=6$ you can use geometry because the angles are nice.  I would guess that for most other $n$ you would do it numerically with trig.  For $n=4$ the ratio is $\frac {\sqrt 2}2$
Answer: Each interior angle of a regular n-gon is given by $(2n - 4) \times 90^0 /n$.
The radius connecting the center to a vertex will divide that angle in halves.
The ray from center perpendicular to a side will cut that side into halves.
The above info will be enough to determine r.
s = The area of that triangle, can therefore be found in terms of x and n.
a = 2ns.
Answer: Let us first find $a$.

Let $O$ be the center of the regular polygon. Then, a circle centered at $O$ circumscribes the polygon.  Each side is a chord of the circle and hence the perpendicular from the center bisects the side. Also, $\triangle AOM\cong\triangle BOM$ so $\angle AOM=\angle BOM=\dfrac{\pi}{n}$. Now, in $\triangle OAM $,$$\frac{AM}{MO}=\frac{x/2}{r}=\tan\frac{\pi}{n}$$ so $$r=\frac{x}{2\tan\frac{\pi}{n}}$$ so the area of triangle $OAB$ is $\dfrac12OM\times AB=\dfrac{x^2}{4\tan\frac{\pi}{n}}$. There are exactly $n$ such triangles so the total area is, $$\fbox{$a= \dfrac{nx^2}{4\tan\frac{\pi}{n}}$}.$$
Now,

to find the side length of the smaller second polygon, join BC. By the midpoint theorem on $\triangle ABC$, the side length of the second polygon is $\dfrac{BC}{2}$. Now, to find $BC$, note that $\angle CAB=\dfrac{(n-2)\pi}{n}$. By the cosine rule in $\triangle ABC$,$$\frac{x^2+x^2-BC^2}{2x^2}=\cos\angle CAB$$$$\implies 1-\frac{BC^2}{2x^2}=\cos\frac{(n-2)\pi}{n}=\cos\left(\pi-\frac{2\pi}{n}\right)$$$$=-\cos\frac{2\pi}{n}$$ so that $$\frac{BC^2}{2x^2}=1+\cos\frac{2\pi}{n}=2\cos^2\frac{\pi}{n}$$ which implies that $$BC=2x\cos\frac{\pi}{n}$$ or that the side of the second polygon is $\dfrac{BC}{2}= x\cos\dfracπn.$ Thus, its area will be (by similarity) $a\cos^2\dfrac{\pi}{n}$, which implies that the common ratio for the geometric series is $\cos^2\dfrac{\pi}{n}.$
Answer: Let the side length of the outermost polygon and side length of the first constructed polygon be $x_0$ and $x_1$ respectively. The external angles of the polygons will each be $\frac{2\pi}{n}$, so the internal angles will each be $\pi - \frac{2\pi}{n}$. Consider the triangle shown in the diagram below:

Applying the cosine law, we get
$$\begin{align}
(x_1)^2 &= \left( \frac{x_0}{2} \right)^2 + \left( \frac{x_0}{2} \right)^2 - 2\left( \frac{x_0}{2} \right)\left( \frac{x_0}{2} \right) \cos \left( \pi - \frac{2\pi}{n} \right) \\
\\
&= \frac{(x_0)^2}{2} + \frac{(x_0)^2}{2} \cos \left( \frac{2\pi}{n} \right) \\
\\
&= \frac{(x_0)^2}{2} \left[ 1 + \cos \left( \frac{2\pi}{n} \right) \right] \\
\\
&= \frac{(x_0)^2}{2} \left[ 2 \cos^2 \left( \frac{\pi}{n} \right) \right] \\
\\
&= (x_0)^2 \cos^2 \left( \frac{\pi}{n} \right) \\
\\
x_1 &= x_0 \cos\left( \frac{\pi}{n} \right)
\end{align}$$
Thus the common ratio of the sides is $\cos \left( \frac{\pi}{n} \right)$, so the common ratio of the areas will be $\boxed{\cos^2 \left( \frac{\pi}{n} \right)}$


Model assumptions not met but model has predictive capabilities

Question: This is a general question, has probably been asked before (I searched and did not see similar), may have a simple answer, may be ridiculous, and is just to satisfy my own curiosity.
Say we build a linear model (or any model for that matter) on our training data, and then generate predictions from our test data and find that the model yields decent predictions as measured by say r^2.  We then test the assumptions of our model, find that it fails to meet necessary assumptions, and are either unable to manipulate our data meet the assumptions or  able to make our data to meet assumptions, but the new model built performs poorly compared to the invalid model.
Any reason (besides that of a theoretical standpoint) not to use  the better-performing invalid model, so long as it keeps generating accurate predictions?
Answer: First, I don't know about the use of r^2 as a metric.  Second, you probably shouldn't be manipulating data to meet the assumptions of the model, but instead altering the model to conform to the data (or data-generating process, if known).  Third, if your goal is accurate prediction (you didn't say), then go ahead and use the model that gives you that, whether or not it is theoretically justified.
Now, given all that, if a simple, unprincipled model outperforms a more complex one, then you should spend a little time trying to figure out why exactly that is.  Some of the time that yields a model that is better than either.


Understanding music with multiple key changes within chord progressions

Question: So this has been bothering me for some time now; I've been making beats for maybe 7-8 years now but my earlier work is heavily-sampled. I just started actually picking up piano, but on my own, learning from Youtube tutorials and different websites with info on chords , scales , reading music and all that stuff.
I believe I've come to understand a lot of useful information and it has really helped and also re-shaped the way I listen to music now. I've always gravitated more towards jazz and synthy mellow lounge dreamy type stuff (lonnie liston smith , stereolab , roy ayers , toro y moi , stevie wonder) , music with lots of 7th chords .
This is where I become confused. From what (I think) I understand , a major scale is made up of 8 notes right ? And with those notes I can form chords and play within that designated key ,  and it's obvious to me playing sharps/flats over a song in the key of C major doesn't sound very pleasant .
It seems to me most of this music that I listen to jumps from this key to that key to another key then back to that key without any problem and just complete disregard for playing these 8 notes assigned .
for example:

listen to the first 8 bars
It's in the key of D major for 3 bars , then it drops 2 semitones to the key of C Major for 2 bars , then its back in D major for 2 bars then it climbs 3 semitones to the key of F Major for the last 1 bar before it loops again .

D,E,F#,G,A,B,C#,D
C,D,E,F,G,A,B,C
F,G,A,A#,C,D,E,F

three different keys in 8 bars , all changed abruptly
I hear it in house music all the time .
How does this work ? There must be some formula, right ? Because in my opinion it sounds really nice , when in actuality it could sound terrible if not done properly , which makes me believe there is a science to it . Is there a name for it ? what is the relation between these keys that make it possible to do this , and how would i know which ones work and which don't ?
Comment: Intro chords are Bm6, Fmaj7/A, D7/A, Bbmaj7. This and "Baby Lulu" I would argue to be Stereolab's greatest harmonic achievements. They show that the key can shift continuously; there are no solid boundaries, but look how long Tim Gayne (sp?) worked to get to this point. I would've never seen this coming from the early albums. The last few minutes of this song is particularly amazing.
Answer: First of all, it's not changing key, it's just using chords not strictly in the key.  You're allowed to deviate from the 7 notes that are strictly in key, only extremely boring music doesn't.
Second, your chords are a little off.  The first one is B minor, not D major.  The second is A minor, not C major.  It's a little noisy so it's hard to hear, but there's certainly not an F major.  I think there's an F# diminished though, which shares some notes.
(Third, and just a technicality, but F major has a Bb, not an A#)
This is all solidly in B minor with some borrowed notes.  There are some fairly standard ways to borrow notes outside of the key (the simplest is with a secondary dominant), but there's also a lot of great music that does wild things that are difficult to classify.  If it sounds good it sounds good.
Comment: @MattPutnam is it maybe going a little far to say that *only* boring music doesn't go outside the 7 notes? I think there are some beautiful pieces that are purely diatonic major pieces, just as there are other good'uns that are strictly within other modes.
Comment: thanks for answering !! im a bit confused though so sorry if i come off dumb , im still a rookie . isn't B minor the relative key to D major ? and the same with A minor/C major ? to elaborate more on what i meant by "key" in my question , i came to my conclusion using the whole step/whole step/half step/whole step/whole step/whole step/half step" formula , by playing what sounded to me like the correct notes for each time the chords seemed to switch , for the first 3 bars all the notes in the D major scale sounded good , and so on . .
Comment: you say its all solidly in B minor , but i couldn't play all the B minor notes without some sounding off at some point . why is that ?
Comment: Yes, B minor and D major are relative, but they function differently.  In particular, the first chord is a B minor chord (B D F#), not a D major chord (D, F#, A).  And yeah, not every note from the B minor scale will work with every chord (in particular B minor's C# will clash with the A minor (A, C, E) chord), but that's true no matter what.
Comment: @shakirgivens There surely are no "dumb" questions.  Yours is a good one.  Matt makes a good point that these keys are relative, but they revolve around the tonic (first note).  So while D and Bm have the same notes, they either sound more like B is home, or D is home.
Comment: Solidly in Bm? Intro is Bm6 Fmaj7/A D7/A Bbmaj7
Answer:
Some music stays in a key. It really only uses the 7 notes diatonic to that key.
Some music stays in a key for a while, but then modulates to another key. Then it might modulate to another one (that would be literally multiple key changes).
Some music has a clear root note (tonic), but uses notes and chords outside of a seven-note scale built on the tonic without really establishing a movement to a different key.
(and there's more)

There is a tendency in beginners' music theory books to focus a lot on the first two types of harmony, and to focus on major and minor tonalities. However, there are styles of music for which the third type is the most common, including a lot of pop and rock songs.
In other words : A lot of music isn't really within the bounds of a key, in the sense that you might understand 'key' from reading a beginners' theory book.
So does that mean that the whole idea of keys is wrong? Not at all. As you noticed, if you play a chord progression that's really and truly in C major, using the chords according to diatonic functions, then you may struggle to work the black notes in unless you are setting up a modulation.
Music is like life. (how cheesy is that... but stay with me) There are many situations we can be in (at a funeral, in an amorous encounter, in the office, in the bathroom) and many things we can do (show a powerpoint presentation, recite poetry, urinate, remove your clothes). You can do anything in any situation, but it's not necessarily going to work out for the best.
My advice would be not to take anything you read about theory too seriously until you've read quite a lot. At a minimum, learn about scales and functional harmony, modulation (seems you have learned some of that already), blues scales, modes, borrowed chords, and especially extended and altered chords as found in jazz, and jazz substitutions.
Once you've done that, you'll be in a position to have a listen to a piece of music and see what kind of situation you're in, and what rules may and may not be good to follow.
Answer: You asked:

A major scale is made up of 8 notes right?

Really it's just seven notes, unless you add the repeat of the tonic (first pitch) at the end, at an octave higher.

And its obvious to me playing sharps/flats over a song in the key of C
  major doesn't sound very pleasant.

You'll soon learn that playing outside of the key can sound quite amazing!  Just take a look at some of your favorite songs by Stevie Wonder - I can't think of any of his songs that stick to only diatonic chords and pitches (diatonic means involving only notes proper to the prevailing key).  The Beatles have tons of songs with fascinating chord substitutions (such as Blackbird and Something).
I truly think you would benefit from a music theory textbook, as opposed to bits and pieces from the web.  While it's likely that the tutorials you've found are very correct in what they teach, a textbook will give you a flowing connection from the first topic to the next (assuming it's a good book!).
Playing outside of the key becomes a somewhat advanced topic in music theory also, which is particularly why a textbook will benefit you.  It's a cumulative quality of learning that will eventually get you to where you need to be.  Eventually you'll get to a chapter or section that deals with closely related keys, and at that point you'll really start to understand some amazing things.
I purposely skipped your video, as it gets to be a little bit off-topic for this website, but if you have any more questions, please add them to the comments and I'll be happy to edit/answer for you.
Comment: We seem to be teaching music theory in a way that gives students the impression that using notes and chords "outside the key" is unusual.  It isn't.  It's absolutely routine.
Comment: @LaurencePayne It is not "absolutely" routine. In fact it is relatively uncommon. most pop songs are diatonic and stick to a single scale. Songs that do use "alterations" usually do so by borrowing, tonicizations, modulations or key changes. None of that is outside playing. Getting outside the key tends to result more bizarre sounds but playing outside the diatonic scale can sound perfectly natural. The problem comes from teaching that diatonic = key. That is, a key consists of only 7 notes and 7 chords. In fact, a key consists of an infinite number of notes and an infinite number chords.
Comment: The reason why it is taught this way is, because once one has masted the diatonic system then they can easily build very large progressions in different "keys"... one just then has to master modulations.  From there, one can learn about borrowing chords and substitutions, etc.  My guess is that most "students" tend to quit after they learn the basics(the diatonic foundation) and never go on to learn how to expand that... then they get confused, etc.  You can't obviously say "You have an infinite number of notes available, go make music!" but that is actually what is being "taught"(The goal).


Usar CONCAT para ajustar a quantidade de números php mysql

Question: Eu preciso completar a quantidade de números para exibição na tela,o que seria isso. a quantidade que seria exemplo: 20 preciso inteirar 15 caracteres com 0,Exemplo: 000000000000020.
Um amigo meu me mostrou no Excel um forma que ele usa o CONCAT e depois pega somente os últimos 15 números,com isso o id pode ser 1,100,100 etc ... que ele vai ser sempre 15 números que seria os zeros mais a quantidade.
 Eu olhei aqui no site e também na internet mais não consegui fazer o que preciso,alguém teria alguma dica.
 Esse resultado eu trago do MySQL,se for mais fácil no MySQL posso usar também.
Segue um exemplo da consulta que tentei fazer:
SELECT
 MAX(cup_id)             AS CUPOM,
 MAX(DATE_FORMAT(c.cup_data_hora, '%d/%m/%Y'))    AS DATA,
 MAX(c.cup_data_hora)    AS HORA,
 MAX(l.loja_num)         AS LOJA_NUM,
 MAX(l.loja_desc)        AS LOJA_NOME,
 MAX(l.loja_end)         AS END_LOJA,
 MAX(u.usu_cod)          AS USU_ID,
 MAX(u.usu_nome)         AS USU_NOME,
 MAX(v.vas_cod_emporium) AS COD_EMPORIUM,
 MAX( v.vas_desc)        AS VASILHAME,
 MAX(c.cup_quantidade)   AS QUANTIDADE,
 CONCAT(c.cup_quantidade,'000000000000') AS QUANTIDADE_15
FROM cupom  AS c
 LEFT JOIN loja      AS l ON c.cup_loja      = l.loja_num
 LEFT JOIN vasilhame AS v ON c.cup_vasilhame = v.vas_id
 LEFT JOIN usuarios  AS u ON c.cup_usu_id    = u.usu_cod
   WHERE cup_loja =4**

Comment: Já tentou usar o campo na tabela com ZEROFILL ?
Comment: vc quer definir um número de com digitos fixo, por exemplo 5, caso o número seja 20 ele coloque 3 zeros a esquerda?
Comment: @rray isso mesmo
Comment: @Zoom , consegui com a ajuda do nosso colega rray ,mais depois vou ver essa sua parte também,obrigado pelo retorno.
Answer: Use a função lpad() do MySQL para adicionar um 'prefixo' a esquerda da string, o primeiro argumento pode ser o campo que será modificado, o segundo é o comprimento(4 caracteres) e o último é o caracter que será adicionado.
SELECT lpad('1',4,0)
SELECT lpad('10',4,0)
SELECT lpad('100',4,0)
SELECT lpad('1000',4,0)

As saidas são:
0001
0010
0100
1000

Exemplo - sqlfiddle
Comment: Tudo certo,obrigado mais uma vez.


Issue with React development server refresh. How do i solve it?

Question: Welcome.
I just started to learn ReactJS, for the first few attempts, it was okay, but since a few hours, every time, when I create a new component, after I define the exact component and gives it content, when I attempt to use it in the App.js, or anywhere (after importation, of course), it displays a few components, but not all, either I refresh it.
The only solution is, if I delete the closing bracket of the return statement, save it, wait for the error on the development server, then write it back.
e.g.
function MainNavigation() {
return (

React Meetups

                    <Link to="/">All Meetups</Link>

                    <Link to="/new-meetup">Add New Meetup</Link>

                    <Link to="/favorites">My Favorites</Link>

);
}

In this case, after ctrl+s, the dev. server displays the div, and the "All Meetups" list item with the link, but not the other two.
If i delete the ); part of the statement, then save it, and write back, then save it again, only then will the changes appear.
Any ideas?
Answer: Few problem which I can think of are as follow

Try to do hard refresh instead of deleting the ");"
Try to inspect the file from developer console. May be some css color ias same as background color.
Comment: I've tried the hard refresh a lot, but it doesn't work.

The developer console has a bunch of errors, until I delete the ");", but after that, it's clean.
Comment: @GaramvölgyiSoma can you please share the screen shot.


how to calculate the normal vector for a bezier curve

Question: Say we have a cubic Bezier curve (so 4 control points) named Q. I understand how to calculate the tangent at by taking the derivative of Q and substituting but i'm not sure how to calculate the normal vector.
Thank you for the help!
Answer: If the curve lies in some plane, and you want a normal vector that also lies in this same plane, just rotate the tangent vector by 90 degrees clockwise or counter-clockwise. So, if the tangent vector is $(u,v,0)$, the normal vector will be either $(v,-u,0)$ or $(-v,u,0)$. If you use a unit-length tangent vector, this will give a unit-length normal vector, too.
If the curve is not planar, there are an infinite number of normal vectors at each point, and you have to decide which one you want. If $\mathbf{t}$ is the tangent vector, and $\mathbf{v}$ is any other vector not parallel to $\mathbf{t}$, then the vector cross product $\mathbf{t} \times \mathbf{v}$ will be normal to the curve. This cross product will not necessarily have unit length, though, so you may want to unitize it before using it in further calculations.
The calculation in the first paragraph is a special case of the one in the second paragraph. We just used $\mathbf{v} = (0,0,\pm 1)$.
Finding normal vectors for Bezier curves is no different from finding normal vectors on any curve. You can read about this in any book on calculus or differential geometry.


News Pages from Wordpress JSON in jQuery Mobile

Question: I'm getting started with jQuery Mobile and PhoneGap. I have an app that I want to display the five most recent posts from a Wordpress blog, and when you click one it loads the content of that post in a new page. Using the JSON api plugin I was able to spit out a list of the titles of the most recent posts.
What I'm stuck on is making those titles into links that will load new pages with their respective content. I've read the JQM documentation on dynamic page generation but I'm a bit lost.
My current code looks like the following:
var urlNews="http://wordpress-site.com/";
$.getJSON(urlNews,function(json){
        $.each(json.posts,function(i,post){
            $("#recentNews").append(
            '
'+post.title+'
'
         );
      });
      $('#recentNews li:gt(4)').remove();
});

I've tried adapting the sample code from the official documentation here, but haven't had any luck.
Answer: This is the code that I'm using to display content from a Wordpress blog:
    var MYBLOG_LIMIT = 7;
var MYWRAPPER_CLASS = 'homeblog';

var WP={open:function(b){var a={posts:function(){var d=MYBLOG_LIMIT;var e=0;var c={all:function(g){var f=b+"/api/get_recent_posts/";f+="?count="+d+"&page="+e+"&callback=?";jQuery.getJSON(f,function(l){var k=l.posts;for(var j=0;j<k.length;j++){var h=k[j];h.createComment=function(i,m){i.postId=h.id;a.comments().create(i,m)}}g(k)})},findBySlug:function(f,h){var g=b+"/api/get_post/";g+="?slug="+f+"&callback=?";jQuery.getJSON(g,function(i){h(i.post)})},limit:function(f){d=f;return c},page:function(f){e=f;return c}};return c},pages:function(){var c={findBySlug:function(d,f){var e=b+"/api/get_page/";e+="?slug="+d+"&callback=?";jQuery.getJSON(e,function(g){f(g.page)})}};return c},categories:function(){var c={all:function(e){var d=b+"/api/get_category_index/";d+="?callback=?";jQuery.getJSON(d,function(f){e(f.categories)})}};return c},tags:function(){var c={all:function(e){var d=b+"/api/get_tag_index/";d+="?callback=?";jQuery.getJSON(d,function(f){e(f.tags)})}};return c},comments:function(){var c={create:function(f,e){var d=b+"/api/submit_comment/";d+="?post_id="+f.postId+"&name="+f.name+"&email="+f.email+"&content="+f.content+"&callback=?";jQuery.getJSON(d,function(g){e(g)})}};return c}};return a}};

var blog = WP.open('http://www.endofphotography.com/');

blog.posts().all(function(posts){
    for(var i = 0; i < posts.length; i++){
        jQuery('.'+MYWRAPPER_CLASS).append(function(){
    return (posts[i].content) ? '

'+posts[i].title+'

'+posts[i].content+'
'+posts[i].date+'

' : '

'+posts[i].date+'

';
   });
  }
});

I had the opposite problem and was trying to disable links. Particularly, for images. I didn't want the user to be scrolling on their mobile and accidentally clicking a link and sending them out of the app. You can control this by editing the HTML markup in your Wordpress admin account for Posts. I did this manually.
For the Titles, as a temporary solution since I don't believe they are clickable by default using JSON API, I would do something like this manually in the Wordpress Editor:

Click here to read full article


Nginx passenger rails

Question: On a EC2 with ubuntu 14.04 with nginx/passenger/rails came with this log on nginx:

App 31063 stderr: * ERROR *: Cannot execute /usr/local/lib/ruby:
  Permission denied (13)
App 31065 stderr: /etc/profile.d/rbenv.sh: line 3: rbenv: command not
  found

nginx conf is:
worker_processes  1;
error_log  logs/error.log;
events {
    worker_connections  1024;
}

http {
    passenger_root /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.18;
    passenger_ruby /usr/local/lib/ruby;

    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
       listen 80;
        server_name teste.com;
        root /home/ubuntu/teste/current/public;
        passenger_enabled on;
        rails_env production;
        access_log  logs/access.log;

        location ~ ^/(assets)/  {
          gzip_static on;
          expires max;
          add_header Cache-Control public;
        }

       error_page 500 502 503 504 /500.html;
       client_max_body_size 4G;
       keepalive_timeout 10;

            }

}

someone cloud give some light? thank's
Answer: You have not set passenger_ruby correctly.
    passenger_ruby /usr/local/lib/ruby;

This is meant to be set to the Ruby binary itself. But you have set it to a directory.
Change it to the location of your ruby interpreter.
Comment: thank's @michael-hampton but show the same: ERROR ***: Cannot execute /usr/local/lib/ruby/2.2.0: Permission denied (13)
Comment: Again, that's a directory, not a copy of the `ruby` program.
Comment: but with which ruby show: /usr/local/bin/ruby so, i tried to find and did not find the ruby interpreter on ubuntu
Comment: `/usr/local/bin/ruby` would be correct, then.

Nginx passenger rails


Linux Program For Stress Testing Current Website

Question: I'm evolved in a project and the server cost's we're using are going to be based on a number of different factors.
One of those factors are how many cores we need for the website.
If there a program for Linux (Ubuntu) that can stress test the website system with a set virtual number of users to test how "hard" the system we've built to run is?
I want to be able to see how many users we can run at once on one core before having to use another, it's just so I have a rough idea if it's 100 users or 1000 users using the system at once.
Or does someone know of another way to test this? Say be me personally running the system, while a statistics program is running in the background and saving data so I can then just times that number as many times as I want.
Thank you very much for viewing my question and I'm looking forward to hearing from you!
Answer: Have you considered Load Runner ? It is by no means free or even cheap, but I heard from many developers that it is highly configurable and kind of de-facto standard for load testing websites.
Click here to see the info page


Mongodb + Kerberos BadValue SASL mechanism GSSAPI is not supported

Question: I am trying to run an instance of mongodb with the authentication mechanism GSS-API. This is the command:
mongod --dbpath /home/ec2-user/db/node2/data --auth --setParameter authenticationMechanisms=GSSAPI

And this is the error that I get:
  F CONTROL  Failed global initialization: BadValue SASL mechanism GSSAPI is not supported

It seems that I need the library that SASL uses for the GSS-API mechanism, just like this other problem that I solved:
https://dba.stackexchange.com/questions/94889/mongodb-couldnt-find-mech-gssapi
But with the difference that now I am using a Linux Red Hat 7.5  and, before, I was using a Ubuntu 14.04. The libraries that I installed to try to solve this error are these:
cyrus-sasl-gssapi.i686 : GSSAPI authentication support for Cyrus SASL
cyrus-sasl-gssapi.x86_64 : GSSAPI authentication support for Cyrus SASL
perl-GSSAPI.x86_64 : Perl extension providing access to the GSSAPIv2 library
rsyslog-gssapi.x86_64 : GSSAPI authentication and encryption support for rsyslog
gssproxy.x86_64 : GSSAPI Proxy
python-kerberos.x86_64 : A high-level wrapper for Kerberos (GSSAPI) operations
sssd-krb5-common.x86_64 : SSSD helpers needed for Kerberos and GSSAPI authentication
sssd-krb5-common.i686 : SSSD helpers needed for Kerberos and GSSAPI authentication

Does anyone know what library I am missing?
Answer: In their document:

MongoDB Enterprise supports authentication using a Kerberos
  service.

Apparently their normal version doesn't support GSSAPI authentication mechanism,
so downloading the enterprise version should solve the problem.
http://docs.mongodb.org/manual/tutorial/control-access-to-mongodb-windows-with-kerberos-authentication/
Comment: I was using the enterprise version


Product of trigonometric polynomials is a trigonometric polynomial

Question: A trigonometric polynomial was defined as $$f(x) = \frac{a_0}{2} + \sum_{k=1}^{n}(a_k \cos(kx) + b_k \sin(kx))$$
I heard somewhere that trigonometric polynomials have a ring structure, i.e. a product of two polynomials is again a polynomial.
I was wondering how can one see it. A direct attempt to multiply two polynomials seem to result in a mess.

Edit:
Using a suggestion from nicomezi from below I go to the complex representation:
$$f(x) = \frac{a_0}{2} + \frac{1}{2} \sum_{k=1}^{n}(e^{ikx}z_k + e^{-ikx} \bar z_k )$$
We can also "hide" the first term:
$$f(x)=\frac{1}{2} \sum_{k=0}^{n}(e^{ikx}z_k + e^{-ikx} \bar z_k ), z_0 = a_0$$
Now when we multiply two polynomials of degrees $n$ and $m$ we get a sum of terms of the form:
$$\frac{1}{4}(e^{ikx}z_k + e^{-ikx} \bar z_k )(e^{ilx}z_l + e^{-ilx} \bar z_l )= \frac{1}{4}(e^{i(k+l)x}z_kz_l + e^{-i(k+l)x}\overline{z_k z_l}) + \frac{1}{4}(e^{i(k-l)x}z_k\bar z_l + e^{-i(k-l)x} \overline{z_k \bar z_l}), 1 \le k \le n, 1 \le l \le m$$
So each term is a polynomial of degree $(k+l)$, thus the whole product is a polynomial of degree $(n+m)$.
Answer: There is no need to multiply two polynomials, that does, indeed, result in a mess.  Instead, all you need to show is that:

$\cos(kx)\cos(lx)$ is a trigonometric polynomial,
$\cos(kx)\sin(lx)$ is a trigonometric polynomial, and
$\sin(kx)\sin(lx)$ is a trigonometric polynomial.

The rest comes from linearity.
Let's check $\cos(kx)\sin(lx)$ is a trigonometric polynomial; the rest of the cases are very similar.
Since $e^{ikx}=\cos(kx)+i\sin(kx)$, $\cos(kx)=\frac{1}{2}\left(e^{ikx}+e^{-ikx}\right)$.  Similarly, $\sin(lx)=\frac{1}{2}\left(ie^{-ilx}-ie^{ilx}\right)$.  Therefore,
$$\cos(kx)\sin(lk)=\frac{1}{4}\left(ie^{i(k-l)x}+ie^{-i(k+l)x}-ie^{i(k+l)x}-ie^{i(l-k)x}\right).$$
Since our answer should be real, we are only interested in the real part of this, which is:
$$
\cos(kx)\sin(lx)=-\frac{1}{2}\sin((k-l)x)+\frac{1}{2}\sin((k+l)x)
$$
Answer: I believe the neatest way to see this is through the Fourier transform.
You can think of the series that you have denoted as a collection of frequencies that you are in possession of. Multiplying the two series in the time domain is equivalent to convolution in the frequency domain.
If you are not aware of what convolution is, it is in some sense a rule of combining two functions $f$ and $g$ such that $f$ is "smeared" according to $g$'s pattern.
Comment: Another way but less elegant is to consider the reals trigonometric polynomials as a particular case of complex trigonometric polynomials, which are easier to manipulate. Then you may be able to prove it quite easily with mathematical induction.
Comment: thanks for your effort, I must admit that I am at the very beginning of my studies of Fourier series and Fourier transform is something above my level yet. But if I believe my class instructor I should be able to find an answer to this question "at my level of knowledge".


AJAX callback issue when using 'Manage Form Display' and 'Manage Display'

Question: Good day everyone,
So I have an issue that I haven't been able to google. The issue seems rather simple but I don't know what's causing it. When i'm managing field displays in either the form or a view, the ajax 'throbber' icon pops up and the ajax request is never completed. It will continue to show the throbber indefinitely. If I drag the field to another location, it will create another instance of the throbber icon and no ajax request is ever completed. I can do this any amount of times. When I save the form and a field is in the AJAX state, it just reverts back to whatever it was originally. The weird thing is, if I press the cog to change the settings of the field and that field was in the 'perpetual ajax request' state, it will then complete the ajax request as expected.
This leads me to believe that dragging and dropping the fields (and changing the formatter/widget) aren't actually sending any ajax requests. This is also confirmed by checking the Network tab in Chrome's tools. Nothing is sent when dragging fields but when pressing the cog "teaser?ajax_form=1&_wrapper_format=drupal_ajax" request is sent.
I'm at a loss as to what is happening. It only started recently (last couple hours of development) and I went through the changes I've made in that time to try and identify the problem and have come up with nothing. I checked for differences from the production site and nothing... I'm not sure what to do next. Has anyone experienced this problem and successfully fixed it?
Comment: Thank you for this information. This may come in handy in the future, however, I did finally solve the issue. I appreciate it!
Comment: While you wait for a better answer, I recommend disabling Javascript in your browser. Drupal degrades gracefully, and should work fine without the AJAX drag-and-drop functionality. This _doesn't_ answer your question, but at least you can continue developing in the meantime. Good luck!
Answer: Well, I feel like a fool as the answer was actually simple... I had forgotten about switching all input elements to actual button elements. This broke any AJAX request only when the type was a submit button.


Android EditText("Textbox") : Auto capitalizing first letter of each word while user typing

Question: I know this question has asked several times but non of the answers worked in my case.
I found some of the same sort of questions and answers in the following links , which didn't work for me at all.
LINK1
LINK2
In my layout file, I have defined my EditText as follows.
 <EditText
    android:id="@+id/test_editText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="16dp"
    android:layout_marginTop="90dp"
    android:inputType="textCapWords"
    android:ems="10" >

Also in the Activity class in the onCreate method I have added the following code.
    EditText testEditText = (EditText) findViewById(R.id.test_editText);
    testEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_WORDS);

If someone have experienced the same issue and solved it would like to hear what I have done wrong in my case. Thanks.
Edits...
Following above explained steps I am unable to make this get it done(Auto capitalizing the first letter of each word while user typing).
According to my code, When user typing it displays first charater in all the words (including first word) in lower case.
Comment: So what is your question now man? Does it work as expected but you want to do something else? Does it not work? Under which circumstances does it not work? Does it flicker? Do you want live updates while typing? Please be more specific
Comment: What happended if you remove the setInputType line ?
Comment: Hi ZouZou, without setInputType line it still the same. Thanks.
Comment: Hi avalancha, I just described a bit more in the "edits" in my question. Thanks.
Answer: android:inputType="textCapWords"

Works for me
I used the same xml code you have in the questions:
<EditText
    android:id="@+id/test_editText"
    android:layout_width="wrap_content"
    android:layout_height="50dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="16dp"
    android:layout_marginTop="90dp"
    android:ems="10"
    android:inputType="textCapWords" >

Just check if you are overriding the inputType attribute in your Activity.
Just try without changing anything in the Activity.
Comment: Hi Archie.bpgc, I just commented all the codes in "onCreate" method in Activity class and now there is no way to override inputtype attribyte in any way. But still when user typing, all prints in lowercase by default, if user havent selected it to be capital by the key board option. I am using an android device which runs android "2.1" OS and also tested with the emulator(Created with Nexus One with google  - device definitions in virtul device manager). In your case is it automatically printing first letter of each word in Upper case while user typing?
Comment: I tried on my device(4.1.2). Yeah the keyboard starts with caps and when I click on spacebar the keyboard turns to all caps.
Comment: Hi I think this doen't work with early OS versions. Yes I just checked, it works with OS version "4.0" for me as well now. Just check with "2.1" or something like that(Even with an emulator), it's not working... But the thing is I am looking for a solution to work with all OS versions higher than "2.1" level. Thanks.
Comment: have You got the solution ??  I am also facing the same problem with older os version but don't got the solution yet. If you got the solution then please help me.
Answer: testEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_WORDS);

or android:inputType="textCapSentences"

will only work If your device keyboard Auto Capitalize Setting enabled.
Answer: This is what I have done. android:inputType="textCapWords" is not working for me, either.
public static void setCapitalizeTextWatcher(final EditText editText) {
    final TextWatcher textWatcher = new TextWatcher() {

        int mStart = 0;

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            mStart = start + count;
        }

        @Override
        public void afterTextChanged(Editable s) {
            //Use WordUtils.capitalizeFully if you only want the first letter of each word to be capitalized
            String capitalizedText = WordUtils.capitalize(editText.getText().toString());
            if (!capitalizedText.equals(editText.getText().toString())) {
                editText.addTextChangedListener(new TextWatcher() {
                    @Override
                    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

                    }

                    @Override
                    public void onTextChanged(CharSequence s, int start, int before, int count) {

                    }

                    @Override
                    public void afterTextChanged(Editable s) {
                        editText.setSelection(mStart);
                        editText.removeTextChangedListener(this);
                    }
                });
                editText.setText(capitalizedText);
            }
        }
    };

    editText.addTextChangedListener(textWatcher);
}

Comment: Amazing, but getting crash when I try to empty the edittext by pressing back. Found the solution. Editing the answer
Answer: Earlier it used to be android:capitalize="words", which is now deprecated. The recommended alternative is to use android:inputType="textCapWords"
Please note that this will only work if your device keyboard Auto Capitalize Setting enabled.
To do this programatically, use the following method:
setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
Answer: Have you tried android:inputType="textPersonName"
Comment: How about adding a textChangeListener and setting case?
Answer: should you try with android:inputType="textCapSentences" ?
Comment: Tried out this. Not this. Thanks.
Answer: Are you trying Emulator or android device?
this works for me in emulator
    android:inputType="textCapWords"
Answer: Simply add this code to your EditText android:capitalize="words" it must work.
Answer:
To capitalize first letter of every word use
android:inputType="textCapWords"
Output:
This Is Simple Text.
To capitalize first letter of every sentence then use
android:inputType="textCapSentences"
Output:
This is first statement. This is second statetment.
To capitalize all letter
android:inputType="textCapCharacters"

Output:
THIS IS SIMPLE TEXT
Note: In output the bold letter used just for formatting answer. Above mentioned properties does not force these capitalization. User can enter small case letter.
Answer: TRY this on your layout...
android:inputType="textCapWords|textCapSentences"

works fine on me.. hope it works also on you...


How do I parameterize text in a re-used section of Lilypond notes?

Question: Here is a short snippet of Lilypond that I think expresses the intent of what I want to do.
verseNotes = \relative c' {
    d^\markup { \verseText } d d d16 d d8 a r4 |
    cis8 cis cis cis16 cis cis8 a r4 |
}

verseSection = \relative c' {
    \repeat volta 2 {
        \verseNotes
    }
    gis,1 |
    gis4. b8~b2 |
    \repeat volta 3 {
        verseText = "Verse (repeat 2x)"
        \verseNotes
    }
}

\relative c' {
    verseText = "Verse"
    \verseSection
}

It, of course, errors out.
I think the cause is something like verseNotes being bound at the time it is parsed, and \verseText having no value at the time.  I would like to re-use the verseNotes variable, but with different values of verseText.
I'm thinking I want the "dynamic" equivalent of a function of some sort, to which I pass a text param. I see various sections in the Lilypond documentation expressing stuff in Scheme, but this is likely last thing I want to be doing while entering music.
Answer: Yes, you're right - you must declare the variable before using it. Hope this helps:
verseText = "Verse"

    verseNotes = \relative c' {
        d8^\markup { \verseText } d d d16 d d8 a r4 |
        cis8 cis cis cis16 cis cis8 a r4 |
    }

    verseSection = \relative c' {
        \repeat volta 2 {
            \verseNotes
        }
        gis'1 |
        gis4. b8~b2 |
    }

    \score {
     \new Staff \verseSection
    }
Peter's further solution, Nov 7, 2013:
verseNotes = \relative c' {
    d8 d d d16 d d8 a r4 |
    cis8 cis cis cis16 cis cis8 a r4 |
}

verseSection = \relative c' {
    \override Score.RehearsalMark #'self-alignment-X = #LEFT
    \mark \markup { \normalsize "Verse" }
    \repeat volta 2 {
        \verseNotes
    }

    gis'1 |
    gis4. b8~b2 |
    \mark \markup { \normalsize "Verse (repeat 2x)" }
    \repeat volta 3 {
        \verseNotes
    }
}

\score {
    \new Staff \verseSection
}
Answer: I see various sections in the Lilypond documentation expressing stuff in Scheme, but this is likely last thing I want to be doing while entering music.
Better get used to it, though.  At pure LilyPond level, you can only assign static music expressions.  While one can introduce a bit of variation into those using \tag, it's not really a parameterization.
You usually don't need to be "expressing stuff" while entering music and vice versa: it's quite feasible to write Scheme for schemish things (namely the parameterization) and music for musicish things by employing #{...#} judiciously.
In this case, this would look (after some tiny octave, duration, and
context fixes) like:

verseNotes =
#(define-music-function (parser location verseText) (markup?)
  #{
    \relative c' {
      d8^\markup { #verseText } d d d16 d d8 a r4 |
      cis8 cis cis cis16 cis cis8 a r4 |
    }
  #})

verseSection =
#(define-music-function (parser location verseText) (markup?)
  #{
     \relative c' {
       \repeat volta 2 {
          \verseNotes #verseText
       }
       gis1 |
       gis4. b8~b2 |
       \repeat volta 3 {
          \verseNotes "Verse (repeat 2x)"
       }
     }
  #})

\relative c' {
    \new Staff \verseSection "Verse"
}

As you can see, the Scheme code compresses itself into single lines that one can learn by heart easily enough and that are only moderately infuriating.
Comment: Thank you! This is really helpful and so hard to find!


Restoring views to their default state

Question: Views module comes with a few default views. I have enabled and modified the frontpage view, but I'd like to go back to its default state that originally came with the module on a fresh install (without my changes). Is this possible?
Thanks
Comment: D8+ question: https://drupal.stackexchange.com/q/267512/7177
Answer: Yes you can do that.

Go to the views listing page (admin/structure/views).
In the Operations column of the view you want to reset, click the Revert operation.
Confirm by clicking the Revert button.

Restoring views to their default state


How to include Facebook feeds inside my page?

Question: I want to include Facebook feeds from my Facebook page to my Drupal site as a block.
How to do that?
Answer: Go to the Facebook Developers site and configure the kind of feed you would like to have. Save the generated the HTML somewhere.
Create a new block in your Drupal installation with the Full HTML text format. Paste the generated HTML in your the content part of your block.
If you do not want to use the default Facebook feed, take a look at this drupal module.
Comment: [Activity Feed](https://developers.facebook.com/docs/plugins/deprecated) is deprecated, use [Page Plugin](https://developers.facebook.com/docs/plugins/page-plugin) instead.
Answer: You can also go with TB Social Feed


What is the probability of selecting an MS student

Question: Following is my assignment question.

Suppose that an experiment is performed on three courses being taught
      which are $C_1$, $C_2$ and $C_3$. The class of $C_1$
      contains $30$ MS students, $40$ undergraduate students(U), and $10$ PhD students, class of $C_2$ contains $10$
      MS , $10$ U, and $0$ PhD students, and class of $C_3$ contains $30$ MS, $30$ U, and $4$ PhD students
      If a class is chosen at random with probabilities $p(C_1) = 0.2, p(C_2) = 0.2, p(C_3) = 0.6$, and a
      student is chosen from the class (with equal probability of selecting any of the students in the class and each student is enrolled in only one course), then what is the probability of selecting an MS student?
  This is how I calculated the answer but I am not sure whether it is correct or not.

$$\left(\frac{30}{80}  \times 0.2\right)+\left(\frac{10}{20} \times 0.2\right)+ \left(\frac{30}{64} \times 0.6\right)=0.45$$
Please tell if I have solved this correctly.
Comment: Why is this being down-voted? The OP did the calculation and now wants confirmation that it is correct. S/he is not asking us to do his/her homework
Answer: The approach is correct.
You are using the law of total probability:
$$\Pr(\text{Ms})= \sum_{i=1}^3 Pr(\text{Ms}|C_i)Pr(C_i)$$
of which upon evaluating gives us $\approx 0.45625$


typeError when passing in objects to require() for passport

Question: I get typeError: object is not a function
when I run:
node server.js
for the following line of code
require('./app/routes.js')(app, passport);

from the following code for my server.js file:
// server.js

// set up ======================================================================
// get all the tools we need
var express = require('express');
var app = express();
var port = process.env.PORT || 8080;
var mongoose = require('mongoose');
var passport = require('passport');
var flash = require('connect-flash');

var morgan = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var session = require('express-session');

var configDB = require('./config/database.js');

// configuration ================================================================
mongoose.connect(configDB.url); // connect to our database

// require('./config/passport')(passport); // pass passport for configuration

// set up our express application
app.use(morgan('dev')); // log every request to the console
app.use(cookieParser()); // read cookies (needed for auth)
app.use(bodyParser.json()); // get info from html forms
    app.use(bodyParser.urlencoded({ extended: true}));

app.set('view engine', 'ejs'); // set up ejs for templating

// requirements for passport:
app.use(session({ secret: 'ilovescotchscotchyscotchscotch'}));
app.use(passport.initialize());
app.use(passport.session()); // persistent login sessions
app.use(flash()); // use connect-flash for flash messages stored in session

// routes ========================================================================
require('./app/routes.js')(app, passport); // load our routes and pass in our app and fully configured passport

// launch =======================================================================
app.listen(port);
console.log('The magic happens on port ' + port);

not entirely sure why this is happening...
I was following this tutorial btw: https://scotch.io/tutorials/easy-node-authentication-setup-and-local
Thanks!
Comment: It means whatever is being exported from `./app/routes.js` is not a function.  Have you checked what that file is assigning to the `exports` object?
Comment: I'm sorry, I don't quite understand the syntax enough. Do you mean that in javascript when you do require('')(object) it's assigning an object to whatever is in the '' ?  If so, then wouldn't my syntax be correct, since app and passport are both objects?
Comment: can you post the code for `app/routes.js`?
Answer: Based on your comments: this post does a pretty good job of explaining how require works in nodeJS (it's not a Javascript thing). Basically every file that can be required is generally expected to export something that the requiring file can assign to a variable (e.g. var someVar = require('someFile');). IF the exported value is a function then you can immediately invoke it before assigning to that variable (e.g. var someVar = require('someFile')(params);). For your error it appears that the file ./app/routes.js is not exporting a function.
FILE: ./app/routes.js
// some code that does cool stuff
// ...
// Time to expose whatever we want to the requiring file
module.exports = someObject; // Or value, function, etc.

FILE: main.js
// we want cool stuff from routes.js
var coolStuff = require('./app/routes.js');

// someObject from ./app/routes.js is now assigned to coolStuff
coolStuff(); // ERROR: object is not a function

console.log(typeof coolStuff) // "object"

Comment: @eduardowarded Glad it was useful for you. :)
Comment: woo! Thanks Jason, your explanation cleared up the problem for me!


Create a new column which name was from a field of a table

Question: For example, I have a table as following:(let's call it a)
SNP         ID    ALLE1    ALLE2
SNPNAME1    1      A        A
SNPNAME2    1      A        G
SNPNAME3    1      G        G
...

I want to write a function to create a new table from above:
ID SNPNAME1  SNPNAME2  SNPNAME3...
1    AA        AG         GG
...

So my idea was to create a NULL object b first, then I add a new column "ID" to it which I can do as following:
b$ID=NA

Then I try to add a new column which name is from a[1,]$SNP, I tried to this by using the following statement:
b$a[1,]$SNP=NA

However I can't.
Then I tried to use
b$get(a[1,]$SNP)=NA

or
c=quote(a[1,]$SNP)
b$eval(c)=NA

But all above didn't now work.
Can anyone tell me how to do this?
Thank you.
Answer: Here's a data.table solution.
library(data.table)

DT <- data.table(a)
DT[, setNames(as.list(paste0(ALLE1, ALLE2)), SNP), by = ID]

##    ID SNPNAME1 SNPNAME2 SNPNAME3
## 1:  1       AA       AG       GG

Using Paul's data
DT <- data.table(df)
DT[, structure(as.list(paste0(var1, var2)), names = as.character(name)), by = ID]

##    ID spam1 spam2 spam3 spam4 spam5 spam6 spam7 spam8 spam9 spam10
## 1:  1    AA    AA    GA    GG    AG    GA    GA    AG    GG     AA
## 2:  2    AA    AA    GA    GA    GA    AA    AG    GG    GG     GG
## 3:  3    AG    AG    AG    GA    AA    AG    GG    GA    AG     AA
## 4:  4    GA    GG    GA    AA    AG    GG    AA    AA    GG     AG
## 5:  5    AG    GA    GG    AG    AA    AG    AA    AA    GG     GA

Comment: I didn't find that the names were properly constructed so perhaps you would consider this minor modification: `DT[, setNames( as.list(paste0(ALLE1, ALLE2)), SNP), by = ID]` . Maybe there were changes in how `data.table` handles lists in the intervening 4 years, but I would have thought that `names=SNP` should have been `.Names=SNP`, but even that fails on my machine.
Comment: @BondedDust Thanks. Must have been some change with `data.table`. Next time just edit it yourself :)
Answer: There is no need to build an object yourself. First let's make some example data that I think is representative for your situation:
df = data.frame(name = paste('spam', rep(1:10, 5), sep = ''),
                ID = rep(1:5, each = 10),
                var1 = sample(c('A', 'G'), 50, replace = TRUE),
                var2 = sample(c('A', 'G'), 50, replace = TRUE))

amd combine the var columns:
df = transform(df, comb_var = paste(var1, var2, sep = ''))
head(df)
   name ID var1 var2 comb_var
1 spam1  1    A    G       AG
2 spam2  1    G    G       GG
3 spam3  1    G    G       GG
4 spam4  1    A    G       AG
5 spam5  1    A    G       AG
6 spam6  1    G    A       GA

And then use dcast to perform the transformation:
library(reshape2)
dcast(df, ID ~ name, value.var = 'comb_var')
  ID spam1 spam10 spam2 spam3 spam4 spam5 spam6 spam7 spam8 spam9
1  1    AG     GA    GG    GG    AG    AG    GA    GG    GA    GG
2  2    AA     GA    AG    GA    GA    AG    AG    AA    GG    AG
3  3    GG     AG    AG    AG    GA    GG    GA    GA    AA    AG
4  4    AA     AA    GA    GA    GA    GA    AA    GA    AG    AA
5  5    AG     AA    GA    AA    GG    GG    GG    GA    GG    GG

Answer: DF <- read.table(text="SNP         ID    ALLE1    ALLE2
SNPNAME1    1      A        A
SNPNAME2    1      A        G
SNPNAME3    1      G        G", header=TRUE)

library(reshape2)

DFm <- melt(DF, id=c("SNP", "ID"))
dcast(DFm, ID~SNP, value.var="value", fun.aggregate=paste, collapse="")
#  ID SNPNAME1 SNPNAME2 SNPNAME3
#1  1       AA       AG       GG

Answer: Whenever I see a reshape2 answer I always try to see if there is a fairly straightforward base R solution. In this case (using Pauls's data) using tapply() with I() seems to rearrange the strings in a tabular arrangement (if you first prevent `transform from making a factor):
 df = transform(df, comb_var = paste(var1, var2, sep = ''),stringsAsFactors=FALSE)
 with(df, tapply(comb_var, list(ID, name), I))
#--------------------
  spam1 spam10 spam2 spam3 spam4 spam5 spam6 spam7 spam8 spam9
1 "AA"  "GA"   "GG"  "GG"  "GA"  "AG"  "AA"  "GG"  "GG"  "AG"
2 "AA"  "AG"   "AA"  "AA"  "AA"  "GG"  "GG"  "AA"  "AA"  "GG"
3 "GA"  "GA"   "GA"  "AG"  "AA"  "AG"  "GA"  "GG"  "AG"  "AG"
4 "GG"  "AA"   "GG"  "GG"  "AA"  "GA"  "GA"  "GG"  "AA"  "AA"
5 "AG"  "GA"   "AG"  "GG"  "GA"  "GA"  "AG"  "AA"  "GG"  "GG"