How to display very large text in Rich Editable Text Input

Question: I am unable to display big text in Rich Editable text input control in flex 4. Below is the code
<code>    <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" width="500" height="600">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Scroller height="100%" width="100%">
    <s:Group height="100%" width="100%">

    <s:RichEditableText editable="false" text="75491302459 75491301083 75491311425 75491301095 75491300318 79004500202 09689827513 09689890273 09736156223 09689835913 09689829263 08539378773 04339607323 79004500205 08539244963 79004500204 79004500207 79004500208 09736155880 79405180133 09736337123 09736016920 79004500209 09736339363 09736337723 09736334300 04339674653 09736155680 09736156270 09736155783 09736062540 04339605870 09736339360 09736156600 09736320543 01223612441 01223612032 08539122223 02761654083 08539132283 01256957003 01476412543 02761685241 08539119513 79404362053 04598602070 04598602079 08539210793 04339600637 04339602221 04598624138 04598624108 04598624100 04598624103 04598624148 04598222222 04598624144 04339600671 04339606169 04339606520 04339607951 04339608142 04339609623 04339609671 04339605471 79004500222 79404367333 79404340363 08539144793 79004500223 08539173713 09736154463 04339607628 04339608284 04339608285 04339610096 08539210693 79004500225 79004500226 79404356453 79404356533 79404355483 04339601032 04339607682 04339607683 04339608575 04339608576 08539218513 04339602270 79404340103 79404343103 08539172473 09736871858 79404354513 79404368423 08539226243 04339612223 08539233013 79004500227 04598602518 04598602521 04598602529 04339605125 04339601788 75491300237 08539126143 75491300697 79404362103 04598624132 09689849593 08539342153 79404346873 02454303425 02454304708 02454305759 04339602945 04339609596 04339609744 04339682593 08539212503 09689836553 09736332510 09736334813 09736340723 09736874773 66706860263 66706899713 66706899753 66706899773 66706899793 67814901483 67814906653 67814931073 79404346383 04339602129 08539210823 04339601058 04339609621 04339608145 04339602148 04339651223 02454305755 79404346433 04339687030 09689848303 79004500206 04339603765 04339607051 04339609443 04339690313 04339694473 04339677923 04339662020 04339683343 04339691973 04339694393 04339660498 04339660237 04598602017 76218881272 75491300157 05393925653 08539141913 02761688731 09736886333 08539275723 07464559143 07464543283 07464559263 09736344573 02761688213 04598602085 04598602257 08539001784 08539178453 08539161083 01871374742 02761651223 08539246563 04598624116 04598608964 02761685244 09736153783 02761669653 01256969580 09736081363 04598624216 02761688430 09736874443 09736874673 09736879053 09736879583 09736879593 02761651373 70440002523 70440003123 70440003183 70440003203 70440003743 70440002703 70440002843 70440002903 04339609673 02848511541 09689601373 08539153723 08539159233 08539153003 09736879293 09736879783 08539153863 02761662283 09736014543 01476412143 09736344073 04598625701 04598625703 04598625702 09736015393 09736018233 09689812283 08539178043 09736877883 09736084593 02761687393 04339608607 04339608606 08539397443 08539348743 08539236633 09736341463 01256971599 02454302852 04339602152 09736156733 09736871623 02635921643 02635921633 09736016433 08539172013 09736330473 04598625704 04598625705 09736332433 09736875333 09736875343 01476412593 01476411933 09689897613 08539313393 09736156513 04598624163 70772955023 70772910116 09736340763 09736343493 02761661373 79404343093 79404343523 79404343493 08539309223 04598624212 01256959324 02454302939 09689847603 08539373073 00968983591 08539389473 09736014673 08539214153 09689849583 09736053823 09736053743 09736019493 08539212513 01256969983 01476414243 09736330553 02635913923 08539166893 09736331313 09736332443 08536518693 08536518843 09736877523 09736874453 09736845473 02454312130 09736341813 01476418793 01476423753 01476418783 01476413783 01476414793 01476418033 01476423743 01256944643 01476417453 01476417463 01476411983 01476419313 01476421503 01476417593 01476421563 01476423803 01476423903 01476420623 01476414863 01476412553 01476421683 08539238793 01476414873 01476419343 02761673033 02761677463 01256959335 09736045203 04339603415 02761661563 09736860163 09736860153 09736025143 09736879543 09736879553 97368601536 97368601635 03150401180 09736088581 09736041933 09736337223 01223273873 08539184363 09736065243 08539232493 02761665453 02761675863 09689897623 04598624210 02761677263 08536518453 01256957763 01256957563 09736061903 02761674093 09736880243 04339606814 08539186183 02761690110 09689812893 04598602530 00853003170 09736342303 70440005653 02635917243 04339621670 04598624211 09689867403 09736341263 01476423853 76218812720 01223614244 02454301469 02454304705 02454310674 02454312129 02454313000 02454312995 02454316035 02454316143 02454317638 02454320012 02454320022 02454320031 02454322206 02761690372 03242900577 08539151833 08539160543 08539164023 08539185343 08539189563 08539234823 08539275803 08539283853 08539284133 08539389413 09736050583 09736053820 09736055313 09736804013 09736837413 09736838743 09736860150 09736860180 09736860183 09736874430 09736874670 09736875633 09736877363 09736877393 09736877403 09736877413 09736877533 09736879103 09736879143 09736879243 09736879283 09736879673 09736879753 09736880173 09736880973 09736880983 09736880993 09736881883 09736881893 09736886233 09736886303 09736886483 09736886493 09736886503 09736886643 09736886653 09736886683 09736886353 09736887333 09736887553 09736889023 09736889443 09736889683 09736889883 09736889913 66706890213 67814908723 67814916803 79404354033 79404356253 79404363183 79404368293 79404368323 79405484213 79405485063 84188705022 84188705026 84188705028 84188705092 84188705116 84188705159 84188705191 09689824183 09736325833 09689817443 02454313318 08539220823 08539232993 08539233113 08539240503 08539313503 08539389533 09689610353 09689800763 09736053262 01223612988 01256959762 01223616239 79404310097 79404340353 79404362343 08539397433 08539276663 09736877383 08536518683 01256945863 04339608435 01223613350 01223613787 01256970355 01476414533 02454316125 02454319863 07464495983 07464540473 07464540493 07464543703 08536518673 08539224403 08539240963 08539247453 08539339853 08539365193 08539374243 79404345903 01223613093 01256959332 01476418433 02454312312 02454317538 03139811805 07464512293 07464553263 08536518623 08536519043 08539139253 08539149803 08539189553 08539224253 08539245933 08539284513 09689619963 09736837183 09736877443 09736877583 09736877893 70440007225 79404348833 08539232393 08539278783 09736877733 79404365033 09736871843 02635919933 04339603892 09689816083 02454311602 79404354153 79404363173 04339608077 79404357233 79404369273 79404354023 79404354853 04339605696 09736155883 02761681033 79404347153 79404347543 04339682653 79404345773 04339682433 04339621703 04339621693 08539129923 75491301083 75491311425 75491301095 75491300318 79004500202 09689827513 09689890273 09736156223 09689835913 09689829263 08539378773 04339607323 79004500205 08539244963 79004500204 79004500207 79004500208 09736155880 79405180133 09736337123 09736016920 79004500209 09736339363 09736337723 09736334300 04339674653 09736155680 09736156270 09736155783 09736062540 04339605870 09736339360 09736156600 09736320543 01223612441 01223612032 08539122223 02761654083 08539132283 01256957003 01476412543 02761685241 08539119513 79404362053 04598602070 04598602079 08539210793 04339600637 04339602221 04598624138 04598624108 04598624100 04598624103 04598624148 04598222222 04598624144 04339600671 04339606169 04339606520 04339607951 04339608142 04339609623 04339609671 04339605471 79004500222 79404367333 79404340363 08539144793 79004500223 08539173713 09736154463 04339607628 04339608284 04339608285 04339610096 08539210693 79004500225 79004500226 79404356453 79404356533 79404355483 04339601032 04339607682 04339607683 04339608575 04339608576 08539218513 04339602270 79404340103 79404343103 08539172473 09736871858 79404354513 79404368423 08539226243 04339612223 08539233013 79004500227 04598602518 04598602521 04598602529 04339605125 04339601788 75491300237 08539126143 75491300697 79404362103 04598624132 09689849593 08539342153 79404346873 02454303425 02454304708 02454305759 04339602945 04339609596 04339609744 04339682593 08539212503 09689836553 09736332510 09736334813 09736340723 09736874773 66706860263 66706899713 66706899753 66706899773 66706899793 67814901483 67814906653 67814931073 79404346383 04339602129 08539210823 04339601058 04339609621 04339608145 04339602148 04339651223 02454305755 79404346433 04339687030 09689848303 79004500206 04339603765 04339607051 04339609443 04339690313 04339694473 04339677923 04339662020 04339683343 04339691973 04339694393 04339660498 04339660237 04598602017 76218881272 75491300157 05393925653 08539141913 02761688731 09736886333 08539275723 07464559143 07464543283 07464559263 09736344573 02761688213 04598602085 04598602257 08539001784 08539178453 08539161083 01871374742 02761651223 08539246563 04598624116 04598608964 02761685244 09736153783 02761669653 01256969580 09736081363 04598624216 02761688430 09736874443 09736874673 09736879053 09736879583 09736879593 02761651373 70440002523 70440003123 70440003183 70440003203 70440003743 70440002703 70440002843 70440002903 04339609673 02848511541 09689601373 08539153723 08539159233 08539153003 09736879293 09736879783 08539153863 02761662283 09736014543 01476412143 09736344073 04598625701 04598625703 04598625702 09736015393 09736018233 09689812283 08539178043 09736877883 09736084593 02761687393 04339608607 04339608606 08539397443 08539348743 08539236633 09736341463 01256971599 02454302852 04339602152 09736156733 09736871623 02635921643 02635921633 09736016433 08539172013 09736330473 04598625704 04598625705 09736332433 09736875333 09736875343 01476412593 01476411933 09689897613 08539313393 09736156513 04598624163 70772955023 70772910116 09736340763 09736343493 02761661373 79404343093 79404343523 79404343493 08539309223 04598624212 01256959324 02454302939 09689847603 08539373073 00968983591 08539389473 09736014673 08539214153 09689849583 09736053823 09736053743 09736019493 08539212513 01256969983 01476414243 09736330553 02635913923 08539166893 09736331313 09736332443 08536518693 08536518843 09736877523 09736874453 09736845473 02454312130 09736341813 01476418793 01476423753 01476418783 01476413783 01476414793 01476418033 01476423743 01256944643 01476417453 01476417463 01476411983 01476419313 01476421503 01476417593 01476421563 01476423803 01476423903 01476420623 01476414863 01476412553 01476421683 08539238793 01476414873 01476419343 02761673033 02761677463 01256959335 09736045203 04339603415 02761661563 09736860163 09736860153 09736025143 09736879543 09736879553 97368601536 97368601635 03150401180 09736088581 09736041933 09736337223 01223273873 08539184363 09736065243 08539232493 02761665453 02761675863 09689897623 04598624210 02761677263 08536518453 01256957763 01256957563 09736061903 02761674093 09736880243 04339606814 08539186183 02761690110 09689812893 04598602530 00853003170 09736342303 70440005653 02635917243 04339621670 04598624211 09689867403 09736341263 01476423853 76218812720 01223614244 02454301469 02454304705 02454310674 02454312129 02454313000 02454312995 02454316035 02454316143 02454317638 02454320012 02454320022 02454320031 02454322206 02761690372 03242900577 08539151833 08539160543 08539164023 08539185343 08539189563 08539234823 08539275803 08539283853 08539284133 08539389413 09736050583 09736053820 09736055313 09736804013 09736837413 09736838743 09736860150 09736860180 09736860183 09736874430 09736874670 09736875633 09736877363 09736877393 09736877403 09736877413 09736877533 09736879103 09736879143 09736879243 09736879283 09736879673 09736879753 09736880173 09736880973 09736880983 09736880993 09736881883 09736881893 09736886233 09736886303 09736886483 09736886493 09736886503 09736886643 09736886653 09736886683 09736886353 09736887333 09736887553 09736889023 09736889443 09736889683 09736889883 09736889913 66706890213 67814908723 67814916803 79404354033 79404356253 79404363183 79404368293 79404368323 79405484213 79405485063 84188705022 84188705026 84188705028 84188705092 84188705116 84188705159 84188705191 09689824183 09736325833 09689817443 02454313318 08539220823 08539232993 08539233113 08539240503 08539313503 08539389533 09689610353 09689800763 09736053262 01223612988 01256959762 01223616239 79404310097 79404340353 79404362343 08539397433 08539276663 09736877383 08536518683 01256945863 04339608435 01223613350 01223613787 01256970355 01476414533 02454316125 02454319863 07464495983 07464540473 07464540493 07464543703 08536518673 08539224403 08539240963 08539247453 08539339853 08539365193 08539374243 79404345903 01223613093 01256959332 01476418433 02454312312 02454317538 03139811805 07464512293 07464553263 08536518623 08536519043 08539139253 08539149803 08539189553 08539224253 08539245933 08539284513 09689619963 09736837183 09736877443 09736877583 09736877893 70440007225 79404348833 08539232393 08539278783 09736877733 79404365033 09736871843 02635919933 04339603892 09689816083 02454311602 79404354153 79404363173 04339608077 79404357233 79404369273 79404354023 79404354853 04339605696 09736155883 02761681033 79404347153 79404347543 04339682653 79404345773 04339682433 04339621703 04339621693 08539129923 75491301083 75491311425 75491301095 75491300318 79004500202 09689827513 09689890273 09736156223 09689835913 09689829263 08539378773 04339607323 79004500205 08539244963 79004500204 79004500207 79004500208 09736155880 79405180133 09736337123 09736016920 79004500209 09736339363 09736337723 09736334300 04339674653 09736155680 09736156270 09736155783 09736062540 04339605870 09736339360 09736156600 09736320543 01223612441 01223612032 08539122223 02761654083 08539132283 01256957003 01476412543 02761685241 08539119513 79404362053 04598602070 04598602079 08539210793 04339600637 04339602221 04598624138 04598624108 04598624100 04598624103 04598624148 04598222222 04598624144 04339600671 04339606169 04339606520 04339607951 04339608142 04339609623 04339609671 04339605471 79004500222 79404367333 79404340363 08539144793 79004500223 08539173713 09736154463 04339607628 04339608284 04339608285 04339610096 08539210693 79004500225 79004500226 79404356453 79404356533 79404355483 04339601032 04339607682 04339607683 04339608575 04339608576 08539218513 04339602270 79404340103 79404343103 08539172473 09736871858 79404354513 79404368423 08539226243 04339612223 08539233013 79004500227 04598602518 04598602521 04598602529 04339605125 04339601788 75491300237 08539126143 75491300697 79404362103 04598624132 09689849593 08539342153 79404346873 02454303425 02454304708 02454305759 04339602945 04339609596 04339609744 04339682593 08539212503 09689836553 09736332510 09736334813 09736340723 09736874773 66706860263 66706899713 66706899753 66706899773 66706899793 67814901483 67814906653 67814931073 79404346383 04339602129 08539210823 04339601058 04339609621 04339608145 04339602148 04339651223 02454305755 79404346433 04339687030 09689848303 79004500206 04339603765 04339607051 04339609443 04339690313 04339694473 04339677923 04339662020 04339683343 04339691973 04339694393 04339660498 04339660237 04598602017 76218881272 75491300157 05393925653 08539141913 02761688731 09736886333 08539275723 07464559143 07464543283 07464559263 09736344573 02761688213 04598602085 04598602257 08539001784 08539178453 08539161083 01871374742 02761651223 08539246563 04598624116 04598608964 02761685244 09736153783 02761669653 01256969580 09736081363 04598624216 02761688430 09736874443 09736874673 09736879053 09736879583 09736879593 02761651373 70440002523 70440003123 70440003183 70440003203 70440003743 70440002703 70440002843 70440002903 04339609673 02848511541 09689601373 08539153723 08539159233 08539153003 09736879293 09736879783 08539153863 02761662283 09736014543 01476412143 09736344073 04598625701 04598625703 04598625702 09736015393 09736018233 09689812283 08539178043 09736877883 09736084593 02761687393 04339608607 04339608606 08539397443 08539348743 08539236633 09736341463 01256971599 02454302852 04339602152 09736156733 09736871623 02635921643 02635921633 09736016433 08539172013 09736330473 04598625704 04598625705 09736332433 09736875333 09736875343 01476412593 01476411933 09689897613 08539313393 09736156513 04598624163 70772955023 70772910116 09736340763 09736343493 02761661373 79404343093 79404343523 79404343493 08539309223 04598624212 01256959324 02454302939 09689847603 08539373073 00968983591 08539389473 09736014673 08539214153 09689849583 09736053823 09736053743 09736019493 08539212513 01256969983 01476414243 09736330553 02635913923 08539166893 09736331313 09736332443 08536518693 08536518843 09736877523 09736874453 09736845473 02454312130 09736341813 01476418793 01476423753 01476418783 01476413783 01476414793 01476418033 01476423743 01256944643 01476417453 01476417463 01476411983 01476419313 01476421503 01476417593 01476421563 01476423803 01476423903 01476420623 01476414863 01476412553 01476421683 08539238793 01476414873 01476419343 02761673033 02761677463 01256959335 09736045203 04339603415 02761661563 09736860163 09736860153 09736025143 09736879543 09736879553 97368601536 97368601635 03150401180 09736088581 09736041933 09736337223 01223273873 08539184363 09736065243 08539232493 02761665453 02761675863 09689897623 04598624210 02761677263 08536518453 01256957763 01256957563 09736061903 02761674093 09736880243 04339606814 08539186183 02761690110 09689812893 04598602530 00853003170 09736342303 70440005653 02635917243 04339621670 04598624211 09689867403 09736341263 01476423853 76218812720 01223614244 02454301469 02454304705 02454310674 02454312129 02454313000 02454312995 02454316035 02454316143 02454317638 02454320012 02454320022 02454320031 02454322206 02761690372 03242900577 08539151833 08539160543 08539164023 08539185343 08539189563 08539234823 08539275803 08539283853 08539284133 08539389413 09736050583 09736053820 09736055313 09736804013 09736837413 09736838743 09736860150 09736860180 09736860183 09736874430 09736874670 09736875633 09736877363 09736877393 09736877403 09736877413 09736877533 09736879103 09736879143 09736879243 09736879283 09736879673 09736879753 09736880173 09736880973 09736880983 09736880993 09736881883 09736881893 09736886233 09736886303 09736886483 09736886493 09736886503 09736886643 09736886653 09736886683 09736886353 09736887333 09736887553 09736889023 09736889443 09736889683 09736889883 09736889913 66706890213 67814908723 67814916803 79404354033 79404356253 79404363183 79404368293 79404368323 79405484213 79405485063 84188705022 84188705026 84188705028 84188705092 84188705116 84188705159 84188705191 09689824183 09736325833 09689817443 02454313318 08539220823 08539232993 08539233113 08539240503 08539313503 08539389533 09689610353 09689800763 09736053262 01223612988 01256959762 01223616239 79404310097 79404340353 79404362343 08539397433 08539276663 09736877383 08536518683 01256945863 04339608435 01223613350 01223613787 01256970355 01476414533 02454316125 02454319863 07464495983 07464540473 07464540493 07464543703 08536518673 08539224403 08539240963 08539247453 08539339853 08539365193 08539374243 79404345903 01223613093 01256959332 01476418433 02454312312 02454317538 03139811805 07464512293 07464553263 08536518623 08536519043 08539139253 08539149803 08539189553 08539224253 08539245933 08539284513 09689619963 09736837183 09736877443 09736877583 09736877893 70440007225 79404348833 08539232393 08539278783 09736877733 79404365033 09736871843 02635919933 04339603892 09689816083 02454311602 79404354153 79404363173 04339608077 79404357233 79404369273 79404354023 79404354853 04339605696 09736155883 02761681033 79404347153 79404347543 04339682653 79404345773 04339682433 04339621703 04339621693 08539129923 75491301083 75491311425 75491301095 75491300318 79004500202 09689827513 09689890273 09736156223 09689835913 09689829263 08539378773 04339607323 79004500205 08539244963 79004500204 79004500207 79004500208 09736155880 79405180133 09736337123 09736016920 79004500209 09736339363 09736337723 09736334300 04339674653 09736155680 09736156270 09736155783 09736062540 04339605870 09736339360 09736156600 09736320543 01223612441 01223612032 08539122223 02761654083 08539132283 01256957003 01476412543 02761685241 08539119513 79404362053 04598602070 04598602079 08539210793 04339600637 04339602221 04598624138 04598624108 04598624100 04598624103 04598624148 04598222222 04598624144 04339600671 04339606169 04339606520 04339607951 04339608142 04339609623 04339609671 04339605471 79004500222 79404367333 79404340363 08539144793 79004500223 08539173713 09736154463 04339607628 04339608284 04339608285 04339610096 08539210693 79004500225 79004500226 79404356453 79404356533 79404355483 04339601032 04339607682 04339607683 04339608575 04339608576 08539218513 04339602270 79404340103 79404343103 08539172473 09736871858 79404354513 79404368423 08539226243 04339612223 08539233013 79004500227 04598602518 04598602521 04598602529 04339605125 04339601788 75491300237 08539126143 75491300697 79404362103 04598624132 09689849593 08539342153 79404346873 02454303425 02454304708 02454305759 04339602945 04339609596 04339609744 04339682593 08539212503 09689836553 09736332510 09736334813 09736340723 09736874773 66706860263 66706899713 66706899753 66706899773 66706899793 67814901483 67814906653 67814931073 79404346383 04339602129 08539210823 04339601058 04339609621 04339608145 04339602148 04339651223 02454305755 79404346433 04339687030 09689848303 79004500206 04339603765 04339607051 04339609443 04339690313 04339694473 04339677923 04339662020 04339683343 04339691973 04339694393 04339660498 04339660237 04598602017 76218881272 75491300157 05393925653 08539141913 02761688731 09736886333 08539275723 07464559143 07464543283 07464559263 09736344573 02761688213 04598602085 04598602257 08539001784 08539178453 08539161083 01871374742 02761651223 08539246563 04598624116 04598608964 02761685244 09736153783 02761669653 01256969580 09736081363 04598624216 02761688430 09736874443 09736874673 09736879053 09736879583 09736879593 02761651373 70440002523 70440003123 70440003183 70440003203 70440003743 70440002703 70440002843 70440002903 04339609673 02848511541 09689601373 08539153723 08539159233 08539153003 09736879293 09736879783 08539153863 02761662283 09736014543 01476412143 09736344073 04598625701 04598625703 04598625702 09736015393 09736018233 09689812283 08539178043 09736877883 09736084593 02761687393 04339608607 04339608606 08539397443 08539348743 08539236633 09736341463 01256971599 02454302852 04339602152 09736156733 09736871623 02635921643 02635921633 09736016433 08539172013 09736330473 04598625704 04598625705 09736332433 09736875333 09736875343 01476412593 01476411933 09689897613 08539313393 09736156513 04598624163 70772955023 70772910116 09736340763 09736343493 02761661373 79404343093 79404343523 79404343493 08539309223 04598624212 01256959324 02454302939 09689847603 08539373073 00968983591 08539389473 09736014673 08539214153 09689849583 09736053823 09736053743 09736019493 08539212513 01256969983 01476414243 09736330553 02635913923 08539166893 09736331313 09736332443 08536518693 08536518843 09736877523 09736874453 09736845473 02454312130 09736341813 01476418793 01476423753 01476418783 01476413783 01476414793 01476418033 01476423743 01256944643 01476417453 01476417463 01476411983 01476419313 01476421503 01476417593 01476421563 01476423803 01476423903 01476420623 01476414863 01476412553 01476421683 08539238793 01476414873 01476419343 02761673033 02761677463 01256959335 09736045203 04339603415 02761661563 09736860163 09736860153 09736025143 09736879543 09736879553 97368601536 97368601635 03150401180 09736088581 09736041933 09736337223 01223273873 08539184363 09736065243 08539232493 02761665453 02761675863 09689897623 04598624210 02761677263 08536518453 01256957763 01256957563 09736061903 02761674093 09736880243 04339606814 08539186183 02761690110 09689812893 04598602530 00853003170 09736342303 70440005653 02635917243 04339621670 04598624211 09689867403 09736341263 01476423853 76218812720 01223614244 02454301469 02454304705 02454310674 02454312129 02454313000 02454312995 02454316035 02454316143 02454317638 02454320012 02454320022 02454320031 02454322206 02761690372 03242900577 08539151833 08539160543 08539164023 08539185343 08539189563 08539234823 08539275803 08539283853 08539284133 08539389413 09736050583 09736053820 09736055313 09736804013 09736837413 09736838743 09736860150 09736860180 09736860183 09736874430 09736874670 09736875633 09736877363 09736877393 09736877403 09736877413 09736877533 09736879103 09736879143 09736879243 09736879283 09736879673 09736879753 09736880173 09736880973 09736880983 09736880993 09736881883 09736881893 09736886233 09736886303 09736886483 09736886493 09736886503 09736886643 09736886653 09736886683 09736886353 09736887333 09736887553 09736889023 09736889443 09736889683 09736889883 09736889913 66706890213 67814908723 67814916803 79404354033 79404356253 79404363183 79404368293 79404368323 79405484213 79405485063 84188705022 84188705026 84188705028 84188705092 84188705116 84188705159 84188705191 09689824183 09736325833 09689817443 02454313318 08539220823 08539232993 08539233113 08539240503 08539313503 08539389533 09689610353 09689800763 09736053262 01223612988 01256959762 01223616239 79404310097 79404340353 79404362343 08539397433 08539276663 09736877383 08536518683 01256945863 04339608435 01223613350 01223613787 01256970355 01476414533 02454316125 02454319863 07464495983 07464540473" top="50" bottom="50"/>
    </s:Group>
    </s:Scroller>

