text:
Q: GLMER, GHAQ and marginaled coefficients I am confused about the GLMM procedures and their reporting. I have tried to follow @Ben Bolker on mixed effect model. However, I am confused after the GLMAdaptive approach. I will lay out my problem.
The experiment involved breeding organisms in three "Treatment" (Gregarious, Intermediate and Sparse). The response variable is "morphs" (red/ blue). However, the treatment was carried in similar sized boxes. During the breeding, organisms died at different time-points (even though they were staged before the experiment began). I have included "Box" as a random effect (random intercept). I have two other numeric predictors.
require(lme4)
e1<- glmer(morph ~ Treatment + growth + weight + (1| Box), data = e, family = "binomial", control = glmerCont`enter code here`rol(optimizer = "bobyqa"), nAGQ = 25, na.action = "na.fail")

I use GHAquadarature with 25 points. Random intercept model. The aim is to study population parameters and not random effects.
Checked for overdispersion.
overdisp_fun(e1)
      chisq       ratio         rdf           p
245.2838191   0.7836544 313.0000000   0.9981553

I then standardized the global model with the "arms" package (this will centre and scale the numeric variables).
require(arm)
e2<-standardize(e1)

summary(e2)

Generalized linear mixed model fit by maximum likelihood (Adaptive Gauss-Hermite Quadrature, nAGQ = 25) ['glmerMod']
     Family: binomial  ( logit )
    Formula: morph ~ Treatment + z.growth + z.weight + (1 | Box)
       Data: e
    Control: glmerControl(optimizer = "bobyqa")

         AIC      BIC   logLik deviance df.resid
       270.7    293.3   -129.3    258.7      313

    Scaled residuals:
        Min      1Q  Median      3Q     Max
    -2.1963 -0.4681 -0.2527 -0.1364  4.1039

    Random effects:
     Groups Name        Variance Std.Dev.
     Box    (Intercept) 0.9245   0.9615
    Number of obs: 319, groups:  Box, 46

    Fixed effects:
                          Estimate Std. Error z value Pr(>|z|)
    (Intercept)            -1.1288     0.3521  -3.206  0.00134 **
    Treatmentintermediate  -1.5315     0.5933  -2.581  0.00985 **
    Treatmentsparse        -1.9510     0.7181  -2.717  0.00659 **
    z.growth               -1.1441     0.4570  -2.503  0.01230 *
    z.weight                0.3748     0.3784   0.991  0.32191
    ---
    Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    Correlation of Fixed Effects:
                (Intr) Trtmntn Trtmnts z.grwt
    Trtmntntrmd -0.512
    Tretmntsprs -0.478  0.311
    z.growth     0.272  0.058  -0.172
    z.weight     0.062 -0.123  -0.091   0.139

display(e2)
            coef.est coef.se
        (Intercept)           -1.13     0.35
        Treatmentintermediate -1.53     0.59
        Treatmentsparse       -1.95     0.72
        z.growth              -1.14     0.46
        z.weight               0.37     0.38

        Error terms:
         Groups   Name        Std.Dev.
         Box      (Intercept) 0.96
         Residual             1.00
        ---
        number of obs: 319, groups: Box, 46
        AIC = 270.7, DIC = 186.8
        deviance = 222.7

After this, I derive a series of candidate models from the e2 global model. I compare them with AICc. I set the threshold of 2 AICc units for the most competitive models while the best model is with the least AICc.
Interpreting random effect: Does the std. deviation of 0.96 indicates any mild/ strong variation among the boxes? Or there is no effect of "boxes" on the response variable? Should I talk anything about the random effect in the results/ discussion?
Marginal AIC: Does the AICc in the summary correspond to marginal AIC? Since I am not interested in random effects, I have not used the (conditional AIC)cAIC.
Should we report estimates and CI of the best model (least AICc) or the global model?
I then compute the confidence intervals of the global model.
2.5 %     97.5 %
    sd_(Intercept)|Box     0.5000825  1.6123814
    (Intercept)           -1.8995190 -0.4334229
    Treatmentintermediate -2.8496460 -0.4161077
    Treatmentsparse       -3.5398772 -0.6348531
    z.growth              -2.1021283 -0.2879385
    z.weight              -0.3676294  1.1247416

Can I report the estimates from the summary table and the CI'S?
Here the CI's indicate that weight does not relatively influence morphs compared to other predictors.
Do we need to report the marginalised coefficients, as I read that GLMM gives estimates conditional on the random effects?. Can we get marginalised coefficients for the glmer() too?
Hence I used another package GLMMAdative for that.
When I used the GLMMAdaptive, I had to manually centre and scale the numeric variables.
require(GLMMadaptive)
p1<-scale(e$growth, center = TRUE, scale = TRUE)
p2<-scale(e$weight, center = TRUE, scale = TRUE)

p3<- mixed_model(fixed = morph ~ Treatment + p1 + p2, random = ~1| Box, data = e, family = "binomial", na.action = "na.fail")

Call:
mixed_model(fixed = morph ~ Treatment + e$growth + e$weight,
    random = ~1 | Box, data = e, family = "binomial", na.action = "na.fail")

Data Descriptives:
Number of Observations: 319
Number of Groups: 46

Model:
 family: binomial
 link: logit

Fit statistics:
   log.Lik     AIC      BIC
 -133.7745 279.549 290.5209

Random effects covariance matrix:
               StdDev
(Intercept) 0.9834821

Fixed effects:
                      Estimate Std.Err z-value    p-value
(Intercept)             0.0093  3.2641  0.0029 0.99771599
Treatmentintermediate  -1.5078  0.6005 -2.5108 0.01204580
Treatmentsparse        -2.4181  0.7187 -3.3647 0.00076634
e$growth               -0.2491  0.4727 -0.5270 0.59816003
e$weight                0.5773  4.3958  0.1313 0.89551131

Integration:
method: adaptive Gauss-Hermite quadrature rule
quadrature points: 11

Optimization:
method: EM
converged: TRUE

Calculating the CI for log odds ratio:
exp(confint(p3))
                           2.5 %   Estimate    97.5 %
(Intercept)           0.19982585 0.39358842 0.7752342
Treatmentintermediate 0.06823391 0.22139601 0.7183553
Treatmentsparse       0.02178281 0.08909298 0.3643956
p1                    0.63238218 0.90745182 1.3021695
p2                    0.74471295 1.02139536 1.4008733

So what do we infer from the CI (obtained by this method, compared to earlier CI), here that all parameters are likely influential for the dependent variable? (since no term includes zero?) Or am I missing something major here? In the sense of interpreting CI's?
Can we report the estimates and CI based on glmer() function or are they/are they not conditional on the random effects? How do I explain the random effect in my case?


text:
Q: Find And Get Data In Datagridview With Condition / Statement in VB.Net How to Fnd and Get Data in Datagridview with COndition / Statement in VB.Net?
This the ilustration.
Let's Say The Table Below A Datagridview, with 5 Columns and 5 Rows.

Case In S1
The example of my problem, in S1 :
[1.] Check Ranking A = Ranking B?

[NO]

[2.] Find Ranking B that have Value = Ranking A!

Row-2 [S2]

[3.] Take Nilai B in the Row-2!

[0.8]

[4.] Find the difference between Nilai B in S1 and S2

[0.8 – 0.9 = 0.1]

[5.] Add new Columns and Put 0.1 right there.
And The Result Will be like this :

I dont Understand about Step 2 and Step 3, Somebody please Help Me! I'm confuse because there is no WHERE in VB.Net to make Condition!

A: Use datagridview filters like this:
 YourGridViewBindingSource.Filter = String.Format("YourDBColumn Like ;'*" & FilterValue) & "*'"

Also you can take yourYourGridViewBindingSource
If it's datatable or dataset and use:
  Datasource.select(your conditions)

redpajama_set_name: RedPajamaStackExchange


text:
Q: Can other people in our world see Kirjava? I've just finished watching series 3 of His Dark Materials (haven't read the books). During the course of the series...

... Will's daemon (named Kirjava by Serafina) becomes visible, both to him and others. I was wondering - once he returns to our world at the end of the series, is his daemon still visible to other people? It seems like it would make his later life complicated to have a cat following him everywhere. On the other hand, perhaps he's able to separate from his daemon (like Lyra now can), so it won't be so much of an issue?

Happy to have answers either from the books, from Phillip Pullman, or from the developers of the show.

A: Season 3 of that series has little to do with the book and misses lots of important elements. In the book, it's described like this: Witches perform a ritual of going into an area where dæemons cannot be, which makes them able to be so far apart. By going to the land of the dead, Lyra and Will did effectively the same. They are still connected, but the maximum distance between them is much larger, maybe even infinite. Kirjava is a regular dæmon since it was "ripped" out of Will while he was in the boat (which the series completely ignored), but with the same large distance. How exactly Will handles this after the story ends isn't specified, but I would guess that she most likely stays at home or goes on her own adventures.

A: Based on the books, no, other people in our world can't see Kirjava. At least not by default.
I've not watched the series so, if you're planning to read the books, the following might be a spoiler.
Towards the end of The Amber Spyglass, Mary Malone speaks with the witch Serafina Pekkala. The witch teaches Mary to see her own dæmon. Later the witch says:

When you are in your world, you will learn to see the dæmons of other people too, in the same way. They won't see yours or Will's, though, unless you teach them as I've taught you.

(p. 920, 38 The Botanic Garden, The Amber Spyglass)

A: Probably.
The Amber Spyglass follows Lyra's perspective, so the narrative never returns to Will's world after Kirjava is separated from Will - it follows Lyra to her own. Within the story, there's no confirmation one way or the other that people would be able to see Kirjava, as it never comes up.
Presumably other people would just see Kirjava as an ordinary cat. They would certainly be able to see something, as Will has no trouble seeing and talking to Pantalaimon. This answer suggests that other people would be able to tell that the cat was unusual, or at least that other animals would, but lacks a source for this. It's also possible that humans with no concept of an external daemon would be unable to do this.


text:
Q: How to use cmd commands from java I made a program in java, and in the program i needed to use cmd,
I saw you can use Runtime().exec method, but i didn't succeed using it.
I tried to do this:
public class name{
    public static void main(String args[]){
        Runtime.exec("ipconfig");
    }
 }

A: From mkyong:
    Process p = Runtime.getRuntime().exec("ifconfig");
    p.waitFor(); // waits for the application's finish

    BufferedReader reader =
         new BufferedReader(new InputStreamReader(p.getInputStream()));

    String line = "";
    while ((line = reader.readLine())!= null) {
    sb.append(line + "\n"); // read the console output
    }
    System.out.println(sb.toString());


text:
Q: Organize controllers into folder in Play (Scala) framework I wonder whether it's possible to organize controllers generated by the Play framework into a folder (for example 'controllers') like in Rails? Thanks.

A: I don't know what you mean by generated, but you can organize your own controllers into Java packages.
I haven't tried that in Scala, but in Java you can put your controllers (extending play.mvc.Controller) into subpackages of controllers.
|- controllers
|--- Application.java
|- controllers.admin
|--- Admin.java

If your are not familiar with Java packages, they are organized in a folder structure, so the controllers.admin-package has the path app/controllers/admin/ in your Play project.
In your project or view files you address these controllers with the package before the class name.
# Path: conf/routes
GET /admin             admin.Admin.index

