text:
Q: Mixed model failing to converge I've got this data:
clear
input str32 record_id float(gender alcohol_consumption tobacco_consumption hypertension treatmentChoice anSize neurotromb)
"007128de18ce5cb1635b8f27c5435ff3" 1 1 1 3 2 1 0
"00abd7bdb6283dd0ac6b97271608a122" 2 3 4 2 . 4 0
"0142103f84693c6eda416dfc55f65de1" 2 2 2 1 . 2 0
"0153826d93a58d7e1837bb98a3c21ba8" 1 1 3 1 1 2 0
"01c729ac4601e36f245fd817d8977917" 1 3 4 3 . 1 0
"01c729ac4601e36f245fd817d8977917" 1 3 4 3 . 1 0
"01dd90093fbf201a1f357e22eaff6b6a" 2 1 1 2 . 1 0
"0208e14dcabc43dd2b57e2e8b117de4d" 2 1 1 2 . 1 0
"0210f575075e5def7ffa77530ce17ef0" 2 2 1 1 4 1 0
"022cc7a9397e81cf58cd9111f9d1db0d" 2 1 3 1 5 1 0
"02afd543116a22fc7430620727b20bb5" 1 3 4 2 . 5 0
"0303ef0bd5d256cca1c836e2b70415ac" 1 3 4 3 . 1 0
"0303ef0bd5d256cca1c836e2b70415ac" 1 3 4 3 . 1 0
"041b2b0cac589d6e3b65bb924803cf1a" 1 1 3 3 1 1 0
"0536317a2bbb936e85c3eb8294b076da" 1 1 1 1 . 1 0
"06161d4668f217937cac0ac033d8d199" 1 3 4 1 4 1 0
"065e151f8bcebb27fabf8b052fd70566" 1 1 1 1 3 1 0
"065e151f8bcebb27fabf8b052fd70566" 1 1 1 1 . 1 0
"065e151f8bcebb27fabf8b052fd70566" 1 1 1 1 . 1 0
"065e151f8bcebb27fabf8b052fd70566" 1 1 1 1 3 1 0
"07196414cd6bf89d94a33e149983d102" 1 1 1 2 4 2 0
"0721c38f8275dab504fc53aebcc005ce" 1 1 2 1 3 1 0
"0721c38f8275dab504fc53aebcc005ce" 1 1 2 1 1 2 0
"0721c38f8275dab504fc53aebcc005ce" 1 1 2 1 1 1 0
"0721c38f8275dab504fc53aebcc005ce" 1 1 2 1 . 1 0
"07bef516d53279a3f5e477d56d552a2b" 1 3 4 1 . 4 0
"08678829b7e0ee6a01b17974b4d19cfa" 1 1 1 1 3 . 0
"08bb6c65e63c499ea19ac24d5113dd94" 1 1 3 1 5 2 0
"08f036417500c332efd555c76c4654a0" 2 1 2 1 1 1 1
"090c54d021b4b21c7243cec01efbeb91" 1 1 3 2 3 1 0
"09166bb44e4c5cdb8f40d402f706816e" 1 1 3 2 . 1 0
"0930159addcdc35e7dc18812522d4377" 1 1 1 1 1 2 0
"096844af91d2e266767775b0bee9105e" 2 3 4 1 . 2 0
"09884af1bb9d59803de0c74d6df57c23" 1 1 3 1 . 1 0
"09e03748da35e9d799dc5d8ddf1909b5" 1 3 4 1 1 1 0
"0a4ce4a7941ff6d1f5c217bf5a9a3bf9" 1 3 2 2 1 2 0
"0a5db40dc58e97927b407c9210aab7ba" 2 3 4 1 4 2 0
"0a5db40dc58e97927b407c9210aab7ba" 2 3 4 1 4 1 0
"0a73c992955231650965ed87e3bd52f6" 2 3 4 1 . 1 0
"0a84ab77fff74c247a525dfde8ce988c" 2 2 1 2 5 2 0
"0a84ab77fff74c247a525dfde8ce988c" 2 2 1 2 1 1 0
"0a84ab77fff74c247a525dfde8ce988c" 2 2 1 2 . 1 0
"0af333ae400f75930125bb0585f0dcf5" 1 1 1 1 1 1 0
"0af73334d9d2166191f3385de48f15d2" 2 1 1 2 . 1 0
"0b341ac8f396a8cdb88b7c658f66f653" 1 3 4 1 3 1 0
"0b341ac8f396a8cdb88b7c658f66f653" 1 3 4 1 . 1 0
"0b35cf4beb830b361d7c164371f25149" 1 1 1 2 . 1 0
"0b35cf4beb830b361d7c164371f25149" 1 1 1 2 . 1 0
"0b3e110c9765e14a5c41fadcc3cfc300" . . . . . . .
"0b6681f0f441e69c26106ab344ac0733" 1 1 3 1 4 1 0
"0b8d8253a8415275dbc2619e039985bb" 1 1 1 1 4 5 0
"0b8d8253a8415275dbc2619e039985bb" 1 1 1 1 4 5 0
"0b8d8253a8415275dbc2619e039985bb" 1 1 1 1 1 1 0
"0b92c26375117bf42945c04d8d6573d4" 1 2 1 2 . 2 0
"0b92c26375117bf42945c04d8d6573d4" 1 2 1 2 . 1 0
"0ba961f437f43105c357403c920bdef1" 2 1 2 3 1 1 0
"0bb601fabe1fdfa794a5272408997a2f" 2 1 3 1 1 2 0
"0c75b36e91363d596dc46bd563c3f5ef" 1 1 2 1 . 1 0
"0d461328a3bae7164ce7d3a10f366812" 1 3 1 1 . 1 0
"0d4cc4eb459301a804cbef22914f44a3" 1 3 4 3 . 1 0
"0d4e29e11bb94e922112089f3fec61ef" 1 3 4 1 . 1 0
"0d4e29e11bb94e922112089f3fec61ef" 1 3 4 1 . 1 0
"0d513c74d667f55c8f4a9836c304149c" 2 3 4 1 . 2 0
"0da25de126bb3b3ee565eff8888004c2" 1 1 1 2 . 2 0
"0da25de126bb3b3ee565eff8888004c2" 1 1 1 2 . 1 0
"0db9ae1f2201577f431b7603d0819fa6" 2 1 3 2 . 1 0
"0dd8a681f6a5d4c888831a591e57a747" 1 1 3 . 5 4 0
"0e05d6958d878368b5fb831211fad6a1" 1 1 1 1 . 1 0
"0e3ff41e0e2b2cb5ec336fd0b04e5d44" 2 1 2 2 1 1 0
"0f61e560ab56b8fea1f2593d7d3b2718" 1 1 3 1 . 1 0
"0f61e560ab56b8fea1f2593d7d3b2718" 1 1 3 1 . 1 0
"0f69f1f998984d37f133185179d63c60" 2 1 3 2 3 3 0
"1037032886a93e66406a4c910d1ef747" 1 1 1 1 . 1 0
"1037032886a93e66406a4c910d1ef747" 1 1 1 1 . 1 0
"1044b81b354b420e85ae835ea07de2d6" 1 1 2 2 . 4 0
"10620fc488346291281212a404681386" 2 1 1 2 . 3 0
"1074389c469944edf026d193a55b1148" 1 1 3 3 3 2 0
"1090d5a678119b03cddab609289a4d3c" 1 1 2 2 1 1 0
"111eebb45cef2211a2a2ff0219095e6a" 1 2 1 1 . 1 0
"11ddcbc8de8ef56cbc578fc81b602ffc" 1 1 1 2 2 2 0
"11f22488513cf717c333786c789b0289" 1 1 3 2 3 1 0
"11f22488513cf717c333786c789b0289" 1 1 3 2 3 1 0
"121552b22cee2a1eb4360b4d2534cd39" 2 1 1 1 1 2 0
"1251d707c5dc9243dc45d04beb7c3493" . 1 1 1 . 1 0
"125689659bb3821fa81698dd72462773" 1 1 3 2 . 1 0
"127ba572433921c5bb408fc62eb9b5d7" 1 1 3 1 1 1 0
"129bea3f73e84e37d77d55fadfeb49dd" 1 1 1 2 3 2 0
"12e8dc6fb87822be26d6678cee9644f5" 1 2 2 3 5 1 0
"12f05a65f771c9675c2c5e9cdbfc33d1" 2 1 1 1 3 1 0
"12f05a65f771c9675c2c5e9cdbfc33d1" 2 1 1 1 3 1 0
"13d2bc86f1a19ed2959cd7354bc92d1d" 2 1 3 2 . 2 0
"13db5ede38e2ae1da17884c9a18df202" 1 1 2 1 3 1 0
"13f946e50df8ad74d7cf9fa05b4ad05b" 1 3 1 2 . 2 0
"146c4b8be7996a9789873fe55a47ab41" 2 1 3 1 1 1 0
"147fadd87da13a0271225d944d2a5e98" 1 1 2 2 4 1 0
"14a1dcfa015343bbefaac9a3a45769e5" 2 1 1 2 4 2 1
"14a1dcfa015343bbefaac9a3a45769e5" 2 1 1 2 . 1 1
"14d1377f74a63ffa29db2d99e7f6a1ce" 1 1 1 2 . 1 0
"150017d944a87b4c61f90034380c0659" 1 1 1 3 5 3 0
"150f6ca1ea453260eabf3472d3ebcad1" 1 1 3 2 4 1 0
"152dbaeb2dccc0b7bc78c83337974e17" 1 3 4 1 . 1 0
"160b6c842870ed5d75ccb791690a84e2" 1 3 4 3 . 1 0
"166ed54ce44b9fd14baff4c13720eb76" 2 2 3 2 1 2 0
"166ed54ce44b9fd14baff4c13720eb76" 2 2 3 2 1 1 0
"16c2a2c90b75135e9321d568967b5034" 1 1 1 1 . 1 0
"1715db73767478aeb9d6dc808fdad443" 1 1 2 2 . 1 0
"17949a61667c79f00dbcaa131a167a7d" 1 2 1 2 1 1 0
"17949a61667c79f00dbcaa131a167a7d" 1 2 1 2 . 1 0
"17bcd3b70b99586cc22894f4870fe0e9" 2 1 1 1 3 2 0
"17ef09ab32f88420a439642a7eedc590" 2 3 4 1 . 1 0
"17ef09ab32f88420a439642a7eedc590" 2 3 4 1 . 1 0
"17ef09ab32f88420a439642a7eedc590" 2 3 4 1 . 1 0
"1836e13c06440db40c7f0ea11bf48587" 1 3 3 1 . 1 0
"1849cda9ceae854c579d60b62352d10d" 1 1 1 2 4 2 0
"1859ae143d9e097d9660b96e847f188c" 2 1 2 1 . 4 0
"187b862bf9b846e7959b3856a22cbc5c" 1 1 1 2 3 2 0
"198d4802c4d49c78dd8236a9cdd13de5" 1 3 4 1 . 1 0
"1a041308d68afeb4667f8281128e1c0a" 1 1 3 2 1 3 0
"1a19bdc645ee2f61e6a870a348b3e6b8" 1 1 3 1 . 1 0
"1a3f6d3083a5b07cd2840b3dec1cfd58" 2 1 3 2 . 1 0
"1a5a193e385e033beb84df32d2154eb5" 1 1 3 2 1 1 0
"1a5d20bf7e66f51259136e1756fa9769" 1 1 1 2 1 1 0
"1a71805e55fa2503102139c85f639ae6" 2 1 1 2 4 2 0
"1a71805e55fa2503102139c85f639ae6" 2 1 1 2 . 1 0
"1afad9a463552e6c9b1680cb23682b2a" 2 1 2 2 . 1 0
"1b8cc13a25626f72e9c7d2c418d07b03" 1 1 3 2 . 1 0
"1b9db681f465d699bee160bcf504a3cf" 1 1 1 1 1 2 0
"1b9db681f465d699bee160bcf504a3cf" 1 1 1 1 1 2 0
"1bb0ecf8203fc4fadb6d6b8d7dc9f543" 2 1 3 2 . 1 0
"1bc9ce4ae6ce7743f7d584c5fd420c12" 2 1 3 1 . 1 0
"1c30679d3c120eaeb638bbcc0943bfcf" 2 3 4 2 5 1 0
"1c4635c702725f45cbd6d6944ab33ca1" 1 1 1 2 2 4 0
"1c4635c702725f45cbd6d6944ab33ca1" 1 1 1 2 5 1 0
"1c517ac859bdb6e78e741d1ba1723ec6" 1 1 2 3 1 2 0
"1c8997f0884bad9c6165d7a059835dcf" 1 1 1 2 . 1 0
"1c89f217a48f1bbb13f16289ba4da568" 1 3 1 2 3 1 0
"1cb74b679f4fafa091037047cfc1a84b" 1 1 1 1 3 1 0
"1cb934a7383eeed130cb233616094f34" 2 2 1 1 1 1 0
"1cbe9fadead834b5acf128746f10a741" 2 1 2 1 . 1 0
"1cd68d28672bb8102f86829b938dfe4d" 1 3 1 2 3 1 0
"1d854ae039abb5dc7ee1a9bb104376a8" 1 1 3 1 . 1 0
"1dc6cf6fb0a06209077411febc6e1c65" 1 1 3 1 3 1 0
"1e00442745c25082a64197b96065f755" 1 1 4 3 . 1 0
"1e0b6ac25d5dafb3a1f32e42e53d3e90" 1 3 1 2 . . .
"1e1425d670466e1a2c6c752d9227df17" 2 1 1 2 3 1 0
"1e6b62ddac39164f28eb019c36cf0b33" 1 1 1 1 . 1 0
"1ee1beebfd76df81746e57a13e258f38" 1 1 3 2 1 1 0
"1ee1beebfd76df81746e57a13e258f38" 1 1 3 2 1 1 0
"1ee1beebfd76df81746e57a13e258f38" 1 1 3 2 1 1 0
"1ee1beebfd76df81746e57a13e258f38" 1 1 3 2 5 1 0
"1ee1beebfd76df81746e57a13e258f38" 1 1 3 2 2 1 0
"1ef30e808a5dccfd6f59814069401536" 1 1 1 2 1 1 0
"1f710e0784066556585dc4cb255119a2" 1 1 2 2 1 2 0
"1f724b5ac268e6695f179a65544b762f" 1 1 2 3 1 1 0
"1f93d9334e868ddcfdf6612ecbea0085" 2 1 1 2 4 2 1
"2042abded277bac20d04e22642fc96ee" 1 1 1 1 . 1 0
"2049ad9e3e71e88d27df76be3ed842d7" 1 1 1 2 . 1 0
"209f55284471eadfa8ac90b203c9253e" 1 3 4 1 1 2 0
"20a242d4fa3cdcadfb70a96822f172d5" 2 2 4 1 3 2 0
"20c3937cf440254929b2c40ffd6de1a4" 1 1 1 2 . 1 0
"21595388405371d0808a044000bd97ae" 1 1 3 1 1 1 1
"215d8fa815973f4fbcd86377977900d8" 1 1 2 1 . 1 0
"21a34d93e3aed141889fd3d6690da932" 1 1 1 2 2 1 0
"222db47be5af3af3ffb2268a8af9462d" 1 3 4 3 . 1 0
"226f5e3fb8f5f886c74e396afd35193b" 1 3 4 3 . 1 0
"2284967e0cefc0e6b42e5b14dd5f3880" 2 1 1 1 . 3 0
"2284967e0cefc0e6b42e5b14dd5f3880" 2 1 1 1 . 1 0
"22ae00f9b4a7f89c4b7c671b7f16f15f" 1 1 1 2 1 1 0
"2311c659fe3e62f744439ddb85239d19" 1 3 4 1 . 1 0
"237a27babe7c480c32fd5d2e3e94b456" 1 3 3 2 . 1 0
"23b26e94718acf085c7f45a16da79e8e" 1 1 2 1 3 2 0
"23ce2e59a2135d2e8f8a39d31f91e69f" 1 3 4 3 . 1 0
"24186e69c5c1fc48f8fac5e28177ccb7" 1 1 2 1 2 3 0
"24227f50621eb4d0e30c8f0d1427f23b" 1 3 4 1 . 1 0
"2448682f873b74c56fc59aa091c93ef3" 1 1 2 2 2 1 1
"248c256573f7049e8ef5abd2e655e8c7" 2 1 2 2 . 1 0
"248d9600588fdd6ad070a2a185d942a3" 2 1 3 1 1 2 0
"24f880cfb32fb5773f087cf67446fe98" 1 2 1 2 3 3 1
"24f880cfb32fb5773f087cf67446fe98" 1 2 1 2 . 1 1
"24f880cfb32fb5773f087cf67446fe98" 1 2 1 2 . 1 1
"2535b1c616dd453abe2a0f4f87a4f92f" 2 1 2 2 4 2 0
"2541eacb78206253021c08335df72a7b" 1 1 1 1 4 1 0
"2586469433fed41601e8a3a60818def1" 1 1 1 1 1 2 0
"2586469433fed41601e8a3a60818def1" 1 1 1 1 5 2 0
"266f1f1517fb50bafca92fff39c259d5" 1 3 2 1 . 1 0
"266f1f1517fb50bafca92fff39c259d5" 1 3 2 1 . 1 0
"2675ea8b57788dff4680e0b70b6a1d69" 1 1 1 2 4 1 0
"2675ea8b57788dff4680e0b70b6a1d69" 1 1 1 2 4 1 0
"267c028ade7b0d58528c8fc130cfdc5c" 1 1 2 1 . 3 0
"267c028ade7b0d58528c8fc130cfdc5c" 1 1 2 1 . 1 0
"26b712f0a44f5fb88fe2d49d6209639a" 2 1 3 2 . 2 0
"26b712f0a44f5fb88fe2d49d6209639a" 2 1 3 2 . 2 0
"26d32f5acb669032bae56e14152044a6" 2 1 1 1 . 4 0
"272c5f2300564e427a953af2ec144cef" 1 1 1 1 3 1 0
"272c5f2300564e427a953af2ec144cef" 1 1 1 1 . 1 0
"272e24b67eef3f79f1a32ee7e0a3dab3" 1 1 2 1 . 2 0
"276c1bdad54d49ed343cd902554ae86f" 1 1 3 1 . 2 0
"27772e9942f7cfaa8648cc6495d7e30d" 2 1 2 1 4 1 0
"278099f521c671e45114b7056c362559" 1 1 3 1 3 1 1
"280e7ad644c45aa66e9b019e929d6617" 1 1 2 1 . 1 0
"282dc9e794504edbd5c2e9b6dc68cc9c" 1 1 3 1 . 1 0
"28a8d624e616dacc3a01d51b656353c8" 1 1 1 2 1 2 0
"28f483b35112c0aa73bb7d3761c3b5d2" 1 1 3 1 1 1 0
"29534fe6f18b75090b9d18f853ed7ec1" 1 3 4 1 3 5 0
"29534fe6f18b75090b9d18f853ed7ec1" 1 3 4 1 3 5 0
"29534fe6f18b75090b9d18f853ed7ec1" 1 3 4 1 3 1 0
"29534fe6f18b75090b9d18f853ed7ec1" 1 3 4 1 . 1 0
"29534fe6f18b75090b9d18f853ed7ec1" 1 3 4 1 . 1 0
"299ce3b994386acaaa633d5567dd327d" 1 1 1 2 5 2 0
"29c02008312d278f9f368ea51dd83adc" 1 1 1 1 3 1 0
"2aa102e00fa4efe3d786462f6275b30f" 1 3 4 2 . 1 0
"2afc1f12901992a1f973cde814615349" 1 1 4 3 . 2 0
"2afc1f12901992a1f973cde814615349" 1 1 4 3 . 1 0
"2c0ba4875d701718be0644d1212f304d" 2 1 1 2 . 1 0
"2d70a27e8bb674fbce35e01d024e9363" 1 1 1 2 . 2 0
"2d943b83a4f7fff4b7c098600b847605" 1 1 1 1 1 2 0
"2e2ecf6c92fde6ca5201a52440355d3d" 2 3 1 1 1 3 1
"2e3ae2a4725cb7addd6af1ea729c10b1" 2 1 1 2 2 2 0
"2e3ae2a4725cb7addd6af1ea729c10b1" 2 1 1 2 2 1 0
"2e73605ba74e9203381022be9438a0f6" 1 3 4 3 . 1 0
"2ed013748bf88df47c39d83bd48d8040" 1 1 4 1 3 1 0
"2eda6a9499d88bff6541548b03d5739b" 1 3 4 1 . 2 0
"2f3c2b5d92461ead44d7577b2ca2c67b" 1 1 1 2 2 2 0
"2f3c2b5d92461ead44d7577b2ca2c67b" 1 1 1 2 . 1 0
"303be56acb1c6514630175c0435677b3" 1 . 3 1 3 2 0
"309704682b2cf0aee0384945ba6965f6" 1 1 3 2 . 1 0
"3099225c525a6a7cf2f44c152cea72ac" 2 2 1 . . 1 0
"30b5ce9e13028219e1b1f4fc7a8f0fdd" 1 2 1 1 . 5 0
"30b5ce9e13028219e1b1f4fc7a8f0fdd" 1 2 1 1 . 5 0
"30bfb44ccfbe0289a85d0c803d815713" 2 3 4 3 . 1 0
"310a3b0d0c717ec85ab9695c29e89e69" 2 1 3 1 . 1 0
"310a3b0d0c717ec85ab9695c29e89e69" 2 1 3 1 3 2 0
"31ef2d94b9a69e3eed6aae83d1826967" 2 3 4 3 . 1 0
"32645986b0130f29ee32ee530f52373e" 2 3 4 3 . 1 0
"330ac3ddd9f1a2e4dae675569d804a10" 1 1 3 2 . 2 0
"331c4f53bbd697ee384424bc0cd2061e" 2 1 2 1 . 3 0
"336f5373cab13f2bf4d11fdfa97dcaec" 1 1 1 2 4 2 1
"336f5373cab13f2bf4d11fdfa97dcaec" 1 1 1 2 1 1 1
"33cb4c6171e5abfe3878743ab33e2091" 1 1 1 1 5 1 0
"33f8dd7e04c3e30b037686546d0dcfe0" 1 1 3 2 . 2 0
"3562e13a0d8d6b3d8fcd8686b4456686" 1 1 2 1 2 2 0
"36904fec81952b2c2f0fcbc7a49a0ad1" 1 3 1 1 . 1 0
"369b58e7d46dd6ca3092d11873a6326b" 2 3 4 1 . 2 0
"369b58e7d46dd6ca3092d11873a6326b" 2 3 4 1 . 2 0
"3717e8e95c688eb7e139255569d7a564" 1 3 4 1 3 1 0
"3717e8e95c688eb7e139255569d7a564" 1 3 4 1 4 1 0
"3717e8e95c688eb7e139255569d7a564" 1 3 4 1 3 1 0
"37272e1e6203f9e18104173acf626b4f" 1 1 3 2 . 1 0
"388bd462a0ccdf6c8cdf614ba5d97664" 1 1 1 2 3 1 0
"38b6fb9b5bf10e5c0e535ee1e8f47c07" 1 1 3 2 1 1 0
"38ecebab24128702fd657fc90623cc91" 1 1 1 2 . 1 0
"38ecebab24128702fd657fc90623cc91" 1 1 1 2 . 1 0
"397f116460482fbf828cb1b41ac795da" 1 3 4 1 . 1 .
"39aefa1784d6061766d4b90c98077f5c" 2 1 1 1 3 1 0
"39ba40af678e2083aa02e12580c1d991" 1 1 3 1 5 2 0
"39f148a18591def27b5821722ecadcf5" 2 1 2 1 . 1 0
"3a125ff4c88b02a5a443ef3434e0484d" 1 1 3 1 3 1 1
"3a2692cdc3fe6781570a259f89035375" 1 1 3 1 4 1 1
"3a4b53abe0d1ccd6f62b16de9e45f56c" 1 2 4 3 . 2 0
"3ab4a637fbaa039042e95e782d3e1700" 1 1 3 1 . 1 0
"3aca179e92e6b3e81b71e6548a2ad2d2" 1 1 2 1 3 3 0
"3aff1153dffdfa55321529d82b44cbd0" 1 3 4 3 . 2 0
"3b09abd94d2f9edac735ae4f4b961733" 1 1 2 2 1 2 0
"3b09abd94d2f9edac735ae4f4b961733" 1 1 2 2 1 1 0
"3b09abd94d2f9edac735ae4f4b961733" 1 1 2 2 1 1 0
"3b53a9e25aba0721501933dec37f349d" 1 1 1 2 2 2 0
"3b53a9e25aba0721501933dec37f349d" 1 1 1 2 5 2 0
"3b55aebe1b4b22e0c77168acc4b775dd" 1 3 4 1 . 5 0
"3cac880fc30873437bd7f9600163ff24" 1 1 3 2 3 2 0
"3e217b8668baf47a526e8b0359db2957" 1 1 2 . . . .
"3e2a66a64f5053dacc55ecde38373166" 1 3 4 3 . 1 0
"3ea05bfc65cce9aea1c1c3a49807d99f" 1 1 3 2 2 1 0
"3ed1d9aee8dcf8da0c17476411ee8ebe" 1 1 2 2 1 1 0
"3f741cdeeebb9bd085120fdc76cd14d4" 2 1 3 1 2 4 0
"3fe59b936db9606d3eca8d14cf507b9a" 2 1 3 2 1 2 0
"40425036bdc1695391897694ce60e596" 2 1 3 2 1 1 0
"40425036bdc1695391897694ce60e596" 2 1 3 2 1 1 0
"4067410b952d26be08fd11937a19d4d2" 1 1 1 2 . 1 0
"4067410b952d26be08fd11937a19d4d2" 1 1 1 2 . 1 0
"409961748f348e836b9862f163b23771" 1 1 3 2 1 1 0
"40a9249759e3ba846d324deb3a8dfd63" 1 1 3 1 4 1 0
"4157a7bd496c733d2422b74fd2125c68" 2 1 2 3 1 1 0
"41714f2016e47daadae150d67988e592" 1 1 1 1 2 1 0
"41c360569cbbb6833505539c3bf4a783" 1 1 3 2 3 1 0
"4200e79d457cfc002ede60ac27e1dc35" 1 1 3 1 . 1 0
"4204c8cafecbca050fe111aedcd732c9" 1 1 1 1 . 1 0
"420bf125eafd56e4693c07137a86528b" 1 1 3 2 3 1 1
"425575728f0c59ec4f7045535a7edaa2" 1 1 2 1 . 1 0
"42ea78204df0879be0026f86355cba07" 2 1 1 1 2 3 0
"431dba60771833b6cd55e01128c1e059" 1 1 3 1 4 1 0
"432e1f89405d805abf074330a2884f3d" 1 3 4 3 . 3 0
"4354adf8072da82b930147ded6948da5" 1 1 1 1 5 2 0
"4393f27b43e526d64b0ca2a69391d17e" 1 1 1 2 5 1 0
"4393f27b43e526d64b0ca2a69391d17e" 1 1 1 2 . 1 0
"4393f27b43e526d64b0ca2a69391d17e" 1 1 1 2 . 1 0
"43d4456ee1a6ed7a6d4fd1a0d4d19599" 1 1 1 2 1 2 0
"43d4456ee1a6ed7a6d4fd1a0d4d19599" 1 1 1 2 . 2 0
"43d4456ee1a6ed7a6d4fd1a0d4d19599" 1 1 1 2 1 1 0
"43d4456ee1a6ed7a6d4fd1a0d4d19599" 1 1 1 2 . 1 0
"4428c1037ec1ac0db3ed774e3b6e12f6" 1 2 1 1 . 3 0
end

