text:
Q: Why my html element is not shown in the following function my goal is to display a loading curtain when a query to Quick-Base takes too long.
I have the following code that I thought it was going to work but it somehow does not. Everything works except for the loading curtain because it is never executed when it should be.
My code:

The code works but the curtain is never shown even if the query takes a couple of seconds (as much as 6 seconds). If I comment out the line "$('#curtain').hide();"  I can see the loading curtain working as expected but only after the query has finished. It is as if the function is not been executed line by line but it waits first to complete the query and then to show the curtain. I'm sure I'm missing something but I don't know what. Thank you.

A: use this instead(no need to add any HTML to page) :
 function showLoading() {
            if (document.getElementById("loadingDiv"))
                return;

            var div = document.createElement("div");
            var img = document.createElement("img");
            var span = document.createElement("span");
            span.appendChild(document.createTextNode("Loading ..."));
            span.style.cssText = "margin-top:50vh;font-family:IranSans;direction:rtl;color:#f78d24;"

            img.src = "/images/LoadingImage.png";
            img.style.cssText = "display:block;margin:auto;margin-top:calc(50vh - 64px);width:128px;height:128px;"

            div.style.cssText = "position:fixed;width:100vw;height:100vh;background-color:rgba(0,0,0,0.85);top:0px;left:0px;z-index:10000;text-align:center";
            div.id = "loadingDiv";
            div.appendChild(img);
            div.appendChild(span);
            document.body.appendChild(div);
        }

        function hideLoading() {
            var div = getElementById("loadingDiv");
            if (div)
                document.body.removeChild(div);
        }

A: The solution as @keith suggested was to "transform" the getRecords function from synchronous to asynchronous.
I ended up making the whole function selectedValueChanged() "asynchronous" by using the setTimeout trick.
One solution that worked for me was the following:
 function selectedValueChanged() {

    var e = document.getElementById("record_id_select");
    var value_selected = e.value;
    var CO_picked_record_id = parseInt(value_selected);
    var query_CO_line_details = "{'"+related_CO_fid+"'.EX.'"+CO_picked_record_id+"'}";
    var records = getRecords(table_CO_line_details_DBID,query_CO_line_details);
    var data_array = createArrayFromRecordsDrilled(records,CO_detail_record_categories);
    var table_div = tableCreate(data_array,'table_container_1',"Please Enter Quantities",headerList);
    $('#table_container_1').replaceWith(table_div);

     }
    }

     function loadingSelectedValueChanged(callbackFunct){

         setTimeout(function(){
             callbackFunct()
             $('#curtain').hide();
         },10);
     }

     function selectedValueChangedUP() {

      $('#curtain').show();
      loadingSelectedValueChanged(selectedValueChanged);
   }

And now instead of calling selectedValueChanged, I call selectedValueChangedUP.
What SetTimeout does is to execute the function that receives as parameter after a given amount of time. This process is done in an "asynchronous" way.


text:
Q: passing a column out of a matrix to a function in c I want to pass a particular column of the matrix that I have in my program to a function.
If I use the call <function_name>(<matrix_name>[][<index>]); as the call
then I get the error

error: expected expression before ']'
  token

So please help me in finding the suitable way
Thanks

A: The syntax you used doesn't exist.
Matrices are stored in memory by row (or better, by the second dimension, to which you give the semantics of rows), so you cannot natively. You could copy all your column elements in a vector (a single dimension array) and pass it.
If you need to work only by column (and never by row) you could change the semantics you give to the first and to the second dimension: think of your matrix as matrix[row][column] instead of matrix[column][row].
Otherwise, if you need to do this often, look for a better data structure, instead of a simple array.

A: Because of the way addressing works, you can't simply pass the 'column' since, the 'column' values are actually stored in your 'rows'. This is why your compiler will not allow you to pass no value in your 'row' reference, ie: '[]'.
An easy solution would be to pass the entire matrix, and pass the column index as a seperate integer, and the number of rows. Your function can then iterate through every row to access all members of that column.
ie:
functionName(matrixType** matrixRef, int colIndex, int numRows)
{
   for(int i=0; i< numRows; ++i)
      matrixType value = matrixRef[i][colIndex]; //Do something
}

A: You are going to have to reformat the data. The column is not contiguous in memory. If for example you have an array:
arr[5][4]

Then trying to pass a 'column' would be like trying to pass every 5th element in the array. Think of it as one giant array.

A: There's a few things you need to keep in mind about C here.
I'm assuming your matrix is stored as a 2D array, like this:
float mat[4][4];
What you need to remember is that this is just 16 floats stored in memory consecutively; the fact that you can access mat[3][2] is just a shortcut that the compiler gives you. Unfortunately, it doesn't actually pass any of that metadata on to other function calls.  Accessing mat[3][2] is actually a shortcut for:
mat[ (3*4 + 2) ]
When you pass this into a function, you need to specify the bounds of the matrix you're passing in, and then the column number:
void do_processing(float* mat, int columns, int rows, int column_idx)
Inside this function, you'll have to calculate the specific entries yourself, using the formula:
mat[ (column_idx * rows) + row_idx ]

redpajama_set_name: RedPajamaStackExchange


text:
Q: Users cannot change their password on WS2012R2 domain I have just made a new Windows Server 2012 R2 domain. Joined the PC and user to the domain and everything Works on that end.
Now I made a group policy (that is being checked as being pushed with rsop.msc on the client PC) that allows them to put any password they want.
The problem is that the clients (via Ctrl+Alt+Del) cannot change their password. It gives them the error message of

Unable to update the password. The value provided for the new password does not meet the length, complexity, or history requirements of the domain.

I've gone also to the "Default Domain Policy" and tried to change it there (even though rsop.msc says that the GPO being applied is the one I made) and it still does not allow them to change it.
I also joined a fresh machine and a new user, and it still does not apply. I have it set to apply to all authenticated users. Do I need to change something else?
A few other things:
The OU (Computers) that my GPO is linked to is all computers. My OU is "Company Name" and inside of it there are two other OUs One is "Users" and the other is "Computers". I am only linking it to Computers.
gpresult /r is telling me that the policy is being applied to the computer.
I am doing gpupdate /force on both server and client side (should not be neccesary for client)

A: There can be only one password policy per domain and it MUST be linked to the domain. A password policy linked to an OU will have no effect. The GPO may show as being processed but the settings will not be implemented. - http://blogs.technet.com/b/askpfeplat/archive/2013/01/14/fun-and-games-active-directory-password-policies.aspx

A: Check the GPO inheritance on your Domain Controllers OU or run an RSOP on one of your DCs. You may have a GPO that contains password policy settings with higher precedence on your DCs than your Default Domain Policy. If so, that's also overriding the password policy you set in your Default Domain Policy.
As joeqwerty said, there can be only one "default" password policy for domain users.  And that policy is controlled by whatever settings get applied to the domain controllers, not the member server where users might be changing their domain password from.
Password policy settings that get applied to member computers only affect passwords for local accounts on that member.

A: You can find your Password Policies using this comment:
net accounts /domain

Try changing the Local Policy of the system.
Use this command to open Local Security Policy:
secpol.msc

A: The password MUST BE composed of at least :

*

*one CAPITAL letter

*one number

*one normal letter

*8 characters length.

If not, the password will not be correct. Try it and give your feedback.


text:
Q: excel variable sheet number equal to column number reference For my latest bright idea I need to change the reference of variable sheet to the next column in another sheet.
I create a copy of an existing sheet ("INL") so I get ("INL(2)),("INL(3)"),....,("INL(n)"). The references in these sheets should be updated to the next column in sheet ("Info") so that the formulas in ("INL B:B") reference to ("Info C:C), ("INL (2)B:B") references to ("Info D:D")... INL (n) to Info (x).
I tried something like the code below but now I am stuck.
Private Sub CommandButton2_Click()

Application.ScreenUpdating = False
 Dim ws As Worksheet
 Dim rng As Range
Set ws= Sheets("INL") Or ws.Name Like ("'INL (*)'")
    For Each ws In ThisWorkbook.Sheets
      Set rng = ws.Range("C:C")
        For Each cell In rng
    cell.Formula = Replace(cell.Formula, "=Info!C", "=Info!(=COLUMN(C24)-2)")
    Next Cell
    Next ws
Application.ScreenUpdating = True
End Sub

Does anyone have a good way to handle this?

A: Try:
Private Sub CommandButton2_Click()

Dim ws As Worksheet
Dim rng As Range
Dim c As Range
Dim varCopy As Variant
Dim strCol As String

Application.ScreenUpdating = False

For Each ws In ThisWorkbook.Sheets
    If Left(ws.Name, 3) = "INL" Then
        If ws.Name = "INL" Then
             varCopy = Array(1, 1)              'An exception case to handle 1st sheet which has no number in it.
        Else
             varCopy = Split(ws.Name, ")")      'Step 1 of getting sheet copy number.
             varCopy = Split(varCopy(0), "(")   'step 2. Copy # will be element 1 in 0 indexed array.
        End If

        Set rng = ws.Range("B:B")               'Question suggests this should be col B, not C. I would recommend limiting the range only to affected rows...
                                                '...rather than looping through the >1 million rows that are in each column.
        strCol = Columns(CLng(varCopy(1)) + 1).Address  'Column number is 1 more than sheet copy number.
        strCol = Mid(strCol, InStr(1, strCol, ":", vbTextCompare) + 1, 100) 'Getting text to right of : ensures including columns AA and higher, if needed.

        For Each c In rng.Cells
           c.Replace What:="Info!C", Replacement:="Info!" & strCol, LookAt:=xlPart 'Changed your line to use the appropriate Replace method.
        Next c

    End If
Next ws

Application.ScreenUpdating = True

Set rng = Nothing
Set ws = Nothing

End Sub

A: Worksheet Copy Index vs Column Number

*

*I have assumed that the references in INL are correct and the code will only modify the references in the copies. If this is not the case, you will have to modify the code.

*I have also assumed that the references are simple and relative (no $ for columns) e.g. =Info!C2.

*Anyways, I have left the three consecutive Debug.Print lines in the code for you to better understand what is happening.

Option Explicit

Private Sub CommandButton2_Click()
    ReplaceReferences
End Sub

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Purpose:      Replaces cell references...
' Calls:        IntColumnNumber,StrStringBetweenTwoChars,StrColumnString
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ReplaceReferences()

    Const sName As String = "INL"
    Const sCol As String = "B"
    Const sfRow As Long = 2
    Const dName As String = "Info"
    Const dfCol As String = "C"
    Const dColDiff As Long = 1 ' don't change: related to (2),(3)...

    Dim dNameExclam As String
    If UBound(Split(dName)) > 0 Then
        dNameExclam = "'" & dName & "'!"
    Else
        dNameExclam = dName & "!"
    End If

    Dim FindString As String: FindString = dNameExclam & dfCol

    Dim dfColNum As Long: dfColNum = IntColumnNumber(dfCol)

    Application.ScreenUpdating = False

    Dim sws As Worksheet
    Dim srg As Range
    Dim scrg As Range
    Dim swsNum As String
    Dim swsName As String
    Dim ReplaceString As String
    Dim dColString As String

    For Each sws In ThisWorkbook.Worksheets
        swsName = sws.Name
        If UCase(swsName) Like UCase(sName) & " (*)" Then
            swsNum = StrStringBetweenTwoChars(swsName, "(", ")")
            If IsNumeric(swsNum) Then
                dColString = StrColumnString(dfColNum + swsNum - dColDiff)
                With sws.Columns(sCol)
                    Set srg = .Resize(.Rows.Count - sfRow + 1).Offset(sfRow - 1)
                End With
                Set scrg = Intersect(sws.UsedRange, srg)
                If Not scrg Is Nothing Then
                    ReplaceString = dNameExclam & dColString