</s:Application>
</code>
Can any one please tell me how to display big text in Rich editable text input control
Answer: If I understand your question, the problem is that it doesn't wrap. You can add height, width and multiline properties to force it to wrap.
<code><?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
    <s:Scroller height="100%" width="100%"  >
        <s:Group height="100%" width="100%">
            <s:RichEditableText height="100%" width="100%"  multiline="true" editable="false" text="..." top="50" bottom="50"/>
        </s:Group>
    </s:Scroller>
</s:Application>
</code>
Comment: Thanks for solution nFreeze it is visible now in multiple lines but i need small modification.That is the text should be visible in one line upto some 20 characters after that i should get "......" concat format.I have given tooltip to display the original text. can you please help me.
Comment: Could you add a mock-up of the result you are looking for to your question? I don't fully understand.


Using Python to find minima and maxima?

Question: I try to differentiate my function in python but receive a "can't convert expression to float" error. I wonder what I am doing wrong.
Here's my code:
import math
from math import pi
import matplotlib.pylab as plt
import sympy
from sympy import symbols, diff
import numpy

def function(x, y, t):
    e = 1.65e-21
    s = 3.4e-10
    return 4*e*((s/x)**12 - (s/x)**6) + 4*e*((s/y)**12 -(s/y)**6) + 4*e*((s/math.sqrt(x**2 + y**2 - 2*x*y*math.cos(math.degrees(t))**12 - (s/math.sqrt(x**2 + y**2 - 2*x*y*math.degrees(math.cos(t))))**6)))

    x, y, t = sympy.symbols('x k t')

    sympy.diff(function(x, y, t), t)