It shows patients (record_id, anonymized), aneurysm size (anSize), an adverse effect (neurotromb), treatment option (treatmentChoice) and some adjusting baseline variables.
I'm interested to know whether choice of treatment has an effect on the adverse effect neurotromb.
As we are arranging by aneurysms (patients can have more than 1 aneurysm) we run a mixed model, grouping by record_id.
This is my code in R:
glmer(neurotromb ~ factor(treatmentChoice) + gender + alcohol_consumption + tobacco_consumption + familial_predisposition + anSize + (1 | record_id), family=binomial)

However this returns the following output:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
 Family: binomial  ( logit )
Formula: neurotromb ~ factor(treatmentChoice) + gender + alcohol_consumption +
    tobacco_consumption + familial_predisposition + anSize +      (1 | record_id)
      AIC       BIC    logLik  deviance  df.resid
 244.7785  291.5070 -111.3893  222.7785       506
Random effects:
 Groups    Name        Std.Dev.
 record_id (Intercept) 13.51
Number of obs: 517, groups:  record_id, 427
Fixed Effects:
             (Intercept)  factor(treatmentChoice)2  factor(treatmentChoice)3  factor(treatmentChoice)4
                -6.58794                  -1.63594                   0.02225                  -0.09801
factor(treatmentChoice)5                    gender       alcohol_consumption       tobacco_consumption
               -74.33215                  -5.34448                   0.33914                  -1.19420
 familial_predisposition                    anSize
                 1.93422                   0.14242