Debug.Print "Range: '" & sws.Name & "!" & scrg.Address(0, 0) & "'"
Debug.Print "'" & FindString & "' to '"; ReplaceString & "'"
Debug.Print "FirstCell formula: '" & scrg.Cells(1).Formula & "'"
                    ' This may not work as expected when you will need to loop.
                    scrg.Formula = Replace(scrg.Cells(1).Formula, _
                         FindString, ReplaceString, , , vbTextCompare)
                    Set scrg = Nothing
                End If
            End If
        End If
    Next sws

    Application.ScreenUpdating = True

End Sub

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Purpose:      Returns the Excel column number from a (column) string.
' Remarks:      Restricted only by 'ColumnNumber As Long', i.e., e.g.:
'               Debug.Print IntColumnNumber("FXSHRXW") ' = 2147483647
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function IntColumnNumber( _
    ByVal ColumnString As String) _
As Double
    Const ProcName As String = "IntColumnNumber"
    On Error GoTo ClearError

    Dim ColumnStringLength As Long: ColumnStringLength = Len(ColumnString)
    If ColumnStringLength = 0 Then Exit Function

    Dim n As Long
    Dim CharNumber As Long
    Dim CharIndex As Long
    Dim ColumnNumber As Long

    For n = ColumnStringLength To 1 Step -1
        CharNumber = Asc(UCase(Mid(ColumnString, n))) - 64
        If CharNumber < 1 Or CharNumber > 26 Then
            Exit Function
        End If
        ColumnNumber = ColumnNumber + CharNumber * 26 ^ CharIndex
        CharIndex = CharIndex + 1
    Next

    IntColumnNumber = ColumnNumber

ProcExit:
    Exit Function
ClearError:
    Debug.Print "'" & ProcName & "' Run-time error '" _
        & Err.Number & "':" & vbLf & "    " & Err.Description
    Resume ProcExit
End Function

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Purpose:      Returns the Excel column string from a (column) number.
' Remarks:      Restricted only by 'ColumnNumber As Long', i.e., e.g.:
'               Debug.Print StrColumnString(2147483647) ' = "FXSHRXW"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function StrColumnString( _
    ByVal ColumnNumber As Long) _
As String
    Const ProcName As String = "StrColumnString"
    On Error GoTo ClearError

    Dim ColumnString As String
    Dim Remainder As Long

    Do
        Remainder = (ColumnNumber - 1) Mod 26
        ColumnString = Chr(Remainder + 65) & ColumnString
        ColumnNumber = Int((ColumnNumber - Remainder) \ 26)
    Loop Until ColumnNumber = 0

    StrColumnString = ColumnString

ProcExit:
    Exit Function
ClearError:
    Debug.Print "'" & ProcName & "' Run-time error '" _
        & Err.Number & "':" & vbLf & "    " & Err.Description
    Resume ProcExit
End Function

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Purpose:      Returns the string between two characters exclusively.
' Remarks:      Only the first occurrence of the characters is considered.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function StrStringBetweenTwoChars( _
    ByVal SearchString As String, _
    ByVal FirstChar As String, _
    ByVal SecondChar As String) _
As String

    Dim fcPos As Long: fcPos = InStr(1, SearchString, FirstChar, vbTextCompare)
    If fcPos = 0 Then Exit Function
    Dim scPos As Long: scPos = InStr(1, SearchString, SecondChar, vbTextCompare)
    If scPos <= fcPos Then Exit Function

    StrStringBetweenTwoChars _
        = Mid(SearchString, fcPos + 1, scPos - fcPos - 1)

End Function


text:
Q: PostgreSQL 12.9: Finding the count of other players that participated in the same activity Version PostgreSQL 12.9
I have the following table that catalogs a list of activities played by a playerid, and another table that serves as the map for the players information along with a clan id, what I want to do is count the number of players that participated in the same instance id, that have the same clan id.
My table structure is as follows:
Activities Table
CREATE TABLE "public"."activities" (
  "playerdestinyid" int8 NOT NULL,
  "instanceid" int8 NOT NULL,
  "timestamp" timestamptz(6) NOT NULL);

Players Table
CREATE TABLE "public"."players" (
  "destinyid" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "clanid" int8 NOT NULL,
  "characterids" jsonb NOT NULL);

Edit 1:
First attempted query
SELECT
    ROUND(
        SUM (
            ( ( activities.kills * activities.killsdeathsratio ) * 100 ) * ( SELECT COUNT ( * ) * 1.05 FROM "activities" INNER JOIN "players" ON ( "playerdestinyid" = "destinyid" ) GROUP BY "instanceid", "clanid" )
        )) AS "Score",
        players.clanid AS "clanId",
        ROW_NUMBER ( ) OVER ( ORDER BY SUM ( ( activities.kills * activities.killsdeathsratio ) * 100 ) DESC ) AS POSITION,
        COUNT ( players.clanid ) AS "gamesplayed"
    FROM
        activities
        INNER JOIN players ON activities.playerdestinyid = players.destinyid
    WHERE
        TIMESTAMP BETWEEN '2022-03-15 17:00:00+00'
        AND now( )
    GROUP BY
        players.clanid
ORDER BY
    SUM ( ( activities.kills * activities.killsdeathsratio ) * 100 ) DESC

The error returned:
> ERROR:  more than one row returned by a subquery used as an expression

Edit 2:
I got what the query re-written using the CTE as suggested, but it's still giving me the  ERROR:  more than one row returned by a subquery used as an expression response though.
WITH clan_multi AS ( SELECT (COUNT ( * ) * 1.05) as multiplier FROM "activities" INNER JOIN "players" ON ( "playerdestinyid" = "destinyid" ) GROUP BY "instanceid", "clanid" )
SELECT
ROUND( SUM ( ( activities.kills * activities.killsdeathsratio ) * 100 ) ) AS "Score",
players.clanid AS "clanId",
(SELECT multiplier from clan_multi),
ROW_NUMBER ( ) OVER ( ORDER BY SUM ( ( activities.kills * activities.killsdeathsratio ) * 100 ) DESC ) AS POSITION,
COUNT ( players.clanid ) AS "gamesplayed"
FROM
    activities
    INNER JOIN players ON activities.playerdestinyid = players.destinyid
    INNER JOIN clan_multi ON activities.instanceid = instanceid AND players.clanid = clanId
WHERE
    TIMESTAMP BETWEEN '2022-03-15 17:00:00+00'
    AND now( )
GROUP BY
    players.clanid
ORDER BY
    SUM ( ( activities.kills * activities.killsdeathsratio ) * 100 ) DESC

A: SELECT
  "instanceid",
  "clanid",
  count(*)
FROM "activities"
INNER JOIN "players" ON ("playerdestinyid" = "destinyid")
GROUP BY
  "instanceid",
  "clanid"


text:
Q: How to change Language on Android google map V2 api I tried many ways to change language in google maps on android. It's not working.I tried to Change the locale of device with programming,also Force changed the locale of device. What should i do
Im using
com.google.android.gms:play-services:7.3.0
thank you

A: As we discuss in the comment: You can change Locale.setDefault.
Sample code:
Locale.setDefault(new Locale("ja"));

For more details, Please refer to here and here.


text:
Q: how is shopify rendering the pages with their own made up tags i know they have something like smarty but i noticed another site called storenvy.com is using the same thing that shopify is. is there an api or something that i dont know about?
they have tags like
{{ shop.url }}

how are they making this if you know of any tutorial i can get into that would be great
thanks

A: Shopify uses Liquid to render those tags. It's an open source Ruby library Tobi wrote a while back that makes caching really easy on Shopify's side.


text:
Q: qt Add qGraphicsitem which has new qGraphicsItem in constructor to qGrahicsScene I Add custom QGraphicsitem(CoauthorGraphItem) in qGraphicsView's scene.
And in QGraphicsItem's constructor create new qGraphicsItem(NodeItem, EdgeItem).
And then in scene, view qGraphicsItem(CoauthorGraphItem) also qGraphicsItem produced by constructor(NodeItem, EdgeItem).
I want to know why this happened. I can't find this document. help me.
here's my code
 // CoauthorGraphItem is inherit QGraphicsItem
    CoauthorGraphItem::CoauthorGraphItem(ifstream& fin)
    {
        ... // read file and create graph data

        for (boost::tie(ei, ei_end) = boost::edges(*graph); ei != ei_end; ++ei) {
            u = source(*ei, *graph);
            v = target(*ei, *graph);
            Point p1 = position[u];
            Point p2 = position[v];

            //make edge item and it's also inherit QGraphicsItem
            EdgeItem *edge;
            edge = new EdgeItem(p1[0], p1[1], p2[0], p2[1], QColor(Qt::black), 0, index[ei->m_source], index[ei->m_target]);

            edge->setPos(p1[0], p1[1]);
            edgeList << edge;
        }
        //add nodes that's graph nodes
        for (boost::tie(vi, vi_end) = vertices(*graph); vi != vi_end; ++vi) {
            Point p = position[*vi];
            std::string name = label[*vi];

            //make nodeItem and it's also inherit QGraphicsItem
            NodeItem *node;
            node = new NodeItem(p[0], p[1], QColor(Qt::green), QString(name.c_str()), vInfo[i], vcoauthor[i]);
            node->setPos(QPointF(p[0], p[1]));
            nodeList << node;
            i++;
        }
    }


text:
Q: how to set path for fsl in google colab I am trying to do skull stripping using nipype fsl in colab
I have installed fsl in google colab but its last step requires to add following line in .bashrc file
FSLDIR=/usr/share/fsl
. ${FSLDIR}/5.0/etc/fslconf/fsl.sh
PATH=${FSLDIR}/5.0/bin:${PATH}
export FSLDIR PATH

after executing !whereis fsl command i am getting output as