I went to the website and tried to implement some suggestion but I am still having problems.
Prompt assistance highly appreciated
Comment: fix your indentation
Answer: Do not use math functions with sympy - use sympy functions. For example a cosine:
sympy.cos

A sqrt is simply:
x**0.5

sympy has all math functions built in though, including sqrt.

Using Python to find minima and maxima?


Chi-Square test: one-sided implementation?

Question: I need to compare two samples and I would like to know if the distribution of the first stochastically dominates that of the second one.
I'm not sure whether with the Chi-Square test I can verify this.
In scipy and R, there is no reference to this test being one-sided, while a previous question on this site says that it's always one-sided.
Could anybody clarify this, with respect to either of the two implementations linked above?
Comment: The chi-square isn't a test for stochastic dominance.
Comment: The CRITICAL REGION for the chi-square statistic is one-sided, but the HYPOTHESES are two-sided or multi-sided, in the sense that the statistic looks to see if one set of frequencies is discrepant from another, without regard to what direction they differ. So the chi-square stat is not really very well suited for your stochastic-ordering alternative. There is literature on order-restricted inference for situations like this, but it gets pretty technical. +1 for the question from here, don't understand what somebody sees wrong with it.
Comment: What do you mean by "distribution being larger"?
Comment: Roughly the same as stated here for kolmogorov smirnov:
http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kstest.html
"In the one-sided test, the alternative is that the empirical cumulative distribution function of the random variable is "less" or "greater" than the cumulative distribution function F(x) of the hypothesis, G(x)<=F(x), resp. G(x)>=F(x)."
Answer: A major reference on this topic is Tim Robertson, F. T. Wright, R. L. Dykstra (1988),
Order Restricted Statistical Inference, published by Wiley. It is expensive and technical, but it is still probably the best place to look. An earlier reference is Richard E. Barlow (1972), Statistical Inference Under Order Restrictions: The Theory and Application of Isotonic Regression. Perhaps you can find something easier to digest online, by searching for "order-restricted inference" or "isotonic regression."
For the chi-square application you mention, the basic idea, as I understand it, is to compute the chi-square statistic but with some twists: First, the "expected" counts should be obtained based on the stochastic-ordering requirement -- this is done using isotonic-regression techniques, which involves pooling adjacent categories when the observed ordering is violated. Second, the significance is assessed using the "chi-bar-square" distribution, which is the distribution of a mixture of chi-squares with different d.f. This is necessary because under the null hypothesis that there is no difference between the distributions, there are various possibilities for which categories need to be pooled in performing the isotonic regression.
This is not a complete answer to your question, but it does point to the basic ideas. Note also that this definitely does say that the usual chi-square test is not suitable for the stochastically-ordered hypotheses you wish to test. Perhaps you can consult someone having the expertise to be able to navigate the techniques needed to get this done with your data. Good luck!


Custom redirect specific page after edit

Question: With my Drupal website ( which is much more custom than drupal ) I've got node referenced in another ( ex. an article in a custom page ).
I want the ability to easily edit the referenced content. To do that I've put a button with the link:
<?php print $base_url; ?>/node/<?php print $article->nid; ?>/edit?destination=<?php print urlencode('node/'.$node->nid); ?>

Sadly Drupal doesn't care about the destination and redirects me to the article node and not the current node it was into.
Answer: It is always a good habit to use l() to create links in Drupal. In your case, you can use the below code to create link.
l(t('Title'), 'node/' . $article->nid . '/edit', array('query' => array('destination' => 'node/' . $node->nid)));

Answer: Destination should work. If it doesn't then you could try this way using hook_form_alter to make it work.
function hook_form_alter(&$form, &$form_state, $form_id) {
        if($form_id == 'your_form_id') {
                $destination = $_GET['destination'];
                $form_state['redirect'] = $destination;
        }
}


After adding a tab control and copying and pasting the text fields + buttons into a tab my windows form no longer works

Question: I'm a C# noobie and have recently made a CRUD app with windows forms and decided to upgrade it a little by adding a tab function to add new functionalities to it but after copying and pasting the design of my windows form into the TabControl field, the design shows up but the CRUD system itself no long works.
I feel like I might need to call the TabControl in the form design code but have no idea how I'd do that. All of my CRUD code was made directly on the WinForm design class.
Comment: @Idle_Mind I appreciate the quick help, it's just as you mentioned, after copying and pasting the event handler properties were lost. After wiring them back everything is working perfectly! :D
Comment: When you paste the controls into the new Tab the will NOT have any events wired up for them.  You'll have to either select each control and re-attach the events to existing methods, or write new methods for them if they should do something different.
Comment: What are you copy/pasting from and to? In addition, what does _"no longer works"_ mean? Are there errors? You need to keep in mind that if you copy/paste controls into the same form… then the paste will change the names of the pasted controls.
Comment: @JohnG nothing was responsive, so no error messages. Turns out the event handlers were wiped from the forms properties. Thanks for the quick response!
Comment: Just make sure if you have multiple controls firing the same method you use the `sender` parameter correctly to know which control was the source of the event.
Answer: As @Idle_Mind mentioned in the comments, after pasting controls into the new tab all the events wired to them were wiped. After rewiring them the problem was solved!


Vue router optional first parameter

Question: I have a list of routes that can all have an optional first parameter. If the parameter is present in the url, it will change a header I use in my api calls. Everything else remains the same.
Rather than create two sets of routes to handle this, is there a way I can list the first parameter as optional and only define my routes once?
For all routes, there can be an :environment param present in the front:
/:environment/:event_identifier/register/pages/:page_uuid

or it can be:
/:event_identifier/register/pages/:page_uuid

Everything else will remain the same.
let routes = [{
   path: '/:event_identifier/register/pages/:page_uuid',
   name: 'ContentPage',
   component: ContentPage,
   meta: {
      requiresAuth: true,
   },
}, {
   path: '/:event_identifier/register/:pagenum',
   name: 'Register',
   component: Register,
   meta: {
      requiresAuth: true,
   },
}, {
   path: '/:event_identifier',
   name: 'Login',
   component: Login,
   children: [{
      path: '/:event_identifier/:registration_uuid/:pagenum',
      name: 'editRegistration',
      component: Login,
   }]
}]

Answer: You can declare an optional param like this:
path: '/myroute/:param?'

The ? after :param makes it optional, so it will match http://domain/myroute with no param or http://domain/myroute/25 with a param.
But, I would suggest making your optional params last on each route. Otherwise, you get some unclear behavior. Imagine you had a route path like this with an optional first param..
path: '/myroute/:optional?/:notoptional'

If you visit http://domain/myroute/25/100, the 25 would match :optional?
But if you visit http://domain/myroute/25, the 25 would match :notoptional

Vue router optional first parameter


How to use ProGuard with NetBeans 6.7/6.8?

Question: Does anyone know how to integrate ProGuard with NetBeans 6.7/6.8 ? I've been using NetBeans for many years, but now I want to use ProGuard, is there a way to add it as a plugin and just click a button to start obfuscating my programs ? I know it exists in NetBeans Mobility Pack, how come it's not in the regular NetBeans version ?
Answer: A simple web search gave me

http://netbeans.dzone.com/tips/obfuscating-netbeans-java-appl
http://blogs.oracle.com/geertjan/entry/obfuscation
Comment: Thanks for the info, I wish Netbeans can have a button to enable Proguard without asking users to mess with the xml files.
Comment: The NB Wiki contains some (although quite old) info here: http://wiki.netbeans.org/DevFaqModuleObfuscation . I couldn't find any NB feature/plug-in after so many years. However, I've decided to use it from the command line: https://github.com/Guardsquare/proguard


Quando devo usar a tag  ou a propriedade do CSS background?

