PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
797,210 | 04/28/2009 10:18:25 | 68,381 | 02/19/2009 13:21:01 | 14 | 0 | can we write custom dropdown box using javascript ? | can we write custom dropdown box using javascript,html,css.
and aslo placing backgroung-image for that.
Thanks & Regards
Ravi | html | javascript | css | null | null | 07/18/2012 06:56:05 | not a real question | can we write custom dropdown box using javascript ?
===
can we write custom dropdown box using javascript,html,css.
and aslo placing backgroung-image for that.
Thanks & Regards
Ravi | 1 |
10,866,167 | 06/02/2012 21:41:51 | 1,225,055 | 02/22/2012 06:02:24 | 24 | 1 | How can I solve 'glibc detected' error in C? | When I was making SIC/XE Memory load machine(System programming class) in C. I found glibc error. I have never seen before this error, so I do not handle how to solve it.
The error message like this
*** glibc detected *** ./20081610.out: free(): invalid next size (fast): 0x0000000000d9e1f0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x77806)[0x7f52cb90a806]
/lib/libc.so.6(cfree+0x73)[0x7f52cb9110d3]
./20081610.out[0x401f63]
./20081610.out[0x401373]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f52cb8b1c4d]
./20081610.out[0x400ca9]
======= Memory map: ========
00400000-0040d000 r-xp 00000000 08:06 1443243 /sogang/under/cs20081610/sp20081610_proj5/20081610.out
0060c000-0060d000 r--p 0000c000 08:06 1443243 /sogang/under/cs20081610/sp20081610_proj5/20081610.out
0060d000-0060e000 rw-p 0000d000 08:06 1443243 /sogang/under/cs20081610/sp20081610_proj5/20081610.out
00d9e000-00dbf000 rw-p 00000000 00:00 0 [heap]
7f52c4000000-7f52c4021000 rw-p 00000000 00:00 0
7f52c4021000-7f52c8000000 ---p 00000000 00:00 0
7f52cb67c000-7f52cb692000 r-xp 00000000 08:01 5111819 /lib/libgcc_s.so.1
7f52cb692000-7f52cb891000 ---p 00016000 08:01 5111819 /lib/libgcc_s.so.1
7f52cb891000-7f52cb892000 r--p 00015000 08:01 5111819 /lib/libgcc_s.so.1
7f52cb892000-7f52cb893000 rw-p 00016000 08:01 5111819 /lib/libgcc_s.so.1
7f52cb893000-7f52cba0d000 r-xp 00000000 08:01 5112158 /lib/libc-2.11.1.so
7f52cba0d000-7f52cbc0c000 ---p 0017a000 08:01 5112158 /lib/libc-2.11.1.so
7f52cbc0c000-7f52cbc10000 r--p 00179000 08:01 5112158 /lib/libc-2.11.1.so
7f52cbc10000-7f52cbc11000 rw-p 0017d000 08:01 5112158 /lib/libc-2.11.1.so
7f52cbc11000-7f52cbc16000 rw-p 00000000 00:00 0
7f52cbc16000-7f52cbc36000 r-xp 00000000 08:01 5111958 /lib/ld-2.11.1.so
7f52cbe29000-7f52cbe2c000 rw-p 00000000 00:00 0
7f52cbe31000-7f52cbe35000 rw-p 00000000 00:00 0
7f52cbe35000-7f52cbe36000 r--p 0001f000 08:01 5111958 /lib/ld-2.11.1.so
7f52cbe36000-7f52cbe37000 rw-p 00020000 08:01 5111958 /lib/ld-2.11.1.so
7f52cbe37000-7f52cbe38000 rw-p 00000000 00:00 0
7ffff2433000-7ffff2837000 rw-p 00000000 00:00 0 [stack]
7ffff29e6000-7ffff29e7000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
And It's source code are below. 20081610.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "20081610.h"
int main(){
int quit_command = 1;
char *token = NULL;
char *token_blank = " \n,";
char *copied = NULL;
char *token_enter = "\n";
char buff[50];
char copy[50];
char *help_1 = "h"; // h[elp]
char *help_2 = "help";
char *dir_1 = "d"; // d[ir]
char *dir_2 = "dir";
char *quit_1 = "q"; // q[uit]
char *quit_2 = "quit";
char *hist_1 = "hi"; // hi[story]
char *hist_2 = "history";
char *dump_1 = "du"; // du[mp]
char *dump_2 = "dump";
char *edit_1 = "e"; // e[dit]
char *edit_2 = "edit";
char *fill_1 = "f"; // f[ill]
char *fill_2 = "fill";
char *reset = "reset"; // reset
char *opcode = "opcode"; // opcode
char *mnemo = "mnemonic"; // mnemonic
char *op_lst = "opcodelist"; // opcodelist
char *mn_lst = "mnemoniclist"; // mnemoniclist
char *type_f = "type"; // type filename
char *assemble_f = "assemble"; // assemble filename
char *symbol = "symbol"; // symbol
char *dissemble_f= "disassemble"; // disassemble
char *pgmaddr_ = "progaddr"; // program address
char *loader_f = "loader"; // loader
char *run_ = "run"; // run
char *breakpt_ = "bp"; // break point
// operand list
int memory[65536][16]; // memory assign
char *mem_start; // assign address start
char *mem_end; // assign address end
char *mem_garbage_checker;
char *mem_value;
int mem_i_start;
int mem_i_end;
int mem_i_value;
int value_flag = 0;
int edit_flag = 0;
int address = 0;
int end_flag = 0;
// 1M(16 X 65536) memory assign
int pgm_addr = 0;
// Loader address
table_maker(); //[ 20081610_hasht.c ] hash table maker
while(quit_command == 1)
{
/******************************************************** data input command *****************/
printf("sicsim>");
fgets(buff,50,stdin); // command set input
// enter input error occurred 04.04
if(strcmp(buff,"\n")==0) // error corrected 04.05
continue;
if(buff[0]==' ')buff[0]='w'; // wrong command
strcpy(copy,buff); // copy buffer
copied = strtok(copy,token_enter); // eat \n charactor
token = strtok(buff,token_blank); // command token
if((mem_start = strtok(NULL,token_blank))!=NULL)
{
if(mem_start){
if(0 == strcmp(opcode, token))
{
edit_flag=1;
}
else
{
if((0 == strcmp(type_f,token)) || (0 == strcmp(assemble_f,token)) ||(0 == strcmp(dissemble_f,token)) || (0==strcmp(breakpt_,token)) || (0==strcmp(loader_f,token))) // eat token
{
}
else
{
mem_i_start = hex_to_dec(mem_start);
if(mem_i_start<0) token = "garbage";
}
edit_flag=1;
}
}
}
else
mem_i_start = -1; // nothing inputted
if((mem_end = strtok(NULL,token_blank))!=NULL)
{
if(mem_end){
if(0 == strcmp(loader_f,token))
{
}
else
{
mem_i_end = hex_to_dec(mem_end);
if(mem_i_end<0) token = "garbage";
}
end_flag=1;
}
}
else
mem_i_end = -1; // nothing inputted
if((mem_value = strtok(NULL,token_blank))!=NULL)
{
if(mem_value){
if(0 == strcmp(loader_f,token))
{
}
else
{
mem_i_value = hex_to_dec(mem_value);
if(mem_i_end<0) token = "garbage";
}
value_flag=1;
}
}
if((mem_garbage_checker = strtok(NULL,token_blank))!=NULL)
token = "garbage"; // wrong command
/******************************************************** command logic filtered *************/
if (((0 == strcmp(help_1,token )) || (0 == strcmp(help_2,token))) && value_flag==0 && edit_flag==0)// h[elp] command
{
help_cmd();
his_push(token);
}
else if(((0 == strcmp(dir_1,token )) || (0 == strcmp(dir_2,token ))) && value_flag==0 && edit_flag==0)// d[ir] command
{
dir_cmd();
his_push(token);
}
else if(((0 == strcmp(quit_1,token)) || (0 == strcmp(quit_2,token))) && value_flag==0 && edit_flag==0)// q[uit] command
{
quit_command = 0;
his_free();
}
else if(((0 == strcmp(hist_1,token)) || (0 == strcmp(hist_2,token))) && value_flag==0 && edit_flag==0)// hi[story] command
{
his_push(token);
his_print();
}
else if(((0 == strcmp(dump_1,token)) || (0 == strcmp(dump_2,token))) && value_flag==0)// du[mp] command
{
dump_cmd(memory, mem_i_start, mem_i_end, &address);
his_push(copied);
}
else if(((0 == strcmp(edit_1,token)) || (0 == strcmp(edit_2,token))) && value_flag==0 && edit_flag==1 && end_flag==1)// e[dit] command
{
edit_cmd(memory, mem_i_start, mem_i_end);
// edit_cmd(ARRAY / ADDRESS / VALUE)
his_push(copied);
}
else if(((0 == strcmp(fill_1,token)) || (0 == strcmp(fill_2,token))) && value_flag==1)// f[ill] command
{
fill_cmd(memory, mem_i_start, mem_i_end, mem_i_value);
his_push(copied);
}
else if(0 == strcmp(reset,token) && value_flag==0 && edit_flag==0) // reset command
{
reset_cmd(memory);
his_push(copied);
}
else if(0 == strcmp(opcode,token) && value_flag==0 && edit_flag==1) // opcode command
{
opcode_finder(mem_start);
his_push(copied);
}
else if(0 == strcmp(mnemo,token) && value_flag==0 && edit_flag==1) // mnemonic command
{
mncode_finder(mem_start);
his_push(copied);
}
else if(0 == strcmp(op_lst,token) && value_flag==0 && edit_flag==0) // opcodelist command
{
optabl_print();
his_push(token);
}
else if(0 == strcmp(mn_lst,token) && value_flag==0 && edit_flag==0) // mnemoniclist command
{
mntabl_print();
his_push(token);
}
else if(0 == strcmp(type_f,token) && value_flag==0 && edit_flag==1) // type filename command
{
//printf("%s\n",mem_start);
type_filename(mem_start);
his_push(copied);
}
else if(0 == strcmp(assemble_f,token) && value_flag==0 && edit_flag==1) // assemble command
{
mtab_free();
symtab_free();
assemble_filename(mem_start);
his_push(copied);
}
else if(0 == strcmp(symbol,token) && value_flag==0 && edit_flag==0) // symbol command
{
symtab_print();
his_push(symbol);
}
else if(0 == strcmp(dissemble_f,token) && value_flag ==0 && edit_flag==1) // disassemble command
{
disassemble(mem_start);
his_push(copied);
}
else if((0 == strcmp(pgmaddr_,token)) && value_flag==0 && edit_flag==1 && end_flag==0)
{
pgm_addr = mem_i_start;
his_push(copied);
}
else if((0 == strcmp(loader_f,token)) && edit_flag == 1)
{
int increment = pgm_addr; // upload length of the program
printf("\t\t\tcontrol\t\tsymbol\t\taddress\t\tlength\n");
printf("\t\t\tsection\t\tname\n");
printf("\t\t\t-------------------------------------------------------------\n");
// PASS 1
increment = load(memory, mem_start,increment);
printf("\n");
if(end_flag == 1)
{
increment = load(memory, mem_end,increment);
printf("\n");
if(value_flag == 1)
{
increment = load(memory, mem_value,increment);
printf("\n");
}
}
increment -= pgm_addr;
// PASS 2
loader_p2(memory, mem_start,pgm_addr);
if(end_flag == 1)
{
loader_p2(memory, mem_end,pgm_addr);
if(value_flag == 1)
{
loader_p2(memory, mem_value,pgm_addr);
}
}
// PASS2 end
printf("\t\t\t-------------------------------------------------------------\n");
printf("\t\t\t\t\t\t\t\ttotal length\t%X\n",increment);
his_push(copied);
symtab_free();
}
else if((0 == strcmp(run_,token)) && edit_flag == 0)
{
printf("run\n");
his_push(copied);
}
else if(0 == strcmp(breakpt_,token))
{
if(edit_flag == 1)
{
if(0 == strcmp(mem_start,"clear"))
{
printf("clear\n");
}
else
{
printf("number\n");
}
}
else
{
printf("just break\n");
}
his_push(copied);
}
else // wrong command
{
printf("%sWrong command!!\n",token);
}
value_flag = 0;
edit_flag = 0;
end_flag = 0;
/********************************************************* command logic filtered *************/
}
his_free();
mtab_free();
table_free(); // [20081610_hasht.c] hash free
symtab_free(); // [20081610_assemble.c] free
return 0;
}
and 20081610_loader.c are below.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// 20081610_symtab.c
extern void symtab_push(char *label_name, char *label_type,int label_address);
extern int find_symbol_address(char *variable_name);
extern void symtab_print();
// memory is declared in 20081610.c
// memory type is integer
// memory[65536][16]; size of the memory
int load(int mem[][16], char *file_name, int address)
{
FILE *fp, *fp2;
int CSLTH = address; // control section length
int i = 0; // for loop
// int j = 0; // for loop
int estab_checker = 0;
char *ptr = NULL;
// int addr_line;
// int addr_column;
// char out_defined[10][7];
char pgm_name[7];
if((fp = fopen(file_name,"r")) == NULL)
{
printf("[20081610_loader.c] There is not exists %s.\n",file_name);
}
else
{
fp2 = fopen(file_name,"r"); // for pass 2
char buff[1000];
/*************************************************** PASS 1 *****************/
while((fgets(buff,sizeof(buff),fp)) != NULL)
{
if(buff[0] == 'H')
{
ptr = buff+1;
pgm_name[6]='\0';
strncpy(pgm_name,ptr,6);
if(pgm_name[strlen(pgm_name)-1]=='\n' || pgm_name[strlen(pgm_name)-2]=='\r')
{
pgm_name[strlen(pgm_name)-1] ='\0';
}
// program name copied [pgm_name]
ptr += 12;
char pgm_length[7]; pgm_length[6]='\0';
int pgm_i_length;
strncpy(pgm_length,ptr,6);
sscanf(pgm_length,"%X",&pgm_i_length);
CSLTH = pgm_i_length;
// program length copied [pgm_i_length]
estab_checker = find_symbol_address(pgm_name);
if(estab_checker == 0)
printf("\t\t\t[Loader error] Control section name duplicated!\n");
else
{
symtab_push(pgm_name,"PGMTIT",CSLTH+address);
printf("\t\t\t%s\t\t\t\t%X\t\t%04X\n",pgm_name,address,CSLTH);
}
// < Using SYMTAB, this pretend as a ESTAB's control section >
// find_symbol_address(variable_name) == return -1 does not exist.
// symtab_push(label_name, label_type, label_address)
ptr = NULL;
}
if(buff[0] == 'D')
{
ptr = buff+1;
char pgm_def_name[7]; pgm_def_name[6]='\0';
char pgm_def_addr[7]; pgm_def_addr[6]='\0';
int pgm_i_def_addr;
for(i=0; (strlen(buff)-1)/12 > i ; i++)
{
strncpy(pgm_def_name,ptr,6);
ptr += 6;
strncpy(pgm_def_addr,ptr,6);
sscanf(pgm_def_addr,"%X",&pgm_i_def_addr);
estab_checker = find_symbol_address(pgm_def_name);
// printf("%s // %s %X\n",buff,pgm_def_name,pgm_i_def_addr);
if(estab_checker == 0)
printf("\t\t\t[Loader error] Symbol name duplicated!\n");
else
{
symtab_push(pgm_def_name,"PGMS",pgm_i_def_addr+address);
printf("\t\t\t\t\t%s\t\t%X\n",pgm_def_name,pgm_i_def_addr+address);
}
ptr += 6;
}
ptr = NULL;
}
}
fclose(fp);
fclose(fp2);
}
return address+=CSLTH;
}
int loader_p2(int mem[][16],char *file_name, int address)
{
FILE *fp, *fp2;
// int CSLTH = address; // control section length
int i = 0; // for loop
int j = 0; // for loop
// int estab_checker = 0;
char *ptr = NULL;
int addr_line;
int addr_column;
char out_defined[10][7];
char pgm_name[7];
if((fp = fopen(file_name,"r")) == NULL)
{
printf("[20081610_loader.c] There is not exists %s.\n",file_name);
}
else
{
fp2 = fopen(file_name,"r"); // for pass 2
char buff[1000];
/************************************************** PASS 2 ****************/
while((fgets(buff,sizeof(buff),fp2)) != NULL)
{
int end_flag = 0;
if(buff[0] == 'H')
{
ptr = buff+1;
pgm_name[6]='\0';
strncpy(pgm_name,ptr,6);
if(pgm_name[strlen(pgm_name)-1]=='\n' || pgm_name[strlen(pgm_name)-2]=='\r')
{
pgm_name[strlen(pgm_name)-1] ='\0';
}
// program name copied [pgm_name]
strcpy(out_defined[1],pgm_name);
}
if(buff[0] == 'T' && end_flag == 0)
{
ptr = buff+1;
char load_start_address[7]; load_start_address[6] = '\0';
int load_i_start_address;
strncpy(load_start_address,ptr,6);
sscanf(load_start_address,"%X",&load_i_start_address);
load_i_start_address += address; // plus a start address
// [load_i_start_address] is integer start address
ptr += 6;
char load_length[3]; load_length[2] = '\0';
int load_i_length;
strncpy(load_length,ptr,2);
sscanf(load_length,"%X",&load_i_length);
// [load_i_length] is the text length of the 'T' line
// printf("buff: %s",buff);
// printf("%X %s %X\n",load_i_start_address,load_length, load_i_length);
ptr += 2;
char load_mem[3]; load_mem[2] ='\0';
int load_i_mem;
for(i=0; (strlen(buff)-9)/2 > i ; i++)
{
strncpy(load_mem,ptr,2);
sscanf(load_mem,"%X",&load_i_mem);
ptr += 2;
addr_line = (load_i_start_address + i)/16;
addr_column = (load_i_start_address + i)%16;
mem[addr_line][addr_column] = load_i_mem;
if( i > load_i_length)
printf("[Load error] Text record length error!\n %d",i);
}
ptr = NULL;
}
if(buff[0] == 'R' && end_flag == 0)
{
for(i=2; 10>i; i++)
for(j=0; 7>j; j++)
out_defined[i][j] = '\0'; // initalize
ptr = buff+1;
for(i=0; (strlen(buff))/8 >i; i++)
{
char number[3]; number[2] = '\0';
int number_i;
strncpy(number,ptr,2);
sscanf(number,"%d",&number_i);
ptr += 2;
char name[7]; name[6] = '\0';
strncpy(name,ptr,6);
if(name[strlen(name)-1]=='\n' || name[strlen(name)-1]=='\r')
{
name[strlen(name)-1]=32;
name[strlen(name)]=32;
}
for(j=0 ; j<7; j++){ out_defined[number_i][j] = name[j]; }
//printf("%d %d %s\n",strlen(buff),number_i,name);
ptr += 6;
}
ptr = NULL;
}
if(buff[0] == 'M' && end_flag == 0)
{
ptr = buff+1;
char load_modify_record[7]; load_modify_record[6] = '\0';
int load_i_modify_record;
strncpy(load_modify_record,ptr,6);
sscanf(load_modify_record,"%X",&load_i_modify_record);
load_i_modify_record += address;
// modify_i_record
ptr += 8;
char type[1];
strncpy(type,ptr,1);
// type = '+'/ '-'
ptr += 1;
char index[3]; index[2] = '\0';
int index_i;
strncpy(index,ptr,2);
sscanf(index,"%d",&index_i);
// index is used to find [out_defined[10][7]]
int result = 0;
unsigned int result2 =0;
if (type[0] == '+')
{
if(find_symbol_address(out_defined[index_i]) != -1)
{
addr_line = (load_i_modify_record+1)/16;
addr_column = (load_i_modify_record+1)%16;
result += (mem[addr_line][addr_column]*256);
addr_line = (load_i_modify_record+2)/16;
addr_column = (load_i_modify_record+2)%16;
result += (mem[addr_line][addr_column]);
result += (find_symbol_address(out_defined[index_i])+address);
result2 = (unsigned int) result;
result2 = result2%65536;
addr_line = (load_i_modify_record+1)/16;
addr_column = (load_i_modify_record+1)%16;
mem[addr_line][addr_column] = result2/256;
// printf("%02X",mem[addr_line][addr_column]);
addr_line = (load_i_modify_record+2)/16;
addr_column = (load_i_modify_record+2)%16;
mem[addr_line][addr_column] = result2%256;
// printf("%02X\n",mem[addr_line][addr_column]);
}
else
printf("[Loader] Cannot found symbol!\n");
}
else if (type[0] == '-')
{
if(find_symbol_address(out_defined[index_i]) != -1)
{
addr_line = (load_i_modify_record+1)/16;
addr_column = (load_i_modify_record+1)%16;
result += (mem[addr_line][addr_column]*256);
addr_line = (load_i_modify_record+2)/16;
addr_column = (load_i_modify_record+2)%16;
result += (mem[addr_line][addr_column]);
result -= (find_symbol_address(out_defined[index_i])+address);
result2 = (unsigned int) result;
result2 = result2%65536;
addr_line = (load_i_modify_record+1)/16;
addr_column = (load_i_modify_record+1)%16;
mem[addr_line][addr_column] = result2/256;
// printf("%02X",mem[addr_line][addr_column]);
addr_line = (load_i_modify_record+2)/16;
addr_column = (load_i_modify_record+2)%16;
mem[addr_line][addr_column] = result2%256;
// printf("%02X\n",mem[addr_line][addr_column]);
}
else
printf("[Loader] Cannot found symbol!\n");
}
else
printf("[Loader] Operator assignment error!\n");
// printf("%d %s %X\n",index_i,out_defined[index_i],find_symbol_address(out_defined[index_i])+address);
ptr = NULL;
}
if(buff[0] == 'E')
end_flag = 1;
if((buff[0] != 'H') && (buff[0] != 'D') && (buff[0] != 'R') && (buff[0] != '.') && (buff[0] != 'T') && (buff[0] != 'M') && (buff[0] != 'E'))
printf("\t\t\t[Loader error] Unexpected text into the object code! '%c'\n",buff[0]);
}
fclose(fp);
fclose(fp2);
}
return 0;
}
This program operate beneath procedure
1. set progaddr to start address(default value is 0)
2. set loader PROGRAM_NAME.obj file to load.
3. Check memory well uploaded into array(in 20081610.c)
4. repeat 1 to 3.
5. quit command
However, when I type quit or loader set over and over again(2 or 5 command repeatedly), this program occurres 'glibc detecting' error.
*The only case that error does not occurred is time when I did not set up progaddr(Just using default value). When I modify progaddr(procedure 1), glibc error occurred.
How can I solve this problem? | c | malloc | free | null | null | 06/02/2012 22:21:37 | not a real question | How can I solve 'glibc detected' error in C?
===
When I was making SIC/XE Memory load machine(System programming class) in C. I found glibc error. I have never seen before this error, so I do not handle how to solve it.
The error message like this
*** glibc detected *** ./20081610.out: free(): invalid next size (fast): 0x0000000000d9e1f0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x77806)[0x7f52cb90a806]
/lib/libc.so.6(cfree+0x73)[0x7f52cb9110d3]
./20081610.out[0x401f63]
./20081610.out[0x401373]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f52cb8b1c4d]
./20081610.out[0x400ca9]
======= Memory map: ========
00400000-0040d000 r-xp 00000000 08:06 1443243 /sogang/under/cs20081610/sp20081610_proj5/20081610.out
0060c000-0060d000 r--p 0000c000 08:06 1443243 /sogang/under/cs20081610/sp20081610_proj5/20081610.out
0060d000-0060e000 rw-p 0000d000 08:06 1443243 /sogang/under/cs20081610/sp20081610_proj5/20081610.out
00d9e000-00dbf000 rw-p 00000000 00:00 0 [heap]
7f52c4000000-7f52c4021000 rw-p 00000000 00:00 0
7f52c4021000-7f52c8000000 ---p 00000000 00:00 0
7f52cb67c000-7f52cb692000 r-xp 00000000 08:01 5111819 /lib/libgcc_s.so.1
7f52cb692000-7f52cb891000 ---p 00016000 08:01 5111819 /lib/libgcc_s.so.1
7f52cb891000-7f52cb892000 r--p 00015000 08:01 5111819 /lib/libgcc_s.so.1
7f52cb892000-7f52cb893000 rw-p 00016000 08:01 5111819 /lib/libgcc_s.so.1
7f52cb893000-7f52cba0d000 r-xp 00000000 08:01 5112158 /lib/libc-2.11.1.so
7f52cba0d000-7f52cbc0c000 ---p 0017a000 08:01 5112158 /lib/libc-2.11.1.so
7f52cbc0c000-7f52cbc10000 r--p 00179000 08:01 5112158 /lib/libc-2.11.1.so
7f52cbc10000-7f52cbc11000 rw-p 0017d000 08:01 5112158 /lib/libc-2.11.1.so
7f52cbc11000-7f52cbc16000 rw-p 00000000 00:00 0
7f52cbc16000-7f52cbc36000 r-xp 00000000 08:01 5111958 /lib/ld-2.11.1.so
7f52cbe29000-7f52cbe2c000 rw-p 00000000 00:00 0
7f52cbe31000-7f52cbe35000 rw-p 00000000 00:00 0
7f52cbe35000-7f52cbe36000 r--p 0001f000 08:01 5111958 /lib/ld-2.11.1.so
7f52cbe36000-7f52cbe37000 rw-p 00020000 08:01 5111958 /lib/ld-2.11.1.so
7f52cbe37000-7f52cbe38000 rw-p 00000000 00:00 0
7ffff2433000-7ffff2837000 rw-p 00000000 00:00 0 [stack]
7ffff29e6000-7ffff29e7000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
And It's source code are below. 20081610.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "20081610.h"
int main(){
int quit_command = 1;
char *token = NULL;
char *token_blank = " \n,";
char *copied = NULL;
char *token_enter = "\n";
char buff[50];
char copy[50];
char *help_1 = "h"; // h[elp]
char *help_2 = "help";
char *dir_1 = "d"; // d[ir]
char *dir_2 = "dir";
char *quit_1 = "q"; // q[uit]
char *quit_2 = "quit";
char *hist_1 = "hi"; // hi[story]
char *hist_2 = "history";
char *dump_1 = "du"; // du[mp]
char *dump_2 = "dump";
char *edit_1 = "e"; // e[dit]
char *edit_2 = "edit";
char *fill_1 = "f"; // f[ill]
char *fill_2 = "fill";
char *reset = "reset"; // reset
char *opcode = "opcode"; // opcode
char *mnemo = "mnemonic"; // mnemonic
char *op_lst = "opcodelist"; // opcodelist
char *mn_lst = "mnemoniclist"; // mnemoniclist
char *type_f = "type"; // type filename
char *assemble_f = "assemble"; // assemble filename
char *symbol = "symbol"; // symbol
char *dissemble_f= "disassemble"; // disassemble
char *pgmaddr_ = "progaddr"; // program address
char *loader_f = "loader"; // loader
char *run_ = "run"; // run
char *breakpt_ = "bp"; // break point
// operand list
int memory[65536][16]; // memory assign
char *mem_start; // assign address start
char *mem_end; // assign address end
char *mem_garbage_checker;
char *mem_value;
int mem_i_start;
int mem_i_end;
int mem_i_value;
int value_flag = 0;
int edit_flag = 0;
int address = 0;
int end_flag = 0;
// 1M(16 X 65536) memory assign
int pgm_addr = 0;
// Loader address
table_maker(); //[ 20081610_hasht.c ] hash table maker
while(quit_command == 1)
{
/******************************************************** data input command *****************/
printf("sicsim>");
fgets(buff,50,stdin); // command set input
// enter input error occurred 04.04
if(strcmp(buff,"\n")==0) // error corrected 04.05
continue;
if(buff[0]==' ')buff[0]='w'; // wrong command
strcpy(copy,buff); // copy buffer
copied = strtok(copy,token_enter); // eat \n charactor
token = strtok(buff,token_blank); // command token
if((mem_start = strtok(NULL,token_blank))!=NULL)
{
if(mem_start){
if(0 == strcmp(opcode, token))
{
edit_flag=1;
}
else
{
if((0 == strcmp(type_f,token)) || (0 == strcmp(assemble_f,token)) ||(0 == strcmp(dissemble_f,token)) || (0==strcmp(breakpt_,token)) || (0==strcmp(loader_f,token))) // eat token
{
}
else
{
mem_i_start = hex_to_dec(mem_start);
if(mem_i_start<0) token = "garbage";
}
edit_flag=1;
}
}
}
else
mem_i_start = -1; // nothing inputted
if((mem_end = strtok(NULL,token_blank))!=NULL)
{
if(mem_end){
if(0 == strcmp(loader_f,token))
{
}
else
{
mem_i_end = hex_to_dec(mem_end);
if(mem_i_end<0) token = "garbage";
}
end_flag=1;
}
}
else
mem_i_end = -1; // nothing inputted
if((mem_value = strtok(NULL,token_blank))!=NULL)
{
if(mem_value){
if(0 == strcmp(loader_f,token))
{
}
else
{
mem_i_value = hex_to_dec(mem_value);
if(mem_i_end<0) token = "garbage";
}
value_flag=1;
}
}
if((mem_garbage_checker = strtok(NULL,token_blank))!=NULL)
token = "garbage"; // wrong command
/******************************************************** command logic filtered *************/
if (((0 == strcmp(help_1,token )) || (0 == strcmp(help_2,token))) && value_flag==0 && edit_flag==0)// h[elp] command
{
help_cmd();
his_push(token);
}
else if(((0 == strcmp(dir_1,token )) || (0 == strcmp(dir_2,token ))) && value_flag==0 && edit_flag==0)// d[ir] command
{
dir_cmd();
his_push(token);
}
else if(((0 == strcmp(quit_1,token)) || (0 == strcmp(quit_2,token))) && value_flag==0 && edit_flag==0)// q[uit] command
{
quit_command = 0;
his_free();
}
else if(((0 == strcmp(hist_1,token)) || (0 == strcmp(hist_2,token))) && value_flag==0 && edit_flag==0)// hi[story] command
{
his_push(token);
his_print();
}
else if(((0 == strcmp(dump_1,token)) || (0 == strcmp(dump_2,token))) && value_flag==0)// du[mp] command
{
dump_cmd(memory, mem_i_start, mem_i_end, &address);
his_push(copied);
}
else if(((0 == strcmp(edit_1,token)) || (0 == strcmp(edit_2,token))) && value_flag==0 && edit_flag==1 && end_flag==1)// e[dit] command
{
edit_cmd(memory, mem_i_start, mem_i_end);
// edit_cmd(ARRAY / ADDRESS / VALUE)
his_push(copied);
}
else if(((0 == strcmp(fill_1,token)) || (0 == strcmp(fill_2,token))) && value_flag==1)// f[ill] command
{
fill_cmd(memory, mem_i_start, mem_i_end, mem_i_value);
his_push(copied);
}
else if(0 == strcmp(reset,token) && value_flag==0 && edit_flag==0) // reset command
{
reset_cmd(memory);
his_push(copied);
}
else if(0 == strcmp(opcode,token) && value_flag==0 && edit_flag==1) // opcode command
{
opcode_finder(mem_start);
his_push(copied);
}
else if(0 == strcmp(mnemo,token) && value_flag==0 && edit_flag==1) // mnemonic command
{
mncode_finder(mem_start);
his_push(copied);
}
else if(0 == strcmp(op_lst,token) && value_flag==0 && edit_flag==0) // opcodelist command
{
optabl_print();
his_push(token);
}
else if(0 == strcmp(mn_lst,token) && value_flag==0 && edit_flag==0) // mnemoniclist command
{
mntabl_print();
his_push(token);
}
else if(0 == strcmp(type_f,token) && value_flag==0 && edit_flag==1) // type filename command
{
//printf("%s\n",mem_start);
type_filename(mem_start);
his_push(copied);
}
else if(0 == strcmp(assemble_f,token) && value_flag==0 && edit_flag==1) // assemble command
{
mtab_free();
symtab_free();
assemble_filename(mem_start);
his_push(copied);
}
else if(0 == strcmp(symbol,token) && value_flag==0 && edit_flag==0) // symbol command
{
symtab_print();
his_push(symbol);
}
else if(0 == strcmp(dissemble_f,token) && value_flag ==0 && edit_flag==1) // disassemble command
{
disassemble(mem_start);
his_push(copied);
}
else if((0 == strcmp(pgmaddr_,token)) && value_flag==0 && edit_flag==1 && end_flag==0)
{
pgm_addr = mem_i_start;
his_push(copied);
}
else if((0 == strcmp(loader_f,token)) && edit_flag == 1)
{
int increment = pgm_addr; // upload length of the program
printf("\t\t\tcontrol\t\tsymbol\t\taddress\t\tlength\n");
printf("\t\t\tsection\t\tname\n");
printf("\t\t\t-------------------------------------------------------------\n");
// PASS 1
increment = load(memory, mem_start,increment);
printf("\n");
if(end_flag == 1)
{
increment = load(memory, mem_end,increment);
printf("\n");
if(value_flag == 1)
{
increment = load(memory, mem_value,increment);
printf("\n");
}
}
increment -= pgm_addr;
// PASS 2
loader_p2(memory, mem_start,pgm_addr);
if(end_flag == 1)
{
loader_p2(memory, mem_end,pgm_addr);
if(value_flag == 1)
{
loader_p2(memory, mem_value,pgm_addr);
}
}
// PASS2 end
printf("\t\t\t-------------------------------------------------------------\n");
printf("\t\t\t\t\t\t\t\ttotal length\t%X\n",increment);
his_push(copied);
symtab_free();
}
else if((0 == strcmp(run_,token)) && edit_flag == 0)
{
printf("run\n");
his_push(copied);
}
else if(0 == strcmp(breakpt_,token))
{
if(edit_flag == 1)
{
if(0 == strcmp(mem_start,"clear"))
{
printf("clear\n");
}
else
{
printf("number\n");
}
}
else
{
printf("just break\n");
}
his_push(copied);
}
else // wrong command
{
printf("%sWrong command!!\n",token);
}
value_flag = 0;
edit_flag = 0;
end_flag = 0;
/********************************************************* command logic filtered *************/
}
his_free();
mtab_free();
table_free(); // [20081610_hasht.c] hash free
symtab_free(); // [20081610_assemble.c] free
return 0;
}
and 20081610_loader.c are below.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// 20081610_symtab.c
extern void symtab_push(char *label_name, char *label_type,int label_address);
extern int find_symbol_address(char *variable_name);
extern void symtab_print();
// memory is declared in 20081610.c
// memory type is integer
// memory[65536][16]; size of the memory
int load(int mem[][16], char *file_name, int address)
{
FILE *fp, *fp2;
int CSLTH = address; // control section length
int i = 0; // for loop
// int j = 0; // for loop
int estab_checker = 0;
char *ptr = NULL;
// int addr_line;
// int addr_column;
// char out_defined[10][7];
char pgm_name[7];
if((fp = fopen(file_name,"r")) == NULL)
{
printf("[20081610_loader.c] There is not exists %s.\n",file_name);
}
else
{
fp2 = fopen(file_name,"r"); // for pass 2
char buff[1000];
/*************************************************** PASS 1 *****************/
while((fgets(buff,sizeof(buff),fp)) != NULL)
{
if(buff[0] == 'H')
{
ptr = buff+1;
pgm_name[6]='\0';
strncpy(pgm_name,ptr,6);
if(pgm_name[strlen(pgm_name)-1]=='\n' || pgm_name[strlen(pgm_name)-2]=='\r')
{
pgm_name[strlen(pgm_name)-1] ='\0';
}
// program name copied [pgm_name]
ptr += 12;
char pgm_length[7]; pgm_length[6]='\0';
int pgm_i_length;
strncpy(pgm_length,ptr,6);
sscanf(pgm_length,"%X",&pgm_i_length);
CSLTH = pgm_i_length;
// program length copied [pgm_i_length]
estab_checker = find_symbol_address(pgm_name);
if(estab_checker == 0)
printf("\t\t\t[Loader error] Control section name duplicated!\n");
else
{
symtab_push(pgm_name,"PGMTIT",CSLTH+address);
printf("\t\t\t%s\t\t\t\t%X\t\t%04X\n",pgm_name,address,CSLTH);
}
// < Using SYMTAB, this pretend as a ESTAB's control section >
// find_symbol_address(variable_name) == return -1 does not exist.
// symtab_push(label_name, label_type, label_address)
ptr = NULL;
}
if(buff[0] == 'D')
{
ptr = buff+1;
char pgm_def_name[7]; pgm_def_name[6]='\0';
char pgm_def_addr[7]; pgm_def_addr[6]='\0';
int pgm_i_def_addr;
for(i=0; (strlen(buff)-1)/12 > i ; i++)
{
strncpy(pgm_def_name,ptr,6);
ptr += 6;
strncpy(pgm_def_addr,ptr,6);
sscanf(pgm_def_addr,"%X",&pgm_i_def_addr);
estab_checker = find_symbol_address(pgm_def_name);
// printf("%s // %s %X\n",buff,pgm_def_name,pgm_i_def_addr);
if(estab_checker == 0)
printf("\t\t\t[Loader error] Symbol name duplicated!\n");
else
{
symtab_push(pgm_def_name,"PGMS",pgm_i_def_addr+address);
printf("\t\t\t\t\t%s\t\t%X\n",pgm_def_name,pgm_i_def_addr+address);
}
ptr += 6;
}
ptr = NULL;
}
}
fclose(fp);
fclose(fp2);
}
return address+=CSLTH;
}
int loader_p2(int mem[][16],char *file_name, int address)
{
FILE *fp, *fp2;
// int CSLTH = address; // control section length
int i = 0; // for loop
int j = 0; // for loop
// int estab_checker = 0;
char *ptr = NULL;
int addr_line;
int addr_column;
char out_defined[10][7];
char pgm_name[7];
if((fp = fopen(file_name,"r")) == NULL)
{
printf("[20081610_loader.c] There is not exists %s.\n",file_name);
}
else
{
fp2 = fopen(file_name,"r"); // for pass 2
char buff[1000];
/************************************************** PASS 2 ****************/
while((fgets(buff,sizeof(buff),fp2)) != NULL)
{
int end_flag = 0;
if(buff[0] == 'H')
{
ptr = buff+1;
pgm_name[6]='\0';
strncpy(pgm_name,ptr,6);
if(pgm_name[strlen(pgm_name)-1]=='\n' || pgm_name[strlen(pgm_name)-2]=='\r')
{
pgm_name[strlen(pgm_name)-1] ='\0';
}
// program name copied [pgm_name]
strcpy(out_defined[1],pgm_name);
}
if(buff[0] == 'T' && end_flag == 0)
{
ptr = buff+1;
char load_start_address[7]; load_start_address[6] = '\0';
int load_i_start_address;
strncpy(load_start_address,ptr,6);
sscanf(load_start_address,"%X",&load_i_start_address);
load_i_start_address += address; // plus a start address
// [load_i_start_address] is integer start address
ptr += 6;
char load_length[3]; load_length[2] = '\0';
int load_i_length;
strncpy(load_length,ptr,2);
sscanf(load_length,"%X",&load_i_length);
// [load_i_length] is the text length of the 'T' line
// printf("buff: %s",buff);
// printf("%X %s %X\n",load_i_start_address,load_length, load_i_length);
ptr += 2;
char load_mem[3]; load_mem[2] ='\0';
int load_i_mem;
for(i=0; (strlen(buff)-9)/2 > i ; i++)
{
strncpy(load_mem,ptr,2);
sscanf(load_mem,"%X",&load_i_mem);
ptr += 2;
addr_line = (load_i_start_address + i)/16;
addr_column = (load_i_start_address + i)%16;
mem[addr_line][addr_column] = load_i_mem;
if( i > load_i_length)
printf("[Load error] Text record length error!\n %d",i);
}
ptr = NULL;
}
if(buff[0] == 'R' && end_flag == 0)
{
for(i=2; 10>i; i++)
for(j=0; 7>j; j++)
out_defined[i][j] = '\0'; // initalize
ptr = buff+1;
for(i=0; (strlen(buff))/8 >i; i++)
{
char number[3]; number[2] = '\0';
int number_i;
strncpy(number,ptr,2);
sscanf(number,"%d",&number_i);
ptr += 2;
char name[7]; name[6] = '\0';
strncpy(name,ptr,6);
if(name[strlen(name)-1]=='\n' || name[strlen(name)-1]=='\r')
{
name[strlen(name)-1]=32;
name[strlen(name)]=32;
}
for(j=0 ; j<7; j++){ out_defined[number_i][j] = name[j]; }
//printf("%d %d %s\n",strlen(buff),number_i,name);
ptr += 6;
}
ptr = NULL;
}
if(buff[0] == 'M' && end_flag == 0)
{
ptr = buff+1;
char load_modify_record[7]; load_modify_record[6] = '\0';
int load_i_modify_record;
strncpy(load_modify_record,ptr,6);
sscanf(load_modify_record,"%X",&load_i_modify_record);
load_i_modify_record += address;
// modify_i_record
ptr += 8;
char type[1];
strncpy(type,ptr,1);
// type = '+'/ '-'
ptr += 1;
char index[3]; index[2] = '\0';
int index_i;
strncpy(index,ptr,2);
sscanf(index,"%d",&index_i);
// index is used to find [out_defined[10][7]]
int result = 0;
unsigned int result2 =0;
if (type[0] == '+')
{
if(find_symbol_address(out_defined[index_i]) != -1)
{
addr_line = (load_i_modify_record+1)/16;
addr_column = (load_i_modify_record+1)%16;
result += (mem[addr_line][addr_column]*256);
addr_line = (load_i_modify_record+2)/16;
addr_column = (load_i_modify_record+2)%16;
result += (mem[addr_line][addr_column]);
result += (find_symbol_address(out_defined[index_i])+address);
result2 = (unsigned int) result;
result2 = result2%65536;
addr_line = (load_i_modify_record+1)/16;
addr_column = (load_i_modify_record+1)%16;
mem[addr_line][addr_column] = result2/256;
// printf("%02X",mem[addr_line][addr_column]);
addr_line = (load_i_modify_record+2)/16;
addr_column = (load_i_modify_record+2)%16;
mem[addr_line][addr_column] = result2%256;
// printf("%02X\n",mem[addr_line][addr_column]);
}
else
printf("[Loader] Cannot found symbol!\n");
}
else if (type[0] == '-')
{
if(find_symbol_address(out_defined[index_i]) != -1)
{
addr_line = (load_i_modify_record+1)/16;
addr_column = (load_i_modify_record+1)%16;
result += (mem[addr_line][addr_column]*256);
addr_line = (load_i_modify_record+2)/16;
addr_column = (load_i_modify_record+2)%16;
result += (mem[addr_line][addr_column]);
result -= (find_symbol_address(out_defined[index_i])+address);
result2 = (unsigned int) result;
result2 = result2%65536;
addr_line = (load_i_modify_record+1)/16;
addr_column = (load_i_modify_record+1)%16;
mem[addr_line][addr_column] = result2/256;
// printf("%02X",mem[addr_line][addr_column]);
addr_line = (load_i_modify_record+2)/16;
addr_column = (load_i_modify_record+2)%16;
mem[addr_line][addr_column] = result2%256;
// printf("%02X\n",mem[addr_line][addr_column]);
}
else
printf("[Loader] Cannot found symbol!\n");
}
else
printf("[Loader] Operator assignment error!\n");
// printf("%d %s %X\n",index_i,out_defined[index_i],find_symbol_address(out_defined[index_i])+address);
ptr = NULL;
}
if(buff[0] == 'E')
end_flag = 1;
if((buff[0] != 'H') && (buff[0] != 'D') && (buff[0] != 'R') && (buff[0] != '.') && (buff[0] != 'T') && (buff[0] != 'M') && (buff[0] != 'E'))
printf("\t\t\t[Loader error] Unexpected text into the object code! '%c'\n",buff[0]);
}
fclose(fp);
fclose(fp2);
}
return 0;
}
This program operate beneath procedure
1. set progaddr to start address(default value is 0)
2. set loader PROGRAM_NAME.obj file to load.
3. Check memory well uploaded into array(in 20081610.c)
4. repeat 1 to 3.
5. quit command
However, when I type quit or loader set over and over again(2 or 5 command repeatedly), this program occurres 'glibc detecting' error.
*The only case that error does not occurred is time when I did not set up progaddr(Just using default value). When I modify progaddr(procedure 1), glibc error occurred.
How can I solve this problem? | 1 |
8,975,301 | 01/23/2012 16:48:21 | 1,165,379 | 01/23/2012 16:36:46 | 1 | 0 | A function that takes one of two child classes and calls the same function on them | I have two classes that both extend a parent class. I want to write a function that can take either class but calls the childs function.
i.e.:
class employee
{
public:
employee();
virtual ~employee();
int wage;
int hours;
virtual int calculatePay() =0;
};
class factoryWorker : public employee
{
public:
factoryWorker();
int calculatePay();
};
class manager : public employee
{
public:
manager();
int calculatePay();
};
in the main.cpp file I have a function
int getPay(employee anyTypeOfWorker) {
return anyTypeOfWorker.calculatePay();
}
But this function always calls the parent (employee) calculatePay() function not the overriden functions.
Thanks. | c++ | class | inheritance | object | null | null | open | A function that takes one of two child classes and calls the same function on them
===
I have two classes that both extend a parent class. I want to write a function that can take either class but calls the childs function.
i.e.:
class employee
{
public:
employee();
virtual ~employee();
int wage;
int hours;
virtual int calculatePay() =0;
};
class factoryWorker : public employee
{
public:
factoryWorker();
int calculatePay();
};
class manager : public employee
{
public:
manager();
int calculatePay();
};
in the main.cpp file I have a function
int getPay(employee anyTypeOfWorker) {
return anyTypeOfWorker.calculatePay();
}
But this function always calls the parent (employee) calculatePay() function not the overriden functions.
Thanks. | 0 |
7,951,210 | 10/31/2011 08:15:04 | 452,046 | 09/19/2010 17:26:16 | 33 | 3 | Scrollable ExtJS driven layout | I'm working on project with heavy usage of ExtJS lib and so far as i'm not really good in pure CSS crossbrowser layout developing, i decide to use ExtJS layouts for robust markup prototyping. There is only one problem -- i can't figure out how to make my pages scrollable, like in traditional sites. ExtJS just clips any content overflowing browser viewport, "autoScroll: true" makes no effect. | layout | extjs | extjs4 | null | null | null | open | Scrollable ExtJS driven layout
===
I'm working on project with heavy usage of ExtJS lib and so far as i'm not really good in pure CSS crossbrowser layout developing, i decide to use ExtJS layouts for robust markup prototyping. There is only one problem -- i can't figure out how to make my pages scrollable, like in traditional sites. ExtJS just clips any content overflowing browser viewport, "autoScroll: true" makes no effect. | 0 |
11,500,019 | 07/16/2012 07:43:30 | 1,528,154 | 07/16/2012 07:19:24 | 1 | 0 | How to insert data in sales_flat_order from sales_flat_quote | I read lots of links but not get exact answer.
I read this (http://www.magentocommerce.com/boards/viewthread/283903/#t393390) link.
Problem is my data goes to "sales_flat_quote" Table but not insert into "sales_flat_order"
table when checkout the cart.
| magento-1.5 | null | null | null | null | null | open | How to insert data in sales_flat_order from sales_flat_quote
===
I read lots of links but not get exact answer.
I read this (http://www.magentocommerce.com/boards/viewthread/283903/#t393390) link.
Problem is my data goes to "sales_flat_quote" Table but not insert into "sales_flat_order"
table when checkout the cart.
| 0 |
7,073,897 | 08/16/2011 05:18:22 | 140,962 | 07/19/2009 13:46:21 | 243 | 0 | Windows application or website | I want to write a warehouse program which has near 80 clients.My program has to make some reports and control entrance and exit of commodities in warehouse and store data in SQL Server Database.I need to know that which one is better: using windows application which give me a lot of feathers or creating website which reduce my ability in using objects?I have to mention that my clients will not increase. | c# | asp.net | vb.net | architecture | null | 08/18/2011 01:16:32 | not a real question | Windows application or website
===
I want to write a warehouse program which has near 80 clients.My program has to make some reports and control entrance and exit of commodities in warehouse and store data in SQL Server Database.I need to know that which one is better: using windows application which give me a lot of feathers or creating website which reduce my ability in using objects?I have to mention that my clients will not increase. | 1 |
4,072,869 | 11/01/2010 20:42:20 | 365,560 | 06/13/2010 06:36:31 | 11 | 2 | How to determine direction of rotation in CSS3 transitions? | I'd like to rotate an object from -180 degrees to 180 degrees via CSS3 transforms and transitions. This works fine, but I'd like to control the direction of rotation. How to determine if it will be going clockwise or counter clockwise? | css | css3 | null | null | null | null | open | How to determine direction of rotation in CSS3 transitions?
===
I'd like to rotate an object from -180 degrees to 180 degrees via CSS3 transforms and transitions. This works fine, but I'd like to control the direction of rotation. How to determine if it will be going clockwise or counter clockwise? | 0 |
9,640,657 | 03/09/2012 20:38:12 | 1,016,807 | 10/27/2011 15:32:36 | 8 | 0 | Reading function from a file in Fortran 90 | I have an optimization solver in Fortran 90. So, if I want to change the objective function
I have to modified the main file and write the objective function in this way:
subroutine fobj(n,x,f)
implicit none
integer :: n
real(8) :: f
real(8) :: x(n)
intent(in ) :: n,x
intent(out) :: f
!OBJECTIVE FUNCTION
f = x(1)**2-x(2)+2*x(3)
end subroutine fobj
I have a big objective function, so I want to call this line "f = x(1)**2-x(2)+2*x(3)" from an external file or at least the subrutine.
Is that possible? (I'm new in Fortran.)
I know that I can modified the file with Python, but I want to do it in other file.
Thanks a lot!
| fortran90 | null | null | null | null | null | open | Reading function from a file in Fortran 90
===
I have an optimization solver in Fortran 90. So, if I want to change the objective function
I have to modified the main file and write the objective function in this way:
subroutine fobj(n,x,f)
implicit none
integer :: n
real(8) :: f
real(8) :: x(n)
intent(in ) :: n,x
intent(out) :: f
!OBJECTIVE FUNCTION
f = x(1)**2-x(2)+2*x(3)
end subroutine fobj
I have a big objective function, so I want to call this line "f = x(1)**2-x(2)+2*x(3)" from an external file or at least the subrutine.
Is that possible? (I'm new in Fortran.)
I know that I can modified the file with Python, but I want to do it in other file.
Thanks a lot!
| 0 |
3,941,793 | 10/15/2010 11:30:05 | 104,021 | 05/09/2009 10:18:32 | 2,651 | 104 | What is guaranteed about the size of a function pointer? | In C, I need to know the size of a struct, which has function pointers in it. Can I be guaranteed that on all platforms and architectures:
- the size of a void* is the same size as a function pointer?
- the size of the function pointer does not differ due to its return type?
- the size of the function pointer does not differ due to its parameter types?
I assume the answer is yes to all of these, but I want to be sure. For context, I'm calling `sizeof(struct mystruct)` and nothing more. | c | pointers | type-conversion | function-pointers | sizeof | null | open | What is guaranteed about the size of a function pointer?
===
In C, I need to know the size of a struct, which has function pointers in it. Can I be guaranteed that on all platforms and architectures:
- the size of a void* is the same size as a function pointer?
- the size of the function pointer does not differ due to its return type?
- the size of the function pointer does not differ due to its parameter types?
I assume the answer is yes to all of these, but I want to be sure. For context, I'm calling `sizeof(struct mystruct)` and nothing more. | 0 |
10,230,977 | 04/19/2012 15:02:32 | 1,323,990 | 04/10/2012 11:57:52 | 1 | 0 | Color based pattern matching | How do i identify patterns based on their colour, using matlab? For example, my template and source image may have the same pattern but of different color. I need to make the system sensitive to color in addition to identifying the pattern. Please help. | matlab | colors | design-patterns | matching | null | 04/20/2012 15:08:46 | not a real question | Color based pattern matching
===
How do i identify patterns based on their colour, using matlab? For example, my template and source image may have the same pattern but of different color. I need to make the system sensitive to color in addition to identifying the pattern. Please help. | 1 |
1,621,744 | 10/25/2009 19:07:54 | 196,279 | 10/25/2009 19:02:41 | 1 | 0 | CoreAnimation doesn't work with -setAlphaValue on QTMovieView | I have some basic code for adding a QTMovieView. I want it to fade in, so I add an animation on setAlphaValue. Only issue is that it doesn't work. The alpha value is instantly set to whatever it was supposed to animate to. If I try animating e.g. setFrame: it works fine. You'll find my code below. This is on 10.5.7 with the Mac OS X 10.5 SDK.
- (id)addMovie:(NSString *)aFile
{
QTMovieView *aMovieView;
QTMovie *aMovie;
NSRect contentFrame;
contentFrame = [[self contentView] frame];
aMovieView = [[QTMovieView alloc]
initWithFrame:contentFrame];
[aMovieView setWantsLayer:YES];
[aMovieView setControllerVisible:NO];
[aMovieView setPreservesAspectRatio:YES];
aMovie = [[QTMovie alloc]
initWithFile:aFile error:nil];
[aMovieView setMovie:aMovie];
[aMovieView setAlphaValue:0.4];
[[self contentView] addSubview:aMovieView];
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:2.0];
[[aMovieView animator] setAlphaValue:0.9];
[NSAnimationContext endGrouping];
}
Any ideas?
| cocoa | core-animation | null | null | null | null | open | CoreAnimation doesn't work with -setAlphaValue on QTMovieView
===
I have some basic code for adding a QTMovieView. I want it to fade in, so I add an animation on setAlphaValue. Only issue is that it doesn't work. The alpha value is instantly set to whatever it was supposed to animate to. If I try animating e.g. setFrame: it works fine. You'll find my code below. This is on 10.5.7 with the Mac OS X 10.5 SDK.
- (id)addMovie:(NSString *)aFile
{
QTMovieView *aMovieView;
QTMovie *aMovie;
NSRect contentFrame;
contentFrame = [[self contentView] frame];
aMovieView = [[QTMovieView alloc]
initWithFrame:contentFrame];
[aMovieView setWantsLayer:YES];
[aMovieView setControllerVisible:NO];
[aMovieView setPreservesAspectRatio:YES];
aMovie = [[QTMovie alloc]
initWithFile:aFile error:nil];
[aMovieView setMovie:aMovie];
[aMovieView setAlphaValue:0.4];
[[self contentView] addSubview:aMovieView];
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:2.0];
[[aMovieView animator] setAlphaValue:0.9];
[NSAnimationContext endGrouping];
}
Any ideas?
| 0 |
11,611,431 | 07/23/2012 11:15:52 | 377,192 | 06/27/2010 00:09:21 | 171 | 14 | sonata admin bundle: nested set | I have entity Location that is nested-set and it will have about 6 million records. Entity Property is many to one with Location.
Unfortunatelly, sonata doesn't suport nested set. So instead of having <select> with 6mill options, is there a way I could implement auto-completion for that field? | symfony-2.0 | nested-sets | sonata-admin | null | null | null | open | sonata admin bundle: nested set
===
I have entity Location that is nested-set and it will have about 6 million records. Entity Property is many to one with Location.
Unfortunatelly, sonata doesn't suport nested set. So instead of having <select> with 6mill options, is there a way I could implement auto-completion for that field? | 0 |
8,328,995 | 11/30/2011 16:04:25 | 683,984 | 03/30/2011 13:26:14 | 418 | 36 | How to delete an inode reference. Linux | I'm a linux beginner and I managed somehow to screw up the file system on my device.
First of all my config is: BusyBox v1.15.0 running on i.MX28 EVK board.
How I got into trouble:
I've created a little TCP server application that was listening to a port for incoming connections. This listen procedure was in new thread in`while(1){...}` so I've closed the application by pressing **ctr+z**.
After this I removed the file with "rm" and this is when the problem appeared. The file was deleted but the application was still running.
Now every time I "ls" I'm getting this error:
~$ ls
EXT2-fs (mmcblk0p3):
error: ext2_lookup: deleted inode referenced: 106338
ls: ./hi: Input/output error
ha hello scr
The name of my app was "hi".
I've tried to restart my board but that dint help.
Any help will be highly appreciated.
If you need more details please let me know.
Thanks
| linux | filesystems | null | null | null | 11/30/2011 16:36:28 | off topic | How to delete an inode reference. Linux
===
I'm a linux beginner and I managed somehow to screw up the file system on my device.
First of all my config is: BusyBox v1.15.0 running on i.MX28 EVK board.
How I got into trouble:
I've created a little TCP server application that was listening to a port for incoming connections. This listen procedure was in new thread in`while(1){...}` so I've closed the application by pressing **ctr+z**.
After this I removed the file with "rm" and this is when the problem appeared. The file was deleted but the application was still running.
Now every time I "ls" I'm getting this error:
~$ ls
EXT2-fs (mmcblk0p3):
error: ext2_lookup: deleted inode referenced: 106338
ls: ./hi: Input/output error
ha hello scr
The name of my app was "hi".
I've tried to restart my board but that dint help.
Any help will be highly appreciated.
If you need more details please let me know.
Thanks
| 2 |
11,472,977 | 07/13/2012 14:55:05 | 1,523,719 | 07/13/2012 13:45:06 | 1 | 0 | Requirements to start up Software and Web development firm/ | ..
I am starting up a software and web development firm which will mainly deal with *(for now/ to start with)* development of **Java applications** and **web development**.
I want to know the infrastructural and **hardware / software** requirements that will be required for such development tasks. | web | hardware | startup | requirements | infrastructure | 07/14/2012 05:10:29 | off topic | Requirements to start up Software and Web development firm/
===
..
I am starting up a software and web development firm which will mainly deal with *(for now/ to start with)* development of **Java applications** and **web development**.
I want to know the infrastructural and **hardware / software** requirements that will be required for such development tasks. | 2 |
11,383,521 | 07/08/2012 13:29:07 | 1,510,057 | 07/08/2012 13:18:39 | 1 | 0 | How to share google photo album link in mobile version? | After I uploaded an album from picasa, I choose to share link only for a few friends.
When I opened the link in my laptop, it shows the google+ page in desktop version and it works perfectly.
Then, when I tried the link in mobile devices(iPod), it shows the desktop version of the album site and it is quite difficult to browse those photos in desktop version on the ipod. Is there any way to share the link in mobile version? | mobile | google-plus | null | null | null | 07/09/2012 01:44:46 | off topic | How to share google photo album link in mobile version?
===
After I uploaded an album from picasa, I choose to share link only for a few friends.
When I opened the link in my laptop, it shows the google+ page in desktop version and it works perfectly.
Then, when I tried the link in mobile devices(iPod), it shows the desktop version of the album site and it is quite difficult to browse those photos in desktop version on the ipod. Is there any way to share the link in mobile version? | 2 |
11,387,951 | 07/09/2012 00:49:01 | 1,485,790 | 06/27/2012 13:26:16 | 1 | 0 | Flash smart preloader. Possible? | I'm trying to make some kind of "smart mp3 music loader", which will not use a lot of bandwidth. I want to load a certain length buffer (about 0.5mb), and when the music plays, keep loading data to it (but not to load all song's 15mb, so if user skip this song at first seconds, 0.5mb of bandwidth will be used, not 15mb).
Is it possible to make it somehow?
Sorry for bad english... | flash | null | null | null | null | 07/09/2012 15:13:46 | not a real question | Flash smart preloader. Possible?
===
I'm trying to make some kind of "smart mp3 music loader", which will not use a lot of bandwidth. I want to load a certain length buffer (about 0.5mb), and when the music plays, keep loading data to it (but not to load all song's 15mb, so if user skip this song at first seconds, 0.5mb of bandwidth will be used, not 15mb).
Is it possible to make it somehow?
Sorry for bad english... | 1 |
10,695,633 | 05/22/2012 04:12:34 | 1,388,555 | 05/11/2012 03:58:37 | 1 | 0 | ANR keyDispatchingTimedOut in Android | DALVIK THREADS:
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2aae0900 self=0xcec8
| sysTid=4608 nice=0 sched=0/0 cgrp=default handle=1876209304
at android.media.MediaPlayer.setDataSource(Native Method)
at android.media.MediaPlayer.create(MediaPlayer.java:662)
at org.android.PeruLink.android_PeruLink.createSoundEffectPlayerAndPlaySound(android_PeruLink.java:368)
at org.android.PeruLink.android_PeruLink.onClick(android_PeruLink.java:745)
at android.view.View.performClick(View.java:2414)
at android.view.View$PerformClick.run(View.java:8838)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4680)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
"Binder Thread #3" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2fed0158 self=0x13eed8
| sysTid=4620 nice=0 sched=0/0 cgrp=default handle=3163808
at dalvik.system.NativeStart.run(Native Method)
"DispatcherThread" prio=5 tid=10 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe975a8 self=0x2f3848
| sysTid=4618 nice=0 sched=0/0 cgrp=default handle=3094920
at java.lang.Object.wait(Native Method)
- waiting on <0x2fe9bf38> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:146)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)
"Thread-10" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe858b8 self=0x2ad978
| sysTid=4617 nice=0 sched=0/0 cgrp=default handle=2741680
at dalvik.system.NativeStart.run(Native Method)
"CookieSyncManager" prio=5 tid=8 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe86888 self=0x145e90
| sysTid=4616 nice=10 sched=0/0 cgrp=bg_non_interactive handle=2597608
at java.lang.Object.wait(Native Method)
- waiting on <0x2fe74bc0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:326)
at android.os.MessageQueue.next(MessageQueue.java:142)
at android.os.Looper.loop(Looper.java:110)
at android.webkit.WebSyncManager.run(WebSyncManager.java:90)
at java.lang.Thread.run(Thread.java:1096)
"WebViewCoreThread" prio=5 tid=7 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe817f8 self=0x262ff8
| sysTid=4614 nice=0 sched=0/0 cgrp=default handle=2502968
at java.lang.Object.wait(Native Method)
- waiting on <0x2fe81ae0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:146)
at android.os.Looper.loop(Looper.java:110)
at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:665)
at java.lang.Thread.run(Thread.java:1096)
"Binder Thread #2" prio=5 tid=6 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe553c0 self=0x134580
| sysTid=4613 nice=0 sched=0/0 cgrp=default handle=1267984
at dalvik.system.NativeStart.run(Native Method)
"Binder Thread #1" prio=5 tid=5 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe55300 self=0x12d7b8
| sysTid=4612 nice=0 sched=0/0 cgrp=default handle=1241448
at dalvik.system.NativeStart.run(Native Method)
"Compiler" daemon prio=5 tid=4 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x2fe4e2a0 self=0x134a10
| sysTid=4611 nice=0 sched=0/0 cgrp=default handle=1299968
at dalvik.system.NativeStart.run(Native Method)
"Signal Catcher" daemon prio=5 tid=3 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x2fe4e1e8 self=0x133c60
| sysTid=4610 nice=0 sched=0/0 cgrp=default handle=1287176
at dalvik.system.NativeStart.run(Native Method)
"HeapWorker" daemon prio=5 tid=2 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x2e704b58 self=0x12f010
| sysTid=4609 nice=0 sched=0/0 cgrp=default handle=1275152
at dalvik.system.NativeStart.run(Native Method)
There is not much details that I can give since I have not dealt with this issues before, it is a freeze and i would like to know how to handle and fix this issue. It says that the cause is ANR keyDispatchingTimedOut | android | android-anr-dialog | null | null | null | null | open | ANR keyDispatchingTimedOut in Android
===
DALVIK THREADS:
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2aae0900 self=0xcec8
| sysTid=4608 nice=0 sched=0/0 cgrp=default handle=1876209304
at android.media.MediaPlayer.setDataSource(Native Method)
at android.media.MediaPlayer.create(MediaPlayer.java:662)
at org.android.PeruLink.android_PeruLink.createSoundEffectPlayerAndPlaySound(android_PeruLink.java:368)
at org.android.PeruLink.android_PeruLink.onClick(android_PeruLink.java:745)
at android.view.View.performClick(View.java:2414)
at android.view.View$PerformClick.run(View.java:8838)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4680)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
"Binder Thread #3" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2fed0158 self=0x13eed8
| sysTid=4620 nice=0 sched=0/0 cgrp=default handle=3163808
at dalvik.system.NativeStart.run(Native Method)
"DispatcherThread" prio=5 tid=10 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe975a8 self=0x2f3848
| sysTid=4618 nice=0 sched=0/0 cgrp=default handle=3094920
at java.lang.Object.wait(Native Method)
- waiting on <0x2fe9bf38> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:146)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)
"Thread-10" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe858b8 self=0x2ad978
| sysTid=4617 nice=0 sched=0/0 cgrp=default handle=2741680
at dalvik.system.NativeStart.run(Native Method)
"CookieSyncManager" prio=5 tid=8 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe86888 self=0x145e90
| sysTid=4616 nice=10 sched=0/0 cgrp=bg_non_interactive handle=2597608
at java.lang.Object.wait(Native Method)
- waiting on <0x2fe74bc0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:326)
at android.os.MessageQueue.next(MessageQueue.java:142)
at android.os.Looper.loop(Looper.java:110)
at android.webkit.WebSyncManager.run(WebSyncManager.java:90)
at java.lang.Thread.run(Thread.java:1096)
"WebViewCoreThread" prio=5 tid=7 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe817f8 self=0x262ff8
| sysTid=4614 nice=0 sched=0/0 cgrp=default handle=2502968
at java.lang.Object.wait(Native Method)
- waiting on <0x2fe81ae0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:146)
at android.os.Looper.loop(Looper.java:110)
at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:665)
at java.lang.Thread.run(Thread.java:1096)
"Binder Thread #2" prio=5 tid=6 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe553c0 self=0x134580
| sysTid=4613 nice=0 sched=0/0 cgrp=default handle=1267984
at dalvik.system.NativeStart.run(Native Method)
"Binder Thread #1" prio=5 tid=5 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x2fe55300 self=0x12d7b8
| sysTid=4612 nice=0 sched=0/0 cgrp=default handle=1241448
at dalvik.system.NativeStart.run(Native Method)
"Compiler" daemon prio=5 tid=4 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x2fe4e2a0 self=0x134a10
| sysTid=4611 nice=0 sched=0/0 cgrp=default handle=1299968
at dalvik.system.NativeStart.run(Native Method)
"Signal Catcher" daemon prio=5 tid=3 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x2fe4e1e8 self=0x133c60
| sysTid=4610 nice=0 sched=0/0 cgrp=default handle=1287176
at dalvik.system.NativeStart.run(Native Method)
"HeapWorker" daemon prio=5 tid=2 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x2e704b58 self=0x12f010
| sysTid=4609 nice=0 sched=0/0 cgrp=default handle=1275152
at dalvik.system.NativeStart.run(Native Method)
There is not much details that I can give since I have not dealt with this issues before, it is a freeze and i would like to know how to handle and fix this issue. It says that the cause is ANR keyDispatchingTimedOut | 0 |
8,446,589 | 12/09/2011 14:03:02 | 52,420 | 01/07/2009 13:07:08 | 1,305 | 9 | How to comminicate two classes? | <p>Hi; i want to communicate 2 clases eachother. i want to add a dictionary add items.i simplified my pattern to solve it easly.How to use dic to add new item.</p>
<b>i want to generate only one instance from MyClass.it is important. this is a kind of a trick...</b>
<pre><code>
public interface IHost
{
}
public class MyClass:IHost
{
public Dictionary<int,string> dic { get; set;}
public MyClass()
{
dic = new Dictionary<int,string>();
}
}
public class MyClass2 : IHost
{
public MyClass()
{
}
public void Save()
{
dic.Add(1,"vxcvcx"); // Error : The name 'dic' does not exist in the current context
}
}
</code></pre>
Error:
The name 'dic' does not exist in the current context | c# | .net | design-patterns | null | null | 12/09/2011 20:10:24 | not a real question | How to comminicate two classes?
===
<p>Hi; i want to communicate 2 clases eachother. i want to add a dictionary add items.i simplified my pattern to solve it easly.How to use dic to add new item.</p>
<b>i want to generate only one instance from MyClass.it is important. this is a kind of a trick...</b>
<pre><code>
public interface IHost
{
}
public class MyClass:IHost
{
public Dictionary<int,string> dic { get; set;}
public MyClass()
{
dic = new Dictionary<int,string>();
}
}
public class MyClass2 : IHost
{
public MyClass()
{
}
public void Save()
{
dic.Add(1,"vxcvcx"); // Error : The name 'dic' does not exist in the current context
}
}
</code></pre>
Error:
The name 'dic' does not exist in the current context | 1 |
11,039,595 | 06/14/2012 18:56:45 | 1,119,631 | 12/28/2011 16:04:44 | 11 | 0 | How to make image link(it doesn't work and i don't know why)? | My image link doesn't work and i don't know how to make it work
HTML CODE:
<a href="mainp.html" ><img src="logo.jpg" class = "headpic" height = "120"></a>
CSS CODE:
.headpic {
left:50%;
margin-left:-405px;
width: 810px;
position: absolute;
} | html | css | null | null | null | 06/16/2012 13:52:38 | too localized | How to make image link(it doesn't work and i don't know why)?
===
My image link doesn't work and i don't know how to make it work
HTML CODE:
<a href="mainp.html" ><img src="logo.jpg" class = "headpic" height = "120"></a>
CSS CODE:
.headpic {
left:50%;
margin-left:-405px;
width: 810px;
position: absolute;
} | 3 |
5,337,683 | 03/17/2011 10:16:21 | 644,891 | 03/04/2011 14:33:50 | 23 | 0 | How to SET extended file properties? | I am talking about properties you see in file properties->summary (Author, Title, etc) I already know how to GET them by using shell32.dll class, and I asumed that I could also SET them with the same class, but it seems like writing extended properties is a little bit more difficult and shell32.dll doesn't allow to do that. I was unable to find a clear solution for SETTING properties (though there are a lot about getting them).
Also found something about taglib-sharp, which seems to have an option to SET extended properties, but I don't really understand how it works. Maybe there are better solutions than that.
If it helps, I need to SET value only for Company field for some Word, .pdf documents. | c# | shell32 | null | null | null | null | open | How to SET extended file properties?
===
I am talking about properties you see in file properties->summary (Author, Title, etc) I already know how to GET them by using shell32.dll class, and I asumed that I could also SET them with the same class, but it seems like writing extended properties is a little bit more difficult and shell32.dll doesn't allow to do that. I was unable to find a clear solution for SETTING properties (though there are a lot about getting them).
Also found something about taglib-sharp, which seems to have an option to SET extended properties, but I don't really understand how it works. Maybe there are better solutions than that.
If it helps, I need to SET value only for Company field for some Word, .pdf documents. | 0 |
7,641,253 | 10/03/2011 22:10:03 | 410,065 | 08/03/2010 19:32:44 | 425 | 0 | Website for mobile, code and deisgn | Can you give me some tips about how should be a design of mobile website and then how to code it? there are some unique tags? I mean a website (http) for smartphones. | mobile | phone | smartphone | null | null | 10/04/2011 13:40:32 | not constructive | Website for mobile, code and deisgn
===
Can you give me some tips about how should be a design of mobile website and then how to code it? there are some unique tags? I mean a website (http) for smartphones. | 4 |
6,019,179 | 05/16/2011 14:52:05 | 755,846 | 05/16/2011 14:52:05 | 1 | 0 | Has anyone had much success recently using the Cappuccino Framework? | I'm just creating my first project in Cappuccino without a lot of success. Looking for examples and documentation, there isn't a lot out there...
The differences from real Objective-C and the lack of libraries mean you cannot easily convert code directly from say a OS X desktop app. to Cappuccino.
As an experienced PHP, and RoR developer (besides the Java, VB, VC.....) I can't quite see the logic of abstracting/wrapping JavaScript in another language.
Any comments or suggestions for a more efficient framework? | frameworks | cappuccino | null | null | null | null | open | Has anyone had much success recently using the Cappuccino Framework?
===
I'm just creating my first project in Cappuccino without a lot of success. Looking for examples and documentation, there isn't a lot out there...
The differences from real Objective-C and the lack of libraries mean you cannot easily convert code directly from say a OS X desktop app. to Cappuccino.
As an experienced PHP, and RoR developer (besides the Java, VB, VC.....) I can't quite see the logic of abstracting/wrapping JavaScript in another language.
Any comments or suggestions for a more efficient framework? | 0 |
1,781,548 | 11/23/2009 07:15:00 | 193,560 | 10/21/2009 04:37:45 | 2 | 0 | please can anyone check this code for image uploading | Hi i want to upload only images getting some problem with this please can anyone check below code
<?php
$target_path = "../test/sites/default/files/ourfiles/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists($_FILES['file']['name']))
{
echo $_FILES['file']['name'] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
$target_path);
echo "Stored in: " . basename( $_FILES['uploadedfile']['name']);
}
}
}
else
{
echo "Invalid file";
}
?> | php | mysql | null | null | null | 05/12/2010 19:28:41 | not a real question | please can anyone check this code for image uploading
===
Hi i want to upload only images getting some problem with this please can anyone check below code
<?php
$target_path = "../test/sites/default/files/ourfiles/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists($_FILES['file']['name']))
{
echo $_FILES['file']['name'] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
$target_path);
echo "Stored in: " . basename( $_FILES['uploadedfile']['name']);
}
}
}
else
{
echo "Invalid file";
}
?> | 1 |
10,534,013 | 05/10/2012 12:28:30 | 1,150,590 | 01/15/2012 16:38:26 | 8 | 0 | YQL (Yahoo Query Language) sort by date | I am trying to retrieve a particular attachment type (say 2500 such mails exist) from 01 Jan 2005 using YQL . The search statement is as follows:
SELECT hits FROM ymail.search WHERE attachmenttypes="pdf" and date-start = 1104537600
The result always starts from the latest mail. If I use the sort function as follows:
SELECT hits FROM ymail.search WHERE attachmenttypes="pdf" and date-start = 1104537600 | sort(field="hits.date", descending = "false")
the result is sorted but only a part of the total rows is returned. So 2 questions:
1) How do I request rows ordered by date?
2) Is there a way to retrieve all the rows at once? The documentation says we can retrieve 5000 rows at once <http://developer.yahoo.com/yql/guide/paging.html> . But this does not seem to be true. Even if I add "count = 3000" to the statement, still only a part of the total rows are returned. | yahoo | yql | null | null | null | null | open | YQL (Yahoo Query Language) sort by date
===
I am trying to retrieve a particular attachment type (say 2500 such mails exist) from 01 Jan 2005 using YQL . The search statement is as follows:
SELECT hits FROM ymail.search WHERE attachmenttypes="pdf" and date-start = 1104537600
The result always starts from the latest mail. If I use the sort function as follows:
SELECT hits FROM ymail.search WHERE attachmenttypes="pdf" and date-start = 1104537600 | sort(field="hits.date", descending = "false")
the result is sorted but only a part of the total rows is returned. So 2 questions:
1) How do I request rows ordered by date?
2) Is there a way to retrieve all the rows at once? The documentation says we can retrieve 5000 rows at once <http://developer.yahoo.com/yql/guide/paging.html> . But this does not seem to be true. Even if I add "count = 3000" to the statement, still only a part of the total rows are returned. | 0 |
10,881,455 | 06/04/2012 12:40:26 | 687,732 | 04/01/2011 14:11:50 | 36 | 0 | Receiving memory leak | I am new to iPhone Development.
I am displaying lots of images on view.also i put button named LOAD MORE for more images.I am also downloading images on LOAD MORE event.
Here is my code:`-(void)btnLoadMorePressed
{
[appdelegate showLoader:MBProgressHUDModeIndeterminate];
RequestResponseManager *requestManager=[RequestResponseManager sharedInstance];
[requestManager setRequestPropery:self ExtraInfo:nil];
Album *album=[appdelegate.CurrentUser.albumListarray objectAtIndex:indexNum-1];
NSArray *obj_keys = [NSArray arrayWithObjects:@"UserId",@"AlbumId",@"SessionId",@"PageNo",@"ModMethod", nil];
NSArray *objects = [NSArray arrayWithObjects:appdelegate.CurrentUser.userId,album.AlbumId,appdelegate.sessionId,[NSString stringWithFormat:@"%d",currentPage],@"getPhotoListByAlbumId",nil];
NSDictionary *jsonDictionary = [NSDictionary dictionaryWithObjects:objects forKeys:obj_keys];
NSString *jsonString = [jsonDictionary JSONRepresentation];
NSString *requestString=[NSString stringWithFormat:@"data=%@",jsonString];
currentRequest=JGetAlbumPhotoList;
[requestManager sendPostHttpRequest:GET_USER_ALBUM_PHOTO_URL RequestType:JGetAlbumPhotoList PostContent:requestString];
}`
but when i am trying to fetch more images,it gives me memory warning and then suddenly crashing.please help me.thanking you... | iphone | null | null | null | null | null | open | Receiving memory leak
===
I am new to iPhone Development.
I am displaying lots of images on view.also i put button named LOAD MORE for more images.I am also downloading images on LOAD MORE event.
Here is my code:`-(void)btnLoadMorePressed
{
[appdelegate showLoader:MBProgressHUDModeIndeterminate];
RequestResponseManager *requestManager=[RequestResponseManager sharedInstance];
[requestManager setRequestPropery:self ExtraInfo:nil];
Album *album=[appdelegate.CurrentUser.albumListarray objectAtIndex:indexNum-1];
NSArray *obj_keys = [NSArray arrayWithObjects:@"UserId",@"AlbumId",@"SessionId",@"PageNo",@"ModMethod", nil];
NSArray *objects = [NSArray arrayWithObjects:appdelegate.CurrentUser.userId,album.AlbumId,appdelegate.sessionId,[NSString stringWithFormat:@"%d",currentPage],@"getPhotoListByAlbumId",nil];
NSDictionary *jsonDictionary = [NSDictionary dictionaryWithObjects:objects forKeys:obj_keys];
NSString *jsonString = [jsonDictionary JSONRepresentation];
NSString *requestString=[NSString stringWithFormat:@"data=%@",jsonString];
currentRequest=JGetAlbumPhotoList;
[requestManager sendPostHttpRequest:GET_USER_ALBUM_PHOTO_URL RequestType:JGetAlbumPhotoList PostContent:requestString];
}`
but when i am trying to fetch more images,it gives me memory warning and then suddenly crashing.please help me.thanking you... | 0 |
5,837,761 | 04/29/2011 21:50:35 | 78,687 | 03/16/2009 17:14:33 | 176 | 6 | SCHTASKS - how to properly quote file path | I'm writing a small app that generates the contents of a batch file, using SCHTASKS to create scheduled tasks. However, I simply cannot get the file path working correctly. I need another set of eyes.
SCHTASKS /CREATE /TN "TASK1" /TR "\"C:\Program_Files\Spybot - Search & Destroy\SpybotSD.exe\" \AUTOCHECK \AUTOFIX \AUTOCLOSE" /ST 01:00:00 /SC Daily /RU MyUser /RP MyPass
I've looked at other threads here, and MS documentation, and I think I have that formed correctly. However, it fails with the output:
ERROR: Invalid syntax. Mandatory option '/sc' is missing.
Type "SCHTASKS /CREATE /?" for usage.
The system cannot find the path specified.
**
I could use some advice here. | batch | scheduled-tasks | null | null | null | null | open | SCHTASKS - how to properly quote file path
===
I'm writing a small app that generates the contents of a batch file, using SCHTASKS to create scheduled tasks. However, I simply cannot get the file path working correctly. I need another set of eyes.
SCHTASKS /CREATE /TN "TASK1" /TR "\"C:\Program_Files\Spybot - Search & Destroy\SpybotSD.exe\" \AUTOCHECK \AUTOFIX \AUTOCLOSE" /ST 01:00:00 /SC Daily /RU MyUser /RP MyPass
I've looked at other threads here, and MS documentation, and I think I have that formed correctly. However, it fails with the output:
ERROR: Invalid syntax. Mandatory option '/sc' is missing.
Type "SCHTASKS /CREATE /?" for usage.
The system cannot find the path specified.
**
I could use some advice here. | 0 |
6,465,531 | 06/24/2011 08:53:47 | 550,966 | 12/22/2010 08:37:34 | 871 | 62 | What should be the better way to implemnt DES encrypting and decrypting for a string? | I have gone through theory of [DES][1] and also [AES][2], and it seems better way to use [AES][2]. But I didn't find any help on [AES][2], that how can I implement in my android application.
*So what should be better implementation of [DES][1] in my application. Can you share some links or codes for example, please?*
[1]: http://en.wikipedia.org/wiki/Data_Encryption_Standard
[2]: http://en.wikipedia.org/wiki/Advanced_Encryption_Standard | java | android | aes | des | null | 06/25/2011 10:16:53 | not a real question | What should be the better way to implemnt DES encrypting and decrypting for a string?
===
I have gone through theory of [DES][1] and also [AES][2], and it seems better way to use [AES][2]. But I didn't find any help on [AES][2], that how can I implement in my android application.
*So what should be better implementation of [DES][1] in my application. Can you share some links or codes for example, please?*
[1]: http://en.wikipedia.org/wiki/Data_Encryption_Standard
[2]: http://en.wikipedia.org/wiki/Advanced_Encryption_Standard | 1 |
2,564,287 | 04/01/2010 23:36:24 | 303,895 | 03/29/2010 02:47:14 | 3 | 0 | Jquery: Extracting the hrefs from multiple links on a page. | I discovered that .attr() only applies to the first matched element on the page! So, I've been trying to get the hrefs from all the matched elements on a page, but to no avail.
Here's what I tentatively wrote:
var thelinks = $("td a").each(function(){
$(this).attr("href");
document.write(thelinks);
});
I used document.write just to see what was going on, and I got a long list of "undefinedundefinedundefined"
What I'm trying to do is extract the hrefs from each td a and then use ajax to visit those pages and do other stuff. I can get it work fine when it's dealing with just one link, but this multiple elements thing I can't figure out.
Any help rendered is appreciated, I'm a novice to the world of Javascript and Jquery. | jquery | null | null | null | null | null | open | Jquery: Extracting the hrefs from multiple links on a page.
===
I discovered that .attr() only applies to the first matched element on the page! So, I've been trying to get the hrefs from all the matched elements on a page, but to no avail.
Here's what I tentatively wrote:
var thelinks = $("td a").each(function(){
$(this).attr("href");
document.write(thelinks);
});
I used document.write just to see what was going on, and I got a long list of "undefinedundefinedundefined"
What I'm trying to do is extract the hrefs from each td a and then use ajax to visit those pages and do other stuff. I can get it work fine when it's dealing with just one link, but this multiple elements thing I can't figure out.
Any help rendered is appreciated, I'm a novice to the world of Javascript and Jquery. | 0 |
8,100,306 | 11/11/2011 21:38:49 | 477,865 | 10/16/2010 11:07:55 | 154 | 0 | How to get and compare date and time of given files in python | Is there any handy functions can retrieve timestamp from given files or even compare them? My ideal usage would be like this:
time_diff = date(file_path_a) - date(file_path_b) # time_diff would be a formatted string such as 2days 3hrs 16 mins
I know there is a built-in datetime module in python, but I haven't found anything similar to my usage. And I know I can achieve similar effect by issuing os.stat(file_path) to get the timestamp, and transform them to the format I want. Just wondering if there are any more handy function to do this.
| python | null | null | null | null | null | open | How to get and compare date and time of given files in python
===
Is there any handy functions can retrieve timestamp from given files or even compare them? My ideal usage would be like this:
time_diff = date(file_path_a) - date(file_path_b) # time_diff would be a formatted string such as 2days 3hrs 16 mins
I know there is a built-in datetime module in python, but I haven't found anything similar to my usage. And I know I can achieve similar effect by issuing os.stat(file_path) to get the timestamp, and transform them to the format I want. Just wondering if there are any more handy function to do this.
| 0 |
6,657,871 | 07/11/2011 23:24:11 | 665,335 | 03/18/2011 01:05:50 | 201 | 3 | Free UML tool, ideally for .NET | Could anyone suggest an UNL tool that meets the following requirements, which you have used and would like to recommend.
1) free, and comply with standards
2) ideally for .net
Please note that the UML in Visual studio Pro is not good enough, VS Ultimate is not considered.
Below is a list on google
http://en.wikipedia.org/wiki/List_of_Unified_Modeling_Language_tools
| c# | java | .net | c++ | tool-uml | 07/19/2011 12:20:27 | not constructive | Free UML tool, ideally for .NET
===
Could anyone suggest an UNL tool that meets the following requirements, which you have used and would like to recommend.
1) free, and comply with standards
2) ideally for .net
Please note that the UML in Visual studio Pro is not good enough, VS Ultimate is not considered.
Below is a list on google
http://en.wikipedia.org/wiki/List_of_Unified_Modeling_Language_tools
| 4 |
5,284,308 | 03/12/2011 17:53:39 | 478,573 | 10/17/2010 14:54:01 | 303 | 11 | Text form newlines appear as \r\n\r\n when sent in an email | I have a form that takes some free text and then puts it in an email. For some reason the newlines appear as \r\n\r\n when people receive the text in the plain-text email.
Is there an easy fix for this? I use PHP.
Thanks,
Alex | php | email | null | null | null | 03/12/2011 23:42:55 | too localized | Text form newlines appear as \r\n\r\n when sent in an email
===
I have a form that takes some free text and then puts it in an email. For some reason the newlines appear as \r\n\r\n when people receive the text in the plain-text email.
Is there an easy fix for this? I use PHP.
Thanks,
Alex | 3 |
10,676,357 | 05/20/2012 19:09:23 | 1,406,649 | 05/20/2012 19:02:18 | 1 | 0 | Can I move a Facebook game off of Facebook game off of canvas? | I run a Facebook game, and we've recently wanted to not support Facebook canvas any longer, and provide platform agnostic login options such as Facebook, Google, Registration through our website, etc. Can we transition from a canvas app to a web app?
Currently, we don't store any Facebook user data other than the user id, and cache user names. The game already runs on our website by requiring Facebook authentication, as well as running in the Facebook iframe. It runs much better off of Facebook and requires less support.
Are there any Caveats to wanting to do this?
Thanks | facebook | application | user | null | null | null | open | Can I move a Facebook game off of Facebook game off of canvas?
===
I run a Facebook game, and we've recently wanted to not support Facebook canvas any longer, and provide platform agnostic login options such as Facebook, Google, Registration through our website, etc. Can we transition from a canvas app to a web app?
Currently, we don't store any Facebook user data other than the user id, and cache user names. The game already runs on our website by requiring Facebook authentication, as well as running in the Facebook iframe. It runs much better off of Facebook and requires less support.
Are there any Caveats to wanting to do this?
Thanks | 0 |
8,835,973 | 01/12/2012 13:36:48 | 1,145,569 | 01/12/2012 13:07:41 | 1 | 0 | Lifecycle of UserDefinedContext in WebSphere ESB | Does anybody know something about the lifecycle of UserDefinedContext in WebSphere ESB? This feature is poorly documented by IBM. I'm calling a webservice from a java component and use the following code to propagate some metadata to a soaphandler:
ContextService contextService = (ContextService) ServiceManager.INSTANCE
.locateService("com/ibm/bpm/context/ContextService");
//Propagating custom data through UserDefinedContext
// Get user defined context in current execution context
UserDefinedContextType userDefinedContext = contextService
.getUserDefinedContext();
if (userDefinedContext == null) { // create a new context if context is null
userDefinedContext = ContextObjectFactory.eINSTANCE
.createUserDefinedContextType();
}
// Modifying the userDefinedContext
//Create a new property with the data that needs to be propagated
ComplexPropertyType customerData = ServiceMessageObjectFactory.eINSTANCE
.createComplexPropertyType();
customerData.setName("customer"); //Set the name of the property
//The value of the data must be of type DataObject.
//Use BusinessObject Factory service to create a DataObject
BOFactory boFactory = (BOFactory) ServiceManager.INSTANCE
.locateService("com/ibm/websphere/bo/BOFactory");
//Pass the targetNameSpace of the business object and the ComplextTypeName
DataObject dataObject = boFactory
.create("http://UDCTest", "DataHolder");
dataObject.setString("name", "name");
customerData.setValue(dataObject);//Set the value on the property
//Get the UserContextType from UserDefinedContextType
UserContextType userContext = userDefinedContext.getUserContext();
if (userContext == null) //If the userContext is null, create a new instance and set in on the userDefinedContext
{
userContext = ServiceMessageObjectFactory.eINSTANCE
.createUserContextType();
userDefinedContext.setUserContext(userContext);
}
//Add the property to the userContext
userContext.getEntries().add(customerData);
// Set user defined context back to the current execution context.
contextService.setUserDefinedContext(userDefinedContext);
Then in a soaphandler I'm able to retrieve the saved data object from the user context. The question is when the context is cleaned up by the runtime? I'd also like to know what the context is bound to (like the thread that executes the code or something else)? | websphere | null | null | null | null | null | open | Lifecycle of UserDefinedContext in WebSphere ESB
===
Does anybody know something about the lifecycle of UserDefinedContext in WebSphere ESB? This feature is poorly documented by IBM. I'm calling a webservice from a java component and use the following code to propagate some metadata to a soaphandler:
ContextService contextService = (ContextService) ServiceManager.INSTANCE
.locateService("com/ibm/bpm/context/ContextService");
//Propagating custom data through UserDefinedContext
// Get user defined context in current execution context
UserDefinedContextType userDefinedContext = contextService
.getUserDefinedContext();
if (userDefinedContext == null) { // create a new context if context is null
userDefinedContext = ContextObjectFactory.eINSTANCE
.createUserDefinedContextType();
}
// Modifying the userDefinedContext
//Create a new property with the data that needs to be propagated
ComplexPropertyType customerData = ServiceMessageObjectFactory.eINSTANCE
.createComplexPropertyType();
customerData.setName("customer"); //Set the name of the property
//The value of the data must be of type DataObject.
//Use BusinessObject Factory service to create a DataObject
BOFactory boFactory = (BOFactory) ServiceManager.INSTANCE
.locateService("com/ibm/websphere/bo/BOFactory");
//Pass the targetNameSpace of the business object and the ComplextTypeName
DataObject dataObject = boFactory
.create("http://UDCTest", "DataHolder");
dataObject.setString("name", "name");
customerData.setValue(dataObject);//Set the value on the property
//Get the UserContextType from UserDefinedContextType
UserContextType userContext = userDefinedContext.getUserContext();
if (userContext == null) //If the userContext is null, create a new instance and set in on the userDefinedContext
{
userContext = ServiceMessageObjectFactory.eINSTANCE
.createUserContextType();
userDefinedContext.setUserContext(userContext);
}
//Add the property to the userContext
userContext.getEntries().add(customerData);
// Set user defined context back to the current execution context.
contextService.setUserDefinedContext(userDefinedContext);
Then in a soaphandler I'm able to retrieve the saved data object from the user context. The question is when the context is cleaned up by the runtime? I'd also like to know what the context is bound to (like the thread that executes the code or something else)? | 0 |
9,223,494 | 02/10/2012 06:08:25 | 860,231 | 07/24/2011 13:08:03 | 97 | 1 | How to add custom button and new features in TinyMCE in wordpress3.3 | Note my wordpress version is 3.3.1
some hooks and function is not the same anymore, and the info on wordpress.org is not actually helping.
all I want to do is adding and customize the default behavior about, so any post to provide? | php | wordpress | tinymce | wordpress-plugin | wordpress-plugin-dev | 02/12/2012 08:15:44 | off topic | How to add custom button and new features in TinyMCE in wordpress3.3
===
Note my wordpress version is 3.3.1
some hooks and function is not the same anymore, and the info on wordpress.org is not actually helping.
all I want to do is adding and customize the default behavior about, so any post to provide? | 2 |
3,779,786 | 09/23/2010 15:11:57 | 422,134 | 08/16/2010 20:19:21 | 68 | 12 | Update Table with a "Select query" with a where clause | I want to Achieve the following:
**Current State of table (my_table)**
id totalX totalY totalZ
--------- -------------- -------------- --------------
9 34 334 0
10 6 56 0
11 21 251 0
12 3 93 0
**Query result of (my_table2)**
select id,count(*) as total FROM my_table2 WHERE column_2 = 1 GROUP BY id
id total
--------- --------------
9 500
10 600
11 700
12 800
**Expected State of table (my_table)**
id totalX totalY totalZ
--------- -------------- -------------- --------------
9 34 334 500
10 6 56 600
11 21 251 700
12 3 93 800
Can this be done in ONE update query ? I am looking for Sybase ASE 12.5 on a RHEL 5.0
| sql | select | update | join | sybase | null | open | Update Table with a "Select query" with a where clause
===
I want to Achieve the following:
**Current State of table (my_table)**
id totalX totalY totalZ
--------- -------------- -------------- --------------
9 34 334 0
10 6 56 0
11 21 251 0
12 3 93 0
**Query result of (my_table2)**
select id,count(*) as total FROM my_table2 WHERE column_2 = 1 GROUP BY id
id total
--------- --------------
9 500
10 600
11 700
12 800
**Expected State of table (my_table)**
id totalX totalY totalZ
--------- -------------- -------------- --------------
9 34 334 500
10 6 56 600
11 21 251 700
12 3 93 800
Can this be done in ONE update query ? I am looking for Sybase ASE 12.5 on a RHEL 5.0
| 0 |
9,705,729 | 03/14/2012 16:14:47 | 404,825 | 07/28/2010 17:23:15 | 72 | 3 | Where Do I Add "service dhcp3-seerver restart" to profile | I have a remote Linux (Umbutu 10.04 64-bit, 250 miles away) on which a general user auto-logs-in and runs my program, called from *.profile* as *shell my_pro*g. *Shell* is used so I can disconnect remotely without stopping the process running my_prog.
There are two IP cameras attached to this box using a separate card with four 1-Gig enets on it. At restart (or some other rare whenever?) the second camera disappears. Restarting the DHCP3-server fixes the problem. So, what I though would help would be a good work-around would be to add a *service dhcp3-server restart* command to some profile that is executed by root after bootup is complete and, best of all, to set it up so my general user can execute the command from inside the program that is running.
So, where do I need to put the command(s) and how would I make it executable by the general user. I assume a set suid, but how?
Thanks. | linux | ubuntu | null | null | null | 03/15/2012 12:31:14 | off topic | Where Do I Add "service dhcp3-seerver restart" to profile
===
I have a remote Linux (Umbutu 10.04 64-bit, 250 miles away) on which a general user auto-logs-in and runs my program, called from *.profile* as *shell my_pro*g. *Shell* is used so I can disconnect remotely without stopping the process running my_prog.
There are two IP cameras attached to this box using a separate card with four 1-Gig enets on it. At restart (or some other rare whenever?) the second camera disappears. Restarting the DHCP3-server fixes the problem. So, what I though would help would be a good work-around would be to add a *service dhcp3-server restart* command to some profile that is executed by root after bootup is complete and, best of all, to set it up so my general user can execute the command from inside the program that is running.
So, where do I need to put the command(s) and how would I make it executable by the general user. I assume a set suid, but how?
Thanks. | 2 |
8,574,842 | 12/20/2011 11:40:37 | 1,107,701 | 12/20/2011 11:21:59 | 1 | 0 | java swing program for JTextField | How to change the JTEXTFIELD properties by pass the parameters without using the default functions.For Example if i want to change the JTextField LEFT property means using parameter (control name,left,100) like this.how to i do change JtextField property by passing parameter to the JTextField Property? | java | swing | null | null | null | 12/21/2011 23:21:05 | not a real question | java swing program for JTextField
===
How to change the JTEXTFIELD properties by pass the parameters without using the default functions.For Example if i want to change the JTextField LEFT property means using parameter (control name,left,100) like this.how to i do change JtextField property by passing parameter to the JTextField Property? | 1 |
3,536,523 | 08/21/2010 05:53:58 | 425,780 | 05/05/2010 01:28:23 | 104 | 5 | Good and bad points of PHP? | Was asked in an interview yesterday to name three good and three bad things about PHP. It was a junior position and the interviewer wasn't expecting all questions to be answered/answered correctly.
I'm a hobbyist web developer mostly, so what _are_ the good and bad points of PHP? | php | interview-questions | null | null | null | 08/21/2010 06:14:17 | not constructive | Good and bad points of PHP?
===
Was asked in an interview yesterday to name three good and three bad things about PHP. It was a junior position and the interviewer wasn't expecting all questions to be answered/answered correctly.
I'm a hobbyist web developer mostly, so what _are_ the good and bad points of PHP? | 4 |
3,618,430 | 09/01/2010 13:17:50 | 81,948 | 03/24/2009 11:12:04 | 33 | 0 | Samsung Wave (Bada) And Java | Can Java apps run on the Samsung Wave Bada OS? | bada | null | null | null | null | null | open | Samsung Wave (Bada) And Java
===
Can Java apps run on the Samsung Wave Bada OS? | 0 |
11,077,676 | 06/18/2012 06:08:45 | 1,172,965 | 01/27/2012 06:55:55 | 31 | 0 | generate xml from java and sql query | I am returning the following result from a sql query:
R INSTNAME INSTITUTE_ID COURSE_ID INSTCOURSE CITY STATE COUNTRY
1 Asia Pacific Institute Of Mangement 167 1134 Post Graduate Diploma in Management New Delhi Delhi India
2 Asia Pacific Institute Of Mangement 167 1135 Post Graduate Diploma in Management (Marketing) New Delhi Delhi India
3 Asia Pacific Institute Of Mangement 167 1136 Post Graduate Diploma in Management (International Business) New Delhi Delhi India
4 Asia Pacific Institute Of Mangement 167 1138 Post Graduate Diploma in Management (Banking & Financial Services) New Delhi Delhi India
5 University of Delhi 182 4283 Bachelor of Business Studies New Delhi Delhi India
6 University of Delhi 182 4285 Bachelor of Commerce (Pass) New Delhi Delhi India
7 University of Delhi 182 4291 Bachelor of Commerce (Honours) New Delhi Delhi India
8 University of Delhi 182 4366 Master of Commerce New Delhi Delhi India
9 Acharya Narendra Dev College 183 812 B.Com. (Hons) New Delhi Delhi India
10 Aditi Mahavidyalaya 184 829 B.Com (Pass) New Delhi Delhi India
From the above query result, I had to make the following xml in java:
<Root>
<INSTITUTE>
<ID>167</ID>
<NAME>Asia Pacific Instiute Of Mangement</Name>
<CITY>New Delhi</CITY>
<STATE>Delhi</STATE>
<COUNTRY>India</COUNTRY>
<COURSES>
<COURSE>
<ID>1134</ID>
<NAME>Post Graduate Diploma in Management</NAME>
</COURSE>
..more
</COURSES>
</INSTITUTE>
..more
</Root>
Earlier I had used 2 sql queries to generate the above xml from java. That approach is resource intensive and not recommended.
How can I generate the xml using from that resultset.
Also, query is used is:
SELECT inst.*
FROM
(SELECT ROWNUM AS r,
b.name INSTNAME,
ICC.INSTITUTE_ID,
ICC.COURSE_ID,
c.name INSTCOURSE,
d.name CITY,
e.name STATE,
f.name COUNTRY
FROM INSTITUTE_COURSE_CATEGORY ICC,
INSTITUTE a,
MEMBER b,
INSTITUTE_COURSE c,
CITY d,
STATE e,
COUNTRY f
WHERE ICC.CATEGORY_ID = 47
AND ICC.INSTITUTE_ID = a.id
AND ICC.INSTITUTE_ID = c.institute_id
AND ICC.COURSE_ID = c.id
AND a.member_id = b.id
AND a.city_id = d.id
AND a.state_id = e.id
AND UPPER(d.name) = UPPER('new delhi')
AND a.country_id = f.id
)inst
WHERE inst.r BETWEEN 1 AND 10
Kindly provide suggestion... | java | xml | oracle | dom4j | null | null | open | generate xml from java and sql query
===
I am returning the following result from a sql query:
R INSTNAME INSTITUTE_ID COURSE_ID INSTCOURSE CITY STATE COUNTRY
1 Asia Pacific Institute Of Mangement 167 1134 Post Graduate Diploma in Management New Delhi Delhi India
2 Asia Pacific Institute Of Mangement 167 1135 Post Graduate Diploma in Management (Marketing) New Delhi Delhi India
3 Asia Pacific Institute Of Mangement 167 1136 Post Graduate Diploma in Management (International Business) New Delhi Delhi India
4 Asia Pacific Institute Of Mangement 167 1138 Post Graduate Diploma in Management (Banking & Financial Services) New Delhi Delhi India
5 University of Delhi 182 4283 Bachelor of Business Studies New Delhi Delhi India
6 University of Delhi 182 4285 Bachelor of Commerce (Pass) New Delhi Delhi India
7 University of Delhi 182 4291 Bachelor of Commerce (Honours) New Delhi Delhi India
8 University of Delhi 182 4366 Master of Commerce New Delhi Delhi India
9 Acharya Narendra Dev College 183 812 B.Com. (Hons) New Delhi Delhi India
10 Aditi Mahavidyalaya 184 829 B.Com (Pass) New Delhi Delhi India
From the above query result, I had to make the following xml in java:
<Root>
<INSTITUTE>
<ID>167</ID>
<NAME>Asia Pacific Instiute Of Mangement</Name>
<CITY>New Delhi</CITY>
<STATE>Delhi</STATE>
<COUNTRY>India</COUNTRY>
<COURSES>
<COURSE>
<ID>1134</ID>
<NAME>Post Graduate Diploma in Management</NAME>
</COURSE>
..more
</COURSES>
</INSTITUTE>
..more
</Root>
Earlier I had used 2 sql queries to generate the above xml from java. That approach is resource intensive and not recommended.
How can I generate the xml using from that resultset.
Also, query is used is:
SELECT inst.*
FROM
(SELECT ROWNUM AS r,
b.name INSTNAME,
ICC.INSTITUTE_ID,
ICC.COURSE_ID,
c.name INSTCOURSE,
d.name CITY,
e.name STATE,
f.name COUNTRY
FROM INSTITUTE_COURSE_CATEGORY ICC,
INSTITUTE a,
MEMBER b,
INSTITUTE_COURSE c,
CITY d,
STATE e,
COUNTRY f
WHERE ICC.CATEGORY_ID = 47
AND ICC.INSTITUTE_ID = a.id
AND ICC.INSTITUTE_ID = c.institute_id
AND ICC.COURSE_ID = c.id
AND a.member_id = b.id
AND a.city_id = d.id
AND a.state_id = e.id
AND UPPER(d.name) = UPPER('new delhi')
AND a.country_id = f.id
)inst
WHERE inst.r BETWEEN 1 AND 10
Kindly provide suggestion... | 0 |
10,960,728 | 06/09/2012 11:46:06 | 1,446,128 | 06/09/2012 11:27:13 | 1 | 0 | Show/hide css/javascript code not hiding content properly in Chrome | I've scowered this site trying to find a similar issue, but so far no luck. Hoping perhaps someone here would know the answer :).
I found this site that had show/hide scrolling code which seemed to work well enough for what I wanted. I've implemented it, and it works fine on Firefox. The scrolling also works fine on Chrome except for the fact that the videos in the "hidden" portion tends to show up in the top left hand corner. To trigger this, click on a different link (i.e. poetry, get involved etc) and click back to music, that's when it messes up. I've included the code in the header as well as the page for "music". I've used the same code in the poetry section, and no issues with the text. Perhaps it has to do with the iframe? Thanks so much!
[<a href="www.leclairstudios.ca">leclairstudios.ca</a>][1]
Head:
<style type="text/css">
.dhtmlgoodies_question{ /* Styling question */
/* Start layout CSS */
width:500px;
margin-bottom:2px;
margin-top:2px;
padding-left:2px;
height:20px;
/* End layout CSS */
cursor:pointer;
}
.dhtmlgoodies_question:hover{
color: red ;
}
.dhtmlgoodies_answer{ /* Parent box of slide down content */
/* Start layout CSS */
background-color:#e6e5f8;
/* End layout CSS */
visibility:hidden;
height:0px;
overflow:hidden;
position:relative;
}
.dhtmlgoodies_answer_content{ /* Content that is slided down */
padding:1px;
font-size:0.9em;
position:relative;
}
</style>
<script type="text/javascript">
/************************************************************************************************************
Show hide content with slide effect
Copyright (C) August 2010 DTHMLGoodies.com, Alf Magne Kalleland
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.
Alf Magne Kalleland, 2010
Owner of DHTMLgoodies.com
************************************************************************************************************/
var dhtmlgoodies_slideSpeed = 10; // Higher value = faster
var dhtmlgoodies_timer = 10; // Lower value = faster
var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;
var dhtmlgoodies_slideInProgress = false;
var dhtmlgoodies_expandMultiple = false; // true if you want to be able to have multiple items expanded at the same time.
function showHideContent(e,inputId)
{
if(dhtmlgoodies_slideInProgress)return;
dhtmlgoodies_slideInProgress = true;
if(!inputId)inputId = this.id;
inputId = inputId + '';
var numericId = inputId.replace(/[^0-9]/g,'');
var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);
objectIdToSlideDown = false;
if(!answerDiv.style.display || answerDiv.style.display=='none'){
if(dhtmlgoodies_activeId && dhtmlgoodies_activeId!=numericId && !dhtmlgoodies_expandMultiple){
objectIdToSlideDown = numericId;
slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
}else{
answerDiv.style.display='block';
answerDiv.style.visibility = 'visible';
slideContent(numericId,dhtmlgoodies_slideSpeed);
}
}else{
slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
dhtmlgoodies_activeId = false;
}
}
function slideContent(inputId,direction)
{
var obj =document.getElementById('dhtmlgoodies_a' + inputId);
var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
height = obj.clientHeight;
if(height==0)height = obj.offsetHeight;
height = height + direction;
rerunFunction = true;
if(height>contentObj.offsetHeight){
height = contentObj.offsetHeight;
rerunFunction = false;
}
if(height<=1){
height = 1;
rerunFunction = false;
}
obj.style.height = height + 'px';
var topPos = height - contentObj.offsetHeight;
if(topPos>0)topPos=0;
contentObj.style.top = topPos + 'px';
if(rerunFunction){
setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
}else{
if(height<=1){
obj.style.display='none';
if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);
}else{
dhtmlgoodies_slideInProgress = false;
}
}else{
dhtmlgoodies_activeId = inputId;
dhtmlgoodies_slideInProgress = false;
}
}
}
function initShowHideDivs()
{
var divs = document.getElementsByTagName('DIV');
var divCounter = 1;
for(var no=0;no<divs.length;no++){
if(divs[no].className=='dhtmlgoodies_question'){
divs[no].onclick = showHideContent;
divs[no].id = 'dhtmlgoodies_q'+divCounter;
var answer = divs[no].nextSibling;
while(answer && answer.tagName!='DIV'){
answer = answer.nextSibling;
}
answer.id = 'dhtmlgoodies_a'+divCounter;
contentDiv = answer.getElementsByTagName('DIV')[0];
contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px';
contentDiv.className='dhtmlgoodies_answer_content';
contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
answer.style.display='none';
answer.style.height='1px';
divCounter++;
}
}
}
window.onload = initShowHideDivs;
</script>
Music:
<br /><br />
<p> Click song name to expand video - page currently best viewed with Firefox</p>
<hr>
<br />
<div class="dhtmlgoodies_question"><p>Eli, The Barrow Boy</p></div>
<div class="dhtmlgoodies_answer">
<div>
<iframe width="420" height="315" src="http://www.youtube.com/embed/NEF8N-5zVMU" frameborder="0" allowfullscreen>
</iframe>
</div>
</div>
<br />
<div class="dhtmlgoodies_question"><p> Pussywillows, Cattails, Softwinds, and Roses </p></div>
<div class="dhtmlgoodies_answer">
<div>
<iframe width="420" height="315" src="http://www.youtube.com/embed/R7XOiSmh7ik" frameborder="0" allowfullscreen>
</iframe>
</div>
</div>
<br />
<div class="dhtmlgoodies_question"><p>Chasing Cars</p></div>
<div class="dhtmlgoodies_answer">
<div>
<iframe width="420" height="315" src="http://www.youtube.com/embed/ZTm6--Bu7W8" frameborder="0" allowfullscreen>
</iframe>
</div>
</div>
[1]: http://leclairstudios.ca | javascript | css | google-chrome | null | null | null | open | Show/hide css/javascript code not hiding content properly in Chrome
===
I've scowered this site trying to find a similar issue, but so far no luck. Hoping perhaps someone here would know the answer :).
I found this site that had show/hide scrolling code which seemed to work well enough for what I wanted. I've implemented it, and it works fine on Firefox. The scrolling also works fine on Chrome except for the fact that the videos in the "hidden" portion tends to show up in the top left hand corner. To trigger this, click on a different link (i.e. poetry, get involved etc) and click back to music, that's when it messes up. I've included the code in the header as well as the page for "music". I've used the same code in the poetry section, and no issues with the text. Perhaps it has to do with the iframe? Thanks so much!
[<a href="www.leclairstudios.ca">leclairstudios.ca</a>][1]
Head:
<style type="text/css">
.dhtmlgoodies_question{ /* Styling question */
/* Start layout CSS */
width:500px;
margin-bottom:2px;
margin-top:2px;
padding-left:2px;
height:20px;
/* End layout CSS */
cursor:pointer;
}
.dhtmlgoodies_question:hover{
color: red ;
}
.dhtmlgoodies_answer{ /* Parent box of slide down content */
/* Start layout CSS */
background-color:#e6e5f8;
/* End layout CSS */
visibility:hidden;
height:0px;
overflow:hidden;
position:relative;
}
.dhtmlgoodies_answer_content{ /* Content that is slided down */
padding:1px;
font-size:0.9em;
position:relative;
}
</style>
<script type="text/javascript">
/************************************************************************************************************
Show hide content with slide effect
Copyright (C) August 2010 DTHMLGoodies.com, Alf Magne Kalleland
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.
Alf Magne Kalleland, 2010
Owner of DHTMLgoodies.com
************************************************************************************************************/
var dhtmlgoodies_slideSpeed = 10; // Higher value = faster
var dhtmlgoodies_timer = 10; // Lower value = faster
var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;
var dhtmlgoodies_slideInProgress = false;
var dhtmlgoodies_expandMultiple = false; // true if you want to be able to have multiple items expanded at the same time.
function showHideContent(e,inputId)
{
if(dhtmlgoodies_slideInProgress)return;
dhtmlgoodies_slideInProgress = true;
if(!inputId)inputId = this.id;
inputId = inputId + '';
var numericId = inputId.replace(/[^0-9]/g,'');
var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);
objectIdToSlideDown = false;
if(!answerDiv.style.display || answerDiv.style.display=='none'){
if(dhtmlgoodies_activeId && dhtmlgoodies_activeId!=numericId && !dhtmlgoodies_expandMultiple){
objectIdToSlideDown = numericId;
slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
}else{
answerDiv.style.display='block';
answerDiv.style.visibility = 'visible';
slideContent(numericId,dhtmlgoodies_slideSpeed);
}
}else{
slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
dhtmlgoodies_activeId = false;
}
}
function slideContent(inputId,direction)
{
var obj =document.getElementById('dhtmlgoodies_a' + inputId);
var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
height = obj.clientHeight;
if(height==0)height = obj.offsetHeight;
height = height + direction;
rerunFunction = true;
if(height>contentObj.offsetHeight){
height = contentObj.offsetHeight;
rerunFunction = false;
}
if(height<=1){
height = 1;
rerunFunction = false;
}
obj.style.height = height + 'px';
var topPos = height - contentObj.offsetHeight;
if(topPos>0)topPos=0;
contentObj.style.top = topPos + 'px';
if(rerunFunction){
setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
}else{
if(height<=1){
obj.style.display='none';
if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);
}else{
dhtmlgoodies_slideInProgress = false;
}
}else{
dhtmlgoodies_activeId = inputId;
dhtmlgoodies_slideInProgress = false;
}
}
}
function initShowHideDivs()
{
var divs = document.getElementsByTagName('DIV');
var divCounter = 1;
for(var no=0;no<divs.length;no++){
if(divs[no].className=='dhtmlgoodies_question'){
divs[no].onclick = showHideContent;
divs[no].id = 'dhtmlgoodies_q'+divCounter;
var answer = divs[no].nextSibling;
while(answer && answer.tagName!='DIV'){
answer = answer.nextSibling;
}
answer.id = 'dhtmlgoodies_a'+divCounter;
contentDiv = answer.getElementsByTagName('DIV')[0];
contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px';
contentDiv.className='dhtmlgoodies_answer_content';
contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
answer.style.display='none';
answer.style.height='1px';
divCounter++;
}
}
}
window.onload = initShowHideDivs;
</script>
Music:
<br /><br />
<p> Click song name to expand video - page currently best viewed with Firefox</p>
<hr>
<br />
<div class="dhtmlgoodies_question"><p>Eli, The Barrow Boy</p></div>
<div class="dhtmlgoodies_answer">
<div>
<iframe width="420" height="315" src="http://www.youtube.com/embed/NEF8N-5zVMU" frameborder="0" allowfullscreen>
</iframe>
</div>
</div>
<br />
<div class="dhtmlgoodies_question"><p> Pussywillows, Cattails, Softwinds, and Roses </p></div>
<div class="dhtmlgoodies_answer">
<div>
<iframe width="420" height="315" src="http://www.youtube.com/embed/R7XOiSmh7ik" frameborder="0" allowfullscreen>
</iframe>
</div>
</div>
<br />
<div class="dhtmlgoodies_question"><p>Chasing Cars</p></div>
<div class="dhtmlgoodies_answer">
<div>
<iframe width="420" height="315" src="http://www.youtube.com/embed/ZTm6--Bu7W8" frameborder="0" allowfullscreen>
</iframe>
</div>
</div>
[1]: http://leclairstudios.ca | 0 |
8,876,659 | 01/16/2012 06:57:30 | 1,118,953 | 12/28/2011 08:44:17 | 1 | 0 | is there any infrared sensor with built in demodulator other than 38 KHz? | looking for infrared sensor with built in demodulator but not the 38 KHz | sensor | infrared | null | null | null | 01/16/2012 17:23:28 | off topic | is there any infrared sensor with built in demodulator other than 38 KHz?
===
looking for infrared sensor with built in demodulator but not the 38 KHz | 2 |
2,518,254 | 03/25/2010 18:16:59 | 300,881 | 03/24/2010 14:22:23 | 13 | 0 | 32bit to 64bit inline assembly porting | I have a piece of C++ code (compiled with g++ under a GNU/Linux environment) that load a function pointer (how it does that doesn't matter), pushes some arguments onto the stack with some inline assembly and then calls that function, the code is like :
unsigned long stack[] = { 1, 23, 33, 43 };
/* save all the registers and the stack pointer */
unsigned long esp;
asm __volatile__ ( "pusha" );
asm __volatile__ ( "mov %%esp, %0" :"=m" (esp));
for( i = 0; i < sizeof(stack); i++ ){
unsigned long val = stack[i];
asm __volatile__ ( "push %0" :: "m"(val) );
}
unsigned long ret = function_pointer();
/* restore registers and stack pointer */
asm __volatile__ ( "mov %0, %%esp" :: "m" (esp) );
asm __volatile__ ( "popa" );
I'd like to add some sort of
#ifdef _LP64
// 64bit inline assembly
#else
// 32bit version as above example
#endif
But i don't know inline assembly for 64bit machines, anyone could help me?
Thanks | c | c++ | assembly | inline-assembly | 32bit-64bit | null | open | 32bit to 64bit inline assembly porting
===
I have a piece of C++ code (compiled with g++ under a GNU/Linux environment) that load a function pointer (how it does that doesn't matter), pushes some arguments onto the stack with some inline assembly and then calls that function, the code is like :
unsigned long stack[] = { 1, 23, 33, 43 };
/* save all the registers and the stack pointer */
unsigned long esp;
asm __volatile__ ( "pusha" );
asm __volatile__ ( "mov %%esp, %0" :"=m" (esp));
for( i = 0; i < sizeof(stack); i++ ){
unsigned long val = stack[i];
asm __volatile__ ( "push %0" :: "m"(val) );
}
unsigned long ret = function_pointer();
/* restore registers and stack pointer */
asm __volatile__ ( "mov %0, %%esp" :: "m" (esp) );
asm __volatile__ ( "popa" );
I'd like to add some sort of
#ifdef _LP64
// 64bit inline assembly
#else
// 32bit version as above example
#endif
But i don't know inline assembly for 64bit machines, anyone could help me?
Thanks | 0 |
11,042,002 | 06/14/2012 22:04:39 | 1,368,346 | 05/01/2012 18:24:36 | 1 | 0 | retreive images in android | I have app contain large number of HD images , so my app is too big over 150 mb when i put images in app resource , if there is alternative way to retrieve images remotly and not included inside app ,i saw some images apps when open it start download images then appear in app , its downloaded from some where i dont know really.am new to android so if any one help me ,where i have to put images and how to retrieve it to app when it open ,finally i will have resnable sized app also i will including all images in app by remote download.
thanks in advance | java | android | null | null | null | 06/16/2012 07:52:09 | not a real question | retreive images in android
===
I have app contain large number of HD images , so my app is too big over 150 mb when i put images in app resource , if there is alternative way to retrieve images remotly and not included inside app ,i saw some images apps when open it start download images then appear in app , its downloaded from some where i dont know really.am new to android so if any one help me ,where i have to put images and how to retrieve it to app when it open ,finally i will have resnable sized app also i will including all images in app by remote download.
thanks in advance | 1 |
7,878,082 | 10/24/2011 15:31:49 | 643,271 | 03/03/2011 15:49:45 | 152 | 13 | What is the best versioning way by a project | It is very confusing with versioning. I saw lots of versioning samples. Some of them contains even subversion information. Many of them looks ok.
- 0.5
- 0.1.0
- 0.0.1.0
- 5.5.5.2_R139
- ...
<br>What is the best practise/best way for software-versioning? | project | versioning | version-numbering | null | null | 11/20/2011 15:07:09 | not constructive | What is the best versioning way by a project
===
It is very confusing with versioning. I saw lots of versioning samples. Some of them contains even subversion information. Many of them looks ok.
- 0.5
- 0.1.0
- 0.0.1.0
- 5.5.5.2_R139
- ...
<br>What is the best practise/best way for software-versioning? | 4 |
11,709,598 | 07/29/2012 13:25:58 | 829,568 | 07/05/2011 11:14:42 | 920 | 26 | Squeryl: KeyedEntity.id isn't updated on insert | I have a table definition
class Transaction(
val ...
) extends KeyedEntity[Long] {
val id:Long = 0
}
val transaction = table[Transaction]("transactions")
on(transaction) {t =>
declare(
t.id is unique
... (other fields)
)
}
The database table was not generated by Squeryl (I created it manually), but the "ID" column is set to PrimaryKey and AutoIncrement.
Now I'm inserting a row in this table:
val row = new Transaction(...)
val rowResult = Transaction.insert(row)
println("Id1="+row.id+"; Id2="+rowResult.id)
The row is correctly inserted into the database and there an ID is assigned (!=0).
But the application prints "ID1=0; ID2=0" on the command line.
Why? And how do I get the assigned ID?
**edit:**
I did also try the table definition this way
class Transaction(
val id: Long,
...
) extends KeyedEntity[Long]
Didn't make any differences. | mysql | scala | playframework-2.0 | squeryl | null | null | open | Squeryl: KeyedEntity.id isn't updated on insert
===
I have a table definition
class Transaction(
val ...
) extends KeyedEntity[Long] {
val id:Long = 0
}
val transaction = table[Transaction]("transactions")
on(transaction) {t =>
declare(
t.id is unique
... (other fields)
)
}
The database table was not generated by Squeryl (I created it manually), but the "ID" column is set to PrimaryKey and AutoIncrement.
Now I'm inserting a row in this table:
val row = new Transaction(...)
val rowResult = Transaction.insert(row)
println("Id1="+row.id+"; Id2="+rowResult.id)
The row is correctly inserted into the database and there an ID is assigned (!=0).
But the application prints "ID1=0; ID2=0" on the command line.
Why? And how do I get the assigned ID?
**edit:**
I did also try the table definition this way
class Transaction(
val id: Long,
...
) extends KeyedEntity[Long]
Didn't make any differences. | 0 |
10,191,993 | 04/17/2012 13:14:17 | 1,085,742 | 12/07/2011 13:57:36 | 143 | 20 | Android gridview stretching effect | In my tablet application a gridview shows stretch effect even after its end is encountered(as shown below image). How this effect can disabled?<br/><br/>![enter image description here][1]
[1]: http://i.stack.imgur.com/bgosJ.png | android | gridview | null | null | null | null | open | Android gridview stretching effect
===
In my tablet application a gridview shows stretch effect even after its end is encountered(as shown below image). How this effect can disabled?<br/><br/>![enter image description here][1]
[1]: http://i.stack.imgur.com/bgosJ.png | 0 |
6,707,039 | 07/15/2011 12:36:59 | 820,914 | 06/29/2011 10:57:17 | 11 | 0 | how to parse html by similar these code ? | =====use these code :
static NSString *kName_Item = @"item";
static NSString *kName_Title =@"title";
static NSString *kName_Category = @"category";
static NSString *kName_Artist = @"itms:artist";
static NSString *kName_Album = @"itms:album";
static NSString *kName_ReleaseDate = @"itms:releasedate";
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
if ([elementName isEqualToString:kName_Item]) {
[self finishedCurrentSong];
} else if ([elementName isEqualToString:kName_Title]) {
currentSong.title = currentString;
} else if ([elementName isEqualToString:kName_Category]) {
currentSong.category = currentString;
} else if ([elementName isEqualToString:kName_Artist]) {
currentSong.artist = currentString;
} else if ([elementName isEqualToString:kName_Album]) {
currentSong.album = currentString;
}
else if ([elementName isEqualToString:kName_ReleaseDate]) {
currentSong.releaseDate = [parseFormatter dateFromString:currentString];
}
storingCharacters = NO;
}
=====if web code is :
(http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wpa/MRSS/newreleases/limit=300/rss.xml)
=====then ok, can easy get element.such as item,title,category
=====but i want to get :(http:view-source:http://www.ted.com/talks/matt_cutts_try_something_new_for_30_days.html)
=====such as :A few years ago, so I decided to follow in the footsteps, of the great American philosopher, Morgan Spurlock,
=====how to do???
| html | objective-c | xml | null | null | 07/15/2011 14:59:59 | too localized | how to parse html by similar these code ?
===
=====use these code :
static NSString *kName_Item = @"item";
static NSString *kName_Title =@"title";
static NSString *kName_Category = @"category";
static NSString *kName_Artist = @"itms:artist";
static NSString *kName_Album = @"itms:album";
static NSString *kName_ReleaseDate = @"itms:releasedate";
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
if ([elementName isEqualToString:kName_Item]) {
[self finishedCurrentSong];
} else if ([elementName isEqualToString:kName_Title]) {
currentSong.title = currentString;
} else if ([elementName isEqualToString:kName_Category]) {
currentSong.category = currentString;
} else if ([elementName isEqualToString:kName_Artist]) {
currentSong.artist = currentString;
} else if ([elementName isEqualToString:kName_Album]) {
currentSong.album = currentString;
}
else if ([elementName isEqualToString:kName_ReleaseDate]) {
currentSong.releaseDate = [parseFormatter dateFromString:currentString];
}
storingCharacters = NO;
}
=====if web code is :
(http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wpa/MRSS/newreleases/limit=300/rss.xml)
=====then ok, can easy get element.such as item,title,category
=====but i want to get :(http:view-source:http://www.ted.com/talks/matt_cutts_try_something_new_for_30_days.html)
=====such as :A few years ago, so I decided to follow in the footsteps, of the great American philosopher, Morgan Spurlock,
=====how to do???
| 3 |
7,342,960 | 09/08/2011 03:56:00 | 527,328 | 12/01/2010 23:50:40 | 318 | 10 | Reading specific CSV value in PHP | I have the following CSV file:
08-0018421032;00-0018151831;G-20009429-0;G-20009429-0;0374048-0
27-001842101232;10-0018151831;G-30009429-0;G-50009429-0;7374048-0
36-0018421033232;20-0018151831;G-40009429-0;G-60009429-0;8374048-0
As you can see the separator is the ; symbol.
I then send this info to php via a jquery plugin which works perfect since I can read the file in PHP. The following code grabs the CSV file (Which is the $csvfile variable) and I can see the lines in it:
$file = fopen("upload/$csvfile", "r");
while (!feof($file) ) {
$line = fgetcsv($file, 1024,';');
print $line[0].'<br/>';
}
fclose($file);
What I need is to be able to select not only the line but on the value in it. To go to a specific value, for example in the first line the 3rd value would be **G-20009429-0** and I would assign this to a php variable to be used later on.
Right now I have no idea how to grab a specific value in a line and also when I print the $line[0] it shows the values in a vertical order instead of a horizontal order. What I mean with this is that it shows the following output:
00-0018151831
10-0018151831
20-0018151831
Instead of showing me like this:
08-0018421032;00-0018151831;G-20009429-0;G-20009429-0;0374048-0
Maybe is the sleep but am stuck here. Just to repeat, the csv file is read by Php correctly since I can do a print_r on it and it shows all the lines in it. The thing is how to manipulate the information after I have the csv and how to grab a specific value in a specific line. Thank you. | php | parsing | csv | null | null | null | open | Reading specific CSV value in PHP
===
I have the following CSV file:
08-0018421032;00-0018151831;G-20009429-0;G-20009429-0;0374048-0
27-001842101232;10-0018151831;G-30009429-0;G-50009429-0;7374048-0
36-0018421033232;20-0018151831;G-40009429-0;G-60009429-0;8374048-0
As you can see the separator is the ; symbol.
I then send this info to php via a jquery plugin which works perfect since I can read the file in PHP. The following code grabs the CSV file (Which is the $csvfile variable) and I can see the lines in it:
$file = fopen("upload/$csvfile", "r");
while (!feof($file) ) {
$line = fgetcsv($file, 1024,';');
print $line[0].'<br/>';
}
fclose($file);
What I need is to be able to select not only the line but on the value in it. To go to a specific value, for example in the first line the 3rd value would be **G-20009429-0** and I would assign this to a php variable to be used later on.
Right now I have no idea how to grab a specific value in a line and also when I print the $line[0] it shows the values in a vertical order instead of a horizontal order. What I mean with this is that it shows the following output:
00-0018151831
10-0018151831
20-0018151831
Instead of showing me like this:
08-0018421032;00-0018151831;G-20009429-0;G-20009429-0;0374048-0
Maybe is the sleep but am stuck here. Just to repeat, the csv file is read by Php correctly since I can do a print_r on it and it shows all the lines in it. The thing is how to manipulate the information after I have the csv and how to grab a specific value in a specific line. Thank you. | 0 |
10,238,339 | 04/19/2012 23:33:56 | 791,804 | 06/09/2011 22:03:56 | 168 | 19 | What is a WEP enterprise ?? | I have been looking around to understand what a WEP enterprise is ? I do see and understand WEP, WPA/WPA2 and WPA/WPA2 enterprise but what is WEP enterprise and how diff it is from WPA/WPA2 enterprise and WEP ? | java | android | networking | wireless | null | 04/20/2012 12:08:39 | off topic | What is a WEP enterprise ??
===
I have been looking around to understand what a WEP enterprise is ? I do see and understand WEP, WPA/WPA2 and WPA/WPA2 enterprise but what is WEP enterprise and how diff it is from WPA/WPA2 enterprise and WEP ? | 2 |
4,573,410 | 01/01/2011 07:01:13 | 177,006 | 09/22/2009 07:49:59 | 207 | 5 | DragAllow Property is not available in Visual Studio 2010 C# | I read in [this article][1] about DragAllow property of components in C#. But I cannot found this property in Visual Studio 2010.
I'm trying to enable Drag and Drop for Picture Control. Does somebody here know about this?
[1]: http://www.codeproject.com/KB/cs/DragDropImage.aspx?fid=370651&df=90&mpp=50&noise=3&sort=Position&view=Expanded | drag-and-drop | null | null | null | null | null | open | DragAllow Property is not available in Visual Studio 2010 C#
===
I read in [this article][1] about DragAllow property of components in C#. But I cannot found this property in Visual Studio 2010.
I'm trying to enable Drag and Drop for Picture Control. Does somebody here know about this?
[1]: http://www.codeproject.com/KB/cs/DragDropImage.aspx?fid=370651&df=90&mpp=50&noise=3&sort=Position&view=Expanded | 0 |
6,074,144 | 05/20/2011 15:27:21 | 396,335 | 07/19/2010 07:21:55 | 1,101 | 34 | Is SQL Server 2000 Free? | Is SQL Server 2000 Free? I mean, can I use it for commercial use like SQL Server 2005 Express Edition? | sql | sql-server | null | null | null | 05/20/2011 15:30:48 | off topic | Is SQL Server 2000 Free?
===
Is SQL Server 2000 Free? I mean, can I use it for commercial use like SQL Server 2005 Express Edition? | 2 |
6,251,635 | 06/06/2011 11:55:59 | 700,663 | 04/10/2011 07:56:33 | 357 | 1 | Is this kind of notation legal in Objective - C | CLLocationCoordinate2D coord = {latitude: 61.2180556, longitude: -149.9002778};
MKCoordinateSpan span = {latitudeDelta: 0.2, longitudeDelta: 0.2};
MKCoordinateRegion region = {coord, span};
| objective-c | xcode4 | null | null | null | null | open | Is this kind of notation legal in Objective - C
===
CLLocationCoordinate2D coord = {latitude: 61.2180556, longitude: -149.9002778};
MKCoordinateSpan span = {latitudeDelta: 0.2, longitudeDelta: 0.2};
MKCoordinateRegion region = {coord, span};
| 0 |
11,415,151 | 07/10/2012 14:09:22 | 1,515,005 | 07/10/2012 14:02:23 | 1 | 0 | Comment code to explain "how" but does not explain "why"? | When I was in a programming study course, I alway had a bad situation: Comment code to explain "how" but does not explain "why".
What I want to know is why re-run the code there is and why you chose to write it.
What can I do to fix this problem to improve my programming? | c# | null | null | null | null | 07/10/2012 14:14:55 | off topic | Comment code to explain "how" but does not explain "why"?
===
When I was in a programming study course, I alway had a bad situation: Comment code to explain "how" but does not explain "why".
What I want to know is why re-run the code there is and why you chose to write it.
What can I do to fix this problem to improve my programming? | 2 |
11,664,617 | 07/26/2012 07:43:31 | 1,553,768 | 07/26/2012 07:15:18 | 3 | 0 | Parsing data from json to iphone application | I am parsing data from iphone app to json from server but it does not get data from the json
i am using following code
To get Data from json
here is the link of my json data
http://celeritas-solutions.com/emrapp/surveyDescription.php?user_id=ali40
NSString*user=@"ali40";
NSString *url=[NSString stringWithFormat:@"http://celeritas-solutions.com/emrapp/surveyDescription.php?user_id=%@",user];
NSLog(url);
NSArray *tempArray =[[DataManager staticVersion] startParsing:url];
for (int i = 0; i<[tempArray count]; i++) {
id *item = [tempArray objectAtIndex:i];
NSDictionary *dict = (NSDictionary *) item;
ObjectData *theObject =[[ObjectData alloc] init];
[theObject setUser_id:[dict objectForKey:@"user_id"]];
[theObject setSurvey_id:[dict objectForKey:@"survey_id"]];
[theObject setSurvey_title:[dict objectForKey:@"survey_Title"]];
[theObject setSurvey_Description:[dict objectForKey:@"survey_Description"]];
[theObject setDate_Created:[dict objectForKey:@"date_Created"]];
[surveyList addObject:theObject];
[theObject release];
theObject=nil;
int count =[surveyList count];
NSLog(@"Total is %d",count);
DataManager Class
DataManager *theInstance;
+ (id)staticVersion{
if(!theInstance){
theInstance = [[DataManager alloc] init];
}
return theInstance;
}
- (NSMutableArray *) startParsing:(NSString *)theURLString {
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@",theURLString]];
NSString *fileContent= [NSString stringWithContentsOfURL:url];
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *data = (NSDictionary *) [parser objectWithString:fileContent error:nil];
NSArray *items = (NSArray *) data ;
return items;
int count=[items count];
NSLog(@"This is testing %d",count);
} | iphone | xcode | json | null | null | null | open | Parsing data from json to iphone application
===
I am parsing data from iphone app to json from server but it does not get data from the json
i am using following code
To get Data from json
here is the link of my json data
http://celeritas-solutions.com/emrapp/surveyDescription.php?user_id=ali40
NSString*user=@"ali40";
NSString *url=[NSString stringWithFormat:@"http://celeritas-solutions.com/emrapp/surveyDescription.php?user_id=%@",user];
NSLog(url);
NSArray *tempArray =[[DataManager staticVersion] startParsing:url];
for (int i = 0; i<[tempArray count]; i++) {
id *item = [tempArray objectAtIndex:i];
NSDictionary *dict = (NSDictionary *) item;
ObjectData *theObject =[[ObjectData alloc] init];
[theObject setUser_id:[dict objectForKey:@"user_id"]];
[theObject setSurvey_id:[dict objectForKey:@"survey_id"]];
[theObject setSurvey_title:[dict objectForKey:@"survey_Title"]];
[theObject setSurvey_Description:[dict objectForKey:@"survey_Description"]];
[theObject setDate_Created:[dict objectForKey:@"date_Created"]];
[surveyList addObject:theObject];
[theObject release];
theObject=nil;
int count =[surveyList count];
NSLog(@"Total is %d",count);
DataManager Class
DataManager *theInstance;
+ (id)staticVersion{
if(!theInstance){
theInstance = [[DataManager alloc] init];
}
return theInstance;
}
- (NSMutableArray *) startParsing:(NSString *)theURLString {
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@",theURLString]];
NSString *fileContent= [NSString stringWithContentsOfURL:url];
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *data = (NSDictionary *) [parser objectWithString:fileContent error:nil];
NSArray *items = (NSArray *) data ;
return items;
int count=[items count];
NSLog(@"This is testing %d",count);
} | 0 |
11,067,383 | 06/16/2012 22:04:24 | 370,401 | 06/18/2010 14:48:05 | 704 | 9 | If web application and SQL Server are on different machines on intranet, can Windows anthentication still be used? | If web application and SQL Server are on different machines(both running Windows) on intranet, can Windows anthentication still be used to access SQl Server or SQL authentication mode need to be used? | sql-server | null | null | null | null | null | open | If web application and SQL Server are on different machines on intranet, can Windows anthentication still be used?
===
If web application and SQL Server are on different machines(both running Windows) on intranet, can Windows anthentication still be used to access SQl Server or SQL authentication mode need to be used? | 0 |
8,914,359 | 01/18/2012 17:16:42 | 638,049 | 02/28/2011 16:47:15 | 10 | 0 | How can I make a progressbar indeterminate and percentage in android | I need to create a progressbar that is indeterminate but has the percentages with the bar going across. I know I have to subclass Progressbar, but I am not sure about how to do this for what I need. Any Examples would be great. Thanks | android | progress-bar | percentage | null | null | 05/08/2012 12:19:01 | not a real question | How can I make a progressbar indeterminate and percentage in android
===
I need to create a progressbar that is indeterminate but has the percentages with the bar going across. I know I have to subclass Progressbar, but I am not sure about how to do this for what I need. Any Examples would be great. Thanks | 1 |
9,907,493 | 03/28/2012 12:28:07 | 547,564 | 12/19/2010 08:44:27 | 542 | 35 | Find jvm from Java | How can I find a JVM ( java command, e.g. */usr/bin/java* for mac and *C:\Program Files\Java\bin\java.exe* for Windows) from a Java application?
Reason:
I am running an JNLP application that should download and launch other jar. I cannot just load the other jar because it has native libraries which could not be launched as JNLP.
| java | jvm | cross-platform | null | null | null | open | Find jvm from Java
===
How can I find a JVM ( java command, e.g. */usr/bin/java* for mac and *C:\Program Files\Java\bin\java.exe* for Windows) from a Java application?
Reason:
I am running an JNLP application that should download and launch other jar. I cannot just load the other jar because it has native libraries which could not be launched as JNLP.
| 0 |
10,883,332 | 06/04/2012 14:50:43 | 793,908 | 06/11/2011 11:39:32 | 20 | 0 | Procurve learning book | I work with HP procurve devices and I am interesting in knowing it, for this reason I looking for a good book, can anyone recommend one?
I only find manuals, not any book... | networking | routing | switch-statement | hp | null | null | open | Procurve learning book
===
I work with HP procurve devices and I am interesting in knowing it, for this reason I looking for a good book, can anyone recommend one?
I only find manuals, not any book... | 0 |
10,421,961 | 05/02/2012 21:24:23 | 931,305 | 09/06/2011 18:17:48 | 1 | 1 | Error handling with afterSubmit is not showing on JqGrid's new model form | I'm trying to show the server error to the user on JqGrid
here is my code:
function addRow() {
$("#updateList").jqGrid('editGridRow', "new", {
editData: {
Year: function () { return $('#year option:selected').val(); }
}
, afterSubmit: function (response, postdata) { return [false, "fdfdfdfd", "141"]; }
, height: 400, width: 400, reloadAfterSubmit: true
});
}
I do get the json error from Server with StatusCode 500
I just wanted to test so I put
return [false, "fdfdfdfd", "141"]
But I always see the default error message
"error Status: 'error'. Error code: 500"
This is a 'new' row adding model form. not inline editing.
Thanks for any help...
| jquery | jqgrid | error-handling | null | null | null | open | Error handling with afterSubmit is not showing on JqGrid's new model form
===
I'm trying to show the server error to the user on JqGrid
here is my code:
function addRow() {
$("#updateList").jqGrid('editGridRow', "new", {
editData: {
Year: function () { return $('#year option:selected').val(); }
}
, afterSubmit: function (response, postdata) { return [false, "fdfdfdfd", "141"]; }
, height: 400, width: 400, reloadAfterSubmit: true
});
}
I do get the json error from Server with StatusCode 500
I just wanted to test so I put
return [false, "fdfdfdfd", "141"]
But I always see the default error message
"error Status: 'error'. Error code: 500"
This is a 'new' row adding model form. not inline editing.
Thanks for any help...
| 0 |
11,727,016 | 07/30/2012 18:02:50 | 1,057,045 | 11/21/2011 02:22:35 | 423 | 40 | permission url callback on-login using custom HTML button | I have a facebook button which refreshes my url `on-login`
<fb:login-button perms="email,user_about_me,user_photos" on-login="window.location = 'http://myDomain.com';">Login</fb:login-button>
But if i dont want to use the standard facebook button and decide to use my own markup with javascript<br/>
i seem to having a hard time getting the callback on login<br/>
heres my attempt, any suggestions or help is always appreciated<br/>
thanks<br/>
function fb_oAuth(){
FB.ui({
method: "permissions.request",
"perms": 'email, user_about_me, user_photos'
} , function(response) {
console.log(response);
/* if (response.session) {
window.location.href = 'http://www.myDomain.com';
} */
});
/* FB.Event.subscribe('auth.sessionChange', function(response) {
if (response.session) {
window.location.href = 'http://www.myDomain.com';
} else {
// The user has logged out, and the cookie has been cleared
}
}); */
});
// HTML button
<a href="#" onClick="fb_oAuth(); event.preventDefault();">Login with Facebook</a> | javascript | facebook-graph-api | null | null | null | null | open | permission url callback on-login using custom HTML button
===
I have a facebook button which refreshes my url `on-login`
<fb:login-button perms="email,user_about_me,user_photos" on-login="window.location = 'http://myDomain.com';">Login</fb:login-button>
But if i dont want to use the standard facebook button and decide to use my own markup with javascript<br/>
i seem to having a hard time getting the callback on login<br/>
heres my attempt, any suggestions or help is always appreciated<br/>
thanks<br/>
function fb_oAuth(){
FB.ui({
method: "permissions.request",
"perms": 'email, user_about_me, user_photos'
} , function(response) {
console.log(response);
/* if (response.session) {
window.location.href = 'http://www.myDomain.com';
} */
});
/* FB.Event.subscribe('auth.sessionChange', function(response) {
if (response.session) {
window.location.href = 'http://www.myDomain.com';
} else {
// The user has logged out, and the cookie has been cleared
}
}); */
});
// HTML button
<a href="#" onClick="fb_oAuth(); event.preventDefault();">Login with Facebook</a> | 0 |
7,162,666 | 08/23/2011 14:29:35 | 229,424 | 12/11/2009 06:53:48 | 152 | 1 | a couple of questions about uploadify with CI | 1) what does the fileObj object in the onCOmplete event refer to? The object BEFORE being processed by the php file or AFTER ? Since I rename the image I uploaded in uploadify.php, but fileObj.name will always return the name before the renaming process and fileObj.filePath will return the current URL with '/imagename.jpg' which is not what I want (I'm not using folder options, so maybe because of that?)
2) I'm using CI, so can I convert the backend script (uploadify.php) to a helper? Since I need to create thumbnails and etc using other CI helpers (I know I can do it using PHP too but CI is easier :o )
3) Can I return more than 1 response?
4) I'm trying to limit one post to have maximum 3 images. When adding a new post, it may not be difficult, since I can create input type hidden with the same name to be processed as arrays in the inserting query (don't know whether it will work though, haven't tested yet), but when editing/updating, let's say when I added the post I uploaded 2 images, how can I limit only one image can be uploaded when I'm updating? Or is it too much hassle using uploadify for that?
Thanks for the answers | jquery | codeigniter | uploadify | null | null | null | open | a couple of questions about uploadify with CI
===
1) what does the fileObj object in the onCOmplete event refer to? The object BEFORE being processed by the php file or AFTER ? Since I rename the image I uploaded in uploadify.php, but fileObj.name will always return the name before the renaming process and fileObj.filePath will return the current URL with '/imagename.jpg' which is not what I want (I'm not using folder options, so maybe because of that?)
2) I'm using CI, so can I convert the backend script (uploadify.php) to a helper? Since I need to create thumbnails and etc using other CI helpers (I know I can do it using PHP too but CI is easier :o )
3) Can I return more than 1 response?
4) I'm trying to limit one post to have maximum 3 images. When adding a new post, it may not be difficult, since I can create input type hidden with the same name to be processed as arrays in the inserting query (don't know whether it will work though, haven't tested yet), but when editing/updating, let's say when I added the post I uploaded 2 images, how can I limit only one image can be uploaded when I'm updating? Or is it too much hassle using uploadify for that?
Thanks for the answers | 0 |
7,812,588 | 10/18/2011 19:31:26 | 805,999 | 06/20/2011 04:18:31 | 183 | 19 | WebView button click not working | I have similar problem (or even the same but with no solution yet) as [here][1].<br>
I have webpage with button loaded in WebView. Unfortunately it is not working - clicking the button is not giving results.<br>
Using solution from issue with keyboard makes my button only focus but not clicked. Is there any solution for this problem?
Thanks!
[1]: http://stackoverflow.com/questions/4200259/tapping-form-field-in-webview-does-not-show-soft-keyboard | android | webview | onclick | null | null | 10/26/2011 00:17:30 | not a real question | WebView button click not working
===
I have similar problem (or even the same but with no solution yet) as [here][1].<br>
I have webpage with button loaded in WebView. Unfortunately it is not working - clicking the button is not giving results.<br>
Using solution from issue with keyboard makes my button only focus but not clicked. Is there any solution for this problem?
Thanks!
[1]: http://stackoverflow.com/questions/4200259/tapping-form-field-in-webview-does-not-show-soft-keyboard | 1 |
4,425,691 | 12/13/2010 03:54:20 | 398,650 | 07/22/2010 02:32:06 | 6 | 0 | Which needs to learn Android? | In my opinion, if you want to learn android, you must know OS, Network, OPP and Design Pattern well, that 's enough, about you?? | java | android | null | null | null | 12/13/2010 04:33:03 | not a real question | Which needs to learn Android?
===
In my opinion, if you want to learn android, you must know OS, Network, OPP and Design Pattern well, that 's enough, about you?? | 1 |
6,766,563 | 07/20/2011 18:21:50 | 840,175 | 07/12/2011 06:38:12 | 6 | 0 | using a tag to replace div | my site has 2 pages both have hyperlinks to each other but when user click on that hyperlink I just need a certain div of that page to be replaced by certain div on other page, please guide me how to program it. | javascript | jquery | html | null | null | 07/20/2011 18:24:35 | not a real question | using a tag to replace div
===
my site has 2 pages both have hyperlinks to each other but when user click on that hyperlink I just need a certain div of that page to be replaced by certain div on other page, please guide me how to program it. | 1 |
8,241,853 | 11/23/2011 12:03:16 | 877,717 | 08/04/2011 01:50:39 | 12 | 0 | Executing a .pyc file | I need to run .pyc files using python c api. if i do PyImport_Import it executes the script. However, i need to pass a dictionary which will be accessed from within the script. Does PyImport_ImportModuleEx do this ? If yes, how is the last parameter fromlist to be passed and what purpose does it serve. Tried to send fromlist as an empty list (PyObject *pLO) . However, PyImport_ImportModuleEx crashes.
here x.pyc is the compiled script.
PyObject * p1 = pFPyImport_ImportModuleEx("x", locals, globals, pLO);
Thanks,
| execute | null | null | null | null | null | open | Executing a .pyc file
===
I need to run .pyc files using python c api. if i do PyImport_Import it executes the script. However, i need to pass a dictionary which will be accessed from within the script. Does PyImport_ImportModuleEx do this ? If yes, how is the last parameter fromlist to be passed and what purpose does it serve. Tried to send fromlist as an empty list (PyObject *pLO) . However, PyImport_ImportModuleEx crashes.
here x.pyc is the compiled script.
PyObject * p1 = pFPyImport_ImportModuleEx("x", locals, globals, pLO);
Thanks,
| 0 |
3,052,047 | 06/16/2010 09:25:36 | 247,265 | 01/06/2010 21:25:20 | 4,120 | 19 | Why did exokernels never take off? | http://en.wikipedia.org/wiki/Exokernel
seems like a great idea. Anyone know why it never took off? I'm geniunely curious why it didn't become popular in niche situations (like servers -- there are things do-able in exokernels that are simply impossible in Linux/BSD).
Thanks!
Note: marked at community wiki as this might be considered discussion oriented. | untagged | null | null | null | null | 06/16/2010 13:04:47 | off topic | Why did exokernels never take off?
===
http://en.wikipedia.org/wiki/Exokernel
seems like a great idea. Anyone know why it never took off? I'm geniunely curious why it didn't become popular in niche situations (like servers -- there are things do-able in exokernels that are simply impossible in Linux/BSD).
Thanks!
Note: marked at community wiki as this might be considered discussion oriented. | 2 |
6,345,941 | 06/14/2011 15:18:43 | 1,375,042 | 03/17/2009 15:43:49 | 1,355 | 115 | iTunes style modal view controller chain (form sheet) | Is there a way to achieve the iTunes style modal view controller chain (see screenshot)?
I've looked around quite a bit but couldn't find any real questions about this. I'm not looking for a replacement or workaround, just want to know if it is possible to do with the current SDK (or iOS 5.0, although we are not supposed to talk about it a simple Yes/No would suffice).
For those who can not make it out from the image; iTunes on the iPad has this great feature where you can view a movie in a `formsheet` style `modalviewcontroller`, and if you click on another movie in that same `modalviewcontroller` it will create a new `modalviewcontroller` with the movie info you clicked on and will slide the 'old' one out (to the left). It will slide back in when the center `modalviewcontroller` is dismissed.
![enter image description here][1]
[1]: http://i.stack.imgur.com/WxPNK.png | ios | ipad | modalviewcontroller | null | null | null | open | iTunes style modal view controller chain (form sheet)
===
Is there a way to achieve the iTunes style modal view controller chain (see screenshot)?
I've looked around quite a bit but couldn't find any real questions about this. I'm not looking for a replacement or workaround, just want to know if it is possible to do with the current SDK (or iOS 5.0, although we are not supposed to talk about it a simple Yes/No would suffice).
For those who can not make it out from the image; iTunes on the iPad has this great feature where you can view a movie in a `formsheet` style `modalviewcontroller`, and if you click on another movie in that same `modalviewcontroller` it will create a new `modalviewcontroller` with the movie info you clicked on and will slide the 'old' one out (to the left). It will slide back in when the center `modalviewcontroller` is dismissed.
![enter image description here][1]
[1]: http://i.stack.imgur.com/WxPNK.png | 0 |
5,438,537 | 03/25/2011 21:55:07 | 361,883 | 06/08/2010 23:03:09 | 432 | 0 | Trying to create a jQuery UI modal dialog without a close option | I have a modal dialog that appears over a page that shouldn't be accessed but should still be seen from outside of the modal dialog. I have everything working perfectly except for two problems:
- As soon as the modal dialog appears, the link within it is automatically focused, so there is a blue box around it (just like with any element onto which I am focused), but I don't want this behavior.
- Also, there is an X button to allow the user to close the dialog, and I want to get rid of it.
Any help?
| jquery | jquery-ui | jquery-ui-dialog | null | null | null | open | Trying to create a jQuery UI modal dialog without a close option
===
I have a modal dialog that appears over a page that shouldn't be accessed but should still be seen from outside of the modal dialog. I have everything working perfectly except for two problems:
- As soon as the modal dialog appears, the link within it is automatically focused, so there is a blue box around it (just like with any element onto which I am focused), but I don't want this behavior.
- Also, there is an X button to allow the user to close the dialog, and I want to get rid of it.
Any help?
| 0 |
11,302,104 | 07/02/2012 22:39:08 | 1,497,288 | 07/02/2012 22:31:57 | 1 | 0 | random number in email html only img src | I need to generate a random number as part of an img src call in my gmail footer.
currently the img src calls __utm.gif with several parameters following ?. However, part of one of those ? needs to have a random number in it. Can this be done? I've seen ways to do it with javascript but as this is part of an email, I can't use javascript and need to use html.
yes, i'm using it to track where my contacts are when they open an email. judge me later. it's something that lots of crm programs do but i'm trying to figure out how to do it on my own without paying them.
www.google-analytics.com/__utm.gif?utmwv=4.5.7&utmn=7100164713&utmhn=domain.com/lod&utmcs=ISO-8859-1&utmsr=-&utmsc=-&utmul=en-US&utmje=-&utmfl=-&utmdt=lod&utmr=-&utmp=lod&utmac=UA-#######-1&utmcc=__utma% ****RANDOM NUMBER GOES HERE AS PART OF URL **** %3B%2B__utmz% ****SECOND RANDOM NUMBER GOES HERE AS PART OF URL **** .utmcsr=email|utmccn=pixel|utmcmd=page|utmcct=visitor%3B?utm_source=cp%20gmail&utm_medium=email&utm_campaign=lod | html | random | analytics | img | src | null | open | random number in email html only img src
===
I need to generate a random number as part of an img src call in my gmail footer.
currently the img src calls __utm.gif with several parameters following ?. However, part of one of those ? needs to have a random number in it. Can this be done? I've seen ways to do it with javascript but as this is part of an email, I can't use javascript and need to use html.
yes, i'm using it to track where my contacts are when they open an email. judge me later. it's something that lots of crm programs do but i'm trying to figure out how to do it on my own without paying them.
www.google-analytics.com/__utm.gif?utmwv=4.5.7&utmn=7100164713&utmhn=domain.com/lod&utmcs=ISO-8859-1&utmsr=-&utmsc=-&utmul=en-US&utmje=-&utmfl=-&utmdt=lod&utmr=-&utmp=lod&utmac=UA-#######-1&utmcc=__utma% ****RANDOM NUMBER GOES HERE AS PART OF URL **** %3B%2B__utmz% ****SECOND RANDOM NUMBER GOES HERE AS PART OF URL **** .utmcsr=email|utmccn=pixel|utmcmd=page|utmcct=visitor%3B?utm_source=cp%20gmail&utm_medium=email&utm_campaign=lod | 0 |
2,826,695 | 05/13/2010 12:26:25 | 148,271 | 07/31/2009 04:57:04 | 330 | 53 | Where is ScriptManager.IsStartupScriptRegistered method? | Below is my code
if (!Page.ClientScript.IsStartupScriptRegistered(Page.GetType(), scriptKey))
{
ScriptManager scriptManager = ScriptManager.GetCurrent(page);
if (scriptManager != null && scriptManager.IsInAsyncPostBack)
{
//if a MS AJAX request, use the Scriptmanager class
ScriptManager.RegisterStartupScript(Page, Page.GetType(), scriptKey, script, true);
}
else
{
//if a standard postback, use the standard ClientScript method
Page.ClientScript.RegisterStartupScript(Page.GetType(), scriptKey, script, true);
}
}
I'm doing as suggested in [this][1] answer so that I can register startup script on both times i.e. when there is partial postback and a full postback.
The problem is `Page.ClientScript.IsStartupScriptRegistered(Page.GetType(), scriptKey)` always returns false when it is partial postback. And I couldn't find ScriptManager.IsStartupScriptRegistered method. As a result of this additional script is emitted on all partial/async postbacks.
Please note that I'm using script manager of AjaxControlToolkit version 4.1 i.e. `ToolkitScriptManager` in my masterpage. But I don't thing it has something to do with this.
Thanks in advance.
[1]: http://stackoverflow.com/questions/1952817/asp-net-javascript-inside-ajax-updatepanel/1953122#1953122 | asp.net-ajax | .net-3.5 | ajaxcontroltoolkit | null | null | null | open | Where is ScriptManager.IsStartupScriptRegistered method?
===
Below is my code
if (!Page.ClientScript.IsStartupScriptRegistered(Page.GetType(), scriptKey))
{
ScriptManager scriptManager = ScriptManager.GetCurrent(page);
if (scriptManager != null && scriptManager.IsInAsyncPostBack)
{
//if a MS AJAX request, use the Scriptmanager class
ScriptManager.RegisterStartupScript(Page, Page.GetType(), scriptKey, script, true);
}
else
{
//if a standard postback, use the standard ClientScript method
Page.ClientScript.RegisterStartupScript(Page.GetType(), scriptKey, script, true);
}
}
I'm doing as suggested in [this][1] answer so that I can register startup script on both times i.e. when there is partial postback and a full postback.
The problem is `Page.ClientScript.IsStartupScriptRegistered(Page.GetType(), scriptKey)` always returns false when it is partial postback. And I couldn't find ScriptManager.IsStartupScriptRegistered method. As a result of this additional script is emitted on all partial/async postbacks.
Please note that I'm using script manager of AjaxControlToolkit version 4.1 i.e. `ToolkitScriptManager` in my masterpage. But I don't thing it has something to do with this.
Thanks in advance.
[1]: http://stackoverflow.com/questions/1952817/asp-net-javascript-inside-ajax-updatepanel/1953122#1953122 | 0 |
5,455,389 | 03/28/2011 06:29:04 | 608,227 | 02/05/2011 09:30:17 | 1 | 0 | how to do touch json parsing | i am using touch json parsing in my application and my code is below
id theObject = [[CJSONDeserializer deserializer] deserialize:jsonData error:&theError];
but at this line my application is crash
please help me | iphone | null | null | null | null | 03/28/2011 12:57:21 | not a real question | how to do touch json parsing
===
i am using touch json parsing in my application and my code is below
id theObject = [[CJSONDeserializer deserializer] deserialize:jsonData error:&theError];
but at this line my application is crash
please help me | 1 |
11,735,607 | 07/31/2012 07:58:55 | 1,105,882 | 12/19/2011 12:27:37 | 6 | 0 | Javascript function call into loop each time | I have function called rotator(id) , this function animate div and i can called this function with different id for animate different id
Actually i use 5 differents id , 1,2,3,4,5
And for call i need put :
rotador(1);rotador(2);rotador(3);rotador(4);rotador(5);
The problem it´s i want rotate i automatic mode for this i think use this
for (i=0;i<=5;i++)
{
setTimeout(rotador(i),2000);
}
But no works , because animate all same time , no let firt execute the first and continue before of first go second , etc , etc and when go the end or number 5 start other time in one
My problem it´s this if you can help me THANKS !!! :) Regards
| javascript | jquery | loops | null | null | null | open | Javascript function call into loop each time
===
I have function called rotator(id) , this function animate div and i can called this function with different id for animate different id
Actually i use 5 differents id , 1,2,3,4,5
And for call i need put :
rotador(1);rotador(2);rotador(3);rotador(4);rotador(5);
The problem it´s i want rotate i automatic mode for this i think use this
for (i=0;i<=5;i++)
{
setTimeout(rotador(i),2000);
}
But no works , because animate all same time , no let firt execute the first and continue before of first go second , etc , etc and when go the end or number 5 start other time in one
My problem it´s this if you can help me THANKS !!! :) Regards
| 0 |
910,890 | 05/26/2009 14:08:00 | 29,403 | 10/19/2008 15:33:00 | 2,172 | 91 | Search Tweets by #topic with distinct user | What is a good way to show the most-recent tweets on a #topic by distinct users? For example, if five users have written a combined total of twenty tweets on #example, but one zealot has the fifteen most recent, I want only his latest.
Duplicate-elimination is a plus, because parrots are low value. | twitted | null | null | null | null | 01/02/2012 01:58:11 | off topic | Search Tweets by #topic with distinct user
===
What is a good way to show the most-recent tweets on a #topic by distinct users? For example, if five users have written a combined total of twenty tweets on #example, but one zealot has the fifteen most recent, I want only his latest.
Duplicate-elimination is a plus, because parrots are low value. | 2 |
4,668,093 | 01/12/2011 11:11:36 | 572,607 | 01/12/2011 11:11:36 | 1 | 0 | control application with vb.net code ? | i want to connect a vb.net code , with a different application ( the user denyed from access them untill he enter a password in the vb.net window that appear when he click on that applications )
Is there a way to do this ?
help me please :( | vb.net | application | control | connect | null | null | open | control application with vb.net code ?
===
i want to connect a vb.net code , with a different application ( the user denyed from access them untill he enter a password in the vb.net window that appear when he click on that applications )
Is there a way to do this ?
help me please :( | 0 |
4,617,098 | 01/06/2011 16:22:26 | 67,153 | 02/16/2009 23:43:45 | 5,651 | 279 | is there a built in functionality in php to convert seconds to hh:mm:ss | is there a built in functionality in php to convert seconds to hh:mm:ss | php | time | null | null | null | null | open | is there a built in functionality in php to convert seconds to hh:mm:ss
===
is there a built in functionality in php to convert seconds to hh:mm:ss | 0 |
11,177,453 | 06/24/2012 12:34:27 | 140,448 | 07/17/2009 22:00:35 | 1,063 | 41 | Best method for Node.JS forking? | I'm writing a trajectory predictor in Node.JS. You may think it's a funny language to write one in, but it's actually working great. Now, I want to be able to start the predictor from a web interface in Node.JS.
The actual predictor process takes about 5 minutes to run. So to spawn it from the Node web process, I don't want the web process waiting for the child process to finish. What is the best method of forking, in Node.JS, to allow for spawning and releasing a process like this?
| node.js | null | null | null | null | null | open | Best method for Node.JS forking?
===
I'm writing a trajectory predictor in Node.JS. You may think it's a funny language to write one in, but it's actually working great. Now, I want to be able to start the predictor from a web interface in Node.JS.
The actual predictor process takes about 5 minutes to run. So to spawn it from the Node web process, I don't want the web process waiting for the child process to finish. What is the best method of forking, in Node.JS, to allow for spawning and releasing a process like this?
| 0 |
199,145 | 10/13/2008 21:50:02 | 1,310 | 08/14/2008 13:42:16 | 1,748 | 65 | How do you programatically authenticate to a web server using NTLM Authentication with apache's commons httpclient? | I'm using this code, and I get the stack trace that is listed below.
I've got this working with just https and with basic authentication, but not ntlm.
HttpClient client = null;
HttpMethod get = null;
try
{
Protocol myhttps = new Protocol("https", ((ProtocolSocketFactory) new EasySSLProtocolSocketFactory()), 443);
Protocol.registerProtocol("https", myhttps);
client = new HttpClient();
get = new GetMethod("https://tt.dummycorp.com/tmtrack/");
Credentials creds = new NTCredentials("dummy", "dummy123", "host", "DUMMYDOMAIN");
client.getState().setCredentials(AuthScope.ANY, creds);
get.setDoAuthentication(true);
int resultCode = client.executeMethod(get);
System.out.println(get.getResponseBodyAsString());
}
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:623)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:828)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2116)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at com.dummycorp.teamtrack.TeamTrackHack.main(TeamTrackHack.java:38)
Caused by: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed
at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:251)
at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:234)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:158)
at sun.security.validator.Validator.validate(Validator.java:218)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)
at org.apache.commons.httpclient.contrib.ssl.EasyX509TrustManager.checkServerTrusted(EasyX509TrustManager.java:104)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:967)
... 17 more
Caused by: java.security.cert.CertPathValidatorException: signature check failed
at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:139)
at sun.security.provider.certpath.PKIXCertPathValidator.doValidate(PKIXCertPathValidator.java:316)
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:178)
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:250)
at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:246)
... 24 more
Caused by: java.security.SignatureException: Signature does not match.
at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:446)
at sun.security.provider.certpath.BasicChecker.verifySignature(BasicChecker.java:133)
at sun.security.provider.certpath.BasicChecker.check(BasicChecker.java:112)
at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:117)
... 28 more | java | httpclient | null | null | null | null | open | How do you programatically authenticate to a web server using NTLM Authentication with apache's commons httpclient?
===
I'm using this code, and I get the stack trace that is listed below.
I've got this working with just https and with basic authentication, but not ntlm.
HttpClient client = null;
HttpMethod get = null;
try
{
Protocol myhttps = new Protocol("https", ((ProtocolSocketFactory) new EasySSLProtocolSocketFactory()), 443);
Protocol.registerProtocol("https", myhttps);
client = new HttpClient();
get = new GetMethod("https://tt.dummycorp.com/tmtrack/");
Credentials creds = new NTCredentials("dummy", "dummy123", "host", "DUMMYDOMAIN");
client.getState().setCredentials(AuthScope.ANY, creds);
get.setDoAuthentication(true);
int resultCode = client.executeMethod(get);
System.out.println(get.getResponseBodyAsString());
}
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:623)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:828)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2116)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at com.dummycorp.teamtrack.TeamTrackHack.main(TeamTrackHack.java:38)
Caused by: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed
at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:251)
at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:234)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:158)
at sun.security.validator.Validator.validate(Validator.java:218)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)
at org.apache.commons.httpclient.contrib.ssl.EasyX509TrustManager.checkServerTrusted(EasyX509TrustManager.java:104)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:967)
... 17 more
Caused by: java.security.cert.CertPathValidatorException: signature check failed
at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:139)
at sun.security.provider.certpath.PKIXCertPathValidator.doValidate(PKIXCertPathValidator.java:316)
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:178)
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:250)
at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:246)
... 24 more
Caused by: java.security.SignatureException: Signature does not match.
at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:446)
at sun.security.provider.certpath.BasicChecker.verifySignature(BasicChecker.java:133)
at sun.security.provider.certpath.BasicChecker.check(BasicChecker.java:112)
at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:117)
... 28 more | 0 |
2,725,070 | 04/27/2010 20:57:24 | 289,666 | 03/09/2010 13:00:04 | 525 | 20 | most seo'd method for date in url structure? | I'm working on an events website so dates are very important search terms, ie: '*whats on on fri 14th september*'
I've seen it done in various methods for example:
domain/whats-on/city-hall/14-09-2010/event-name.html
domain/whats-on/city-hall/2010/09/14/event-name.html
the first is 'shallower'.
the second could be clearer for google to synonym-ize as a date,
has anyone else got any experience or input? | seo | google | null | null | null | 04/27/2010 21:20:30 | off topic | most seo'd method for date in url structure?
===
I'm working on an events website so dates are very important search terms, ie: '*whats on on fri 14th september*'
I've seen it done in various methods for example:
domain/whats-on/city-hall/14-09-2010/event-name.html
domain/whats-on/city-hall/2010/09/14/event-name.html
the first is 'shallower'.
the second could be clearer for google to synonym-ize as a date,
has anyone else got any experience or input? | 2 |
5,256,767 | 03/10/2011 07:38:39 | 602,676 | 02/04/2011 05:45:46 | 40 | 0 | plotting points over an image | I've an image over which i need to plot some points. The problem is that the points appear for a fraction of a second and then disappear. How to make the points permanent over the image. I've set the image as the background of the form.
I'm working on C# .net framework.
Thanks. | c# | points | null | null | null | null | open | plotting points over an image
===
I've an image over which i need to plot some points. The problem is that the points appear for a fraction of a second and then disappear. How to make the points permanent over the image. I've set the image as the background of the form.
I'm working on C# .net framework.
Thanks. | 0 |
5,538,694 | 04/04/2011 12:50:30 | 519,465 | 11/24/2010 22:46:30 | 1 | 0 | PHP/MySql Test Application | It's rather a general, conceptual question, but I'm developing a test/quiz application at the moment, and want to
a) be able to change the questions/ answers / orders whenever I want
b) save every completed test, complete with report, in the database
I've built the back end (in CI) so there is a nice user friendly way to edit the questions, but I'm trying to think of the best way to save the completed tests, without memory & space wastage.
Trouble is, if I change the test questions, I don't want them to alter the archived saved results that people have taken in the past. So I'm thinking I need to serialize every single question when someone takes a test, so that you can view the old 'report cards' with legacy questions on them, even if those questions no longer exist.
This seems bulky though, with 40+ questions needing to be saved for every test someone takes. Anyone have a better idea?
Thanks! | php | mysql | serialization | null | null | null | open | PHP/MySql Test Application
===
It's rather a general, conceptual question, but I'm developing a test/quiz application at the moment, and want to
a) be able to change the questions/ answers / orders whenever I want
b) save every completed test, complete with report, in the database
I've built the back end (in CI) so there is a nice user friendly way to edit the questions, but I'm trying to think of the best way to save the completed tests, without memory & space wastage.
Trouble is, if I change the test questions, I don't want them to alter the archived saved results that people have taken in the past. So I'm thinking I need to serialize every single question when someone takes a test, so that you can view the old 'report cards' with legacy questions on them, even if those questions no longer exist.
This seems bulky though, with 40+ questions needing to be saved for every test someone takes. Anyone have a better idea?
Thanks! | 0 |
6,885,237 | 07/30/2011 18:44:20 | 312,692 | 04/09/2010 10:41:09 | 598 | 11 | What is a classic homework problem for writing a neural network? | I've been a computer science student for three years now, yet never had to implement a neural network. I would like to learn how to do this, and therefore my question:
What is a classic/fun/easy homework problem, that you can solve with a (simple) neural network? | homework | neural-network | null | null | null | 07/31/2011 07:23:49 | off topic | What is a classic homework problem for writing a neural network?
===
I've been a computer science student for three years now, yet never had to implement a neural network. I would like to learn how to do this, and therefore my question:
What is a classic/fun/easy homework problem, that you can solve with a (simple) neural network? | 2 |
4,880,309 | 02/02/2011 21:53:51 | 284,560 | 03/02/2010 16:18:00 | 150 | 13 | Testing UNC path with subfolders | I want to test the existence of a sub folder on a file share using Test-Path and Resolve-Path. First I create a share on my machine \\someshare\somefolder. Then using file explorer I add a sub folder so the entire path looks like this: \\someshare\somefolder\subfolder
Test-Path \\someshare\somefolder results in True
Test-Path \\someshare\somefolder\subfolder results in False
Resolve-Path \\someshare\somefolder results in True
Revolve-Path \\someshare\somefolder\subfolder results in does not exist error
why does powershell not return true for the subfolders?
| powershell | null | null | null | null | null | open | Testing UNC path with subfolders
===
I want to test the existence of a sub folder on a file share using Test-Path and Resolve-Path. First I create a share on my machine \\someshare\somefolder. Then using file explorer I add a sub folder so the entire path looks like this: \\someshare\somefolder\subfolder
Test-Path \\someshare\somefolder results in True
Test-Path \\someshare\somefolder\subfolder results in False
Resolve-Path \\someshare\somefolder results in True
Revolve-Path \\someshare\somefolder\subfolder results in does not exist error
why does powershell not return true for the subfolders?
| 0 |
6,743,270 | 07/19/2011 06:50:12 | 8,741 | 09/15/2008 16:46:16 | 4,405 | 96 | Enable and require SSL for certain actions in an MVC3 application. | I am busy setting up a protocol between my payments service provider and my site. They use Immediate Payment Notification (IPN), where they contact a URL in my site when the payment is processed, sending me confirmation data. I would like to secure this URL, and one or two others, using SSL. The majority of actions don't require this, as no sensitive data is passed during normal operations, only payments, logins, and uploads. | asp.net | asp.net-mvc | asp.net-mvc-3 | ssl | web-security | null | open | Enable and require SSL for certain actions in an MVC3 application.
===
I am busy setting up a protocol between my payments service provider and my site. They use Immediate Payment Notification (IPN), where they contact a URL in my site when the payment is processed, sending me confirmation data. I would like to secure this URL, and one or two others, using SSL. The majority of actions don't require this, as no sensitive data is passed during normal operations, only payments, logins, and uploads. | 0 |
7,601,090 | 09/29/2011 17:30:32 | 966,691 | 09/27/2011 09:25:01 | 17 | 0 | how to pass model from json to view? | i have a button on my view when fire it execute GetReport() and it execute :public ActionResult GetReport(int licenseId) by json.
now public ActionResult GetReport(int licenseId) fill my model and return it by json.
everythings are correct but i do not know how link returned model (by json) to my view?
function GetReport() {
var id = $("select#LicensesDropdown").val();
if (id == null || id == '')
return;
var inputParams = "{licenseId : '" + id + "'}";
var abc;
$.ajax({
url: "/Members/ClientMonitoring/GetReport",
type: 'POST',
dataType: 'json',
data: inputParams,
contentType: 'application/json; charset=utf-8',
success: function (msg) {
var d = Date.parseJSON(msg.StartDate);<-----------------returned filled model-------------
here i don't know how to fill my grid now
}
});
}
My Model---------------------------------------------------------------------------------------------------------------------
public class ReportBaseModel
{
public List<person> MonitoringLicenseModelsList { get; set; }
}
my action result----------------------------------------------------------------------------------------------------------
[HttpPost]
public ActionResult GetReport(int licenseId)
{
// fill reportmodel it contains list of data and return it by jason
return Json(reportmodel);
}
in my view --------------------------------------------------------------------------------------------------------------
@model Karanoos.Areas.Members.Models.CompositModels.ReportBaseModel
<input id="ButtonGetReport" type="button" value="Report" class="btnnormal" onclick="GetReport();" />
@{
var grid = new WebGrid(source: Model.LicensesClientsPacketModelsList,
defaultSort: "LicenseUI",
rowsPerPage: 3);
}
<div id="grid">
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("LicenseUI"),
grid.Column("AccountName"),
grid.Column("AppName")
)
)
</div> | json | null | null | null | null | null | open | how to pass model from json to view?
===
i have a button on my view when fire it execute GetReport() and it execute :public ActionResult GetReport(int licenseId) by json.
now public ActionResult GetReport(int licenseId) fill my model and return it by json.
everythings are correct but i do not know how link returned model (by json) to my view?
function GetReport() {
var id = $("select#LicensesDropdown").val();
if (id == null || id == '')
return;
var inputParams = "{licenseId : '" + id + "'}";
var abc;
$.ajax({
url: "/Members/ClientMonitoring/GetReport",
type: 'POST',
dataType: 'json',
data: inputParams,
contentType: 'application/json; charset=utf-8',
success: function (msg) {
var d = Date.parseJSON(msg.StartDate);<-----------------returned filled model-------------
here i don't know how to fill my grid now
}
});
}
My Model---------------------------------------------------------------------------------------------------------------------
public class ReportBaseModel
{
public List<person> MonitoringLicenseModelsList { get; set; }
}
my action result----------------------------------------------------------------------------------------------------------
[HttpPost]
public ActionResult GetReport(int licenseId)
{
// fill reportmodel it contains list of data and return it by jason
return Json(reportmodel);
}
in my view --------------------------------------------------------------------------------------------------------------
@model Karanoos.Areas.Members.Models.CompositModels.ReportBaseModel
<input id="ButtonGetReport" type="button" value="Report" class="btnnormal" onclick="GetReport();" />
@{
var grid = new WebGrid(source: Model.LicensesClientsPacketModelsList,
defaultSort: "LicenseUI",
rowsPerPage: 3);
}
<div id="grid">
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("LicenseUI"),
grid.Column("AccountName"),
grid.Column("AppName")
)
)
</div> | 0 |
11,670,129 | 07/26/2012 13:14:58 | 1,285,928 | 03/22/2012 12:39:23 | 61 | 6 | How to create h:commandButton in JSF to open a new page | I want to create command button in JSF page. When I press it I want to open a new page and send a value using using the http. I tested this `h:commnadButton` but it's not working.
<h:commandButton id="lnkHidden" value=" Edit User " action="EditAccountProfile.jsf">
<f:param name="id" value="#{item.userid}" />
</h:commandButton> | jsf | jsf-2.0 | null | null | null | null | open | How to create h:commandButton in JSF to open a new page
===
I want to create command button in JSF page. When I press it I want to open a new page and send a value using using the http. I tested this `h:commnadButton` but it's not working.
<h:commandButton id="lnkHidden" value=" Edit User " action="EditAccountProfile.jsf">
<f:param name="id" value="#{item.userid}" />
</h:commandButton> | 0 |
5,495,084 | 03/31/2011 03:38:40 | 685,050 | 03/31/2011 03:38:40 | 1 | 0 | Tree proof About Simple Cycle | I am trying to prove the following:
Let A be a tree and let x and y be any 2 nodes such that (x,y) is not an edge. Let B be the graph acquired from A by adding the edge (x,y). Prove that B has exactly 1 simple cycle. | graph | null | null | null | null | 03/31/2011 12:55:58 | off topic | Tree proof About Simple Cycle
===
I am trying to prove the following:
Let A be a tree and let x and y be any 2 nodes such that (x,y) is not an edge. Let B be the graph acquired from A by adding the edge (x,y). Prove that B has exactly 1 simple cycle. | 2 |
8,048,663 | 11/08/2011 10:01:40 | 956,689 | 09/21/2011 10:27:33 | 423 | 1 | provides no initializer for.....? What? | Pickup::Pickup(std::vector<Agent, std::allocator<Agent>> &agents)" provides no initializer for:
I'm getting this error for a number of my constructors, annoyingly the error ends abruptly just before it tells me what I'm not providing an initialiser for. Additionally, I'm pretty certain I am in fact providing initialization for everything that needs it. Can anyone shed any light on this?
#include "Pickup.h"
Pickup::Pickup(vector<Agent>& agents)
: GameObject(), TOLERANCE(0.1f)
{ // this brace is underlined and is where the error occurs.
xRotation = D3DXVECTOR3(0.005f, 0.005f, 0.04f);
count = 0;
index = -1;
nodeIndex = -1;
isPresent = true;
}
void Pickup::Regenerate()
{
//when the pickup gets picked up, start a countdown
count++;
if (count == 300)
{
isPresent = true;
count = 0;
}
}
//void Pickup::addAmmo(int agentIndex) { }
void Pickup::Update()
{
Rotation(Rotation() + xRotation);
for (unsigned int i = 0; i < agents.size(); i++)
{
//if (D3DXVec3Length(agents[i].MainLegsPosition() - Position()) < TOLERANCE && isPresent)//right here
//{
// addAmmo(agents[i].Index());
// isPresent = false;
//}
}
if (isPresent == false)
{
Regenerate();
}
}
/*void Pickup::Draw(D3DXMATRIX matView, D3DXMATRIX matProjection, ID3D10Effect* effect)//right here
{
if (isPresent == true)
{
Draw(matView, matProjection, effect);
}
}*/
// getters
int Pickup::Index()
{
return index;
}
int Pickup::NodeIndex()
{
return nodeIndex;
}
bool Pickup::IsPresent()
{
return isPresent;
}
/* vector<Agent>& Pickup::Agents()
{
return agents;
}*/
// setters
void Pickup::Index(int index)
{
this->index = index;
}
void Pickup::NodeIndex(int nodeIndex)
{
this->nodeIndex = nodeIndex;
}
header:
#ifndef PICKUP_H
#define PICKUP_H
#include "gameObject.h"
#include "Agent.h"
#include <vector>
using namespace std;
class Pickup : public GameObject
{
private:
int count;
int index;
int nodeIndex;
bool isPresent;
D3DXVECTOR3 xRotation;
const float TOLERANCE;
void Regenerate();
protected:
vector<Agent>& agents;
public:
Pickup(vector<Agent>& agents);
virtual void addAmmo(int agentIndex);
void Update();
void Draw();
// getters
int Index();
int NodeIndex();
bool IsPresent();
// setters
void Index(int index);
void NodeIndex(int nodeIndex);
};
#endif | c++ | null | null | null | null | 11/08/2011 10:14:27 | too localized | provides no initializer for.....? What?
===
Pickup::Pickup(std::vector<Agent, std::allocator<Agent>> &agents)" provides no initializer for:
I'm getting this error for a number of my constructors, annoyingly the error ends abruptly just before it tells me what I'm not providing an initialiser for. Additionally, I'm pretty certain I am in fact providing initialization for everything that needs it. Can anyone shed any light on this?
#include "Pickup.h"
Pickup::Pickup(vector<Agent>& agents)
: GameObject(), TOLERANCE(0.1f)
{ // this brace is underlined and is where the error occurs.
xRotation = D3DXVECTOR3(0.005f, 0.005f, 0.04f);
count = 0;
index = -1;
nodeIndex = -1;
isPresent = true;
}
void Pickup::Regenerate()
{
//when the pickup gets picked up, start a countdown
count++;
if (count == 300)
{
isPresent = true;
count = 0;
}
}
//void Pickup::addAmmo(int agentIndex) { }
void Pickup::Update()
{
Rotation(Rotation() + xRotation);
for (unsigned int i = 0; i < agents.size(); i++)
{
//if (D3DXVec3Length(agents[i].MainLegsPosition() - Position()) < TOLERANCE && isPresent)//right here
//{
// addAmmo(agents[i].Index());
// isPresent = false;
//}
}
if (isPresent == false)
{
Regenerate();
}
}
/*void Pickup::Draw(D3DXMATRIX matView, D3DXMATRIX matProjection, ID3D10Effect* effect)//right here
{
if (isPresent == true)
{
Draw(matView, matProjection, effect);
}
}*/
// getters
int Pickup::Index()
{
return index;
}
int Pickup::NodeIndex()
{
return nodeIndex;
}
bool Pickup::IsPresent()
{
return isPresent;
}
/* vector<Agent>& Pickup::Agents()
{
return agents;
}*/
// setters
void Pickup::Index(int index)
{
this->index = index;
}
void Pickup::NodeIndex(int nodeIndex)
{
this->nodeIndex = nodeIndex;
}
header:
#ifndef PICKUP_H
#define PICKUP_H
#include "gameObject.h"
#include "Agent.h"
#include <vector>
using namespace std;
class Pickup : public GameObject
{
private:
int count;
int index;
int nodeIndex;
bool isPresent;
D3DXVECTOR3 xRotation;
const float TOLERANCE;
void Regenerate();
protected:
vector<Agent>& agents;
public:
Pickup(vector<Agent>& agents);
virtual void addAmmo(int agentIndex);
void Update();
void Draw();
// getters
int Index();
int NodeIndex();
bool IsPresent();
// setters
void Index(int index);
void NodeIndex(int nodeIndex);
};
#endif | 3 |
1,725,880 | 11/12/2009 22:33:40 | 40,956 | 11/26/2008 09:02:45 | 91 | 8 | Android: best practices for SQLite DB and ContentProvider | My Android app is reading and writing to a local SQLite DB from a few different Activities and a Service. Pretty standard. But I'm not happy with the way I've got all the DB details stored as constants that I then use anywhere I access the DB. I've been advised to wrap the DB in a ContentProvider. Sounds good to me. While I'm refactoring my code, I figured I'd ask:
* What are your best practices for local DB data storage in Android?
* Where and how do you store "CREATE TABLE" statements, column names, other SQL?
* Would you mind sharing a list of the classes you instantiate and what goes into each (ContentProvider, DatabaseProvider, DatabaseHelper...)?
* How do you coordinate the structure of your local Android DB with a server-side DB available through a REST interface?
Yeah, I realize I'm getting at the perennial "where's the Android object-relation-mapping framework?" question. For now, I'm mainly curious to hear how you structure your Android apps with what's available in the standard SDK.
As always, thanks for the pointers! | android | orm | null | null | null | null | open | Android: best practices for SQLite DB and ContentProvider
===
My Android app is reading and writing to a local SQLite DB from a few different Activities and a Service. Pretty standard. But I'm not happy with the way I've got all the DB details stored as constants that I then use anywhere I access the DB. I've been advised to wrap the DB in a ContentProvider. Sounds good to me. While I'm refactoring my code, I figured I'd ask:
* What are your best practices for local DB data storage in Android?
* Where and how do you store "CREATE TABLE" statements, column names, other SQL?
* Would you mind sharing a list of the classes you instantiate and what goes into each (ContentProvider, DatabaseProvider, DatabaseHelper...)?
* How do you coordinate the structure of your local Android DB with a server-side DB available through a REST interface?
Yeah, I realize I'm getting at the perennial "where's the Android object-relation-mapping framework?" question. For now, I'm mainly curious to hear how you structure your Android apps with what's available in the standard SDK.
As always, thanks for the pointers! | 0 |
8,891,916 | 01/17/2012 09:00:36 | 345,659 | 05/20/2010 02:17:25 | 805 | 47 | Linq to Entities insert multiple child relationship records for many-to-many relationship using POCO | I have a database similar to below:
Order
===============
OrderID
Description
EmployeeID
...other fields
Product
===============
ProductID
...other fields
OrderProducts
===============
OrderID
ProductID
Employee
===============
EmployeeID
...other fields
<br /><br />
I'm using Linq to Entities and the **edmx file has been created without the OrderProducts table, as it is just a joining table**. The Products table is a list of static products - I dont need to insert any rows at the moment. The Order table I can insert rows successfully using the following code:
[Serializable]
public class MyOrderObject
{
public int OrderID { get; set; }
public string OrderDescription { get; set; }
public int? EmployeeID { get; set; }
public IEnumerable<MyProductObject> ProductsList { get; set; }
...other fields
}
[Serializable]
public class MyProductObject
{
public int ProductID { get; set; }
...other fields
}
private static void AddNewOrder(MyOrderObject order)
{
using (var context = DatabaseHelper.CreateContext())
{
var dbOrder = new Order
{
OrderID = order.OrderID,
Description = order.OrderDescription,
Employee = context.Employees.SingleOrDefault(x => x.EmployeeID == order.EmployeeID),
}
context.AddToOrders(dbOrder);
context.SaveChanges();
}
}
**How do I insert my list of child relationship records??**
I've tried:
List<int> ProductIDs = order.ProductsList.Select(x => x.ProductID).ToList();
//dbOrder.Products.Attach(context.Products.Where(x => ProductIDs.Contains(x.ProductID)));
//or dbOrder.Products = context.Products.Where(x => ProductIDs.Contains(x.ProductID));
//or dbOrder.Products = context.Products.Contains(ProductIDs);
//or foreach(var p in order.ProductsList)
// {
// context.AttachTo("Products", new Product { ProductID = p.ProductID });
// }
| c# | asp.net | entity-framework | linq-to-entities | many-to-many | null | open | Linq to Entities insert multiple child relationship records for many-to-many relationship using POCO
===
I have a database similar to below:
Order
===============
OrderID
Description
EmployeeID
...other fields
Product
===============
ProductID
...other fields
OrderProducts
===============
OrderID
ProductID
Employee
===============
EmployeeID
...other fields
<br /><br />
I'm using Linq to Entities and the **edmx file has been created without the OrderProducts table, as it is just a joining table**. The Products table is a list of static products - I dont need to insert any rows at the moment. The Order table I can insert rows successfully using the following code:
[Serializable]
public class MyOrderObject
{
public int OrderID { get; set; }
public string OrderDescription { get; set; }
public int? EmployeeID { get; set; }
public IEnumerable<MyProductObject> ProductsList { get; set; }
...other fields
}
[Serializable]
public class MyProductObject
{
public int ProductID { get; set; }
...other fields
}
private static void AddNewOrder(MyOrderObject order)
{
using (var context = DatabaseHelper.CreateContext())
{
var dbOrder = new Order
{
OrderID = order.OrderID,
Description = order.OrderDescription,
Employee = context.Employees.SingleOrDefault(x => x.EmployeeID == order.EmployeeID),
}
context.AddToOrders(dbOrder);
context.SaveChanges();
}
}
**How do I insert my list of child relationship records??**
I've tried:
List<int> ProductIDs = order.ProductsList.Select(x => x.ProductID).ToList();
//dbOrder.Products.Attach(context.Products.Where(x => ProductIDs.Contains(x.ProductID)));
//or dbOrder.Products = context.Products.Where(x => ProductIDs.Contains(x.ProductID));
//or dbOrder.Products = context.Products.Contains(ProductIDs);
//or foreach(var p in order.ProductsList)
// {
// context.AttachTo("Products", new Product { ProductID = p.ProductID });
// }
| 0 |
4,411,089 | 12/10/2010 16:36:09 | 434,439 | 08/29/2010 21:32:47 | 157 | 6 | How popular are different Continuous Integration frameworks? | Interesting question that came up in discussion with a friend. Does anyone have any hard and fast usage data on how many people use different CI frameworks? I'm guessing they're more used in the .net and java communities than say ruby or python. Does usage of different frameworks differ much?
I'm guessing more people use say CruiseControl.net for .net projects, than java - but does anyone have actual empirical evidence? I hear hudson is quite popular, but does anyone know what percentage of people use it, or indeed any CI framework at all? | c# | java | .net | continuous-integration | hudson | 12/10/2010 16:46:34 | not constructive | How popular are different Continuous Integration frameworks?
===
Interesting question that came up in discussion with a friend. Does anyone have any hard and fast usage data on how many people use different CI frameworks? I'm guessing they're more used in the .net and java communities than say ruby or python. Does usage of different frameworks differ much?
I'm guessing more people use say CruiseControl.net for .net projects, than java - but does anyone have actual empirical evidence? I hear hudson is quite popular, but does anyone know what percentage of people use it, or indeed any CI framework at all? | 4 |
4,504,917 | 12/21/2010 23:26:12 | 59,639 | 01/28/2009 06:09:55 | 98 | 11 | IE 9 in IE8 Browser Mode/Document mode supports SVG? | I just upgraded to IE9 to do cross browser compatibility testing of my site, which uses Raphael.js. I know my site and its Raphael.js graphics work in IE8 proper using VML, but for some reason, when I set IE9 to have IE8 Browser Mode/Document Mode, Raphael.js tries to use SVG instead of VML. This doesn't happen when I set IE9 to IE7 Browser Mode/Document Mode; that is, Rapahel.js uses VML. Why does IE9 think that IE8 supported SVG? | internet-explorer | internet-explorer-8 | raphael | internet-explorer-9 | null | null | open | IE 9 in IE8 Browser Mode/Document mode supports SVG?
===
I just upgraded to IE9 to do cross browser compatibility testing of my site, which uses Raphael.js. I know my site and its Raphael.js graphics work in IE8 proper using VML, but for some reason, when I set IE9 to have IE8 Browser Mode/Document Mode, Raphael.js tries to use SVG instead of VML. This doesn't happen when I set IE9 to IE7 Browser Mode/Document Mode; that is, Rapahel.js uses VML. Why does IE9 think that IE8 supported SVG? | 0 |
10,334,369 | 04/26/2012 13:23:47 | 591,826 | 01/27/2011 07:46:05 | 331 | 4 | Creating new gui components with win32 API | everybody,
can you tell me is there any ways to create new gui controls(for example accordion bar, etc) in win32 api. Please if you know tell me books or links for reading.
Thanks. | winapi | win32gui | null | null | null | 04/27/2012 05:19:29 | not a real question | Creating new gui components with win32 API
===
everybody,
can you tell me is there any ways to create new gui controls(for example accordion bar, etc) in win32 api. Please if you know tell me books or links for reading.
Thanks. | 1 |
11,704,906 | 07/28/2012 21:46:35 | 1,331,704 | 04/13/2012 13:31:57 | 1 | 0 | How do I store an app user's email address on our server? | How do I store an app user's email address on our server once I've requested the permission on Facebook's side?
I know very little to nothing about servers and little programming, but I'm wondering how/where the emails I request on my app are stored on my server?
Thanks so much!
Dan | facebook | email | application | store | null | 07/30/2012 05:14:24 | not a real question | How do I store an app user's email address on our server?
===
How do I store an app user's email address on our server once I've requested the permission on Facebook's side?
I know very little to nothing about servers and little programming, but I'm wondering how/where the emails I request on my app are stored on my server?
Thanks so much!
Dan | 1 |
9,001,362 | 01/25/2012 10:44:55 | 671,667 | 03/22/2011 17:16:47 | 16 | 1 | How to get the html header values like h1 using html parser dom? | how to get the header value like h1 or h2 which lies inside a div having some class name using simple html parser dom?
ex: - `<html>
<body>
<div class="somename">
<h1>MyText</h1>
</div>
</body>
</html> ` | php | null | null | null | null | null | open | How to get the html header values like h1 using html parser dom?
===
how to get the header value like h1 or h2 which lies inside a div having some class name using simple html parser dom?
ex: - `<html>
<body>
<div class="somename">
<h1>MyText</h1>
</div>
</body>
</html> ` | 0 |
8,003,288 | 11/03/2011 23:37:35 | 668,236 | 03/20/2011 13:33:34 | 91 | 3 | Refresh without reload | I have this div i which I add more divs with javascript.
However, everytime I add a new div the to div with javascript, it refreshes so for example a youtube video in on of those divs will stop.
Can I put these divs into the div without reloading it?
Thanks in advance, enji | javascript | refresh | reload | null | null | 11/12/2011 23:11:35 | not a real question | Refresh without reload
===
I have this div i which I add more divs with javascript.
However, everytime I add a new div the to div with javascript, it refreshes so for example a youtube video in on of those divs will stop.
Can I put these divs into the div without reloading it?
Thanks in advance, enji | 1 |
9,103,542 | 02/01/2012 21:21:35 | 915,839 | 08/27/2011 20:13:53 | 12 | 0 | SQL model/schema design, check constraints, FK or table redesign? | I have the following models (simplified leaving all other fields out, focusing on primary key ID's):
[invoice]
invoice_id
customer_id
invoice_description
[customer]
customer_id
company_id
customer_name
[company]
company_id
company_name
[strategy]
strategy_id
strategy_descripton
A company contains many customers, which in turn can have many invoices belonging to that customer.
Although not shown above, I also wish to have a list of strategies, that belong to a company (and only one company).
I would like the customer, invoice, and company, to be able to define a 'default strategy' which references a strategy of the company to which they belong.
I know i could put an extra FK field called strategy_id in each table (invoice, customer and company), but how can i ensure that if changes are made (someone tries to move a strategy to a different company) we do not end up with an invoice, or customer pointing to a strategy that belongs in another company's strategy list?
How would i deal with this - Do i need to check all this in business logic, or use check constraints, or can this be achieved through table redesign and foreign keys?
Many thanks in advance,
Chris | sql | entity-relationship | database-schema | null | null | null | open | SQL model/schema design, check constraints, FK or table redesign?
===
I have the following models (simplified leaving all other fields out, focusing on primary key ID's):
[invoice]
invoice_id
customer_id
invoice_description
[customer]
customer_id
company_id
customer_name
[company]
company_id
company_name
[strategy]
strategy_id
strategy_descripton
A company contains many customers, which in turn can have many invoices belonging to that customer.
Although not shown above, I also wish to have a list of strategies, that belong to a company (and only one company).
I would like the customer, invoice, and company, to be able to define a 'default strategy' which references a strategy of the company to which they belong.
I know i could put an extra FK field called strategy_id in each table (invoice, customer and company), but how can i ensure that if changes are made (someone tries to move a strategy to a different company) we do not end up with an invoice, or customer pointing to a strategy that belongs in another company's strategy list?
How would i deal with this - Do i need to check all this in business logic, or use check constraints, or can this be achieved through table redesign and foreign keys?
Many thanks in advance,
Chris | 0 |
7,803,804 | 10/18/2011 07:26:31 | 485,743 | 10/24/2010 17:21:38 | 1,855 | 9 | Benefits of HTML5 and CSS3 | What are the benefits of using HTML5 and CSS3 a) from development perspective b) from end user perepective ?
I know the standard CSS3 things like border radius, gradient, transforms ,etc
Also any downside of using HTML5 apart from lack of support in older browsers ? | html5 | css3 | null | null | null | 11/14/2011 05:04:35 | not constructive | Benefits of HTML5 and CSS3
===
What are the benefits of using HTML5 and CSS3 a) from development perspective b) from end user perepective ?
I know the standard CSS3 things like border radius, gradient, transforms ,etc
Also any downside of using HTML5 apart from lack of support in older browsers ? | 4 |
4,288,227 | 11/26/2010 20:00:08 | 492,848 | 10/31/2010 16:32:07 | 20 | 4 | Custom header and footer in an iPhone table view | I'm trying to implement something just like the HeaderFooter sample code that apple provides:
http://developer.apple.com/library/ios/#samplecode/HeaderFooter/Introduction/Intro.html
Unfortunately they used Interface Builder to do most of the work here, and I'm beginning to see that interface builder is the hardest thing to deal with in iPhone development.
My table works fine, but the header and footer aren't there at all. My question is how can I make it work.
My code is identical to Apple's, with a few name changes:
- (void)viewDidLoad
{
// headerView
CGRect newFrame = CGRectMake(0.0, 0.0, self.tableView.bounds.size.width, self.headerView.frame.size.height);
self.headerView.backgroundColor = [UIColor clearColor];
self.headerView.frame = newFrame;
self.tableView.tableHeaderView = self.headerView; // note this will override UITableView's 'sectionHeaderHeight' property
// set up the table's footer view based on our UIView 'myFooterView' outlet
newFrame = CGRectMake(0.0, 0.0, self.tableView.bounds.size.width, self.footerView.frame.size.height);
self.footerView.backgroundColor = [UIColor clearColor];
self.footerView.frame = newFrame;
self.tableView.tableFooterView = self.footerView; // note this will override UITableView's 'sectionFooterHeight' property
//...
The problem must be in my xib file, but the sample file has one giant nib that defines everything, all the way back to the window so I can't use that. I had to make my own.
I started with a uitableviewcontroller and nib and added header and footer views views to the nib.
I connected them to their respective IBOutlets in the table view controller subclass.
The delegate and datasource are connected and all the table cells work fine.
What did I forget? Why isn't it making the header and footer?
Follow up question:
How can I learn how to use IB? I try to avoid it, but sometimes I can't. It seems really poorly documented.
| interface-builder | uitableviewcontroller | null | null | null | null | open | Custom header and footer in an iPhone table view
===
I'm trying to implement something just like the HeaderFooter sample code that apple provides:
http://developer.apple.com/library/ios/#samplecode/HeaderFooter/Introduction/Intro.html
Unfortunately they used Interface Builder to do most of the work here, and I'm beginning to see that interface builder is the hardest thing to deal with in iPhone development.
My table works fine, but the header and footer aren't there at all. My question is how can I make it work.
My code is identical to Apple's, with a few name changes:
- (void)viewDidLoad
{
// headerView
CGRect newFrame = CGRectMake(0.0, 0.0, self.tableView.bounds.size.width, self.headerView.frame.size.height);
self.headerView.backgroundColor = [UIColor clearColor];
self.headerView.frame = newFrame;
self.tableView.tableHeaderView = self.headerView; // note this will override UITableView's 'sectionHeaderHeight' property
// set up the table's footer view based on our UIView 'myFooterView' outlet
newFrame = CGRectMake(0.0, 0.0, self.tableView.bounds.size.width, self.footerView.frame.size.height);
self.footerView.backgroundColor = [UIColor clearColor];
self.footerView.frame = newFrame;
self.tableView.tableFooterView = self.footerView; // note this will override UITableView's 'sectionFooterHeight' property
//...
The problem must be in my xib file, but the sample file has one giant nib that defines everything, all the way back to the window so I can't use that. I had to make my own.
I started with a uitableviewcontroller and nib and added header and footer views views to the nib.
I connected them to their respective IBOutlets in the table view controller subclass.
The delegate and datasource are connected and all the table cells work fine.
What did I forget? Why isn't it making the header and footer?
Follow up question:
How can I learn how to use IB? I try to avoid it, but sometimes I can't. It seems really poorly documented.
| 0 |
10,328,135 | 04/26/2012 06:15:17 | 1,357,866 | 04/26/2012 06:08:31 | 1 | 0 | How to integrate Highcharts with jasperreport or ireport? | i am havving the source code of highcharts which as been downloaded from www.highcharts.com, click on Demo Gallery link and then on left side of the page you will find numerous types of charts, click anyone of them, it will lead you to a webpage in which you will see your desired chart that you want to integrate in your website. Under chart you will see the View Options button, click on that button and you will get the code that you have to copy/paste in your webpage to integrate that chart in your website. Before copy/paste that code, please add jquery file, highcharts library and a div in your webpage code.
But now i want to integrate this high charts source code to jasper reports to i reports | jasper-reports | ireport | highcharts | null | null | 04/26/2012 11:55:15 | not a real question | How to integrate Highcharts with jasperreport or ireport?
===
i am havving the source code of highcharts which as been downloaded from www.highcharts.com, click on Demo Gallery link and then on left side of the page you will find numerous types of charts, click anyone of them, it will lead you to a webpage in which you will see your desired chart that you want to integrate in your website. Under chart you will see the View Options button, click on that button and you will get the code that you have to copy/paste in your webpage to integrate that chart in your website. Before copy/paste that code, please add jquery file, highcharts library and a div in your webpage code.
But now i want to integrate this high charts source code to jasper reports to i reports | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.