/usr/bin/fsl5.0-fnirt /usr/bin/fsl5.0-first_boundary_corr
/usr/bin/fsl5.0-viena_quant /usr/bin/fsl5.0-bedpostx_datacheck
/usr/bin/fsl5.0-fsl2ascii /usr/bin/fsl5.0-probtrackx
/usr/bin/fsl5.0-extractfidparams /usr/bin/fsl5.0-asl_calib
/usr/bin/fsl5.0-aff2rigid /usr/bin/fsl5.0-Text2Vest
/usr/bin/fsl5.0-fabber /usr/bin/fsl5.0-fslswapdim
/usr/bin/fsl5.0-melodic /usr/bin/fsl5.0-imln /usr/bin/fsl5.0-pnm_evs
/usr/bin/fsl5.0-mcflirt /usr/bin/fsl5.0-lesion_filling
/usr/bin/fsl5.0-first /usr/bin/fsl5.0-vecreg /usr/bin/fsl5.0-Featquery
/usr/bin/fsl5.0-slicesmask /usr/bin/fsl5.0-fast
/usr/bin/fsl5.0-run_mesh_utils /usr/bin/fsl5.0-tbss_2_reg
/usr/bin/fsl5.0-bet2 /usr/bin/fsl5.0-fsladd
/usr/bin/fsl5.0-systemnoise /usr/bin/fsl5.0-create_lut
/usr/bin/fsl5.0-tsplot /usr/bin/fsl5.0-robustfov
/usr/bin/fsl5.0-cutoffcalc /usr/bin/fsl5.0-feat_gm_prepare
/usr/bin/fsl5.0-surf2surf /usr/bin/fsl5.0-siena_flirt
/usr/bin/fsl5.0-Possum /usr/bin/fsl5.0-distancemap
/usr/bin/fsl5.0-applywarp /usr/bin/fsl5.0-eddy_correct
/usr/bin/fsl5.0-drawmesh /usr/bin/fsl5.0-basil_var
/usr/bin/fsl5.0-fslvbm_3_proc /usr/bin/fsl5.0-fsl_sbca
/usr/bin/fsl5.0-tbss_deproject /usr/bin/fsl5.0-fslfft
/usr/bin/fsl5.0-fslcc /usr/bin/fsl5.0-mccutup
/usr/bin/fsl5.0-selfintersection /usr/bin/fsl5.0-fsl_glm
/usr/bin/fsl5.0-surface_fdr /usr/bin/fsl5.0-generate_b0calc
/usr/bin/fsl5.0-pvmfit /usr/bin/fsl5.0-mm /usr/bin/fsl5.0-medianfilter
/usr/bin/fsl5.0-fsl /usr/bin/fsl5.0-first_flirt
/usr/bin/fsl5.0-possum_matrix /usr/bin/fsl5.0-fslmeants
/usr/bin/fsl5.0-standard_space_roi /usr/bin/fsl5.0-fslcorrecthd
/usr/bin/fsl5.0-ccops /usr/bin/fsl5.0-randomise_parallel
/usr/bin/fsl5.0-siena_cal /usr/bin/fsl5.0-surf_proj
/usr/bin/fsl5.0-extracttxt /usr/bin/fsl5.0-possum
/usr/bin/fsl5.0-fsl_mvlm /usr/bin/fsl5.0-InvertXFM
/usr/bin/fsl5.0-Make_flobs /usr/bin/fsl5.0-Renderstats
/usr/bin/fsl5.0-b0calc /usr/bin/fsl5.0-prewhiten
/usr/bin/fsl5.0-xfibres /usr/bin/fsl5.0-contrast_mgr
/usr/bin/fsl5.0-fslFixText /usr/bin/fsl5.0-dual_regression
/usr/bin/fsl5.0-Susan /usr/bin/fsl5.0-updatefeatreg
/usr/bin/fsl5.0-epi_reg /usr/bin/fsl5.0-possumX
/usr/bin/fsl5.0-randomise /usr/bin/fsl5.0-eddy_combine
/usr/bin/fsl5.0-fslchpixdim /usr/bin/fsl5.0-AnatomicalAverage
/usr/bin/fsl5.0-pngappend /usr/bin/fsl5.0-surf2volume
/usr/bin/fsl5.0-dtigen /usr/bin/fsl5.0-tbss_x
/usr/bin/fsl5.0-fslvbm_1_bet /usr/bin/fsl5.0-ptoz
/usr/bin/fsl5.0-ApplyXFM /usr/bin/fsl5.0-fslcpgeom
/usr/bin/fsl5.0-tcalc /usr/bin/fsl5.0-generate_brain
/usr/bin/fsl5.0-gps /usr/bin/fsl5.0-Pnm /usr/bin/fsl5.0-basil
/usr/bin/fsl5.0-find_the_biggest /usr/bin/fsl5.0-probtrackx2
/usr/bin/fsl5.0-fsl_gui /usr/bin/fsl5.0-slicer
/usr/bin/fsl5.0-convert_xfm /usr/bin/fsl5.0-asl_preproc
/usr/bin/fsl5.0-signal2image /usr/bin/fsl5.0-ConcatXFM
/usr/bin/fsl5.0-fsl_motion_outliers /usr/bin/fsl5.0-fsl_histogram
/usr/bin/fsl5.0-pointflirt /usr/bin/fsl5.0-fslsmoothfill
/usr/bin/fsl5.0-checkFEAT /usr/bin/fsl5.0-ztop
/usr/bin/fsl5.0-fsl_prepare_fieldmap /usr/bin/fsl5.0-applytopup
/usr/bin/fsl5.0-halfcosbasis /usr/bin/fsl5.0-swap_voxelwise
/usr/bin/fsl5.0-fslslice /usr/bin/fsl5.0-fslchfiletype_exe
/usr/bin/fsl5.0-first_roi_slicesdir /usr/bin/fsl5.0-zeropad
/usr/bin/fsl5.0-featquery /usr/bin/fsl5.0-immv /usr/bin/fsl5.0-Fdt
/usr/bin/fsl5.0-fslerrorreport /usr/bin/fsl5.0-tbss_skeleton
/usr/bin/fsl5.0-featregapply /usr/bin/fsl5.0-run_first
/usr/bin/fsl5.0-rmsdiff /usr/bin/fsl5.0-fslhd
/usr/bin/fsl5.0-viena_createpng /usr/bin/fsl5.0-imrm
/usr/bin/fsl5.0-fsl_boxplot /usr/bin/fsl5.0-tbss_sym
/usr/bin/fsl5.0-invwarp /usr/bin/fsl5.0-fslvbm_2_template
/usr/bin/fsl5.0-Feat /usr/bin/fsl5.0-slices
/usr/bin/fsl5.0-fdt_rotate_bvecs /usr/bin/fsl5.0-fslcomplex
/usr/bin/fsl5.0-fslanimate /usr/bin/fsl5.0-qboot_parallel
/usr/bin/fsl5.0-applyxfm4D /usr/bin/fsl5.0-mvntool
/usr/bin/fsl5.0-tbss_4_prestats /usr/bin/fsl5.0-bedpost
/usr/bin/fsl5.0-film_gls /usr/bin/fsl5.0-swap_subjectwise
/usr/bin/fsl5.0-mean /usr/bin/fsl5.0-invfeatreg
/usr/bin/fsl5.0-pairreg /usr/bin/fsl5.0-smoothest
/usr/bin/fsl5.0-fsl_abspath /usr/bin/fsl5.0-fslchfiletype
/usr/bin/fsl5.0-oxford_asl /usr/bin/fsl5.0-fslsurfacemaths
/usr/bin/fsl5.0-ttoz /usr/bin/fsl5.0-siena_diff
/usr/bin/fsl5.0-cluster /usr/bin/fsl5.0-std2imgcoord
/usr/bin/fsl5.0-slicesdir /usr/bin/fsl5.0-fslinfo
/usr/bin/fsl5.0-baycest /usr/bin/fsl5.0-fslsize
/usr/bin/fsl5.0-avscale /usr/bin/fsl5.0-slices_summary
/usr/bin/fsl5.0-fslecho /usr/bin/fsl5.0-susan /usr/bin/fsl5.0-Asl
/usr/bin/fsl5.0-Bet /usr/bin/fsl5.0-invwarp_exe
/usr/bin/fsl5.0-concat_bvars /usr/bin/fsl5.0-asl_reg
/usr/bin/fsl5.0-topup /usr/bin/fsl5.0-Flirt
/usr/bin/fsl5.0-design_ttest2 /usr/bin/fsl5.0-fabber_var
/usr/bin/fsl5.0-fslmaths /usr/bin/fsl5.0-Renderhighres
/usr/bin/fsl5.0-quasil /usr/bin/fsl5.0-tmpnam /usr/bin/fsl5.0-fslsplit
/usr/bin/fsl5.0-setFEAT /usr/bin/fsl5.0-sienax
/usr/bin/fsl5.0-remove_ext /usr/bin/fsl5.0-spharm_rm
/usr/bin/fsl5.0-siena /usr/bin/fsl5.0-fslnvols
/usr/bin/fsl5.0-fslmodhd /usr/bin/fsl5.0-fslroi
/usr/bin/fsl5.0-fslreorient2std /usr/bin/fsl5.0-feat
/usr/bin/fsl5.0-fnirtfileutils /usr/bin/fsl5.0-fslstats
/usr/bin/fsl5.0-proj_thresh /usr/bin/fsl5.0-fsl_regfilt
/usr/bin/fsl5.0-avw2fsl /usr/bin/fsl5.0-imglob
/usr/bin/fsl5.0-filmbabescript /usr/bin/fsl5.0-easythresh
/usr/bin/fsl5.0-fsl_schurprod /usr/bin/fsl5.0-tbss_fill
/usr/bin/fsl5.0-setup_masks /usr/bin/fsl5.0-qboot
/usr/bin/fsl5.0-pnm_stage1 /usr/bin/fsl5.0-filmbabe
/usr/bin/fsl5.0-Fsl_prepare_fieldmap /usr/bin/fsl5.0-renderhighres
/usr/bin/fsl5.0-Melodic /usr/bin/fsl5.0-feat_model
/usr/bin/fsl5.0-maskdyads /usr/bin/fsl5.0-flirt_average
/usr/bin/fsl5.0-fsl_tsplot /usr/bin/fsl5.0-asl_mfree
/usr/bin/fsl5.0-calc_grad_perc_dev /usr/bin/fsl5.0-first3Dview
/usr/bin/fsl5.0-fsl_reg /usr/bin/fsl5.0-select_dwi_vols
/usr/bin/fsl5.0-mainfeatreg /usr/bin/fsl5.0-sliceanimate
/usr/bin/fsl5.0-hist2prob /usr/bin/fsl5.0-imtest
/usr/bin/fsl5.0-match_smoothing /usr/bin/fsl5.0-possum_sum
/usr/bin/fsl5.0-first_utils /usr/bin/fsl5.0-fslinterleave
/usr/bin/fsl5.0-img2imgcoord /usr/bin/fsl5.0-fslascii2img
/usr/bin/fsl5.0-cluster2html /usr/bin/fsl5.0-siena_flow2std
/usr/bin/fsl5.0-ttologp /usr/bin/fsl5.0-betsurf /usr/bin/fsl5.0-pulse
/usr/bin/fsl5.0-connectedcomp /usr/bin/fsl5.0-fsledithd
/usr/bin/fsl5.0-fslselectvols /usr/bin/fsl5.0-fdr
/usr/bin/fsl5.0-fsl_sub /usr/bin/fsl5.0-fslcreatehd
/usr/bin/fsl5.0-generate_b0 /usr/bin/fsl5.0-unconfound
/usr/bin/fsl5.0-new_invwarp /usr/bin/fsl5.0-tbss_3_postreg
/usr/bin/fsl5.0-convertwarp /usr/bin/fsl5.0-autoaq
/usr/bin/fsl5.0-verbena /usr/bin/fsl5.0-fslval
/usr/bin/fsl5.0-tbss_non_FA /usr/bin/fsl5.0-fugue
/usr/bin/fsl5.0-fsl_anat /usr/bin/fsl5.0-label2surf
/usr/bin/fsl5.0-wpng /usr/bin/fsl5.0-Nudge
/usr/bin/fsl5.0-first_mult_bcorr /usr/bin/fsl5.0-asl_file
/usr/bin/fsl5.0-Vest2Text /usr/bin/fsl5.0-makerot
/usr/bin/fsl5.0-overlay /usr/bin/fsl5.0-sigloss
/usr/bin/fsl5.0-prelude /usr/bin/fsl5.0-dtifit
/usr/bin/fsl5.0-probtrack /usr/bin/fsl5.0-fslpspec
/usr/bin/fsl5.0-estnoise /usr/bin/fsl5.0-flirt
/usr/bin/fsl5.0-slicetimer /usr/bin/fsl5.0-fslorient
/usr/bin/fsl5.0-bet /usr/bin/fsl5.0-generateConfounds
/usr/bin/fsl5.0-imcp /usr/bin/fsl5.0-perfusion_subtract
/usr/bin/fsl5.0-morph_kernel /usr/bin/fsl5.0-make_dyadic_vectors
/usr/bin/fsl5.0-fslswapdim_exe /usr/bin/fsl5.0-run_first_all
/usr/bin/fsl5.0-img2stdcoord /usr/bin/fsl5.0-old_betall
/usr/bin/fsl5.0-flameo /usr/bin/fsl5.0-ftoz /usr/bin/fsl5.0-midtrans
/usr/bin/fsl5.0-Glm /usr/bin/fsl5.0-popp /usr/bin/fsl5.0-fslmerge
/usr/bin/fsl5.0-Fast /usr/bin/fsl5.0-whirlgif /usr/lib/fsl /etc/fsl
/usr/share/fsl /usr/share/man/man1/fsl.1.gz


text:
Q: Prove that the function $(\overset{-}{z})^2$ is not holomorphic in any open subset of $\mathbb{C}$. Prove that the function $(\overset{-}{z})^2$ is not holomorphic in any open subset of $\mathbb{C}$.
Im not really too sure how to approach this question so any help will be appreciated.