Question: Quando devo usar uma tag  HTML para exibir uma imagem?
E background-image CSS?
Fatores como acessibilidade e suporte de navegador podem influenciar na escolha?
Comment: Não é uma resposta, só uma consideração inicial: img faz parte do conteudo, CSS não. Isso já seria um fator de decisão. Semanticamente se a imagem é parte do conteúdo, como um diagrama esquemático referido em um texto, o IMG faz mais sentido. Se é um elemento decorativo como uma textura de página, ou um detalhe gráfico, ou uma imagem complementar (como um logo no lugar do nome da empresa no cabeçalho) geralmente no CSS faz mais sentido. Não é regra geral nem absoluta, só quis adiantar o assunto.
Comment: CSS transitions, com `background-image`pode nos salvar às vezes =]
Comment: @LucasCosta isso dá pra fazer com IMG tambem, sem problemas.
Comment: @Bacco Bem colocado!
Answer: Usos recomendados da tag :

Quando é necessário que a imagem apareça no caso da página ser impressa. Os browsers não inserem imagens de fundo em impressões, por padrão.
Quando é importante inserir uma descrição da imagem (atributo alt). Esta informação é  importante em vários casos como: o usuário está com conexão à internet lenta e as imagens nao carregam (exibindo somente a descrição) ou até deficientes visuais que acessam a página podem saber do que se trata a imagem (através de um software que "fala" o texto da pagina incluindo a descrição das imagens).
Quando a imagem precisa ser indexada por buscadores.

Usos recomendados do background-image (CSS):

Quando a imagem não faz parte do conteúdo, ou seja, é parte do design do site.
Quando a imagem não deve aparecer quando o usuário imprimir a página.
Quando você quer usar CSS Sprites

Conclusão
Acredito que o fator conteúdo vs design, influencia mais na escolha entre img e background-image. Uma imagem que é parte do conteúdo usada como background-image pode prejudicar a acessibilidade e diminuir a chance de uma boa indexação da página em buscadores. Em relação à performance, em algumas pesquisas iniciais que fiz, não encontrei diferenças no tempo de carregamento. Uma diferença que encontrei foi que o background-image não carrega caso não esteja sendo usado, já a tag img carrega sempre.
Referência: When to use IMG vs. CSS background-image?  Are unused CSS images downloaded?
Comment: Muito obrigada, você sanou minhas duvidas. Excelente resposta!
Comment: @AlíciaTairini Que bom que a resposta te ajudou! =D
Answer: Minha resposta ficou assim:
A propriedade em CSS background-image só deve ser usada quando uma imagem for  decorativa ou seja, não tenha nenhum valor semântico  e só serve para deixar a pagina mais "bonitinha", se a imagem for realmente importante para entender o texto, deve ser utilizada a tag , e adicione o atributo alt para oferecer um texto alternativo a imagem (com CSS não é possível fazer isso).
Answer: Olá,
respondendo de uma forma pratica e simples podes usar as imagens no CSS caso queiras elas no fundo da tua página como background mesmo. E as com a tag img normais do corpo da imagem, como produtos novos ou outras secções do html. E não te esqueça a a tag img carrega sempre a imagem está é a melhos parte


ASP.NET AJAX Load Balancing Issues

Question: This would be a question for anyone who has code in the App_Code folder and uses a hardware load balancer. Its true the hardware load balancer could be set to sticky sessions to solve the issue, but in a perfect world, I would like the feature turned off.
When a file in the App_Code folder, and the site is not pre-compiled iis will generate random file names for these files.
<code>server1 "/ajax/SomeControl, App_Code.tjazq3hb.ashx"
server2 "/ajax/SomeControl, App_Code.wzp3akyu.ashx"
</code>
So when a user posts the page and gets transfered to the other server nothing works.
Does anyone have a solution for this? I could change to a pre-compiled web-site, but we would lose the ability for our QA department to just promote the changed files.
Answer: Do you have the <machinekey> node on both servers set to the same value?
You can override the machine.config file in web.config to set this. This needs to match otherwise you can get strange situations like this.
Comment: Looks like  only affects the ViewState
Answer: Does your load balancer supports sticky sessions? With this on, the balancer will route the same IP to the same server over and over within a certain time window. This way, all requests (AJAX or otherwise) from one client would always hit the same server in the cluster/farm.
Comment: Its true the hardware load balancer could be set to sticky sessions to solve the issue, but in a perfect world, I would like the feature turned off.
Answer: Ok, first things first... the MachineKey thing is true.  That should absolutely be set to the same on all of the load balanced machines.  I don't remember everything it affects, but do it anyway.
Second, go ahead and precompile the site.  You can actually still push out new versions, whenever there is a .cs file for a page that page gets recompiled.  What gets tricky is the app_code files which get compiled into a single dll.  However, if a change is made in there, you can upload the new dll and again everything should be fine.
To make things even easier, enable the "Used fixed naming and single page assemblies" option.  This will ensure things have the same name on each compilation, so you just test and then replace the changed .dll files.
All of that said, you shouldn't be having an issue as is.  The request goes to IIS, which just serves up the page and compiles as needed.  If the code behind is different on each machine it really shouldn't matter, the code is the same and that machine will reference it's own code.  The actual request/postback doesn't know or care about any of that.  Everything I said above should help simplify things, but it should be working anyway... so it's probably a machinekey issue.
Answer: If it's a hardware load balancer, you shouldn't have an issue, because all that is known there is the request URL, in which the server would compile the requested page and serve it.
the only issue i can think of that you might have is with session and view state.
Answer: Its true the hardware load balancer could be set to sticky sessions to solve the issue, but in a perfect world, I would like the feature turned off.
Answer: It appears that the  is only for ViewState encryption. It doesn't affect the file names for auto compiled assemblies.
Answer: You could move whatever is in your app_code to an external class library if your QA dept can promote that entire library.  I think you are stuck with sticky sessions if you can't find a convenient or tolerable way to switch to a pre-compiled site.
Comment: This only way I have fixed this problem, without turning on sticky sessions.
Answer: I think asp.net model has quite a bit dependency for encryption and machine specific storage, so I am not sure if it works to avoid sticky IP for session.
I don't know about ASP.NET AJAX (I use MonoRail NJS approach instead), but session state could be an issue for you.
You have to make sure session states are serializable, and don't use InMemory session. You probably need to run ASP.NET Session State Server to make sure the whole frontend farm are using the same session storage. In such case session has to be perfectly serializable (thats why no object in session is preferred, you have to always use ID, and I bet MS stick on this limitation when they do AJAX library development)

ASP.NET AJAX Load Balancing Issues


Win8 ComboBox IsDropDownOpen + Visibility causes Glitched UI

Question: I am developing a Windows 8 App using XAML and C#.
I have a problem with my ComboBox, and have a simple example to demonstrate it.

Add the following to a Layout Aware Page (New BasicPage)
<ComboBox x:Name="comboBox1" DropDownClosed="comboBox1_DropDownClosed" Visibility="Collapsed" HorizontalAlignment="Left" Margin="179,217,0,0" Grid.Row="1" VerticalAlignment="Top" Width="998" Height="51">
    <x:String>Option 1</x:String>
    <x:String>Option 2</x:String>
    <x:String>Option 3</x:String>
</ComboBox>
<Button Click="Button_Click" Margin="585,130,0,416" Grid.Row="1" Height="82" Width="154">
    <Viewbox>
        <TextBlock Text="Press Me" />
    </Viewbox>
</Button>

Add this to the page's CodeBehind
private void Button_Click(object sender, RoutedEventArgs e)
{
    comboBox1.Visibility = Windows.UI.Xaml.Visibility.Visible;
    comboBox1.IsDropDownOpen = true;
}

private void comboBox1_DropDownClosed(object sender, object e)
{
    comboBox1.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
}

Expected:
When the button is pressed, the ComboBox should appear and the options should expand, allowing the user to select one. Once the user has selected an option, the ComboBox disappears.
Actual Result:
When the button is pressed, nothing happens. If the button is pressed a second time, the ComboBox appears in a glitched state, and the app is essentially non-responsive. (All input is directed at the ComboBox, which never closes.
Note: The DropDownClosed event fires immediately after the Button_Click event does. Removing the event handler doesn't change anything, but it's interesting that the DropDownClosed event is firing.
Rejected Solution:
It was suggested to me to use Dispatcher.RunAsync to set IsDropDownOpen after the Visibility change has taken effect. This seems to be a race condition, because it only works some of the time. If there were a way to confirm that the ComboBox had been rendered visible, adding this check to the RunAsync method could solve the problem.
As a workaround, I'm currently delaying Dispatcher.RunAsync for 200 milliseconds, which is an annoying workaround. Any other ideas?
Comment: Is there no `Xaml` `Triggers` in `Metro`? seems odd to drag UI logic into code behind
Answer: You're right, you need to make sure comboBox1 is actually rendered visible, before trying to set IsDropDownOpen. The way to do it is to make the second call via Dispatcher:
private void Button_Click(object sender, RoutedEventArgs e)
{
    comboBox1.Visibility = Windows.UI.Xaml.Visibility.Visible;
    Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => comboBox1.IsDropDownOpen = true);
}

Comment: +1. This seems to work for me, and is probably a much better answer than mine. I'm curious as well on why this problem exists in the first place. Any further thoughts on why your solution works, or can you at least point me to some documentation?
Comment: This does not solve my issue. I'm familiar with `Dispatcher.RunAsync`, but I believe this solution is incomplete. Obviously, setting the `Visibility` property doesn't synchronously return only once the `ComboBox` has rendered, and I doubt that the task for rendering the `ComboBox` is guaranteed to complete before my dispatched call to `IsDropDownOpen`. Do I misunderstand? Perhaps there's a way to confirm that the ComboBox has been rendered: either a test on `comboBox1`/`Frame`, or a better understanding of UI Task scheduling, or setting `IsDropDownOpen` from a Rendered event or similar?
Comment: @chuex Unfortunately I didn't come across any documentation on the subject, although I'd be very interested in it as well. I have used this approach in similar situations before and it always worked for me. I don't have any definite proof but my understanding is that `Dispatcher.RunAsync` schedules the call on the UI thread while `CoreDispatcherPriority.Normal` means it is going to be processed in the order it was scheduled. Asuming that `Visibility` setter also schedules the rendering to the UI thread with normal priority, the calls should always be processed in the right order.
Comment: @Nathan Is there a case when it doesn't work for you, i.e. have you encountered a race condition? Or do you just doubt the solution will always work correctly? I'm really interested to know since as I've already mentioned in the above comment this approach has worked for me in similar situations.
Comment: The above solution works for a simple case, but it doesn't work in my actual app. Perhaps my simple example is too simple. In my actual app, despite using `Dispatcher.RunAsync`, the glitched UI sometimes appears as if I had not used `Dispatcher.RunAsync`. But, as I mentioned, after delaying the dispatched method with `await Task.Delay(200);` before setting `IsDropDownOpen`, the glitch hasn't occurred yet. Doesn't this strongly suggest a race condition?
Comment: @Nathan Well, it does. Unless there's something else affecting the behavior in your case, I might indeed be missing something in my simplified understanding of UI scheduling.
Answer: What a nasty bug, ah?
A simple workaround is instead of using the Visibility property, use Opacity. It works as expected:
   <ComboBox x:Name="comboBox1" DropDownClosed="comboBox1_DropDownClosed" Opacity="0" HorizontalAlignment="Left" Margin="179,217,0,0" Grid.Row="1" VerticalAlignment="Top" Width="998" Height="51">
        <x:String>Option 1</x:String>
        <x:String>Option 2</x:String>
        <x:String>Option 3</x:String>
    </ComboBox>

    private void Button_Click(object sender, RoutedEventArgs e) {
        comboBox1.Opacity = 1;
        comboBox1.IsDropDownOpen = true;
    }

    private void comboBox1_DropDownClosed(object sender, object e) {
        comboBox1.Opacity = 0;
    }

