Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
George L.
Tutor for Java and C programming language
Tutor Satisfaction Guarantee
Web Design
TutorMe
Question:

Create a user's log table use Oracle database.

George L.
Answer:

------------------------------------------user's log---------------------------------------------- -------------------------------------------------log's table--------------------------------------- CREATE TABLE "PSMEDIA"."USERLOGINLOG" ( ULL_ID INTEGER not null, --write ID ULL_AD_ID INTEGER not null, ULL_STARTTIME DATE default sysdate not null, --login time ULL_ENDTIME DATE default sysdate not null, --leave time ULL_IPADDRESS VARCHAR2(20) default '', --login IP MONTH NUMBER default to_number(to_char(sysdate,'mm')) not null ) TABLESPACE "TSDATA_LOG" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) PARTITION BY RANGE ( MONTH ) ( PARTITION PAR_USERLOGINLOG_1 VALUES LESS THAN ( 2 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_2 VALUES LESS THAN ( 3 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_3 VALUES LESS THAN ( 4 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_4 VALUES LESS THAN ( 5 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_5 VALUES LESS THAN ( 6 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_6 VALUES LESS THAN ( 7 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_7 VALUES LESS THAN ( 8 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_8 VALUES LESS THAN ( 9 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_9 VALUES LESS THAN ( 10 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_10 VALUES LESS THAN ( 11 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_11 VALUES LESS THAN ( 12 ) TABLESPACE TSDATA_LOG , PARTITION PAR_USERLOGINLOG_12 VALUES LESS THAN ( MAXVALUE ) TABLESPACE TSDATA_LOG )NOLOGGING; ALTER TABLE PSMEDIA.USERLOGINLOG ADD CONSTRAINT PK_USERLOGINLOG PRIMARY KEY (ULL_ID, MONTH) USING INDEX TABLESPACE TSDATA_IND2 PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1) LOCAL ( PARTITION P_I_USERLOGINLOG_1 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_2 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_3 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_4 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_5 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_6 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_7 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_8 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_9 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_10 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_11 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_12 TABLESPACE TSDATA_IND2 )NOLOGGING; CREATE INDEX PSMEDIA.I_USERLOGINLOG_ID ON PSMEDIA.USERLOGINLOG(ULL_ID) TABLESPACE TSDATA_IND2 PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1) LOCAL ( PARTITION P_I_USERLOGINLOG_1 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_2 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_3 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_4 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_5 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_6 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_7 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_8 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_9 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_10 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_11 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_12 TABLESPACE TSDATA_IND2 )NOLOGGING; CREATE INDEX PSMEDIA.I_USERLOGINLOG_STARTTIME ON PSMEDIA.USERLOGINLOG(ULL_STARTTIME) TABLESPACE TSDATA_IND2 PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1) LOCAL ( PARTITION P_I_USERLOGINLOG_1 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_2 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_3 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_4 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_5 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_6 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_7 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_8 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_9 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_10 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_11 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_12 TABLESPACE TSDATA_IND2 )NOLOGGING; CREATE INDEX PSMEDIA.I_USERLOGINLOG_ENDTIME ON PSMEDIA.USERLOGINLOG(ULL_ENDTIME) TABLESPACE TSDATA_IND2 PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1) LOCAL ( PARTITION P_I_USERLOGINLOG_1 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_2 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_3 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_4 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_5 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_6 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_7 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_8 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_9 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_10 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_11 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_12 TABLESPACE TSDATA_IND2 )NOLOGGING; CREATE INDEX PSMEDIA.I_USERLOGINLOG_ADID ON PSMEDIA.USERLOGINLOG(ULL_AD_ID) TABLESPACE TSDATA_IND2 PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1) LOCAL ( PARTITION P_I_USERLOGINLOG_1 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_2 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_3 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_4 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_5 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_6 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_7 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_8 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_9 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_10 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_11 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_12 TABLESPACE TSDATA_IND2 )NOLOGGING; CREATE INDEX PSMEDIA.I_USERLOGINLOG_ADIDSTARTTIME ON PSMEDIA.USERLOGINLOG(ULL_AD_ID,ULL_STARTTIME) TABLESPACE TSDATA_IND2 PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1) LOCAL ( PARTITION P_I_USERLOGINLOG_1 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_2 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_3 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_4 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_5 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_6 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_7 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_8 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_9 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_10 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_11 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_12 TABLESPACE TSDATA_IND2 )NOLOGGING; CREATE INDEX PSMEDIA.I_USERLOGINLOG_ADIDENDTIME ON PSMEDIA.USERLOGINLOG(ULL_AD_ID,ULL_ENDTIME) TABLESPACE TSDATA_IND2 PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1) LOCAL ( PARTITION P_I_USERLOGINLOG_1 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_2 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_3 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_4 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_5 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_6 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_7 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_8 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_9 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_10 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_11 TABLESPACE TSDATA_IND2 , PARTITION P_I_USERLOGINLOG_12 TABLESPACE TSDATA_IND2 )NOLOGGING;

Java Programming
TutorMe
Question:

Test the Java iterator

George L.
Answer:

import java.util.*; public class IteratorTest { public static void main(String[] args) { // TODO Auto-generated method stub Collection c = new HashSet(); c.add(new Name("f1111", "l1222")); c.add(new Name("f2", "l2")); c.add(new Name("f3", "l3")); for(Iterator i = c.iterator();i.hasNext();){ Name n = (Name)i.next(); if(n.getFirstName().length() < 3){ i.remove(); } } System.out.println(c); } } class Name{ String firstName, lastName; public Name(String firstName, String lastName){ this.firstName = firstName; this.lastName = lastName; } public String getFirstName(){ return firstName; } public String getLastName(){ return lastName; } public String toString(){ return firstName+" "+lastName; } /* public boolean equals(Object obj){ if(obj instanceof Name){ Name name = (Name) obj; return (firstName.equals(name.firstName)) && (lastName.equals(name.lastName)); } return super.equals(obj); }*/ public int hashCode(){ return firstName.hashCode(); } }

C Programming
TutorMe
Question:

Please write a program in C to accomplish the LinkList create, insert, delete reverse

George L.
Answer:

#include <stdio.h> #include <stdlib.h> typedef int DATATYPE; typedef struct node { DATATYPE data; struct node *next; }LinkNode; typedef struct head { LinkNode *head; int tlen; int clen; }LinkList; LinkList *CreateLinkList(int len) { LinkList *list = NULL; LinkNode *temp = NULL; list = malloc(sizeof(LinkList)); if (list == NULL) { perror("fail to malloc!"); return NULL; } temp = malloc(sizeof(LinkNode)); if (temp == NULL) { perror("fail to malloc!"); return NULL; } temp->data = 0; temp->next = NULL; list->head = temp; list->tlen = len; list->clen = 0; return list; } int InsertLinkList(LinkList *list, DATATYPE data) { LinkNode *temp = NULL; if (list->clen == list->tlen) { printf("The linklist is full!\n"); return -1; } temp = malloc(sizeof(LinkNode)); if (temp == NULL) { perror("fail to malloc!"); return -1; } temp->data = data; temp->next = list->head->next; list->head->next = temp; list->clen++; return 0; } int LinkListShow(LinkList *list) { LinkNode *p = NULL; p = list->head->next; while (p != NULL) { printf("%d ", p->data); p= p->next; } printf("\n"); return 0; } int DestroyLinkList(LinkList *list) { LinkNode *p = NULL; LinkNode *temp = NULL; p = list->head->next; temp = list->head->next; while (p != NULL) { p = p->next; free(temp); temp = p; } free(list); return 0; } int FindLinkList(LinkList *list, DATATYPE data) { LinkNode *p = NULL; p = list->head->next; while (p != NULL) { if (p->data == data) return 1; p = p->next; } return 0; } int DeleteLinkList(LinkList *list, DATATYPE data) { LinkNode *p = NULL; LinkNode *temp = NULL; p = list->head; while (p->next != NULL) { if (p->next->data == data) { temp = p->next; p->next = p->next->next; free(temp); } p = p->next; } list->clen--; return 0; } int ReviseLinkList(LinkList *list,DATATYPE old, DATATYPE new) { LinkNode *p = NULL; p = list->head->next; while (p != NULL) { if (p->data == old) { p->data = new; } p = p->next; } return 0; } int main(void) { int i = 0; int n = 0; LinkList *linklist = NULL; linklist = CreateLinkList(10); for (i = 0;i < 5;i++) { InsertLinkList(linklist, i); } n = FindLinkList(linklist, 20); printf("n = %d\n", n); LinkListShow(linklist); DeleteLinkList(linklist, 2); LinkListShow(linklist); DeleteLinkList(linklist, 3); LinkListShow(linklist); ReviseLinkList(linklist, 1, 50); LinkListShow(linklist); DeleteLinkList(linklist, 4); LinkListShow(linklist); DestroyLinkList(linklist); return 0; }

Send a message explaining your
needs and George will reply soon.
Contact George
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.