A: Treat $z \mapsto (\overset{-}{z})^2$ as the following function
$$f(x,y)= u(x,y)+ i v(x,y) $$
where $u(x,y) = x^2 - y^2 $ and $ v(x,y) = -2xy $.
$u_{x} = 2x$ aand $v_{y} = -2x$
Since $u_{x} \neq v_{y}$ on any open domain of $\Bbb{C}$
Therefore it doesn't hold Cauchy Reimann condition for holomorphicity.
Hence, $z \mapsto (\overset{-}{z})^2$ is not holomorphic on any open domain of $\Bbb{C}$.


text:
Q: PCI Standards end to end encyption In order to comply with all due diligence is required to encrypt all sensitive data when stored and transfer such as cards, address, sex, names, etc.
I know TLS 1.3 encrypts all the data. But the standard says:
Encrypting all electronic transmissions of confidential and personal Information.
What I understand is that the standard requires that ON CLIENT SIDE we add the extra security layer; this extra layer would be encrypting manually with RSA algorithms from client side to server and the other way around any sensitive data exchange.
You can find the official PDF with the requirements here
https://www.pcisecuritystandards.org/documents/SSF-Qualification-Requirements-for-Assessors-V1.pdf?agreement=true&time=1580914534790

A: TLS 1.3 over HTTPS considers encrypting the data when transfer. If the site is using these protocols is not necessary, at the moment, to encrypt data on client side for PCI standards because TLS already achieves it.
More info: To encrypt on client side is not really useful and usually companies do not use it. Nevertheless there are some sites on the security area that are encrypting the data on client side before sending it. This option is to be protected against any break of the TLS and give an extra time to patch and update to the latest version without compromising any data. Nevertheless this extra step can be seen as unnecessary once using the TLS.


text:
Q: How to decrease the voltage spike of a Buck circuit? I have designed a buck circuit.
The Bode plot of my system is as follows:

I use a type Ⅲ compensator to control my system. The switching frequency is 100 kHz. The cut-off frequency is 20 kHz and the phase margin is 60°.
The transient state of the system does not meet my requirement: when the load is from 100% to 50%, the output can't exceed 12.12 V, but as the plot shows, the max of the output is almost 12.37 V.
I have tried increasing the phase margin (from 60° to 80°) and lower the cut-off frequency (from 20 kHz to 10 kHz) (these methods could improve the damping of the system and reduce overshoot, right?), but the effect is limited. So what else could I do? Could anyone give me some suggestions?

Second Edited:
Thanks to Verbal Kint's book, I have done something to improve the transient response including using two parallel capacitors rather a big capacitor to lower the ESR of the capacitors and increasing the cut-off frequency \$fc\$ (\$fc\$ must be higher than the resonant frequency \$fo\$ of output impedance).Now the \$fc\$ is 30kHz.
Now The main circuit is as follows:

And now my circuit's transient response is as follows:

when the load is from 50% to 100%, the response is in my expectation: the decrease of Vo is less than 120mV, but when the load is from 100% to 50%, the response still doesn't meet my requirement. I think I can't increase the cut-off frequency \$fc\$ any more, because the nyquist show me that it will become unstable when I increase \$fc\$!!
Now what should I do? Thanks for help!

A: The initial voltage spike at load step from 100% to 50% mainly depends on the inductor and the output capacitors. The inductor will dump excess energy into the output capacitors and increase the voltage at the output. Like already suggested in the comments, either decrease L or increase C to decrease the voltage spike.
The controller behavior is only kicking in some microseconds after the initial voltage spike.