Cheers!
Comment: Nathan will tell if this workaround fits him. `Visibility = Collapsed` is not exactly the same as `Opacity = 0`, but it might be close enough. Anyway, I'm more interested in getting to the bottom of the original issue than finding workarounds for it :)
Comment: Thanks Andre, I think this may work for now. Of course, it forces me to hide the control in some other way because I can still tap a transparent ComboBox, and it causes Auto-sizing `Grid`s to reserve space. I agree with Damir, I'd prefer to have a working `Visibility`, but this seems to be a great alternative to a 200ms delay.
Answer: I've tested the following on my desktop and Surface device, and it seems to work all the time.  It is a variation on delaying setting IsDropDownOpen.  I understand you may have tried some variation of this that produced a race condition. I am not seeing a race condtion, so hopefully it works for you as well.
// need this for Task
using System.Threading.Tasks;
...

// note async keyword added to function signature
async private void Button_Click(object sender, RoutedEventArgs e)
{
    comboBox1.Visibility = Windows.UI.Xaml.Visibility.Visible;
    // add small delay before opening dropdown
    await Task.Delay(1);
    comboBox1.IsDropDownOpen = true;
}


R loop through name and element

Question: So far I only have 5 of these for each line, but soon I will have over 20 so I need to find a better way to do this. I was thinking of for loops but I don't know how to iterate over the numbers on the names (mt1, mt2, and so on).
mt1<- do.call(cbind, dataoutput[[1]])
mt2<- do.call(cbind, dataoutput[[2]])
mt3<- do.call(cbind, dataoutput[[3]])
mt4<- do.call(cbind, dataoutput[[4]])
mt5<- do.call(cbind, dataoutput[[5]])

rownames(mt1)[1:No.file]<-paste("file", 1:No.file, sep=" ")
rownames(mt2)[1:No.file]<-paste("file", 1:No.file, sep=" ")
rownames(mt3)[1:No.file]<-paste("file", 1:No.file, sep=" ")
rownames(mt4)[1:No.file]<-paste("file", 1:No.file, sep=" ")
rownames(mt5)[1:No.file]<-paste("file", 1:No.file, sep=" ")

library(reshape)
mt11<-melt(mt1, id.vars="Legend")
mt21<-melt(mt2, id.vars="Legend")
mt31<-melt(mt3, id.vars="Legend")
mt41<-melt(mt4, id.vars="Legend")
mt51<-melt(mt5, id.vars="Legend")

Comment: could you show an example of `dataoutput`?
Answer: You can use lapply, for example:
lapply(1:5,function(i){
       mt <- do.call(cbind, dataoutput[[i]])
       rownames(mt)[1:No.file]<- paste("file", 1:No.file, sep=" ")
       mt.melt <-melt(mt, id.vars="Legend")
})

Here you get a list of data.frame which is much better than having separate variables.
Note that paste("file", 1:No.file, sep=" ") is identical for all the data.frame's.
EDIT
In this case it is better to loop over , this will handle the case when dataoutput has length==0 and avoid error like subscript out of bounds
lapply(dataoutput,function(do){
       mt <- do.call(cbind, do)
       rownames(mt)[1:No.file]<- paste("file", 1:No.file, sep=" ")
       mt.melt <-melt(mt, id.vars="Legend")
})

Comment: Since `i` is used only once, you could make `lapply` loop over `dataoutput`. It will also handle the case when `dataoutput` has length==0 gracefully.
Comment: @flodel I edit my post according to your comment. merci beaucoup:)

R loop through name and element


Matlab - Multiplication of matrices $A.B$, A being a triangular matrix

Question: I have this code for the multiplication $A.B=C$, $A(m,p)$, $B(p,n):$
C = zeros(m,n)
for j=1:n
   aux = zeros(m,1)
   for k=1:p
      for i=1:m
         aux(i) = aux(i)+A(i,k)*B(k,j)
      end
   end
   C(:,j) = aux
 end

How can I rewrite this code for $A$, $a_{ij}=0$, $i<j$, in a way that these null elements will not be acessed?
What I tried, but is wrong:
C = zeros(m,n)
for j=1:n
   aux = zeros(m,1)
   for k=1:p
      for i=1:m
         if i<=j
            aux(i) = aux(i)+A(i,k)*B(k,j)
         end
      end
   end
   C(:,j) = aux
 end

Answer: $$C_{ij}=\sum_{k=1}^n A_{ik}B_{kj}$$
When $i < k$, $A_{ik}=0$, hence we can simplify the expression above as
$$C_{ij}=\sum_{\color{red}k=1}^\color{red}i A_{ik}B_{kj}$$
Try to edit your based on the expression above.
Comment: I get confused with $j$ and $k$ and I didn't notice.


deleteing multiple files in remote box via sh

Question:
Requirement

Several files in remote machines ought to be deleted via sh. Name of the files to be deleted are know

Approach

1) script was written with ftp (requires credential) and delete command. File names were passed as array(iterated via for loop-with ftp+delete commands enclosed within for loop). files were not getting deleted by this approach
2) another approach attempted was to pass temp.ftp(which contains delete command) to ftp command and rm the temp.ftp file eg.ftp <

Request

require pointers to delete muliple files in remote machine via shell script
Answer: I recommend using ssh instead of ftp for interfacing with the remote unix machine.
SSH allows you to run remote commands easily and securely.
Read this article for more info.


How to show that $\sum_{g\in G} \phi (g) = 0$?

Question: If $\phi \ne 1  \in \hat G$  where G is   an abelian group , show  that $\sum_{g\in G} \phi (g) = 0$
My attempts  : It is  sufficient to show  that $g\in G\setminus\{1\}$ then there exists $\phi$ such that $\phi(g)\neq 1$.
After that  I am not able  to show that $\sum_{g\in G} \phi (g) = 0$
Any hints/solution  will be appreciated, thanks  in advance
Comment: @NicolasHemelsoet  So the OP should have written $1 \neq \phi \in \hat G$. ($1/2 \neq 2 \in \Bbb{Z}$ is true and does not imply that $1/2 \in \Bbb{Z}$.)
Comment: $\phi$ is a character, as written $\phi \in \hat G$.
Answer: Hint : If $S$ is your sum show that $S = \phi(h)S$ where $h \in G$ is such that $\phi(h) \neq 1$. It works even if $G$ is not abelian.
Comment: @stupid : Try to show that $S = \phi(h)S$. For this, use that $\phi$ is a morphism of groups and that $g \mapsto hg$ is a bijection.
Comment: @stupid : have you figured out ?
Comment: @stupid : great !
Comment: thanks for  answer  @Nicolas      can u u more  elaborate  ur answer...as  im not  getting  much
Comment: ya  i got its@Nicolas


Moving average for continuous functions

Question: In statistics, the moving average is usually defined for discrete data sets. Is there a moving average concept for continuous randomly fast-oscillating functions? I am seeking for the moving average determined in terms of integrals rather than sums.
Answer: You could simply use the mean value of the function in each window.
A "backward-looking" moving average with window size $w$ is
$$
\mbox{MA}_w^\text{b}(t) = \frac{1}{w} \int_{t-w}^t f(x)dx ,
$$
and a "centered" moving average is
$$
\mbox{MA}_w^\text{c}(t) = \frac{1}{w} \int_{t-w/2}^{t+w/2} f(x)dx .
$$
Comment: Seems nice! Do you have a reference to a textbook or paper where this definition is utilized?
Comment: I don't have a reference where the suggested function is used to compute the moving average; I just customized the [first mean value theorem](http://en.wikipedia.org/wiki/Mean_value_theorem#First_mean_value_theorem_for_integration) to your needs.

Moving average for continuous functions


In linear models, why are we focused on BLUE rather than UMVUE?

Question: It seems more natural to talk about UMVUE (following the basic statistical estimation theory). But when we turn to lm, we only care about BLUE, why? Are there any insurmountable difficulties here?
Comment: The statement "we only care..." is baseless.
Answer: The BLUE of an estimable linear parametric function (elpf) is literally the linear analogue of UMVUE. Like as in the case of UMVUE, an elpf is BLUE if and only if it is uncorrelated with every linear zero functions (lzf).
When in $\langle \mathbf y, \mathbf X\boldsymbol\beta, \sigma^2\mathbb I\rangle, $ the dependent vector is following multivariate normal distribution, then the BLUE of any elpf is UMVUE and and any lzf is ancillary to it.

Reference:
$\rm [I]$ Linear Models: An Integrated Approach, Debasis Sengupta, Sreenivasa Rao Jammalamadaka, World Scientific, $2003, $ sec. $4.3.$


How to set multiple object value with special key on react js

Question: i need your help to set the new value in multiple object. I had object like this:
constructor(props){
 this.state = {
  objData : [{
    score:{q1:null,q2:null,q3:null},
    data:{id:123, name:"Steven CHS"}
    },
    {
    score:{q1:null,q2:null,q3:null},
    data:{id:124, name:"Christian"}
    },
  ]
 }
}

and i would like to change the value by key q1,q2, anda q3. When i tried to use destructor like this, it's not working.
const handleChangeScore = (e,type,id) =>{
      const cScore = e.target.value;
      this.setState((state) => {
          return {
              objData: state.objData.map((item) => {
              if(item.data.id !== e.target.name) return item;
              else return {...item.score.q1, cScore};
            })
          };
      });
}

this is the JSX where handleChangeScore() is used:
this.state.objData .map((v,index)=>(

        {index+1}
        {v.data.id} - {v.data.name}
        <input type="text" name={v.data.id} className="form-control" onChange={(e)=>handleChangeScore(e,"q1",v.data.id)} defaultValue={(v.score.q1) ? v.score.q1 : 0} />
        <input type="text" name={v.data.id} className="form-control" onChange={(e)=>handleChangeScore(e,"q2",v.data.id)} defaultValue={(v.score.q2) ? v.score.q2: 0} />

))

The problem is when i use destructor to change the value on multiple object with specific key its not work or not change the value. Can anyone help me to fix my code ? Here's the full code in codesanbox
Answer: Few things to be fixed

Your item.data.id is number and e.target.name is string. To compare them without type comparison use != instead of !==.

The else block should be corrected as below.

  handleChangeScore = (e, type, id) => {
    const cScore = e.target.value;
    this.setState((state) => {
      return {
        ...state,
        objData: state.objData.map((item) => {
          if (item.data.id != e.target.name) return item;
          else {
            return { ...item, score: { ...item.score, [type]: cScore } };
          }
        })
      };
    });
  };

Code Sandbox
Comment: Wow... thx for your help dud..
Comment: @Febry Fairuz, check this out !!
Answer: Try below code no need to use map(). just pass the index in this.handleChangeScore() function !
And put handleChangeScore() this function in outside of render() !
export class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      objData: [
        {
          score: { q1: null, q2: null, q3: null },
          data: { id: 123, name: "Steven CHS" }
        },
        {
          score: { q1: null, q2: null, q3: null },
          data: { id: 124, name: "Christian" }
        }
      ]
    };
  }

  handleChangeScore = (value, index, childObj) => {
    this.state.objData[index].score[childObj] = value;
    this.setState(this.state);
  };

  render() {
    return (

          {this.state.objData.map((v, index) => (

              {index + 1}

                {v.data.id} - {v.data.name}

                <input
                  type="text"
                  name={v.data.id}
                  className="form-control"
                  onChange={(e) => this.handleChangeScore(e.target.value, index, "q1")}
                  defaultValue={v.score.q1 ? v.score.q1 : 0}
                />

                <input
                  type="text"
                  name={v.data.id}
                  className="form-control"
                  onChange={(e) => this.handleChangeScore(e.target.value, index, "q2")}
                  defaultValue={v.score.q2 ? v.score.q2 : 0}
                />

          ))}

    );
  }
}

export default App;

Comment: @Febry Fairuz, check my answer ! no need use `map()`


Android - Hide text cursor input React Native

Question: I am using React Native and I would like to remove the cursor from text input.
How can I remove the cursor either using JavaScript or Android Functionality ?
Answer: Try:
<TextInput caretHidden={true} ... />

See: https://facebook.github.io/react-native/docs/textinput#carethidden
Answer: Add caretHidden to the TextInput :
<TextInput caretHidden ... />