convergence code 0; 0 optimizer warnings; 2 lme4 warnings
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  unable to evaluate scaled gradient
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge: degenerate  Hessian with 1 negative eigenvalues

I'm not entirely sure if the model can be used or not or if these are absolute errors? It runs fine if I dichotomize treatmentChoice into either one type of treatment or the other, but the treatmentChoice variable is nicely distributed so I wouldn't think I'd have to.

A:
I'm not entirely sure if the model can be used or not or if these are absolute errors

The model has not converged to a solution, so you should not uses the output from this model.
This is probably related to the dataset having a large proportion of singleton clusters. A few things to try are:

*

*try the other optimisers avalable in lme4

*try setting nAGQ greater than 1

*refit the model using a range of starting values

*try using GLMMAdaptive, brms, glmmTMB and other packages

If all the above fails then you could split the dataset into two - one part for all the singleton clusters and fit it a linear model (with lm in R) on those, and the other part with a mixed model package.


text:
Q: Tabluea bubble in bubble chart I would like to make a chart showing assessment scores by gender.  I would like one bubble to show the % of total students for each tick on the x-axis (call this class number).  Next, I want the inner bubble to fill the first bubble based on the % of total passing grades.  I also want to break it down by gender.  The following is an illustration of what I am looking for:

There will be 2 bubbles per x-axis value (one for males and one for females).  If the proportion of passing grades for a class is greater than it's proportion of students, then the outer bubble will be larger than the inner bubble and the colors will invert (I suppose opacity will work too).
If a bubble-in-bubble is not possible, what other chart types would you recommend?  Just side-by-side bar-in-bar?

A: I guess we cannot have nested bubbles in Tableau.

redpajama_set_name: RedPajamaStackExchange


text:
Q: C++/Qt: crash on QCoreApplicationPrivate::sendPostedEvents I'm having difficulties to fix following issue/crash. The program just keeps going around 30 minutes and then it crashes. Basically what the program does is (simplified):
runCalculations(const InputValues &dataIn, OutputValues &dataOut);
appendNewOutputValues(const OutputValues &dataOut){
   doSomeVerifications(dataOut);
   emit dataChanged(dataOut);
}
//In another class I'm listening to the signal and adding each dataOut to a QMap<QDateTime, QVariant>
onDataChanged(const OutputValues &dataOut){
   addToMap(dateTime, dataOut);
   emit mapChanged();
}

//After that I'm emitting a signal that the buffer was changed: This signal is connected to an QObject which takes new value and does some functionality with it.
onMapChanged(){
   map.getNewData(&newData);
   doSomethingWithNewData(newData);
}

I hope that the main idea should be clear from above example.
Approximately I'm sending 2400 signals/sec. All the data I'm using should take around 14MB, so that should be OK.
First I thought that the problem is that my event queue gets full, so I have added code below after each runCalculations():
QCoreApplication::instance()->sendPostedEvents();
QCoreApplication::instance()->processEvents();
QCoreApplication::instance()->sendPostedEvents(0, QEvent::DeferredDelete);

I have tried also only with processEvents, sendPostedEvents,... but the same result.
When I run my program only with runCalculations method (without updating and sending signals) everything works fine. Problem is that from the debug info I'm not very much smarter.
I'm running on XP in Parallels, where I have dedicated 3GB of Ram and 2 cores.

Backtrace:
Thread 1 (Thread 3484.0x3ec):
#0  0x08b05fe0 in abort () from C:\Qt\4.8.4\bin\QtCored4.dll
No symbol table info available.
#1  0x08b6013d in __gnu_cxx::__verbose_terminate_handler () at ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/vterminate.cc:93
    terminating = true
    t = <optimized out>
#2  0x08b0db8d in __cxxabiv1::__terminate (handler=0x8b60018 <__gnu_cxx::__verbose_terminate_handler()>) at ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/eh_terminate.cc:38
No locals.
#3  0x08b73efb in std::terminate () at ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/eh_terminate.cc:48
No locals.
#4  0x08b76956 in __cxxabiv1::__cxa_rethrow () at ../../../../gcc-4.4.0/libstdc++-v3/libsupc++/eh_throw.cc:116
    globals = 0x188f5f4c
    header = 0x762a7b90
#5  0x08aa69c3 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x178e6ad0) at kernel/qcoreapplication.cpp:1582
    pe = @0x4e717fe0: {receiver = 0x178e6ce8, event = 0x0, priority = 0}
    e = 0x1adc1018
    r = 0x178e6ce8
    locker = {val = 395209469}
    startOffset = 0
    i = @0x178e6af4: 1
#6  0x08acb347 in qt_internal_proc (hwnd=0x5203ca <FMDataVerificator::createSockets()+3930>, message=1025, wp=0, lp=0) at kernel/qeventdispatcher_win.cpp:496
    localSerialNumber = 540804d
    msg = {hwnd = 0x5203ca <FMDataVerificator::createSockets()+3930>, message = 1025, wParam = 0, lParam = 0, time = 2285040, pt = {x = 2285016, y = 145536386}}
    app = 0x22fe70
    q = 0x178e6ce8
    result = 0
    d = 0x178e6d08
#7  0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
No symbol table info available.

A: As far as I know I don't think you can exceed the capacity of the Event Queue.  I would look other places before pointing at something in the QtCore.
http://qt-project.org/doc/qt-4.8/eventsandfilters.html
It is most likely a synchronization issue or a memory leak issue or maybe even a memory access issue.
Memory Leak?
To rule out the memory leak issue, look at Task Manager, and watch the size of your program on the Heap.  (The memory column).  If it continues to grow over the whole 30 minutes, it's probably a memory leak.
Memory Access?
To see if it is a memory access issue, you might be "cleaning up" an object and then referring to it again, or referring to pointer that hasn't been instantiated yet.
To fix this, for any object created on the heap, zero it out in your constructor or even create a void init_mem() function that sets all your heap items to zero.
Then when you delete any thing make sure you set it to zero afterwards, too.
Then before accessing any of your pointers, check to make sure they are not null, and return or print an error if they are.
Synchronization Issue?
And lastly if you are having a synchronization issue, this would have to deal with any data that is accessed by multiple threads.  Any data shared between the two or more threads needs to be treated as a problem area.  So wrap it with something like the QMutexLocker properly or something similar.  Also calls to another thread should be done using signals and slots connected over a Queued Connection, not an Auto Connection or a Direct Connection.
It sounds like if you aren't using threads, you probably should be, because of the Producer/Consumer model you have.
Debugging Techniques
Also with long running processes using logging and debug statements properly can help narrow down what is causing the problem.
Adding Qt Sources to QtCreator 2.4.1
http://qt-project.org/doc/qt-4.8/debug.html
Hope that helps.


text:
Q: Fuseki - server configuration I would like to do a benchmark in order to compare the performances among different triple stores.
In this case I am using Fuseki Server. I would like to limit the RAM and the number of threads used. I would like to run fuseki-server from command line.
I know how to limit the RAM : I can limit the max heap memory allowed by typing from prompt  -Xmx4G ( in this case I limit it to 4 GB).
I think I also know how to limit the number of threads: I just need to put in the Fuseki-server directory a xml file (in this case called jetty.xml) how it is explained here: xml file.
So from command prompt I run
java -Xmx4G -jar fuseki-server.jar --jetty-config=jetty.xml
and I get the following error

[2015-10-08 08:56:22] Server     INFO  Jetty server config file = jetty.xml
  [2015-10-08 08:56:22] XmlConfiguration WARN  Config error at name="addConnector">
 <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"><Set >name="port">3030</Set><Set name="maxIdleTime">0</Set><Set >name="requestHeaderSize">65536</Set><Set >name="requestBufferSize">5242880</Set><Set >name="responseBufferSize">5242880</Set></New>

  [2015-10-08 08:56:22] Server     ERROR SPARQLServer: Failed to configure >server: org.eclipse.jetty.server.nio.SelectChannelConnector
  java.lang.ClassNotFoundException: >org.eclipse.jetty.server.nio.SelectChannelConnector
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
          at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86)
          at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:364)
          at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:754)
          at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1125)
          at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1030)
          at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:721)
          at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:417)
          at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:298)
          at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:248)
          at org.apache.jena.fuseki.jetty.JettyFuseki.configServer(JettyFuseki.java:266)
          at org.apache.jena.fuseki.jetty.JettyFuseki.buildServerWebapp(JettyFuseki.java:223)
          at org.apache.jena.fuseki.jetty.JettyFuseki.(JettyFuseki.java:92)
          at org.apache.jena.fuseki.jetty.JettyFuseki.initializeServer(JettyFuseki.java:87)
         at >org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:330)
         at arq.cmdline.CmdMain.mainMethod(CmdMain.java:102)
         at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
         at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
         at >org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:>97)
         at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:60)
  org.apache.jena.fuseki.FusekiException: Failed to configure a server using >configuration file 'jetty.xml'
         at >org.apache.jena.fuseki.jetty.JettyFuseki.configServer(JettyFuseki.java:270)
         at >org.apache.jena.fuseki.jetty.JettyFuseki.buildServerWebapp(JettyFuseki.java:2>23)
          at org.apache.jena.fuseki.jetty.JettyFuseki.>(JettyFuseki.java:92)
         at >org.apache.jena.fuseki.jetty.JettyFuseki.initializeServer(JettyFuseki.java:8>7)
        at >org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:330)
         at arq.cmdline.CmdMain.mainMethod(CmdMain.java:102)
         at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
         at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
          at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:97)
          at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:60)

