Oracle Sql performance very slow

I have created aquery that joins several tables in Oracle, but the execution time is very slow, around 1-2 minutes. Is there a method to make the query faster?

SELECT S.ID STAFF_ID,
        d.year_enrol,
        C.COUNSELLOR_ID,
        count(*) Num_Of_Stud
FROM aab_ASSIGNED_COUNSELLOR C,
     aab_STAFF S,
     v_aab_student d
WHERE C.COUNSELLOR_ID = S.COUNSELLOR_ID
  AND SYSDATE BETWEEN C.EFFECTIVE_DATE_FM AND C.EFFECTIVE_DATE_TO
  AND C.HOST_COUNSELLOR_IND = 'Y'
  AND c.student_num = d.student_num
  AND (d.prog_code, d.subcode) NOT IN (('11345',' '),
                                       ('22678',' '),
                                       ('93451', ' '),
                                       ('62378','OPT'))
GROUP BY S.ID,
         d.year_enrol,
         C.COUNSELLOR_ID;

read more

Oracle Sql performance very slow

I have created aquery that joins several tables in Oracle, but the execution time is very slow, around 1-2 minutes. Is there a method to make the query faster?

SELECT S.ID STAFF_ID,
        d.year_enrol,
        C.COUNSELLOR_ID,
        count(*) Num_Of_Stud
FROM aab_ASSIGNED_COUNSELLOR C,
     aab_STAFF S,
     v_aab_student d
WHERE C.COUNSELLOR_ID = S.COUNSELLOR_ID
  AND SYSDATE BETWEEN C.EFFECTIVE_DATE_FM AND C.EFFECTIVE_DATE_TO
  AND C.HOST_COUNSELLOR_IND = 'Y'
  AND c.student_num = d.student_num
  AND (d.prog_code, d.subcode) NOT IN (('11345',' '),
                                       ('22678',' '),
                                       ('93451', ' '),
                                       ('62378','OPT'))
GROUP BY S.ID,
         d.year_enrol,
         C.COUNSELLOR_ID;

read more

How to pass GridView IDs and other controls into jQuery functions?

I am learning a lot more about jQuery and Javascript, and I am loving it! The power you have over a webform, control, etc with this language beats client-server methodologies hands down!

One of the most common things people do with scripting languages is control Gridview rows and columns. In my case I am trying to control a Gridview within a cell of another gridview. What I want to do is to checkbox all my checkboxes inside the sub GridView control.

Here is my ASP.net code of the main GridView and the sub Gridview in one of the columns:

        **<asp:GridView ID="gvStudents"** runat="server" DataSourceID="SqlDataSourceStudents" AutoGenerateColumns="False" Width="100%" OnRowDataBound="gvStudents_RowDataBound">
            <HeaderStyle BackColor="#5D7B9D" ForeColor="White" />
            <AlternatingRowStyle BackColor="#EEEEEE" />
            <RowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="Student" >
                    <ItemTemplate>
                        <asp:Label ID="lblName" runat="server" Text='<%# Eval("StudentName") %>' ToolTip='<%# Eval("ProgramName") %>'></asp:Label>
                    </ItemTemplate>
                    <ControlStyle Width="120px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mobile" >
                    <ItemTemplate>
                        <asp:Label ID="lblMobile" runat="server" Text='<%# Eval("StudentMobilePhone") %>'></asp:Label>
                    </ItemTemplate>
                    <ControlStyle Width="70px" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:CheckBox ID="cbNOKall" runat="server" Text="Next Of Kin" TextAlign="Left"/>
                    </HeaderTemplate>
                    <ItemTemplate>
                        **<asp:GridView ID="gvNOKs"** runat="server" AutoGenerateColumns="False" BorderStyle="None" GridLines="Vertical" ShowHeader="false" ShowFooter="false" BackColor="transparent" >
                            <Columns>
                                <asp:TemplateField HeaderText="Given Name" >
                                    <ItemTemplate>
                                        <asp:Label ID="lblNOKGivenName" runat="server" Text='<%# Eval("NOKname") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ControlStyle Width="150px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="NoK Type" >
                                    <ItemTemplate>
                                        <asp:Label ID="lblNOKType" runat="server" Text='<%# Eval("NOKType") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ControlStyle Width="100px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Mobile" >
                                    <ItemTemplate>
                                        <asp:Label ID="lblNOKMobile" runat="server" Text='<%# Eval("NOKMobile") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ControlStyle Width="100px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cbNOKAdd" runat="server" onclick="javascript:SelectAllCheckboxesCol(this);" />
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                           </Columns>
                        </asp:GridView>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:CheckBox id="CheckBoxAll" runat="server" onclick="javascript:SelectAllCheckboxesCol(this);"/>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBoxAdd" runat="server" onclick="javascript:HighlightRow(this);"/>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

read more

R : how to run a command between every pair in a list

I have an n x m matrix, say like so:

df = 

1 0 2 1  
1 2 3 2  
3 3 1 0  
2 2 2 1  
1 2 3 1

I want to run a function on all the columns, such as myfunct, which will sum every column, and then sum each pair of columns, self inclusive.

16 17 19 13  
17 18 20 14  
19 20 22 16  
13 14 16 10

Is there an easy way to apply myfunct to a matrix to arrive at the corresponding square matrix? More generally, is there an easy way, if I have a list of N things, to run a bivariate function between all i,j pairs in that list, outputted as a square matrix?

read more