Making a page within a div refresh on a click

Question: I am playing with things here above my head but am desperately trying to learn.
I have an administration page, using jquery I display a hidden div that displays a another page inside.
I do this using:
$(document).ready(function(){
  $("a#fadeoutblog").click(function(){
    $("#page").fadeTo("slow",0.25)
    $("#terms4").fadeIn("slow")
    $("#back2").fadeIn("slow")
    $("#terms4").load("blogpageload.php")
     }); });

So terms4 is the div on the admin page and it diplays the page blogpageload.php!
On this page is a table that displays all the posts of a really simple blog, 'a' delete post a tag and an approve post 'a' tag (which just sets the approved column to 'Y' in the database). What i want is for the page inside this div to refresh when a post in the table is deleted(or the delete 'a' tag is clicked). The problem is that when you click on the delete 'a' tag we are sent to the ammendblogdatabase.php page first so that the post can be deleted!.
I have tried multiple methods but they all have problems!
The main part that is causing problems is that to view this div that contains a page the user must first click on another a tag that uses a jquery to stop the 'display: none;'.
Im not sure what code you may need to see but please ask....
This is the information in the table cell with the delete button:
echo "Delete";

Thank you!
Comment: Read this - I presume you are looking for partial refresh of some sort but this link should help: http://stackoverflow.com/questions/932777/jquery-reload-divs-content-dynamically-rendered cheers!
Comment: as I understand you are not using ajax for deleting post, just make delete process with ajax and refresh table again in succes.
Answer: The problem you're most likely having is binding to "future" elements (e.g. elements that will be on the page, but aren't yet). To overcome this, you can use .on() to avoid this.
$('#terms4').on('click','a',function(){
  // will bind to anchor elements in #terms4 at the time of execution
  // (most likely page ready) and look for future anchors added (in
  // the case of .load() completing)
});

From there, you can bind your own show/hide event, maybe call an ajax method that deletes the entry behind the scenes, and make a re-call to .load again and refresh the page.
Comment: Shouldn't the `a` be in the selector of the `on()` call: `$('#terms4').on('click','a',function(){ /*...stuff...*/ });`?
Comment: @DavidThomas: Good call. It's funny, had it all out in my head, then got distracted and tried to re-finish my thought. Thanks and good looking out. ;-)
Comment: No worries, when I spot something like that I tend to assume there's a super-secret usage of jQuery that I've yet to appreciate... =D And +1 for the answer!


Find the values of the parameter p, with which the equation $\frac{(x-8)(x-4p)}{x^2-16x+48}=0$ has one root.

Question: Find the values of the parameter p, with which the equation $\frac{(x-8)(x-4p)}{x^2-16x+48}=0$ has one root.
I know that, if Discriminant is equal to $0$ then equation has $1$ root. But what if we have a fraction ?
Please provide me with a hint.
Comment: HINT: What happens when some $x$ cancels both numerator and denominator?
Comment: Also consider the case when the Nr has a double root.
Answer: When you have a rational function equation:
$$
\frac{P(x)}{Q(x)} = 0,
$$
it is effectively the same as two equations:
$$
\begin{cases}P(x) = 0,\\Q(x)\neq 0.\end{cases}
$$
So either $P(x)$ has 1 root which isn't the root of $Q(x)$ or all but 1 root of $P(x)$ are the roots of $Q(x)$
Comment: Now I understand how to find p. I need to find the sum of all p's. My textbook answer says it is 6. Is there a mistake, since I found that only $p=2$ ?
Comment: Check  hamam_Abdallah solution
Answer: $$x^2-16x+48=x^2-16x+64-16$$
$$=(x-8)^2-16$$
$$=(x-8+4)(x-8-4)$$
$$=(x-4)(x-12)$$
So, if $ x\ne 4$ and $ x\ne 12$,
$$\frac{(x-8)(x-4p)}{x^2-16x+48}=0$$
$$\iff (x-4)(x-4p)=0$$
$$\iff x=8 \vee x=4p$$
where $ p\ne 1$ and $ p\ne 3$.
If $ p=1 $ or $ p=3 $ then $ x=8 $ is the unique root.
There will be one root if $$4p=8 \vee p=1 \vee  p=3$$
Comment: This isn't correct. There will be one root if $p = 1,2,3$.


Hope to create gmail attachment preview like functionality using angularjs

Question: I have a requirement where I want to show the file preview to the users.
There are various file types which are supported like; .pdf, .xlsx, .doc, .rar, .jpeg, .png and many more.
When user clicks on the preview it should open the file in popup where preview of the file is shown to him. User can Zoom-in, Zoom-out, Download the file. Just as you can see into gmail for attachment preview.
Please, can anyone guide me to any relevant library or helpful resource for the same.
Thanks in advance
Comment: This question is way too broad to have a reasonable answer.
Comment: what happens on zoom-in/zoom-out? should it work only for images or for archives as well?
Comment: You don't mention what serverside tech stack you are using. You would need to render your preview serverside and send a preview image to the browser.
Comment: I recommend @AdrianBrand's Server-side solution. What's backend technology?
Answer: There are two main ways you can do this.
1) Server-side: Render previews once server-side (on file upload) into jpg/png images, and store the previews on the server. This is the easiest to implement on the client side, but requires extra storage on the server.
2) Client-side: Render the previews 'live' with javascript in browser, this reduces the amount the server has to do/store, but does require the client to fully download the file in-memory before it can render the preview, which for large files could be an issue. Also, you would need javascript libraries included for likely each individual file type, since most libraries will target one specific file format.
Server-Side is probably the recommended way to go. What are you using for your web server?
Answer: You are looking at creating document viewer.
Belive me its big work as browser does not understand these formats. Browser can render images directly on canvas but it does not know how to render the other files. So, any file other than image formats, one need to save them temporarily on server and then stream on the browser and show them using the respective file viewer.
You can convert doc and xlsx files to pdf and show these files using pdf viewer (http://ngmodules.org/modules/ng-pdfviewer). There are plenty of document converters available on internet (however you will need to check the licensing terms as most of them are GPL licensed, hense can not be used in commercial projects).
If you want to save this work then go for third party server those take all paint to convert documents in html5  such as https://crocodoc.com/why-crocodoc/
You can also try using google doc viewer google doc veiwer
Answer: This question is fairly broad. I'm not going through all the steps of how to implement an attachment viewer directive, but here are some pointers you might find useful.
To allow the user to download the file, you simply put a download link somewhere. If you are hosting the attachment on Amazon S3, Google Cloud Storage or some other cloud storage service, check their documentation. If you're downloading the files from your own server, make sure to set the Content-Disposition HTTP response header to attachment; filename="ORIGINAL_FILENAME", where ORIGINAL_FILENAME is the file name you want to user to see in the save dialog that appears when they click the download link.
Now on to the viewer.
For PDF files, I'd use pdfJS. There's an angular directive for it here.
You could look at something like CloudConvert for other files, to convert ehm to a PDF, and then displaying them in pdfJS, but then you probably want to store the PDF on your server as well, in addition to the original files, which requires extra storage. You might also be able to use the Google Docs viewer, or Office 365 viewer, as described in this answer.


Does there exists a one time differentiable function?

Question:
Does there exists a only one time differentiable function $f$ in an interval $[a,b]$ whose derivative is monotone increasing in $[a,b]$ ? That is, does there exists a function $f$ in $[a,b]$ such that $f'$ exists for all $x\in [a,b]$ and $f'$ is monotone increasing in $[a,b]$ but $f''$ does not exists at some point in $[a,b]$.

I guess there exists such a function. I'm trying to define such function but unable!!
Any hint?
Comment: If a function is non-decreasing, its derivative exists almost everywhere... But take the function $f'(x) = \chi_{[0,\infty)}x$ (i.e., $f(x) = \int_0^x\chi_{[0,\infty)}(t)t\,dt$). That's an example.
Comment: @amsmath Edited. Please recheck it.
Comment: Check out my example. $f(x)$ is zero for negative $x$ and otherwise a parabola.
Answer: Define $f:[-1,1]\to\mathbb R$ by
$$
f(x) =
\begin{cases}
0&\text{for $x<0$}\\
x^2&\text{for $x\ge 0$}
\end{cases}.
$$


Extracting information from simultaneous boolean AND, XOR, and NOT

Question: I'm looking to extract some information from a series of equations with AND, XOR and NOT. I've already covered all of the easy parts using various boolean identities, so I'm looking to now determine if there are any non-obvious sources of information.
Right now, I've got this simultaneous equation which can yield extra information where c1 and c2 are known, and a and b are unknown:
a ^ b = c1
a && b = c2

a b c1 c2
0 0 0  0
1 0 1  0
0 1 1  0
1 1 0  1

When both c1 and c2 are false, then a and b must also be false.
However, I've been unable to determine any other scenarios, simultaneous or otherwise, which can yield additional information.
What I would like to know is

Are there any other ways of extracting information?
Can I prove that I have all of it?

Edit: What I'm looking for, exactly, are other simultaneous equations or identities of this, or a similar, form, which may (depending on the values of constants) allow me to prove additional values for unknowns. I have already exhausted the avenues through single-operator equations.
Answer: It seems to me that the best you can do is:

If $c_2$ is true, then both $a$ and $b$ are true.
Otherwise, if $c_1$ is false, then both $a$ and $b$ are false.
Otherwise exactly one of $a$ and $b$ is true, but you don't know which.

Both logical are and logical exclusive or are symmetric functions of their two arguments.  Neither one distinguishes between its two inputs, so there's clearly no way you're going to be able to distinguish the situations where one of the inputs is true and one is false.
Comment: Oh yes, I know that, and it's fine. I'm looking for other situations, like this, which *may* yield information.
Comment: In that case I don't understand your question. Maybe you could edit it to clarify what you are looking for.


Query string paginação com codeigniter

Question: Como posso fazer busca com paginação usando query string no CodeIgniter? Estou tentando procurar na documentação mas não encontrei! Tenho seguinte cenário:
<code>http://localhost/meusite/procurar/s?search_state=RJ&search_city=Rio+de+Janeiro
</code>
Se fosse em uma pagina sem busca ficaria fácil, bastaria indicar a página principal que será exibida a listagem, mas como um sistema de busca como faço para quando clicar na próxima página manter o critério da busca no get?
Comment: @ThiMoreira, você pode responder sua própria pergunta :). Coloque a solução como resposta e aprove ela. Depois pode remover o "RESPONDIDO" do título da sua pergunta e, de preferência, remover a solução da sua pergunta. Assim fica mais organizado. Entendeu? E seja bem-vindo ao SOpt!
Comment: Desculpa @Dherik por ter feito a edição de forma errada, sou novo aqui e ainda não adaptei! Obrigado pelo conselho!
Comment: Apesar de estar em inglês, é um exemplo interessante que pode te ajudar: https://stackoverflow.com/questions/40542031/how-to-make-pagination-query-string-in-codeigniter
Comment: @RicardoPontual não tem problema estar em outro idioma, mas ali é com apenas uma query string, no meu caso são duas, sem contar que depois virá a da paginação! O problema maior está que o uri->segment so identifica o até o 'S' e ignora totalmente o resto, sendo assim eu não consigo passar todo o link para o array $config['base_url']
Comment: Obrigado @RicardoPontual pela disposição em ajudar, editei o post da maneira que consegui resolver, não sei se foi a melhor maneira, mas resolveu pra mim, obrigado novamente!
Comment: @ThiMoreira, que isto, acabou de chegar, normal cometer alguns erros :). O SOpt agradece a edição! rs. Aliás, você pode aceitar sua resposta clicando no botão de checkmark
Answer: RESOLVIDO DA SEGUINTE FORMA:
Como o problema era identificar qual seria o número da paginação, então fiz dessa forma, não sei se é a melhor, mas funcionou pra mim:
<code>     $state   = $this->input->get('search_state');
     $city    = $this->input->get('search_city');

     $urlExp  =  explode("=", $_SERVER['QUERY_STRING'] );

     $maximum                   = 1;
     $start                     = isset( $urlExp[3] ) ? $urlExp[3] : 0;

     $config['base_url']        = base_url( 'procurar/result?search_state=' .$state. '&search_city=' .$city. '' );