Do you think I miss some class in the classpath?
And where should I add them?
Thanks in advanced.
I apologize for my poor formatting style but I am not used to ask questions, If you tell my how to improve it I will do it.

A: This looks like Fuseki2 which uses Jetty9.  SelectChannelConnector is for Jetty8 (as used by Fuseki1).  Jetty8 and Jetty9 are quite different in this area.  See the Jetty9 documentation.
-Xmx4G will likely slow Fuseki down and it does not limit the amount of RAM.  TDB uses memory mapped files and these do not contribute to heap space.  What is more, engaing the heap takes space away from the OS memory mapped file cache.


text:
Q: I'm new to atom (atom.io), I have downloaded it, and success installed it. But how to open this editor? I'm new to atom (atom.io), I have downloaded it, and success installed it. But how to open this editor?
There is no shortcut in my desktop. And no atom icon on my start menu. How to open this editor?

A: try to open a terminal and type "atom ." or, if it fail, check the installation guide here.


text:
Q: About RISC-V compilers? I am new to programming and as well as RISC-V. I have a few questions regarding the RISC-V compilers:

*

*Do RISC-V compilers support the C program?

*From which RISC-V cross compiler can I generate ELF files that accept C program?

*Can anyone who is familiar with these things please help me in the learning process?

A: Here is a RISC-V GNU Compiler Toolchain. It is a cross compiler that makes it possible to build ELF files for RISC-V on a standard Linux system.
It can be a bit of a challenge to build a toolchain by yourself, but there seems to be good instructions for this one.
Often you get a pre-built toolchain from a supplier. If you have that I recommend you to use it instead of building one yourself.


text:
Q: Numpy Lognorm function, used in dataframe Suppose you have a dataframe A which looks like this:
ID  sigma  miu   prob
1    20    0.5   0.875
2    25    0.2   0.800
3    10    0.4   0.668
4    30    0.6   0.994

how can i use python to create another column which does this Excel equivalent calculation?
LOGNORM.INV(prob, sigma, exp(miu))

thanks in advance :)

A: This is the expected output of the scipy.stats.lognorm function, as stated in the documentation.

A: As the error suggests scipy.stats.lognorm does not return an object over which you can iterate. It returns a continuous random variable. It inherits from scipy's generic class scipy.stats.rv_continuous, meant for subcalssing.
I'd suggest you to check the docs so you know what to expect from it and see the methohds it has.

A: Use the ppf method to get the of x at which the probability is the desired one
data = [20, 25, 10, 30]
miu = [0.5, 0.2, 0.4, 0.6]
prob = [0.875, 0.800, 0.668, 0.994]

df = pd.DataFrame(dict(sigma=data, miu=miu, prob=prob))

df['calc'] = scipy.stats.lognorm(s=df['sigma'], scale=np.exp(df['miu'])).ppf(df.prob)


text:
Q: Do master-detail relationships not cascade their deletes? I was under the impression that deleting a master record in a master detail relationship would delete the detail record automically, cascading the delete.
In practice I get this error

DELETE_FAILED, Your attempt to delete xxx could not be completed because it is associated with the following .: xxxx

I know lookups have the ability to cascade their deletes, but this isn't built in with master-detail relationships?
Edit: Leaving this downvoted post up in case any other person stumbles onto the same problem.
Essentially my issue is because the child object was a junction object meaning it had 2 master detail relationships. I think that is why the natural cascading behavior didn't delete this child object and threw an error.

A: Custom Master-Detail relationships reliably behave the same; they will delete the child records when the parent is deleted. Standard "master-detail" relationships, which many of which are technically a hybrid between lookup and master-detail, actually prevent deletion of the parent record. In those cases, you have to delete the child records before deleting the parent.


text:
Q: symfony 4 with fixtures, the getReference method does not return the expected object (return PROXY/__CG__/... instead an instance of User class) From symfony 4, I created two fixtures classes.
When I run the command "./bin/console doctrine:fixtures:load" I get this error :
Argument 1 passed to App\Entity\Article::setAuthor() must be an instance of User, instance of Proxies\__CG__\App\Entity\User given, called in /home/okli/PhpstormProjects/nomads_fiction/src/DataFixtures/ArticleFixtures.php on line 53

From the fixture 1 (the first fixture called), I created a user with this code :
$myuser = new User();
$myuser->setName("foo");
...

$em->persist($myuser);
$em->persist();

$this->addReference("foo", $myuser);
$this->log->info("class is : " . get_class($myuser)); //  print "class is : App\Entity\User" its good !

From the fixture 2, I loaded the myuser object like this :
$myuser = $this->getReference("foo");
$this->log->info("class is : " . get_class($myuser)); //  print "class is : Proxies\__CG__\App\Entity\User", why not App\Entity\User ?

Why getReference doesn't return me the exact same object I returned from the fixture 1 ? Where is my mistake ?
Thank you for some help :)

A: That's exactly what it was supposed to do. The getReference() function lets you obtain a reference to an entity for which the identifier is known, without loading that entity from the database, which is a proxy object of the generated class for the User. Full documentation here
In fact, doctrine doesn't really care if you use a proxy object. All you have to do to get your code working is to remove the type-hinting from the setAuthor function in Article entity (i.e setAuthor(User $user) to setAuthor($user)).
This will work because all you want to achieve by calling the setAuthor function is to establish an association to an entity. Since you already have the identifier for this entity, you don't have to fully load it.
EDIT: As Matías Navarro Carter observed, entity proxy classes extend real entity classes, so the type-hinting should work anyway. I guess you forgot to use the appropriate namespace in your Article entity. Maybe you are missing something like this in your Article.php:
use App\Entity\User;


text:
Q: Reddit json api behaves differently when access it through a browser and nodejs request I'm trying to access secure_media property of a post to download a v.redd.it media.
For example: when I try to access this link from a browser, the secure_media property is not empty in the response, but when i GET it through nodejs request the secure_media is empty