... or ...
*{
     Path: app/views/admin/Admin/index.html (app/views/<package>/<Controller>/<method>
}*

#{form @admin.Admin.setSomething()}
    ...
#{/form}


text:
Q: Components added to disabled div are not all inheriting disabled attribute For part of our UI, the main div is disabled and then more components are added based on the data loaded. However, if the main div is disabled before adding the additional components, then only some of the additional components added have the disabled attribute set.
Have tried Vaadin 23.0.10 and 23.1.0rc1 with Java 17.
Example code:
        VerticalLayout vlMain = new VerticalLayout();
        vlMain.setSizeFull();
        HorizontalLayout hlOne = new HorizontalLayout(FontAwesome.Solid.BUG.create(), new Button("Testing"));
        HorizontalLayout hlTwo = new HorizontalLayout();
        hlOne.setEnabled(false);
        hlTwo.setEnabled(false);
        Button add = new Button("Add");
        add.addClickListener(buttonClickEvent -> {
            if(buttonClickEvent.isFromClient())
            {
                hlTwo.add(FontAwesome.Solid.BUG.create());
                hlTwo.add(new Button("Testing"));
            }
        });
        vlMain.add(hlOne, hlTwo, add);

When the above is run, hlOne contains 2 disabled controls.
Clicking the button adds the additional components, however the icon doesn't inherit the disabled attribute but the button does. Calling hlTwo.setEnabled(false) again then sets everything correctly. This can be verified using the browser inspector.
While there is the workaround, it would be good to know what the expected behaviour should be.
Thanks.


text:
Q: the program is very slow, why? in C# i'm using this code to export an excel wuth 256 rows at the moment (later i need 256k of rows), but the program is very slow compare to java,
i read a folder with all text files in it, then i read all lines in each file, i look for a letter, and if i see it, i add the line to the excel file
what is the problem at my program?
       private void Create_Excel_File_Click(object sender, EventArgs e)
    {
        ProgressBarTimer.Start();

            String[] Coulmn_Head =  {"סוג פעולה","    נקלט בשעה"};

        int Coulmn = 1, Row = 1;
        Excel.Application xlApp;
        Excel.Workbook xlWorkBook;
        Excel.Worksheet xlWorkSheet;
        object misValue = System.Reflection.Missing.Value;
        xlApp = new Excel.Application();
        xlWorkBook = xlApp.Workbooks.Add(misValue);
        xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
        for (Coulmn=1; Coulmn <=Coulmn_Head.Length; Coulmn++)
        {

            xlWorkSheet.Cells[Row, Coulmn] = Coulmn_Head[Coulmn - 1];
            xlWorkSheet.Columns[Coulmn].AutoFit();
        }
        Coulmn = 1;
        Row++;
        int CountErrors = 0;
        string[] Files = System.IO.Directory.GetFiles(SourceFolderText.Text, "*.txt");

        for (int i = 0; i < Files.Length; i++)
        {
            string line;
            System.IO.StreamReader File_Now = new System.IO.StreamReader(Files[i]);
            while ((line = File_Now.ReadLine()) != null)
            {
                for (int j = 0; j < line.Length; j++)
                {
                    if (line[j] >= 'א' && line[j] <= 'ת')
                    {
                        string[] words = line.Split('|');
                        foreach (string word in words)
                        {
                            xlWorkSheet.Cells[Row, Coulmn++] = word;
                        }
                        Coulmn = 1;
                        Row++;
                        j = line.Length;
                        CountErrors++;

                    }

                }

            }
            File_Now.Close();
        }

        xlWorkBook.SaveAs(TargetFolderText.Text + "\\" + TargetFIleText.Text + ".xls", Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
        xlWorkBook.Close(true, misValue, misValue);
        xlApp.Quit();

        releaseObject(xlWorkSheet);
        releaseObject(xlWorkBook);
        releaseObject(xlApp);

        MessageBox.Show(CountErrors + " Errors Found");

    }

A: Excel app takes significant time to initialize, and you instantiate it every time when handler is triggered (Create_Excel_File_Click).
So you better create one global application-wide Excel instance, so the host app will be freezed only once, at startup.
public class ExcelComponent
{
    private static Excel.Application _app;
    public static App
    {
        get
        {
            if (_app == null)
                _app = new Excel.Application();
            return _app;
        }
    }
}

private void Create_Excel_File_Click(object sender, EventArgs e)
{
    Excel.Application xlApp = ExcelComponent.App;
    Excel.Workbook xlWorkBook = xlApp.Workbooks.Add(misValue);
    // etc.
}


text:
Q: fade in/out with css3
Possible Duplicate:
thumbnails fade in fade out

I'm curios if it's possible to achieve this effect ( only the fade in/out )
with css3.
I have a similar thumbnails scroller and I want to create that effect without javascript, or if this is not possible could you help me with a simple solution for creating this with jquery ?
Thanks!

A: Yes this is possible with CSS3 transitions.
Here's an example: http://jsfiddle.net/fgasU/
code:

img{-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
-ms-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}

img:hover{opacity:0}

This simple example will change the opacity on hover.  Because a css transition is defined for 'all' properties, and they are given a 1 second transition with an ease-in-out easing function, the property change is animated.
Also, because it is a new property, the transition property must be preceded by the applicable brower's implementation.  -webkit for chrome/safari, -moz for firefox/mozilla, -o opera, -ms microsoft.

A: The jQuery solution: Wrap the thumbnails in a trigger div, which is absolutely positioned over the image. Target that to fade the elements in and out.
For a CSS3 solution, refer to Vigrond's answer.
HTML

CSS
#wrapper { position:relative; }

#trigger {
    width:100%;
    height:80px;
    position:absolute;
    left:0;
    bottom:20px; }

#thumbnails {
    width:100%;
    height:80px;
    display:none; }

#thumbnails img {
    margin:10px;
    float:left; }

jQuery
$(document).ready(function(){
    $("#trigger").hover(function () {
       $(this).children("div").fadeTo(200, 1);
    }, function(){
         $(this).children("div").fadeOut(200);
    });
});

See my fiddle:
http://jsfiddle.net/TheNix/Cjmr6/


text:
Q: Paste Excel Table into Word Content Control I have a macro that will paste an excel table into a word content control.  The excel table is range named dTable2.  The word content control is wTable2.  This works, but the table inside the word content control is hard to format and manipulate.
Application.Goto Sheets("Table Pg 2").Range("dTable2")
Selection.copy
wordDoc.SelectContentControlsByTag("wTable2").Item(1).Range.PasteExcelTable _
      LinkedToExcel:=False, _
      WordFormatting:=False, _
      RTF:=False

Is it possible to paste an enhanced metafile into the word content control?  For my use it is easier to format, etc.  For some reason this does not work. It will paste outside the content control in word.
wordDoc.SelectContentControlsByTag("wTable2").Item(1).Range.PasteSpecial
DataType:=EnhancedMetaFile


text:
Q: MS word 2013 not launching after changing PIA 14 to PIA 15 in VS 2010 I have developed a office application using interop assemblies for Office 2010 in Visual studio 2010.The PIA referred in this is 14.All works fine here.
Now I have changed the office 2010 to 2013,so referred PIA 15 in VS 2010.The project builds successfully.When I run the application,the word document launches but Ms office configuration setup also start and after completing the setup it prompt to close the launched office component.It start happening after changing office 2010 to 2013.
I have tried removing old references from project and adding again for Office 15 library.But still the same.
After a lot search,i found something in my .vbproj file
<Reference Include="Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <EmbedInteropTypes>True</EmbedInteropTypes>
  <HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Word\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll</HintPath>
</Reference>

Is anything need to change here ?
Also I have done the development for office 2010 in VS 2010 ultimate.Now I have started to work in VS 2010 professional for development of office 2013 application.Does this caused any problem.
Please guide.

A: Solutions to solve this issue :
Solution 1 :
Uninstall MS office 2013 and then Visual Studio .Fix registry.Reboot machine.Install MS Office and then visual studio.Refer the PIA given with VS and build project and see if works.
Solution 2: Format the machine,it worked for me.


