0

`

#include<stdio.h>
#include<stdlib.h>

typedef struct node {
    int coeff,expo;
    struct node *next;
}N;

N *input();
N *p_addition(N *,N *);
N *getnode();

N *getnode() {
    N *new;
    new=(N*)malloc(sizeof(N));      
    new->next=NULL;
}
N *p_addition(N *ptr,N *qtr) {
    N *rptr=getnode(),*r1ptr=rptr,*aptr=NULL;
    int s;
    printf("\n...................addition starts...................\n");
    while(ptr!=NULL&&qtr!=NULL) {
        if(ptr->expo==qtr->expo) {
            s=ptr->coeff+qtr->coeff;
            if(s!=0) {
                aptr=getnode();
                aptr->coeff=s;
                aptr->expo=ptr->expo;
                r1ptr->next=aptr;
                r1ptr=aptr;
            }           
            ptr=ptr->next;
            qtr=qtr->next;
        }

        else if(ptr->expo>qtr->expo) {
            aptr=getnode();
            aptr->coeff=ptr->coeff;
            aptr->expo=ptr->expo;
            ptr=ptr->next;
            r1ptr->next=aptr;
            r1ptr=aptr;
        }
        else {
            aptr=getnode();
            aptr->coeff=qtr->coeff;
            aptr->expo=qtr->expo;
            qtr=qtr->next;
            r1ptr->next=aptr;
            r1ptr=aptr;

        }
    }
        while(ptr!=NULL) {
            aptr=getnode();
            aptr->coeff=ptr->coeff;
            aptr->expo=ptr->expo;
            ptr=ptr->next;
            r1ptr->next=aptr;
            r1ptr=aptr;

        }
        while(qtr!=NULL) {
            aptr=getnode();
            aptr->coeff=qtr->coeff;
            aptr->expo=qtr->expo;
            qtr=qtr->next;
            r1ptr->next=aptr;
            r1ptr=aptr;
        }       
        return (rptr->next);
}
N *input()
{
    N *new,*qtr,*ptr;
    int i,n;
    new=(N *)malloc(sizeof(N));
    new->next=NULL;
    qtr=new;
    printf("Enter number of nodes");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        ptr=(N*)malloc(sizeof(N));      
        printf("Enter Coeff & Expo respectively");
        scanf("%d%d",&ptr->coeff,&ptr->expo);
        ptr->next=NULL;
        qtr->next=ptr;
        qtr=qtr->next;
    }
    return(new->next);
}
int main() 
{
    N *ptr,*qtr,*add;
    ptr=input();
    qtr=input();
    add=p_addition(ptr,qtr);
    while(add!=NULL) {
        printf("%dX^%d+",add->coeff,add->expo);
        add=add->next;
    }

}

`

0

The above given query i am using to generate a ledger report. I am getting right output from this query but i want to pass a table name from a string in this query, so I want to use dynamic SQL query. I am doing any syntax mistake using dynamic SQL so kindly help me out in this.

0

Hello

I am trying to create chaper links for my Vimeo videos on my site. I have managed to get a script working with direct links but cannot get it to work with a drop-down menu.

Here is my code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<script src="https://f.vimeocdn.com/js/froogaloop2.min.js"></script>

<script>
$(window).load(function(){

 var link_1_track = 26;
 var link_2_track = 75;
 var link_3_track = 103;
 var link_4_track = 170;
 var link_5_track = 188;
 var link_6_track = 226;
 var link_7_track = 265;
 var link_8_track = 299;
 var link_9_track = 382;
 var link_10_track = 420;
 var link_11_track = 445;
 var link_12_track = 458;
 var link_13_track = 489;
 var link_14_track = 534;

 var iframe_player = jQuery('#player')[0];
 var player = $f(iframe_player);

 function setupLinks() {

    jQuery(".link_1").click(function () {
        player.api('play');
        player.api('seekTo', link_1_track);
    });

    jQuery(".link_2").click(function () {
        player.api('play');
        player.api('seekTo', link_2_track);
    });

    jQuery(".link_3").click(function () {
        player.api('play');
        player.api('seekTo', link_3_track);
    });

    jQuery(".link_4").click(function () {
        player.api('play');
        player.api('seekTo', link_4_track);
    });

    jQuery(".link_5").click(function () {
        player.api('play');
        player.api('seekTo', link_5_track);
    });

    jQuery(".link_6").click(function () {
        player.api('play');
        player.api('seekTo', link_6_track);
    });

    jQuery(".link_7").click(function () {
        player.api('play');
        player.api('seekTo', link_7_track);
    });

    jQuery(".link_8").click(function () {
        player.api('play');
        player.api('seekTo', link_8_track);
    });

    jQuery(".link_9").click(function () {
        player.api('play');
        player.api('seekTo', link_9_track);
    });

    jQuery(".link_10").click(function () {
        player.api('play');
        player.api('seekTo', link_10_track);
    });

    jQuery(".link_11").click(function () {
        player.api('play');
        player.api('seekTo', link_11_track);
    });

    jQuery(".link_12").click(function () {
        player.api('play');
        player.api('seekTo', link_12_track);
    });

    jQuery(".link_13").click(function () {
        player.api('play');
        player.api('seekTo', link_13_track);
    });

    jQuery(".link_14").click(function () {
        player.api('play');
        player.api('seekTo', link_14_track);
    });
}
setupLinks();
});
</script>

<a class="link_1" href="javascript:void(0);">1</a>&emsp;-&emsp;
<a class="link_2" href="javascript:void(0);">2</a>&emsp;-&emsp;
<a class="link_3" href="javascript:void(0);">3</a>&emsp;-&emsp;
<a class="link_4" href="javascript:void(0);">4</a>&emsp;-&emsp;
<a class="link_5" href="javascript:void(0);">5</a>&emsp;-&emsp;
<a class="link_6" href="javascript:void(0);">6</a>&emsp;-&emsp;
<a class="link_7" href="javascript:void(0);">7</a>&emsp;-&emsp;
<a class="link_8" href="javascript:void(0);">8</a>&emsp;-&emsp;
<a class="link_9" href="javascript:void(0);">9</a>&emsp;-&emsp;
<a class="link_10" href="javascript:void(0);">10</a>&emsp;-&emsp;
<a class="link_11" href="javascript:void(0);">11</a>&emsp;-&emsp;
<a class="link_12" ...
0

hi james and rproffitt

here is the code

package forensic;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.*;

/**
 *
 * @author luana taylor
 */
public class forensic_login extends javax.swing.JFrame {
Connection conn = null;
PreparedStatement pst = null;
ResultSet rs = null;

    /**

the errors that I am getting is that it cannot find symbol

I have now starting to build the login gui page, I want it to hook up to the database, so when there is a login it can say you are login successfully or invalid login