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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
766,066 |
04/19/2009 20:44:24
| 58,634 |
01/24/2009 18:14:30
| 66 | 1 |
What ASP.NET MVC sample projects exist?
|
The only sample ASP.NET MVC projects I know about are the following from [http://asp.net/mvc][1]. Are there others?
- [Nerddinner.com][2]
- [Stephen Walther's Contact Manager][3]
- [Rob Conery's MVC Storefront][4]
- [CodeCampServer][5]
- [Suteki Shop E-Commerce Application][6]
- [Stephen Walther's Movie Database][7]
[1]: http://asp.net/mvc
[2]: http://www.codeplex.com/nerddinner
[3]: http://www.asp.net/learn/mvc/tutorial-26-cs.aspx
[4]: http://blog.wekeroad.com/mvc-storefront/
[5]: http://code.google.com/p/codecampserver/
[6]: http://code.google.com/p/sutekishop/
[7]: http://www.asp.net/learn/mvc-videos/video-395.aspx
|
asp.net-mvc
| null | null | null | null |
10/16/2011 22:31:44
|
not constructive
|
What ASP.NET MVC sample projects exist?
===
The only sample ASP.NET MVC projects I know about are the following from [http://asp.net/mvc][1]. Are there others?
- [Nerddinner.com][2]
- [Stephen Walther's Contact Manager][3]
- [Rob Conery's MVC Storefront][4]
- [CodeCampServer][5]
- [Suteki Shop E-Commerce Application][6]
- [Stephen Walther's Movie Database][7]
[1]: http://asp.net/mvc
[2]: http://www.codeplex.com/nerddinner
[3]: http://www.asp.net/learn/mvc/tutorial-26-cs.aspx
[4]: http://blog.wekeroad.com/mvc-storefront/
[5]: http://code.google.com/p/codecampserver/
[6]: http://code.google.com/p/sutekishop/
[7]: http://www.asp.net/learn/mvc-videos/video-395.aspx
| 4 |
10,864,688 |
06/02/2012 18:02:19
| 1,380,611 |
05/07/2012 20:11:12
| 7 | 0 |
Android set height of custom title bar
|
I made a custom title bar. In the title bar are two imageviews next to each other and one textview beneath it. It works fine but I just see the top of the textview. So I think the title bar get cropped at the underside. Does somebody know how to set the height of a custom title bar?
|
android
|
height
|
titlebar
| null | null | null |
open
|
Android set height of custom title bar
===
I made a custom title bar. In the title bar are two imageviews next to each other and one textview beneath it. It works fine but I just see the top of the textview. So I think the title bar get cropped at the underside. Does somebody know how to set the height of a custom title bar?
| 0 |
3,688,213 |
09/10/2010 20:45:17
| 427,673 |
08/22/2010 14:32:50
| 25 | 1 |
Iterating through IQueryable with foreach results in an out of memory exception.
|
I'm iterating through a smallish (~10GB) table with a foreach / IQueryable and LINQ-to-SQL.
Looks something like this:
using (var conn = new DbEntities() { CommandTimeout = 600*100})
{
var dtable = conn.DailyResults.Where(dr => dr.DailyTransactionTypeID == 1);
foreach (var dailyResult in dtable)
{
//Math here, results stored in-memory, but this table is very small.
//At the very least compared to stuff I already have in memory. :)
}
}
The Visual Studio debugger throws an out-of memory exception after a short while at the base of the foreach loop. I'm assuming that the rows of dtable are not being flushed. What to do?
Thanks in advance.
|
c#
|
linq
|
linq-to-sql
| null | null | null |
open
|
Iterating through IQueryable with foreach results in an out of memory exception.
===
I'm iterating through a smallish (~10GB) table with a foreach / IQueryable and LINQ-to-SQL.
Looks something like this:
using (var conn = new DbEntities() { CommandTimeout = 600*100})
{
var dtable = conn.DailyResults.Where(dr => dr.DailyTransactionTypeID == 1);
foreach (var dailyResult in dtable)
{
//Math here, results stored in-memory, but this table is very small.
//At the very least compared to stuff I already have in memory. :)
}
}
The Visual Studio debugger throws an out-of memory exception after a short while at the base of the foreach loop. I'm assuming that the rows of dtable are not being flushed. What to do?
Thanks in advance.
| 0 |
8,387,813 |
12/05/2011 15:38:56
| 971,359 |
09/29/2011 14:28:43
| 15 | 0 |
Do the same thing as clear data button
|
Is there a way to do the same thing that does clear data button from Settings->Application->Manage Applications to an application programmatically?
Or else i want on click to delete all sharedpreferences. How to do that?
|
android
|
button
|
data
| null | null | null |
open
|
Do the same thing as clear data button
===
Is there a way to do the same thing that does clear data button from Settings->Application->Manage Applications to an application programmatically?
Or else i want on click to delete all sharedpreferences. How to do that?
| 0 |
7,584,399 |
09/28/2011 13:56:17
| 745,778 |
05/09/2011 20:27:00
| 15 | 0 |
List Box enable/disable one column
|
Access 2007: Is it possible to enable/disable one column in a List Box on a form. For example: Say you have 2 columns A,B - If Me.A = title Then Me.B.Enabled = True Else Me.B.Enabled = False.
If so, where would it go? On Got Focus, On Click??
Thanks
|
access
| null | null | null | null | null |
open
|
List Box enable/disable one column
===
Access 2007: Is it possible to enable/disable one column in a List Box on a form. For example: Say you have 2 columns A,B - If Me.A = title Then Me.B.Enabled = True Else Me.B.Enabled = False.
If so, where would it go? On Got Focus, On Click??
Thanks
| 0 |
5,184,739 |
03/03/2011 18:15:22
| 643,443 |
03/03/2011 17:59:06
| 1 | 0 |
Class Methods and Implementations
|
I have created a really fun, completely working project called bank accounts that does many working transactions. The code looks like this
/*
* Bank Accounts Program: Classes w. Member Functions and Separate Compilation
* Create a small banking transaction
* system where each account
* consists of a number and a
* balance of which the teller can
* create a new & close accounts, perform deposits,
* withdrawals, balance transactions, and account information
*/
#include <iostream>
#include <string>
#include <fstream>
#include "Bank.h"
using namespace std;
bool choice_flag = true;
//constant definitions
const int MAX_NUM_ACCOUNTS = 50;
Account[MAX_NUM_ACCOUNTS];
// Function Prototypes
int read_accts(BankAccount account[], int max_accts);
void print_accts(const BankAccount account[], int num_accts, ofstream &infile);
void menu();
int findacct(const BankAccount account[], int num_accts, int requested_account);
int findssn(const BankAccount account[], int num_accts, int requested_ssn);
void balance(const BankAccount account[], int num_accts, ofstream &outfile);
void deposit(BankAccount account[], int num_accts, ofstream &outfile);
void withdrawal(BankAccount accounnt[], int num_accts, ofstream &outfile);
int new_acct(BankAccount account[], int num_accts, ofstream &outfile);
int close_acct(BankAccount account[], int num_accts, ofstream &outfile);
void account_info(const BankAccount account[], int num_accts, ofstream &outfile);
int main()
{
Bank bank[MAX_NUM_ACCOUNTS];
int num_accts;
char choice;
bool choice_flag = true;
// open output file
ofstream outfile("c:\\users\\MsDellie\\My Documents\\My_Programs\\BankAccounts_ClassesMembersCompilation.txt");
// ofstream outfile("con"); //un-comment for debugging
outfile.setf(ios::fixed,ios::floatfield);
outfile.precision(2); //set decimal precision
outfile << "Lori Bailey" << endl;
/* first part */
/* fill and print initial database */
num_accts = read_accts(bank,MAX_NUM_ACCOUNTS);
print_accts(bank,num_accts,outfile);
/* second part */
/* prompts for a transaction and then */
/* call functions to process the requested transaction */
do {
menu();
cin >> choice;
switch(choice)
{
case 'q':
case 'Q':
choice_flag = false;
print_accts(bank,num_accts,outfile);
break;
case 'b':
case 'B':
balance(bank,num_accts,outfile);
break;
case 'd':
case 'D':
deposit(bank,num_accts,outfile);
break;
case 'w':
case 'W':
withdrawal(bank,num_accts,outfile);
break;
case 'n':
case 'N':
num_accts = new_acct(bank,num_accts,outfile);
break;
case 'c':
case 'C':
num_accts = close_acct(bank,num_accts,outfile);
break;
case 'i':
case 'I':
account_info(bank,num_accts,outfile);
break;
default:
outfile << endl << "Error: '" << choice << "' is an invalid selection - try again" << endl << endl;
break;
}
// give user a chance to look at output before printing menu
} while (choice_flag);
outfile.close(); // close output file
// system("pause");
return 0;
}
/* Function read_accts()
* Input:
* BankAccount account - array of
* max_accts - maximum number of active accounts allowed
* Process:
* Reads the initial database of accounts and balances
* Output:
* Fills in the initial account and balance arrays and returns the number of active accounts
*/
int read_accts(BankAccount account[], int max_accts)
{
string accttype,ssn,lastname,firstname;
int numaccts,acctnum;
double acctbalance;
// open input file
ifstream infile("c:\\users\\MsDellie\\My Documents\\My_Programs\\Classes\\BankAccounts_Structures\\input.txt");
// ifstream infile("con"); //un-comment for debugging
int count = 0; //initialize count
while (infile >> lastname)
{
account[count].setLastname(lastname);
infile >> firstname;
account[count].setFirstname(firstname);
infile >> ssn;
account[count].setssn(ssn);
infile >> acctnum;
account[count].setAcctnum(acctnum);
infile >> accttype;
account[count].setAccttype(accttype);
infile >> acctbalance;
account[count].setAcctbalance(acctbalance);
count++;
}
infile.close();
return count;
}
/* Function print_accts:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out1 - reference to output file
* Process:
* Prints the database of accounts and balances
* Output:
* Prints the database of accounts and balances
*/
void print_accts(const BankAccount account[], int num_accts, ofstream &out1)
{
out1 << endl << endl;
out1 << "\t\tDatabase of Bank Accounts" << endl << endl;
out1 << "Account Balance" << endl << endl;
for (int index = 0; index < num_accts; index++)
{
out1 << " " << account[index].last_name;
out1 << " " << account[index].first_name;
out1 << "\t" << account[index].ssn;
out1 << "\t" << account[index].acct_num;
out1 << "\t" << account[index].acct_type;
out1.width(7);
out1 << "\t$" << account[index].acct_balance;
out1 << endl;
}
return;
}
/* Function menu()
* Input:
* none
* Process:
* Prints the menu of transaction choices
* Output:
* Prints the menu of transaction choices
*/
void menu()
{
cout << endl << endl;
cout << "Select one of the following transactions:" << endl;
cout << "\t****************************" << endl;
cout << "\t List of Choices " << endl;
cout << "\t****************************" << endl;
cout << "\t W -- Withdrawal" << endl;
cout << "\t D -- Deposit" << endl;
cout << "\t N -- New Account" << endl;
cout << "\t B -- Balance Inquiry" << endl;
cout << "\t I -- Account Info" << endl;
cout << "\t C -- Close Account" << endl;
cout << "\t Q -- Quit" << endl;
cout << endl << "\tEnter your selection: ";
return;
}
/* Function findacct:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* requested_account - requested account
* Process:
* Performs a linear search on the acct_num array for the requested account
* Output:
* If found, the index of the requested account is returned
* Otherwise, returns -1
*/
int findacct(const BankAccount account[], int num_accts, int requested_account)
{
for (int index = 0; index < num_accts; index++)
if (account[index].acct_num == requested_account)
return index;
return -1;
}
/* Function findssn:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* requested_ssn - requested social security number
* Process:
* Performs a linear search on the ssn array for the requested social security number
* Output:
* If found, the index of the requested social security number is returned
* Otherwise, returns -1
*/
int findssn(const BankAccount account[], int num_accts, int requested_ssn)
{
for (int index = 0; index < num_accts; index++)
if (account[index].ssn == requested_ssn)
return index;
return -1;
}
/* Function balance:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* outfile - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account exists, the balamce is printed
* Otherwise, an error message is printed
* Output:
* If the account exists, the balance is printed
* Otherwise, an error message is printed
*/
void balance(const BankAccount account[], int num_accts, ofstream &out2)
{
int requested_account;
int index;
cout << endl << "Enter the account number: "; //prompt for account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //invalid account
{
out2 << endl << "Transaction Requested: Balance Inquiry" << endl;
out2 << "Error: Account number " << requested_account << " does not exist" << endl;
}
else //valid zccount
{
out2 << endl << "Transaction Requested: Balance Inquiry" << endl;
out2 << "Account Number: " << requested_account << endl;
out2 << "Current Balance: $" << account[index].acct_balance << endl;
}
return;
}
/* Function deposit:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* outfile - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account exists, prompts for the amount to deposit
* If the amount is valid, it makes the depost and prints the new balance
* Otherwise, an error message is printed
* Output:
* For a valid deposit, the deposit transaction is printed
* Otherwise, an error message is printed
*/
void deposit(BankAccount account[], int num_accts, ofstream &out3)
{
int requested_account;
int index;
double amount_to_deposit;
cout << endl << "Enter the account number: "; //prompt for account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //invalid account
{
out3 << endl << "Transaction Requested: Deposit" << endl;
out3 << "Error: Account number " << requested_account << " does not exist" << endl;
}
else //valid account
{
cout << "Enter amount to deposit: "; //prompt for amount to deposit
cin >> amount_to_deposit;
if (amount_to_deposit <= 0.00) //invalid amount to deposit
{
out3 << endl << "Transaction Requested: Deposit" << endl;
out3 << "Account Number: " << requested_account << endl;
out3 << "Error: $" << amount_to_deposit << " is an invalid amount" << endl;
}
else //valid deposit
{
out3 << endl << "Transaction Requested: Deposit" << endl;
out3 << "Account Number: " << requested_account << endl;
out3 << "Old Balance: $" << account[index].acct_balance << endl;
out3 << "Amount to Deposit: $" << amount_to_deposit << endl;
account[index].acct_balance += amount_to_deposit; //make the deposit
out3 << "New Balance: $" << account[index].acct_balance << endl;
}
}
return;
}
/* Function withdrawal:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out4 - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account exists, prompts for the amount to withdraw
* If the amount is valid, it makes the withdrawal and prints the new balance
* Otherwise, an error message is printed
* Output:
* For a valid withdrawal, the withdraw transaction is printed
* Otherwise, an error message is printed
*/
void withdrawal(BankAccount account[], int num_accts, ofstream &out4)
{
int requested_account;
int index;
double amount_to_withdraw;
cout << endl << "Enter the account number: "; //prompt for account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //invalid account
{
out4 << endl << "Transaction Requested: Withdraw" << endl;
out4 << "Error: Account number " << requested_account << " does not exist" << endl;
}
else //valid account
{
cout << "Enter amount to withdraw: "; //prompt for amount to withdraw
cin >> amount_to_withdraw;
if (amount_to_withdraw <= 0.00 || amount_to_withdraw > account[index].acct_balance) //invalid amount to withdraw
{
out4 << endl << "Transaction Requested: Withdraw" << endl;
out4 << "Account Number: " << requested_account << endl;
out4 << "Error: $" << amount_to_withdraw << " is an invalid amount" << endl;
}
else //valid deposit
{
out4 << endl << "Transaction Requested: Withdraw" << endl;
out4 << "Account Number: " << requested_account << endl;
out4 << "Old Balance: $" << account[index].acct_balance << endl;
out4 << "Amount to Withdraw: $" << amount_to_withdraw << endl;
account[index].acct_balance -= amount_to_withdraw; //make the deposit
out4 << "New Balance: $" << account[index].acct_balance << endl;
}
}
return;
}
/* Function new_acct:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out5 - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account doesn't exists, prompts for the new account
* If the account is valid, it makes the new account's balance 0.00
* Otherwise, an error message is printed
* Output:
* For a valid new account, the new account transaction is printed
* Otherwise, an error message is printed
*/
int new_acct(BankAccount account[], int num_accts, ofstream &out5)
{
int requested_account;
int index;
cout << endl << "Enter the new account number: "; //prompt for new account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //valid new account
{
out5 << endl << "Transaction Requested: New Account" << endl;
out5 << "Account Number: " << requested_account << endl;
account[num_accts].acct_num = requested_account;
cout << endl << "Enter new depositor's Last Name: ";
cin >> account[num_accts].last_name;
cout << endl << "Enter new depositor's First Name: ";
cin >> account[num_accts].first_name;
cout << endl << "Enter new depositor's Social Security Number: ";
cin >> account[num_accts].ssn;
cout << endl << "Enter new depositor's Account Type: ";
cin >> account[num_accts].acct_type;
cout << endl << "Enter new depositor's Initial Opening Deposit: ";
cin >> account[num_accts].acct_balance;
num_accts++;
}
else //invalid new account
{
out5 << endl << "Transaction Requested: New Account" << endl;
out5 << "Error: Account number " << requested_account << " already exists" << endl;
}
return num_accts;
}
/* Function close_acct:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out6 - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account exists, prompts for the account to close
* If the account exists, it makes the close & deletes it
* Otherwise, an error message is printed
* Output:
* For a valid close, the close & deletion transaction is printed
* Otherwise, an error message is printed
*/
int close_acct(BankAccount account[], int num_accts, ofstream &out6)
{
int requested_account;
int index;
cout << endl << "Enter the account number: "; //prompt for account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //invalid account
{
out6 << endl << "Transaction Requested: Close Account" << endl;
out6 << "Error: Account number " << requested_account << " has an error" << endl;
}
else if (index != -1 && account[index].acct_balance != 0.00)
{
out6 << endl << "Transaction Requested: Close Account" << endl;
out6 << "Error: Account number " << requested_account << " has a non-zero balance" << endl;
}
else //valid account
{
out6 << endl << "Transaction Requested: Close Account" << endl;
out6 << "Account Number: " << requested_account << endl;
for (int i = index+1; i < num_accts; i++)
{
account[index].last_name = account[num_accts-1].last_name;
account[index].first_name = account[num_accts-1].first_name;
account[index].ssn = account[num_accts-1].ssn;
account[index].acct_num = account[num_accts-1].acct_num;
account[index].acct_type = account[num_accts-1].acct_type;
account[index].acct_balance = account[num_accts-1].acct_balance;
}
num_accts--;
}
return num_accts;
}
/* Function account_info:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out7 - reference to output file
* Process:
* Prompts for the requested social security number
* Loops to see if ssn exists
* Calls findacct() to see if the account exists
* If the account exists, prints the account information
* Otherwise, an error message is printed
* Output:
* Prints account information for corresponding ssn
* Otherwise, an error message is printed
*/
void account_info(const BankAccount account[], int num_accts, ofstream &out7)
{
int requested_ssn;
int index;
cout << endl << "Enter the social security number: "; //prompt for social security number
cin >> requested_ssn;
index = findssn(account, num_accts, requested_ssn);
if (index == -1) //invalid account
{
out7 << endl << "Transaction Requested: Account Info" << endl;
out7 << "Error: Social Security Number " << requested_ssn << " does not exists" << endl;
}
else //valid account
{
out7 << endl << "Transaction Requested: Account Info" << endl;
out7 << "Account Information for Requested Account:" << endl;
out7 << "Name: " << account[index].last_name;
out7 << ", " << account[index].first_name << endl;
out7 << "Social Security #: " << account[index].ssn << endl;
out7 << "Account #: " << account[index].acct_num << endl;
out7 << account[index].acct_type << " Account: ";
out7 << "$" << account[index].acct_balance << endl;
}
return;
}
Now I am being asked to use Classes and move functionality into the classes. Specifically, you should have at least the
following classes:
1. A Bank class which consists of an array of Accounts and the number of accounts currently active in the bank.
2 An Account class which consists of a Depositor, an account number, an account type, and a balance.
3 A Depositor class which has a Name and a social security number.
4 A Name class which consists of first and last names.
You must add appropriate member functions (or methods) to each class so as to implement the functionality of each of the
functions of the previous assignment (HW2). Each of the functions of HW2 should be re-implemented using a class method.
HE GAVE US A CLUE AS TO HOW WE CAN GET STARTED:
1. The Bank class should have at least have the following methods:
openAccount(...)
getBalance(...)
getAccountInfo(...)
makeDeposit(...)
makeWithdrawal(...)
closeAccount(...)
2. The Account class should at least have a constructor that would allow statements of the form:
account[j] = Account(...);
3. The Depositor class should at least have a constructor that would allow statements of the form:
depositor = Depositor(...);
4. The Name class should at least have a constructor that would allow statements of the form:
name = Name(...);
5. Add additional methods to each class as necessary.
6. All I/O should be done outside of the class implementations.
I DONT KNOW WHAT TO PUT INTO THESE POSSIBLE METHOD PARAMETERS TO GET THESE FUNCTIONS TO WORK AS THEY WERE BEFORE THE CLASS SPECICIFICATIONS AND IMPLEMENTATIONS. CAN SOMEONE POINT ME THE RIGHT DIRECTION OF HOW TO GET THIS GOING PLEASE!!!!
THANK YOU
|
c++
|
class
|
function
|
member
| null |
03/04/2011 15:42:10
|
not a real question
|
Class Methods and Implementations
===
I have created a really fun, completely working project called bank accounts that does many working transactions. The code looks like this
/*
* Bank Accounts Program: Classes w. Member Functions and Separate Compilation
* Create a small banking transaction
* system where each account
* consists of a number and a
* balance of which the teller can
* create a new & close accounts, perform deposits,
* withdrawals, balance transactions, and account information
*/
#include <iostream>
#include <string>
#include <fstream>
#include "Bank.h"
using namespace std;
bool choice_flag = true;
//constant definitions
const int MAX_NUM_ACCOUNTS = 50;
Account[MAX_NUM_ACCOUNTS];
// Function Prototypes
int read_accts(BankAccount account[], int max_accts);
void print_accts(const BankAccount account[], int num_accts, ofstream &infile);
void menu();
int findacct(const BankAccount account[], int num_accts, int requested_account);
int findssn(const BankAccount account[], int num_accts, int requested_ssn);
void balance(const BankAccount account[], int num_accts, ofstream &outfile);
void deposit(BankAccount account[], int num_accts, ofstream &outfile);
void withdrawal(BankAccount accounnt[], int num_accts, ofstream &outfile);
int new_acct(BankAccount account[], int num_accts, ofstream &outfile);
int close_acct(BankAccount account[], int num_accts, ofstream &outfile);
void account_info(const BankAccount account[], int num_accts, ofstream &outfile);
int main()
{
Bank bank[MAX_NUM_ACCOUNTS];
int num_accts;
char choice;
bool choice_flag = true;
// open output file
ofstream outfile("c:\\users\\MsDellie\\My Documents\\My_Programs\\BankAccounts_ClassesMembersCompilation.txt");
// ofstream outfile("con"); //un-comment for debugging
outfile.setf(ios::fixed,ios::floatfield);
outfile.precision(2); //set decimal precision
outfile << "Lori Bailey" << endl;
/* first part */
/* fill and print initial database */
num_accts = read_accts(bank,MAX_NUM_ACCOUNTS);
print_accts(bank,num_accts,outfile);
/* second part */
/* prompts for a transaction and then */
/* call functions to process the requested transaction */
do {
menu();
cin >> choice;
switch(choice)
{
case 'q':
case 'Q':
choice_flag = false;
print_accts(bank,num_accts,outfile);
break;
case 'b':
case 'B':
balance(bank,num_accts,outfile);
break;
case 'd':
case 'D':
deposit(bank,num_accts,outfile);
break;
case 'w':
case 'W':
withdrawal(bank,num_accts,outfile);
break;
case 'n':
case 'N':
num_accts = new_acct(bank,num_accts,outfile);
break;
case 'c':
case 'C':
num_accts = close_acct(bank,num_accts,outfile);
break;
case 'i':
case 'I':
account_info(bank,num_accts,outfile);
break;
default:
outfile << endl << "Error: '" << choice << "' is an invalid selection - try again" << endl << endl;
break;
}
// give user a chance to look at output before printing menu
} while (choice_flag);
outfile.close(); // close output file
// system("pause");
return 0;
}
/* Function read_accts()
* Input:
* BankAccount account - array of
* max_accts - maximum number of active accounts allowed
* Process:
* Reads the initial database of accounts and balances
* Output:
* Fills in the initial account and balance arrays and returns the number of active accounts
*/
int read_accts(BankAccount account[], int max_accts)
{
string accttype,ssn,lastname,firstname;
int numaccts,acctnum;
double acctbalance;
// open input file
ifstream infile("c:\\users\\MsDellie\\My Documents\\My_Programs\\Classes\\BankAccounts_Structures\\input.txt");
// ifstream infile("con"); //un-comment for debugging
int count = 0; //initialize count
while (infile >> lastname)
{
account[count].setLastname(lastname);
infile >> firstname;
account[count].setFirstname(firstname);
infile >> ssn;
account[count].setssn(ssn);
infile >> acctnum;
account[count].setAcctnum(acctnum);
infile >> accttype;
account[count].setAccttype(accttype);
infile >> acctbalance;
account[count].setAcctbalance(acctbalance);
count++;
}
infile.close();
return count;
}
/* Function print_accts:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out1 - reference to output file
* Process:
* Prints the database of accounts and balances
* Output:
* Prints the database of accounts and balances
*/
void print_accts(const BankAccount account[], int num_accts, ofstream &out1)
{
out1 << endl << endl;
out1 << "\t\tDatabase of Bank Accounts" << endl << endl;
out1 << "Account Balance" << endl << endl;
for (int index = 0; index < num_accts; index++)
{
out1 << " " << account[index].last_name;
out1 << " " << account[index].first_name;
out1 << "\t" << account[index].ssn;
out1 << "\t" << account[index].acct_num;
out1 << "\t" << account[index].acct_type;
out1.width(7);
out1 << "\t$" << account[index].acct_balance;
out1 << endl;
}
return;
}
/* Function menu()
* Input:
* none
* Process:
* Prints the menu of transaction choices
* Output:
* Prints the menu of transaction choices
*/
void menu()
{
cout << endl << endl;
cout << "Select one of the following transactions:" << endl;
cout << "\t****************************" << endl;
cout << "\t List of Choices " << endl;
cout << "\t****************************" << endl;
cout << "\t W -- Withdrawal" << endl;
cout << "\t D -- Deposit" << endl;
cout << "\t N -- New Account" << endl;
cout << "\t B -- Balance Inquiry" << endl;
cout << "\t I -- Account Info" << endl;
cout << "\t C -- Close Account" << endl;
cout << "\t Q -- Quit" << endl;
cout << endl << "\tEnter your selection: ";
return;
}
/* Function findacct:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* requested_account - requested account
* Process:
* Performs a linear search on the acct_num array for the requested account
* Output:
* If found, the index of the requested account is returned
* Otherwise, returns -1
*/
int findacct(const BankAccount account[], int num_accts, int requested_account)
{
for (int index = 0; index < num_accts; index++)
if (account[index].acct_num == requested_account)
return index;
return -1;
}
/* Function findssn:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* requested_ssn - requested social security number
* Process:
* Performs a linear search on the ssn array for the requested social security number
* Output:
* If found, the index of the requested social security number is returned
* Otherwise, returns -1
*/
int findssn(const BankAccount account[], int num_accts, int requested_ssn)
{
for (int index = 0; index < num_accts; index++)
if (account[index].ssn == requested_ssn)
return index;
return -1;
}
/* Function balance:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* outfile - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account exists, the balamce is printed
* Otherwise, an error message is printed
* Output:
* If the account exists, the balance is printed
* Otherwise, an error message is printed
*/
void balance(const BankAccount account[], int num_accts, ofstream &out2)
{
int requested_account;
int index;
cout << endl << "Enter the account number: "; //prompt for account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //invalid account
{
out2 << endl << "Transaction Requested: Balance Inquiry" << endl;
out2 << "Error: Account number " << requested_account << " does not exist" << endl;
}
else //valid zccount
{
out2 << endl << "Transaction Requested: Balance Inquiry" << endl;
out2 << "Account Number: " << requested_account << endl;
out2 << "Current Balance: $" << account[index].acct_balance << endl;
}
return;
}
/* Function deposit:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* outfile - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account exists, prompts for the amount to deposit
* If the amount is valid, it makes the depost and prints the new balance
* Otherwise, an error message is printed
* Output:
* For a valid deposit, the deposit transaction is printed
* Otherwise, an error message is printed
*/
void deposit(BankAccount account[], int num_accts, ofstream &out3)
{
int requested_account;
int index;
double amount_to_deposit;
cout << endl << "Enter the account number: "; //prompt for account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //invalid account
{
out3 << endl << "Transaction Requested: Deposit" << endl;
out3 << "Error: Account number " << requested_account << " does not exist" << endl;
}
else //valid account
{
cout << "Enter amount to deposit: "; //prompt for amount to deposit
cin >> amount_to_deposit;
if (amount_to_deposit <= 0.00) //invalid amount to deposit
{
out3 << endl << "Transaction Requested: Deposit" << endl;
out3 << "Account Number: " << requested_account << endl;
out3 << "Error: $" << amount_to_deposit << " is an invalid amount" << endl;
}
else //valid deposit
{
out3 << endl << "Transaction Requested: Deposit" << endl;
out3 << "Account Number: " << requested_account << endl;
out3 << "Old Balance: $" << account[index].acct_balance << endl;
out3 << "Amount to Deposit: $" << amount_to_deposit << endl;
account[index].acct_balance += amount_to_deposit; //make the deposit
out3 << "New Balance: $" << account[index].acct_balance << endl;
}
}
return;
}
/* Function withdrawal:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out4 - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account exists, prompts for the amount to withdraw
* If the amount is valid, it makes the withdrawal and prints the new balance
* Otherwise, an error message is printed
* Output:
* For a valid withdrawal, the withdraw transaction is printed
* Otherwise, an error message is printed
*/
void withdrawal(BankAccount account[], int num_accts, ofstream &out4)
{
int requested_account;
int index;
double amount_to_withdraw;
cout << endl << "Enter the account number: "; //prompt for account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //invalid account
{
out4 << endl << "Transaction Requested: Withdraw" << endl;
out4 << "Error: Account number " << requested_account << " does not exist" << endl;
}
else //valid account
{
cout << "Enter amount to withdraw: "; //prompt for amount to withdraw
cin >> amount_to_withdraw;
if (amount_to_withdraw <= 0.00 || amount_to_withdraw > account[index].acct_balance) //invalid amount to withdraw
{
out4 << endl << "Transaction Requested: Withdraw" << endl;
out4 << "Account Number: " << requested_account << endl;
out4 << "Error: $" << amount_to_withdraw << " is an invalid amount" << endl;
}
else //valid deposit
{
out4 << endl << "Transaction Requested: Withdraw" << endl;
out4 << "Account Number: " << requested_account << endl;
out4 << "Old Balance: $" << account[index].acct_balance << endl;
out4 << "Amount to Withdraw: $" << amount_to_withdraw << endl;
account[index].acct_balance -= amount_to_withdraw; //make the deposit
out4 << "New Balance: $" << account[index].acct_balance << endl;
}
}
return;
}
/* Function new_acct:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out5 - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account doesn't exists, prompts for the new account
* If the account is valid, it makes the new account's balance 0.00
* Otherwise, an error message is printed
* Output:
* For a valid new account, the new account transaction is printed
* Otherwise, an error message is printed
*/
int new_acct(BankAccount account[], int num_accts, ofstream &out5)
{
int requested_account;
int index;
cout << endl << "Enter the new account number: "; //prompt for new account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //valid new account
{
out5 << endl << "Transaction Requested: New Account" << endl;
out5 << "Account Number: " << requested_account << endl;
account[num_accts].acct_num = requested_account;
cout << endl << "Enter new depositor's Last Name: ";
cin >> account[num_accts].last_name;
cout << endl << "Enter new depositor's First Name: ";
cin >> account[num_accts].first_name;
cout << endl << "Enter new depositor's Social Security Number: ";
cin >> account[num_accts].ssn;
cout << endl << "Enter new depositor's Account Type: ";
cin >> account[num_accts].acct_type;
cout << endl << "Enter new depositor's Initial Opening Deposit: ";
cin >> account[num_accts].acct_balance;
num_accts++;
}
else //invalid new account
{
out5 << endl << "Transaction Requested: New Account" << endl;
out5 << "Error: Account number " << requested_account << " already exists" << endl;
}
return num_accts;
}
/* Function close_acct:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out6 - reference to output file
* Process:
* Prompts for the requested account
* Calls findacct() to see if the account exists
* If the account exists, prompts for the account to close
* If the account exists, it makes the close & deletes it
* Otherwise, an error message is printed
* Output:
* For a valid close, the close & deletion transaction is printed
* Otherwise, an error message is printed
*/
int close_acct(BankAccount account[], int num_accts, ofstream &out6)
{
int requested_account;
int index;
cout << endl << "Enter the account number: "; //prompt for account number
cin >> requested_account;
index = findacct(account, num_accts, requested_account);
if (index == -1) //invalid account
{
out6 << endl << "Transaction Requested: Close Account" << endl;
out6 << "Error: Account number " << requested_account << " has an error" << endl;
}
else if (index != -1 && account[index].acct_balance != 0.00)
{
out6 << endl << "Transaction Requested: Close Account" << endl;
out6 << "Error: Account number " << requested_account << " has a non-zero balance" << endl;
}
else //valid account
{
out6 << endl << "Transaction Requested: Close Account" << endl;
out6 << "Account Number: " << requested_account << endl;
for (int i = index+1; i < num_accts; i++)
{
account[index].last_name = account[num_accts-1].last_name;
account[index].first_name = account[num_accts-1].first_name;
account[index].ssn = account[num_accts-1].ssn;
account[index].acct_num = account[num_accts-1].acct_num;
account[index].acct_type = account[num_accts-1].acct_type;
account[index].acct_balance = account[num_accts-1].acct_balance;
}
num_accts--;
}
return num_accts;
}
/* Function account_info:
* Input:
* BankAccount account - array of
* num_accts - number of active accounts
* out7 - reference to output file
* Process:
* Prompts for the requested social security number
* Loops to see if ssn exists
* Calls findacct() to see if the account exists
* If the account exists, prints the account information
* Otherwise, an error message is printed
* Output:
* Prints account information for corresponding ssn
* Otherwise, an error message is printed
*/
void account_info(const BankAccount account[], int num_accts, ofstream &out7)
{
int requested_ssn;
int index;
cout << endl << "Enter the social security number: "; //prompt for social security number
cin >> requested_ssn;
index = findssn(account, num_accts, requested_ssn);
if (index == -1) //invalid account
{
out7 << endl << "Transaction Requested: Account Info" << endl;
out7 << "Error: Social Security Number " << requested_ssn << " does not exists" << endl;
}
else //valid account
{
out7 << endl << "Transaction Requested: Account Info" << endl;
out7 << "Account Information for Requested Account:" << endl;
out7 << "Name: " << account[index].last_name;
out7 << ", " << account[index].first_name << endl;
out7 << "Social Security #: " << account[index].ssn << endl;
out7 << "Account #: " << account[index].acct_num << endl;
out7 << account[index].acct_type << " Account: ";
out7 << "$" << account[index].acct_balance << endl;
}
return;
}
Now I am being asked to use Classes and move functionality into the classes. Specifically, you should have at least the
following classes:
1. A Bank class which consists of an array of Accounts and the number of accounts currently active in the bank.
2 An Account class which consists of a Depositor, an account number, an account type, and a balance.
3 A Depositor class which has a Name and a social security number.
4 A Name class which consists of first and last names.
You must add appropriate member functions (or methods) to each class so as to implement the functionality of each of the
functions of the previous assignment (HW2). Each of the functions of HW2 should be re-implemented using a class method.
HE GAVE US A CLUE AS TO HOW WE CAN GET STARTED:
1. The Bank class should have at least have the following methods:
openAccount(...)
getBalance(...)
getAccountInfo(...)
makeDeposit(...)
makeWithdrawal(...)
closeAccount(...)
2. The Account class should at least have a constructor that would allow statements of the form:
account[j] = Account(...);
3. The Depositor class should at least have a constructor that would allow statements of the form:
depositor = Depositor(...);
4. The Name class should at least have a constructor that would allow statements of the form:
name = Name(...);
5. Add additional methods to each class as necessary.
6. All I/O should be done outside of the class implementations.
I DONT KNOW WHAT TO PUT INTO THESE POSSIBLE METHOD PARAMETERS TO GET THESE FUNCTIONS TO WORK AS THEY WERE BEFORE THE CLASS SPECICIFICATIONS AND IMPLEMENTATIONS. CAN SOMEONE POINT ME THE RIGHT DIRECTION OF HOW TO GET THIS GOING PLEASE!!!!
THANK YOU
| 1 |
9,358,950 |
02/20/2012 09:39:51
| 924,821 |
09/02/2011 07:32:57
| 28 | 1 |
Passing page variable to function in PHP
|
How do I pass page variable itself to the function ? here's snippet
$user_name;
function set($variable,$value)
{
$variable = $value ;
}
to call set($user_name);
i am not using class.
thanks
|
php
| null | null | null | null | null |
open
|
Passing page variable to function in PHP
===
How do I pass page variable itself to the function ? here's snippet
$user_name;
function set($variable,$value)
{
$variable = $value ;
}
to call set($user_name);
i am not using class.
thanks
| 0 |
1,183,091 |
07/25/2009 21:19:23
| 131,448 |
07/01/2009 02:32:35
| 217 | 5 |
Trouble in implementing link list sorting in c#
|
I am having trouble implementing a sort algo (merge) for singly list as defined below
My mergesort method always gives me null..I am not able to figure out what is wrong
Can you guys help me out?
Node class
public class Node
{
private int data;
private Node next;
}
Linked List class
public class SSL
{
private Node head;
}
My merge sort code
public static void MergeSort(SSL a)
{
SSL x = new SSL();
SSL y = new SSL();
if (a.Head == null || a.Head.Next == null) // base case if list has 0 or 1 element
return;
AlternateSplitting(a, x, y);
MergeSort(x);
MergeSort(y);
a = SortedMerge(x, y);
}
I implemented following helper methods to implement merge sort
AlternateSplitting: This method will split the list into 2 lists
public static void AlternateSplitting(SSL src, SSL odd, SSL even)
{
while (src.Head != null)
{
MoveNode(odd, src);
if (src.Head != null)
MoveNode(even, src);
}
} // end of AlternateSplitting
This method will merge the 2 list and return a new list
public static SSL SortedMerge(SSL a, SSL b)
{
SSL c = new SSL();
if (a.Head == null)
return b;
else
if (b.Head == null)
return a;
else
{
bool flagA = false;
bool flagB = false;
Node currentA = new Node();
Node currentB = new Node();
while (!flagA && !flagB)
{
currentA = a.Head;
currentB = b.Head;
if (currentA.Data < currentB.Data)
{
MoveNodeToEnd(a, c);
currentA = a.Head;
if (currentA== null)
flagA = true;
}
else
if (currentA.Data > currentB.Data)
{
MoveNodeToEnd(b, c);
currentB = b.Head;
if (currentB== null)
flagB = true;
}
} // end of while
if (flagA)
{
while (currentB != null)
{
MoveNodeToEnd(b, c);
currentB = b.Head;
}
}
else
if(flagB)
{
while (currentA != null)
{
MoveNodeToEnd(a, c);
currentA = a.Head;
}
}
return c;
} // end of outer else
} // end of function sorted merge
|
linked-list
| null | null | null | null | null |
open
|
Trouble in implementing link list sorting in c#
===
I am having trouble implementing a sort algo (merge) for singly list as defined below
My mergesort method always gives me null..I am not able to figure out what is wrong
Can you guys help me out?
Node class
public class Node
{
private int data;
private Node next;
}
Linked List class
public class SSL
{
private Node head;
}
My merge sort code
public static void MergeSort(SSL a)
{
SSL x = new SSL();
SSL y = new SSL();
if (a.Head == null || a.Head.Next == null) // base case if list has 0 or 1 element
return;
AlternateSplitting(a, x, y);
MergeSort(x);
MergeSort(y);
a = SortedMerge(x, y);
}
I implemented following helper methods to implement merge sort
AlternateSplitting: This method will split the list into 2 lists
public static void AlternateSplitting(SSL src, SSL odd, SSL even)
{
while (src.Head != null)
{
MoveNode(odd, src);
if (src.Head != null)
MoveNode(even, src);
}
} // end of AlternateSplitting
This method will merge the 2 list and return a new list
public static SSL SortedMerge(SSL a, SSL b)
{
SSL c = new SSL();
if (a.Head == null)
return b;
else
if (b.Head == null)
return a;
else
{
bool flagA = false;
bool flagB = false;
Node currentA = new Node();
Node currentB = new Node();
while (!flagA && !flagB)
{
currentA = a.Head;
currentB = b.Head;
if (currentA.Data < currentB.Data)
{
MoveNodeToEnd(a, c);
currentA = a.Head;
if (currentA== null)
flagA = true;
}
else
if (currentA.Data > currentB.Data)
{
MoveNodeToEnd(b, c);
currentB = b.Head;
if (currentB== null)
flagB = true;
}
} // end of while
if (flagA)
{
while (currentB != null)
{
MoveNodeToEnd(b, c);
currentB = b.Head;
}
}
else
if(flagB)
{
while (currentA != null)
{
MoveNodeToEnd(a, c);
currentA = a.Head;
}
}
return c;
} // end of outer else
} // end of function sorted merge
| 0 |
5,508,753 |
04/01/2011 03:12:46
| 469,756 |
10/08/2010 01:44:23
| 61 | 0 |
difference between <%! %> and <% %>
|
what is the difference between <%! %> and <% %> in JSP?
|
jsp
| null | null | null | null | null |
open
|
difference between <%! %> and <% %>
===
what is the difference between <%! %> and <% %> in JSP?
| 0 |
11,047,384 |
06/15/2012 08:47:48
| 1,230,447 |
02/24/2012 09:47:46
| 9 | 0 |
Why such a basic script is not working
|
Here I am doing a basic trigger example but jquery is unable to execute it. I know jquery has some issues with such kind of trigger but isn't there any solution for the same.
Demo of code: [jsfiddle][1]
[1]: http://jsfiddle.net/program_me/4eF2x/
|
javascript
|
jquery
|
jquery-ui
| null | null |
06/15/2012 08:53:30
|
too localized
|
Why such a basic script is not working
===
Here I am doing a basic trigger example but jquery is unable to execute it. I know jquery has some issues with such kind of trigger but isn't there any solution for the same.
Demo of code: [jsfiddle][1]
[1]: http://jsfiddle.net/program_me/4eF2x/
| 3 |
11,395,388 |
07/09/2012 12:51:26
| 1,462,225 |
06/17/2012 18:32:43
| 1 | 2 |
Error when booting Linux Mint 12
|
When I try to boot Linux Mint12 I had this error:
alloc magic point is broken . aborted. Press any key to exit
How can I repair it?
|
linuxmint
| null | null | null | null |
07/09/2012 12:58:31
|
off topic
|
Error when booting Linux Mint 12
===
When I try to boot Linux Mint12 I had this error:
alloc magic point is broken . aborted. Press any key to exit
How can I repair it?
| 2 |
4,556,233 |
12/29/2010 17:22:38
| 292,214 |
03/12/2010 08:58:06
| 59 | 1 |
Google buzz like application
|
Im jus trying to code a one page application same as of google buzz [with php,mysql & jQuery ] just simple text buzz with text reply.[list all users buzz on the same page & there no followers / followings]
I just did listed 10 buzz & its corresponding comments on the Buzz page onload & now if any other user place a buzz i did loaded the latest buzz as a 11th in the list through Ajax like kinda heartbeat ajax with jQuery.
Now here is the situation i just want to load the reply comment for each buzz through ajax synchronously & also refelect the changes like [edit / delete ] of each buzz & comments on the other user end.
Please guide me with the situation & i really thankful for that,
Nithish :)
|
php
|
jquery
|
mysql
|
ajax
|
google-buzz
|
12/29/2010 17:39:26
|
not a real question
|
Google buzz like application
===
Im jus trying to code a one page application same as of google buzz [with php,mysql & jQuery ] just simple text buzz with text reply.[list all users buzz on the same page & there no followers / followings]
I just did listed 10 buzz & its corresponding comments on the Buzz page onload & now if any other user place a buzz i did loaded the latest buzz as a 11th in the list through Ajax like kinda heartbeat ajax with jQuery.
Now here is the situation i just want to load the reply comment for each buzz through ajax synchronously & also refelect the changes like [edit / delete ] of each buzz & comments on the other user end.
Please guide me with the situation & i really thankful for that,
Nithish :)
| 1 |
4,089,705 |
11/03/2010 17:18:31
| 320,724 |
04/19/2010 20:00:18
| 357 | 8 |
Handle throws a Disposed exception
|
When I open my form for the first time, frm1.Hanlde is Ok but when I close my form and open it again,the value for handle is throwing an exception of System.ObjectDisposedException .... what are the things I should consider for debugging and fixing it?
|
objectdisposedexception
| null | null | null | null | null |
open
|
Handle throws a Disposed exception
===
When I open my form for the first time, frm1.Hanlde is Ok but when I close my form and open it again,the value for handle is throwing an exception of System.ObjectDisposedException .... what are the things I should consider for debugging and fixing it?
| 0 |
7,786,076 |
10/16/2011 17:39:43
| 985,483 |
10/08/2011 15:21:03
| 1 | 1 |
importence of MVC
|
Developing a dynamic website or an online Application, in PHP using MVC, how much this is importent?
what if we simply made website and add php code where we want to...? like structured approach
Is MVC or N-Tier are used for more security
|
php
|
security
|
mvc
|
web
| null |
10/16/2011 18:20:29
|
not a real question
|
importence of MVC
===
Developing a dynamic website or an online Application, in PHP using MVC, how much this is importent?
what if we simply made website and add php code where we want to...? like structured approach
Is MVC or N-Tier are used for more security
| 1 |
7,448,389 |
09/16/2011 17:35:03
| 927,326 |
09/04/2011 07:03:22
| 1 | 0 |
How to apply a composition on a 3d object in adobe after effects
|
i want to create something like this
http://www.youtube.com/watch?v=UJ7E7uEZN00&feature=player_embedded
can i create a composition and use it as a texture on a 3d object in after effects??
if not any other software which can help
|
3d
|
after-effects
| null | null | null |
09/21/2011 01:41:17
|
off topic
|
How to apply a composition on a 3d object in adobe after effects
===
i want to create something like this
http://www.youtube.com/watch?v=UJ7E7uEZN00&feature=player_embedded
can i create a composition and use it as a texture on a 3d object in after effects??
if not any other software which can help
| 2 |
8,854,615 |
01/13/2012 17:21:30
| 906,592 |
08/22/2011 20:13:19
| 382 | 1 |
Resources for using Git with RStudio
|
Are there any resources (examples, documentation) for using Git specifically with RStudio?
Thank you very much,
EC
|
git
|
r
| null | null | null |
03/20/2012 18:23:39
|
not constructive
|
Resources for using Git with RStudio
===
Are there any resources (examples, documentation) for using Git specifically with RStudio?
Thank you very much,
EC
| 4 |
6,973,722 |
08/07/2011 15:30:53
| 388,088 |
07/09/2010 19:59:29
| 76 | 0 |
Images tile on Google map in android
|
I am developing an android application where I have place image tiles on Google map in android.
I can do with simple javascript but can anyone tell how I do this in android.Here is my JavaScript code.
function initialize() {
var center = new google.maps.LatLng(37.4419, -122.1419);
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var globalfoovar = new google.maps.ImageMapType({
getTileUrl: function(tile, zoom) {
return "http://demoserver.com";
},
tileSize: new google.maps.Size(256, 256),
opacity:0.60,
isPng: true
});
map.overlayMapTypes.push(null); // create empty overlay entry
map.overlayMapTypes.setAt("0",globalfoovar); // set the overlay, 0 index
Can any translate the above to android Google map.
Thanks in android
Altaf
|
android
|
google-maps
| null | null | null | null |
open
|
Images tile on Google map in android
===
I am developing an android application where I have place image tiles on Google map in android.
I can do with simple javascript but can anyone tell how I do this in android.Here is my JavaScript code.
function initialize() {
var center = new google.maps.LatLng(37.4419, -122.1419);
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var globalfoovar = new google.maps.ImageMapType({
getTileUrl: function(tile, zoom) {
return "http://demoserver.com";
},
tileSize: new google.maps.Size(256, 256),
opacity:0.60,
isPng: true
});
map.overlayMapTypes.push(null); // create empty overlay entry
map.overlayMapTypes.setAt("0",globalfoovar); // set the overlay, 0 index
Can any translate the above to android Google map.
Thanks in android
Altaf
| 0 |
9,806,999 |
03/21/2012 14:50:29
| 1,283,571 |
03/21/2012 13:59:30
| 1 | 0 |
Java Eclipse+Jigloo. Abstract class
|
I'm using eclipse with jigloo plugin. I have an abstract class - NewFrame, and a class which extends it - UserFrame. When I'm trying to open UserFrame with Jigloo GUI, there is a mistake: "Error: The class UserFrame extends the abstract class NewFrame - you should implement the getGUIBuilderInstance method for UserFrame."
I found the decision [here][1], so I created NewJFrame-class with constructor and added getGUIBuilderInstance()-method to UserFrame-class. But it still doesn't work. I'm doing something wrong?
[1]: http://kameleon.ijs.si/temp/eclipse/temp/plugins/com.cloudgarden.jigloo_4.2.0/html/inheritance.html#abstract "here"
|
java
|
eclipse-plugin
| null | null | null | null |
open
|
Java Eclipse+Jigloo. Abstract class
===
I'm using eclipse with jigloo plugin. I have an abstract class - NewFrame, and a class which extends it - UserFrame. When I'm trying to open UserFrame with Jigloo GUI, there is a mistake: "Error: The class UserFrame extends the abstract class NewFrame - you should implement the getGUIBuilderInstance method for UserFrame."
I found the decision [here][1], so I created NewJFrame-class with constructor and added getGUIBuilderInstance()-method to UserFrame-class. But it still doesn't work. I'm doing something wrong?
[1]: http://kameleon.ijs.si/temp/eclipse/temp/plugins/com.cloudgarden.jigloo_4.2.0/html/inheritance.html#abstract "here"
| 0 |
7,362,181 |
09/09/2011 13:15:04
| 853,896 |
07/20/2011 12:17:51
| 3 | 0 |
MS Studio 2008 plugin - Change icon in solution explorer
|
I was exploring on the web but didn't find anything useful..
I managed to read item's name but nothing more..
Any help is welcome!
|
c#
| null | null | null | null |
09/09/2011 19:17:17
|
not a real question
|
MS Studio 2008 plugin - Change icon in solution explorer
===
I was exploring on the web but didn't find anything useful..
I managed to read item's name but nothing more..
Any help is welcome!
| 1 |
5,615,135 |
04/10/2011 22:23:23
| 583,916 |
01/21/2011 03:41:19
| 46 | 0 |
codeigniter -> Upload Null Issue
|
I am getting the following error:
`Column 'thumbpath' cannot be null`
I have tried `$thumb_info = $thumb_info = $this->image_lib->resize();` and then in my `$data` array I have set it like `'thumbpath' => $thumb_info['create_thumb']` but this causes a PHP error
`Fatal error: Call to a member function resize() on a non-object in addimage.php on line 60`
I also am struggling to get the error or success messages to post into the view:
**View**
<?php
//Setting form attributes
$formAddImage = array('id' => 'addImage', 'name' => 'addImage');
$imageImage = array('id' => 'userfile', 'name' => 'userfile', 'placeholder' => 'File Location*');
$imageDescription = array('id' => 'description','name' => 'description','placeholder' => 'Image Description*');
?>
<section id = "validation"><?php echo validation_errors();?></section>
<?php
if(!empty($success)) : ?>
<section id="validation"><?php echo $success; ?></section>
<?php endif; ?>
<?php
echo form_open_multipart('admin/addimage', $formAddImage);
echo form_fieldset();
echo form_upload($imageImage);
echo form_textarea($imageDescription);
echo form_submit('submit','Submit');
echo form_fieldset_close();
echo form_close();
?>`
**Controller**
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Addimage extends CI_Controller {
function __construct(){
parent::__construct();
}
function index() {
if(!$this->session->userdata('logged_in')) {
redirect('admin/home');
}
// Main Page Data
$data['cms_pages'] = $this->navigation_model->getCMSPages();
$data['title'] = 'Add Gallery Image';
$data['content'] = $this->load->view('admin/addimage',NULL,TRUE);
$this->load->view('admintemplate', $data);
//Set Validation
//$this->form_validation->set_rules('userfile', 'userfile', 'trim|required');
$this->form_validation->set_rules('description', 'Description', 'trim|required');
if($this->form_validation->run() === TRUE) {
//Set File Settings
$config['upload_path'] = 'includes/uploads/gallery/';
$config['allowed_types'] = 'jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if(!$this->upload->do_upload()) {
$error = array('imageError' => $this->upload->display_errors());
$this->load->view('admintemplate', $data);
}
else{
$data = array('upload_data' => $this->upload->data());
$config['image_library'] = 'GD2';
$config['source_image'] = $this->upload->upload_path.$this->upload->file_name;
$config['new_image'] = 'includes/uploads/gallery/thumbs/';
$config['create_thumb'] = 'TRUE';
$config['maintain_ratio'] = 'FALSE';
$config['width'] = '200';
$config['height'] = '150';
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}
$file_info = $this->upload->data();
$data = array(
'description' => $this->input->post('description', TRUE),
'fullpath' => $file_info['file_name'],
'thumbpath' => $file_info['create_thumb']
);
$this->image_model->addImage($data);
$this->data['success'] = 'Thank You, Your Image Has Been Uploaded';
}
}
}
**Model**
function addImage($data) {
$this->db->insert('images',$data);
return;
}
|
php
|
query
|
codeigniter
|
upload
| null | null |
open
|
codeigniter -> Upload Null Issue
===
I am getting the following error:
`Column 'thumbpath' cannot be null`
I have tried `$thumb_info = $thumb_info = $this->image_lib->resize();` and then in my `$data` array I have set it like `'thumbpath' => $thumb_info['create_thumb']` but this causes a PHP error
`Fatal error: Call to a member function resize() on a non-object in addimage.php on line 60`
I also am struggling to get the error or success messages to post into the view:
**View**
<?php
//Setting form attributes
$formAddImage = array('id' => 'addImage', 'name' => 'addImage');
$imageImage = array('id' => 'userfile', 'name' => 'userfile', 'placeholder' => 'File Location*');
$imageDescription = array('id' => 'description','name' => 'description','placeholder' => 'Image Description*');
?>
<section id = "validation"><?php echo validation_errors();?></section>
<?php
if(!empty($success)) : ?>
<section id="validation"><?php echo $success; ?></section>
<?php endif; ?>
<?php
echo form_open_multipart('admin/addimage', $formAddImage);
echo form_fieldset();
echo form_upload($imageImage);
echo form_textarea($imageDescription);
echo form_submit('submit','Submit');
echo form_fieldset_close();
echo form_close();
?>`
**Controller**
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Addimage extends CI_Controller {
function __construct(){
parent::__construct();
}
function index() {
if(!$this->session->userdata('logged_in')) {
redirect('admin/home');
}
// Main Page Data
$data['cms_pages'] = $this->navigation_model->getCMSPages();
$data['title'] = 'Add Gallery Image';
$data['content'] = $this->load->view('admin/addimage',NULL,TRUE);
$this->load->view('admintemplate', $data);
//Set Validation
//$this->form_validation->set_rules('userfile', 'userfile', 'trim|required');
$this->form_validation->set_rules('description', 'Description', 'trim|required');
if($this->form_validation->run() === TRUE) {
//Set File Settings
$config['upload_path'] = 'includes/uploads/gallery/';
$config['allowed_types'] = 'jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if(!$this->upload->do_upload()) {
$error = array('imageError' => $this->upload->display_errors());
$this->load->view('admintemplate', $data);
}
else{
$data = array('upload_data' => $this->upload->data());
$config['image_library'] = 'GD2';
$config['source_image'] = $this->upload->upload_path.$this->upload->file_name;
$config['new_image'] = 'includes/uploads/gallery/thumbs/';
$config['create_thumb'] = 'TRUE';
$config['maintain_ratio'] = 'FALSE';
$config['width'] = '200';
$config['height'] = '150';
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}
$file_info = $this->upload->data();
$data = array(
'description' => $this->input->post('description', TRUE),
'fullpath' => $file_info['file_name'],
'thumbpath' => $file_info['create_thumb']
);
$this->image_model->addImage($data);
$this->data['success'] = 'Thank You, Your Image Has Been Uploaded';
}
}
}
**Model**
function addImage($data) {
$this->db->insert('images',$data);
return;
}
| 0 |
10,023,393 |
04/05/2012 06:03:30
| 551,967 |
12/23/2010 03:49:06
| 60 | 4 |
Available screen size on Linux in QT 3
|
QDesktopWidget * screen = QApplication::desktop();
QRect size = screen->availableGeometry(this);
Qt doc says,
What is available will be subrect of screenGeometry() based on what
the platform decides is available (for example excludes the Dock and
Menubar on Mac OS X, or the taskbar on Windows).
What I want to know is how can i get available screen geometry (without panels) on LINUX ? I tried above code on linux, but it returns physical screen size.
|
c++
|
qt
|
gui
|
qt3
| null | null |
open
|
Available screen size on Linux in QT 3
===
QDesktopWidget * screen = QApplication::desktop();
QRect size = screen->availableGeometry(this);
Qt doc says,
What is available will be subrect of screenGeometry() based on what
the platform decides is available (for example excludes the Dock and
Menubar on Mac OS X, or the taskbar on Windows).
What I want to know is how can i get available screen geometry (without panels) on LINUX ? I tried above code on linux, but it returns physical screen size.
| 0 |
7,824,036 |
10/19/2011 15:43:19
| 209,636 |
11/12/2009 14:12:07
| 77 | 0 |
How to unlock SO pin in USB Token?
|
Simple issue, but i don't know how to unlock USB Token that SO pin locked. I have try to read PKCS 11 but have no idea how to implemention this function or tool for executive this. Can anyone have knowgledge about this, please help me!
|
c++
|
pkcs11
| null | null | null |
10/21/2011 04:34:18
|
off topic
|
How to unlock SO pin in USB Token?
===
Simple issue, but i don't know how to unlock USB Token that SO pin locked. I have try to read PKCS 11 but have no idea how to implemention this function or tool for executive this. Can anyone have knowgledge about this, please help me!
| 2 |
5,059,476 |
02/20/2011 19:36:43
| 578,332 |
01/17/2011 09:38:04
| 11 | 0 |
import data from Excel
|
I want import data from Excel into Paradox db on delphi 7
|
delphi-7
| null | null | null | null |
02/22/2011 22:57:51
|
not a real question
|
import data from Excel
===
I want import data from Excel into Paradox db on delphi 7
| 1 |
11,299,381 |
07/02/2012 18:44:42
| 901,891 |
08/19/2011 06:16:02
| 13 | 0 |
MySQL order by not working with join
|
I am attempting to create a mysql query that ranks MMA fighters based on their score, and whether or not they are professional, and their weight class, together creating a fighters division. I have a table with all of the fighters that contains their weight, status (professional or amateur), and a bunch of other columns. I also have a table that contains scores that are calculated from all of their fights. The records need to be ordered by both division and score, but I can only get my query to order by the division:
INSERT INTO fa_rankings (fighter_id, rank, division)
SELECT
fa_scores.fighter_id,
@r := CASE WHEN @div <> f_division THEN 1 ELSE @r+1 END as f_rank,
@div := f_division
FROM
(SELECT @div := NULL) d,
(SELECT @r := 0) r,
fa_scores
JOIN (SELECT fa_fighters.fighter_id,
CONCAT(
IF(status = 'professional', 'a', 'b'),
CASE
WHEN weight < 126 THEN 0
WHEN weight BETWEEN 126 AND 135 THEN 1
WHEN weight BETWEEN 136 AND 145 THEN 2
WHEN weight BETWEEN 146 AND 155 THEN 3
WHEN weight BETWEEN 156 AND 170 THEN 4
WHEN weight BETWEEN 171 AND 185 THEN 5
WHEN weight BETWEEN 186 AND 205 THEN 6
WHEN weight BETWEEN 206 AND 265 THEN 7
ELSE 8 END) as f_division
FROM fa_fighters
ORDER BY f_division ASC) as fighters using (fighter_id)
ORDER BY score DESC
I'm guessing this has something to do with where the last order by statement is, but I can't figure out where else to put it, because it doesn't work with in the joined query. Right now this query generates the following:
Rankings Table Compared with Scores
+------------+------+----------+ +-------+
| fighter_id | rank | division | | score |
+------------+------+----------+ +-------+
| 131 | 1 | a1 | | 0 |
| 23 | 2 | a1 | | 34 |
| 332 | 3 | a1 | | 4 |
| 1233 | 1 | a2 | | 0 |
| 643 | 2 | a2 | | 44 |
+------------+------+----------+ +-------+
EDIT: I had previous query that did not use a join, but that only grouped by whether or not the fighter was professional, and that query did apply the rankings correctly, so I suspect it has something to with the join.
|
mysql
|
join
|
order
| null | null | null |
open
|
MySQL order by not working with join
===
I am attempting to create a mysql query that ranks MMA fighters based on their score, and whether or not they are professional, and their weight class, together creating a fighters division. I have a table with all of the fighters that contains their weight, status (professional or amateur), and a bunch of other columns. I also have a table that contains scores that are calculated from all of their fights. The records need to be ordered by both division and score, but I can only get my query to order by the division:
INSERT INTO fa_rankings (fighter_id, rank, division)
SELECT
fa_scores.fighter_id,
@r := CASE WHEN @div <> f_division THEN 1 ELSE @r+1 END as f_rank,
@div := f_division
FROM
(SELECT @div := NULL) d,
(SELECT @r := 0) r,
fa_scores
JOIN (SELECT fa_fighters.fighter_id,
CONCAT(
IF(status = 'professional', 'a', 'b'),
CASE
WHEN weight < 126 THEN 0
WHEN weight BETWEEN 126 AND 135 THEN 1
WHEN weight BETWEEN 136 AND 145 THEN 2
WHEN weight BETWEEN 146 AND 155 THEN 3
WHEN weight BETWEEN 156 AND 170 THEN 4
WHEN weight BETWEEN 171 AND 185 THEN 5
WHEN weight BETWEEN 186 AND 205 THEN 6
WHEN weight BETWEEN 206 AND 265 THEN 7
ELSE 8 END) as f_division
FROM fa_fighters
ORDER BY f_division ASC) as fighters using (fighter_id)
ORDER BY score DESC
I'm guessing this has something to do with where the last order by statement is, but I can't figure out where else to put it, because it doesn't work with in the joined query. Right now this query generates the following:
Rankings Table Compared with Scores
+------------+------+----------+ +-------+
| fighter_id | rank | division | | score |
+------------+------+----------+ +-------+
| 131 | 1 | a1 | | 0 |
| 23 | 2 | a1 | | 34 |
| 332 | 3 | a1 | | 4 |
| 1233 | 1 | a2 | | 0 |
| 643 | 2 | a2 | | 44 |
+------------+------+----------+ +-------+
EDIT: I had previous query that did not use a join, but that only grouped by whether or not the fighter was professional, and that query did apply the rankings correctly, so I suspect it has something to with the join.
| 0 |
11,544,612 |
07/18/2012 15:13:21
| 1,471,926 |
06/21/2012 11:21:26
| 17 | 0 |
Android TextView carry text by letters
|
Is there any way to carry text in TextView by letters in Android?
If no settings have been set – TextView carries text by words and situation is possible when with too long word you have big whitespace in TextView.
Example – what I’m talking about:
![Carry text by words][1]
[1]: http://i.stack.imgur.com/LRxbV.png
|
android
| null | null | null | null | null |
open
|
Android TextView carry text by letters
===
Is there any way to carry text in TextView by letters in Android?
If no settings have been set – TextView carries text by words and situation is possible when with too long word you have big whitespace in TextView.
Example – what I’m talking about:
![Carry text by words][1]
[1]: http://i.stack.imgur.com/LRxbV.png
| 0 |
9,969,527 |
04/02/2012 00:16:22
| 925,916 |
09/02/2011 19:45:45
| 29 | 0 |
Many to many using Flask-SQLAlchemy returns raw sql instead of executed
|
Im using the python framework flask with sqlalchemy.
My many-to-many looks like this:
collections_questions = db.Table('collections_questions',
db.Column('question_id',db.Integer,db.ForeignKey('question.id')),
db.Column('collection_id',db.Integer,db.ForeignKey('collection.id'))
)
class Collection(db.Model):
id = db.Column(db.Integer,primary_key=True)
title = db.Column(db.String)
lang = db.Column(db.Integer)
questions = db.relationship('Question',secondary=collections_questions,backref=db.backref('collections'),lazy='dynamic')
def __init__(self,title,lang=0):
self.title = title
self.lang = lang
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String)
question = db.Column(db.String)
lang = db.Column(db.Integer)
type = db.Column(db.Integer)
def __init__(self,title,question,lang=0,type=0):
self.title = title
self.question = question
self.lang = lang
self.type = type
Now if i do
collection = db.session.query(Collection).get(1)
collection.questions does not return a list of questions, instead it returns the following query.
SELECT question.id AS question_id, question.title AS question_title, question.question AS question_question, question.lang AS question_lang, question.type AS question_type
FROM question, collections_questions
WHERE :param_1 = collections_questions.collection_id AND question.id = collections_questions.question_id
Any help would be greatly apprecieted!
Thanks
|
sqlalchemy
|
flask
|
flask-sqlalchemy
| null | null | null |
open
|
Many to many using Flask-SQLAlchemy returns raw sql instead of executed
===
Im using the python framework flask with sqlalchemy.
My many-to-many looks like this:
collections_questions = db.Table('collections_questions',
db.Column('question_id',db.Integer,db.ForeignKey('question.id')),
db.Column('collection_id',db.Integer,db.ForeignKey('collection.id'))
)
class Collection(db.Model):
id = db.Column(db.Integer,primary_key=True)
title = db.Column(db.String)
lang = db.Column(db.Integer)
questions = db.relationship('Question',secondary=collections_questions,backref=db.backref('collections'),lazy='dynamic')
def __init__(self,title,lang=0):
self.title = title
self.lang = lang
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String)
question = db.Column(db.String)
lang = db.Column(db.Integer)
type = db.Column(db.Integer)
def __init__(self,title,question,lang=0,type=0):
self.title = title
self.question = question
self.lang = lang
self.type = type
Now if i do
collection = db.session.query(Collection).get(1)
collection.questions does not return a list of questions, instead it returns the following query.
SELECT question.id AS question_id, question.title AS question_title, question.question AS question_question, question.lang AS question_lang, question.type AS question_type
FROM question, collections_questions
WHERE :param_1 = collections_questions.collection_id AND question.id = collections_questions.question_id
Any help would be greatly apprecieted!
Thanks
| 0 |
9,963,076 |
04/01/2012 08:44:41
| 1,204,751 |
02/12/2012 05:58:09
| 7 | 1 |
Jqgrid on rails
|
I am unable to get proper documentation on using jqgrid in rails. Client part is working fine. That is, I am able to make AJAX call using jqgrid. I am able to receive all parameters like page, rows etc. I am not sure on how to send my data back to client. Server side code is not querying the db. It is some having code where I make many rest calls(like to twitter) and few parsing to create an array of object. What is the best way to send data.
Ex code: Server side
T1 = Triple.new(1,2); // creating new object of type Triple(fname, lname)
T2 = Triple.new(3,4); // creating new object of type Triple(fname, lname)
T << T1 //Adding it to array
T << T2 //Adding it to array
// How to construct final json out of the above mentioned array for jqgrid?
Do I need to use any gem in rails part? Or can I just construct json object and send that. A sample code for above mentioned example will be really helpful.
Sample client code which I am planning to use
jQuery("#tb2Id").jqGrid({
url:'/reference_uri.json
datatype: "json",
colNames: ['First Name', 'Last Name'],
colModel:[
{name:'Name',index:'fnames', width:55}
{name:'Name',index:'lnames', width:55}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager',
viewrecords: true,
caption:"JSON Example"
});
|
jquery
|
ruby-on-rails
|
ruby-on-rails-3
|
jqgrid
| null | null |
open
|
Jqgrid on rails
===
I am unable to get proper documentation on using jqgrid in rails. Client part is working fine. That is, I am able to make AJAX call using jqgrid. I am able to receive all parameters like page, rows etc. I am not sure on how to send my data back to client. Server side code is not querying the db. It is some having code where I make many rest calls(like to twitter) and few parsing to create an array of object. What is the best way to send data.
Ex code: Server side
T1 = Triple.new(1,2); // creating new object of type Triple(fname, lname)
T2 = Triple.new(3,4); // creating new object of type Triple(fname, lname)
T << T1 //Adding it to array
T << T2 //Adding it to array
// How to construct final json out of the above mentioned array for jqgrid?
Do I need to use any gem in rails part? Or can I just construct json object and send that. A sample code for above mentioned example will be really helpful.
Sample client code which I am planning to use
jQuery("#tb2Id").jqGrid({
url:'/reference_uri.json
datatype: "json",
colNames: ['First Name', 'Last Name'],
colModel:[
{name:'Name',index:'fnames', width:55}
{name:'Name',index:'lnames', width:55}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager',
viewrecords: true,
caption:"JSON Example"
});
| 0 |
9,132,714 |
02/03/2012 17:21:08
| 1,188,075 |
02/03/2012 17:15:01
| 1 | 0 |
C++ Serial Comunnications
|
good afternoon.
I'm breaking my mind 3 days back and I cant find something who help-me to understand the communication with Serial ASCII and PLCs; and some library in C++ that help-me to write a code for this communication.
Please someone can help me?
Thank you so much.
|
c++
|
ascii
|
serial
|
plc
| null |
02/03/2012 22:51:54
|
not a real question
|
C++ Serial Comunnications
===
good afternoon.
I'm breaking my mind 3 days back and I cant find something who help-me to understand the communication with Serial ASCII and PLCs; and some library in C++ that help-me to write a code for this communication.
Please someone can help me?
Thank you so much.
| 1 |
10,187,446 |
04/17/2012 08:07:38
| 1,051,619 |
11/17/2011 11:07:53
| 1 | 0 |
Rewrite querystring with IIS url rewrite module
|
I'm using the URL Rewrite module and I have the following querystring /foto/?tag=cats
Is there any way to rewrite this to a more friendly /foto/cats/ ?
Thanks / Niklas
|
url-rewrite-module
| null | null | null | null | null |
open
|
Rewrite querystring with IIS url rewrite module
===
I'm using the URL Rewrite module and I have the following querystring /foto/?tag=cats
Is there any way to rewrite this to a more friendly /foto/cats/ ?
Thanks / Niklas
| 0 |
7,134,325 |
08/20/2011 20:02:52
| 708,274 |
04/14/2011 15:49:47
| 103 | 0 |
jQuery Ajax Combo box not working
|
I have the following combo box which sets the number of images displayed per page. I had the original php code working, but I am having a lot of trouble using jQuery to change it to Ajax.
It appears the combo box part is working, but it's hard to tell as the images are not displaying.
I'm hoping someone can help me.
**The HTML**
<form>
<label>Images Number:</label>
<select id="imgNum" name="imgNum">
<option value="12">12</option>
<option value="16">16</option>
<option value="20">20</option>
</select>
</form>
<div id="imgTray"></div>
**The jQuery**
//Bind the onChange event to Fetch images on combox selection
$("#imgNum").change(function(){
//The combo box
var sel = $(this);
//Selected value
var value = sel.value();
//Fetch the images
$.get("get_images.php",{imgs: value}, function(data){
//Add images to the document
$("#imgTray").html(data);
});
})
//You should store the current selected option in a cookie
//For the sake of the example i'll set the default permanently to 12
var imgNum_selected = 12;
//set the initial selected option and trigger the event
$("#imgNum [value='"+imgNum_selected+"']")
.prop("selected","selected")
.change();
**The PHP**
<?php
if((int) $_GET['imgs'] > 0){
$limit = (int) $_GET['imgs'];
} else {
$limit = 12;
}
$curPage = 0;
if(isset($_GET['page'])){
$curPage = (int) $_GET['page'];
}
$mysql_link = mysql_connect("localhost", "root", "root");
mysql_select_db("new_arrivals_imgs") or die("Could not select database");
$query = mysql_query("SELECT `imgURL`,`imgTitle` FROM `images` ".
"ORDER BY `imgDate` DESC LIMIT " . $limit * $curPage . ", $limit") or die(mysql_error());
if(!$query) {
echo "Cannot retrieve information from database.";
} else {
while($row = mysql_fetch_assoc($query)) {
echo "<li><a href='new_arrivals_img/".$row['imgURL']."' class='gallery' title='".$row['imgTitle']."'><img src='new_arrivals_img/thumbnails/".$row['imgURL']."'></a></li>";
}
}
?>
Thanks in advance for any help you can provide.
|
php
|
ajax
|
jquery-ajax
| null | null | null |
open
|
jQuery Ajax Combo box not working
===
I have the following combo box which sets the number of images displayed per page. I had the original php code working, but I am having a lot of trouble using jQuery to change it to Ajax.
It appears the combo box part is working, but it's hard to tell as the images are not displaying.
I'm hoping someone can help me.
**The HTML**
<form>
<label>Images Number:</label>
<select id="imgNum" name="imgNum">
<option value="12">12</option>
<option value="16">16</option>
<option value="20">20</option>
</select>
</form>
<div id="imgTray"></div>
**The jQuery**
//Bind the onChange event to Fetch images on combox selection
$("#imgNum").change(function(){
//The combo box
var sel = $(this);
//Selected value
var value = sel.value();
//Fetch the images
$.get("get_images.php",{imgs: value}, function(data){
//Add images to the document
$("#imgTray").html(data);
});
})
//You should store the current selected option in a cookie
//For the sake of the example i'll set the default permanently to 12
var imgNum_selected = 12;
//set the initial selected option and trigger the event
$("#imgNum [value='"+imgNum_selected+"']")
.prop("selected","selected")
.change();
**The PHP**
<?php
if((int) $_GET['imgs'] > 0){
$limit = (int) $_GET['imgs'];
} else {
$limit = 12;
}
$curPage = 0;
if(isset($_GET['page'])){
$curPage = (int) $_GET['page'];
}
$mysql_link = mysql_connect("localhost", "root", "root");
mysql_select_db("new_arrivals_imgs") or die("Could not select database");
$query = mysql_query("SELECT `imgURL`,`imgTitle` FROM `images` ".
"ORDER BY `imgDate` DESC LIMIT " . $limit * $curPage . ", $limit") or die(mysql_error());
if(!$query) {
echo "Cannot retrieve information from database.";
} else {
while($row = mysql_fetch_assoc($query)) {
echo "<li><a href='new_arrivals_img/".$row['imgURL']."' class='gallery' title='".$row['imgTitle']."'><img src='new_arrivals_img/thumbnails/".$row['imgURL']."'></a></li>";
}
}
?>
Thanks in advance for any help you can provide.
| 0 |
7,314,068 |
09/06/2011 01:15:43
| 929,762 |
09/06/2011 01:15:43
| 1 | 0 |
Awaitility for testing Async messages
|
I read some documentation that Awaitility framework can help testing Async messages. Does any one has implemented it or is there any feedack on Awaitility implementation.
Thanks
Devautomater
|
testing
|
asynchronous
|
messages
| null | null |
09/06/2011 23:33:12
|
not constructive
|
Awaitility for testing Async messages
===
I read some documentation that Awaitility framework can help testing Async messages. Does any one has implemented it or is there any feedack on Awaitility implementation.
Thanks
Devautomater
| 4 |
11,725,434 |
07/30/2012 16:17:22
| 1,098,699 |
12/14/2011 21:00:48
| 171 | 0 |
Justifying Text Java
|
I came across a question in an old computer olympiad where you are required to justify text in java.
Bassically, you are given a sentence that stays the same throughout the program for example:
The existence of religion in all of the world's major societies is the result of the process of Darwinian natural selection. Religion is a set of beliefs made by the elders in a society to enforce the moral values necessary to preserve the society which exploits a belief and supernatural powers to enforce “the rules.”
The user inputs the column width (how many characters should fit on a line) and then the text is outputted as such.
eg column width 13
The existence
rest of text
|
java
| null | null | null | null |
07/31/2012 08:32:30
|
not a real question
|
Justifying Text Java
===
I came across a question in an old computer olympiad where you are required to justify text in java.
Bassically, you are given a sentence that stays the same throughout the program for example:
The existence of religion in all of the world's major societies is the result of the process of Darwinian natural selection. Religion is a set of beliefs made by the elders in a society to enforce the moral values necessary to preserve the society which exploits a belief and supernatural powers to enforce “the rules.”
The user inputs the column width (how many characters should fit on a line) and then the text is outputted as such.
eg column width 13
The existence
rest of text
| 1 |
9,937,849 |
03/30/2012 06:12:29
| 1,193,386 |
02/06/2012 21:55:50
| 3 | 0 |
inputting pics in tex file, using winedt 6
|
Don't understand why this piece won't compile fluently.
tex file as following:
\begin{figure}
\centering
\includegraphics[width=\textwidth]{chapter2/epjb/groups_0.pdf}
\caption{\label{fig:epjbgroups} Schematic diagram indicating the presence of coalescence
and fragmentation processes, for a population of $N=15$ objects
dynamically partitioned into clusters. The size of cluster $i$ is
$s_i=2$, while the size of cluster $j$ is $s_j=6$ etc. The
fragmentation process exhibits the richest range of possibilities,
given the combinatorial number of ways in which a cluster can in
principle be divided. There are many possible realizations of the
objects themselves, e.g. humans, animals, macromolecules, though
for simplicity we show them as humans.}
\end{figure}
the output of PDFLatex is:
!Extra }, or forgoten \endgroup.
\color@endbox ->egroup
1.118 \end{figure}
?
Don't understand where the extra } come from.
|
latex
|
tex
| null | null | null |
03/30/2012 10:05:26
|
off topic
|
inputting pics in tex file, using winedt 6
===
Don't understand why this piece won't compile fluently.
tex file as following:
\begin{figure}
\centering
\includegraphics[width=\textwidth]{chapter2/epjb/groups_0.pdf}
\caption{\label{fig:epjbgroups} Schematic diagram indicating the presence of coalescence
and fragmentation processes, for a population of $N=15$ objects
dynamically partitioned into clusters. The size of cluster $i$ is
$s_i=2$, while the size of cluster $j$ is $s_j=6$ etc. The
fragmentation process exhibits the richest range of possibilities,
given the combinatorial number of ways in which a cluster can in
principle be divided. There are many possible realizations of the
objects themselves, e.g. humans, animals, macromolecules, though
for simplicity we show them as humans.}
\end{figure}
the output of PDFLatex is:
!Extra }, or forgoten \endgroup.
\color@endbox ->egroup
1.118 \end{figure}
?
Don't understand where the extra } come from.
| 2 |
9,847,605 |
03/23/2012 23:09:24
| 768,398 |
05/24/2011 19:31:56
| 5 | 0 |
How to work with java using methods and arrays
|
Hi i'm a newb at java and for one of my labs I have to create a instant messenger client with these requirements:
-add buddyList instance variable
-add IMClient constructor to create ArrayList
-addBuddy method
-removeBuddy method
-findBuddy method
-printBuddyList method
what's the best way to go about this? so far I have this:
public class IMClient
{
private String userId; // User id
private String password; // Password
private int status; // Status code for user: 1 - Online, 2 - Off-line, 3 - Away
public IMClient(String userId, String password, int status)
{
super();
this.userId = userId;
this.password = password;
this.status = status;
}
// Returns true if password as a parameter matches password instance variable.
public boolean checkPassword(String password)
{
return this.password.equals(password);
}
public String toString()
{ StringBuffer buf = new StringBuffer(100);
buf.append(" User id: ");
buf.append(userId);
buf.append(" Password: ");
buf.append(password);
buf.append(" Status: ");
buf.append(status);
return buf.toString();
}
public String getUserId()
{
return userId;
}
public void setUserId(String userId)
{
this.userId = userId;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public int getStatus()
{
return status;
}
public void setStatus(int status)
{
this.status = status;
}
public static void main(String[] args)
{
}
}
|
java
| null | null | null | null |
03/23/2012 23:24:26
|
not a real question
|
How to work with java using methods and arrays
===
Hi i'm a newb at java and for one of my labs I have to create a instant messenger client with these requirements:
-add buddyList instance variable
-add IMClient constructor to create ArrayList
-addBuddy method
-removeBuddy method
-findBuddy method
-printBuddyList method
what's the best way to go about this? so far I have this:
public class IMClient
{
private String userId; // User id
private String password; // Password
private int status; // Status code for user: 1 - Online, 2 - Off-line, 3 - Away
public IMClient(String userId, String password, int status)
{
super();
this.userId = userId;
this.password = password;
this.status = status;
}
// Returns true if password as a parameter matches password instance variable.
public boolean checkPassword(String password)
{
return this.password.equals(password);
}
public String toString()
{ StringBuffer buf = new StringBuffer(100);
buf.append(" User id: ");
buf.append(userId);
buf.append(" Password: ");
buf.append(password);
buf.append(" Status: ");
buf.append(status);
return buf.toString();
}
public String getUserId()
{
return userId;
}
public void setUserId(String userId)
{
this.userId = userId;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public int getStatus()
{
return status;
}
public void setStatus(int status)
{
this.status = status;
}
public static void main(String[] args)
{
}
}
| 1 |
3,123,003 |
06/26/2010 07:00:00
| 376,840 |
06/26/2010 07:00:00
| 1 | 0 |
Using the devExpress WinForms controls with Clarion NET
|
How seamless is the integration of devexpress winforms controls in Clarion NET. Does it work at all ? Is it comfortable ?
Bjoern
|
devexpress
|
net
|
clarion
| null | null | null |
open
|
Using the devExpress WinForms controls with Clarion NET
===
How seamless is the integration of devexpress winforms controls in Clarion NET. Does it work at all ? Is it comfortable ?
Bjoern
| 0 |
10,196,404 |
04/17/2012 17:55:17
| 412,395 |
06/22/2010 19:16:03
| 1,734 | 130 |
How to completely quit an android apllication?
|
I'm facing a similar issue like [this one][1]. I'm using some static class members inlcuding singletons in my aplication. When I leave the main activity using finish() and start it again, all static members are still present. It seems not to be a good soloution to call Process.killProcess(Process.myPid()); and I also don't want to need to unset all static members when I leave the application because this is error-prone when extending the application. So how would one completely quit an android application properly?
[1]: http://stackoverflow.com/questions/3421812/destroy-android-application
|
android
|
application
|
quit
| null | null | null |
open
|
How to completely quit an android apllication?
===
I'm facing a similar issue like [this one][1]. I'm using some static class members inlcuding singletons in my aplication. When I leave the main activity using finish() and start it again, all static members are still present. It seems not to be a good soloution to call Process.killProcess(Process.myPid()); and I also don't want to need to unset all static members when I leave the application because this is error-prone when extending the application. So how would one completely quit an android application properly?
[1]: http://stackoverflow.com/questions/3421812/destroy-android-application
| 0 |
10,600,158 |
05/15/2012 11:55:17
| 595,090 |
01/29/2011 16:19:47
| 19 | 8 |
Colour the border of an image in a map
|
I am using MS Chart control, where in within a point chart I have to populate some mini charts (pie or bar) based on the position of the points.
And when the user clicks or hovers over those point it should fire some events (circle/mark the image border or show data). I have completed all except the last part, I cannot apply the css to the image border.
I will paste the rendered html from the page here:
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function showData(pie) {
debugger;
$(pie).css("border-width", "thick");
$(pie).css("border-color", "Red");
$(pie).css("border-style", "dotted");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="sampleTable">
<tr>
<td class="style3">
<asp:Chart ID="Chart1" runat="server" Width="412px" Height="296px" ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)"
ImageType="Png" BorderlineDashStyle="Solid" Palette="BrightPastel" BackSecondaryColor="White"
BackGradientStyle="TopBottom" BorderWidth="2" BackColor="WhiteSmoke" BorderColor="26, 59, 105"
ClientIDMode="Static">
<Titles>
<asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" ShadowOffset="3"
Text="Case Value Assesment" ForeColor="26, 59, 105">
</asp:Title>
</Titles>
<Legends>
<asp:Legend Enabled="False" IsTextAutoFit="False" Name="Default" BackColor="Transparent"
Font="Trebuchet MS, 8.25pt, style=Bold">
</asp:Legend>
</Legends>
<BorderSkin SkinStyle="Emboss"></BorderSkin>
<Series>
<asp:Series MarkerSize="22" YValuesPerPoint="2" Name="Default" ChartType="Point"
CustomProperties="BubbleScaleMin=-60" BorderColor="180, 26, 59, 105" Color="220, 65, 140, 240"
ShadowOffset="2">
<Points>
<asp:DataPoint YValues="9,20" />
<asp:DataPoint YValues="2,30" />
<asp:DataPoint YValues="5,50" />
<asp:DataPoint YValues="7,5" />
<asp:DataPoint YValues="4,60" />
<asp:DataPoint YValues="2,25" />
<asp:DataPoint YValues="6,50" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BackSecondaryColor="White"
BackColor="Gainsboro" ShadowColor="Transparent" BackGradientStyle="TopBottom">
<Area3DStyle Rotation="10" Perspective="10" Inclination="15" IsRightAngleAxes="False"
WallWidth="0" IsClustered="False" />
<AxisY LineColor="64, 64, 64, 64" IsLabelAutoFit="False" Title="Percent Fact Match">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisY>
<AxisX LineColor="64, 64, 64, 64" IsLabelAutoFit="False" Title="Settlement Or Verdict Amount">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
</td>
</table>
</div>
</form>
</body>
</html>
Can someone help me border(put a circle) around the mini-charts when an user clicks it?
Attaching the rendered chart image for reference:
![Image rendered for the MS Chart control][1]
Regards
Aritra
[1]: http://i.stack.imgur.com/Y9YXY.png
|
javascript
|
asp.net
|
css
|
jquery-selectors
| null |
05/18/2012 13:03:24
|
not a real question
|
Colour the border of an image in a map
===
I am using MS Chart control, where in within a point chart I have to populate some mini charts (pie or bar) based on the position of the points.
And when the user clicks or hovers over those point it should fire some events (circle/mark the image border or show data). I have completed all except the last part, I cannot apply the css to the image border.
I will paste the rendered html from the page here:
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function showData(pie) {
debugger;
$(pie).css("border-width", "thick");
$(pie).css("border-color", "Red");
$(pie).css("border-style", "dotted");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="sampleTable">
<tr>
<td class="style3">
<asp:Chart ID="Chart1" runat="server" Width="412px" Height="296px" ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)"
ImageType="Png" BorderlineDashStyle="Solid" Palette="BrightPastel" BackSecondaryColor="White"
BackGradientStyle="TopBottom" BorderWidth="2" BackColor="WhiteSmoke" BorderColor="26, 59, 105"
ClientIDMode="Static">
<Titles>
<asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" ShadowOffset="3"
Text="Case Value Assesment" ForeColor="26, 59, 105">
</asp:Title>
</Titles>
<Legends>
<asp:Legend Enabled="False" IsTextAutoFit="False" Name="Default" BackColor="Transparent"
Font="Trebuchet MS, 8.25pt, style=Bold">
</asp:Legend>
</Legends>
<BorderSkin SkinStyle="Emboss"></BorderSkin>
<Series>
<asp:Series MarkerSize="22" YValuesPerPoint="2" Name="Default" ChartType="Point"
CustomProperties="BubbleScaleMin=-60" BorderColor="180, 26, 59, 105" Color="220, 65, 140, 240"
ShadowOffset="2">
<Points>
<asp:DataPoint YValues="9,20" />
<asp:DataPoint YValues="2,30" />
<asp:DataPoint YValues="5,50" />
<asp:DataPoint YValues="7,5" />
<asp:DataPoint YValues="4,60" />
<asp:DataPoint YValues="2,25" />
<asp:DataPoint YValues="6,50" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BackSecondaryColor="White"
BackColor="Gainsboro" ShadowColor="Transparent" BackGradientStyle="TopBottom">
<Area3DStyle Rotation="10" Perspective="10" Inclination="15" IsRightAngleAxes="False"
WallWidth="0" IsClustered="False" />
<AxisY LineColor="64, 64, 64, 64" IsLabelAutoFit="False" Title="Percent Fact Match">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisY>
<AxisX LineColor="64, 64, 64, 64" IsLabelAutoFit="False" Title="Settlement Or Verdict Amount">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
</td>
</table>
</div>
</form>
</body>
</html>
Can someone help me border(put a circle) around the mini-charts when an user clicks it?
Attaching the rendered chart image for reference:
![Image rendered for the MS Chart control][1]
Regards
Aritra
[1]: http://i.stack.imgur.com/Y9YXY.png
| 1 |
8,248,383 |
11/23/2011 20:03:56
| 1,050,429 |
11/16/2011 20:04:07
| 30 | 0 |
Random numbers 1-6
|
Im trying to create a simple high/low app but the application crashes when I try to get a random number.
Here is some code:
final TextView counter = (TextView) findViewById(R.id.tcounter);
Button high = (Button) findViewById(R.id.bhigh);
Button low = (Button) findViewById(R.id.blow);
Button start = (Button) findViewById(R.id.bplay);
final Random rstart = new Random();
final int counternr = rstart.nextInt(5) + 1;
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
counter.setText(counternr);
That is supposed to set the TextView "counter" to a random number from 1-6, but gives me a crash.
Thanks in advance!
|
java
|
android
| null | null | null | null |
open
|
Random numbers 1-6
===
Im trying to create a simple high/low app but the application crashes when I try to get a random number.
Here is some code:
final TextView counter = (TextView) findViewById(R.id.tcounter);
Button high = (Button) findViewById(R.id.bhigh);
Button low = (Button) findViewById(R.id.blow);
Button start = (Button) findViewById(R.id.bplay);
final Random rstart = new Random();
final int counternr = rstart.nextInt(5) + 1;
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
counter.setText(counternr);
That is supposed to set the TextView "counter" to a random number from 1-6, but gives me a crash.
Thanks in advance!
| 0 |
776,673 |
04/22/2009 11:07:52
| 11,256 |
09/16/2008 06:37:37
| 1,635 | 63 |
Parameter binding of POST action method
|
You can see what **GET Delete** action method passes DDW2File object to view. Is it possible somehow to bind this object back to **ddw2file** parameter of **POST Delete** action method? Now I have **null** value in it.
Code fragment:
public class DDW2FileController : Controller
{
...
public ActionResult Delete(string fileName)
{
return View(repository.GetFile(fileName));
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Delete(DDW2File ddw2file)
{
repository.Delete(file);
return View("Index", repository.Files);
}
}
...
public class DDW2File
{
public string Name { get; set; }
public long Length { get; set; }
}
Thanks!
|
asp.net-mvc
|
controller
| null | null | null | null |
open
|
Parameter binding of POST action method
===
You can see what **GET Delete** action method passes DDW2File object to view. Is it possible somehow to bind this object back to **ddw2file** parameter of **POST Delete** action method? Now I have **null** value in it.
Code fragment:
public class DDW2FileController : Controller
{
...
public ActionResult Delete(string fileName)
{
return View(repository.GetFile(fileName));
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Delete(DDW2File ddw2file)
{
repository.Delete(file);
return View("Index", repository.Files);
}
}
...
public class DDW2File
{
public string Name { get; set; }
public long Length { get; set; }
}
Thanks!
| 0 |
2,164,016 |
01/29/2010 18:02:00
| 101,823 |
05/05/2009 20:23:19
| 563 | 7 |
Should I have multiple swf files on different webpages?
|
I'm writing a small game app in Flash, and I'm wondering what the benefits of having one giant SWF loading everything vs multiple webpages and multiple SWF's.
|
flash
|
flash-cs4
| null | null | null | null |
open
|
Should I have multiple swf files on different webpages?
===
I'm writing a small game app in Flash, and I'm wondering what the benefits of having one giant SWF loading everything vs multiple webpages and multiple SWF's.
| 0 |
5,245,703 |
03/09/2011 12:22:27
| 64,105 |
02/09/2009 10:01:44
| 2,213 | 98 |
Getting head and tail from IEnumerable that can only be iterated once
|
I have a sequence of elements. The sequence can only be iterated once and can be "infinite".
What is the best way get the head and the tail of such a sequence?
|
c#
|
linq
|
ienumerable
| null | null | null |
open
|
Getting head and tail from IEnumerable that can only be iterated once
===
I have a sequence of elements. The sequence can only be iterated once and can be "infinite".
What is the best way get the head and the tail of such a sequence?
| 0 |
5,008,473 |
02/15/2011 19:21:31
| 618,430 |
02/15/2011 19:21:31
| 1 | 0 |
Delphi's function to change iso and nrg files size.
|
Need a function in Delphi to change the summary size in iso and nrg image files.
|
delphi
| null | null | null | null |
02/16/2011 09:39:08
|
not a real question
|
Delphi's function to change iso and nrg files size.
===
Need a function in Delphi to change the summary size in iso and nrg image files.
| 1 |
1,150,419 |
07/19/2009 17:42:13
| 141,012 |
07/19/2009 17:04:14
| 6 | 0 |
VB Project
|
can any one of u give me some suggesstion about what project should i make in visual basic..??? its a college mini project ..
thanks ..
|
visual
|
basic
| null | null | null |
07/19/2009 17:55:24
|
not a real question
|
VB Project
===
can any one of u give me some suggesstion about what project should i make in visual basic..??? its a college mini project ..
thanks ..
| 1 |
11,621,224 |
07/23/2012 22:03:05
| 84,131 |
03/28/2009 23:11:03
| 2,704 | 47 |
Can a Backbone.js View have a Model and a Collection?
|
Can a Backbone.js `View` have a `Model` and a `Collection`?
The reason I am asking is because I'm working with a View that holds a map with places plotted on it (using the leaflet library).
The `Collection` is of a group of models that hold coordinates to be plotted on the map.
The `Model` holds stuff like the map bounds and map shape.
Not sure how else to pull this one off...
Any help is appreciated, thanks!
|
javascript
|
backbone.js
|
backbone-relational
|
backbone-views
| null | null |
open
|
Can a Backbone.js View have a Model and a Collection?
===
Can a Backbone.js `View` have a `Model` and a `Collection`?
The reason I am asking is because I'm working with a View that holds a map with places plotted on it (using the leaflet library).
The `Collection` is of a group of models that hold coordinates to be plotted on the map.
The `Model` holds stuff like the map bounds and map shape.
Not sure how else to pull this one off...
Any help is appreciated, thanks!
| 0 |
1,012,114 |
06/18/2009 11:18:14
| 60,143 |
01/29/2009 10:38:14
| 90 | 9 |
eclipse shows unchanged files on synchronise
|
When i do a synchronisation of files or try to commit, there are also files shown that are not changed.
This is only when i did a merge from an other workspace to the one i get those files in.
When i take a look at those files, they have no difference from the files on svn.
anyone any idea?
|
eclipse
|
commit
|
merge
| null | null | null |
open
|
eclipse shows unchanged files on synchronise
===
When i do a synchronisation of files or try to commit, there are also files shown that are not changed.
This is only when i did a merge from an other workspace to the one i get those files in.
When i take a look at those files, they have no difference from the files on svn.
anyone any idea?
| 0 |
10,859,078 |
06/02/2012 01:14:29
| 1,316,405 |
04/05/2012 22:23:24
| 158 | 2 |
have div fadein on video "ended" only if it's the last in an array
|
Basically, it's what the question says. I need a div to fadeIn and another fadeOut (or show, I just used fadeIn) when a video ends, but only when it's the last video in an array of 6. I have
$("#myVid").bind("ended", function() {
if(currentVideo == videos.length) {
$(".control").fadeOut();
$("#final").fadeIn();
}
and I've tried
$("#myVid").bind("ended", function() {
if(currentVideo == 6) {
$(".control").fadeOut();
$("#final").fadeIn();
}
so, I should be doing it's job, but something isn't doing it, but I can't figure it out... Can I get some help here?
|
javascript
|
jquery
|
html5
|
binding
|
html5-video
| null |
open
|
have div fadein on video "ended" only if it's the last in an array
===
Basically, it's what the question says. I need a div to fadeIn and another fadeOut (or show, I just used fadeIn) when a video ends, but only when it's the last video in an array of 6. I have
$("#myVid").bind("ended", function() {
if(currentVideo == videos.length) {
$(".control").fadeOut();
$("#final").fadeIn();
}
and I've tried
$("#myVid").bind("ended", function() {
if(currentVideo == 6) {
$(".control").fadeOut();
$("#final").fadeIn();
}
so, I should be doing it's job, but something isn't doing it, but I can't figure it out... Can I get some help here?
| 0 |
10,949,685 |
06/08/2012 13:20:37
| 777,294 |
05/31/2011 08:09:18
| 168 | 13 |
.htaccess redirect file type
|
I have some old `.swf` files/links for a website and they currently lead to a `404 Not Found` page.
I was wondering if there was a simple way, using `.htaccess` (or any other method you may recommend) to redirect these files/links to my websites homepage `http:www.mysite.com/home`.
Example links:
`http://www.mysite.com/folder/file.swf`
`http://www.mysite.com/file.swf`
|
php
|
.htaccess
|
redirect
|
page
|
file-type
| null |
open
|
.htaccess redirect file type
===
I have some old `.swf` files/links for a website and they currently lead to a `404 Not Found` page.
I was wondering if there was a simple way, using `.htaccess` (or any other method you may recommend) to redirect these files/links to my websites homepage `http:www.mysite.com/home`.
Example links:
`http://www.mysite.com/folder/file.swf`
`http://www.mysite.com/file.swf`
| 0 |
7,955,116 |
10/31/2011 14:31:09
| 36,525 |
11/11/2008 11:28:30
| 1,662 | 125 |
Resize image on Ftp event
|
Every day in my server are copied some images via ftp.I want for every image a thumbnail to be created immediately after copying.Is there a way to catch this ftp event?Or i must check periodically for changes?
I'm on apache server using php.
Thanks
|
php
|
events
|
ftp
| null | null | null |
open
|
Resize image on Ftp event
===
Every day in my server are copied some images via ftp.I want for every image a thumbnail to be created immediately after copying.Is there a way to catch this ftp event?Or i must check periodically for changes?
I'm on apache server using php.
Thanks
| 0 |
7,861,091 |
10/22/2011 16:54:34
| 911,022 |
08/25/2011 02:31:04
| 42 | 0 |
Is it possible to make an option of a select dropdown appear as optgroup via css
|
I am actually populating options from xml for my dropdown and Now adding an optgroup to select is a challenge. Can I add them manually and change the behaviour via css
|
javascript
|
jquery
|
css
|
xml
|
optgroup
| null |
open
|
Is it possible to make an option of a select dropdown appear as optgroup via css
===
I am actually populating options from xml for my dropdown and Now adding an optgroup to select is a challenge. Can I add them manually and change the behaviour via css
| 0 |
5,800,678 |
04/27/2011 07:15:41
| 723,743 |
04/25/2011 12:53:06
| 1 | 0 |
Cell Position Using LINQ
|
I have data in List<List<string>> data. I want to locate the cell position using LINQ. Like I have 3 columns and 5 rows and my desired values is available at 1st columns and 3rd row. Please tell me the solution how I can achieve this using LINQ in C#. I want the functionality like excel where it highlights the data cell on find.
|
linq-to-objects
| null | null | null | null | null |
open
|
Cell Position Using LINQ
===
I have data in List<List<string>> data. I want to locate the cell position using LINQ. Like I have 3 columns and 5 rows and my desired values is available at 1st columns and 3rd row. Please tell me the solution how I can achieve this using LINQ in C#. I want the functionality like excel where it highlights the data cell on find.
| 0 |
8,541,577 |
12/16/2011 23:59:47
| 838,025 |
07/10/2011 23:11:14
| 75 | 1 |
.tar files on OS X Lion
|
I am about to throw my shiny new MBP out the window. How the &*&^%%&$ am I supposed to deal with .tar files with OS X Lion? Every single application I try to download spits out some dumb error about PowerPC architecture not being supported.
Any help is *greatly* appreciated.
Note: More specifically, my latest issue is trying to install Ruby Version Manager so I can update to 1.9.3.
|
ruby
|
osx
|
osx-lion
|
tar
|
powerpc
|
12/17/2011 00:21:42
|
off topic
|
.tar files on OS X Lion
===
I am about to throw my shiny new MBP out the window. How the &*&^%%&$ am I supposed to deal with .tar files with OS X Lion? Every single application I try to download spits out some dumb error about PowerPC architecture not being supported.
Any help is *greatly* appreciated.
Note: More specifically, my latest issue is trying to install Ruby Version Manager so I can update to 1.9.3.
| 2 |
11,315,393 |
07/03/2012 16:40:45
| 940,008 |
09/12/2011 06:46:57
| 57 | 1 |
open source mutation testing c++
|
I need an *Open Source* tool (even a relatively primitive one will do) which performs Mutation Testing on C++ code. I require it to be open source as I require to modify it in a proof of concept experiment. I tried Googling it but did not come up with open source tools, I came up with the question http://stackoverflow.com/questions/4715890/what-mutation-testing-frameworks-exist-for-c-c but they either are not open source or do not mutate C++.
|
c++
|
open-source
|
mutation-testing
| null | null | null |
open
|
open source mutation testing c++
===
I need an *Open Source* tool (even a relatively primitive one will do) which performs Mutation Testing on C++ code. I require it to be open source as I require to modify it in a proof of concept experiment. I tried Googling it but did not come up with open source tools, I came up with the question http://stackoverflow.com/questions/4715890/what-mutation-testing-frameworks-exist-for-c-c but they either are not open source or do not mutate C++.
| 0 |
8,806,840 |
01/10/2012 16:36:11
| 1,114,734 |
12/24/2011 16:44:04
| 22 | 0 |
how to make our asp .net website work both in pc and mobile
|
I want to create a website in asp .net .
All I know is if a I create my website it will work in pc.
But i want to know will it work in mobiles.
If not what i should do .
Thanks In Advance.
|
c#
|
asp.net
| null | null | null |
01/11/2012 08:39:05
|
not a real question
|
how to make our asp .net website work both in pc and mobile
===
I want to create a website in asp .net .
All I know is if a I create my website it will work in pc.
But i want to know will it work in mobiles.
If not what i should do .
Thanks In Advance.
| 1 |
3,200,292 |
07/08/2010 02:21:43
| 139,985 |
07/17/2009 07:28:22
| 30,803 | 1,459 |
Password strength checking library
|
Can anyone recommend a Java library that contains methods that are suitable for performing server-side password strength checking in a webapp. Ideally the checker should be:
- configurable, allowing the deployer to supply different dictionaries, adjust weights of different criteria, and so on
- extensible allowing new criteria to be implemented if required
- implemented in pure Java
- not fundamentally intertwined with a tag libraries, UI components or "password management" functionality
- compatible with a GPL 3 project
- compatible with Spring wiring
- mavenized (ideally available through Maven Central)
|
java
|
passwords
| null | null | null | null |
open
|
Password strength checking library
===
Can anyone recommend a Java library that contains methods that are suitable for performing server-side password strength checking in a webapp. Ideally the checker should be:
- configurable, allowing the deployer to supply different dictionaries, adjust weights of different criteria, and so on
- extensible allowing new criteria to be implemented if required
- implemented in pure Java
- not fundamentally intertwined with a tag libraries, UI components or "password management" functionality
- compatible with a GPL 3 project
- compatible with Spring wiring
- mavenized (ideally available through Maven Central)
| 0 |
7,243,549 |
08/30/2011 13:03:33
| 919,743 |
08/30/2011 13:03:33
| 1 | 0 |
FFMPEG Convert from mov, mjpeg codec error
|
I've a problem when i try to convert a .mov to a .webm with ffmpeg... I've no problems from any others video format.
I've enable the Quicktime formats "--enable-zlib" and with the "ffmpeg -formats" command i get .mov files as encode or decode.
When i try to transform a video i get this :
# ffmpeg -i /var/www/static/uploads/usersVideos/cavity0.mov -vcodec mjpeg /var/www/static/uploads/usersVideos/cavity.webm
ffmpeg version N-32159-gc70e852, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 30 2011 14:16:07 with gcc 4.4.5
configuration: --enable-gpl --enable-libmp3lame --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx
libavutil 51. 14. 0 / 51. 14. 0
libavcodec 53. 12. 0 / 53. 12. 0
libavformat 53. 10. 0 / 53. 10. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x13b7320] stream 0, error opening alias: path='/matlab_sv13/work/cavity_flow/up500.jpg', dir='cavity_flow', filename='up500.jpg', volume='NONAME', nlvl_from=1, nlvl_to=1**
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x13b7320] Could not find codec parameters (Video: mjpeg (jpeg / 0x6765706A), 434x343, 4762 kb/s)
/var/www/static/uploads/usersVideos/cavity0.mov: could not find codec parameters
[1] 8265 exit 1 ffmpeg -i /var/www/static/uploads/usersVideos/cavity0.mov -vcodec mjpeg
Someone has an idea?
|
ffmpeg
|
zlib
|
mjpeg
|
mov
| null |
06/18/2012 12:17:44
|
off topic
|
FFMPEG Convert from mov, mjpeg codec error
===
I've a problem when i try to convert a .mov to a .webm with ffmpeg... I've no problems from any others video format.
I've enable the Quicktime formats "--enable-zlib" and with the "ffmpeg -formats" command i get .mov files as encode or decode.
When i try to transform a video i get this :
# ffmpeg -i /var/www/static/uploads/usersVideos/cavity0.mov -vcodec mjpeg /var/www/static/uploads/usersVideos/cavity.webm
ffmpeg version N-32159-gc70e852, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 30 2011 14:16:07 with gcc 4.4.5
configuration: --enable-gpl --enable-libmp3lame --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx
libavutil 51. 14. 0 / 51. 14. 0
libavcodec 53. 12. 0 / 53. 12. 0
libavformat 53. 10. 0 / 53. 10. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x13b7320] stream 0, error opening alias: path='/matlab_sv13/work/cavity_flow/up500.jpg', dir='cavity_flow', filename='up500.jpg', volume='NONAME', nlvl_from=1, nlvl_to=1**
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x13b7320] Could not find codec parameters (Video: mjpeg (jpeg / 0x6765706A), 434x343, 4762 kb/s)
/var/www/static/uploads/usersVideos/cavity0.mov: could not find codec parameters
[1] 8265 exit 1 ffmpeg -i /var/www/static/uploads/usersVideos/cavity0.mov -vcodec mjpeg
Someone has an idea?
| 2 |
10,964,396 |
06/09/2012 20:32:58
| 568,508 |
01/09/2011 02:46:19
| 1,545 | 76 |
Permutation when each row can have a differnet start and end?
|
Does anyone know how to write a permutation in Java when the start and end can very per digit?
Ex: The first digit can be 1 to 5, but the second can be 1 to 8 and the third 1 to 3?
|
java
| null | null | null | null |
06/10/2012 07:39:58
|
not a real question
|
Permutation when each row can have a differnet start and end?
===
Does anyone know how to write a permutation in Java when the start and end can very per digit?
Ex: The first digit can be 1 to 5, but the second can be 1 to 8 and the third 1 to 3?
| 1 |
10,678,195 |
05/20/2012 23:53:37
| 1,252,552 |
03/06/2012 15:17:13
| 121 | 14 |
Use JQuery to do server side validation then send user to another site
|
I want to 'postpone' (stop the default behavior of the form) sending the user to 'http://www.othersite.com' until server side validation is finished on check.php
Once complete, send the user on their way to 'http://www.othersite.com'. I can send to the validation page no problem, but I need to validate then send to another website. Say I have a form like this
$(document).ready(function(){
$('#sendbutton').click(function(){
$('#error').empty();
$('#send').ajaxForm(function (data, textStatus) {
$('#error').append(data);
});
});
});
<form id="send" name="send" method="post" action="http://www.othersite.com/index.htm">
<input type="text" id="fname" name="fname" />
<input type="text" id="lname" name="lname" />
<input type="text" id="address" name="address" />
<input type="text" id="city" name="city" />
<input type="text" id="state" name="state" />
<button id="sendbutton">Submit</button>
</form>
<div id="error"></div>
And server side validation occurs on check.php
check field inputs here on check.php
if not correct
echo error message
if successful echo "validation_ok"
If the returned data is 'validation_ok' then send the user to complete form submission on 'http://www.othersite.com'
|
javascript
|
jquery
|
html
| null | null | null |
open
|
Use JQuery to do server side validation then send user to another site
===
I want to 'postpone' (stop the default behavior of the form) sending the user to 'http://www.othersite.com' until server side validation is finished on check.php
Once complete, send the user on their way to 'http://www.othersite.com'. I can send to the validation page no problem, but I need to validate then send to another website. Say I have a form like this
$(document).ready(function(){
$('#sendbutton').click(function(){
$('#error').empty();
$('#send').ajaxForm(function (data, textStatus) {
$('#error').append(data);
});
});
});
<form id="send" name="send" method="post" action="http://www.othersite.com/index.htm">
<input type="text" id="fname" name="fname" />
<input type="text" id="lname" name="lname" />
<input type="text" id="address" name="address" />
<input type="text" id="city" name="city" />
<input type="text" id="state" name="state" />
<button id="sendbutton">Submit</button>
</form>
<div id="error"></div>
And server side validation occurs on check.php
check field inputs here on check.php
if not correct
echo error message
if successful echo "validation_ok"
If the returned data is 'validation_ok' then send the user to complete form submission on 'http://www.othersite.com'
| 0 |
8,477,270 |
12/12/2011 16:14:30
| 513,225 |
11/19/2010 08:23:09
| 11 | 1 |
Percona MYSQL / Ruby mysql2 gem - Data loss on insert
|
I'm not sure which is causing the problem: whether it is mysql itself or the ruby mysql2 gem, but I am experiencing some data loss in my queries.
I am using mysql2's multi_statement support, so I have a series of INSERT statements separated by a semi-colon like so:
INSERT INTO some_table (col) VALUES (val); INSERT INTO some_table (col) VALUES (val2)
The problem with this is that if I have more than three statements, the **3rd** statement gets lost. It doesn't return errors or anything, it just skips the insertion process, so, for example, I have 10 INSERT statements, only 9 are inserted.
Does anyone know how this is? Or have you experienced a similar situation?
|
mysql
|
ruby-on-rails
|
ruby
|
mysql2
| null | null |
open
|
Percona MYSQL / Ruby mysql2 gem - Data loss on insert
===
I'm not sure which is causing the problem: whether it is mysql itself or the ruby mysql2 gem, but I am experiencing some data loss in my queries.
I am using mysql2's multi_statement support, so I have a series of INSERT statements separated by a semi-colon like so:
INSERT INTO some_table (col) VALUES (val); INSERT INTO some_table (col) VALUES (val2)
The problem with this is that if I have more than three statements, the **3rd** statement gets lost. It doesn't return errors or anything, it just skips the insertion process, so, for example, I have 10 INSERT statements, only 9 are inserted.
Does anyone know how this is? Or have you experienced a similar situation?
| 0 |
81,557 |
09/17/2008 09:49:20
| 4,101 |
09/01/2008 19:04:06
| 8 | 1 |
Prevent implicit import of units in Delphi packages
|
Is there a way to prevent packages in Delphi to implicitly import units that are not listed in the "Contains" list? I'm looking for a compiler directive that makes the build to fail if it tries to do an implicit import.
Problems occur when you install a package into the IDE that implicitly imports unit A and then you try to install another package that really contains unit A and the IDE tells you that it cannot install that package because unit A is already contained in the first package even if it shouldn't be!
|
delphi
|
compiler
|
packages
| null | null | null |
open
|
Prevent implicit import of units in Delphi packages
===
Is there a way to prevent packages in Delphi to implicitly import units that are not listed in the "Contains" list? I'm looking for a compiler directive that makes the build to fail if it tries to do an implicit import.
Problems occur when you install a package into the IDE that implicitly imports unit A and then you try to install another package that really contains unit A and the IDE tells you that it cannot install that package because unit A is already contained in the first package even if it shouldn't be!
| 0 |
6,228,764 |
06/03/2011 14:58:47
| 248,827 |
01/12/2010 11:24:07
| 4,177 | 81 |
Second level cache with NHibernate filters?
|
I am configuring 2nd level cache with NHibernate 3.0. 2nd level cache works great for Entities and Collections but I also have some Entities which have filtered collections.
<bag name="EntityTrans" cascade="all-delete-orphan" table="EntityTrans">
<key column="entityId" not-null="true" />
<one-to-many class="MyDomain.EntityTran, MyDomain" />
<filter name="cultureFilter" condition=":cultureCode = CultureCode" />
</bag>
NHibernate 2nd level caching does not cache the above collection. My NHibernate config file has the following entries.
<class-cache class="MyDomain.EntityTran, MuDomain" region="MyRegion" usage="read-only"/>
<collection-cache collection="MyDomain.Entity.EntityTrans" region="MyRegion" usage="read-only"/>
Do I need to add something more to cache the filtered collection?
|
asp.net
|
nhibernate
|
second-level-cache
| null | null | null |
open
|
Second level cache with NHibernate filters?
===
I am configuring 2nd level cache with NHibernate 3.0. 2nd level cache works great for Entities and Collections but I also have some Entities which have filtered collections.
<bag name="EntityTrans" cascade="all-delete-orphan" table="EntityTrans">
<key column="entityId" not-null="true" />
<one-to-many class="MyDomain.EntityTran, MyDomain" />
<filter name="cultureFilter" condition=":cultureCode = CultureCode" />
</bag>
NHibernate 2nd level caching does not cache the above collection. My NHibernate config file has the following entries.
<class-cache class="MyDomain.EntityTran, MuDomain" region="MyRegion" usage="read-only"/>
<collection-cache collection="MyDomain.Entity.EntityTrans" region="MyRegion" usage="read-only"/>
Do I need to add something more to cache the filtered collection?
| 0 |
5,568,848 |
04/06/2011 15:23:06
| 663,749 |
03/03/2011 05:56:37
| 3 | 0 |
Check mysql database state periodically from java
|
I am new to this MySQL concepts.i want to check the MySQL database periodically whether its working properly or not from java.Is there any simple way to check this.
Thanks In Advance.
|
mysql
|
check
| null | null | null | null |
open
|
Check mysql database state periodically from java
===
I am new to this MySQL concepts.i want to check the MySQL database periodically whether its working properly or not from java.Is there any simple way to check this.
Thanks In Advance.
| 0 |
9,270,225 |
02/14/2012 00:43:48
| 482,358 |
10/20/2010 22:57:54
| 56 | 3 |
Getting started with GDI+ and creating a 2d drawing program
|
I have never done anything with a windows c++ GUI and I need to make basically a 2d drawing application using GDI+ where there is a grid to draw shapes on. I cant find any information on getting started on doing this. What are some good resources to look at to learn how to do this?
The goal is to have a program where the user can click a button to pick a tool then draw with that tool on the grid.
|
c++
|
windows
|
gui
|
graphics
| null |
02/14/2012 05:43:11
|
not constructive
|
Getting started with GDI+ and creating a 2d drawing program
===
I have never done anything with a windows c++ GUI and I need to make basically a 2d drawing application using GDI+ where there is a grid to draw shapes on. I cant find any information on getting started on doing this. What are some good resources to look at to learn how to do this?
The goal is to have a program where the user can click a button to pick a tool then draw with that tool on the grid.
| 4 |
5,513,755 |
04/01/2011 13:02:38
| 583,523 |
01/19/2011 12:21:28
| 16 | 2 |
Double self-referencing property with Entity Framework
|
This code represents in small scale my problem:
public class Person
{
public int ID { get; set; }
public string Name { get; set; }
public virtual Person Parent { get; set; }
public virtual ICollection<Person> Friends { get; set; }
}
When I use this class in an Entity Framework (4.1) scenario, the system generates one only relation, thinking that Parent and Friends are the two faces of the same relation.
How can I tell to semantically separate the properties, and generate two different relations in SQL Server (since we can see that Friends are totally different from Parents :-)).
I tried with the fluent interfaces, but I think I don't know the right calls to do.
Thanks to all.
Andrea Bioli
|
c#
|
entity-framework
|
entity-framework-4
|
code-first
|
entity-framework-4.1
| null |
open
|
Double self-referencing property with Entity Framework
===
This code represents in small scale my problem:
public class Person
{
public int ID { get; set; }
public string Name { get; set; }
public virtual Person Parent { get; set; }
public virtual ICollection<Person> Friends { get; set; }
}
When I use this class in an Entity Framework (4.1) scenario, the system generates one only relation, thinking that Parent and Friends are the two faces of the same relation.
How can I tell to semantically separate the properties, and generate two different relations in SQL Server (since we can see that Friends are totally different from Parents :-)).
I tried with the fluent interfaces, but I think I don't know the right calls to do.
Thanks to all.
Andrea Bioli
| 0 |
8,038,313 |
11/07/2011 15:04:35
| 1,024,500 |
11/01/2011 20:57:22
| 1 | 0 |
Toolbar not showing in UIView
|
I am having different views in one Xib file and am moving from one to the next and back. All views have a button that should reveal the same toolbar which I added in IB in its own view. Only when the toolbar gets called it is always behind the view. How do I get it to show on top of the view?
|
iphone
| null | null | null | null | null |
open
|
Toolbar not showing in UIView
===
I am having different views in one Xib file and am moving from one to the next and back. All views have a button that should reveal the same toolbar which I added in IB in its own view. Only when the toolbar gets called it is always behind the view. How do I get it to show on top of the view?
| 0 |
8,055,145 |
11/08/2011 18:13:37
| 630,908 |
02/23/2011 19:09:04
| 530 | 3 |
Tow bytes of unicode letters is a myth?
|
I have read an article talks about text encoding. It refers that saying that a unicode letter is two bytes is a myth.
It explains that but my english is not good enugh to understand the reasons.
Kindly, any one here can explain that fact if it is true and the reasons? Pleas ,keep simple english as possible as you can.
|
unicode
|
encoding
| null | null | null | null |
open
|
Tow bytes of unicode letters is a myth?
===
I have read an article talks about text encoding. It refers that saying that a unicode letter is two bytes is a myth.
It explains that but my english is not good enugh to understand the reasons.
Kindly, any one here can explain that fact if it is true and the reasons? Pleas ,keep simple english as possible as you can.
| 0 |
11,592,470 |
07/21/2012 13:11:11
| 1,199,861 |
02/09/2012 14:32:36
| 25 | 0 |
Generalized least square model giving auto correlated residuals
|
I work for a financial institution, we often times run into analysis of time series data. A lot of times we end up doing regression using time series variables. As this happens, we often encounter residuals with time series structure that violates basic assumption of independent errors in OLS regression. We are building another model in which I believe we have regression with auto correlated errors. The residuals from linear model (lm(object)) clearly has a AR(1) structure, as evident from ACF and PACF. I fit the model using Generalized least square model using gls() in R. My expectation was that the residuals from gls(object) is white noise,but residuals from gls(object) still have the same ARIMA structure as in the ordinary regression. Unfortunately there is something wrong in what I am doing which I could not figure out. Hence I decided to manually adjust the regression coefficients from the linear model (OLS estimates). Surprisingly that seems to be working when I plotted the residuals from adjusted regression (residuals are white noise). I really want to use gls() in ‘nlme’ package so that coding will be lot simpler and easier.
lm.bk_ai <- lm( PRNP_BK_actINV~ PRM_BK_INV_ENDING + NPRM_BK_INV_ENDING + PRM_BK_INV_OUTFLOW + NPRM_BK_INV_OUTFLOW +
PRM_BK_INV_OUTFLOW + NPRM_BK_INV_OUTFLOW,
na.action =na.exclude, data = fit.cap01A)
summary(lm.bk_ai)
a <- stepAIC(lm.bk_ai, direction="backward") #-- selecting the best model based on least AIC value
a.upd <- update.formula(lm.bk_ai$call, a$call)
lm.bk_ai <- lm(as.formula(a.upd), data=fit.cap01A, na.action=na.exclude)
summary(lm.bk_ai)
lm.bk_ai <- update(lm.bk_ai, . ~ . -NPRM_BK_INV_OUTFLOW, data=fit.cap01A, na.action=na.exclude) ## the non-significant variable was droped
summary(lm.bk_ai)
acf2(residuals(lm.bk_ai)) ## acf2() function from Stoffer and Shumway is used here,....AR(1) will be the plausible model for residuals
arma.bk_ai <- sarima(residuals(lm.bk_ai), 1,0,0 ) ## sarima() function from Stoffer and Shumway is used here...arima() from stat package can also be used
phi <- coefficients(arma.bk_ai$fit)[1]
gls.bk_ai <- gls(PRNP_BK_actINV ~ PRM_BK_INV_ENDING + NPRM_BK_INV_ENDING, correlation=corARMA(p=1), method='ML', data = fit.cap01A) # -Fitting Generalized least square
summary(gls.bk_ai)
gls2.bk_ai <- update(gls.bk_ai, correlation = corARMA(p=2)) ## testing different (gls) model
gls3.bk_ai <- update(gls.bk_ai, correlation = corARMA(p=3))
gls0.bk_ai <- update(gls.bk_ai, correlation = NULL)
anova(gls.bk_ai, gls2.bk_ai, gls3.bk_ai, gls0.bk_ai) ## looking at the AIC value, gls model with AR(1) will be the best bet
acf2(residuals(gls.bk_ai)) # residuals are not white noise-------- There is something wrong in what I am doing???????
|
r
| null | null | null | null |
07/28/2012 13:49:30
|
off topic
|
Generalized least square model giving auto correlated residuals
===
I work for a financial institution, we often times run into analysis of time series data. A lot of times we end up doing regression using time series variables. As this happens, we often encounter residuals with time series structure that violates basic assumption of independent errors in OLS regression. We are building another model in which I believe we have regression with auto correlated errors. The residuals from linear model (lm(object)) clearly has a AR(1) structure, as evident from ACF and PACF. I fit the model using Generalized least square model using gls() in R. My expectation was that the residuals from gls(object) is white noise,but residuals from gls(object) still have the same ARIMA structure as in the ordinary regression. Unfortunately there is something wrong in what I am doing which I could not figure out. Hence I decided to manually adjust the regression coefficients from the linear model (OLS estimates). Surprisingly that seems to be working when I plotted the residuals from adjusted regression (residuals are white noise). I really want to use gls() in ‘nlme’ package so that coding will be lot simpler and easier.
lm.bk_ai <- lm( PRNP_BK_actINV~ PRM_BK_INV_ENDING + NPRM_BK_INV_ENDING + PRM_BK_INV_OUTFLOW + NPRM_BK_INV_OUTFLOW +
PRM_BK_INV_OUTFLOW + NPRM_BK_INV_OUTFLOW,
na.action =na.exclude, data = fit.cap01A)
summary(lm.bk_ai)
a <- stepAIC(lm.bk_ai, direction="backward") #-- selecting the best model based on least AIC value
a.upd <- update.formula(lm.bk_ai$call, a$call)
lm.bk_ai <- lm(as.formula(a.upd), data=fit.cap01A, na.action=na.exclude)
summary(lm.bk_ai)
lm.bk_ai <- update(lm.bk_ai, . ~ . -NPRM_BK_INV_OUTFLOW, data=fit.cap01A, na.action=na.exclude) ## the non-significant variable was droped
summary(lm.bk_ai)
acf2(residuals(lm.bk_ai)) ## acf2() function from Stoffer and Shumway is used here,....AR(1) will be the plausible model for residuals
arma.bk_ai <- sarima(residuals(lm.bk_ai), 1,0,0 ) ## sarima() function from Stoffer and Shumway is used here...arima() from stat package can also be used
phi <- coefficients(arma.bk_ai$fit)[1]
gls.bk_ai <- gls(PRNP_BK_actINV ~ PRM_BK_INV_ENDING + NPRM_BK_INV_ENDING, correlation=corARMA(p=1), method='ML', data = fit.cap01A) # -Fitting Generalized least square
summary(gls.bk_ai)
gls2.bk_ai <- update(gls.bk_ai, correlation = corARMA(p=2)) ## testing different (gls) model
gls3.bk_ai <- update(gls.bk_ai, correlation = corARMA(p=3))
gls0.bk_ai <- update(gls.bk_ai, correlation = NULL)
anova(gls.bk_ai, gls2.bk_ai, gls3.bk_ai, gls0.bk_ai) ## looking at the AIC value, gls model with AR(1) will be the best bet
acf2(residuals(gls.bk_ai)) # residuals are not white noise-------- There is something wrong in what I am doing???????
| 2 |
2,216,284 |
02/07/2010 07:27:38
| 268,055 |
02/07/2010 07:27:38
| 1 | 0 |
JavaScript code to handle comment folding (similar to Reddit's?
|
I really like the way Reddit's comment system works - particulary the ability to smoothly fold/unfold a tree of comments.
Is there some standard JavaScript code/library that does this? Or did Reddit develop this inhouse and is not portable?
I'm fairly a beginner in JS, so browsing through Reddit's page source is not that helpful.
|
reddit
|
threaded-comments
|
javascript
| null | null | null |
open
|
JavaScript code to handle comment folding (similar to Reddit's?
===
I really like the way Reddit's comment system works - particulary the ability to smoothly fold/unfold a tree of comments.
Is there some standard JavaScript code/library that does this? Or did Reddit develop this inhouse and is not portable?
I'm fairly a beginner in JS, so browsing through Reddit's page source is not that helpful.
| 0 |
4,967,744 |
02/11/2011 10:06:25
| 227,865 |
12/09/2009 10:21:52
| 677 | 27 |
Does a SQL UNION with a LIMIT optimize away uneeded queries?
|
Say I have a sequence of queries that progressively get more expensive. I can join all these with a union but I'm only interested in the top 10 results so I add a LIMIT. The query looks something like this:
(SELECT col1, col2 FROM table WHERE colx = 'x')
UNION
(SELECT col1, col2 FROM table WHERE colx LIKE '%x%')
UNION
(SELECT col1, col2 FROM table WHERE colx LIKE '%x%' AND unindexedcol LIKE '%y%')
LIMIT 10
I know that this is not guaranteed to be the top 10 from the first query as the MySQL documentation states
> UNION by default produces an unordered
> set of rows
but in practice it appears that the results are ordered select 1 followed by select 2 etc until the limit is reached.
So does MySQL execute the queries sequentially and stop when it hits the limit? If not then what is a better way to execute this style of query where only a subset of results are needed and prioritisation of less expensive queries is preferred to minimize execution time?
|
sql
|
mysql
|
query-optimization
|
union
| null | null |
open
|
Does a SQL UNION with a LIMIT optimize away uneeded queries?
===
Say I have a sequence of queries that progressively get more expensive. I can join all these with a union but I'm only interested in the top 10 results so I add a LIMIT. The query looks something like this:
(SELECT col1, col2 FROM table WHERE colx = 'x')
UNION
(SELECT col1, col2 FROM table WHERE colx LIKE '%x%')
UNION
(SELECT col1, col2 FROM table WHERE colx LIKE '%x%' AND unindexedcol LIKE '%y%')
LIMIT 10
I know that this is not guaranteed to be the top 10 from the first query as the MySQL documentation states
> UNION by default produces an unordered
> set of rows
but in practice it appears that the results are ordered select 1 followed by select 2 etc until the limit is reached.
So does MySQL execute the queries sequentially and stop when it hits the limit? If not then what is a better way to execute this style of query where only a subset of results are needed and prioritisation of less expensive queries is preferred to minimize execution time?
| 0 |
6,488,228 |
06/27/2011 03:05:51
| 499,282 |
11/06/2010 15:23:00
| 458 | 1 |
how to use javascript replace all of it?
|
the style is `@XXX`
now i want to replace all of it to `<a href='XXX'>@XXX</a>`.
how should i do? thank you.
|
javascript
| null | null | null | null |
06/28/2011 03:44:38
|
not a real question
|
how to use javascript replace all of it?
===
the style is `@XXX`
now i want to replace all of it to `<a href='XXX'>@XXX</a>`.
how should i do? thank you.
| 1 |
2,298,617 |
02/19/2010 18:21:33
| 253,288 |
01/18/2010 15:21:30
| 88 | 6 |
syntax highlight with objective-c
|
i'm looking for a objective-c class that supports syntax hightlighting a string.
is there something like that existing?
this should work on iphone!
|
iphone
|
objective-c
|
syntax-highlighting
| null | null | null |
open
|
syntax highlight with objective-c
===
i'm looking for a objective-c class that supports syntax hightlighting a string.
is there something like that existing?
this should work on iphone!
| 0 |
9,565,863 |
03/05/2012 11:28:53
| 179,056 |
09/25/2009 13:05:44
| 86 | 5 |
Error logging into SQL Azure using manage link on Azure portal
|
I have logged into Azure and navigated to Database link. I created a new database using "create' on the azure portal. Now i try to test connectivity. It fails. So i try to debug by clicking on "manage". Here i enter the database name user id and password. It fails, stating "Login is disabled or credentials are invalid"
I am using windows azure in conjunction with Visual Studio express (trial edition). I have tried with checking the "allow other windows azure services.." box and also by providing the IP designated to the db server in firewall rules. In both cases i get the same error.
This effort is part of deploying the sample VS 2010 windows azure web application on azure. It works fine on the emulator, but fails when actually deployed, at the time for registering a user. I have changed the default connection string to point to SQL azure as described @ http://msdn.microsoft.com/library/hh369932.aspx#SQLAzure.
Any pointers would be appreciated
regards
Sameer
|
azure
|
sql-azure
| null | null | null | null |
open
|
Error logging into SQL Azure using manage link on Azure portal
===
I have logged into Azure and navigated to Database link. I created a new database using "create' on the azure portal. Now i try to test connectivity. It fails. So i try to debug by clicking on "manage". Here i enter the database name user id and password. It fails, stating "Login is disabled or credentials are invalid"
I am using windows azure in conjunction with Visual Studio express (trial edition). I have tried with checking the "allow other windows azure services.." box and also by providing the IP designated to the db server in firewall rules. In both cases i get the same error.
This effort is part of deploying the sample VS 2010 windows azure web application on azure. It works fine on the emulator, but fails when actually deployed, at the time for registering a user. I have changed the default connection string to point to SQL azure as described @ http://msdn.microsoft.com/library/hh369932.aspx#SQLAzure.
Any pointers would be appreciated
regards
Sameer
| 0 |
4,002,001 |
10/23/2010 01:26:19
| 82,865 |
03/25/2009 23:10:38
| 8,928 | 346 |
Java Concurrency Exercises
|
Does anybody have suggestions for good resources and exercises on Java concurrency, particularly the new Java 5 constructs? They should have model answers ideally.
|
java
|
concurrency
|
homework
| null | null |
12/10/2011 06:08:05
|
not constructive
|
Java Concurrency Exercises
===
Does anybody have suggestions for good resources and exercises on Java concurrency, particularly the new Java 5 constructs? They should have model answers ideally.
| 4 |
8,217,215 |
11/21/2011 19:14:24
| 221,509 |
11/30/2009 17:44:48
| 2,697 | 71 |
Android parse time in default timezone
|
I want to parse a time value formatted as `"12:34:56"`, which comes from an external web service, to a `Date`, `Calendar` or anything that I can later compare to current time.
The problem is that on Android, `DateFormat.parse` seems to ignore the user's default timezone and parse the value as if it was in UTC. Given this code:
DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
String inTime = "12:34:56";
Date time = timeFormat.parse(inTime);
I get the wanted result on my desktop (Java 1.6.0_29):
Thu Jan 01 12:34:56 CET 1970
However, on Android this is one hour off:
Thu Jan 01 11:34:56 GMT+0100 1970
I even tried setting the timezone using `timeFormat.setTimeZone(TimeZone.getDefault())`, but this does not help. Is there any way to get `DateFormat.parse` to work correctly, or do I have to convert everything to UTC and back to get it working on Android?
|
android
|
timezone
| null | null | null | null |
open
|
Android parse time in default timezone
===
I want to parse a time value formatted as `"12:34:56"`, which comes from an external web service, to a `Date`, `Calendar` or anything that I can later compare to current time.
The problem is that on Android, `DateFormat.parse` seems to ignore the user's default timezone and parse the value as if it was in UTC. Given this code:
DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
String inTime = "12:34:56";
Date time = timeFormat.parse(inTime);
I get the wanted result on my desktop (Java 1.6.0_29):
Thu Jan 01 12:34:56 CET 1970
However, on Android this is one hour off:
Thu Jan 01 11:34:56 GMT+0100 1970
I even tried setting the timezone using `timeFormat.setTimeZone(TimeZone.getDefault())`, but this does not help. Is there any way to get `DateFormat.parse` to work correctly, or do I have to convert everything to UTC and back to get it working on Android?
| 0 |
11,504,955 |
07/16/2012 13:04:37
| 1,528,376 |
07/16/2012 09:06:55
| 1 | 0 |
php returns a whole html file instead of a string (ajax)
|
**Hey guys, i'm working on a website which uses AJAX and I've run into a dead end. My javascript has a funtion named validate which takes from the "name" and "password" fields and sends it over to php, waiting for a response**
function Validate() {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
if (xmlhttp.responseText.value == 'Invalid'){
$("#box").effect('shake',150);
document.getElementById("validationText").innerHTML = xmlhttp.responseText;
}
else if (xmlhttp.reponseText.value == 'Success!'){
console.log(xmlhttp.responseText.value)
document.getElementById("validationText").innerHTML = xmlhttp.responseText;
}
}
}
var name = document.getElementById("name").value;
var password = document.getElementById("password").value;
var arg = "JqueryPhp.php?name=" + name + "&password=" + password;
xmlhttp.open("GET", arg, true);
xmlhttp.send();
}
**The php file should return either "Success!" or "Invalid" depending on the situation.**
<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("collegedatabase", $con);
$getUserName = $_GET["name"];
$getPassword = $_GET["password"];
$result = mysql_query("SELECT * FROM `admin`");
$Success = false;
/* if the user entered does not exist, run the function which shakes the screen and add a bit of text to say that the username is invalid */
while ($row = mysql_fetch_array($result)){
if ($row['userName'] == $getUserName && $row['password'] == $getPassword){
echo "Success!";
$Success = true;
break;
}
}
if($Success === false) {
echo ('Invalid');
}
?>
**Instead, it returns a whole html file, with the string inside of a body tag. the response which I recorded from firebug is as follows;**
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
Invalid</body>
</html>
|
php
|
javascript
|
html
|
ajax
| null |
07/16/2012 13:39:47
|
too localized
|
php returns a whole html file instead of a string (ajax)
===
**Hey guys, i'm working on a website which uses AJAX and I've run into a dead end. My javascript has a funtion named validate which takes from the "name" and "password" fields and sends it over to php, waiting for a response**
function Validate() {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
if (xmlhttp.responseText.value == 'Invalid'){
$("#box").effect('shake',150);
document.getElementById("validationText").innerHTML = xmlhttp.responseText;
}
else if (xmlhttp.reponseText.value == 'Success!'){
console.log(xmlhttp.responseText.value)
document.getElementById("validationText").innerHTML = xmlhttp.responseText;
}
}
}
var name = document.getElementById("name").value;
var password = document.getElementById("password").value;
var arg = "JqueryPhp.php?name=" + name + "&password=" + password;
xmlhttp.open("GET", arg, true);
xmlhttp.send();
}
**The php file should return either "Success!" or "Invalid" depending on the situation.**
<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("collegedatabase", $con);
$getUserName = $_GET["name"];
$getPassword = $_GET["password"];
$result = mysql_query("SELECT * FROM `admin`");
$Success = false;
/* if the user entered does not exist, run the function which shakes the screen and add a bit of text to say that the username is invalid */
while ($row = mysql_fetch_array($result)){
if ($row['userName'] == $getUserName && $row['password'] == $getPassword){
echo "Success!";
$Success = true;
break;
}
}
if($Success === false) {
echo ('Invalid');
}
?>
**Instead, it returns a whole html file, with the string inside of a body tag. the response which I recorded from firebug is as follows;**
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
Invalid</body>
</html>
| 3 |
413,050 |
01/05/2009 13:13:37
| 34,022 |
11/04/2008 09:56:48
| 54 | 0 |
C#: How to remove namespace information from XML elements
|
How can I remove the "xmlns:..." namespace information from each XML element in C#?
|
xml
|
namespaces
|
c#
|
.net
| null | null |
open
|
C#: How to remove namespace information from XML elements
===
How can I remove the "xmlns:..." namespace information from each XML element in C#?
| 0 |
9,905,605 |
03/28/2012 10:27:32
| 1,297,857 |
03/28/2012 10:14:28
| 1 | 0 |
AVAssetWriter can't create m4a file on iPhone 3G
|
I'm trying to use AVAssetWriter to create an m4a file. It works perfectly on any devices exclude iPhone 3G. Some says, that problem is in 3G does not support AAC encoding. Is it true? if ([assetWriter canAddInput:assetWriterInput]) returns NO.
AVAssetWriter *assetWriter = [AVAssetWriter assetWriterWithURL:exportURL
fileType:AVFileTypeAppleM4A
error:&assetError];
if (assetError) {
NSLog (@"error: %@", assetError);
return;
}
AudioChannelLayout channelLayout;
memset(&channelLayout, 0, sizeof(AudioChannelLayout));
channelLayout.mChannelBitmap = 0;
channelLayout.mNumberChannelDescriptions = 0;
channelLayout.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo;
NSDictionary *outputSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[ NSNumber numberWithInt: kAudioFormatMPEG4AAC], AVFormatIDKey,
[ NSNumber numberWithInt: 2], AVNumberOfChannelsKey,
[ NSNumber numberWithFloat: 44100.0], AVSampleRateKey,
[ NSData dataWithBytes: &channelLayout length:sizeof( AudioChannelLayout ) ], AVChannelLayoutKey,
[ NSNumber numberWithInt: 192000], AVEncoderBitRateKey,nil];
AVAssetWriterInput *assetWriterInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeAudio
outputSettings:outputSettings];
if ([assetWriter canAddInput:assetWriterInput]) {
[assetWriter addInput:assetWriterInput];
}
Anybody knows, how to create m4a file on a iPhone 3G?
Thanks
|
ios
|
aac
|
avassetwriter
| null | null | null |
open
|
AVAssetWriter can't create m4a file on iPhone 3G
===
I'm trying to use AVAssetWriter to create an m4a file. It works perfectly on any devices exclude iPhone 3G. Some says, that problem is in 3G does not support AAC encoding. Is it true? if ([assetWriter canAddInput:assetWriterInput]) returns NO.
AVAssetWriter *assetWriter = [AVAssetWriter assetWriterWithURL:exportURL
fileType:AVFileTypeAppleM4A
error:&assetError];
if (assetError) {
NSLog (@"error: %@", assetError);
return;
}
AudioChannelLayout channelLayout;
memset(&channelLayout, 0, sizeof(AudioChannelLayout));
channelLayout.mChannelBitmap = 0;
channelLayout.mNumberChannelDescriptions = 0;
channelLayout.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo;
NSDictionary *outputSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[ NSNumber numberWithInt: kAudioFormatMPEG4AAC], AVFormatIDKey,
[ NSNumber numberWithInt: 2], AVNumberOfChannelsKey,
[ NSNumber numberWithFloat: 44100.0], AVSampleRateKey,
[ NSData dataWithBytes: &channelLayout length:sizeof( AudioChannelLayout ) ], AVChannelLayoutKey,
[ NSNumber numberWithInt: 192000], AVEncoderBitRateKey,nil];
AVAssetWriterInput *assetWriterInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeAudio
outputSettings:outputSettings];
if ([assetWriter canAddInput:assetWriterInput]) {
[assetWriter addInput:assetWriterInput];
}
Anybody knows, how to create m4a file on a iPhone 3G?
Thanks
| 0 |
5,523,519 |
04/02/2011 13:47:19
| 679,755 |
03/28/2011 06:35:55
| 1 | 0 |
how to remove the ssl error from modernbill api installation
|
i want to installed the modernbill on my localhost,
i got this error on the installation phase,
* You MUST have (SSL-enabled PHP cURL for faster secure remote API queries [you do not], or SSL-enabled CLI cURL for secure remote API queries [you do not]) [you do not].
* You SHOULD have SSL-enabled PHP cURL for faster secure remote API queries [you do not].
* You SHOULD have the "openssl" extension loaded for asynchronous secure remote API queries [you do not].
* You MAY have the "sysvshm" extension loaded for Unix performance optimizations [you do not].
* You MAY have the "sysvsem" extension loaded for Unix performance optimizations [you do not].
i enable the ssl and cURL module from ,y wamp server,
and also remove the ; from extention=php.curl file
but i got the abou=ve error,
i search for it the whole day but unable to solve the sain problem
please help me
|
php
| null | null | null | null | null |
open
|
how to remove the ssl error from modernbill api installation
===
i want to installed the modernbill on my localhost,
i got this error on the installation phase,
* You MUST have (SSL-enabled PHP cURL for faster secure remote API queries [you do not], or SSL-enabled CLI cURL for secure remote API queries [you do not]) [you do not].
* You SHOULD have SSL-enabled PHP cURL for faster secure remote API queries [you do not].
* You SHOULD have the "openssl" extension loaded for asynchronous secure remote API queries [you do not].
* You MAY have the "sysvshm" extension loaded for Unix performance optimizations [you do not].
* You MAY have the "sysvsem" extension loaded for Unix performance optimizations [you do not].
i enable the ssl and cURL module from ,y wamp server,
and also remove the ; from extention=php.curl file
but i got the abou=ve error,
i search for it the whole day but unable to solve the sain problem
please help me
| 0 |
1,638,312 |
10/28/2009 16:15:36
| 198,250 |
10/28/2009 16:15:35
| 1 | 0 |
Writing Standard Input and waiting for Standar Output
|
I'm trying to create a Thread that keeps netsh windows command-line tool open so I can execute netsh commands without open it every single time.
The thing is, once I've created the Thread, just the first command call works... the subsequent calls seems to have no effect.
Here is my code:
public class NetshThread implements Runnable{
private static Process netshProcess = null;
private static BufferedInputStream netshInStream = null;
private static BufferedOutputStream netshOutStream = null;
public BufferedReader inPipe = null;
public void run(){
startNetsh();
}
public void startNetsh(){
try {
netshProcess = Runtime.getRuntime().exec("netsh");
netshInStream = new BufferedInputStream(netshProcess.getInputStream());
netshOutStream = new BufferedOutputStream(netshProcess.getOutputStream());
inPipe = new BufferedReader(new InputStreamReader(netshInStream));
} catch (IOException e) {
e.printStackTrace();
}
}
public void executeCommand(String command){
System.out.println("Executing: " + command);
try {
String str = "";
netshOutStream.write(command.getBytes());
netshOutStream.close();
while ((str = inPipe.readLine()) != null) {
System.out.println(str);
}
} catch (IOException e) {
e.printStackTrace();
}
}
public void closeNetsh(){
executeCommand("exit");
}
public static void main(String[] args){
NetshThread nthread = new NetshThread();
nthread.run();
String command = "int ip set address " +
"\"Local Area Connection 6\" static .69.69.69 255.255.255.0";
nthread.executeCommand(command);
command = "int ip set address " +
"\"Local Area Connection 6\" static 69.69.69.69 255.255.255.0";
nthread.executeCommand(command);
System.out.println("*** DONE ***");
}
}
Thank you!!! =)
|
standards
|
input
|
output
|
process
| null | null |
open
|
Writing Standard Input and waiting for Standar Output
===
I'm trying to create a Thread that keeps netsh windows command-line tool open so I can execute netsh commands without open it every single time.
The thing is, once I've created the Thread, just the first command call works... the subsequent calls seems to have no effect.
Here is my code:
public class NetshThread implements Runnable{
private static Process netshProcess = null;
private static BufferedInputStream netshInStream = null;
private static BufferedOutputStream netshOutStream = null;
public BufferedReader inPipe = null;
public void run(){
startNetsh();
}
public void startNetsh(){
try {
netshProcess = Runtime.getRuntime().exec("netsh");
netshInStream = new BufferedInputStream(netshProcess.getInputStream());
netshOutStream = new BufferedOutputStream(netshProcess.getOutputStream());
inPipe = new BufferedReader(new InputStreamReader(netshInStream));
} catch (IOException e) {
e.printStackTrace();
}
}
public void executeCommand(String command){
System.out.println("Executing: " + command);
try {
String str = "";
netshOutStream.write(command.getBytes());
netshOutStream.close();
while ((str = inPipe.readLine()) != null) {
System.out.println(str);
}
} catch (IOException e) {
e.printStackTrace();
}
}
public void closeNetsh(){
executeCommand("exit");
}
public static void main(String[] args){
NetshThread nthread = new NetshThread();
nthread.run();
String command = "int ip set address " +
"\"Local Area Connection 6\" static .69.69.69 255.255.255.0";
nthread.executeCommand(command);
command = "int ip set address " +
"\"Local Area Connection 6\" static 69.69.69.69 255.255.255.0";
nthread.executeCommand(command);
System.out.println("*** DONE ***");
}
}
Thank you!!! =)
| 0 |
6,653,307 |
07/11/2011 16:27:24
| 154,502 |
08/11/2009 16:39:34
| 740 | 29 |
CKEditor charset
|
I updated my web app to use UTF-8 instead of ANSI.
I did the following measures to define charset:
mysql_set_charset("utf8"); // PHP
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> // HTML
utf8_general_ci // In MySQL
I also edited the CKEditor config to remove htmlentities because I need the correct character (i.e. `é` and not `é`) for MySQL fulltext search.
config.entities = false;
config.entities_latin = false;
In the database (phpMyAdmin view) and on normal text fields output (HTML, `<input>` or `<textarea>`), everything looks fine (I see `é`, not `é`, not `é`, yay).
However, CKEditor has some trouble with the encoding. See attached image for the same field taken from the database, displayed in a textarea, then in a textarea repalced by CKEditor:
![CKEditor Encoding Problems][1]
This seems to be in the CKEditor JavaScript code (probably a fixed charset), but I can't find it in the config. Again, since the `é` displays correctly in normal HTML (real UTF-8 `é`, not `é` nor `é`), I'm quite sure it's not the PHP/MySQL query that's wrong (but I might be mistaken).
[1]: http://i.stack.imgur.com/Senmu.png
|
php
|
mysql
|
html
|
encoding
|
ckeditor
| null |
open
|
CKEditor charset
===
I updated my web app to use UTF-8 instead of ANSI.
I did the following measures to define charset:
mysql_set_charset("utf8"); // PHP
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> // HTML
utf8_general_ci // In MySQL
I also edited the CKEditor config to remove htmlentities because I need the correct character (i.e. `é` and not `é`) for MySQL fulltext search.
config.entities = false;
config.entities_latin = false;
In the database (phpMyAdmin view) and on normal text fields output (HTML, `<input>` or `<textarea>`), everything looks fine (I see `é`, not `é`, not `é`, yay).
However, CKEditor has some trouble with the encoding. See attached image for the same field taken from the database, displayed in a textarea, then in a textarea repalced by CKEditor:
![CKEditor Encoding Problems][1]
This seems to be in the CKEditor JavaScript code (probably a fixed charset), but I can't find it in the config. Again, since the `é` displays correctly in normal HTML (real UTF-8 `é`, not `é` nor `é`), I'm quite sure it's not the PHP/MySQL query that's wrong (but I might be mistaken).
[1]: http://i.stack.imgur.com/Senmu.png
| 0 |
6,990,726 |
08/09/2011 02:14:13
| 803,969 |
06/17/2011 21:26:24
| 32 | 3 |
Correct way of declaring pointer variables in C/C++
|
I noticed some people use the following notation for declaring pointer variables.
(a) char* p;
instead of
(b) char *p;
I use the (b). What is the rational behind the notation (a)?
Notation (b) makes more sense to me because character pointer is not a type itself. Instead the type is character and the variable may be a pointer to the character.
char* c;
This looks like there is a type char* and the variable c is of that type. But in fact the type is char and *c (the memory location pointed by c) is of that type (char). If you declare multiple variables at once this distinction becomes obvious.
char* c, *d;
This looks weird. Both c and d are same kind of pointers that point to a character. In this since the next one looks more natural.
char *c, *d;
Thanks.
|
c++
|
c
|
pointers
| null | null |
08/09/2011 03:12:50
|
not constructive
|
Correct way of declaring pointer variables in C/C++
===
I noticed some people use the following notation for declaring pointer variables.
(a) char* p;
instead of
(b) char *p;
I use the (b). What is the rational behind the notation (a)?
Notation (b) makes more sense to me because character pointer is not a type itself. Instead the type is character and the variable may be a pointer to the character.
char* c;
This looks like there is a type char* and the variable c is of that type. But in fact the type is char and *c (the memory location pointed by c) is of that type (char). If you declare multiple variables at once this distinction becomes obvious.
char* c, *d;
This looks weird. Both c and d are same kind of pointers that point to a character. In this since the next one looks more natural.
char *c, *d;
Thanks.
| 4 |
8,157,813 |
11/16/2011 19:56:12
| 26,787 |
10/10/2008 11:36:59
| 2,535 | 111 |
Configuring HandlerInterceptors within a @Configuration context
|
I'm using @Configuration in Spring 3.0.6 to use dependency injection without using .xml definition files.
I use a mixed approach for defining Controllers, I put them in the DispatcherServlet's @Configuration, using @Bean("/sample/path") *and* use @RequestMapping in their methods to further refine the mapping (including using it to append to the bean's path).
This works fairly well with the default HandlerMapper configuration.
Now, I want to add some HandlerInterceptors to the mix. It seems that I need to duplicate the default HandlerMapper configuration and then add my HandlerInterceptor.
However, this does not seem a great idea. Is there any way to add my HandlerInterceptor to the default HandlerMapper config?
Cheers,
Alex
|
spring-mvc
| null | null | null | null | null |
open
|
Configuring HandlerInterceptors within a @Configuration context
===
I'm using @Configuration in Spring 3.0.6 to use dependency injection without using .xml definition files.
I use a mixed approach for defining Controllers, I put them in the DispatcherServlet's @Configuration, using @Bean("/sample/path") *and* use @RequestMapping in their methods to further refine the mapping (including using it to append to the bean's path).
This works fairly well with the default HandlerMapper configuration.
Now, I want to add some HandlerInterceptors to the mix. It seems that I need to duplicate the default HandlerMapper configuration and then add my HandlerInterceptor.
However, this does not seem a great idea. Is there any way to add my HandlerInterceptor to the default HandlerMapper config?
Cheers,
Alex
| 0 |
3,355,741 |
07/28/2010 17:42:30
| 252,593 |
01/17/2010 12:48:21
| 52 | 16 |
date_select tag doesn't get stored in my rails app
|
I'm trying to let the user select his birthday with:
<% form_for :user, :url => users_path do |f| %>
<%= f.date_select :birthday, :start_year => 2010 , :end_year =>1920, :discard_day => true %>
<% end %>
The problem is that it doesn't get saved... birthday is a date field in the users table and to save it I call
@user = User.new(params[:user])
@user.save
what could be the problem?
Thanks
Maechi
|
ruby-on-rails
| null | null | null | null | null |
open
|
date_select tag doesn't get stored in my rails app
===
I'm trying to let the user select his birthday with:
<% form_for :user, :url => users_path do |f| %>
<%= f.date_select :birthday, :start_year => 2010 , :end_year =>1920, :discard_day => true %>
<% end %>
The problem is that it doesn't get saved... birthday is a date field in the users table and to save it I call
@user = User.new(params[:user])
@user.save
what could be the problem?
Thanks
Maechi
| 0 |
11,680,983 |
07/27/2012 03:16:37
| 905,197 |
08/22/2011 03:19:15
| 19 | 0 |
Inserting an EMF into LaTeX
|
After years of playing around with different figure formats in R I have found the one to hold it's quality best is an EMF. I have just started using LaTeX and cannot get LaTeX to read my EMFs. I am using the graphicx package (which I have read supports EMF files) but its still not reading it.
\usepackage{graphicx}
\begin{figure}[h]
\centering
\includegraphics*[width=1\textwidth]{combined_DMC}
\caption{Frequency of fires for each month of the year}
\label{fig_fire_month}
\end{figure}
I am not sure if I am telling latex to use the graphicx package (as opposed to the standard graphics package) by using includegraphics*
Thanks
|
r
|
latex
|
.emf
| null | null |
07/27/2012 07:21:05
|
off topic
|
Inserting an EMF into LaTeX
===
After years of playing around with different figure formats in R I have found the one to hold it's quality best is an EMF. I have just started using LaTeX and cannot get LaTeX to read my EMFs. I am using the graphicx package (which I have read supports EMF files) but its still not reading it.
\usepackage{graphicx}
\begin{figure}[h]
\centering
\includegraphics*[width=1\textwidth]{combined_DMC}
\caption{Frequency of fires for each month of the year}
\label{fig_fire_month}
\end{figure}
I am not sure if I am telling latex to use the graphicx package (as opposed to the standard graphics package) by using includegraphics*
Thanks
| 2 |
11,482,000 |
07/14/2012 07:47:46
| 1,322,916 |
04/10/2012 00:01:30
| 7 | 1 |
i want to send an attachment in a form sql and php .. !
|
i want to send an attachment in a form so i used this code .. !
but one i check the database i find the fileld like this [BLOB - 0B] !
<form id="form1" name="form1" autocomplete="off" enctype="multipart/form-data"
method="post" novalidate action="triprequestexcuton.php">
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
then in triprequestexcuton.php
$form_data=$_POST['form_data'];
$attachment = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$qry="insert into triprequest values('','". $attachment."');";
$resultop=mysql_query($qry);
|
php
|
mysql
| null | null | null |
07/16/2012 02:05:08
|
not a real question
|
i want to send an attachment in a form sql and php .. !
===
i want to send an attachment in a form so i used this code .. !
but one i check the database i find the fileld like this [BLOB - 0B] !
<form id="form1" name="form1" autocomplete="off" enctype="multipart/form-data"
method="post" novalidate action="triprequestexcuton.php">
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
then in triprequestexcuton.php
$form_data=$_POST['form_data'];
$attachment = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$qry="insert into triprequest values('','". $attachment."');";
$resultop=mysql_query($qry);
| 1 |
11,627,876 |
07/24/2012 09:25:25
| 1,300,679 |
03/29/2012 11:52:48
| 1 | 0 |
Using Skype presence control over HTTPS
|
I would like to create a page, that displays the skype status of logined user like this:
http://www.skype.com/intl/en-us/tell-a-friend/get-a-skype-button/
It works fine on http, but i have to use https protocol.
MyStatus link is a http link that displays the status of user, but browsers doesn't display this correctly or display a notification because of http link.
Has anyone had experience with this?
Thank you in advance.
|
https
|
skype
| null | null | null | null |
open
|
Using Skype presence control over HTTPS
===
I would like to create a page, that displays the skype status of logined user like this:
http://www.skype.com/intl/en-us/tell-a-friend/get-a-skype-button/
It works fine on http, but i have to use https protocol.
MyStatus link is a http link that displays the status of user, but browsers doesn't display this correctly or display a notification because of http link.
Has anyone had experience with this?
Thank you in advance.
| 0 |
7,304,290 |
09/05/2011 05:53:21
| 735,687 |
05/03/2011 07:44:21
| 6 | 0 |
"System error 1231 has occurred." while trying to map another computer in my network
|
I have problem with network share in my Windows Server 2008 Machine.
Ping is OK, net use or net view is not. See under:
C:\Users\tsi>net view \\storage01
System error 1231 has occurred.
The network location cannot be reached. For information about network troubleshoting, see Windows Help.
C:\Users\tsi>ping storage01
Pinging storage01.powelasa.powel.com [2002:c1d7:4a5b::c1d7:4a5b] from 2002:c1d7
4a30::c1d7:4a30 with 32 bytes of data:
Reply from 2002:c1d7:4a5b::c1d7:4a5b: time<1ms
Reply from 2002:c1d7:4a5b::c1d7:4a5b: time<1ms
Reply from 2002:c1d7:4a5b::c1d7:4a5b: time<1ms
Reply from 2002:c1d7:4a5b::c1d7:4a5b: time<1ms
Ping statistics for 2002:c1d7:4a5b::c1d7:4a5b:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
'WebClient' in my machine is also started and its startup type is also set as Automatic.
Can anyone help me to solve this issue???
Thanks,
Velu
|
windows-server-2008
| null | null | null | null |
09/05/2011 10:17:57
|
off topic
|
"System error 1231 has occurred." while trying to map another computer in my network
===
I have problem with network share in my Windows Server 2008 Machine.
Ping is OK, net use or net view is not. See under:
C:\Users\tsi>net view \\storage01
System error 1231 has occurred.
The network location cannot be reached. For information about network troubleshoting, see Windows Help.
C:\Users\tsi>ping storage01
Pinging storage01.powelasa.powel.com [2002:c1d7:4a5b::c1d7:4a5b] from 2002:c1d7
4a30::c1d7:4a30 with 32 bytes of data:
Reply from 2002:c1d7:4a5b::c1d7:4a5b: time<1ms
Reply from 2002:c1d7:4a5b::c1d7:4a5b: time<1ms
Reply from 2002:c1d7:4a5b::c1d7:4a5b: time<1ms
Reply from 2002:c1d7:4a5b::c1d7:4a5b: time<1ms
Ping statistics for 2002:c1d7:4a5b::c1d7:4a5b:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
'WebClient' in my machine is also started and its startup type is also set as Automatic.
Can anyone help me to solve this issue???
Thanks,
Velu
| 2 |
5,678,706 |
04/15/2011 15:05:45
| 710,048 |
04/15/2011 15:02:10
| 1 | 0 |
Smooth movement Django site
|
I need the make some front page text move smoothly like the front page of www.twitter.com under Top Tweets.
Im using Django but have tried using http://docs.jquery.com/UI/Effects/Slide#overview but it doesnt work well for me.
Any help would be appreciated. Thanks.
|
jquery
|
django
| null | null | null |
04/16/2011 22:21:19
|
not a real question
|
Smooth movement Django site
===
I need the make some front page text move smoothly like the front page of www.twitter.com under Top Tweets.
Im using Django but have tried using http://docs.jquery.com/UI/Effects/Slide#overview but it doesnt work well for me.
Any help would be appreciated. Thanks.
| 1 |
7,264,263 |
08/31/2011 22:33:37
| 248,237 |
01/11/2010 17:06:25
| 911 | 6 |
Debugging a world of hell when trying to install MySQL-Python on Mac OS X
|
I've been trying for weeks and weeks to install MySQL-python with absolutely no luck, on Mac OS X 10.6 with Python 7.0 from the Enthought Python Distribution. Many of the issues I ran into have been described in other posts and I'm pretty sure I read all of those, but still cannot fix this issue. I tried installing and reinstalling various MySQL packages for 64bit OS X but finally just compiled it from scratch. MySQL, as far as I know, works and lives in the directory /usr/local/mysql-5.5.9-osx10.6-x86/.
I was able to install MySQL-python-1.2.3 using "sudo setup.py install". However, when I import it, I get the error:
$ python
Enthought Python Distribution -- www.enthought.com
Version: 7.0-2 (64-bit)
Python 2.7.1 |EPD 7.0-2 (64-bit)| (r271:86832, Dec 3 2010, 15:56:20)
[GCC 4.0.1 (Apple Inc. build 5488)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
Reason: image not found
I looked to see, as other posters on here suggested, what _mysql.so is referencing using otool:
$ otool -L /Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
/Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so:
libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 438.0.0)
The correct file seems to exist here:
$ ls -al /usr/local/mysql-5.5.9-osx10.6-x86/lib/libmysqlclient.16.dylib
-rwxr-xr-x 1 root wheel 3539752 Jan 20 2011 /usr/local/mysql-5.5.9-osx10.6-x86/lib/libmysqlclient.16.dylib
I tried several approaches to make _mysql.so recognize this file:
1. Making symbolic links, as others suggested, to the right file:
$ sudo ln -s /usr/local/mysql-5.5.9-osx10.6-x86/lib/libmysqlclient.16.dylib /usr/lib/libmysqlclient.18.dylib
when I do this, I get a new error:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
Reason: no suitable image found. Did find:
/usr/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture
2. Setting DYLD_LIBRARY_PATH, as follows (after removing the previous symbolic link):
$ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/mysql-5.5.9-osx10.6-x86/lib/
Then I get the same error as initially:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
Reason: image not found
Any ideas on what can be done to fix this? I'd really like to get this package working... I tried for a while and could not get it to work. I understand it's a common issue but I could not get any of the posted solutions to work.
Thanks very much for your help.
|
python
|
mysql
|
osx
|
mysql-python
| null |
08/31/2011 23:31:31
|
off topic
|
Debugging a world of hell when trying to install MySQL-Python on Mac OS X
===
I've been trying for weeks and weeks to install MySQL-python with absolutely no luck, on Mac OS X 10.6 with Python 7.0 from the Enthought Python Distribution. Many of the issues I ran into have been described in other posts and I'm pretty sure I read all of those, but still cannot fix this issue. I tried installing and reinstalling various MySQL packages for 64bit OS X but finally just compiled it from scratch. MySQL, as far as I know, works and lives in the directory /usr/local/mysql-5.5.9-osx10.6-x86/.
I was able to install MySQL-python-1.2.3 using "sudo setup.py install". However, when I import it, I get the error:
$ python
Enthought Python Distribution -- www.enthought.com
Version: 7.0-2 (64-bit)
Python 2.7.1 |EPD 7.0-2 (64-bit)| (r271:86832, Dec 3 2010, 15:56:20)
[GCC 4.0.1 (Apple Inc. build 5488)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
Reason: image not found
I looked to see, as other posters on here suggested, what _mysql.so is referencing using otool:
$ otool -L /Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
/Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so:
libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 438.0.0)
The correct file seems to exist here:
$ ls -al /usr/local/mysql-5.5.9-osx10.6-x86/lib/libmysqlclient.16.dylib
-rwxr-xr-x 1 root wheel 3539752 Jan 20 2011 /usr/local/mysql-5.5.9-osx10.6-x86/lib/libmysqlclient.16.dylib
I tried several approaches to make _mysql.so recognize this file:
1. Making symbolic links, as others suggested, to the right file:
$ sudo ln -s /usr/local/mysql-5.5.9-osx10.6-x86/lib/libmysqlclient.16.dylib /usr/lib/libmysqlclient.18.dylib
when I do this, I get a new error:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
Reason: no suitable image found. Did find:
/usr/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture
2. Setting DYLD_LIBRARY_PATH, as follows (after removing the previous symbolic link):
$ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/mysql-5.5.9-osx10.6-x86/lib/
Then I get the same error as initially:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/foo/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so
Reason: image not found
Any ideas on what can be done to fix this? I'd really like to get this package working... I tried for a while and could not get it to work. I understand it's a common issue but I could not get any of the posted solutions to work.
Thanks very much for your help.
| 2 |
3,857,196 |
10/04/2010 16:28:08
| 358,193 |
06/04/2010 07:13:03
| 69 | 1 |
integer range in c
|
why integer has a range between 0 and 32768?
|
c++
|
c
|
integer
|
range
| null |
10/04/2010 19:28:43
|
not a real question
|
integer range in c
===
why integer has a range between 0 and 32768?
| 1 |
6,354,357 |
06/15/2011 07:21:43
| 726,521 |
04/21/2011 12:27:19
| 3 | 0 |
Book for object oriented programming in PHP
|
can any one suggest me Book for object oriented programming in PHP
|
php
|
php5
| null | null | null |
06/15/2011 08:18:56
|
not constructive
|
Book for object oriented programming in PHP
===
can any one suggest me Book for object oriented programming in PHP
| 4 |
11,473,281 |
07/13/2012 15:13:15
| 1,346,418 |
04/20/2012 11:30:54
| 164 | 1 |
global vs local (variables and lists) by byte consumption JAVA
|
I' trying to create a web site and some times i took the PermGen exception. So i start searching for ways to reduce the amount of the created objects and also to reduce the memory consumption. I read some articles. But i'm not sure about some things. For example is better to declare lists outside of a method(global), or to create them into a method? What's the difference in terms of memory consumption at this case? If i declare them as local that means that after the use the garbage collector will collect them and thus will release space at the heap? Can anyone propose me ways to reduce more the memory consumption and the amount of the create objects(is the @Autowired better way to declare on object)?
|
java
| null | null | null | null | null |
open
|
global vs local (variables and lists) by byte consumption JAVA
===
I' trying to create a web site and some times i took the PermGen exception. So i start searching for ways to reduce the amount of the created objects and also to reduce the memory consumption. I read some articles. But i'm not sure about some things. For example is better to declare lists outside of a method(global), or to create them into a method? What's the difference in terms of memory consumption at this case? If i declare them as local that means that after the use the garbage collector will collect them and thus will release space at the heap? Can anyone propose me ways to reduce more the memory consumption and the amount of the create objects(is the @Autowired better way to declare on object)?
| 0 |
10,353,012 |
04/27/2012 15:00:09
| 1,361,162 |
04/27/2012 13:02:03
| 1 | 0 |
Faild to get the full image in wia scanner in c# windows application
|
this code gives me only the half image from cannon scanner. plz give me the solution of this code.I tried in both picture box and panel to show the image . auto scroll is given true for the form.I tried to get the complete image from the scanner but I got only half image. I tried the code is given below.
const string wiaFormatBMP = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}";
class WIA_DPS_DOCUMENT_HANDLING_SELECT
{
public const uint FEEDER = 0x00000001;
public const uint FLATBED = 0x00000002;
}
class WIA_DPS_DOCUMENT_HANDLING_STATUS
{
public const uint FEED_READY = 0x00000001;
}
class WIA_PROPERTIES
{
public const uint WIA_RESERVED_FOR_NEW_PROPS = 1024;
public const uint WIA_DIP_FIRST = 2;
public const uint WIA_DPA_FIRST = WIA_DIP_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
public const uint WIA_DPC_FIRST = WIA_DPA_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
//
// Scanner only device properties (DPS)
//
public const uint WIA_DPS_FIRST = WIA_DPC_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
public const uint WIA_DPS_DOCUMENT_HANDLING_STATUS = WIA_DPS_FIRST + 13;
public const uint WIA_DPS_DOCUMENT_HANDLING_SELECT = WIA_DPS_FIRST + 14;
}
/// <summary>
/// Use scanner to scan an image (with user selecting the scanner from a dialog).
/// </summary>
/// <returns>Scanned images.</returns>
//public static List<Image> Scanning()
//{
//}
/// <summary>
/// Use scanner to scan an image (scanner is selected by its unique id).
/// </summary>
/// <param name="scannerName"></param>
/// <returns>Scanned images.</returns>
public List<Image> Scan(string scannerId)
{
List<Image> images = new List<Image>();
bool hasMorePages = true;
while (hasMorePages)
{
// select the correct scanner using the provided scannerId parameter
WIA.DeviceManager manager = new WIA.DeviceManager();
WIA.Device device = null;
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
if (info.DeviceID == scannerId)
{
// connect to scanner
device = info.Connect();
break;
}
}
// device was not found
if (device == null)
{
// enumerate available devices
string availableDevices = "";
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
availableDevices += info.DeviceID + "n";
}
// show error with available devices
throw new Exception("The device with provided ID could not be found. Available Devices:n" + availableDevices);
}
WIA.Item item = device.Items[1] as WIA.Item;
try
{
// scan image
WIA.ICommonDialog wiaCommonDialog = new WIA.CommonDialog();
WIA.ImageFile image = (WIA.ImageFile)wiaCommonDialog.ShowTransfer(item, wiaFormatBMP, false);
// save to temp file
string fileName = Path.GetTempFileName()+".BMP";
File.Delete(fileName);
image.SaveFile(fileName);
pictureBox1.ImageLocation = fileName;
image = null;
// add file to output list
images.Add(Image.FromFile(fileName));
}
catch (Exception exc)
{
throw exc;
}
finally
{
item = null;
//determine if there are any more pages waiting
WIA.Property documentHandlingSelect = null;
WIA.Property documentHandlingStatus = null;
foreach (WIA.Property prop in device.Properties)
{
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_SELECT)
documentHandlingSelect = prop;
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_STATUS)
documentHandlingStatus = prop;
}
// assume there are no more pages
hasMorePages = false;
// may not exist on flatbed scanner but required for feeder
if (documentHandlingSelect != null)
{
// check for document feeder
if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER) != 0)
{
hasMorePages = ((Convert.ToUInt32(documentHandlingStatus.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_STATUS.FEED_READY) != 0);
}
}
}
}
return images;
}
/// <summary>
/// Gets the list of available WIA devices.
/// </summary>
/// <returns></returns>
public static List<string> GetDevices()
{
List<string> devices = new List<string>();
WIA.DeviceManager manager = new WIA.DeviceManager();
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
devices.Add(info.DeviceID);
}
return devices;
}
private void button1_Click(object sender, EventArgs e)
{
WIA.ICommonDialog dialog = new WIA.CommonDialog();
WIA.Device device = dialog.ShowSelectDevice(WIA.WiaDeviceType.UnspecifiedDeviceType, true, false);
if (device != null)
{
Scan(device.DeviceID);
}
else
{
throw new Exception("You must select a device for scanning.");
}
}
}
this code gives me only the half image from cannon scanner. plz give me the solution of this code.
I tried in both picture box and panel to show the image .
auto scroll is given true for the form.
|
c#
| null | null | null | null |
04/30/2012 15:35:33
|
not a real question
|
Faild to get the full image in wia scanner in c# windows application
===
this code gives me only the half image from cannon scanner. plz give me the solution of this code.I tried in both picture box and panel to show the image . auto scroll is given true for the form.I tried to get the complete image from the scanner but I got only half image. I tried the code is given below.
const string wiaFormatBMP = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}";
class WIA_DPS_DOCUMENT_HANDLING_SELECT
{
public const uint FEEDER = 0x00000001;
public const uint FLATBED = 0x00000002;
}
class WIA_DPS_DOCUMENT_HANDLING_STATUS
{
public const uint FEED_READY = 0x00000001;
}
class WIA_PROPERTIES
{
public const uint WIA_RESERVED_FOR_NEW_PROPS = 1024;
public const uint WIA_DIP_FIRST = 2;
public const uint WIA_DPA_FIRST = WIA_DIP_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
public const uint WIA_DPC_FIRST = WIA_DPA_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
//
// Scanner only device properties (DPS)
//
public const uint WIA_DPS_FIRST = WIA_DPC_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
public const uint WIA_DPS_DOCUMENT_HANDLING_STATUS = WIA_DPS_FIRST + 13;
public const uint WIA_DPS_DOCUMENT_HANDLING_SELECT = WIA_DPS_FIRST + 14;
}
/// <summary>
/// Use scanner to scan an image (with user selecting the scanner from a dialog).
/// </summary>
/// <returns>Scanned images.</returns>
//public static List<Image> Scanning()
//{
//}
/// <summary>
/// Use scanner to scan an image (scanner is selected by its unique id).
/// </summary>
/// <param name="scannerName"></param>
/// <returns>Scanned images.</returns>
public List<Image> Scan(string scannerId)
{
List<Image> images = new List<Image>();
bool hasMorePages = true;
while (hasMorePages)
{
// select the correct scanner using the provided scannerId parameter
WIA.DeviceManager manager = new WIA.DeviceManager();
WIA.Device device = null;
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
if (info.DeviceID == scannerId)
{
// connect to scanner
device = info.Connect();
break;
}
}
// device was not found
if (device == null)
{
// enumerate available devices
string availableDevices = "";
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
availableDevices += info.DeviceID + "n";
}
// show error with available devices
throw new Exception("The device with provided ID could not be found. Available Devices:n" + availableDevices);
}
WIA.Item item = device.Items[1] as WIA.Item;
try
{
// scan image
WIA.ICommonDialog wiaCommonDialog = new WIA.CommonDialog();
WIA.ImageFile image = (WIA.ImageFile)wiaCommonDialog.ShowTransfer(item, wiaFormatBMP, false);
// save to temp file
string fileName = Path.GetTempFileName()+".BMP";
File.Delete(fileName);
image.SaveFile(fileName);
pictureBox1.ImageLocation = fileName;
image = null;
// add file to output list
images.Add(Image.FromFile(fileName));
}
catch (Exception exc)
{
throw exc;
}
finally
{
item = null;
//determine if there are any more pages waiting
WIA.Property documentHandlingSelect = null;
WIA.Property documentHandlingStatus = null;
foreach (WIA.Property prop in device.Properties)
{
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_SELECT)
documentHandlingSelect = prop;
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_STATUS)
documentHandlingStatus = prop;
}
// assume there are no more pages
hasMorePages = false;
// may not exist on flatbed scanner but required for feeder
if (documentHandlingSelect != null)
{
// check for document feeder
if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER) != 0)
{
hasMorePages = ((Convert.ToUInt32(documentHandlingStatus.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_STATUS.FEED_READY) != 0);
}
}
}
}
return images;
}
/// <summary>
/// Gets the list of available WIA devices.
/// </summary>
/// <returns></returns>
public static List<string> GetDevices()
{
List<string> devices = new List<string>();
WIA.DeviceManager manager = new WIA.DeviceManager();
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
devices.Add(info.DeviceID);
}
return devices;
}
private void button1_Click(object sender, EventArgs e)
{
WIA.ICommonDialog dialog = new WIA.CommonDialog();
WIA.Device device = dialog.ShowSelectDevice(WIA.WiaDeviceType.UnspecifiedDeviceType, true, false);
if (device != null)
{
Scan(device.DeviceID);
}
else
{
throw new Exception("You must select a device for scanning.");
}
}
}
this code gives me only the half image from cannon scanner. plz give me the solution of this code.
I tried in both picture box and panel to show the image .
auto scroll is given true for the form.
| 1 |
10,714,925 |
05/23/2012 06:56:27
| 1,411,893 |
05/23/2012 06:47:14
| 1 | 0 |
Wt (C++) or Ruby on Rails, or Django (Python)? for a computer science student
|
I am a 2nd year computer science student and I am looking for advice. I have done JAVA and a little bit of C so far in school. In my own time I like to make small web applications because they can easily be deployed and are much easy to code compared to standalone programs. I have been using PHP for the past 3 years and was told to move on to different language to enhance my learning experience and broaden the job skills.
I want to know what language out of the three mentioned is good for:
1. Someone wanting to pursue a computer science/software engineering career.
2. Something that will help me with my degree (e.g I heard Ruby on rails helps to better understand OOP concepts)
3. A language that is in demand (Which is why I am leaning towards Wt, that case I get to practice my C++ skills)
I know it depends on what kind of application you want to build, so heres what I intend to do:
Make websites that allow :
1. Data storage (easy interface with database systems perhaps?)
2. Graphics library. I want to program a web graphics program where you can make wallpapers on the go.
Thanks
|
c++
|
ruby-on-rails
|
ruby
|
django
|
wt
|
05/23/2012 08:43:28
|
not constructive
|
Wt (C++) or Ruby on Rails, or Django (Python)? for a computer science student
===
I am a 2nd year computer science student and I am looking for advice. I have done JAVA and a little bit of C so far in school. In my own time I like to make small web applications because they can easily be deployed and are much easy to code compared to standalone programs. I have been using PHP for the past 3 years and was told to move on to different language to enhance my learning experience and broaden the job skills.
I want to know what language out of the three mentioned is good for:
1. Someone wanting to pursue a computer science/software engineering career.
2. Something that will help me with my degree (e.g I heard Ruby on rails helps to better understand OOP concepts)
3. A language that is in demand (Which is why I am leaning towards Wt, that case I get to practice my C++ skills)
I know it depends on what kind of application you want to build, so heres what I intend to do:
Make websites that allow :
1. Data storage (easy interface with database systems perhaps?)
2. Graphics library. I want to program a web graphics program where you can make wallpapers on the go.
Thanks
| 4 |
6,037,451 |
05/17/2011 21:35:58
| 749,113 |
05/11/2011 16:36:56
| 1 | 0 |
Object reference not set to an instance of an object.
|
I create next button but doesent work. The error says: Object reference not set to an instance of an object.
Please help
private void nextbutton_Click(object sender, EventArgs e)
{
if (counter<dt.Rows.Count - 1)
{
counter++;
cbSifra.Text = dt.Rows[counter][0].ToString();
cbSSP.Text = dt.Rows[counter][1].ToString();
}
}
|
c#
| null | null | null | null |
05/17/2011 22:05:04
|
not a real question
|
Object reference not set to an instance of an object.
===
I create next button but doesent work. The error says: Object reference not set to an instance of an object.
Please help
private void nextbutton_Click(object sender, EventArgs e)
{
if (counter<dt.Rows.Count - 1)
{
counter++;
cbSifra.Text = dt.Rows[counter][0].ToString();
cbSSP.Text = dt.Rows[counter][1].ToString();
}
}
| 1 |
8,728,015 |
01/04/2012 13:52:03
| 1,129,856 |
01/04/2012 11:56:11
| 1 | 0 |
Easy but effective way of solving huge one-page site?
|
Simple question, but I'll probably go around the world a few times before I get to the point. I'm currently designing a site dedicated to 'The Legend of Zelda' called Zelda Timeline, which will follow the official timeline as revealed by Nintendo recently in their Japanese book, 'Hyrule Historia'.
The idea is you go on the site and presented firstly with an brief about and slider, then scroll down to view the game in list order. Currently, I have a one-page template set up to put each game in order, and then when 'Next' is clicked is jumps to the next game in the list. That's the easy part...
Nintendo being Nintendo, they decided to split the Zelda timeline into three parts from the game 'Ocarina of Time' so there are three parallel timelines from that game: A, B, C we'll say for now. [This image explains it better](http://chzfandom.files.wordpress.com/2011/12/timeline.png). Now, the easy option would be have Split A running straight on from the main timeline, then B, then C with the user clicking Split B, skipping Split A completely, or the user clicking Split C and skipping A and B. The only fault with this solution is that if the user wants to, they can just keep scrolling, therefore bypassing the jumps and scrolling the content out of order.
I had the idea of once you get to the game where it splits - 'Ocarina of Time' - the user is presented with three choices as above: A, B, or C. When the user presses their choice, the are taken diagonally down-left for A, down for B, diagonally down-right for C, but cannot scroll down to the actual content unless the choices is made? When the choice has loaded, the normal vertical scrolling is resumed to follow that timeline? [See this image](http://dl.dropbox.com/u/6174165/horizontal-timeline.jpg).
Is this feasible? I remember seeing a form a while ago, that once each section was filled and submitted, it loaded the next section in a horizontal manner and a mix of jQuery and AJAX comes to mind?
What are your thought and ideas on this, and would it be easy to implement for someone with decent HTML/CSS and jQuery knowledge?
|
javascript
|
jquery
|
html
|
css
|
ajax
|
01/04/2012 14:02:08
|
not constructive
|
Easy but effective way of solving huge one-page site?
===
Simple question, but I'll probably go around the world a few times before I get to the point. I'm currently designing a site dedicated to 'The Legend of Zelda' called Zelda Timeline, which will follow the official timeline as revealed by Nintendo recently in their Japanese book, 'Hyrule Historia'.
The idea is you go on the site and presented firstly with an brief about and slider, then scroll down to view the game in list order. Currently, I have a one-page template set up to put each game in order, and then when 'Next' is clicked is jumps to the next game in the list. That's the easy part...
Nintendo being Nintendo, they decided to split the Zelda timeline into three parts from the game 'Ocarina of Time' so there are three parallel timelines from that game: A, B, C we'll say for now. [This image explains it better](http://chzfandom.files.wordpress.com/2011/12/timeline.png). Now, the easy option would be have Split A running straight on from the main timeline, then B, then C with the user clicking Split B, skipping Split A completely, or the user clicking Split C and skipping A and B. The only fault with this solution is that if the user wants to, they can just keep scrolling, therefore bypassing the jumps and scrolling the content out of order.
I had the idea of once you get to the game where it splits - 'Ocarina of Time' - the user is presented with three choices as above: A, B, or C. When the user presses their choice, the are taken diagonally down-left for A, down for B, diagonally down-right for C, but cannot scroll down to the actual content unless the choices is made? When the choice has loaded, the normal vertical scrolling is resumed to follow that timeline? [See this image](http://dl.dropbox.com/u/6174165/horizontal-timeline.jpg).
Is this feasible? I remember seeing a form a while ago, that once each section was filled and submitted, it loaded the next section in a horizontal manner and a mix of jQuery and AJAX comes to mind?
What are your thought and ideas on this, and would it be easy to implement for someone with decent HTML/CSS and jQuery knowledge?
| 4 |
11,439,555 |
07/11/2012 18:58:18
| 933,670 |
09/07/2011 21:39:52
| 21 | 3 |
Boost asio acceptor and netcat : connection refused
|
I am working with Boost asio on the [fourth example of http server](http://www.boost.org/doc/libs/1_50_0/doc/html/boost_asio/examples.html)
The server is working with a browser, but it don't seems to accept `netcat` connection.
$ ./http_server localhost 8080 src &
$ nc -vv localhost 8080
Notice: Real hostname for localhost [127.0.0.1] is localhost.localdomain
Notice: Real hostname for localhost [127.0.0.1] is localhost.localdomain
localhost [127.0.0.1] 8080 (socks): Connection refused
Total received bytes: 0
Total sent bytes: 0
I am currently using Boost version 1.49
Is this an expected behavior ?
Am I missing something ?
|
boost-asio
|
netcat
| null | null | null |
07/26/2012 20:46:33
|
too localized
|
Boost asio acceptor and netcat : connection refused
===
I am working with Boost asio on the [fourth example of http server](http://www.boost.org/doc/libs/1_50_0/doc/html/boost_asio/examples.html)
The server is working with a browser, but it don't seems to accept `netcat` connection.
$ ./http_server localhost 8080 src &
$ nc -vv localhost 8080
Notice: Real hostname for localhost [127.0.0.1] is localhost.localdomain
Notice: Real hostname for localhost [127.0.0.1] is localhost.localdomain
localhost [127.0.0.1] 8080 (socks): Connection refused
Total received bytes: 0
Total sent bytes: 0
I am currently using Boost version 1.49
Is this an expected behavior ?
Am I missing something ?
| 3 |
3,788,679 |
09/24/2010 15:40:44
| 453,124 |
09/20/2010 19:37:59
| 104 | 15 |
CAPTCHA and it's legality?
|
I am sourcing some info from the OWASP (open application security community) web site (http://owasp.org) and came across some info in their Authentication section.
> CAPTCHA (Completely automated Turing
> Tests To Tell Humans and Computers
> Apart) are illegal in any jurisdiction
> that prohibits discrimination against
> disabled citizens. This is essentially
> the entire world. Although CAPTCHAs
> seem useful, they are in fact, trivial
> to break using any of the following
> methods:
><br /><br />• Optical Character
> Recognition. Most common CAPTCHAs are
> solvable using specialist CAPTCHA
> breaking OCR software.
><br />• Break a test,
> get free access to foo, where foo is a
> desirable resource
><br />• Pay someone to
> solve the CAPTCHAs. The current rate
> at the time of writing is $12 per 500
> tests.
><br /><br />Therefore implementing CAPTCHAs
> in your software is most likely to be
> illegal in at least a few countries,
> and worse - completely ineffective.
[http://www.owasp.org/index.php/Guide_to_Authentication][1]
They are saying that their useage is illegal due to discrimination laws in place for Disabled Citizens.
I know OWASP is pretty good for info on security, but I have to question how serious the legality of implementing something like CAPTCHA is.
So. Can anyone reference or point me in the direction of any type of documentation confirming there is an issue of legality with using CAPTCHA? Is it specific to all countries or just U.S.?
Is implmementing speech features for the CAPTCHA enough to overcome the legality?
Extra points if you can find the relevant documents to support this in Canada. As I work in Canada for a large multinational company which uses CAPTCHA extensively.
Cheers Mates!
[1]: http://www.owasp.org/index.php/Guide_to_Authentication
|
security
|
forms
|
authentication
|
captcha
| null |
09/24/2010 16:02:56
|
off topic
|
CAPTCHA and it's legality?
===
I am sourcing some info from the OWASP (open application security community) web site (http://owasp.org) and came across some info in their Authentication section.
> CAPTCHA (Completely automated Turing
> Tests To Tell Humans and Computers
> Apart) are illegal in any jurisdiction
> that prohibits discrimination against
> disabled citizens. This is essentially
> the entire world. Although CAPTCHAs
> seem useful, they are in fact, trivial
> to break using any of the following
> methods:
><br /><br />• Optical Character
> Recognition. Most common CAPTCHAs are
> solvable using specialist CAPTCHA
> breaking OCR software.
><br />• Break a test,
> get free access to foo, where foo is a
> desirable resource
><br />• Pay someone to
> solve the CAPTCHAs. The current rate
> at the time of writing is $12 per 500
> tests.
><br /><br />Therefore implementing CAPTCHAs
> in your software is most likely to be
> illegal in at least a few countries,
> and worse - completely ineffective.
[http://www.owasp.org/index.php/Guide_to_Authentication][1]
They are saying that their useage is illegal due to discrimination laws in place for Disabled Citizens.
I know OWASP is pretty good for info on security, but I have to question how serious the legality of implementing something like CAPTCHA is.
So. Can anyone reference or point me in the direction of any type of documentation confirming there is an issue of legality with using CAPTCHA? Is it specific to all countries or just U.S.?
Is implmementing speech features for the CAPTCHA enough to overcome the legality?
Extra points if you can find the relevant documents to support this in Canada. As I work in Canada for a large multinational company which uses CAPTCHA extensively.
Cheers Mates!
[1]: http://www.owasp.org/index.php/Guide_to_Authentication
| 2 |
413,145 |
01/05/2009 13:51:36
| 1,231 |
08/13/2008 14:34:47
| 134 | 15 |
What is the best advertisement service to put on your site?
|
I have a site I'm currently building and I want to make it free, but support it with advertisements. I see a lot of sites using Google's Adsense program and others using Ebay & Amazon. But I noticed with StackOverflow, it looks like they're partnering up directly with sellers. I have Google's adsense on my blog, but I still haven't made a cent from it. Not saying I have a great number of visitors, but I'm starting to wonder if Google is not the way to go.
What experience have you guys had with advertisements and what do you recommend?
With the new closing rules in place, I can finally get my answer. ;-)
|
advertising
|
business
|
marketing
| null | null |
01/05/2009 14:06:33
|
off topic
|
What is the best advertisement service to put on your site?
===
I have a site I'm currently building and I want to make it free, but support it with advertisements. I see a lot of sites using Google's Adsense program and others using Ebay & Amazon. But I noticed with StackOverflow, it looks like they're partnering up directly with sellers. I have Google's adsense on my blog, but I still haven't made a cent from it. Not saying I have a great number of visitors, but I'm starting to wonder if Google is not the way to go.
What experience have you guys had with advertisements and what do you recommend?
With the new closing rules in place, I can finally get my answer. ;-)
| 2 |
7,989,521 |
11/03/2011 02:05:29
| 1,026,849 |
11/03/2011 01:52:20
| 1 | 0 |
How can I get OProfile / Xenoprof to use event counters when running on EC2?
|
I'm writing a cluster-wide profiling tool for EC2 that is designed to collect data by running OProfile on each instance. I'd eventually like to aggregate the XML output generated by opreport, and analyze it later.
Right now, I'm stuck on getting OProfile to see hardware events -- all I can do is build profiles in Timer Interrupt mode. I have a feeling this is due to the fact that EC2 instances run in a virtualized environment, where OProfile cannot see hardware events.
I looked into this hunch a bit, and came up with Xenoprof as a possible solution, but there's very limited documentation on how to get it up and running with EC2.
If anyone's had any success running Xenoprof on EC2 (and I know there must be some successes, because there are several papers about it), could you clue me in as to what's going wrong?
When I run
yum install oprofile
and then
man opcontrol
on the instance, I see the options for xen are there, which I *think* means that Xenoprof must be installed. I just don't know what to do to get the hardware events as my samples.
Any advice would be much appreciated! Thanks.
|
amazon-ec2
|
profiling
|
virtual-machine
|
xen
|
oprofile
| null |
open
|
How can I get OProfile / Xenoprof to use event counters when running on EC2?
===
I'm writing a cluster-wide profiling tool for EC2 that is designed to collect data by running OProfile on each instance. I'd eventually like to aggregate the XML output generated by opreport, and analyze it later.
Right now, I'm stuck on getting OProfile to see hardware events -- all I can do is build profiles in Timer Interrupt mode. I have a feeling this is due to the fact that EC2 instances run in a virtualized environment, where OProfile cannot see hardware events.
I looked into this hunch a bit, and came up with Xenoprof as a possible solution, but there's very limited documentation on how to get it up and running with EC2.
If anyone's had any success running Xenoprof on EC2 (and I know there must be some successes, because there are several papers about it), could you clue me in as to what's going wrong?
When I run
yum install oprofile
and then
man opcontrol
on the instance, I see the options for xen are there, which I *think* means that Xenoprof must be installed. I just don't know what to do to get the hardware events as my samples.
Any advice would be much appreciated! Thanks.
| 0 |
9,117,793 |
02/02/2012 18:24:42
| 963,115 |
09/24/2011 23:09:13
| 36 | 4 |
bitwise most significant set bti
|
I want to find the most significant bit that is set to 1. I have tried every possible way from & to ORing all of the bits from 1 to 31 and it doesn't work. Like if 1000000 I would like to have 7. Thank you.
|
java
|
bitwise
| null | null | null | null |
open
|
bitwise most significant set bti
===
I want to find the most significant bit that is set to 1. I have tried every possible way from & to ORing all of the bits from 1 to 31 and it doesn't work. Like if 1000000 I would like to have 7. Thank you.
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.