A: The issue here is that you are dealing with a crosspost submission, not the actual submission itself, which work a bit differently from normal submissions.
You can get the video information from the secure_media property of the first item in the crosspost_parent_list property. Here is part of the JSON structure for the post you linked:
[
  {
    "kind": "Listing",
    "data": {
      "modhash": "yg3o3tzdc136d53e2919218e00ef74e8fc38d97b9a22f34b60",
      "dist": 1,
      "children": [
        {
          "kind": "t3",
          "data": {
            "secure_media": null,
            "is_reddit_media_domain": true,
            "is_meta": false,
            "category": null,
            "num_comments": 9,
            "secure_media_embed": {},
            "crosspost_parent_list": [
              {
                "secure_media": {
                  "reddit_video": {
                    "fallback_url": "https://v.redd.it/kh2kirut06731/DASH_1080?source=fallback",
                    "height": 1080,
                    "width": 608,
                    "scrubber_media_url": "https://v.redd.it/kh2kirut06731/DASH_96",
                    "dash_url": "https://v.redd.it/kh2kirut06731/DASHPlaylist.mpd",
                    "duration": 53,
                    "hls_url": "https://v.redd.it/kh2kirut06731/HLSPlaylist.m3u8",
                    "is_gif": true,
                    "transcoding_status": "completed"
                  }
                },
                "is_reddit_media_domain": true,
                "discussion_type": null,
                "mod_reports": [],
                "is_video": true
              }
            ],
            "created": 1561824841,
            "link_flair_type": "text",
            "wls": 6,
            "banned_by": null,


text:
Q: CSS Styles not being picked up with class defined as parent I have some CSS styles defined in a style sheet that are not being picked up on the page.
The page renders a telerik component which uses these styles.  However, the table that wraps around the page, I applied a "telerikEditor" class to.
If I remove "telerkEditor" from the style sheet everywhere then it works, but it doesn't work as it is shown below.
I am confused as I thought I could narrow down the styles to anything within a telerikEditor class as the parent and it would apply these styles to it's children.
Am I doing this wrong?
telerikEditor .t-icon { background-image: url('Default/sprite.png'); }
telerikEditor .t-editor .t-tool-icon { background-image: url('Default/editor.png'); }

telerikEditor .t-loading,
telerikEditor .t-widget .t-loading { background: transparent url('Default/loading.gif') no-repeat 0 0; }

telerikEditor .t-widget,
telerikEditor .t-link:link,
telerikEditor .t-link:active,
telerikEditor .t-link:visited,
telerikEditor .t-popup
{
    color: #000;
}

A: telerikEditor is a css class? If so then put a dot as first char.
Eg
    .telerikEditor .t-icon { background-image: url('Default/sprite.png'); }


text:
Q: Possible (literal) meanings of "get high/get by" There's a single "High By the Beach", recently issued by Lana Del Rey, which has the following chorus:
All I wanna do is get high by the beach,
Get high by the beach, get high.
All I wanna do is get by by the beach,
Get by – baby, baby, bye, bye.

The question is: what other meanings/synonyms of the idiom "to get high" [besides the obvious "to get euphoric (by smoking weed)"] are possible here in the context of the lyrics/music video: https://youtu.be/QnxpHIl5Ynw? May it be interpreted literally as simply "to get high enough somewhere over a beach far from the rest of the world"? Does the meaning change through repetition? And the same goes for "get by" phrasal verb, first followed by "by the beach" and then used on its own. What meanings may it have here? Very much looks like a play on words, doesn't it?

A: Interpreting song lyrics and poetry can by tricky, since it's hard to say what the writer meant in a particularly poetic passage.
However, this is not such a case. I'm 99% sure Lana Del Rey literally means that all she wants to do was get high (become intoxicated on some drug of her choice) in the vicinity of a sandy ocean vista.
This is not high poetry.
To expand on the idea a little more, "to get high" generally means to enter a state of intoxication or euphoria, usually but not always by means of a psychoactive drug. Sometimes people say they are "high on life", or "high on your love." I have also heard people talk about getting a "high" from working out or playing competitive sports.
It isn't usually used in the sense of "ascend in altitude", although you could say something like "I want to get high in the sky in an airplane." Some people might still think you're implying you want to get high on drugs, though.
The line "Get by, by the beach" could mean she wants to "get by" - which in my opinion, in this context means to manage or cope despite hardship - near the beach. It could also be a simple repetition of the word to fill out the meter, meaning just "get by the beach."


text:
Q: How to draw a circle and line on Google Map pixel-based? Is it possible to draw circles and polylines on Google maps based on pixel dimensions? Allow me to explain...
I have a marker on a map. Next, I want to draw a circle around it, with the marker being the exact center. I'd like the circle to have a fixed pixel-based radius. However, as the Google Maps API takes distance in meters to base the radius on, the size of the circle varies based on the zoom level, which is what I do not want.
Another example is an angled Polyline. I'm drawing such a line from the marker into a certain direction. Again the distance is based on meters, not pixels, thus the zoom shrinks or grows the size of the line. Another unwanted side effect is that due the sperical projection of the map (if I understand this correctly), a line angled at 90 degrees, will not draw it precisely at east.
What I'm looking for is the convenience of these drawing objects on the map, without tying them to map dimensions, just to hard pixels. Is such a thing possible, or does it mean I need to start from scratch with a custom div and some kind of SVG library?

A: It's easier than you might think, use Symbols.
For a circle there is a predefined path:
new google.maps.Marker({
    position: centerLatLngOfTheCircle,
    icon: {
        path: google.maps.SymbolPath.CIRCLE,
        scale: yourDesiredRadius,
        strokeWeight: 1,
    },
    map: map
});

For a polyline you must assign a custom path:
line = new google.maps.Marker({
    position: startLatLngOfTheLine,
    icon: {
        path: ['M0 0 ',
               (Math.cos(Math.PI * angle / 180)),
               (Math.sin(Math.PI * angle / 180))].join(' '),
        scale: desiredStrokeLength,
        strokeWeight: 1
    },
    map: map
});

(the angle is counted clockwise, starting at 3:00)
Demo: http://jsfiddle.net/doktormolle/y8S8e/


text:
Q: Is there a good way to use Slf4j to log certain event to a separate log file? I am using Slf4j for logging in my Java service, but for certain type of events, I want to create a separate log file for it.
Is it possible to use Slf4j to implement that?

A: Slf4j is just an abstraction that helps you interface with various logging frameworks - you will need to select a logging framework too.
Below is an example with logback - but if you prefer other frameworks (JUL, log4j2), the same concept works with those as well.
What you need to do is to log your special events under a specific logger:
Logger logger = LoggerFactory.getLogger("my.special.events");
logger.info("Oh my! Something has happened!");

Then set up logback (or the framework of your choice) to send the events coming via this logger to another destination (another appender) too:
<configuration>
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%msg%n</pattern>
    </encoder>
  </appender>

  <appender name="SPECIAL" class="ch.qos.logback.core.FileAppender">
    <file>specialEvents.log</file>
    <encoder>
      <pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
    </encoder>
  </appender>

  <logger name="my.special.events">
    <appender-ref ref="SPECIAL" />
  </logger>

  <root level="debug">
    <appender-ref ref="STDOUT" />
  </root>
</configuration>

This will send your special events to both STDOUT and to the separate file. If you only need these events in the file, set the additivity to false, as described in the docs.


text:
Q: Why is the e in the LHS equals to cos + isin in the RHS?
In the Method 1 and 2 how is the $e$ in the LHS equal to the RHS?
In the junior classes I was just given to learn that $cos(\frac{π}{2}±\theta)=\mp sin\theta$ but we never proved it.
I have no idea how the e got there in the first statement of the proof.
Can anyone prove the first statement of the proof of Method 1 and 2?
Any help would be appreciated.

A: $e^{ix}=\cos{x}+i\sin x$ is Euler's formula.
Also, $\cos\left(\dfrac\pi2\pm\theta\right)=\mp \sin\theta$ follows from the angle addition formula
$\cos\left(\dfrac\pi2\pm\theta\right)=\cos\left(\dfrac\pi2\right)\cos(\theta)\mp\sin\left(\dfrac\pi2\right)\sin(\theta)$.


text:
Q: Why does gmail connector trigger skips new incoming email In one of my Logic Apps I'm using gmail connector trigger "when a new email arrives", but it doesn't seem to be working.
I'm sending email that it should detect when the trigger is run, but the trigger history simply shows the trigger is skipping and therefor not firing the rest of the workflow.
How can I debug this issue?
The following code is the trigger section of the logic app:
"triggers": {
        "When_a_new_email_arrives": {
            "description": "",
            "inputs": {
                "host": {
                    "connection": {
                        "name": "@parameters('$connections')['gmail']['connectionId']"
                    }
                },
                "method": "get",
                "path": "/Mail/OnNewEmail",
                "queries": {
                    "fetchOnlyWithAttachments": false,
                    "from": "secret@secret.com",
                    "importance": "All",
                    "includeAttachments": false,
                    "label": "INBOX",
                    "starred": "All",
                    "subject": "something"
                }
            },
            "recurrence": {
                "frequency": "Day",
                "interval": 1,
                "startTime": "2019-08-17T08:40:00Z"
            },
            "type": "ApiConnection"
        }
    }

It setup to runs ones every day, although for testing purposes I'm running the trigger manually.
Update 1
I've tried sending the mail from my own mail adress after configuring the from-parameter in the trigger and that works as intented. So I think the issue might be due to something about the senders original mail message. I did some digging, and pulled out the original raw mail from gmail. It contains some logging information from gmail servers. Appearently something called DMARC authentication have failed. I wonder if this has anything do the problem that is arising, maybe the gmail connector will not accept the senders identity.
Here's the part about DMARC in the raw mail message:
Authentication-Results: mx.google.com;
       spf=pass (google.com: domain of source-company@company-product.com designates 85.236.67.1 as permitted sender) smtp.mailfrom=source-company@company-product.com;
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=source-company.com

Could this be the reason the connector does not detect these mails?

A: for this issue I did some test but I haven't met this issue. In my logic app, I set the "How often do you want to check for items?" box as 10 minutes. I didn't run the trigger manually(I didn't click the "Run" button). Then I sent an email to my gmail, and after about 10 minutes, when the trigger went to check my gmail, the logic app run the actions under the trigger successfully. Apart from this, if I sent two emails to my gmail in these ten minutes, the trigger will not be triggered twice, it will be triggered just once.

I saw you mentioned set once every day in your description. So for example, if you completed the configuration of the logic app at 1:00 pm, and your gmail received an email at 2:00 pm, it will not run the actions under the trigger at once. The trigger will check your gmail at 1:00 pm tomorrow, so the actions under the trigger will also run at 1:00 pm tomorrow. But when you test this logic app, if you run the logic app manually, when your gmail received an email, it will triggered at once.
I wonder if this explanation will be helpful to your issue ?


text:
Q: Is there a way to "turn off" a shared context inside a single blcok? I am using shared contexts to DRY my spec files.
However, I have one single context block where I would like to disable the shared context. Is this possible?
describe MyClass do
  include_context 'my shared context'

  describe '#some_method' do
    # Specs using the shared context...

    context 'with some special context' do
      # Turn off 'my shared context' here
      # ...
    end
  end
end

A: I think by slightly modifying how you include the context and using RSpec metadata, you should be able to get this working.
RSpec.shared_context "my shared context" do
  # code
end

# spec/support/shared_context_load.rb
RSpec.configure do |config|
  config.before do |example|
    unless example.metadata[:load_shared_context] == false
      config.include_context "my shared context"
    end
  end
end

describe MyClass do
  # NOTE the shared_contxet is removed from here

  describe '#some_method' do
    # Specs using the shared context...

    it "this spec using shared context"
       # code
    end

    context 'with some special context' do
      it "this spec is not using shared context", load_shared_context: false do
        # Turn off 'my shared context' here
        # ...
      end
    end
  end
end


text:
Q: C# MapCamera : Singleton выдает ошибку В Unity3d при создании класса "public class MapCamera : Singleton" выдает ошибку:
- The namespace '' already contains a definition for 'MapCamera'.
Что я делаю не так?

A: Эта ошибка говорит вам о том, что такой класс уже существует. Вы уверены, что не добавляли его в проект? Попробуйте поискать в папке по имени.
Если точнее, то в ошибке говориться, что именно в этом пространстве имён класс содержится. Пространство имён можно добавлять, если заключить класс в дополнительные скобки со спец словом, например вот так:
namespace Game
{
    public class MapCamera : Singleton
    {

    }
}

Подобная конструкция означает, что класс MapCamera находится в "пространстве имён Game". Это приведёт к тому, что "видеть" этот класс смогут только классы из того же пространства имен, либо те классы, у которых вверх будет присутствовать строка using Game; т.е. им будет дан доступ к конкретному пространству имён.
Классы с одинаковыми именами могут существовать одновременно, если они находятся в разных пространствах имён. Но лучше так не делать, чтобы не запутаться)


text: Q: Can I modify the Mac's default "next word" delineator to include an underscore? For example, if I hold the option key and press the left arrow, the cursor jumps to the next space or special character. I use this a lot when naming files, for example, "description-date.ext". If I need to modify the date, I just hold down option+shift, press the left arrow, and type to replace "date". But if I name the file "description_date.ext" it doesn't count the underscore as a separator like the hyphen. Does anyone know how I can make it treat the underscore like the hyphen?


text:
Q: Place a JButton as Image at dedicated location I am trying to place my JButton which has Image form to a desired place on my JFrame but when I define method setBounds for this particular button it is not working as expected and button is still on the same place. Code below:
public
    class GameFrame {

    JButton atB = new JButton();
    JButton beB = new JButton();
    JButton bgB = new JButton();
    JButton czB = new JButton();
    JButton deB = new JButton();
    JButton dkB = new JButton();
    JButton esB = new JButton();
    JButton plB = new JButton();
    JButton roB = new JButton();
    JButton ruB = new JButton();

    public GameFrame(){
        generateGameFrame();
    }

    public void generateGameFrame() {

        JPanel gamePanel;
        Countries countries = new Countries();
        JFrame gameFrame = new JFrame("Koronawirus AntiPlague - Game");
        try {
            gameFrame.setIconImage(ImageIO.read(GameFrame.class.getResourceAsStream("/resources/images/Icon.png")));
        } catch (IOException ex) {
            ex.printStackTrace();
        }

        gamePanel = new JPanel() {
            public void paintComponent(Graphics g) {
                Image img = Toolkit.getDefaultToolkit().getImage(
                        MenuFrame.class.getResource("/resources/images/map.png"));
                g.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this);
            }
        };
        gameFrame.setContentPane(gamePanel);

        gameFrame.setSize(700, 700);
        gameFrame.setVisible(true);
        gameFrame.setResizable(false);
        gameFrame.setLocationRelativeTo(null);
        gameFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        loadImageAsButtonAndDesign();
        gamePanel.add(atB);

    }

    public void loadImageAsButtonAndDesign()
    {
        try {
            Image img = ImageIO.read(getClass().getResource("/resources/images/at.png"));
            atB.setIcon(new ImageIcon(img));
        } catch (Exception ex) {
            System.out.println(ex);
        }
        atB.setBorderPainted(false);
        atB.setOpaque(false);
        atB.setBackground(Color.DARK_GRAY.darker());
        atB.setBounds(100,100,20,15);
    }
}

As you can see above I am trying setBounds but unsuccessfully. I was trying also:
atB.setLayout(null);


text:
Q: Send commands to subprocess.Popen() process I need to pass commands to a process on subprocess.Popen() but when I do, it only works if I use stdin.close() afterwards. My code is below.
sprocess.stdin.write('/stop'.encode())
sprocess.stdin.flush()
sprocess.stdin.close()
sprocess.stdout.close()

Works, but that is because of stdin.close() and I need to be able to do this without closing the pipes.
How can I pass commands to the process without closing the pipes after?

A: Note that sprocess.stdin.write('/stop'.encode()) will not add a newline! Your subprocess is probably expecting a line of input, signified by either a newline or EOF. Closing stdin will send that EOF.
Try sending sprocess.stdin.write('/stop\n'.encode()) instead.


text:
Q: Is it bad if the train score is much higher thanthe test score? I'm doing a binary classification problem and using accuracy as my metric (I know that's not always advisable but, for now, it makes sense here). I trained a random forest classifier with grid search on the training set and then took the model with the best parameters and applied it to the test data.
The results I got are:

*

*Training data: accuracy is 93.28%

*Testing data: 82.44%

I know that this means that, on further unseen data, I should expect an accuracy of about 82.44% (under assumptions relating to the data coming from the same sample). My question is this: is it bad that the model is so over-fit? Is this something I should try to avoid? Or, if I'm happy with an 82% accuracy, can I just accept this?


text:
Q: How to update an instance without one of the params from the instance_params? I have a user_controller with an update method. Depending on where the user comes from, I sometimes have to pass the edit form for the user an extra param (:tournament) that actually don't update the user instance but helps me to redirect the user to the right page at the end of the update action.
Here's my update method :
  def update
    authorize @user
    if @user.subscriptions.exists? && !@user.judge? && user_params[:birthdate].present?
      flash[:alert] = "Vous ne pouvez plus modifier votre date de naissance après vous etre inscrit à une compétition. Merci de contacter l'administrateur du site"
      redirect_to user_path(current_user)
    elsif @user.update(user_params)
      if @user.judge? && @user.profile_complete? && !@user.accepted
        UserMailer.judge_waiting_for_confirmation(@user).deliver
        redirect_to user_path(current_user)
      else
        redirect_to user_path(current_user)
      end
    else
      render 'edit'
    end
  end

Problem is in the elsif when I try to update my user with user_params, it throws me an error unknown attribute 'tournament' for User.
My user params looks like that :
  def user_params
    params.require(:user).permit(
      :extradoc,
      :address,
      :birthdate,
      :certifmedpicture,
      :club,
      :email,
      :first_name,
      :genre,
      :judge_number,
      :last_name,
      :licence_number,
      :licencepicture,
      :login_aei,
      :name,
      :password_aei,
      :picture,
      :ranking,
      :telephone,
      :sms_forfait,
      :sms_quantity,
      :tournament
    )
  end

How can I update my user without the :tournament param while at the same time permitting it so I can use it to redirect my user to the right place at the end of the action ?

A: You need to create attr_accessor for tournament attribute to achieve this.
So go into your user model and create attr_accessor for tournament like below :
attr_accessor :tournament

Now you can set tournament value in your form. Remove tournament from user_params.
You can get value in params[:user][:tournament] check and redirect. Also your object will update properly.


text:
Q: cakephp: how to add language folder to url? I am having a project in 5 languages and I am switching languages by p28n Controller which works perfect! But now, the SEO guys want to have the urls like:
www.projekt.com/en for english
www.projekt.com/es for spanish
www.projekt.com/fr for french

I am a little bit lost now and don't know who to achieve this?
I this a question for the htaccess file?
Or do I have to deal with it in Cake?
Please help me out where to start!

A: This plugin should help you get the urls like you need.


text:
Q: how to schedule ge task queue to run only once Does anyone know how to schedule a Task queue in python for GAE, such that the task runs only once? I thought about using a cron, but a google search didn't turn up any configuration for running only once. I did however find
this post. Does anyone know how I can accomplish this in python for GAE.
Thanks.

A: Use task_retry_limit.
taskqueue.Task(
        url='/process/url,
        params={'varname': 'value'},
        method='POST',
        retry_options=taskqueue.TaskRetryOptions(task_retry_limit=1)).add()


text:
Q: Unhandled exception in jquery-ui-1.10.0.js. 0x800a138f - Microsoft JScript runtime error: Object expected I am developing my ASP-MVC application in ie9, and when I load the first login page I get this error;

Unhandled exception at line 6953, column 7 in
  .../Scripts/jquery-ui-1.10.0.js
0x800a138f - Microsoft JScript runtime error: Object expected

I look inside the JQuery-ui-1.10.0.js file and I find this code;
_search: function( value ) {
        this.pending++;
        this.element.addClass( "ui-autocomplete-loading" );
        this.cancelSearch = false;

            this.source( { term: value }, this._response() );
    },

I find that reason this happens is because;
this.source is set to null.

But I haven't been able to find out why this is and how to fix it.
I have tried to locate where this.source is set.
I found this code in jquery-ui;
_initSource: function() {
        var array, url,
            that = this;
        if ( $.isArray(this.options.source) ) {
            array = this.options.source;
            this.source = function( request, response ) {
                response( $.ui.autocomplete.filter( array, request.term ) );
            };
        } else if ( typeof this.options.source === "string" ) {
            url = this.options.source;
            this.source = function( request, response ) {
                if ( that.xhr ) {
                    that.xhr.abort();
                }
                that.xhr = $.ajax({
                    url: url,
                    data: request,
                    dataType: "json",
                    success: function( data ) {
                        response( data );
                    },
                    error: function() {
                        response( [] );
                    }
                });
            };
        } else {
            **this.source = this.options.source;**
        }

I have highlighted the code that is executed (ie the 3rd branch) and where this.source is set to null.
I have not been able to trace back any further than that.
My View Source is;
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>SCD</title>
    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    <link rel="SHORTCUT ICON" href="/favicon.ico" />

    <link href="/dataTables/css/AutoFill.css" rel="stylesheet"/>
<link href="/dataTables/css/demo_page.css" rel="stylesheet"/>
<link href="/dataTables/css/demo_table.css" rel="stylesheet"/>
<link href="/dataTables/css/demo_table_jui.css" rel="stylesheet"/>
<link href="/dataTables/css/jquery.dataTables.css" rel="stylesheet"/>
<link href="/dataTables/css/jquery.dataTables_themeroller.css" rel="stylesheet"/>
<link href="/dataTables/css/TableTools.css" rel="stylesheet"/>
<link href="/dataTables/css/TableTools_JUI.css" rel="stylesheet"/>

    <link href="/Content/superfish.css" rel="stylesheet"/>
<link href="/Content/superfish-navbar.css" rel="stylesheet"/>

    <link href="/Content/themes/sunny/jquery-ui.css" rel="stylesheet"/>
<link href="/Content/themes/sunny/jquery.ui.theme.css" rel="stylesheet"/>

    <link href="/Content/demos.css" rel="stylesheet"/>

    <link href="/Content/jquery.mobile-1.2.0.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile.structure-1.2.0.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile.theme-1.2.0.css" rel="stylesheet"/>

    <link href="/Content/PagedList.css" rel="stylesheet"/>

    <link href="/Content/css/bootstrap.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap-responsive.css" rel="stylesheet"/>

    <link href="/Content/Site.css" rel="stylesheet"/>

    <link href="/Content/jquery.jqGrid/ui.jqgrid.css" rel="stylesheet"/>

<hgroup class="title">

Log in.

</hgroup>

<form action="/" method="post"><input name="__RequestVerificationToken" type="hidden" value="I-FFb6bdAvkOOiAvXXU3kBC2f8ovY_xH2Y0tG4craWHUa6oVcHH-V6zi2kJy4luADvcRN6e_EC9vyIA8QnIWSnocZqnRFV79uVl_3s_BndjE_3R2P0MFJMpsLfA0yte4_N4hyNXQj3livH-2fNZGmKnZGQscE-Qj6GbSIRivn6A1" />

            <fieldset>
                <legend>Account Information</legend>

                    User name

                    <input data-val="true" data-val-required="The User name field is required." id="UserName" name="UserName" type="text" value="geoffreypayne" />

                    Password

                    <input data-val="true" data-val-required="The Password field is required." id="Password" name="Password" type="password" />

                    <input data-val="true" data-val-required="The Remember me? field is required." id="RememberMe" name="RememberMe" type="checkbox" value="true" /><input name="RememberMe" type="hidden" value="false" />
                    Remember me?

                    <input type="submit" class="btnSubmit" value="Log On" />

            </fieldset>

</form>

A: With the current informations, I think the problem is that the autocomplete is attached to every input tag, and not for all there is a source option defined.
A possibile solution is to add a specific class to the fields that will host autocomplete fieldAutocomplete then use a more restrictive selector to attach autocomplete only to elements that have that class.
Like:
$( "input.fieldAutocomplete" ).autocomplete({
});


text:
Q: Coefficients and Parameters for contracted Gaussian basis sets This is a repost from Chemistry.stackexchange in the hopes that someone here will be able to help me. Any help at all would be greatly appreciated.
As far as I understand, an STO-NG contracted Gaussian basis function has the following form:
$$\phi_{\mu}^{CGF}(\vec{r}) = \sum_{p=1}^{N} d_{p\mu} (x-X_A)^{i_{p\mu}} (y-Y_A)^{j_{p\mu}} (z-Z_A)^{k_{p\mu}} e^{-\alpha_{p\mu}\zeta^{2}|\vec{r}-\vec{R_{A}}|}$$
where the contraction coefficients, $d_{k\mu}$ and exponents, $\alpha_{k\mu}$ are chosen such that $\phi_{\mu}$ provides the 'best fit' to a Slater-type orbital having stater-exponent $\zeta$, $\vec{R_{A}}=(X_A,Y_A,Z_A)$ is a fixed reference centre (usually a nucleus) and $l_{p\mu} = i_{p\mu} + j_{p\mu} + k_{p\mu}$ defines the angular momentum of the primitive Gaussian function:
$$g_{p\mu} = (x-X_A)^{i_{p\mu}} (y-Y_A)^{j_{p\mu}} (z-Z_A)^{k_{p\mu}} e^{-\alpha_{p\mu}\zeta^{2}|\vec{r}-\vec{R_{A}}|}$$.
I'm having problems interpreting data files documenting contraction coefficients and exponents for various basis sets.
For example, please consider the following snippet from the Gaussian 94 STO-3G basis set file documenting contraction parameters for Carbon:
****
C     0
S   3   1.00
     71.6168370              0.15432897
     13.0450960              0.53532814
      3.5305122              0.44463454
SP   3   1.00
      2.9412494             -0.09996723             0.15591627
      0.6834831              0.39951283             0.60768372
      0.2222899              0.70011547             0.39195739
****

I have read in various places that there are enough coefficients here to describe 5 contracted functions, but I see only enough for 3 maximum (if the exponents are the same, but the coefficients change between 2S and 2P). I'd be eternally grateful if someone could explain for me, precisely how one would determine the following information from such a basis set data file:
1) Which EXACT basis functions appear within each contracted function?
2) How many contracted Gaussian basis functions there are?
If possible, would you be able to do the same for the following snippet, again for Carbon, Gaussian 94, but this time for the more complicated 6-31++G** basis set?:
****
C     0
S   6   1.00
   3047.5249000              0.0018347
    457.3695100              0.0140373
    103.9486900              0.0688426
     29.2101550              0.2321844
      9.2866630              0.4679413
      3.1639270              0.3623120
SP   3   1.00
      7.8682724             -0.1193324              0.0689991
      1.8812885             -0.1608542              0.3164240
      0.5442493              1.1434564              0.7443083
SP   1   1.00
      0.1687144              1.0000000              1.0000000
SP   1   1.00
      0.0438000              1.0000000              1.0000000
D   1   1.00
      0.8000000              1.0000000
****

Thank-you for reading.


text:
Q: How to parse '' as 0, otherwise parse decimal in TSQL? I'm inserting a record into a TSQL table which contains a value that could either be a decimal value or an empty string.  How can I parse the empty string as 0, otherwise a decimal?
Sadly, the application I'm interfacing with will not allow a "CASE WHEN" statement.
I've tried:
SELECT CONVERT(decimal(15,2),'')
SELECT CAST('' as decimal(15,2))
SELECT CAST(COALESCE('',0.00) as decimal(15,2))

Each gives:
Error converting data type varchar to numeric.

A: select case when your_column = ''
            then 0
            else your_column
       end as your_column
from your_table


text:
Q: Rails 4, Rspec, FactoryGirl I am having trouble having an id column in a database that is not rails automagic. Basically the situation is the users table has to be between 5000 and 7000 and there are other external stipulations that don't allow this to auto-increment Here is the migration (which works magically in the console):
class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users, id: false do |t|
      t.integer :id, null: false
      t.string :firstname, null: false
      t.string :lastname, null: false
      t.string :username, null: false
      t.boolean :active, null: false, default: true
      t.date :hiredate, null: false
      t.date :termdate

      t.timestamps
    end

    add_index :users, [:id], :unique => true

    execute "ALTER TABLE users ADD PRIMARY KEY (id);"
  end
end

The problem I'm having is with testing in order to create a user with the factory I have to have a begin rescue block. The first time it fails and the second time it works perfectly. I have no idea why this happens. Here is the first part of users_spec.rb:
describe User do
    before(:all)do
        begin
            @user = FactoryGirl.create(:user)
        rescue
            @user = FactoryGirl.create(:user)
        end
    end
end

I'm contemplating just having the id column perform as it should in a rails app and making a new extensions column, but I would appreciate someone helping me with this issue. Thank you for the help!


text:
Q: PA subsets consistency IF i have T  in piano arithmetic and suppose I add a new symbol c
suppose it is T1
T1=T U {c>1,c>1+1,c>1+1+1.......}
Is it true that every finite subset of T1 is consistent  and can we show that a structure M |= T1
I have read in a notes that it is by soundness we can confirm that it is consistent
From my googling I understand that if aal the subsets are consistent then T1 is consistent , how can I show that all the subsets of T1 are consistent and the existence of the structure

A: For any finite subset of the axioms there is one with the most $1$s on the right. Any model of PA will then satisfy PA plus a finite number of these axioms by taking $c$ larger than this number. This shows that every finite subset of $T1$ has a model (assuming PA has a model) and is therefore consistent. The compactness theorem then promises that the whole set of axioms is consistent and has a model, but the usual model of PA doesn't work, so there must be a model that satisfies PA but is not the usual model.


text:
Q: Trouble implementing android_serialport_api into my own application I am currently working on an embedded system for my company that runs the android 4.2 OS (from TI bbb source) on the Beaglebone black. I have been tasked with setting up communication with the serial port (UART). I have been able to configure the serial port and run the android_serial_port_api (https://code.google.com/p/android-serialport-api/) sample application flawlessly. Where I am having trouble is when I try to write my own application using this API. I do not quite understand the idea of using an API (especially a third party one). I am using Android Studio to develop and have copied all of the source code from the sample application and am now attempting to alter it to my own needs. I know this is most likely a stupid question, but my research on how to fix it is running me in circles. Any and all help is more than welcome.
edit: tried to include image, but have too low a rep...

A: Create a new Module using the third party library and include in your project. Now you can start importing the classes directly from the third party library. Android studio has options to create a new module from the current project.


text:
Q: Will VMware Server make my virtual machines use less RAM? I have many virtual machines on my system (6 at the moment) and many times 2 of them are running in the same time. I have 6GB of RAM but most of time it's on 90% of usage because of the running virtual machines. All virtual OSs are Win7.
I heard that installing VMware Server and logging onto the virtual machines via remote desktop would make them use less RAM.
Is this true? If not, is there any virtual server which will make my virtual machines use less RAM?
Maybe I should change OS on the virtual machines?! I use them for .NET development and for Photoshop editing.
PS. I know I can reduce virtual machine's RAM in the setting, but it's already set down to 1GB per machine which is the minimum for the normal work.

A: VMWare Server, Virtual PC, and VMWare workstation are Type 2 Hypervisors and run on top of the OS.  To the best of my knowledge, No type 2 hypervisor supports memory overcommit technologies.
Hyper-V and VMWare ESXi are type 1 Hypervisors and (in the case of Hyper-V 2008 R2 with Service Pack 1) both support memory overcommit capabilities.  VMWare, I BELIEVE, supports it on most if not all Windows operating systems.  Hyper-V only supports it with Windows 7 (Enterprise and Ultimate (and I think Pro)), Server 2008, 2008 R2, and 2003 R2, and Vista (Enterprise and Ultimate (and I think Business))
The problem with a Type 1 hypervisor is that it's a bare-metal hypervisor - that means, in a simplistic description, it IS your operating system.  If you were to use EITHER you wouldn't be able to work directly on your computer.  Both require a separate physical server to effectively provide their services.  Server 2008 R2 includes the Hyper-V Role and you COULD run that as your workstation OS and enable Hyper-V there - the base install becomes a guest OS with direct hardware access when the Hyper-V role is enabled.
Otherwise, wait for Windows 8 (or use the Developer preview).  It will include (does include in the preview) Hyper-V on the workstation OS.
OR, upgrade your RAM.  RAM is CHEAP.  16 GB of DDR3 for a desktop can be as little as $80.


text:
Q: In Ruby, on osx, how can I change the prompt from within a ruby script? In Ruby, on osx, how can I change the prompt from within a ruby script?
For example,
I'd like a ruby script to run some code and depending on the result, do PS1='\w$ '. or PS1='\t$ '
i.e.
~ $PS1='\w $'
~ $

~ $PS1='\t $'
20:52:23 $

So as a start I've just tried a script to change the prompt
~/$ cat scripttochangeprompt.rb
`export PS1='\t$ '`
~/$

but it doesn't change the prompt.
~/$ ruby ./scripttochangeprompt.rb
~/$

I can guess that it's creating a new console session to run the command then closing that new console session. But how can I get it to run it in this console session?

A: Ruby will always run in a subprocess. A subprocess cannot change the environment of a parent process. However, it can output things in a format that is convenient for parent process to evaluate. This is how e.g. ssh-agent sets its environment variables.
#!/usr/bin/env ruby
puts "export PS1='\t$ '"

Then execute it like this:
eval `changeprompt.rb`

A: There are several ways to work with shell command execution and you use the one that executes the command in the current ruby process and returns its result to your script. With such an approach this proccess cannot mutate a shell it was called from, so it is unfitting. Other ways of interaction with the shell also use child processes or current ruby process one way or another. Unfortunately, in most OS you cannot set an environment variable of parent process(namely, shell) from child process(namely, your ruby script). Here are stackoverflow issue and an article on that matter. There are some hacks in the issue provided that can satisfy you in practice, but they seem obscure and awkward to me.


text:
Q: How does experience work in Dungeon Defenders? While playing Dungeon Defenders with friends, some of them aren't gaining as much experience as others.  We started to worry Squires were kill stealing the Apprentices.  But in the end we couldn't figure out how exactly our characters gain experience.
So how do you gain experience:
Is it by damage dealt?
Is more last hit style?
How does this apply to defense structures?

A: For the PC version of the game, experience is shared for all kills. So all kills will give all players the same amount of XP, regardless of who killed them.
The Experience page on the wikia supports this:

On the PC version, experience from killing creatures is shared among the entire party.


text:
Q: Make image double height of sibling (hard to topic) I'm struggling to make the large image on the right be in line visually with the other items when the screen scales.
Flexbox or grid can be used if they make this possible I just wasn't sure how to achieve this using those tools.
Thanks

Folding Beds

 Discover
More

https://codepen.io/qwerty-design/pen/PQVzaL?editors=1100

A: It can be achieved in many ways one of them is to use CSS grid. You can find a good guide here and here

To make an HTML element behave as a grid container, you have to set the display property to grid or inline-grid. Grid containers consist of grid items, placed inside columns and rows.

.grid-container {
  /*Must set display to grid or inline-grid*/
  display: grid;

  /*Define number of columns and column width*/
  /*Here we define 3 columns each of which is 33% of its parent width*/
  /*You can set each column with different width e.g.(100px, 200px, 50px)*/
  grid-template-columns: repeat(3, 33%);

   /*Define number of rows and row height*/
  /*Here we define 2 rows each of which is 100px*/
  grid-template-rows: repeat(2, 100px);

  /*Spaces between columns*/
  grid-column-gap: 10px;

  /*Spaces between rows*/
  grid-row-gap: 10px
}
/*Just for demo*/
.item-1,
.item-2,
.item-3,
.item-4,
.item-5 {
  background-color: #333;
  color: #fff
}
/*For each item, select its position you can think of it as a table and point to each cell with (row,col)*/
.item-1 {
  grid-column-start: 1;
  grid-column-end: 2;
  grid-row-start: 1;
  grid-row-end: 2;
}

.item-2 {
  grid-column-start: 1;
  grid-column-end: 2;
  grid-row-start: 2;
  grid-row-end: 3;
}

.item-3 {
  grid-column-start: 3;
  grid-column-end: 4;
  grid-row-start: 1;
  grid-row-end: 3;
}

.item-4 {
  grid-column-start: 2;
  grid-column-end: 3;
  grid-row-start: 1;
  grid-row-end: 2;
}

.item-5 {
  grid-column-start: 2;
  grid-column-end: 3;
  grid-row-start: 2;
  grid-row-end: 3;
}

1

2

3

4

5


text:
Q: Eigenfunctions of the Laplacian on an arbitrary mesh So, I've constructed a mesh over which I'd like to find eigenfunctions of Laplace's equation with a free boundary (a zero Neumann boundary condition along the edge).

Mostly because I figured an electric guitar–shaped Chladni plate would look really cool (but also because I'd like to try to find the resonant frequencies of a lamina this shape).
Normally, to do this sort of eigenvalue problem, I'd do something like this:
ParametricNDSolve[
  {Laplacian[phi[x, y], {x, y}] == -w^2*phi[x, y]},
  {x, y} ∈ mesh,
  w
]

with some boundary conditions in there.
However, while I feel like I understand (well enough) the theory behind what I want to accomplish (at the very least, I can derive the eigenfunctions in coordinate systems where Laplace's equation is solvable by separation of variables), I don't quite know how to go about implementing it in this case.
How do I impose a free boundary for an arbitrary mesh?
This is relatively easy on a rectangle or circle, but on this mesh, I think would have to somehow determine the vector normal to the mesh boundary at each point (so that I can specify $\mathbf{n}\cdot\nabla \phi = 0$). Furthermore, once I've specified the Neumann boundary condition, are there any other boundary conditions I have to keep in mind (I imagine that if I only specify a zero derivative on the edge, NDSolve will give me a constant solution)? Thank you so much in advance for your help, and I promise to post cool plots of irregularly-shaped guitar Chladni plates when I'm done.
Edit: Alright, I guess the question I was asking wasn't the question I should have been asking. To boil it down, we don't really have to worry about the Neumann boundary condition in this case, as it's zero by default. However, Mathematica doesn't actually have built-in eigenvalue analysis for these sorts of problems (thus the necessity of using some low-level code, as utilized to great effect by user21 here).

A: As promised:

And here are the nodes:

Now to outline the process. [This first part has no Mathematica.] First, I found an image of a guitar using Google's Image Search. I then went into GIMP (although you can use any image editing software, or even draw the image yourself) and used it as a template to create a silhouette (it's okay if the edges are a little rough).  Then, I created a parametric plot using this technique.
img = Binarize[Import["/home/michael/Downloads/test.jpg"]~ColorConvert~"Grayscale"~ImageResize~500~Blur~3]~Blur~3;
lines = Cases[Normal@ListContourPlot[Reverse@ImageData[img], Contours -> {0.5}], _Line, -1];

param[x_, m_, t_] := Module[{f, n = Length[x], nf},
  f = Chop[Fourier[x]][[;; Ceiling[Length[x]/2]]]; nf = Length[f];
  Total[Rationalize[2 Abs[f]/Sqrt[n] Sin[Pi/2 - Arg[f] + 2. Pi Range[0, nf - 1] t],.01][[;;Min[m, nf]]]]]

tocurve[Line[data_], m_, t_] := param[#, m, t] & /@ Transpose[data]

parplot = ParametricPlot[Evaluate[tocurve[#, 40, t] & /@ lines], {t, 0, 0.998},
 Frame -> True, Axes -> False, PlotPoints -> 3] /.
 Line[l_List] :> {{Blue, Polygon[l]}, {White, Line[l]}}

I recommend setting PlotPoints to something very low in order to decrease the need for mesh refinement near the edges of your lamina (although this will decrease the resolution of your boundary curve; I did not do this in my original question, which gave me a mesh that was far too complex near the edge). Also, closing the loop (letting t go to 1 in our plot bounds) was for some reason giving me a weird irregularity (jaggedness of the boundary) that was almost invisible but was causing the mesh to become extremely (and stubbornly) fine near that point.
Then, use DiscretizeGraphics[] and ToElementMesh[] to convert this polygon to an element mesh.
g = DiscretizeGraphics[parplot]

<<NDSolve`FEM`
mesh = ToElementMesh[g, MeshQualityGoal -> 0.8, MaxCellMeasure -> 30, "MeshOrder" -> 1]
mesh["Wireframe"]

Using the answer provided here by user21 (check out his answer for a better explanation of what each piece of this code does), we can then find the eigenfunctions of the Helmholtz differential equation (which is the eigenvalue equation for the Laplacian) over our lamina.
pde = D[u[t, x, y], t] - Laplacian[u[t, x, y], {x, y}] + u[t, x, y] == 0;
Γ = DirichletCondition[u[t, x, y] == 0, True];

nr = ToNumericalRegion[mesh];
{state} = NDSolve`ProcessEquations[{pde, Γ, u[0, x, y] == 0}, u, {t, 0, 1}, {x, y} ∈ nr];

femdata = state["FiniteElementData"]
initBCs = femdata["BoundaryConditionData"];
methodData = femdata["FEMMethodData"];
initCoeffs = femdata["PDECoefficientData"];

vd = methodData["VariableData"];
sd = NDSolve`SolutionData[{"Space" -> nr, "Time" -> 0.}];

discretePDE = DiscretizePDE[initCoeffs, methodData, sd];
discreteBCs = DiscretizeBoundaryConditions[initBCs, methodData, sd];

load = discretePDE["LoadVector"];
stiffness = discretePDE["StiffnessMatrix"];
damping = discretePDE["DampingMatrix"];

DeployBoundaryConditions[{load, stiffness, damping}, discreteBCs]

nDiri = First[Dimensions[discreteBCs["DirichletMatrix"]]];
numEigenToCompute = 10;
numEigen = numEigenToCompute + nDiri;

res = Eigensystem[{stiffness, damping}, -numEigen];
res = Reverse /@ res;
eigenValues = res[[1, nDiri + 1 ;; Abs[numEigen]]];
eigenVectors = res[[2, nDiri + 1 ;; Abs[numEigen]]];

evIF = ElementMeshInterpolation[{mesh}, #] & /@ eigenVectors;

The above plots can then be created with this:
densityplot[i_] := DensityPlot[Evaluate[evIF[[i]][x, y]], {x, y} \[Element] mesh,
  PlotPoints -> 256, PlotRange -> All, ColorFunction -> "TemperatureMap", PlotLabel -> i]
nodeplot[i_] := ContourPlot[Evaluate[evIF[[i]][x, y]] == 0, {x, y} \[Element] mesh, PlotPoints -> 256, PlotRange -> All, PlotLabel -> i]

Show[GraphicsGrid[Table[{densityplot[2i-1], densityplot[2i]}, {i, 1, 5}]], ImageSize -> Full]
Show[GraphicsGrid[Table[{nodeplot[2i-1], densityplot[2i]}, {i, 1, 5}]], ImageSize -> Full]

Thanks so much to user21 for his brilliant code.


text:
Q: rdd.saveAsTextFile("path"), it return without error but unable to find the output file I am executing below statement:
item_final_view_cassandra_df.
  map({case Row(item_id: Long, account_id: Long, ssin_id: String,
                gu_id: String, modified_id: Long ) =>
    (item_id, account_id, ssin_id, gu_id, modified_id)})
    .rdd.saveAsTextFile("/home/cassandra_data/cassnadra_" +
    epoch.toString());

It returns no error, but no output file is created either. All I can see is _SUCCESS created under this path.


text:
Q: How to group 'like' with Codeigniter active records? I'm building a search form with multiple options. The idea is to look for people with certain characteristics like career, name of last company job, years of experience, etc.
In the first part of the form you can enter a career you would like candidate to have, on second part you can enter one or more companies name. What I want is my query to look something like this:
SELECT *
FROM work_experience
WHERE position = 'some position'
AND (company LIKE 'company 1' OR company LIKE 'company 2', etc)

Problem is I don't know hoy many company names the user might enter, what I do is store every name in an array which I don't know how big it may be.
I tried using or_like() active record, but the problem was that it looked for people with 'positionx' OR people working at 'company x' which is not the result I want.
Is there a way to make this query using active records? Or even how can I make the query in simple SQL if I don't know the exact number of company names I'm searching for.
Thank you for your time and help, if something was not clear please let me know.

A: Try using this sequence
Controller Code
$getcompanyList=$this->input->post('company'); //post variable company from view
$data['companyList']=explode(',', $getcompanyList);
//Query for model
$getResult=$this->myModel->somefunction($data);

Model Code
function somefunction($data){
$this->db->select('*');
$this->db->where('position','some position');
$this->db->where_in('company',$data['companyList']);
//or $this->db->or_where_in('company',$data['companyList']);
$getResult=$this->db->get('work_experience');
}

Now if you doesn't get the desired result then just print the last query using $this->db->last_query() or do profiling of your application and check what sql is being generated.

A: This is how it should be -
View:
<form action="/career/search/" method="POST">
      Position: <input type="text" name="position" />
      Company1: <input type="text" name="company[]" />
      Company2: <input type="text" name="company[]" />
      Company3: <input type="text" name="company[]" />
      ...
      ...
      CompanyN: <input type="text" name="company[]" />
</form>

Controller:
class Career extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
    }

    public function search()
    {
       $this->career_model->search_career($this->input->post());
    }
}

(A) Model (using where_in):
class Career_model extends CI_Model
{
    public function __construct()
    {
        parent::__construct();
    }

    public function search_career($data)
    {
        $this->db->select('*');
        $this->db->where('position', $data['position']);
        $this->db->where_in('company', $data['company']);
        $query = $this->db->get('work_experience');

        echo "<pre>"; print_r($query->result());   // Result
    }
}

(B) Model (using or_like):
class Career_model extends CI_Model
{
    public function __construct()
    {
        parent::__construct();
    }

    public function search_career($data)
    {
        $this->db->select('*');
        $this->db->where('position', $data['position']);

        foreach($data['company'] as $company)
        {
            $this->db->or_like('company', $company);
        }
        $query = $this->db->get('work_experience');

        echo "<pre>"; print_r($query->result());   // Result
    }
}

Edit:
foreach($data['company'] as $company)
{
    $wh[] = "`company` LIKE '".$company."'";
}
$where = "(".implode("or", $wh).")";
$this->db->where($where, NULL, FALSE);


text:
Q: :before pseudo element is not working Following link is affected: https://preview.hs-sites.com/_hcms/preview/template/multi?is_buffered_template_layout=true&portalId=2753787&tc_deviceCategory=undefined&template_layout_id=5699672553&updated=1523614982274
We are experiencing problems with a form and its parent div. We tried to bring in a frosted glas style to the parent div landingboxForm, but if we are working with pseudoelements, nothing happens.
The tutorial is from here https://medium.com/@AmJustSam/how-to-do-css-only-frosted-glass-effect-e2666bafab91 and is working well for others. I just do not succeed in port it for our landing page.
Does anybody know why the :before div tag is just grey in the Chrome inspector and why it does not appear?
CSS:
   .lp-sorba {
    background-size: cover;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    bottom: 0;
    height: 900px !important;
}

.lp-sorba .landingpageHeader {
height: 80px;
background: #1d89d2;
}

.lp-sorba #hs-link-logo > img {
  margin-top: 22px;
}

.lp-sorba .landingboxForm:before {
 content:" ";
 background: inherit;
 left: 0;
 right: 0;
 top: 0;
 height: 100%;
 width: 100%;
 bottom: 0;
 box-shadow: inset 0 0 0 3000px rgba(255,255,255,0.3);
 filter: blur(10px) !important;
}

.lp-sorba .landingboxForm {
  background: inherit;
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 5px;
  box-shadow: 0 23px 40px rgba(0,0,0,0.2);
  padding: 20px;
  border: 0.5px solid #edebeb;
}

A: As for your question

why the :before div tag is just grey in the Chrome inspector and why it does not appear?

Your pseudo element is collapsing right know. Add position: absolute; to the .lp-sorba .landingboxForm:before rule.

But that won't solve your underlying problem / won't create the frosted glass effect.
The way how filters work is: they get applied to the element itself only, not the ones lying behind it.
In the example from Medium/Codepen, the form element inherits the background from the main element. By that it's pseudo element may apply a filter to it.
In your setup, the form is positioned absolute, while the image tag is also positioned absolute. The forms filter won't bleed into that image tag.
Revisit the example:

*

*apply a background image to a parent container

*inherit that in the form

*pseudo filter on the form will blur the forms inherited background


text:
Q: Sorting in Datatable (ServerSide) sql query with "Grouped by" Statement I am using datatable jQuery plugin to render tables from MySQL database. I am able to get the table rendered as desired. But the sorting and individual search is not functioning.
here is my Script of datatable :
var table = $("#example").DataTable({
  "serverSide" : true,
  "processing" : true,
 "lengthMenu": [10,25, 50, 100 ],
   "ajax" : {
        url:"serverdata.php",
        type:"POST",
       },

    // to search individual column value
  initComplete: function() {
      var api = this.api();

      // For each column
      api
        .columns([0, 1])
        .eq(0)
        .each(function(i) {
          // Set the header cell to contain the input element
          var cell = $('.search th').eq(
            $(api.column(i).header()).index()
          );
          var title = $('#example thead tr:eq(1) th').text();
          $(cell).html('<input type="text" placeholder="Search " />');

          // On every keypress in this input
            $('input', this).on('keyup change', function(e) {
                 if (e.keyCode == 13) {
                    e.preventDefault();
                if ( table.search() !== this.value ) {
                    table
                        .search( this.value )
                        .draw();
                }
            }
            });
        });
    },

});

PHP Code : serveride.php
$query = '';
$output = array();
$columns = array('frnumber',  'customername');

$query .= "SELECT * FROM (select frnumber from tablename";

//common search
if(isset($_POST["search"]["value"]))
{
 $query .= '
  where  frnumber LIKE "%'.$_POST["search"]["value"].'%"
  OR customername LIKE "%'.$_POST["search"]["value"].'%"
 ';
}
if(isset($_POST["order"]))
{
 $query .= ' ORDER BY '.$columns[$_POST['order']['0']['column']].' '.$_POST['order']['0']['dir'].')t1 group by frnumber ';
}
else
{
 $query .= ' ORDER BY id DESC)t1  group by frnumber ';

}

if($_POST["length"] != -1)
{
 $query .= 'LIMIT ' . $_POST['start'] . ', ' . $_POST['length'];
}

$statement = $connection->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
$data = array();
$filtered_rows = $statement->rowCount();
foreach($result as $row)
{

  $sub_array = array();
  ....
  ...
  ....
}

I have researched for this type questions on the Stack Overflow, and there are many questions with answers, but none of them seems to work for me.
Can any one guide me?


text:
Q: How to host a Spring-Boot Application with MySql Backend online for free? I have created a working spring-boot-app, which works flawless on my laptop. I wish to host it online.
To do so, I referred to many guides including pivotal, heroku.
On Heroku, It says application error.
I followed this link as walk-through: https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku
Application log:https://pastebin.com/nivpqEiJ
I am an absolute beginner, please guide me how do I host it. Basically I applied in a company and they want me to host it so that they can test my application.
I feel maybe, its with application.properties. As I have mentioned my MySql credentials. But I don't know how to rectify this problem.
for reference,
here is the link to project on github: https://github.com/pranavpsinha/SMS
Thanks in advance!

A: I tried heroku a while back and ran into similar problems, I sloved it by including a Procfile in my root with the following content: web: java -Dserver.port=$PORT -jar target/sms-0.0.1-SNAPSHOT.jar
I've set my application to a web app in heroku.
You can find more info at devcenter.heroku.com/articles/procfile


text:
Q: Karate Gatling Report Customization Is it possible to customize Karate gatling report from scala file itself? Can we add anything to scala file in order to control how gatling report appears or what content or graph to be displayed in the gatling report.

A: As far as I know you can't. There is typically no reason to change it, it has been designed by experts in the field of performance-testing.
That said, all the data is available in simulation.log for you to create your own report. Also note that there are ways to connect gatling to things like grafana etc, you can search for all that, nothing specific to Karate.


text:
Q: jQuery catch Captcha image before loading OR get the image file content after loading so i play a game which verifies user input after some time by sending a captcha form. Since the captcha image changes with every reload, i have to get the contents of the loaded image, or if possible, have some listening function to catch the image before being rendered by the browser (to prevent re-newing the image).
    <form action="?" method="post">
    <img src="captcha.url?token" id="captcha_img">
    <input type='text' name='captcha' id='captcha_text'>
    <input type='submit' name='sendcaptcha' value='Continue'>
    </form>

With the content or link i plan on sending it through a vbscript which executes a captcha breaker program and return the code, this i have all figured out, i'm stuck on getting the image..
Thank you for your help.

A: Figured this out too:
    function addListener() {
        $(document).bind('DOMSubtreeModified',function(){
            if($('#captcha_img').length!=0){
                $(this).unbind('DOMSubtreeModified');
                var src = $('#captcha_img').attr("src");
                $('#captcha_img').attr("src", 'caught.png');
               alert(src);
        }
        });
    }


text:
Q: Swipe gesture on google map android I'm trying to add swipe gesture on a basic application which just show a google map. It works fine without map. Here is my solution without the map :
private float x1,x2;
static final int MIN_DISTANCE = 150;
private Point pt;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    pt = new Point();
    getWindowManager().getDefaultDisplay().getSize(pt);
}

@Override
public boolean onTouchEvent(MotionEvent event)
{
    switch(event.getAction())
    {
      case MotionEvent.ACTION_DOWN:
          if(event.getX()>pt.x-5){
              x1 = event.getX();
              Log.d("DEBUUUUG", ""+event.getX());
          }else{
              x1=0;
          }
      break;
      case MotionEvent.ACTION_UP:
          if(x1>=pt.x-5){
              x2 = event.getX();
              Log.d("DEBUUUUG", "X1="+x1+" X2="+x2);
              float deltaX = x2 - x1;
              if (Math.abs(deltaX) > MIN_DISTANCE)
              {
                  Toast.makeText(this, "swipe", Toast.LENGTH_SHORT).show ();
              }
          }
      break;
    }
    return super.onTouchEvent(event);
}

and here is my xml layout with the map (the layout without just has a simple LinearLayout who's empty) :
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapSee"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />

My goal is to add a right-to-left slider, like on the GoogleMaps app.
Is it possible ?
Thanks.
EDIT
Done, I've found a solution. I don't think it's the best way to do this, but it works.
I've added an invisible button :

    <Button
        android:id="@+id/btn_slideMenuCM"
        android:layout_width="1dp"
        android:layout_height="match_parent"
        android:layout_alignParentRight="true"
        android:background="@android:color/transparent"/>
</RelativeLayout>

I've implemented a TouchListener on this button :
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
    case MotionEvent.ACTION_DOWN:
    //The action to do
        break;
}
return false;
}

It's not a real "swipe gesture", but it looks like.


text:
Q: How can I create custom user model for different user types using django rest framework I am new to django rest framework and I want to create different types of users "I think it should be 4", (students, teachers, staff and admin) And I want the staff user to register the teacher and student users. I want to use custom user model and use email to register and login,  can it be done, please help, I have been looking for days for anything that can help me to understand how to do it

A: You can use AbstractUser , This is pretty straighforward since the class django.contrib.auth.models.AbstractUser provides the full implementation of the default User as an abstract model.
**
    from django.db import models
    from django.contrib.auth.models import AbstractUser
    USER_TYPE_CHOICES = (
     ('student', 'student'),
     ('teacher', 'teacher'),
     ('staff', 'staff'),
     ('admin', 'admin'),
                        )
    class User(AbstractUser):
       user_type = models.CharField(max_length=40,choices=USER_TYPE_CHOICES)
**

After that you have to update our settings.py defining the AUTH_USER_MODEL property.
 AUTH_USER_MODEL = 'Your app name.User'

You can email as username in your serializers.py:
class RegisterSerializer(serializers.ModelSerializer):
    password1 = serializers.CharField(write_only=True)

    class Meta:
      model = User
      fields = ('first_name', 'last_name', 'email', 'password','password1',  'user_type',)

    def validate(self, attr):
       validate_password(attr['password'])
       return attr

    def create(self, validated_data):
          user = User.objects.create(
                username=validated_data['email'],
                user_type=validated_data['user_type'],
                email=validated_data['email'],
                first_name=validated_data['first_name'],
                last_name=validated_data['last_name'],

                )
        user.set_password(validated_data['password'])
        user.save()

       return user

Now ,you can use this serializer in your views.py and create user with different user types
Best regards,

A: yes it can be definitely done please checkout this! https://docs.djangoproject.com/en/3.1/topics/auth/customizing/#extending-user