text:
Q: Mapping between Notations As in my other question, it is assumed that the (total) function describing a given notation is denoted as $address:p\rightarrow \Bbb{N}$ and assumed to be bijective.
Suppose we are given two notations $N_1$ and $N_2$ for some $p \in \omega{_C}{_K}$(Church-Kleene). Denote the mapping from $N_1$ to $N_2$ as $P{_1}{_2}:\Bbb{N} \rightarrow \Bbb{N}$.
If we wanted to be more formal, we could say that consider the two functions $address1:p\rightarrow \Bbb{N}$ and $address2:p\rightarrow \Bbb{N}$ corresponding to $N_1$ and $N_2$ respectively. Then $P{_1}{_2}$ is defined by:
$$P{_1}{_2}(address1(x))=address2(x) \qquad for \; all \; x < p$$
Now assume that the less-than relations corresponding to $N_1$ and $N_2$ are computable. My question simply is the following: Is the function $P{_1}{_2}$ always Total-computable? That is, computable using an oracle-program that has access to the set representing "indexes of total recursive functions".
If no, then what would be the example for it (also generally, what would be the suitable upper-bound in that case). If yes, then can someone give a reference where a complete or partial proof(if there is one) for a reasonable upper-bound(or lack of it) is provided.
P.S.
I posted this question on Math.SE (https://math.stackexchange.com/questions/2380838/mapping-between-notations). After no replies/comments since few days after posting it, I am posting it here. Hopefully that isn't a problem.

A: Your question is about the oracle strength needed to compute an
isomorphism between two isomorphic computable well-orders. In
general, $0''$ is not necessarily enough to compute such an isomorphism, unless the order-types are sufficiently small, and the general
phenomenon is that the strength needed to compute the isomorphisms rises with the length of the order types being considered.
Let's begin by pointing out what various oracles can compute about a computable well-order relation.
Theorem. Suppose that $\langle\mathbb{N},\lhd\rangle$ is a
computable well-order relation.

*

*Oracle $0'$ can compute the adjacency relation.

*Oracle $0''$ can identify limit ordinal nodes.

*Oracle $0'''$ can compute the "next limit" relation, i.e. where $a\lhd b$ and $b$ is a limit, with no limits between.

*Oracle $0''''$ can identify limits-of-limits.

*Oracle $0^{(5)}$ can compute the next-limit-of-limits.

Proof. Given $a\lhd b$, the oracle $0'$ can tell if we'll ever
find $c$ such that $a\lhd c\lhd b$ and thereby know whether or not
$a$ and $b$ are adjacent.
Node $b$ is a limit ordinal node, if every $a\lhd b$ does have such
a $c$ between, and this is a $\Pi_2$ question to which $0''$ knows
the answer. So oracle $0''$ can identify the limit ordinal nodes.
Similarly, $b$ is the next limit after $a$, if $a\lhd b$ and every
$c$ between them has a predecessor, which is a $\Pi_3$ question
that $0'''$ can answer. So $0'''$ can compute the next-limit
relation.
A node $b$ is a limit-of-limits, if every smaller node has another
limit node between. This is a $\pi_4$ assertion that $0''''$ can
answer.
And so on. $\Box$
We can use this to find upper bounds on the strength needed to compute
isomorphisms for various small order-types.
Corollary.

*

*For any two computable well-orders of the same order-type less
than $\omega^2$, oracle $0'$ can compute the isomorphism.

*For any two computable well-orders of the same order-type less
than $\omega^3$, oracle $0'''$ can compute the isomorphism.

*For any two computable well-orders of the same order-type less
than $\omega^4$, oracle $0^{(5)}$ can compute the isomorphism.

Proof. If the orders have type less than $\omega^2$, then they
have only finitely many limit ordinal nodes, which can be
hard-coded into the program. And then the rest of the isomorphism
amounts to finding adjacencies, which can be computed from $0'$.
If the orders have type less than $\omega^3$, then they have at
most finitely many limits-of-limits, which can be hard-coded into
the program. And the rest of the isomorphism amounts to finding the
next-limit and the corresponding adjacencies, which can be computed
from $0'''$.
And so on. $\Box$
Meanwhile, we can show that for certain small order-types, one does in fact need strength.
Theorem.
 There are two computable order relations on $\mathbb{N}$ of order type $\omega$, with no
 computable isomorphism.
Proof. Let the first order be the natural numbers with the
usual ordering $\langle\mathbb{N},<\rangle$, which has order type
$\omega$. Let the second order be constructed in the following
computable manner. Put the Turing machines in order in type
$\omega$ and for each machine $p$, create two points $a_p$ and
$b_p$ and specify $a_p<b_p$. Now, begin simulating all programs,
and whenever a new program halts, add a new point $c_p$ with
$a_p<c_p<b_p$. This specifies a computable order with order type
$\omega$. But there can be no computable isomorphism between this
order and the first order, because if there were, we could
computably determine whether or not $b_p$ was a successor of $a_p$
or not, and thereby computable solve the halting problem, which is
impossible. $\Box$
Theorem. There are two computable relations with order-type
$\omega^2$, having no $0'$-computable isomorphism relation.
Proof. Let the first order of type $\omega^2$ be a computable
ordering for which the map $(n,k)\mapsto\omega\cdot n+k$ is
computable. We build the second order by the following computable
procedure. Order the Turing machines $p$ in order type $\omega$.
Create an interval in our new order associated with each $p$. The
interval will either be finite or infinite (but infinitely many of
them will be infinite, and so the order overall will have type
$\omega^2$). We simulate all programs on input $0$, input $1$,
input $2$ and so on. Every time a program halts on the next input,
we add another point to its interval block. Thus, the total
programs will lead to infinite intervals, but the non-total
programs will lead to finite intervals, since they will be waiting
for their next input to halt. There can be no $0'$-computable
isomorphism from the first order to the second, since from any such
isomorphism, we could tell whether or not an interval was infinite
or not, and thereby come to solve the $\Pi_2$-complete problem of
totality, which is not possible using only $0'$ as an oracle.
$\Box$
Theorem. There are two computable relations with order-type
$\omega^3$, having no $0''$-computable isomorphism relation.
Proof. For the first order, we can use a standard ordinal
denotation for which the function $(n,m,k)\mapsto
\omega^2\cdot n+\omega\cdot m+k$ is computable. We build the second order by
the following computable procedure. Consider any complete
$\Sigma_3$ relation $A(w)\iff
\exists x\forall y\exists z\ R(w,x,y,z)$, where $R$ is $\Delta_0$.
We may assume that infinitely many $w$ have such an $x$, that every
$(w,x)$ has infinitely many $y$ with some $z$ for which
$R(w,x,y,z)$, and that when there is an $x$ for $w$, then there are
infinitely many such $x$. For each $(w,x)$, we create a node in the
lexical order, and then we begin inspecting the various $y$ in
turn, searching for a $z$ for which $R(w,x,y,z)$ (but waiting for
each $y$ to finish before considering the next). Every time we find
that $(w,x)$ admits the next $y$ having such a $z$, then we add
another node to the interval associated with $(w,x)$. Thus, this
$x$ will be an acceptable witness for $w$ if this interval grows
infinitely often, and otherwise it will have only finitely many
points. So $w$ will satisfy the property $\exists x\forall y\exists
z\ R(w,x,y,z)$ if and only if the interval associated with $w$
(ranging over all possible $x$) has order type strictly exceeding
$\omega$, and otherwise it will have order type $\omega$. It
follows from our assumptions on the relation $R$ that this relation
has order type $\omega^3$. But finally, any isomorphism of this
relation to the standard notations for ordinals below $\omega^3$
will tell us the length of the interval associated with $w$. So if
$0''$ could compute the isomorphism, then it could solve the
$\Sigma_3$ relation with which we began, and this is impossible.
Since that relation was $\Sigma_3$-complete, there can be no such
isomorphism computable from $0''$. $\Box$
I believe that these methods can be pushed harder, and one might
expect to prove the optimal results.


text:
Q: Hover при наведении Имеем такой код:

.pre p {
  width: 301px;
  height: 226px;
  background: rgba(255, 255, 255, 0.7);
  color: #000000;
  padding: 18px 20px;
  position: absolute;
  top: 50.4%;
  left: 50.0%;
  transform: translate(-50%, -50%);
  transition: all .2s ease-in-out;
  opacity: 0;
  font-size: 15px;
}

.pre p:hover,
img:hover + p {
  opacity: 1;
}

.pre .col-md-4 > div {
  position: relative;
}

Рапапам

Т.е. при наведении на картинку появляется текст на белом фоне. Как сделать так, чтобы при загрузке кода снизу картинки был текст, а при наведении появлялся мой фрагмент кода?

A: но можно сделать плавнее с помощью JQuery

.pre p {
  width: 301px;
  height: 226px;
  background: rgba(255, 255, 255, 0.7);
  color: #000000;
  padding: 18px 20px;
  position: absolute;
  top: 50.4%;
  left: 50.0%;
  transform: translate(-50%, -50%);
  transition: all .2s ease-in-out;
  opacity: 0;
  font-size: 15px;
}

.pre p:hover,
img:hover + p {
  opacity: 1;
}

.pre .col-md-4 > div {
  position: relative;
}
.hover-hide,
.after-hover {
  -webkit-transition: all .3s ease-in-out;
  -moz-transition: all .3s ease-in-out;
  -o-transition: all .3s ease-in-out;
  transition: all .3s ease-in-out;
  }
 .comf .after-hover
{
  display: none;
}

.comf:hover .hover-hide {
  display: none;
}
.comf:hover .after-hover {
  display: block;
}

Рапапам

Text after hover


text:
Q: Why Collapsible Panel Cannot be found in jQuery I have nine collapsible panels on a page. I can expand or collapse them from either jQuery or C# code behind. It was all working fine until I broke something and now the $find(cpe) returns null for two of the nine.
The panels are defined and visible to the C# but their outerHTML settings in the DOM (Firebug) suggest the problem:
These work:
<input name="ctl00$body$cpOutsideSales_ClientState" id="ctl00_body_cpOutsideSales_ClientState" value="true" type="hidden">
<input name="ctl00$body$cpGeneral_ClientState" id="ctl00_body_cpGeneral_ClientState" value="false" type="hidden">

These don't work:
<input name="ctl00$body$cpDuties_ClientState" id="ctl00_body_cpDuties_ClientState" type="hidden">
<input name="ctl00$body$cpAnalyst_ClientState" id="ctl00_body_cpAnalyst_ClientState" type="hidden">

The problem is that the "value='true'" is missing, but I see no obvious way to set it. Here is a declaration of one that works:
<asp:CollapsiblePanelExtender ID="cpGeneral" runat="server"
    TargetControlID="pnlGeneral"
    BehaviorID="cpGeneral"
    TextLabelID="lblGeneral"
    SuppressPostBack="true"
    Collapsed="true"
    ImageControlID="icnGeneral"
    ExpandControlID="pnlGeneralcp"
    CollapseControlID="pnlGeneralcp"
    ExpandedText="Collapse"
    CollapsedText="Position/Organization">
</asp:CollapsiblePanelExtender>

and one that doesn't:
<asp:CollapsiblePanelExtender ID="cpDuties" runat="server"
    TargetControlID="pnlDuties"
    BehaviorID="cpDuties"
    TextLabelID="lblDuties"
    SuppressPostBack="true"
    Collapsed="true"
    ImageControlID="icnDuties"
    ExpandControlID="pnlDutiescp"
    CollapseControlID="pnlDutiescp"
    ExpandedText="Collapse"
    CollapsedText="Duties">
</asp:CollapsiblePanelExtender>

I have tried setting ClientState in C#, and the code executes, but the jQuery code still cannot find the control. I.E. This works when pn="cpGeneral" but fails when pn="cpDuties':
function addPanelHandler(panel, pn) {
    extender = $find(pn);
    if (extender != null) {
        extender.add_expanded(function () {
            loadPanel(panel, pn);
        });
    }
}

Here is an image from FireBug. Note that the "true" is missing from two of the nine:

A: I see no reason the two shouldn't work.  I believe it is input/data related.
But because it is a fast check:
1) Try another browser.  And another.
If they all behave the same way:
2) Make sure the inputs to addPanelHandler are totally correct.  If they are - find someone to rubber duck the inputs and problem with.
3) If you still have the problem: ditch aspnet for the time being and copy/paste the code into HTML and distill the code.  IMHO: getting rid of the server fastens up the debugging turnaround.

A: I never came up with a definitive answer to what caused this, but by carefully recreating the control, I created another one that worked and gradually moved the functionality from the bad control to the good one. I was able to isolate it to something in the declaration of the control, but that's as close as I got.


text:
Q: I am creating a tun interface with sudo ip tuntap add dev  mod tun, but it's not receiving packets when I ping it? Here are my command when I set up the interface:
sudo ip tuntap add dev router0 mod tun
sudo ip addr add 10.0.0.138/24 dev router0
sudo ip link set dev router0 up

Here is the output of ip addr show dev router0
8: router0: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 500
    link/none
    inet 10.0.0.138/24 scope global router0
       valid_lft forever preferred_lft forever

When I try to ping 10.0.0.138 listen on the interface using tshark via sudo tshark -i router0, nothing happens.
Here is my ping 10.0.0.138 output:
PING 10.0.0.138 (10.0.0.138) 56(84) bytes of data.
64 bytes from 10.0.0.138: icmp_seq=1 ttl=64 time=0.063 ms
64 bytes from 10.0.0.138: icmp_seq=2 ttl=64 time=0.058 ms

Here is my sudo tshark -i router0 output:
Capturing on 'router0'

Nothing is coming through

A: Because the ping actually doesn't reach a physical device, where tshark taps into it to listen for packets.
When you add an address to your computer, to any interface, it creates a special route in the table local (check your sudo ip route show table local). There will be some local routes. Any communication with local routes is designed to skip several layers of networking stack to enhance efficiency. Your packets should appears on the lo interface, so to see them you have to run sudo tshark -i lo.


text:
Q: MAX5033CASA DC-DC converter not providing correct output voltage I'm using MAX5033CASA DC-DC converter to generate 12V/500mA from a 48V voltage. My schematic is attached to the message.
The inductor I'm using is DO5022P-334MLD.
The input voltage to the converter is 30V (I will need to figure out why) and the problem is that the converter generated 5V output, when it should be 12V.
My schematic is the same as that provided in the datasheet. Does anybody encountered this problem? Is there a problem with the schematic? If so, can it be resolved?
Thank you!
UPDATE
I tried the following:

*

*followed metacollin's advice, the converter does generate 12V, but the power fails to maintain; after about 400ms it drops; same thing happens with PG;

*the above statement is valid when I remove the DC converter input capacitor; I tried a 22uF, 47uF, 22uF, 100uF capacitor, but every time I connect the capacitor, the PSE (LTC4263) does not supply power, instead it indicates low signature resistance.

I will create another thread because I think this problem is related with the PSE-PD circuits, not the converter.

A: There is no problem with Maxim's schematic.  Of course, that schematic and your circuit are completely different, so there is little reason to think that the problem lies with Maxim's own application circuit.  If you remove the everything involving the TPS2375, even then would Maxim's schematic not be suspect. Your layout would be suspect, however.  Problems with switching circuits are, more often than not, a problem with the actual layout, and thus including only the schematic but not the circuit board layout is not useful and you will not get a solution to your problem.    If the layout was fine, and the power source fine, then I would suspect that an ESD killed that chip, and try another  one.  If it still didn't work, only then would I consider contacting Maxim.
The chip has been out for 3 years.  Countless engineers have designed it into products.  Do you really think that your command of electrical engineering is so perfect that surely the fault must lie with Maxim's own datasheet?  That this mistake has some how gone unnoticed by everyone to have ever used this chip in the last 3 years, and their success in using it was pure luck?  Let's be reasonable.  Of course there is no problem with the schematic in the datasheet.
I make a point of saying this because the single biggest downfall of many an engineer in my personal experiences has been a lack of humility.  The moment one decides that a problem was not caused by yourself is the moment you become blind to the most likely source of human error (yourself).  Sometimes you'll get lucky and the mistake really isn't yours, but all it takes is one time where it IS, and you'll never find it because you've decided you didn't make a mistake.  Remember, we tend to be the worst person at spotting our own mistakes, so even if you feel 100% sure you haven't made a mistake, have another engineer look over things, or even better, have 2 or 3 engineers look.  You'd be amazed how often anyone else, simply by not being you, is able to spot errors that you consistently miss.  Making mistakes does not reflect poorly on your skill as an engineer - we all make them, all the time.
Now, normally any question involving a DC/DC converter would need to supply the layout, not just the schematic.  But in this case, the problem is much simpler (and more easily solved, yay!).
Why aren't you using the provided power good output of the TPS2375 to turn on the MAX5033?  That's the entire point of the buck converter's ON/OFF pin.  UVLO is only needed when such a signal is unavailable.  And this is likely the source of your trouble.
The problem is that the MAX5033, by using it's UVLO to decide when to turn on, instead of allowing the TPS2375 to control when the MAX5033 turns on.  And the TPS2375 needs to have that control.
To comply with the 802.23af standard, there are certain requirements for inrush current.  These requirements all revolve around the fact that there could be who knows how many feet of crappy, high-gauge ethernet cable between this power supply and the voltage source.  With as little was 44V being available on the distant end of the cable, and significant resistance from the cable itself in between, current must be carefully controlled so as not to drop the voltage too far.  This, by and large, is the whole point of using a chip like the TPS2375.
Buck converters are very input-centered devices.  The primary ripple is at the input, not the output.   Their input is trying to draw the maximum switch current when on, regardless of the output load.  Loading the output varies the duty cycle of the switch being on, but it does not impact the magnitude of the current it is trying to draw while on, even if it is on only briefly.  The average current will be much lower, but average current is not how the TPS2375 decides to do its job.   Likewise, the 802.23af spec isn't talking about average current, it is talking about any current draw not exceeding various limits.
So, the MAX5033 is trying to turn on when the input cap is charged up to a mere ~6.6V (given your UVLO resistor values).  This is while the TPS2375 is still in in-rush limiting mode.  The power good output is also low - because the power is not yet good.  No downstream circuitry should be drawing power at this point, yet the MAX5033 is definitely trying to.  I would expect it to overload the current limit circuitry and prevent proper startup at the least.  But, from the TPS2375 datasheet, page 13, under the POWER GOOD heading (which you, in theory, have read):

The TPS2375 includes a power-good circuit that can be used to signal
  the PD circuitry that the load capacitor is fully charged. This pin is
  intended for use as an enable signal for downstream circuitry. If the
  converter tries to start up while inrush is active, and draws a
  current equal to the inrush limit, a latchup condition occurs in which
  the PD never successfully starts. Using the PG pin is the safest way
  to assure that there are no undesired interactions between the inrush
  limit, the converter startup characteristic, and the size of the bulk
  capacitor.

Omit the resistor from the MAX5033's ON/OFF pin to GND, it is not needed (and 1 less BOM line is definitely a bonus), leaving the 1MΩ resistor as a pull-up (needed for the open-collector/drain output of the TPS2375).  Connect the ON/OFF pin directly to the PG pin.  Now the MAX5033 can be controlled by the TPS2375, and your circuit should work.
If it doesn't, then it's time to post that board layout!


text:
Q: Autofac factory of unit of work in a singleton Plain and simple as the title suggests, is this a possible thing using Autofac dependency injection? I have been trying and searching everywhere.. I'm losing hope here.
My class has to be singleton - that can't change. I want it to take a factory of unit of works - for database transactions.
Please help me figure this one out, I'm deseperate.
Tried Func<> and registering my unit of work in every possible way (all sorts of lifetimes, externally owned or not) but failed because the DbContext within the unit of work is disposed and not created again after the first request
Edit:
Added code that will hopefully help understanding my problem:
public class SingletonDataService : IDataService
{
    private _uowFactory;

    public SingletonDataService(Func<IEFUnitOfWork> uowFactory)
    {
        _uowFactory = uowFactory
    }

    public List<Folder> GetAllFolders ()
    {
        using (uow = uowFactory())
        {
            return uow.FoldersRepository.GetAll();
        }
    }
}

public MyDbContext : DbContext
{
    public DbSet<Folder> Folders {get; set;}

    public DbSet<Letter> Letters {get; set;}

    public MyDbContext() : base("myContext...")
}

public EFUnitOfWork : IEFUnitOfWork, IDisposable
{
    public IRepository<Folder> FoldersRepository;
    public IRepository<Letter> LettersRepository;

    private DbContext _context;

    public EFUnitOfWork(IRepository<Folder> folders, IRepository<Letter> letters, DbContext context)
    {
        _folders = folders;
        _letters = letters;
        _context = context;
    }

    private bool disposed = false;

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    protected virtual void Dispose(bool disposing)
    {
        if (!disposed)
        {
            if (disposing)
            {
                _context.Dispose();
            }

            disposed = true;
        }
    }
}

public Repository<T> : IRepository<T> where T: BaseEntity
{
    private DbContext _context;
    private DbSet<T> _set

    public Repository(DbContext context)
    {
        _context = context;
        _set = _context.Set<T>();
    }
}

public LettersController : ApiController
{
    private IDataService _dataService;

    public LettersController(IDataService dataService)
    {
        _dataService = dataService;
    }

    [HttpGet]
    public IHttpActionResult GetAllLetters()
    {
        return Ok(_dataService.GetAllLetters());
    }
}

// Must be singleton
builder.Register<SingletonDataService>().As(IDataService).SingleInstance();

builder.RegisterGeneric(typeof(Repository<>))
       .As(typeof(IRepository<>))
       .InstancePerLifetimeScope();

builder.Register<EFUnitOfWork>().As(IEFUnitOfWork).InstancePerLifetimeScope();

builder.Register<DbContext>().As(AppDbContext).InstancePerLifetimeScope();

In the first request everything works fine, in the second third and so on I get this exception :
system.ObjectDisposedException: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.

I clearly see it happens because the context in my repository is now null, but I don't how to to change that with the DI.
What I want to achieve is so easy without DI :
How can I achieve the following with Autofac??
public class UowFactory
{
    public UowFactory()
    {

    }

    public IEFUnitOfWork Create()
    {
        var context = new AppDbContext()
        var uow = new EFUnitOfWork(new Repository<Folder>(context), new Repository<Letter>(context), context);
        return uow;
    }
}

A: Your problem is that you have a singleton (SingletonDataService) depend on a service that has a shorter lifetime (EFUnitOfWork). When the SingletonDataService instance is created by autofac, it gets an instance of EFUnitOfWork, but this instance will always stay the same (its actual lifetime will be longer than you expect) and thus gets disposed and used again, giving errors.
You have two possible solutions:
One is to create a UowFactory class like the one you defined at the bottom (but with dependencies on IRepository<Folder>, IRepository<Letter>, DbContext), register that as anything (for example singleton, but it won't matter) and make the SingletonDataService depend on it. This will likely not be a viable solution to you though, since it will also extend the lifetime of the IRepository<Folder>, IRepository<Letter>, DbContext instances and create problems there.
The proper solution is to remove the reason why you would want the SingletonDataService to be a singleton, probably some cache. And move it to a new service (CacheService?) on which the SingletonDataService depends and make that new service a singleton.

A: Issue
You are registering the critial components with InstancePerLifetimeScope()
When the autofac container is built it also creates a root ILifetimeScope which lives until IContainer.Dispose() is called. Now unless you create nested ILifetimeScope somewhere in the chain to the SingletonDataService, the ILifetimeScope which is used your components is the root ILifetimeScope and InstancePerLifetimeScope() effectly becomes equivalent to SingleInstance().
Solution
One of the possible solutions is to create an ILifetimeScope per IEFUnitOfWork and its children. Autofac facilitates this by providing the Owned<T> type. We can use it in conjunction with a Func<> factory (also see documentation):
public class SingletonDataService : IDataService
{
    private Func<Owned<IEFUnitOfWork>> _uowFactory;

    public SingletonDataService(Func<Owned<IEFUnitOfWork>> uowFactory)
    {
        _uowFactory = uowFactory
    }

    public List<Folder> GetAllFolders ()
    {
        using (var uow = _uowFactory())
        {
            return uow.Value.FoldersRepository.GetAll();
        }
    }
}

This should play nicely with the following registrations:
// Must be singleton
builder.Register<SingletonDataService>().As(IDataService).SingleInstance();

builder.RegisterGeneric(typeof(Repository<>))
       .As(typeof(IRepository<>))
       .InstancePerLifetimeScope();

builder.Register<EFUnitOfWork>().As(IEFUnitOfWork).InstancePerLifetimeScope();

builder.Register<DbContext>().As(AppDbContext).InstancePerLifetimeScope();

However, note, that DbContext being bound with InstancePerLifetimeScope basically makes the manual disposal in EFUnitOfWork redundant.
Sidenote on proper Disposal
Since IDisposable types should support graceful multi-disposal , one should be able to simplify EFUnitOfWork.Dispose() to
public void Dispose()
{
    _context.Dispose();
}

Also note, that i left out the call GC.SuppressFinalize(this);. This call is only relevant in case the class implements a custom finalizer (~EFUnitOfWork method) - or a deriving class could do so, otherwise the object is not put on the finalizer queue anyway.


text:
Q: Unhandled promise rejection while using Microsoft bot framework I am using microsoft bot framework and trying to integrate it with external HTTP calls.
However when i invoke the BotWorker.say in the handler BotKitConversation's ask i start getting
 (node:5711) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot perform 'get' on a proxy that has been revoked

Below is my code
In my handler function's callback i get some values returned from external function.
Then i try to perform bot.say on the response returned and i recieve the above mentioned error.
 myDialog.ask('What would like to hear?', [
    {
        pattern: '.*',
        handler: async (response, convo, bot) => {
            await YoutubeHelper.getChannel(response, convo,async function(channels){
            console.log("value returned " + channels.length);
            try {
            await bot.say('Printing values'); //error comes here

            if (channels.length == 0) {

                await bot.say('No items found.');
              } else {
                await bot.say('This items\'s ID is %s. Its title is \'%s\', and ' ,
                            channels[0].id,
                            channels[0].snippet.title
                            );
              }
            }catch (err) {
                console.log('error occurred' , err);

            }
            });
        }
    }

],  {key: 'name'});
}

where myDialog is an object of BotkitConversation.
Below is the code for my external utility class
 /**
 * Lists the names and IDs of up to 10 files.
 *
 *
 */

var {google} = require('googleapis');

var {myDialog} = require("./bot")

const getChannel = function getChannel(searchTerm, convo,callback) {

    var service = google.youtube({
      version : 'v3',
      auth : '<client id>'});

    service.search.list({
      part: 'id,snippet',
      q: searchTerm
    }, function(err, response) {
      if (err) {
        console.log('The API returned an error: ' + err);
        return;
      }
      var channels = response.data.items;
      if (channels.length == 0) {
        console.log('No items found.');
      } else {
        console.log('This items\'s ID is %s. Its title is \'%s\', and ' ,
                    channels[0].id,
                    channels[0].snippet.title
                    );
      }
      console.log(channels.length);
      callback(channels);
    });
    //

  }

  module.exports ={
    getChannel
}

I found this document regarding the error . I am coding according to the guidelines mentioned.
Best Regards,
Saurav

A: Try to put first await function in a try-catch block:
myDialog.ask('What would like to hear?', [
  {
    pattern: '.*',
    handler: async (response, convo, bot) => {
      try {
        await YoutubeHelper.getChannel(response, convo, async function (channels) {
          console.log("value returned " + channels.length);
          try {
            await bot.say('Printing values'); //error comes here

            if (channels.length == 0) {
              await bot.say('No items found.');
            }
            else {
              await bot.say('This items\'s ID is %s. Its title is \'%s\', and ',
                channels[0].id,
                channels[0].snippet.title
              );
            }
          }
          catch (err) {
            console.log('error occurred', err);

          }
        });
      }
      catch (error) {
        console.log('----::error::----', error)
      }
    }
  }

], { key: 'name' });

A: Problem was with my helper class which was not an awaitable function.
I made changes in my helper function to make it return a promise and it started working.
Below is the updated code
 function askMusicPreferences(answer, convo, bot){

myDialog.ask('What would like to hear?', [
    {
        pattern: '.*',
        handler: async(response, convo, bot, message) => {
            try {
            var channels = await YoutubeHelper.getChannel(response);

            if (channels.length == 0) {

               await bot.say('No items found.');
            }
               else {
                await bot.say(`This items\'s ID is ${channels[0].id}. Its title is ${channels[0].snippet.title}`);
              }

            }catch (error){
                console.log( 'error occurred ', err);
            }

       // }
        // catch (err){
        //     console.log('error occurred', err);
        // }

    }
}
],  {key: 'name'});
}

My helper class

    /**
 * Lists the names and IDs of up to 10 files.
 *
 *
 */

var {google} = require('googleapis');

var {myDialog} = require("./bot");

const getChannel = function getChannel(searchTerm) {
    return new Promise(function(resolve,reject) {

    var service = google.youtube({
      version : 'v3',
      auth : '<client id>'});

    service.search.list({
      part: 'id,snippet',
      q: searchTerm
    }, function(err, response) {
      if (err) {
        console.log('The API returned an error: ' + err);
        reject(err);
        return;
      }
      var channels = response.data.items;
      if (channels.length == 0) {
        console.log('No items found.');
      } else {
        console.log('This items\'s ID is %s. Its title is \'%s\', and ' ,
                    channels[0].id,
                    channels[0].snippet.title
                    );
      }
      console.log(channels.length);
      resolve(channels);
      //callback(channels);
    });
    //
  });

  }

  module.exports ={
    getChannel
}


text:
Q: Are LINQ expression trees Turing complete? As they are in .Net 3.5. I know they are in 4.0, as that's what the DLR works with, but I'm interested in the version we have now.

A: Without defining the thing that will execute the tree, we don't know. In the CLR's own interpretation (when you compile them into delegates) they are. But if you translate them into SQL, they are not, and you can invent your own confusing interpretation of them with whatever properties you like.
Until you've decided how to interpret them, they're just data structures.

A: In the early draft of the C# 3.0 spec there was a comment in the margin of the section on expression trees that said:

I have a truly marvellous proof of Turing-completeness which this margin is too narrow to contain.

Sadly no one has been able to find out who wrote it or develop the proof.

A: LINQ expression trees can represent anything you can put in a normal C# expression. As such, they can't be used to directly represent while loops, for loops, etc.
However, it's theoretically possible to use lambda expressions and recursion to carry out any iteration you may need. In practice it may be easier to drop Enumerable methods into your tree.

A: Well, why don't you try to prove it? I bet it's a fun challenge ;)
But expression trees only represent an expression and as such you'll have to define what you are allowed to do, as stated by Earwicker.
If you allow expression trees to use recursion you can achieve repetition i.e. for loops and such.
However, untyped lambda calculus is Turing-complete Turing_completeness#Examples but Lambda calculus does not permit recursion per se Lambda_calculus#Recursion it's all very dicey.
I would conclude that expression are probably Turing complete but it will require someone who is more familiar with this to confirm it.


text:
Q: Why does a dynamically imported ESModule return JSON, when the module exports only plaintext? I am reasonably familiar with ES2015 Modules, but, right now, I am (simultaneously) getting my head around:

*

*Heroku

*Deno

*Oak

*TypeScript
I'm sure I've missed something elementary here, but I cannot find it.
I have two versions of a template, which look like this:
template-static.ts
import page from './page.ts';

let template = page;  // Normally, the template will add a lot more to page

export default template;

template-dynamic.ts
const page = await import('./page.ts');

let template = page;  // Normally, the template will add a lot more to page

export default template;

In this test setup, each template (whether using static or dynamic import) imports the same module:
page.ts
let page = `

Test Page

This is the Test Page.

Go to the Test Page (static import) Page

Go to the Test Page (dynamic import) Page

`;

export default page;

Finally, I have the following HTTP Server (using Oak):
server.ts
import { Application, Router } from 'https://deno.land/x/oak/mod.ts';
import * as flags from 'https://deno.land/std/flags/mod.ts';

import templateStatic from './template-static.ts';
import templateDynamic from './template-dynamic.ts';

const {args} = Deno;
const DEFAULT_PORT = 8080;
const argPort = flags.parse(args).port;
const port = argPort ? Number(argPort) : DEFAULT_PORT;

const app = new Application();
const router = new Router();

app.use(router.routes());
app.use(router.allowedMethods());

router.get('/test-page-static-import', ({ response }: { response: any }) => {
    response.status = 200;
    response.headers.set('Content-Type', 'text/html');
    response.body = templateStatic;
});

router.get('/test-page-dynamic-import', ({ response }: { response: any }) => {
    response.status = 200;
    response.headers.set('Content-Type', 'text/html');
    response.body = templateDynamic;
});

console.log(`Server is running on port ${port}`)

await app.listen({ port });

When I deploy the app to Heroku it works, but with the following outputs:
/test-page-static-import

Test Page

This is the Test Page.

Go to the Test Page (static import) Page

Go to the Test Page (dynamic import) Page

/test-page-dynamic-import
{"default":"\n\n
Test Page
\n
This is the Test Page.
\n
\n
Go to the Test Page (static import) Page
\n
Go to the Test Page (dynamic import) Page
\n
\n"}

It's clear to me that the template which uses static import is importing plaintext and serving it as text/html while the template which uses dynamic import is importing JSON and serving it as text/html.
Why is the dynamic import() returning JSON?

A: The reason is that the return value of a dynamic import is not the default import as you are expecting it but an object wrapper around it.
Mind the example on the dynamic import webpack documentation.
return import('lodash')
    .then(({ default: _ }) => {
      const element = document.createElement('div');

      element.innerHTML = _.join(['Hello', 'webpack'], ' ');

If you want to access the default import from a dynamically imported file, you have to access it via resolvedPromise.default.
In your case, you can access the default import from page.ts like follows:
const { default: page } = await import('./page.ts');

let template = page;

export default template;


text:
Q: Como criar Capa em um Relatório usando iReport Estou usando o iReport 5.5.2 e já tentei de várias formas adicionar uma capa no relatório, que é necessário, porém sem sucesso.
Já tentei adicionar o atributo isTitleNewPage na banda Title do iReport, mas isso não funcionou e procurei algum atributo para iniciar uma banda em uma nova página e depois as restantes em outra página e não funciona.
Vi em um fórum, que não me recordo o nome, um usuário informando que resolveu o problema criando dois arquivos PDF's separados e depois unindo os dois com iText, mas acredito que isso é POG.

A: Quando tive a necessidade de adicionar páginas quaisquer em relatórios ou mesmo juntar vários relatórios, o caminho foi juntar os documentos com iText.
Isso não é POG! POG é usar uma ferramenta para um objetivo diferente do qual ela foi projetado.
O JasperReports (iReport é apenas o editor) foi projeto para gerar relatórios a partir de fontes de dados e não documentos contendo texto. Já o iText é projetado para criar e manipular arquivos PDF. Portanto, nada mais justo do que deixar cada ferramenta com a sua função.
Por outro lado, fiz uma breve pesquisa para saber se o pessoal do JasperReports poderia ter implementado algo específico quanto a isso e cheguei a um blog que mostra um trecho de código que permite juntar dois relatórios. Não testei a solução, mas se funcionar você pode criar um outro relatório que seja somente a capa e juntar com o relatório que contém os dados.
Veja o trecho de código:
JasperPrint jp1 = JasperFillManager.fillReport(url.openStream(), parameters,
                    new JRBeanCollectionDataSource(inspBean));
JasperPrint jp2 = JasperFillManager.fillReport(url.openStream(), parameters,
                    new JRBeanCollectionDataSource(inspBean));

List pages = jp2 .getPages();
for (int j = 0; j < pages.size(); j++) {
    JRPrintPage object = (JRPrintPage)pages.get(j);
    jp1.addPage(object);
}
JasperViewer.viewReport(jp1, false);

Obviamente seria necessário adaptar o exemplo e verificar se a sua versão API é compatível com este método.


text:
Q: Line segments intersecting at the nine-point center Can you provide a proof for the following claim:

Claim.Given any $\triangle ABC$. The tangent lines to the circumscribed circle of $\triangle ABC$ are constructed at vertices $A$,$B$,$C$ . Let point $D$ be the intersection point of tangent lines that passes through vertices $A$ and $C$ , point $E$ the intersection point of tangent lines that passes through vertices $A$ and $B$ , point $F$ the intersection point of tangent lines that passes through vertices $B$ and $C$ , and let $H_1$,$H_2$,$H_3$ be the orthocenters of  $\triangle ACD$, $\triangle AEB$ and $\triangle BFC$ respectively. Then line segments $AH_3$,$BH_1$ and $CH_2$ concur at the nine-point center of $\triangle ABC$.

GeoGebra applet that demonstrates this claim can be found here.
I don't know how to start the proof. All I know is that nine-point center of the triangle lies in the middle of the line segment whose endpoints are orthocenter and circumcenter , but I don't know how to use that fact.  Any hints are welcomed.

A: In fact we can say more : $N_9$ is the midpoint of segments $AH_i$.

First we show that $BOCH_2$ is a rhombus. $\triangle BEC$ is isosceles so $H_2$ lies on its symmetry axis. So $BH_2C$ is isosceles as is $BOC$. Hence $OH_2$ is perpendicular to $BC$ at its midpoint $M$. Also $\angle OBC = 90 -A = 90 - \angle EBC = \angle H_2CB$.
Next we show $AHH_2O$ is a parallelogram. $AH \perp BC \Rightarrow AH || OH_2$. It is known that $2OM = AH$. So $AH = OH_2$.
We conclude $AH_2$ is bisected at intersection of diagonals of parallelogram $AHH_2O$. But midpoint of $OH$ is $N_9$. We're done.


text:
Q: UPDATE or MERGE INTO or maybe anything else I am using Oracle PL/SQL.
I have table A:
ID  SALES
--------
1   5
2   3
3   231
2   1
3   421
1   2

Table B:
ID  REGION
------------
1   London
2   New-York
3   Paris
4   Dublin
5   Munich

and table C:
ID  REGION
------------
1   London
2   New-York

Also i have table D:
ID  SUM_OF_SALES
------------
1   .
2   .
3   .

The task is to fill value SUM_OF_SALES in table D with the sum of column sales in table A grouped by ID column where A.ID = B.ID and B.REGION = C.REGION. The result i want is:
ID  SUM_OF_SALES
------------
1   7
2   4
3   .

I would be very appreciated for different approaches to this task.

A: MERGE INTO  d
USING (SELECT a.id, SUM(a.sales) sum_of_sales
       FROM   a,b,c
       WHERE  a.id = b.id
       AND    b.region = c.region
       GROUP BY a.id) q
WHEN MATCHED THEN UPDATE SET d.sum_of_sales = q.sum_of_sales


text:
Q: SwiftUI initializer apparent circularity TL:DR
There seems to be a chicken-and-egg paradox in this View initializer.
The Code
This happens often enough to me that I must be missing something fundamental about @State. Namely the compiler seems to be saying I can't set pickerIndex until pickerIndex has been set, and I can't exit the initializer without setting pickerIndex.

(The LetterSelection variable tracks a letter of the alphabet, but I don't think its details are relevant.)

A: Note: it is better to provide code "as code", so it could be easier edited
In the described case it needs to initialize not property value but the state wrapper itself, like
self._pickerIndex = State(initialValue: sel.current.idx)


text:
Q: Add non app tests to tests that run when executing python manage.py test My Django project has a few app each with their respective tests. It also has a utils package that has its own tests.
The package utils is in a folder at the same level as manage.py and its tests are in a subfolder called tests in files called test_xxx.py
When I run python manage.py test Django runs all tests for all the apps in my project but it does not run the tests for the utils package. I can run the tests for the utils package by running python manage.py test utils.
What I would like to do is that tests for utils are also run when I run python manage.py test so that single command tests the whole suite for my project. I haven't been able to find anything in the documentation or searching google or here on how to do it. Any ideas?
Thanks for your help!!
--- Additional details ---
Directory structure
├── project
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── manage.py
├── ...
├── app1
│   ├── __init__.py
│   ├── urls.py
│   ├── views.py
│   ├── ...
│   └── tests
│        ├── test_views.py
│        └── test_models.py
├── app2
│   ├── __init__.py
│   ├── urls.py
│   ├── views.py
│   ├── ...
│   └── tests
│        ├── test_views.py
│        └── test_models.py
└── utils
    ├── __init__.py
    ├── code.py
    └── tests
         └── test_utils.py

Command to execute tests
python manage.py test
... that executes ...
nosetests --with-coverage --cover-package=app1,app2, utils --cover-html --cover-erase --logging-filter='selenium' --verbosity=1
And the coverage report shows that all the tests for app1 and app2 have been executed but not the tests for utils

A: Django uses the DiscoverRunner to run your tests harness. As you can see here: https://docs.djangoproject.com/en/2.1/topics/testing/advanced/#defining-a-test-runner
The first option is:

top_level can be used to specify the directory containing your
  top-level Python modules. Usually Django can figure this out
  automatically, so it's not necessary to specify this option. If
  specified, it should generally be the directory containing your
  manage.py file.

Therefore your test should be run by the test harness because are in the same folder of your manage.py. Did you add the __init__.py in the tests folder?


text:
Q: How to do a singularity analysis on $M(z) := \frac{1 - z - \sqrt{1 - 2 z - 3 z^2}}{2 z}$? This question is realted to these previous questions of mine:

Use singularity analysis on
$$ M(z) := \frac{1 - z - \sqrt{1 - 2 z - 3 z^2}}{2 z}$$
to show that
$$[z^n]M(z) = 3^n \sqrt{\frac{3}{4 \pi n^3}} \biggl(1+\mathcal{O}\biggl(\frac{1}{n}\biggr) \biggr)$$

I understand now that $1/3$ is the dominant singularity of $M$. And from the lecture I know the transfer theorem and the

Standard function scale: Let $\alpha \in \mathbb{C} \setminus \mathbb{Z}_{\le 0}$. Then
$$[z^n] (1-z)^{-\alpha} = \frac{n^{\alpha-1}}{\Gamma(\alpha)} \biggl(1+\mathcal{O}\biggl(\frac{1}{n}\biggr) \biggr).$$

I can see that the formula for the standard function scale looks pretty similar to what is asked, but I do not see how to apply it here. Could you please give me a hint on how to proceed?
Edit: So far I got, using the binomial expansion of $(1-3z)^{1/2}$, that
$$(1-3z)^{1/2} = \sum_{k \ge 0} \binom{1/2}{k} 3^kz^k$$
and by the standard function scale and the fact that $\Gamma(1/2) = \sqrt{\pi}$ this entails
$$[z^n](1-3z)^{1/2} = \frac{3^n}{n^{3/2}\Gamma(1/2)} \biggl(1+\mathcal{O}\biggl(\frac{1}{n}\biggr)\biggr) = 3^n \sqrt{\frac{1}{\pi n^{3}}} \biggl(1+\mathcal{O}\biggl(\frac{1}{n}\biggr)\biggr).$$
We furthermore get
\begin{align}
[z^n]\frac{(1-3z)^{1/2}}{2z} &= \frac{3^{n-1}}{2(n-1)^{3/2}\Gamma(1/2)} \biggl(1+\mathcal{O}\biggl(\frac{1}{n-1}\biggr)\biggr) \\
&= 3^{n-1} \sqrt{\frac{1}{4\pi (n-1)^{3}}} \biggl(1+\mathcal{O}\biggl(\frac{1}{n}\biggr)\biggr).
\end{align}

A: Comment that got too long and explains where you need to change your computations.
First $\alpha=-1/2$ in the formula so you need $|\Gamma(-1/2)|=2\sqrt \pi$ (not forgetting that $M$ has the square root with a minus, canceling the minus of $\Gamma(-1/2)$)
Second, you need to normalize the term $\sqrt {1+z}$ at $1/3$ since you have that in $M(z)$ too, and that is done by using
$$\sqrt {1+z}\sqrt {1-3z }= \biggl(\sqrt {1+z}-\frac{2}{\sqrt 3}\biggr)\sqrt{1-3z}+ \frac{2}{\sqrt 3}\sqrt {1-3z}$$
and noting that $(\sqrt {1+z}-2/\sqrt 3)=(1-3z)g(z)$ with $g$ analytic at $1/3$ so the term $(\sqrt {1+z}-2/\sqrt 3)\sqrt {1-3z}$ is of lower order and can be incorporated in the error.
Third, when you divide by $z$ you need the coeeficient of $z^{n+1}$ in the binomial expansion of $\sqrt {1-3z}$ to get the (dominant) coefficient of $z^n$ in $M(z)$ so putting it together we get that for $n \ge 1$
$$[z^n](M(z))= \frac{2}{\sqrt 3}[z^{n+1}]\frac{(1-3z)^{1/2}}{2}+ \text{error}$$ where the error above is one (negative) power of $n$ extra coming from the expansion of $(1-3z)^{3/2}$, hence it can be incorporated in the final $O(1/n)$, hence
$$[z^n](M(z)) = \frac{3^{n+1}}{2\sqrt{3 \pi} (n+1)^{3/2}}\biggl(1+O \biggl(\frac{1}{n+1}\biggr)\biggr)$$
But clearly $(n+1)^{-3/2}(1+O(1/(n+1))=n^{-3/2}(1+O(1/n))$ so one finally gets that
$$[z^n]M(z) = 3^n \sqrt{\frac{3}{4 \pi n^3}} \biggl(1+\mathcal{O}\biggl(\frac{1}{n}\biggr) \biggr)$$


text:
Q: Failed to get tokens using Azure AD and SPA I am developing my web app, it is a single page application. I want to integrate it with Azure Aactive Directory to login users and call microsoft graph API .
I am following this doc:https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc .
But seems it is not so smoothly when I tried to get an ID token or access token, I always got an error:
blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource . How could I solve it ?Am I in the right direction? Thanks!

A: As superstar @GauravMantri mentioned, if you are developing a SPA, you should use MSAL.js to log in users and get tokens. Call REST API directly not works here.
Just try the .html code below to log in users and get an access token to Microsoft Graph API:

    <meta charset="utf-8">

    <title>Azure AD test</title>

        <button id="SignIn" onclick="signIn()">Sign in</button>

Let me know if you have any more questions.


text:
Q: calling function for all elements in sequence one at a time xquery I am trying to call a function for every element in a sequence but I either get only one of the elements or all of them at the same time.
My sequence has the form $y = ("N","K")and I want to run my function with first the letter N and then the letter K.
My code is:
for $nr in 1 to count($y)
let $n := ($y)[$nr]
return local:checking($n)

But that loop never ends... which I think is because the $n that i send to the function is both "N" and "K".
Any ideas?


text:
Q: Optimization with Boundary Solutions I am trying to maximize this objective function $$f(x)=-x^2$$ subject to $1 \le x\le 3 $
This is the Langrangian I wrote:
$$\mathcal L (x, \mu, \lambda) := x^2 + \lambda (3-x)+\mu (x-1)$$
F.O.C + other conditions
1) $2x=\mu-\lambda$
2) $\lambda (3-x)=0$
3) $\mu (x-1)=0$
4) $\lambda \geq0, \mu \ge0$
What am I stuggling with assuming that I dont know which constraints bind, how do I solve knowing potentially the answer is on the boundary? i.e, w/o converting this problem to a minimization or adding slack terms, how do I solve for the answer with the 4 equations I have? Thank you.

A: If the only  permitted  way of solving problem is using Lagrange multiplier,  you are going to consider all possibilities for Lagrange multipliers , for example from relation 2. you either have $[\lambda > 0 , ~ x=3]$ or $\lambda = 0$
First case gives you $x=3.$
Second case gives you $ 2x = \mu   $ using 3 you get $x=0 ,$ or $x=1$. ($x=0$ is not feasible)
So all candidate points for optimality are $$x= 1, ~ 3$$
Last step:  Check them to find maximum point!

A: Guide:
There are only $2$ boundaries, you can try out
Case $1$: $x=1$.
Case $2$: $x=3$.
Case $3$: optimal $x$ is in the interior.

A: HINT: the searched Maximum is $f(1)$ since your function is monotonously decreasing in the given interval


text:
Q: Exercise on graphing integral of floor function My question is from Apostol's Vol. 1: One-variable calculus with introduction to linear algebra textbook.

Page 70. Exercise 6.
a) If $n$ is a positive integer, prove that $\int_0^n\lfloor t\rfloor^2\mathrm dt=\frac{n(n-1)(2n-1)}{6}.$
b) If $f(x)=\int_0^x\lfloor t\rfloor^2\mathrm dt$ for $x\ge0$, draw the graph of $f$ over the interval $[0,3]$.
c) Find all $x>0$ for which $\int_0^x\lfloor t\rfloor^2\mathrm dt=2(x-1)$.

The attempt at a solution. I solved a), and I think my solution is correct, here it is:
We know that $$\int_0^n\lfloor t\rfloor^2\mathrm dt=1^2+2^2+\cdots+(n-1)^2$$ and $$1^2+2^2+\cdots+(n-1)^2=\frac{n(n-1)(2n-1)}{6}$$ therefore $$\int_0^n\lfloor t\rfloor^2\mathrm dt=\frac{n(n-1)(2n-1)}{6}.$$
For b), I am confused, I thought I should have graphed $f(x)=\frac{2x^3-3x^2+x}{6}=\frac{x(x-1)(2x-1)}{6}$, but that's silly, because the formula is for $\int_0^n\lfloor t\rfloor^2\mathrm dt$ where $n$ is integer. So I guess $f(x)=\int_0^x\lfloor t\rfloor^2\mathrm dt$ from $0$ to $3$ would be constant $5$, since $\int_0^3\lfloor t\rfloor^2\mathrm dt=5$, am I correct?
As for c), my attempt was to solve this equation: $$\frac{x(x-1)(2x-1)}{6}=2(x-1)$$ $$x=\frac{1}{4}(1-\sqrt{97}), x=\frac{1}{4}(1+\sqrt{97}).$$ This is not correct. So any hints would be appreciated on b) and c). Thank you in advance.

A: For b): You're not right in saying that $f(x)$ is constant. You know the value in $0, 1, 2$ and $3$ (from the formula you proved in a), try to think about what happens to $\lfloor t\rfloor^2$ between two integers and use that to find out how $f$ behaves on those intervals.
c) should be easy when you've figured out how $f$ behaves on the intervals between the integers.


text:
Q: Does the word "raytracer" exist? If not, is it well readable anyway?
"Ray tracer" seems to be used more frequently but this is not my question.
An example sentence could be:

A raytracer is a computer program that uses an algorithm where light rays are traced back to their origin to create realistic 2D images from 3D scenes.

A: You certainly wouldn't be misunderstood if you used raytrace, raytracer, or raytracing in your writing.
If you peruse the comp.graphics.raytracing newsgroup, you'll see that it's pretty common to write the terms as closed compounds (one word, unhyphenated).


text:
Q: Writing every element in a group from its presentation Problem
If we have a group $G$ of order $8$ such that $G=\langle i,j,k | ij=k,jk=i,ki=j,i^2=j^2=k^2\rangle $, and we denote $i^2=m$, show that every element of G can be written in the form $e,i,j,k,m,mi,mj,mk$. The problem suggests writing out the multiplication table during the course of the solution.
Solution attempt with questions
(I will edit with the multiplication table added once I convert it from $\LaTeX$ to markdown.
First question: How does this group have order 8? I can only find 7 elements: $e,i,j,k,i^2,j^2,k^2$. It doesn't make sense for the 8th element to be $m$ as $m$ is just a denotion for $i^2$.
Next question:
I've shown all the trivial answers:
Given by presentation:
$ij=k,jk=i,ki=j, ii=m, jj=m, kk=m$
Extrapolated with $i^2=j^2=k^2=m$:
$i^2i=mi$, $k^2i=mi$, $j^2i=mi$
(I use similar logic to find terms like $i^2j$ and $i^2k$)
Elements of form $x^3$:
$i^2i=(ii)i=mi, j^2j=mj, k^2k=mk$
Where I'm stuck at is determining what the elements like $i^2i^2$ are. For example, $i^2i^2=iiii$. There isn't a part of the presentation that helps reduce $i^2$ to a usable form.
If I'm looking at this completely wrong, I'd appreciate some advice or a hint towards the solution.

A: *

*Since $i^2=j^2=k^2=m$, then $mi=im$, $jm=mj$, $km=mk$.

*Since $m=kk=kij=(ij)(jk)(ki)=im^2i=m^3$, then $m^2=e$.

*Since $i^4=e$, then $i^{-1}=i^3=im$. Similarly, $j^{-1}=jm$, $k^{-1}=km$.
So, $ji=ijm$, $kj=jkm$, and $ik=kim$.

*Using 1-3 we can simplify any word from $i,j,k,i^{-1},j^{-1},k^{-1}$.
Hence, here is the complete list of elements of group $G$: $e,i,j,k,m,mi,mj,mk$.


text:
Q: C++ access callback data I am attempting to create a wrapper around class functions. The purpose of my wrapper is to test input, output, and enforce order of operations with various calls throughout my program. I am trying to not make any changes to the callee class. Attached is an example of what I am trying to achieve, but unable to figure out.
Main.cpp
#include "func_warpper.h"
#include "func.h"

int main()
{
    func_wrapper fw
    fun func;
    int origValue = 5;
    fw.caller([&](int origValue) { func.f(origValue); }, origValue);
    int output = func.getResult().number;
    std::cout << " value outputed by function 2 : " << output << std::endl;
    // output
    // note that above line does give me the result I am looking for
    // however, I want to be able to get this inside the function of caller
    return 0;
}

func.h .... I want this to be unmodified
#ifndef FUN_H
#define FUN_H

class fun
{
    public:
        struct result
        {
            int number;
        };
        fun();
        ~fun();
        void f(int value);
        struct result getResult(){return this->testResult;};
        private:
            struct result testResult;
};
#endif

func.cpp  .... I want this to be unmodified
#include "func.h"

fun::fun(){
    this->testResult.number = 0;
    return;
}
fun::~fun(){
    return;
}
void fun::f(int value){
    int updateValue = value * 5;
    this->testResult.number = updateValue;
}

func_wrapper.h     .... I can modify this until the cows come home, please go ham with recommended changes :)
class func_wrapper
{
public:
    struct new_result
    {
        int new_number;
    };
    func_wrapper();
    ~func_wrapper();

    void caller(std::function<void(int)> clb, int val);
    struct new_result getNewResult() { return this->new_testResult; };
    private:
        struct new_result new_testResult;
};

#endif

func_wrapper.cpp   .... same as above, I can modify this until the cows come home, please go ham with recommended changes :)
#include "func_wrapper.h"

func_wrapper::func_wrapper()
{
    //ctor
    this->new_testResult.new_number = 0;
    return;
}

func_wrapper::~func_wrapper()
{
    //dtor
}

void func_wrapper::caller(std::function<void(int)> clb, int val)
{
    std::cout << " value entered into function: " << val << std::endl;
    // clb(val); seems to call the function but does not store locally anything
    clb(val);
    clb;
    // clb; seems to store all the information locally however I seem unable to
    // to reach the infromation: clb -> [functor] -> func -> testResult -> number
    // would like ...
    int output = clb ???  // the result of what gets filled from number struct
    // if I attempt to #include func.h
    // func func;
    // func.getResult().number; locally the answer is zero with or without delay
}

Through several days of searching, I have not found anything that can help with this problem, to include similar enough questions on stack overflow. Any help would be greatly appreciated, thank you.

A: So, my understanding is that inside  func_wrapper::caller you want to be able to access the wrapped class that is inside your callback. Unfortuately, the way you are doing it, is impossible. There is no (legitimate) way to reach inside the function and access its arguments.
However, if you break up the operation into its component parts, you can do what you want. You would want a caller function more like this:
template <typename Type, typename Function>
void caller(Type&& functor, Function function, int val)
{
   std::cout << " value entered into function: " << val << std::endl;

   std::invoke(function, functor, val);

   std::cout << "value inside wrapper: " << functor.getResult().number << "\rn";
}

and then call it like this.
fw.caller(func, &fun::f, origValue);

https://godbolt.org/z/151YfEeoo

A: @JohnFilleau had mentioned to pass the class object instead of the function from within the class. The following is the solution based on example code that he provided, and I modified to work with the example. I realize the question is confusing but would like to thank both JohnFilleau and Taekahn for the discussion.
In main.cpp
int main()
{
    func_wrapper fw;
    fun func;
    int origValue = 5;
    fw.caller2(func, origValue);
return 0:
}

func_wrapper::caller2
    void func_wrapper::caller2(fun& fun, int val)
{
    std::cout << " value entered into function: " << val << std::endl;
    fun.f(val);
    int output = fun.getResult().number;
    std::cout << " did this work: " << output << std::endl;

}

In the header I had to add
#include "func.h"

with the change to the header as follows
void caller2(fun& fun, int val);


text:
Q: How to get an Image of specific dimensions from native camera This is the code I am using to get a full sized image, which is >2mb in size and 3560 X 1876 in dimension.
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    image = (ImageView) findViewById(R.id.image);
    button = (Button) findViewById(R.id.button);

    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            filePath = Environment.getExternalStorageDirectory() + "/Full_"
                    + System.currentTimeMillis() + ".jpeg";
            File file = new File(filePath);
            Uri output = Uri.fromFile(file);

            Intent i = new Intent(
                    android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
            i.putExtra(MediaStore.EXTRA_OUTPUT, output);
            startActivityForResult(i, CAPTURE_IMAGE);
        }
    });
}

    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inPreferredConfig = Bitmap.Config.ARGB_8888;
    Bitmap photo = BitmapFactory.decodeFile(filePath, options);
    image.setImageBitmap(photo);
}

Is there a way to get the image of specific size, in my case a <100kb sized image of dimensions 480 x 320.

A: You can take a look at this blog post I wrote on how to get Images from device's camera Activity:
Guide: Android: Use Camera Activity for Thumbnail and Full Size Image
If you look at the end of the guide, you have this method:
public static Bitmap decodeSampledBitmapFromFile(String path, int reqWidth, int reqHeight)
{ // BEST QUALITY MATCH

//First decode with inJustDecodeBounds=true to check dimensions
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(path, options);

// Calculate inSampleSize, Raw height and width of image
final int height = options.outHeight;
final int width = options.outWidth;
options.inPreferredConfig = Bitmap.Config.RGB_565;
int inSampleSize = 1;

if (height > reqHeight)
{
    inSampleSize = Math.round((float)height / (float)reqHeight);
}
int expectedWidth = width / inSampleSize;

if (expectedWidth > reqWidth)
{
    //if(Math.round((float)width / (float)reqWidth) > inSampleSize) // If bigger SampSize..
    inSampleSize = Math.round((float)width / (float)reqWidth);
}

options.inSampleSize = inSampleSize;

// Decode bitmap with inSampleSize set
options.inJustDecodeBounds = false;

return BitmapFactory.decodeFile(path, options);
}

you can provider there the required dimensions for your image output.

A: you have to use the inSampleSize from BitmapFactory.Options. Through it the decoder will downsample your image of the  inSampleSize. For instance  inSampleSize = 2 will create a bitmap of width/2 and heigth/2
int destWidth = 480;
int destHeight = 320;

while ( (bitmapWidth/2 > destWidth)
                 || (bitmapHeight/2 > destHeight)) {
      ++inSampleSize;
      bitmapWidth /= 2;
      bitmapHeight /=2;
}

A: What if using a simplest way to do it. Copy this method, pass your bitmap and required height and width, get a scaled image back :)
public static Bitmap resizeBitmap(Bitmap originalBitmap, int width, int height) {

    float scaleWidth = ((float) width) / originalBitmap.getWidth();
    float scaleHeight = ((float) height) / originalBitmap.getHeight();

    Matrix matrix = new Matrix();
    matrix.postScale(scaleWidth, scaleHeight);

    return Bitmap.createBitmap(originalBitmap, 0, 0, original.getWidth(),original.getHeight(), matrix, true);
  }


text:
Q: Looking for a simple proof that the generalized disc is bounded So let us define the generalized disc of degree $n$ as
$$
\mathbb{D}_n:=\{w\in M_{n\times n}(\mathbb{C}):w=w^t, I_n-w\overline{w}>0\}.
$$
For a Hermitian matrix $A$, the notation $A>0$ means that it is positive definite.
Q: So how do you prove cleanly that $\mathbb{D}_n$ is bounded?

A: The diagonal entries of a positive definite matrix are real and non-negative. If we let the rows of $w$ be $v_1,\dots,v_n$, then the diagonal entries of $I_n-w\overline{w}$ are $1-v_i\overline{v_i}=1-\sum_{j=1}^n|w_{ij}|^2$. So in particular $|w_{ij}|\le 1$. This implies that $\mathbb D_n$ is bounded.

A: Your condition implies that for any $\vec{v} \in \mathbb{C}^n$, we have $\lVert \vec{v} \rVert > \lVert w\vec{v} \rVert$, except for $\vec{v} = 0$.  Take $\vec{v}$ to be any of the standard basis vectors and conclude that the columns of $w$ have length less than 1, so its entries are at the least bounded.  It seems that you don't need to assume $w = w^t$, if you write $I_n - ww^* > 0$ instead, and this seems more natural if you are talking about complex Hermitian matrices.


text:
Q: Firefox "intelligently" and silently fixes incorrect file references in CSS and Scripts at runtime. Driving me nuts! Well this is a really weird issue, I really didn't find anything on this elsewhere so I thought I'd address it here.
Say I have an "image.jpg" and accidentally reference it in the CSS like so:
url(imag.jpg)

Note the missing "e". Now for me, Firefox is so incredibly clever that it will still find the correct image, but not spit out a warning. So I assume that everything is ok.
But later, when I test the page in any other browser, all of a sudden the image doesn't display (and rightly so). That's because Firefox thought it was a good idea to correct my error without telling me.
This becomes more critical with scripts. Firefox will also auto-correct a typo in a <script src=""> reference.
I just wasted a whole hour scratching my head and trying to debug an ajax function in Webkit - turns out, I just had a typo where I included the file.
Why on earth does Firefox do this without telling, and where the heck can I turn this off? This has first occured somewhere around FF 3.0 and still persists in 3.6.3.
/rant an thank fo any inpu ;)
EDIT: Thanks for your answers so far. I've uploaded a demo
EDIT 2: Thanks to the great input below, I found out that it was my server having the CheckSpelling module on (Apache). Solution: Add
CheckSpelling OFF

to the .htaccess and that fixes it. Thanks again to all.
PS. I'm sorry that I blamed you, Firefox. You're still the best!

A: I don't think this has anything to do with Firefox. Your script also gets included in IE, which leads me to believe your web server is redirecting the request to the real file, not Firefox. What web server are you using? IIS?
When I browse to http://soapdesigned.com/firefox-test/scrip.js in IE, I get prompted to download script.js, the correct file.
Update:
After examining with Fiddler, when I request scrip.js, I get HTTP 301 (Moved Permanently).

A: I think what you're seeing is mod_speling (or something like it) in action:
http://httpd.apache.org/docs/2.0/mod/mod_speling.html
It's an apache module meant for correcting minor mis-spellings.

Requests to documents sometimes cannot be served by the core apache server because the request was misspelled or miscapitalized. This module addresses this problem by trying to find a matching document, even after all other modules gave up. It does its work by comparing each document name in the requested directory against the requested document name without regard to case, and allowing up to one misspelling (character insertion / omission / transposition or wrong character). A list is built with all document names which were matched using this strategy.

A: This is not Firefox, it is something in your server:

~% curl -v -o/dev/null http://soapdesigned.com/firefox-test/scrip.js
* About to connect() to soapdesigned.com port 80 (#0)
*   Trying 82.165.116.124... connected
* Connected to soapdesigned.com (82.165.116.124) port 80 (#0)
> GET /firefox-test/scrip.js HTTP/1.1
> User-Agent: curl/7.19.5 (x86_64-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: soapdesigned.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Sat, 17 Apr 2010 22:44:08 GMT
< Server: Apache
< Location: http://soapdesigned.com/firefox-test/script.js
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=iso-8859-1
<
* Connection #0 to host soapdesigned.com left intact

* Closing connection #0

Your server probably is running mod_spelling, which detects failed requests to nonexistent files and tries to redirect to other files with similar spellings.


text:
Q: multiple login to access data for each department only I have requests table that have fields (id, name, date, department, answer) and (req_res1.php) that display all records from the table, I tried to create multiple login to access this form for each department only. I mean in a login form there are  username and password and department name and when user choose user, pass and dept., the form display results for only this department. I tried different things but nothing works.
req_res1.php
<?php
$connect = mysqli_connect('localhost', 'root', '', 'test')or die ( mysqli_error($connect) );
$sSQL= 'SET CHARACTER SET utf8';
mysqli_query($connect,$sSQL)
or die ('Can\'t charset in DataBase');
$query = "SELECT * FROM requests ORDER BY id DESC";
$result = mysqli_query($connect, $query);

?>

          <title>update and delete records</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

          <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />

requests display

       request no
       name
        date of request
    department
    status

     <?php
     while($row = mysqli_fetch_array($result))
     {
      echo '

       '.$row["no"].'
       '.$row["name"].'
       '.$row["reqdate"].'
        '.$row["dept"].'
        '.$row["answer"].'

      ';
     }
     ?>

req_res2.php
<?php
header ('Content-Type: text/html; charset=UTF-8');
$connect = mysqli_connect('localhost', 'root', '', 'test')or die ( mysqli_error($connect) );

$sSQL= 'SET CHARACTER SET utf8';

mysqli_query($connect,$sSQL)
or die ('Can\'t charset in DataBase');

$input = filter_input_array(INPUT_POST);
$name = mysqli_real_escape_string($connect, $input["name"]);
$no = mysqli_real_escape_string($connect, $input["no"]);
$reqdate = mysqli_real_escape_string($connect, $input["reqdate"]);
$answer = mysqli_real_escape_string($connect, $input["answer"]);

if($input["action"] === 'edit')
{
 $query = "
 UPDATE requests
 SET name = '".$name."',
 answer = '".$answer."'
 WHERE id = '".$input["id"]."'
 ";

 mysqli_query($connect, $query);

}
if($input["action"] === 'delete')
{
 $query = "
 DELETE FROM requests
 WHERE id = '".$input["id"]."'
 ";
 mysqli_query($connect, $query);
}

echo json_encode($input);

?>


text:
Q: Scala: curried function in foreach? I am trying to use curried function when iterating collection with 'foreach' method:
object CurriedTest {

  def main(args: Array[String]): Unit = {
    fun("one")("two")("three")
    (fun2)("three")
    val lst = List ("x", "y", "z")
    lst.foreach(fun2)
    lst.foreach(fun("one"),("two") _)

  }

  def fun (a1: String) (a2:String) (a3: String) = {
    println("a1: "+a1+" a2: "+a2+" a3: "+a3)
  }

  def fun2 = fun("one")("two") _
}

Why line 'lst.foreach(fun("one"),("two") _) ' does not compile and return:
- too many arguments for method foreach: (f: String => B)Unit

error message?

A: Remove comma from this line
lst.foreach(fun("one"),("two") _)


text:
Q: How do I assign array variable in a simple Pthread programming? I'm a newbie in Pthread programming.
I've been trying to use Pthread in a very simple way like this code below, and it works well in my CodeBlock as I already included the dll and bin files.
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

void *printNumber(void *x);

int main(){
    pthread_t threadA, threadB, threadC, threadD;
    pthread_create(&threadA, NULL, printNumber, (void *)"Sponge");
    pthread_create(&threadB, NULL, printNumber, (void *)"Star");
    pthread_create(&threadC, NULL, printNumber, (void *)"Squid");
    pthread_create(&threadD, NULL, printNumber, (void *)"Crab");
    pthread_exit(NULL);
    return 0;
}

void *printNumber(void *x){
    char* id = (char*)x;
    int i;
    for(i=0;i<100;i++){
        printf("Thread %s: printing integer value %i\n", id, i);
    }
    pthread_exit(NULL);
}

And then I write another simple program to add 2 arrays (arrayA + arrayB) into arrayC, using Pthread.
Here's my simple code.
Everything was hardcoded, no looping and such in the main(), because I want to make it as simple as possible for me to understand how to create a single Pthread.
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

#define SIZE 16
#define UPPER_RAND 100
#define NUM_THREADS 4

// HEADER PROCEDURES
void randomGenerator(int arr[]);
void printArray(int arr[]);
void *addArrayPthread(void *x);

typedef struct {
    int startIdx;
    int arrC[SIZE], arrA[SIZE], arrB[SIZE];
} someType;

int main(){
    printf("A Simple Program To Add Arrays Using PThread\n");
    int arrayA[SIZE];
    int arrayB[SIZE];
    int arrayC[SIZE];

    randomGenerator(arrayA);
    printArray(arrayA);

    randomGenerator(arrayB);
    printArray(arrayB);

    someType *w,*x,*y,*z;
    w = (someType*) malloc(sizeof(someType));
    x = (someType*) malloc(sizeof(someType));
    y = (someType*) malloc(sizeof(someType));
    z = (someType*) malloc(sizeof(someType));

    (*w).startIdx = 0;
    (*w).arrA = arrayA;
    (*w).arrB = arrayB;
    (*w).arrC = arrayC;

    (*x).startIdx = 4;
    (*x).arrA = arrayA;
    (*x).arrB = arrayB;
    (*x).arrC = arrayC;

    (*y).startIdx = 8;
    (*y).arrA = arrayA;
    (*y).arrB = arrayB;
    (*y).arrC = arrayC;

    (*z).startIdx = 12;
    (*z).arrA = arrayA;
    (*z).arrB = arrayB;
    (*z).arrC = arrayC;

    pthread_t threadA, threadB, threadC, threadD;
    pthread_create(&threadA, NULL, addArrayPthread, (void *)w);
    pthread_create(&threadB, NULL, addArrayPthread, (void *)x);
    pthread_create(&threadC, NULL, addArrayPthread, (void *)y);
    pthread_create(&threadD, NULL, addArrayPthread, (void *)z);

    pthread_join(threadA, NULL);
    pthread_join(threadB, NULL);
    pthread_join(threadC, NULL);
    pthread_join(threadD, NULL);

    return 0;
}

//=====================================================================================//

void randomGenerator(int arr[]){
    printf("Generating random value for the array...\n");
    int i;
    for (i=0;i<SIZE;i++){
        arr[i] = (rand() % UPPER_RAND);
    }
}

void printArray(int arr[]){
    printf("Display the array value...\n");
    int i;
    printf("[");
    for (i=0;i<SIZE;i++){
        printf("%i, ",arr[i]);
    }
    printf("]\n");
}

void *addArrayPthread(void *x){
    someType *p = (someType *) x;
    printf("Adding to arrays, starting from index #%i\n",(*p).startIdx);
    int blockSize = SIZE/NUM_THREAD;
    int end = (*p).startIdx + blockSize;
    int i;
    for (i=(*p).startIdx;i<end;i++){
        (*p).arrC[i] = (*p).arrA[i] + (*p).arrB[i];
    }
}

I got 12 error messages around these lines:
(*x).arrA = arrayA; and such
||In function `int main()':|
\pth_array.c|58|error: ISO C++ forbids assignment of arrays|

Here's my questions:

*

*Why the forbidden assigment of arrays? And how to solve it?

*In the first program above, I put pthread_exit(NULL) twice: in
main() and in the void* function. I suppose I only need to put it once. So where do exactly I have to put it? In main() or in the void* function?

*Is it mandatory to put pthread_join in the main() before return 0?

Thank you in advance.
Your explanation will be a big help for me.
Thanks
P.S.: I post another similar question (about matrix) in the section below.

A: What about something like :
typedef struct {
    int startIdx;
    int *arrC, *arrA, *arrB;
} someType;

[...]

x->arrA = arrayA
[...]

pthread_join is needed because you want to wait for every thread to be finished before exiting the application.

A: Well,

*

*You are not allowed to directly copy arrays in C. It has been explained here quite well.

*The exact functinality of pthread_exit is clearly stated here; Examples are also available here. That is to say that the call should be placed in printNumber(void *x) and not in main().

*The exact functinality of pthread_join is clearly stated here. So to pass control to the thread, the pthread_join call is required.