A: Thanks to Mr. Christophe's Book Designing Control Loops for Linear and Switching Power Supplies A Tutorial Guide! Now I have solved my problem. Now I plan to write a brief answer to show how I solve my problem. Hope the answer will help you too.
I got a task that the total ripple must be within 120mV when the load is from 100% to 50% and from 50% to 10%.
When I designed the circuit according to the requirement of output ripple and the inductor current, I tested the circuit's transient response. then I got a figure like this:
The voltage spike was too huge for me. What did I do first? I increased the phase margin and decreased the cut-off frequency \$fc\$. The increased phase margin did help me but the effect was limited. But when I decreased the \$fc\$, the spike was even higher which confused me because I thought the lower the \$fc\$ was, the higher the damping was.
After studying the book, I checked  out the spike when the load was from 50% to 100%. The output voltage consist of two part (don't consider the ESL of capacitor): the voltage drop across the ESR of capacitor and the vlotage drop due to capacitor.
The voltage drop across the ESR is a slope. The value is about the \$ΔVESR = ESR*ΔIout\$. The ESR of my output capacitor was two big that no matter how I compensated the circuit, the spike always was too high. To lower the ESR, I used several parallel capacitors to replace one capacitor utill the ESR was small enough.
The second part of volatge drop was purely because of the capacitor. The value is about \$ΔIout*Zout(fc)\$. As for Buck circuit, there is a equation: \$ Zout(fc) ≈ sqrt(1/(2π*fc*Cout)^2+r^2)\$ . According to the requirement of voltage sipke, you can get the maxinum Zout. First I change the cut-off frequency \$fc\$. The cut-off frequency \$fc\$ has an influence on the \$Zout\$. According to the the maxinum Zout, solve the equation: \$ Zout(fc) ≈ sqrt(1/(2π*fc*Cout)^2+r^2)\$. I get a mininum value of \$fc\$. Then use the compensator to set out a \$fc\$ that higher than the mininum value.
When I run the simulation. I get a figure like this:

The volatge drop meets my requirement when the load is from 50% to 100%. But when the load is from 100% to 50%. Why are the two processes different? Aren't they supposed to be symmetrical? This is my guess: when the load is from 50% to 100%,the energy (I use \$W1\$ to represent it) that the load need is suppied by capacitor and inductor. The energy \$W2\$ that the capacitor supplies is less than \$W1\$. When the load is from 100% to 50%, the excess energy W1 of inductor will all come to the capacitor. It is clear that the value of voltage drop caused by \$W2\$ is smaller the the value of voltage rise caused by \$W1\$. And according to this guess,to drop the voltage spike, I could decrease the value of inductor or increase the value of capacitor.
Because I don't want to decrease the value of inductor to avoid increasing
the inductor current ripple, I increase the value of output capacitor. And finally the circuit meets my requirement!


text:
Q: Handle Laravel app.php Service Providers for prod/dev use Installing package using composer require rap2hpoutre/laravel-log-viewer --dev. Package is correctly sent to the require-dev in composer.json which also requires a Service Provider. However, when running composer install --no-dev I'm getting error:
Class 'Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider' not found
This makes sense since it cannot find this Service Provider since it's only installing the required production packages.
What would be a good practice to tackle handling the app.php Autoloaded Service Providers for various environments or in this case just Local(dev) & Production?


text:
Q: Is there a way to de-normalize ActiveRecord associations for a unified view object? I have a complex object 'Variant' which has many associations. Something on these lines.
class Spree::Variant
  belongs_to :product
  has_many :variant_properties
end

class Spree::Product
  has_many :variants
  has_many :properties
end

On a page I want to display many variant objects which needs all the product/variant associations and properties. I was using elasticsearch earlier to create a unified view which would encapsulate all this data into one object. On variant save, elasticsearch would update its index with the changed mapped values.
Now I wish to remove elasticsearch and fetch all the data via activerecord. but creating the object with all the data would require a lot of database calls.
Is there a way so I can have the de-normalized object using ActiveRecord?

A: You must use something like Spree::Product.last.includes(:variants).variants It explained here


text:
Q: Error when getting my Signed APK in Android Studio - Could not find com.android.tools.lint:lint-gradle:26.1.2 When i'm going to create signed APK in Adroid Studio, this error happens..
Could not find com.android.tools.lint:lint-gradle:26.1.2.
    Searched in the following locations:
        file:/C:/Android/sdk/extras/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom
        file:/C:/Android/sdk/extras/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar
        file:/C:/Android/sdk/extras/google/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom
        file:/C:/Android/sdk/extras/google/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar
        file:/C:/Android/sdk/extras/android/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom
        file:/C:/Android/sdk/extras/android/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar
        file:/C:/Users/pache/.m2/repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom
        file:/C:/Users/pache/.m2/repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar
        https://repo.maven.apache.org/maven2/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom
        https://repo.maven.apache.org/maven2/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar
        https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom
        https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar
        https://oss.sonatype.org/content/repositories/releases/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom
        https://oss.sonatype.org/content/repositories/releases/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar
    Required by:
        project :android

How to fix this?

A: try whit this
in your project`s gradle file add the following lines
allprojects {
    repositories {
        .....
        ......
        maven { url 'https://maven.google.com' }
        ......
    } }

I hope it helps


text:
Q: cannot set value as a string instead of object in multiple selection I am using react-select for autocomplete and option related field. In single selection the below code works for only sending the value as string but in multiple it does not work though it works if i want the value as object.
Here is the code
const normalizedValue = (input, options, valueType, isMulti) => {
  if (valueType === "string" && !isMulti) {
    options.find(option => option.value === input.value);
  }
  if (valueType === "string" && isMulti) {
    console.log("input value", input);
    options.filter(option => option.value === input.value);
  }

  if (valueType === "object" && !isMulti) {
    options.find(option => option === input.value);
  }

  if (valueType === "object" && isMulti) {
    options.filter(option => option === input.value);
  }
};

const SearchableTextField = ({
  children,
  input,
  options,
  isMulti,
  valueType,
  ...props
}) => {
  return (
    <Select
      {...props}
      clearable={props.clearable}
      searchable={props.searchable}
      options={options}
      {...input}
      value={normalizedValue(input, options, valueType, isMulti)}
      onChange={option =>
        valueType === "string"
          ? input.onChange(option.value)
          : input.onChange(option)
      }
      onBlur={() => input.onBlur(input.value)}
      isMulti={isMulti}
    />
  );
};

const MyForm = reduxForm({ form: "MyForm" })(
  class extends React.PureComponent {
    handleSubmit(values) {
      console.log("values", values);
    }
    render() {
      const { handleSubmit } = this.props;
      return (
        <form onSubmit={handleSubmit(this.handleSubmit.bind(this))}>
          <Field
            name="myCoolSelect"
            component={SearchableTextField}
            options={[
              { value: "chocolate", label: "Chocolate" },
              { value: "strawberry", label: "Strawberry" },
              { value: "vanilla", label: "Vanilla" }
            ]}
            valueType="string"
            isMulti
          />
          <button type="submit">SUbmit</button>
        </form>
      );
    }
  }
);

If i have the options as following
options = [
 {value: 'abc', label: 'ABC'},
 {value: 'abc2', label: 'ABC2'},
]

the expected output when i select suppose first option is selectedOption: "abc" in single selection which works and in multiple it should be selectedOption: ["abc", "abc2"] (this is not working)
I have a reproducible code as well in sandbox https://codesandbox.io/s/wnvpnlj245

A: The problem is here
  onChange={option =>
    valueType === "string"
      ? input.onChange(option.value)
      : input.onChange(option)
  }

You need also check here if its multi or not. Because when its multi it pass value as array.
Try like
 onChange={option => {
    valueType === "string"
      ? input.onChange(isMulti ? option.map(o => o.value) : option.value)
      : input.onChange(option)
    }
  }


text:
Q: Zend_Form array notation with no indices I would like to create a form that allows the user to input any number of values, each in a separate text field using an array notation. The example expected HTML output is:

    <input type="text" name="dupa[]" value="">
    <input type="text" name="dupa[]" value="">

However, I can't seem to find a way to introduce multiple input elements within a single element, using array notation without indices.
Currently, I do this:
$elt1 = new Zend_Form_Element_Text('1');
$elt1->setOptions(array('belongsTo' => 'dupa'));

$elt2 = new Zend_Form_Element_Textarea('2');
$elt2->setOptions(array('belongsTo' => 'dupa'));

While this works, Zend_Form treats these as independent elements (which can have different sets of validators and filters - that's sort of cool) and the resulting HTML is something along these lines:

    <input type="text" name="dupa[1]" id="dupa-1" value="">

    <input type="text" name="dupa[2]" id="dupa-2" value="">

Is there a (preferably simple) way to achieve the indexless array notation I'm after?

A: I would follow MWOP's tutorial on creating composite elements. More work, but it's less Trial&Error then akond's solution. Basic idea for me would be extending the Zend_Form_Element_Multi (what you want is how Zend_Form_Element_Multiselect/MultiCheckbox works).

A: I managed to do this by having a "container subform", and then adding subforms to that "container" e.g.:
$container = new Zend_Form_SubForm();
$subform1 = new Zend_Form_SubForm();
$container->addSubForm($subform1, '1');

$subform2 = new Zend_Form_SubForm();
$subform2->addSubForm($subform1, '2');

$mainForm = new Zend_Form();
$mainForm->addSubform($container,'mysubforms');

Hope that helps.

A: You need a custom view helper for that.
class Zend_View_Helper_FormMySelect extends Zend_View_Helper_Abstract
{
    function formMySelect ($name, $value = null, $attribs = null, $options = null, $listsep = "
\n")
    {
        $result = array ();
        foreach ($options as $option)
        {
            $result [] = sprintf ('<input type="text" name="%s[]" value="">', $name);
        }

        return join ($listsep, $result);
    }
}

Than have in your form something like that:
    $form = new Zend_Form();
    $form->addElement ('select', 'test', array (
    'label'     => 'Test',
    'multioptions' => array (
        'test 1',
        'test 2',
        'test 3',
    ),
    ));

    $form->test->helper = 'formMySelect';


text:
Q: Django HtmlCalendar как перевести месяц на русский язык? Разрабатываю HTMLCalendar с событиями на Django и не знаю как перевести месяц на русский язык, вывод в английском формате, а мне нужно на русском, может кто сталкивался с данной проблемой ?
    def formatmonth(self, withyear=True):
    events = Event.objects.filter(start_time__year=self.year, start_time__month=self.month)

    cal = f'\n'

    cal += f'
{self.formatmonthname(self.year, self.month, withyear=withyear)}
\n'

в этой функции месяц выводится на английском языке. Если кто знает как перевести, подскажите пожалуйста, буду очень благодарен.

A: В settings.py укажите настройки:
LANGUAGE_CODE = 'ru-ru'
TIME_ZONE = 'Europe/Moscow'
USE_I18N = True
USE_L10N = True
USE_TZ = True

Это задаст региональные настройки для Django.
Возможно потребуется указать формат вывода
DATE_FORMAT = 'd E Y' #26 ноября 2020

Принудительное использование в коде:
from datetime import datetime
from django.utils import dateformat

# Форматирование даты
you_date = dateformat.format(datetime.now(), settings.DATE_FORMAT)

Или в коде шаблона
{{you_date|date:'d-m-Y'}}  # 26-11-2020


text:
Q: Stripes & checkerboard pattern on MacBook Pro monitor I am trying to fix a MacBook Pro (one of the earliest Intel processor models) that spontaneously gets into a state where stripes would appear in a checkerboard pattern all over the display. Please see attached image:

I can't find anything trigger for this phenomenon, occasionally it appears during the startup process when the grey Apple logo appears.
When it occurs, the display is frozen and I can't do any work. However, the computer itself seems to still function, because I can press then power button followed by Return, and the computer will turn off.
I suspect this is a hardware problem, one that is hard to fix because this model is so old with no warranty for years. But I would appreciate any ideas on how I may fix it before I give up. Thank you.


text:
Q: Let $R$ be a commutative ring with $1$. Show that if $I,J$ are ideals of $R$ such that $I\cap J\subseteq P$ and $J\nsubseteq P$, then $I\subseteq P$
Question: Let $R$ be a commutative ring with $1$ and $P$ a prime ideal of $R$. Show that if $I,J$ are ideals of $R$ such that $I\cap J\subseteq P$ and $J\nsubseteq P$, then $I\subseteq P$

Thoughts: By contradiction, suppose $I\nsubseteq P$.  Then there exists $i\in I-P$ and $j\in J-P$ where $ij\in I\cap J$, since $I$ and $J$ are ideals.  Since $I\cap J\subseteq P$, $ij\in P$, a contradiction since $i$ is not in $P$ and $j$ is not in $P$, but $P$ is a prime ideal.  Thus $I\subseteq P$.
Does this look correct?  I feel like I may be missing something.  Thank you!

A: Your argument is correct (maybe it would be nice to make the $i\in I\setminus P,\,j\in J\setminus P\implies ij\in I\cap J$ part a bit more explict, but that might be just me).
However, a relevant note on style: There is no need to frame this proof as proof by contradiction!
Indeed, suppose we are given ideals $I,J\leqslant R$ in a commutative unital ring $R$, a prime ideal $P\leqslant R$ such that $I\cap J\subseteq P$ and $J\nsubseteq P$. Then there is some $j\in J$ which is not contained in $P$ (i.e. $j\in P\setminus J$). On the other hand, for every $i\in I$ we have
$$
ij\in IJ\subseteq I\cap J\subseteq P
$$
by assumption. Hence, $ij\in P$ implying that $i\in P$ or $j\in P$ since $P$ is prime. However, we have chosen $j$ such that $j\notin P$ and hence it follows that $i\in P$. Since $i\in I$ was arbitrary we conclude that $I\subseteq P$.
In my opinion, direct proofs are often much clearer than a proof by contradiction which introduces more and more additional assumptions along the way. So this alternative might highlight this.

Now that I think about it: Your proof is closer to one by contrapositive!
I.e., consider the proposition "if $I\cap J\subseteq P$, then $I\subseteq P$ or $J\subseteq P$". Then your statement covers the non-trivial case of $J\nsubseteq P$ (equivalently, $I\nsubseteq P$). The contrapositive of the proposition is "if $I\nsubseteq P$ and $J\nsubseteq P$, then $I\cap J\nsubseteq P$" and your proof shows precisly this statement.
But again: There is no need to frame this proof as proof by contradiction! And this is another valid alternative.

A: Your argument is exactly correct! Another way of thinking about things is the following alternative criterion for a proper ideal $P<R$ to be prime:

$P$ is prime if and only if, whenever $IJ\leqslant P$ for ideals $I,J\leqslant R$, then one of $I\leqslant P$ and $J\leqslant P$ holds.

Now you just note that $IJ\leqslant I\cap J$ for any ideals $I,J$ of a commutative ring, and the desired result follows. The proof of the highlighted equivalence is almost identical to the proof you've written in your post; as an exercise, try to prove it! However, the two notions do not necessarily coincide if $R$ is non-commutative, and the latter definition is actually often used as a definition of a prime ideal in a non-commutative ring; see for example here.


text:
Q: Ionic unable to resolve dependency tree I am trying to create the ionic project but getting the same error every time.I have try to uninstall and install everything for a fresh start but still getting the same error.

A: You seem to be using a version of typescript that does not exist. cf npmjs.org.
You're using the tilde character (~) to specify a version in a range that doesn't exist. From the docs:

~version "Approximately equivalent to version", will update you to all future patch versions, without incrementing the minor version. ~1.2.3 will use releases from 1.2.3 to <1.3.0.

Specifically, tilde does not resolve to 4.x and the version you specified is higher than the latest 3.x release available.
So, specify version 3.9.4 to keep it at 3.x, or the next major release 4.0.3, or the latest.


text:
Q: Openlayers / Openstreetmap background is vertically striped and squished So the background of my openlayers implementation appears to be squished into vertical stripes.  The weird thing is that it wasn't always like this but even when I stash all my changes back to a point where I know it was working, it still is broken.  It makes me wonder if perhaps something has changed about the way the tile assets are being delivered.  I have tried switching between using osm and wms layers with no change, any help would be appreciated.
Here is the pertinent code:
initMap: function() {
  var view = this;
  var map = this.map = new OpenLayers.Map();
  map.render(this.$map[0]);

  var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
    "http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'});

  var osmLayer = new OpenLayers.Layer.OSM();

  this.layers = {
    point: new OpenLayers.Layer.Vector("Point Layer"),
    line: new OpenLayers.Layer.Vector("Line Layer"),
    polygon: new OpenLayers.Layer.Vector("Polygon Layer")
  };

  this.setValue(this.value);

  map.addLayers([this.layers.point, this.layers.line, this.layers.polygon, osmLayer]);

  drawControls = {
    point: new OpenLayers.Control.DrawFeature(this.layers.point,
      OpenLayers.Handler.Point),
    line: new OpenLayers.Control.DrawFeature(this.layers.line,
      OpenLayers.Handler.Path),
    polygon: new OpenLayers.Control.DrawFeature(this.layers.polygon,
      OpenLayers.Handler.Polygon)
  };

  this.layers[this.layerType].events.on({'sketchcomplete': function(feature) {

    if (!view.multiple) {
      // deactivate polygon layer once a polygon has been added
      drawControls[view.layerType].deactivate();
    }

  }});

  for(var key in drawControls) {
    map.addControl(drawControls[key]);
  }

  if (this.layers[this.layerType].features.length) {
    var bounds = this.layers[this.layerType].getDataExtent();
    var zoom = this.layers[this.layerType].getZoomForExtent(bounds);
    var lon = (bounds.top - bounds.bottom) / 2;
    var lat = (bounds.right - bounds.left) / 2;
    map.setCenter(new OpenLayers.LonLat(lon,lat), 3);
    map.zoomToExtent(bounds);

    if (view.multiple) {
      drawControls[view.layerType].activate();
    }

  } else {
    map.setCenter(new OpenLayers.LonLat(-11174482.03751,4861394.9982606), 4);
    drawControls[view.layerType].activate();
  }

  this.$('.clear').click(function(e) {
    e.preventDefault();
    view.layers[view.layerType].destroyFeatures();
    drawControls[view.layerType].activate();
  });
},

Here is the output:

A: I was having the same problem, are you using bootstrap of twitter?

I found out there was a selector for img elements that was affecting the map. I had the next selector into the bootstrap.css"

img {
  max-width: 100%;
  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic;
}

I don't know whay the parameter max-width: 100%; makes the vertical stripes in my case. I remove the propertie max-width: 100% and now is working.

A: Setting img { max-width: 100% } to img { max-width:none; } does resolve the problem.
However this will have an unintended effect on images throughout your website. I am also using Bootstrap Twitter's carousel component for images and when I made the above changed the images did not fit in the carousel. Therefore I changed it so that it only targets the images in the OpenLayers / OpenStreetMap div.
div#outlet_map img { max-width:none; }

A: So I found the problem.  Twitter bootstrap has a line in its reset file that sets:
img { max-width: 100% }

This was squishing the images.  You can fix it by doing:
img { max-width: none; }


text:
Q: Django app not populating data from admin - Heroku I am trying to deploy my first django app to heroku. Everything is fine, but my app is not populating data from admin. When I check admin page of app it has data, but same does not reflect on app. What could be the issue.
Its been hours I m fiddling with this.
this is my settings.py
import dj_database_url
DATABASES['default'] = dj_database_url.config()

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

ALLOWED_HOSTS = ['*']

DEBUG = False

try:
    from .local_settings import *
except ImportError:
    pass

post_list.html
{{posts}}

views.py
from django.shortcuts import render
from .models import Post
from django.utils import timezone

def post_list(request):
 posts =   Post.objects.filter(published_date__lte=timezone.now()).order_by("published_date")
    return render(request, 'blog/post_list.html', {"posts":posts} )


text:
Q: Avoiding deadlocks when running stored procedure on table WITH UPDLOCK, HOLDLOCK I'm maintaining a stored procedure which will be executed whenever a user visits a web page.
-- Existing tables
CREATE TABLE SourceAccount
(
    Id bigint NOT NULL,
    Value varchar(50) NOT NULL,
    UpdateTime datetime2 NULL
)

CREATE TABLE TargetAccount
(
    Id bigint NOT NULL,
    Value varchar(50) NOT NULL,
    UpdateTime datetime2 NULL
)

CREATE TABLE UpdatedCustomers
(
     CustomerID bigint NOT NULL,
     SyncTime datetime2 NOT NULL
)

The stored procedure:
CREATE PROCEDURE TriggerAccountSync (
    @CustId bigint,
    @LastUpdate DATETIME2)
AS
BEGIN
    --if customer is outdated
    IF EXISTS(SELECT 1 FROM UpdatedCustomers
              WHERE CustomerID = @CustId AND SyncTime < @LastUpdate)
    BEGIN
      BEGIN TRY
          INSERT INTO TargetAccount(Id, Value)
              SELECT Id, Value
              FROM SourceAccount
              LEFT OUTER JOIN TargetAccount WITH (UPDLOCK, HOLDLOCK) ON TargetAccount.Id = SourceAccount.Id
              WHERE SourceAccount.UpdateTime IS NULL

          DELETE FROM TargetAccount
          FROM SourceAccount
          INNER JOIN TargetAccount WITH (UPDLOCK) ON TargetAccount.Id = SourceAccount.Id
          WHERE TargetAccount.UpdateTime < @TimeStamp

          UPDATE UpdatedCustomers
          SET SyncTime = @LastUpdate
          WHERE CustomerID = @CustId
      END TRY
      BEGIN CATCH
        --there are multiple simultaneous calls, it can fail with deadlock
        --don't raise error
      END CATCH
    END
END

Can I throw exception using TRY CATCH THROW END CATCH and still avoid deadlocks on TargetAccount table ? I need to know when it fails to sync.
Is there a way to release table lock if the stored procedure failed to complete ?

A: Table locks are transaction-scoped. If you only have the implicit transaction associated with the stored procedure, as soon as your stored procedure ends, so will the locks, regardless of any errors.
When dealing with locks like this, it is generally useful to use explicit transactions, so that you have more control over the lifetime of the locks, and make it more explicit in the code (so that there is no confusion when transactions are nested).


text:
Q: asterisk: command not found I'm trying to run the following script...
#!/bin/bash -x
ADMIN=..@.com

X='asterisk -rx "show channels" | grep -c Zap/'
if [$X -ge 4]; then
echo "Active Calls: $X" |
mail -s "Active Calls: $X" $ADMIN
fi

and get this error "line 5: [asterisk: command not found"
I'm really new to this but understand it's probably a path problem. However from the same directory that I'm running the script from I can type out the 'asterisk -rx "show cha...' command and it works fine. So don't understand why the shell script can't do the same? Thanks!

A: Your problem is two-fold

*

*This line: X='asterisk -rx "show
channels" | grep -c Zap/'.  You
want to use command substitution for
this via $()

*This line: if [$X -ge 4]; then. The [ is actually not syntax but a call to a binary named [ which is the same as the test binary.  Therefor you must put a space after the [ otherwise the shell will complain as you have seen.

.
#!/bin/sh -x
ADMIN="..@.com" # don't forget to quote this

X=$(asterisk -rx "show channels" | grep -c Zap/)
if [ "$X" -ge 4 ]; then # don't forget the spaces
  echo "Active Calls: $X" |
  mail -s "Active Calls: $X" $ADMIN
fi

Note that if you are going to use bash you might as well use its nicer syntax:
#!/bin/bash -x
ADMIN="..@.com" # don't forget to quote this

X=$(asterisk -rx "show channels" | grep -c Zap/)
if ((X > 4)); then # much nicer syntax
  echo "Active Calls: $X" |
  mail -s "Active Calls: $X" $ADMIN
fi


text:
Q: Heroku Routes to backend not working in development mode I made a simple todo application with React,Node and Mongodb. The application works fine while run on the dev server. When I deploy it, however, it appears as though the app can't hit the todo API routes. Any help would be appreciated.
this is my github repo link(https://github.com/Ashish5911/notebook-backend/)

A: Would suggest you to identify the presence of errors in Heroku log for further analysis.
You can open the Heroku log by pressing the View logs button as seen in the below pop-up menu:

A: .env is in your .gitignore file, which is what is not pushed to Heroku. If you remove .env from your .gitignore, that may help. I faced the same issue before.


text:
Q: How to create SQL constraint on primary key to make sure it could only be referenced once? How do I add constraint to guard that a primary key could only be referenced once?(It could be referenced in two tables)
Each reference should have a unique value out of the primary key.
Table A
----------------------
id
1
2
3
4

Table B
----------------------
id            a_id (foreign key to table A.id)
1             2
2             3

Table C
----------------------
id            a_id (foreign key to table A.id)
1             1

I want something to happen to give error when try to insert a_id = 2 into table C as its used in table B already.

A: You can use an INSERT, UPDATE trigger on each of the child tables to ensure that the PK of the parent table that is about to be inserted or updated does not already exist in the other child table.

A: What you are trying to do requires another table D, that will help unify the references to A.
Table D will contain its own  primary key ( Id ), a reference to table A with a UNIQUE constraint on it (call it AId ), and a third column (called "RowType") to indicate to which of the child tables (B or C) the row corresponds. You can make this column to be of type int, and assign value "0" for B and "1" for C, for example.
Then in table B you add a foreign key to D.Id, AND another column "BRowType" as  foreign key to D.RowType; then you define a constraint on this column, so it can only have the value '0' ( or whatever value you have decided to correspond to this table).
For table C your constraint will limit the values to '1'.
Or course, in order to insert a record into B or C you first need to create a record in D. But once you have a record in B that references a record in D, which in turn links to a record in A, you will no longer be able to create a record in C for the same line in A - because of the UNIQUE constraint on D.AId AND the constraint on C.BRowType.

A: If I understand the question correctly, it sounds like you need to add a unique constraint on the column of each table that references your primary key.
For example:
Table A
----------------------
id (primary key)
1
2
3

Table B
----------------------
id            a_id (foreign key to table A.id)
1             2
2             3

Set the a_id column to be UNIQUE and that way you can ensure that the primary key from Table A is not used twice. You would do that in each table which references A.id

A: If you want to avoid using triggers, you could create a table X with id and a unique constraint on it.
In each transaction in which you insert a record into B or C you have to insert into X as well. Both insertions will only be possible if not yet in the other table.


text:
Q: Binary Search Tree insertion Code UNEXPECTED behavior I am inserting a node to the Binary Search Tree and I encountered an unexpected behaviour.
My question is - Why last line in insert function is optional ?
The last line takes care of the recursive case, and it should be mandatory but when I run without the last line then also it works.
It works means, It successfully insert a node to BST.
#include<stdio.h>
#include<stdlib.h>

struct node {
    int data;
    struct node *left;
    struct node *right;

};

typedef struct node Node;

struct node *insert(Node *root, int val)
{

    if(root == NULL){

        struct node *root = malloc(sizeof(struct node));
        root->data   = val;
        root->left  = root->right = NULL;
        return root;
    }

    if(root->data < val)
        root->right = insert(root->right,val);

    else if(root->data > val)
        root->left = insert(root->left,val);

    //return root; //WHY THIS LINE IS OPTIONAL
}

int main(){

    Node *root = NULL;
    root = insert(root, 10);
    root = insert(root, 20);
    root = insert(root, 5);
    root = insert(root, 1);
}

A: The last line in insert() is very much optional but only if you're willing to put up with undefined behaviour. In your particular case, the UB seems to work correctly and that is certainly one possibility of UB.
In fact, it's one of its more insidious features since seeming correct behaviour may see your buggy code being released to you poor unsuspecting users :-)
As an example, with the stack going up and down due to function calls, it may just be that the previous value of root is returned because you're not loading a new value in to it. And, if the new value is the same as the previous one already on the stack, it may well seem to work.
However, the fact that it works in one specific case does not make it a good idea to rely on it.

Further expanding on the arbitrary values, consider this code:
#include<stdio.h>

int get42(void) { return 42; }
int getX(void) {}

int main(){
    int x = get42();
    //printf("123456789\n");
    int y = getX();
    printf("%d\n", x);
    printf("%d\n", y);
}

Keeping in mind this is UB so may act differently for you, this produces for me:
prog.c: In function 'getX':
prog.c:4:17: warning: control reaches end of non-void function [-Wreturn-type]
    4 | int getX(void) {}
      |                 ^
42
42

So despite the warning, it seems to give the same value as the previous function call. You can validate this by uncommenting the printf() and seeing:
prog.c: In function 'getX':
prog.c:4:17: warning: control reaches end of non-void function [-Wreturn-type]
    4 | int getX(void) {}
      |                 ^
123456789
42
10

The 10 there is the return value from the printf call (it returns the number of characters printed, nine digits and \n).
So, in this case, it very much seems that skipping a return statement will just allow the caller to pick up whatever was on the stack from a previous call (or some arbitrary value if this is the first call at that depth), such as with:
#include<stdio.h>

int get42(void) { return 42; }
int getX(void) {}

int main(){
    int x = 42;//get42();
    //printf("123456789\n");
    int y = getX();
    printf("%d\n", x);
    printf("%d\n", y);
}

producing for me:
prog.c: In function 'getX':
prog.c:4:17: warning: control reaches end of non-void function [-Wreturn-type]
    4 | int getX(void) {}
      |                 ^
42
-1539029341

But, as previously indicated, don't rely on this. The behaviour may change when you switch to a new compiler, a new compiler version, a new machine, or even decide to compile it on s Saturday instead of a weekday :-)


text:
Q: I am trying to force an input value of type number in react to take only positive integers
I have this input tag of type number and right now, it takes both negative and positive value. I want the input field to only accept only positive natural numbers
I have tried
<input type="number" min="0">

and for some reason, it does not work as expected.

A: You can use min property:
<input type='number' min={1} step={1} />

A: This might works for you.
 <input type="number" name="test_name" min="0" oninput="validity.valid||(value='');">

But if you are working with forms in react, I would recommend using Formik and Yup(validation).
Formik: https://formik.org/docs/tutorial
Yup : https://github.com/jquense/yup

A: You can use regex so don't need any library.
const [value, setValue] = useState(1)

const onChange = (e) => {
  const reg = /^$|^[0-9]+$/;
  const newValue = e.target.value;
  if (reg.test(newValue)) {
   setValue(newValue);
  }
}

<input value={state} onChange={onChange} />

A: I found out this also works well.
   handleChange=(e)=>{
   this.setState({
   value: e.target.value
   })

   <input type="number"
   value={this.state.value}
   onChange={e=> e.target.value > 0 && handleChange}
 />

this is the magic here:
e.target.value > 0
it will force the input not to take a negative value.


text:
Q: Is this a problem with the Django tutorial or a package problem, or is it me? I'm using Ubuntu 10, python 2.6.5
I'm following this tutorial: http://www.djangobook.com/en/2.0/chapter02
I followed all of the steps using cut-and-paste.
The following directory structure was automatically created:
bill@ed-desktop:~/projects$ ls -l mysite
total 36
-rw-r--r-- 1 bill bill     0 2010-09-01 08:18 __init__.py
-rw-r--r-- 1 bill bill   546 2010-09-01 08:18 manage.py
-rw-r--r-- 1 bill bill 20451 2010-09-01 18:50 mysite.wpr
-rw-r--r-- 1 bill bill  3291 2010-09-01 08:18 settings.py
-rw-r--r-- 1 bill bill   127 2010-09-01 11:13 urls.py
-rw-r--r-- 1 bill bill    97 2010-09-01 08:20 views.py

urls.py
from django.conf.urls.defaults import *
import sys
print sys.path

from mysite.views import hello
urlpatterns = patterns('',
    (r'^hello/$', hello),
)

pylint produces this error: Unable to import 'mysite.views'
views.py
from django.http import HttpResponse

def hello(request):
    return HttpResponse("Hello world")

bill@ed-desktop:~/projects/mysite$ python manage.py runserver

Validating models...
0 errors found

Django version 1.2.1, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Which resulted in:
Page not found (404)
Request Method:  GET
Request URL:  http://127.0.0.1:8000/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
   1. ^hello/$
The current URL, , didn't match any of these.

Why does view.py which is in the main directory contain the following?
from mysite.views import hello
There is no subdirectory 'views'.  Although I'm familiar with using packages, I've never had the need to create my own so I'm a bit confused.  I would have thought that from views import hello would be correct.
The step-by-step tutorial looks straight forward and I haven't seen anyone else come across this problem so I'm a bit perplexed what I've done wrong.

A: I'm not sure what your actual question is.
You've requested the root page, \, but have only defined a URL for \hello\, so obviously Django can't find what you've requested. If you want your hello view to match against the site root, do this:
urlpatterns = patterns('',
    (r'^$', hello),
)

I don't understand the question about the from mysite.views import hello. This will work if the parent of mysite is on the Python path.

A: you see 404 error, because you don't have the default handler, add to url patterns something like this:
('^$', views.default )

and probably you need to add the web application path to the sys.path variable to be able to 'see' your modules:
import sys
sys.path.append(path_to_site)


text:
Q: 'python' plugin loader has not been enabled I want to use plugin 'intelligent text completion' for gedit in Ubuntu 17.10 so I followed all the instructions here but it was showing error like plugin loader 'python3' was not found and after searching this a lot on web I got this question on stack overflow and again I changed python3 to python as mentioned and followed further steps in that but still it shows error like libpeas-WARNING **: The 'python' plugin loader has not been enabled
 Can anyone suggest something to clear this error I have been browsing on this for a long time.


text:
Q: I'm getting "Bad argument setup" while running VirtualBox on Linux I'm trying to run Oracle VM VirtualBox, and I'm getting following error:
# /sbin/rcvboxdrv setup
Bad argument setup
# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
# uname -a
Linux X 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# rpm -qa | grep ^VirtualBox
VirtualBox-5.0-5.0.14_105127_el7-1.x86_64
#

ERROR:
Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/sbin/rcvboxdrv setup'

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.

Advise please?

A: I found it; instead of:

sudo /sbin/rcvboxdrv setup

one should run

sudo /usr/lib/virtualbox/vboxdrv.sh setup

desired output would be:
# sudo /usr/lib/virtualbox/vboxdrv.sh setup
Stopping VirtualBox kernel modules                         [  OK  ]
Recompiling VirtualBox kernel modules                      [  OK  ]
Starting VirtualBox kernel modules                         [  OK  ]
#


text:
Q: Creating Graph from nested objects with Neo4jClient and Cypher I have some data modeled as a simple set of nested c# objects, that I am trying to create/retrieve from a neo4j database using the .Net Neo4jClient.
My classes are in the form:
public class Foo {
    public int ID { get; set; }
    public List<Bar> bar { get; set;}
}

public class Bar {
    public int ID { get; set; }
    public List<Baz> baz { get; set;}
}

public class Baz {
    public int ID { get; set; }
}

Once the data has been stored in the correct form in the database:
(f:Foo)-[h:HASBAR]->(b:Bar)-[hb:HASBAZ]->(bz:Baz)

I am able to retrieve the data into my class structure using collect and optional match using the following query:
List<Foo> foolist = WebApiConfig.GraphClient.Cypher
    .Match("(f:Foo)-[h:HASBAR]->(b:Bar)")
    .OptionalMatch("(b)-[hb:HASBAZ]->(bz:Baz)")
    .With("f, { ID: b.ID, baz: collect(bz) } as Bar")
    .With("{ ID:f.ID, bar:collect(Bar) } as Foo")
    .Return<Foo>("Foo")
    .Results
    .ToList();

This all works perfectly and the data is correctly serialized into the proper classes.
My question is how should I perform the reverse?
As in given a single Foo class, containing multiple bar and baz classes nested, can I create the above data structure in the database in a single query?
Or do I have to write a query per each level of nesting?
I know I will probably have to list properties when creating, as if I give the client a Foo class it will create a node with "bar" as a property.
My problem mostly comes from the third level of nesting, if I treat the second level (bar) as an array (passing in Foo.bar) as a variable, I can create multiple [:HASBAR] relationships. But within the same query I have not found a way to relate the correct Baz node with the Bar node.
Am I approaching this in the correct way?
Any responses are appreciated, thanks in advance...

A: Well, it is possible to do it in one query - unfortunately I don't think you can use the tasty UNWIND or FOREACH due to the secondary nesting, and you'll need to do some funky things with the classes, but well, here goes:
First, we need to define the classes, so we can deserialize the properties, but not serialize them, to that end
public class Foo
{
    public int ID { get; set; }

    [JsonIgnore]
    public List<Bar> bar { get; set; }

    [JsonProperty("bar")]
    private List<Bar> barSetter { set { bar = value;} }
}

public class Bar
{
    public int ID { get; set; }

    [JsonIgnore]
    public List<Baz> baz { get; set; }

    [JsonProperty("baz")]
    private List<Baz> bazSetter { set { baz = value; } }
}

public class Baz
{
    public int ID { get; set; }
}

What is this craziness??!?! Well - By using [JsonIgnore] we tell Json not to serialize or deserialize a given property - but we want to deserialize so your retrieval query will work - so having the private setter with JsonProperty allows us to achieve this.
The added bonus of this approach is that you don't need to specify properties to serialize in the Cypher generation bit. And here it is in all it's glory:
var query = gc.Cypher
    .Create("(f:Foo {fooParam})")
    .WithParam("fooParam", foo);

for (int barIndex = 0; barIndex < foo.bar.Count; barIndex++)
{
    var barIdentifier = $"bar{barIndex}";
    var barParam = $"{barIdentifier}Param";
    query = query
        .With("f")
        .Create($"(f)-[:HASBAR]->({barIdentifier}:Bar {{{barParam}}})")
        .WithParam(barParam, foo.bar[barIndex]);

    for (int bazIndex = 0; bazIndex < foo.bar[barIndex].baz.Count; bazIndex++)
    {
        var bazIdentifier = $"baz{barIndex}{bazIndex}";
        var bazParam = $"{bazIdentifier}Param";
        query = query
            .With($"f, {barIdentifier}")
            .Create($"({barIdentifier})-[:HASBAZ]->({bazIdentifier}:Baz {{{bazParam}}})")
            .WithParam(bazParam, foo.bar[barIndex].baz[bazIndex]);
    }
}

The f:Foo bit is as per normal, the subsequent for loops allow you to define each identifier and set the parameters.
I don't think this is an ideal solution, but it will work, and will execute in 1 query. Obvs, this could get unwieldy with lots of nested values.


text:
Q: How to slice order number from below column text enter image description here
{'totalSize': 1, 'records': [{'Data__c': None, 'attributes': {'url': '/services/data/v56.0/sobjects/Notification_Data__c/a5j4T000007OirXQAS', 'type': 'Notification_Data__c'}}], 'done': True}
{'totalSize': 1, 'records': [{'Data__c': '552935547', 'attributes': {'url': '/services/data/v56.0/sobjects/Notification_Data__c/a5j4T000007OnJ4QAK', 'type': 'Notification_Data__c'}}], 'done': True}
these are my column values. i need to remove all the string value and strip to get the value of Data__c value and store it to new column.
i tried df["Notification_Data__r"].str.split(" ", expand=True) method in different ways but its not working.


text:
Q: New column based on comparison with values from predecessor row I have the following df:
  Doc          Date      Q   F
30040771    2020-04-22  220  1
30040771    2020-04-22  88   0
30040771    2020-04-22  88   0
30040771    2020-04-22  100  0

I want to add a new column based on a comparison of each row and it's predecessor.
I have a working solution using shift(-1) on columns Doc, Date and Q and then comparing values in Doc, Date and Q with the values in the shifted columns.
Comparison is the following:
df["New_Col"] = (df["F"] ==1) & (df["Doc"] == df["Doc_Shift"]) & (df["Date"] == df["Date_Shift"]) & (df["Q"] != df["Q_Shift"])

Resulting in:
  Doc          Date      Q   Doc_Shift  Date_Shift  Q_Shift  F   New_Col
30040771    2020-04-22  220  30040771   2020-04-22     88    1     1
30040771    2020-04-22  88   30040771   2020-04-22     88    0     0
30040771    2020-04-22  88   30040771   2020-04-22     100   0     0
30040771    2020-04-22  100  30040771   2020-04-22     88    0     0

My solution works but it's ugly.
The original df has multiple docs and dates in it.
How can I solve that problem more efficient & pythonic?

A: In [2]: df = pd.DataFrame({'Doc': {0: 30040771, 1: 30040771, 2: 30040771, 3: 30040771},
   ...:  'Date': {0: '2020-04-22', 1: '2020-04-22', 2: '2020-04-22', 3: '2020-04-22'},
   ...:  'Q': {0: 220, 1: 88, 2: 88, 3: 100},
   ...:  'Doc_Shift': {0: 30040771, 1: 30040771, 2: 30040771, 3: 30040771},
   ...:  'Date_Shift': {0: '2020-04-22',
   ...:   1: '2020-04-22',
   ...:   2: '2020-04-22',
   ...:   3: '2020-04-22'},
   ...:  'Q_Shift': {0: 88, 1: 88, 2: 100, 3: 88},
   ...:  'F': {0: 1, 1: 0, 2: 0, 3: 0}})
   ...: df
Out[2]:
        Doc        Date    Q  Doc_Shift  Date_Shift  Q_Shift  F
0  30040771  2020-04-22  220   30040771  2020-04-22       88  1
1  30040771  2020-04-22   88   30040771  2020-04-22       88  0
2  30040771  2020-04-22   88   30040771  2020-04-22      100  0
3  30040771  2020-04-22  100   30040771  2020-04-22       88  0

In [3]: df['New_Col'] = ((df.F == 1) & df.filter(regex="Doc").nunique(axis=1) & df.filter(regex="Date").nunique(axis=1)  & (df.filter(regex="Q").n
   ...: unique(axis=1) != 1)).astype(int)
   ...: df
Out[3]:
        Doc        Date    Q  Doc_Shift  Date_Shift  Q_Shift  F  New_Col
0  30040771  2020-04-22  220   30040771  2020-04-22       88  1        1
1  30040771  2020-04-22   88   30040771  2020-04-22       88  0        0
2  30040771  2020-04-22   88   30040771  2020-04-22      100  0        0
3  30040771  2020-04-22  100   30040771  2020-04-22       88  0        0


text:
Q: (Windows Forms) Button only available if bool is true Is it possible to set a button so that it is only clickable if a bool is true?
This isn't my actual code but:
bool details_accepted = false;

public bool check_bank_details()
{
    //this is simplified it's actually using an SQL query
    if (bank_details = "123456789")
    {
        return true;
    }
    else
    {
    return false;
    }
}

if (check_bank_details == true)
{
    //CODE FOR SETTING BUTTON TO CLICKABLE
}
else if (check_bank_details == false)
{
    //Code making Button not clickable
}

A: use the Enabled property
Button1.Enabled = check_bank_details();


text:
Q: How can a make a c program that uses 2 different processes I need to make a program in c that converts a string to capitals and vice-versa
Using 2 processes, one to read from the console and write the converted
string and another to convert the string
I already have the algorithm, I just can't manage to use the fork/wait
correctly
void Convert(char *word){
for(int i = 0; i < strlen(word); i++){
        if(word[i] >= 'a' && word[i] <= 'z')
            word[i] -= 32;
        else if(word[i] >= 'A' && word[i] <= 'Z')
            word[i] += 32;
    }

}

void testEx4(){
char word[10000];
while(scanf("%s", word) != EOF){
        Convert(word);
        printf("%s\n", word);
    }

}


text:
Q: A small problem regarding compactness. Recently I saw a problem of compactness,it is as follows:
Let $A$ be compact and $U$ be open in a metric space $X$ such that $A\subset U$.Show that for some $\epsilon>0$,$\{x\in X: d(x,A)<\epsilon\}\subset U$.
I solved the problem in the following manner.For each $a\in A$,choose $r_a>0$ such that $B(a,r_a)\subset U$.Consider the open cover $\{B(a,r_a/2): a\in A\}$ of $A$.Since $A$ is compact,so it has a finite subcover,say $\{B(a_i,r_i/2):i=1,2,...,k\}$,Set $\epsilon=\min_i(r_i/2)$.Now,take any $x \in X$ such that $d(x,A)<\epsilon$,Since $A$ is compact $\exists a\in A$ such that $d(x,A)=d(x,a)$.Then $d(x,a)<\epsilon$.Now $a\in A$,so $a\in B(a_i,r_i/2)$ for some $i=1,2,...,k$.Now $d(x,a_i)\leq d(x,a)+d(a,a_i)<\min_i(r_i/2)+r_i/2<r_i$.So $x\in B(a_i,r_i)\subset U$ and we are done.Is this proof correct or it can be done in an easier way.What is the intuition behind this problem?

A: Your proof is correct. An alternative aproach is to look at the function
$$f: X \rightarrow \mathbb{R}: x \mapsto d(x, U^c).$$
This function is continuous and hence it attains its minimum on compact sets. In particular there exists $x \in A$ such that $f(x) = \inf \{ d(x,U^c) \mid x \in A \} \geq 0$. We claim that $f(x) >0$. Because $x \in K \subset U$ and because $U$ is open there exists $\delta >0$ such that $B(x,\delta) \subset U$. However this means that $f(x) = d(x,U^c) \geq \delta$. In particular $\inf \{ d(x,U^c) \mid x \in A \} \geq \delta$, which we had to show.
For the intuition: as you know, any closed set is not the intersection of finite open sets. This means in particular that there is no smallest open set around the closed set.
However for non-compact sets $A$ that are closed (for example $\mathbb{R} \subset \mathbb{C}$) we can find open sets containing  $A$ that approximately meet $A$ in the sense that the complement of an open gets arbitrary close to $A$. This is not possible for compact sets because there is always a non-zero minimum distance between the two.


text:
Q: How can I count the number of leaves of a node in an extjs tree? I have a tree made in extjs 4.x, and I need to count for any node, the number of leaves of that node.
And I mean the total number of leaves, which means also the leaves of the "sub-nodes" of that node.
I saw there is a cascade method, but I can't manage to use it.

A: var leafCount = 0;
treePanel.getRootNode().cascadeBy(function(node){
    if(node.isLeaf()) leafCount++;
});


text:
Q: Laravel 5.2 Session flash not working even with web middleware I am trying to implement flash messaging using sessions but am unable to do so.
In my controller I have:
public function store(Request $request) {
    session()->flash('donald', 'duck');
    session()->put('mickey', 'mouse');
    return redirect()->action('CustomerController@index')->with('bugs', 'bunny');
}

But when I check the session variables in the view, I can only see the values from session()->put('mickey', 'mouse').
Session:
{"_token":"F6DoffOFb17B36eEJQruxvPe0ra1CbyJiaooDn3F","_previous":{"url":"http:\/\/localhost\/customers\/create"},"flash":{"old":[],"new":[]},"mickey":"mouse"}

A lot of people encountered this problem by not having the relevant routes inside the web middleware. I made sure to do this as well but it still wouldn't work.
In routes.php:
Route::group(['middleware' => ['web']], function () {

    Route::get('/', function () {
        return view('welcome');
    });

    Route::get('/customers', 'CustomerController@index');
    Route::get('/customers/create', 'CustomerController@create');
    Route::post('/customers', 'CustomerController@store');
});

In Kernel.php:
protected $middlewareGroups = [
    'web' => [
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
        \Illuminate\Session\Middleware\StartSession::class,
        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
        \App\Http\Middleware\VerifyCsrfToken::class,
    ],

    'api' => [
        'throttle:60,1',
    ],
];

Can anyone let me know what I could be doing wrong here? Thanks!

A: This is more than likely because of a change that was made to the Laravel framework (v5.2.27) that all routes by default are part of the "web" middleware, so assigning it again in your routes.php file ends up assigning it twice.
The solution is either to remove the "web" middleware from your routes OR remove the automatic assignment from the RouteServiceProvider.
Before the Laravel update:
// RouteServiceProvider.php
$router->group(['namespace' => $this->namespace], function ($router) {
    require app_path('Http/routes.php');
});

After the Laravel update:
// RouteServiceProvider.php
$router->group([
    'namespace' => $this->namespace, 'middleware' => 'web',
], function ($router) {
    require app_path('Http/routes.php');
});

Notice how the new update automatically applies the "web" middleware to all routes. Simply remove it here if you wish to continue using Laravel 5.2 as you have before (manually assigning "web" middleware in your routes.php).

A: Fixed the issue by replacing
Route::group(['middleware' => ['web']], function () {
   ...
});

with
Route::group(['middlewareGroups' => ['web']], function () {
   ...
});

No idea why this works though when all the documentation suggests that we use ['middleware' => ['web']]

A: Build your Session flash info by using this code:
<?php

Session::flash("Donald", "Duck")
// Or in your code style.
$request->session()->flash("Donald", "Duck")
?>

Check it in your view with:
@if(Session::has("Donald")
    {{Session::get("Donald")}}
@endif

You forget to use $request :)

A: In Controller:
use Session,Redirect;

public function store(Request $request)
{
Session::flash('donald', 'duck');
Session::put('mickey', 'mouse');
return Redirect::to('/customers')->with('bugs', 'bunny');
}

In 'view' check the data is getting or not:
<?php
print_r($bugs);die;
?>

Good Luck :)

A: I use the following:
In my controller:
public function xyz(){
   // code

   // This
   return redirect()->action('homeController@index')->with('success', 'Check! Everything done!');

    // Or this
    return redirect('/index')->with('success', 'Check! Everything done!');
}

In my view:
@if(session('success'))
    {{ session('success') }}
@endif

Nothing else. The web-middleware is assigned to every route.

A: I dont know why but on Windows you need changes in your routes: middleware to middlewareGroups, like that:

So, in your app\Kernel.php, you need put the StartSession at first on array of middleware group web:


text:
Q: Python googleapiclient cannot get more than 10 results With this code:
import json
from googleapiclient.discovery import build
from pprint import pprint as pp

NUM_RESULTS = 11
MY_SEARCH = 'bordben'
MY_API_KEY = '...'
MY_CSE_ID = '...'

def google_search(search_term, api_key, cse_id, **kwargs):
    service = build("customsearch", "v1", developerKey=api_key)
    res = service.cse().list(q=search_term, cx=cse_id, **kwargs).execute()
    return res['items']

results = google_search(MY_SEARCH, MY_API_KEY, MY_CSE_ID, num=NUM_RESULTS)

for result in results:
    pp(result)

if NUM_RESULTS greater than 10 I will get an error like this:
 googleapiclient.errors.HttpError: <HttpError 400 when requesting https://customsearch.googleapis.com/customsearch/v1?q=bordben&cx=...( api key and csi id)&alt=json returned "Request contains an invalid argument.". Details: "[{'message': 'Request contains an invalid argument.', 'domain': 'global', 'reason': 'badRequest'}]">

if NUM_RESULTS = 10 or less than 10, there will print the search results. , why there is a limit by 10?

A: Found the answer here:
https://gist.github.com/adambernier/0cc96d07691a635cc464d24c63caff39
each API call not be greater then 10 results.


text:
Q: File transformations before packaging WSP I need to modify the content of some files in my SP 2010 project before packaging, something like Web.Config transformations.
I need a file to have different content based on the environment: Debug, Staging, Release.
What are my options aside pre-build event command line in the build events?

A: I eventually used MSBuild to intervene before the WSP packaging step (step 3 from here).
What you will need is the  AfterLayout step. An explanation on Integrating post-processors in SharePoint builds you can find here.


text:
Q: recursively copy only images and preserve path I'm working on a website migration. I have a scrape of the site, with all the files and directory structure as you would see them in the URL. I want to pull all images, maintaining the directory structure, and copy them into a new place.
For instance, if I have
/content1/index.php
/content1/page2.php
/content1/images/image1.jpg
/content1/images/image2.jpg
/content1/background/spacer.gif
/content1/background/background.gif
/content2/index.php
/content2/images/image3.jpg
/content2/background/spacer.gif
/content2/background/background.gif

Then I want
/content1/images/image1.jpg
/content1/images/image2.jpg
/content1/background/spacer.gif
/content1/background/background.gif
/content2/images/image3.jpg
/content2/background/spacer.gif
/content2/background/background.gif

I can use the find command to get a list of only image files, but I don't know how to manipulate each file while preserving the directory path to it.
I could make a copy of the entire directory, and then recursively delete any non-image file, but now that I have set this problem before myself, I figure its worthwhile to know how to do it, in case I really do need to do it this way later.

A: Use pax (or one of its predecessors cpio or tar) in copy-through mode. Tell it to copy only the desired files (.jpg or .gif). The syntax is a little roundabout: the -s option specifies how to rename files; renaming a file to an empty name means it won't be copied, and since the first match applies, to exclude most files, the trick is to rename files that you want to include to themselves, and exclude the rest. Directories won't be copied this way, but if pax copies foo/bar/qux.jpg then it will create foo and foo/bar on the destination if necessary, and pax recurses even inside excluded directories.
pax -rw -pp -s '!\.gif$!&!' -s '!\.jpg$!&!' -s '!.*!!' /content* /destination

You can also use rsync to perform the copy, but it's clumsier. Since rsync doesn't copy excluded directories, you either need to include all directories and remove the empty ones afterwards, or to generate the list of directories to copy. See this answer for explanations.
rsync -a --include='*.gif' --include='*.jpg' --include='*/' \
      --exclude='*' /content* /destination

A: Try this command (find and cp with --parent option):
find /source -regextype posix-extended -regex '.*(gif|jpg)' \
    -exec cp --parents {} /dest \; -print

A: Assuming we want to copy all *.conf files from /etc/ to /tmp/ I whould do:
tar c $(find /etc/ -name '*.conf') | tar xv -C /tmp

How it works:

*

*create list of files to be copied by proper $(find ...)

*tar c create new tar archive and pass it to stdout

*| pipe that archive to another tar process to unpack

*tar xv verbose extract archive read from stdin but with directory changed to /tmp (destination).

This method will not work correctly with files with spaces in it. To fix than you can generate list of files and pass it first tar command via -T option.


text:
Q: How to require location to be on for an app on marketplace download? I recently submitted a windows phone app to the marketplace that uses the geolocation api to grab the gps coordinates and do something with it.
I got declined in certification because I don't ask for the users permission to use location.
My first thought was to just show a message box in the app and if they hit cancel then don't let them use it. But I noticed that a lot of marketplace apps somehow have that dialog box popup when you download the app.
How do they make this happen?

A: If the application has the ID_CAP_LOCATION capability then the market place client (web and phone) will prompt the user to accept the location policy. Note: Including or removing  this capability from your WMAppManifest.xml file only effects developer phones. When your application is ingested into the market place it scans your XAP to determine its actual capabilities and applies those automatically.
However in order to be ingested into the market place you must provide the user with the ability to disable location services, a location privacy policy and the user must opt in to using location services. ie. Disable location services until they've said to use them.
The Application Certification Requirements for Windows Phone spell this out as requirements 2.7 through to 2.7.8.
Also, note, the testers are pretty thorough in this regard and will fail your application if it does not have such features. Additionally they will test your application when location services have been opted out - both at the application level (via the mechanism you provide) and at the Operating System level (Settings > Location > Off). Make sure you test these scenarios as the second one bit me and caused my first submission to be rejected.

A: Go to the WMAppManifest.xml and add
<Capabilities>
....
  <Capability Name="ID_CAP_LOCATION" />