</code>

Query string paginação com codeigniter


What's the (italian or classical) name of a single slash repeat?

Question: I know, the "percent" sign, to repeat the previous bar, is also called due volte. See here:

taken from here.
However, I'm looking for the (classical name of a) single slash, like here in the first line:

found here.
"Slash" I know from drum notation, where I feel it's a bit of a slang word.
Background: I'm using Latex' MusiXTeX on occasion. It's fairly complete, but the slash repeat may either be missing OR be available under a peculiar name. E.g. the duevolte is both documented and in the Tex code, while "slash" isn't. Also section on %% repeats wasn't revealing so far.
Hence: What is its name (and synonyms) in music theory, besides "slash"?
P.S.: According to the first two comments I'd like to add from Unicode (here wrt HTML), category "figure repetition":

See also in slash noteheads in SMuFL (Standard Music Font Library)
Comment: It might be worthwhile to note that the Unicode Consortium calls them `MUSICAL SYMBOL REPEATED FIGURE-1`, `MUSICAL SYMBOL REPEATED FIGURE-2`, and `MUSICAL SYMBOL REPEATED FIGURE-3`.
Comment: In researching this I found that Unicode has left out `//`, meaning "repeat the previous two beats."  Mozart used it in his variations on "Ah, vous dirai-je Maman": ([at IMSLP](https://imslp.org/wiki/12_Variations_on_'Ah%2C_vous_dirai-je_maman'%2C_K.265%2F300e_(Mozart%2C_Wolfgang_Amadeus))) ([direct link to manuscript download page](https://imslp.org/wiki/Special:ImagefromIndex/472376/putr))
Answer: Dolmetsch' chart of musical symbols provides the term simile marks for any slash and percent symbol.
Elaine Gould "Behind Bars" does not give names for the symbols, but describes their functions similar to your source as beat repeat, bar repeat and double bar repeat.
Comment: The Unicode Consortium calls them `MUSICAL SYMBOL REPEATED FIGURE-1`, `MUSICAL SYMBOL REPEATED FIGURE-2`, and `MUSICAL SYMBOL REPEATED FIGURE-3`, which I would argue may be seen as a direct translation of _simile_ from Italian to compu-bureaucratical English.  I wouldn't be surprised if they had started off calling them `SIMILE-1` and so on but found that the word was too unfamiliar to most English speakers and perhaps too similar to the word "smile."
Answer: As your linked answer already states this would signify something we'd call simile, which means something like (continue) alike. That being said: These markings are a bit uncommon in classical music, so there not really a lot of commonly used "music speak" terminology for this.
Comment: They're relatively common in classical composers' manuscripts, but they are not commonly used in published performing materials.
Comment: In addition to working manuscripts, they're also typically found in fair copies prepared for a copyist or engraver who will be preparing parts or a published score.  They're certainly prevalent enough to have a name; I rather suspect that the name isn't well known because they were typically used in a "private" context.  I mean that the only people who would encounter them were professionals, so teaching materials for beginners didn't need to explain them; the professionals would learn about them orally.
Comment: @phoog Cool to know (although engraving manuscripts are a whole different thing compared to fair copies, as these would contain corrections and instructions for the editor (there is this anecdote by Littlewood who allegedly had a typesetter who misstook a correction "Now make epsilon as small as possible" as an instruction and printed the smallest epsilon letter he had ...))
Comment: Should that be "performance materials"?
Comment: @phoog That's fair, yes, although that should mostly be the case for working manuscripts, not the final one. Point is that these things are not prevalent enough to really give rise to common terms these are called by. Usually people would just say their languages equivalent of *slash*.
Comment: Don't those manuscripts start off as fair copies?


planned contrast with **emmeans** on interaction term in mixed model

Question: I think this is simple: I want to test if a treatment (that I know a priori does something) is stronger in one group vs. the other (in the presence of random effects). This seems like it should be straightforward with emmeans, but I'm struggling to find the example that matches my use case and would love a pointer. Below is a simulated dataset and where I got to so far...
How do I compare the strength of treatment between my two groups f2 == "A" and f2 == "B"?
I am partly asking for the right emmeans syntax, but also not sure which p-value correction is appropriate in a situation like this.
Thanks!
# load libraries
library(tidyverse)
library(lme4)
library(emmeans)

# simulate data
# this is a slight modification from glmer.nb test data from Ben Bolker
dd <- expand.grid(f1 = factor(1:2), # changed to 2 from 3; this is treatment
                  f2 = LETTERS[1:2] # this is the "group"
                  , g = 1:9 # random effect
                  , rep = 1:600
                  , KEEP.OUT.ATTRS = FALSE)
# in documentation, BB didn't simulate `mu` as a function of `g` but I will
# this avoids singular fits
summary(mu <- 5*(-4 + with(dd, as.integer(f1) + 4*as.numeric(f2) + g/5)))
dd$y <- rnbinom(nrow(dd), mu = mu, size = 0.5)
str(dd)

# define and fit model
my_formula <- "y ~ f1:f2 + f1 + f2 + (1|g)"

my_mod <- glmer.nb(formula = my_formula
                   , data = dd
                   # , control = glmerControl(maxit = 1e6)
)

# what I want to say is whether the treatment("f1") is stronger for one group
# vs. the other (i.e `f2 == "A"` vs. `f2 == "B"`)

# I thought the way to do this (in a planned contrast framework) might be to
# estimate marginal means (with `emmeans::emmeans`) and then calculate adjusted
# p-values for the interaction term of interest here

# my first stab was this:

emm_first<-emmeans(my_mod
                   ,  trt.vs.ctrl~ f1|f2)

# then, to get the contrast
contrast(emm_first
         , method = "trt.vs.ctrl")

# which returns 0s. Is this right (and I simulated wrong), or am I using emmeans
# wrong?

UPDATE
@RussLenth suggested modifying the last line to
contrast(emm_first
        , method = "trt.vs.ctrl"
         , by = NULL)

Which returns great-looking ouptput:
$emmeans
 contrast      estimate     SE  df z.ratio p.value
 f12 A - f11 A    0.377 0.0277 Inf  13.603  <.0001
 f11 B - f11 A    1.124 0.0276 Inf  40.692  <.0001
 f12 B - f11 A    1.252 0.0276 Inf  45.385  <.0001

Results are given on the log (not the response) scale.
P value adjustment: dunnettx method for 3 tests

$contrasts
 contrast                      estimate     SE  df z.ratio p.value
 (f12 - f11 B) - (f12 - f11 A)   -0.248 0.0389 Inf  -6.374  <.0001

Results are given on the log (not the response) scale.

Final question: is this "dunnettx" p-value the best choice for asking my question?
Comment: emm_first still "remembers" f2 as the by variable. try adding by = NULL to the contrast call.
Comment: BTW, I wonder why you named the factors "f1" and "f2" rather than "treatment" and "group". I don't think it improves an analysis to make the variable names abstract. In fact, it puts up a barrier in interpreting the results.
Comment: @RussLenth Thanks! When adding `by = NULL` I get an output that looks right! Is this a sensible p-value for a planned contrast? FWIW I agree on variable names. I basically copy-pasted the example given in `?lme4::glmer.nb` to avoid thinking too hard about the simulation :P
Answer: I can't reproduce the results here exactly because the random-number seed is not given. But there is some confusion here because, due to the two-sided formula, emm_first is a list of two objects. If I understand the question, we want the contrasts only of the second one -- i.e., a contrast of contrasts:
> contrast(emm_first[[2]]
+          , method = "trt.vs.ctrl"
+          , by = NULL)
 contrast                      estimate     SE  df z.ratio p.value
 (f12 - f11 B) - (f12 - f11 A)   -0.221 0.0392 Inf  -5.631  <.0001

Results are given on the log (not the response) scale.

This is an example of an interaction contrast. Below are the means and the required interaction contrast:
> (EMM <- emmeans(my_mod, ~ f1 * f2))
 f1 f2 emmean     SE  df asymp.LCL asymp.UCL
 1  A    2.28 0.0580 Inf      2.17      2.40
 2  A    2.69 0.0580 Inf      2.57      2.80
 1  B    3.37 0.0579 Inf      3.25      3.48
 2  B    3.55 0.0579 Inf      3.43      3.66

Results are given on the log (not the response) scale.
Confidence level used: 0.95

> contrast(EMM, interaction = "trt.vs.ctrl")
 f1_trt.vs.ctrl f2_trt.vs.ctrl estimate     SE  df z.ratio p.value
 2 - 1          B - A            -0.221 0.0392 Inf  -5.631  <.0001

Results are given on the log (not the response) scale.

Note that the same result is obtained.
This is discussed more fully in the vignette on interactions in the emmeans package.
Side note: Due to fairly widespread confusion resulting from follow-up analyses when a two-sided formula was used, versions after 1.7.4-1 will just do the contrast on the first one in the list (in this case, not the one desired), with a message.
Comment: The one you have. It is just one test, so there is no multiplicity adjustment. There is no law that says you have to do an ANOVA first -- those really are most useful for model selection, and their importance for testing (as opposed to just summarizing the contributions of model terms) is over-rated, IMO.
Comment: Thanks for this answer, which fully addresses how to use **emmeans** to obtain the relevant contrast. Could you also comment on the correct p-value computation (which method is preferred for this and why)?
Comment: Really appreciate all the support you give on this site to help people learn your package, it's super. Thank you!
Comment: In the vignette, it seems contrasts are considered post-hoc, I'd like to leverage any power I can from having a well-formulated question :-). What is the least-conservative, appropriate p-value for a pre-hoc planned comparison of an interaction term? Thanks!!


Importar bot chatterbot para o telegram

Question: Eu não sei se esse tipo de pergunta é bem vinda aqui, mas vamos lá:
Estou desenvolvendo um chatbot em python e escolhi a biblioteca chatterbot por causa do processamento de linguagem natural, pela capacidade de usar mais de um corpus e principalmente pela capacidade de o bot aprender a conversar com o próprio usuário.
O bot feito com o chatterbot roda pelo CMD, mas eu gostaria de colocar ele no telegram.
Implementei o código da resposta abaixo e por mais que meu chatbot esteja funcionando no computador, no telegram ele não responde as mensagens. Alguém poderia me ajudar?
import os
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from telegram.ext import Updater, MessageHandler, Filters

# Define a função que responderá no Telegram
def response(update, context):
    bot_response = bot.get_response(update.message.text)
    update.message.reply_text(bot_response)

def main():
    # Inicia o bot do Telegram
    updater = Updater("o meu token ta aqui, eu juro")

    # Pega o disparador do Telegram
    dp = updater.dispatcher

    # Adiciona a função ao bot
    dp.add_handler(MessageHandler(Filters.text, response))

if __name__ == '__main__':
    main()

bot = ChatBot("Futaba")

trainer = ListTrainer(bot)

for arquivos in os.listdir('arquivos'):
    chats = open('arquivos/' + arquivos, 'r', encoding="utf8").readlines()
    trainer.train(chats)

print("Hey, meu nome é Futaba e você pode se sentir confortável para conversar comigo mesmo que conversar não seja lá a coisa mais confortável pra você.")
response = bot.get_response("Hey!")
print(response)

while True:
    resq = input('Você: ')
    resp = bot.get_response(resq)
    if float(response.confidence) > 0.5:
        print('Futaba: ' + str(resp))
    else:
        print('Como você tem se sentido?')

Comment: Naturalmente que sim. O Chatterbot não define como você obterá a mensagem a ser tratada, então basta você fazer a integração com a API do Telegram e obter as mensagens a partir dela (e enviar a resposta por ela também).
Comment: Aaaah, entendi! Então eu posso continuar usando o chatterbot pra desenvolver o bot, não preciso usar o framework python-telegram-bot, só usar a API mesmo do telegram direto.
Comment: Mas é óbvio que ele não responderá ao Telegram, você nem colocou o bot para ler as mensagens dele. Você leu a documentação citada? Viu que precisa chamar outros métodos além do que eu citei na resposta? Aliás, com a sua edição você invalidou a minha resposta, tanto que você removeu a aceitação, isso deve ser evitado aqui no site e a edição deve ser revertida. Se tem outro problema que não foi abordado aqui você deve abrir uma nova pergunta.
Comment: Ok, cara, era só uma dúvida mas eu já resolvi.
Answer: O Chatterbot não define a maneira como você vai obter a frase que deverá ser processada, então basta você fazer a integração com a API do Telegram para pegar a frase digitada e responder por ela também.
Por exemplo:
from chatterbot import ChatBot
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters

# Cria uma instância do ChatBot
bot = ChatBot(
    ...
)

# Define a função que responderá no Telegram
def response(update, context):
    bot_response = bot.get_response(update.message.text)
    update.message.reply_text(bot_response)

def main():
    # Inicia o bot do Telegram
    updater = Updater("TOKEN", use_context=True)

    # Pega o disparador do Telegram
    dp = updater.dispatcher

    # Adiciona a função ao bot
    dp.add_handler(MessageHandler(Filters.text, response))

if __name__ == '__main__':
    main()

Códigos (incompletos) baseados inteiramente nos exemplos das documentações do ChatterBot e Telegram

Assim, quando o bot do Telegram receber uma mensagem, a função response será executada passando a frase recebida para o bot do ChatterBot e enviando de volta a resposta obtida.
Comment: Hey, implementei o mesmo código adicionando meu chatbot e incluindo o meu token, porém, o meu chatbot do Telegram não responde as mensagens. Não tem nenhuma mensagem de erro, não tenho ideia do que pode ser.
Comment: Vou adicionar a pergunta o código

Importar bot chatterbot para o telegram


Explain inequality of integrals by taylor expansion

Question: I try to understand why the following inequality holds.
$$\left|\int_{|y|<1} e^{iuy}−1−iuy\ \, dy \right| \le \frac{1}{2} \cdot \int_{|y|<1} |uy|^2\ \, dy$$
Due to a hint I'm pretty sure, that the taylor expansion of $$z↦e^{iuz}−1−iuz$$ is part of the solution.
The taylor expansion of the mentioned function is $$e^{iuz}-1-iuz=\sum_{n=2}^\infty\frac{i^nu^nz^n}{n!}$$
Does anyone have an idea how to continue?
Thank you!
Comment: I just can't understand that $\;v(dy)\;$ notation...If it were just $\;dy\;$ or even $\;(dy)\;$ is fine, but $\;v(dy)\;$ looks a little like Riemann-Stieltjes...what is $\;v\;$ there?
Comment: $v$ is just a borel measure defined on $\mathbb{R}-\{0\}$. Could you explain it in the case of just $dy$? Thanks!
Comment: Maybe I'm too stupid to see it? I'm literally staring at this inequality for hours...
Answer: There are (at least) two ways to prove this inequality.
Solution 1: Taylor's formula states that for any nice function $f: \mathbb{R} \to \mathbb{C}$, we have
$$f(y) = f(0)+ f'(0) y + \frac{1}{2} f''(\xi) y^2$$
where $\xi = \xi(y)$ is an intermediate point between $0$ and $y$. Hence,
$$|f(y)-f(0) -f'(0)y| = \frac{1}{2} |f''(\xi)|.$$
Applying this for $f(y) := e^{iuy}$ (with $u$ fixed), we get
$$|e^{iuy}-1-iuy| \leq \frac{1}{2} u^2 y^2 |e^{iu \xi}| \leq \frac{1}{2} u^2 y^2.$$
Using the triangle inequality, this proves the claimed integral inequality.
Solution 2:
Since
$$e^{iuy}-1 =iu \int_0^y e^{iuz} \, dz, \tag{1}$$
we have
$$e^{iuy}-1-iyu \stackrel{(1)}{=} iu \int_0^y (e^{iuz}-1) \, dz \stackrel{(1)}{=} (iu)^2 \int_0^y \int_0^z e^{iuw} \, dw \, dz.$$
As $|e^{iuw}| \leq 1$, this implies
$$|e^{iuy}-1-iyu| \leq |u|^2 \int_0^y \int_0^z 1 \, dw \, dz = \frac{1}{2} y^2 u^2.$$


LightGBM Installation Issues - Python

Question: I am following the Installation guide found at https://github.com/Microsoft/LightGBM/wiki/Installation-Guide to install LightGBM. In the MinGW shell, I am able to download the git repo, and then cd into the build directory. When I try try the following command:
 cmake -G "MinGW Makefiles" ..

I get the following error:
CMake Error at C:/Program Files/CMake/share/cmake-
3.9/Modules/CMakeMinGWFindMake.cmake:12 (message):
sh.exe was found in your PATH, here:

 C:/Program Files/Git/usr/bin/sh.exe

 For MinGW make to work correctly sh.exe must NOT be in your path.

 Run cmake from a shell that does not have sh.exe in your PATH.

 If you want to use a UNIX shell, then use MSYS Makefiles.

 Call Stack (most recent call first):
 CMakeLists.txt:8 (PROJECT)

 CMake Error: CMake was unable to find a build program corresponding to
 "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to
 select a different build tool.
 CMake Error: CMake was unable to find a build program corresponding to "
 MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to
 select a different build tool.
 CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
 CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
 -- Configuring incomplete, errors occurred!

I also tryed removing the sh.exe from my path.
Can anyone point me to a possible solution? I am guessing I installed cmake incorrect?
Comment: My guess is it can't find gnu `make`. Do you have a full MinGW or just the one that comes with Git?
Comment: Think I have the one that comes with Git...found here: https://git-scm.com/downloads
Comment: In their [installation guide](https://github.com/Microsoft/LightGBM/wiki/Installation-Guide) they ask for MinGW64, try installing it and using that enviroment to compile
Comment: @yorodm , I believe that I am using MinGW64.
Answer: You can try to run cmake -G "MinGW Makefiles" .. two times .
Answer: A simple solution presented itself:
pip install lightgbm

problem solved
Answer: create a new environment in conda according to requirements shown in lightgbm and than create a environment list in jupyter and use according to your package by changing in kernel setting it will work fine.
how to create new env??
conda create --n py37_64 python=3.7
also download according 32 bit or 64 bit for lightgbm 64 bit is used for that:
config --env --set subdir win--64
and activate particular env here it is py37_64
so command will be:
activate py37_64
and install lightgbm
pip install lightgbm
enter image description herenow see the magic and use this env in your jupyter notebook how??
conda install nb_conda
for using this kernels in notebook you have to deactivate env and activate it again
now see your notebook
here you can see in image im actually using this now you can switch kernels according to
your requirement

LightGBM Installation Issues - Python


Proving $\frac{1}{a} + \frac{1}{b} + \frac{1}{c} \geq 1 + \frac{6}{a+b+c}$ if $abc \leq 1$

Question: My goal is to prove that $\frac{1}{a} + \frac{1}{b} + \frac{1}{c} \geq 1 + \frac{6}{a+b+c}$ if $abc \leq 1$, for $a,b,c$ all positive.  I've tried to multiply both sides by $a+b+c$ to arrive at $(a+b+c)(1/a+1/b+1/c−1)≥6,$ but I haven't figured out how to properly use the condition $abc \leq 1$.
Any hints or solution are welcome.
Comment: What is not obvious though is ... what did you try?
Comment: [Quick beginner guide for asking a well-received question](https://math.meta.stackexchange.com/questions/35391/quick-beginner-guide-for-asking-a-well-received-question) + please [avoid "no clue" questions](https://math.meta.stackexchange.com/questions/9959/how-to-ask-a-good-question/27933#27933).
Comment: Sorry for the ambiguity. I've tried to multiply both sides by $(a+b+c)$ to arrive at $(a+b+c)(1/a + 1/b + 1/c - 1) \geq 6$, but then I have trouble using the condition $abc \leq 1$
Answer: What you have tried should do the trick.
First, from AM ≥ GM, we get:
$\bullet\quad a+b+c\ge 3(abc)^{1/3}$;
$\bullet\quad ab+ac+bc\ge 3(abc)^{2/3}$;
Since $abc\le 1$, we have that $-abc\ge -(abc)^{2/3}$, so that
\begin{align*}
\frac{(a+b+c)(ab+ac+bc-abc)}{abc}&\ge \frac{(3(abc)^{1/3})(3(abc)^{2/3}-(abc)^{2/3})}{abc} \\
&= 6
\end{align*}
Comment: Thanks! That's clean and elegant.


RxJava fromCallable and unsubscription

Question: I have the following code (RxJava 1.3.8):
Scheduler scheduler = Schedulers.from(Executors.newSingleThreadExecutor());

Subscription subscription1 = Completable.fromCallable(() -> {
  Thread.sleep(1000);
  System.out.println("first Callable executed");
  return 0;
})
    .subscribeOn(scheduler)
    .subscribe();

Subscription subscription2 = Completable.fromCallable(() -> {
  Thread.sleep(1000);
  System.out.println("second Callable executed");
  return 0;
})
    .subscribeOn(scheduler)
    .subscribe();

CompositeSubscription subscriptions = new CompositeSubscription();
subscriptions.addAll(subscription1, subscription2);
subscriptions.clear();

Output:

first Callable executed
second Callable executed

The question is - why was second Callable executed? Before it runs I expect that subscription checked and execution canceled if subscription is unsubscribed.
Comment: Works for me; nothing is printed if I run your code, even if looped.
Comment: @akarnokd actually I run this code in Android environment (MainActivity::onCreate), messages printed with Log::d, RxJava version - 1.3.5. Maybe it matters
Comment: Try with 1.3.8, the latest version of the now unsupported 1.x line.
Comment: @akarnokd 1.3.8 - same behavior, but on 2.2.1 - nothing is printed. Is it a bug or 1x intended behavior?
Comment: I can't reproduce your issue with 1.3.8 so I can't say for sure. Besides, 1.x is end of life so there is no point in spending to much time over this.
Answer: The subscription is only checked before it emits a value but it would appear that it will trigger the callable regardless.
public static Completable fromCallable(final Callable<?> callable) {
    requireNonNull(callable);
    return create(new OnSubscribe() {
        @Override
        public void call(rx.CompletableSubscriber s) {
            BooleanSubscription bs = new BooleanSubscription();
            s.onSubscribe(bs);
            try {
                // calls the callable regardless
                callable.call();
            } catch (Throwable e) {
                if (!bs.isUnsubscribed()) {
                    s.onError(e);
                }
                return;
            }
            // the emission of the complete is guarded
            if (!bs.isUnsubscribed()) {
                s.onCompleted();
            }
        }
    });
}

So if we were to modify your code as follows adding a doOnComplete to each.
Scheduler scheduler = Schedulers.from(Executors.newSingleThreadExecutor());

Subscription subscription1 = Completable.fromCallable(() -> {
  Thread.sleep(1000);
  System.out.println("first Callable executed");
  return 0;
})
    .doOnComplete(() -> System.out.println("first Completable complete"))
    .subscribeOn(scheduler)
    .subscribe();

Subscription subscription2 = Completable.fromCallable(() -> {
  Thread.sleep(1000);
  System.out.println("second Callable executed");
  return 0;
})
    .doOnComplete(() -> System.out.println("second Completable complete"))
    .subscribeOn(scheduler)
    .subscribe();

CompositeSubscription subscriptions = new CompositeSubscription();
subscriptions.addAll(subscription1, subscription2);
subscriptions.clear();

We get:
first Callable executed
second Callable executed

If we do not clear the subscriptions we will see the extra output, i.e.
first Callable executed
first Completable complete
second Callable executed
second Completable complete

RxJava fromCallable and unsubscription