Tuesday, 10 September 2013

Archiving a record to mysql using php

Archiving a record to mysql using php

I'm developing a record management system, but i dont know how to archive
it's records. can somebody please give me an idea or logic on how to
archive records. thanks for your time & effort for helping me ..,

How to set environment variable in Ubuntu

How to set environment variable in Ubuntu

I am new to ubuntu. I am using matlab in ubuntu. I used 'mcc' command in
matlab(ubuntu) to create executable files.
Now to run those executables I need to set the 'MCR' directory path to the
environment variable. I used 'setenv' but, it says 'setenv is not found.
the following is what I did-
setenv PATH/<mcr root path>/v7.17: "$PATH"
And I get the following output-
No command 'setenv' found, did you mean command 'neten'
from package 'netenv'
setenv: commmand not found
Can you please help me telling how do I set the environment variable in
ubuntu to run my executable files.
Regards,

program to remove a row in excel baseed on cell value

program to remove a row in excel baseed on cell value

Can some one tell me how achieve the following task?
I have a excel and i want delete some rows based on the particular cell
value, but the excel is very very huge it has got around 75000 rows. I
tried writing a nomal function to loop through the sheet, check for the
cell value and delete the rows if matched. but it is taking very long
time. i waited for 30 min and program was still running can some one
suggest me how to achieve this.
Thanks in Advance. Veeresh

Apache Shiro- using DataBase to read users, roles and permissions

Apache Shiro- using DataBase to read users, roles and permissions

Currently I've a swing app and I wan't to implement Apache Shiro in order
to Authenticate and delegate permissions to certain roles. I've already
managed myself to read the users from the Shiro.ini file that I've created
for tests, it looks something like this
[users]
admin = 123456, Administrator
[role]
Administrator = *:*:*
However I've stored in a database a table with the info I need and it
looks something like this:
users (id,password,username) userRoles (userId, role) rolePermission
(permissionID,permission,roleID)
I've been trying to understand tutorials that use a JDBC realm, however
they use web applications or specials frameworks to manage their
connection to the DataBase like Apache Derby or BoneCP, and they confuse
me even more with these examples.
So what I'm asking it's how I need to configure the Shiro.ini file if I
wanna use a JDBC realm (with an oracle database) and what classes the
Shiro.ini needs. Any examples or explanation will be appreciated!

javascript jquery callback accumulates

javascript jquery callback accumulates

Issue: Each time div.a is clicked, the number of callbacks when div.b is
clicked,accumulates by 1.
var $=jQuery;
$(function(){
$("div.a").click(function(){cbf(trgmsg);});
});
function trgmsg(){
alert($.now());
}
function cbf(cb){
$("div.b").click(function(){cb()});
}
Result:
click div.a once and click div.b => alert() pops-up;
if i click div.a again and click div.b => alert() pops-up twice
consecutively;
if i click div.a another time and click div.b => alert() pops-up three
times consecutively;
..and so on

I have No idea what the cause of the problem is or if its simply my
misunderstanding/misuse of callback functions in JS. Any insights and/or
advice will be greatly appreciated. thanks

My program skip getting input data?

My program skip getting input data?

I have written a simple program to exchange currency and able to buy a beer.
But there something in program and I don't know why, it auto skips the
third input data -> end program.
Here my code :
#include <stdio.h>
#include <stdlib.h>
int main()
{
int ex_rate_into_vnd = 20000; //! Exchange Rate
int beer = 7000; //! Local price of a beer
float in_c = 0; //! Input amount of money
float out_c = 2; //! Amount of currency to exchange !
float choice; //! Switch mode
char buy; //! Deal or not
//! Introduction
printf ("||---------------------------------------------------||\n");
printf ("|| Currency Exchange Machine beta ||\n");
printf ("||---------------------------------------------------||\n");
printf ("Please choose your option:\n");
printf("\t 1.Exchange VND to dollar\n");
printf("\t 2.Exchange Dollar to VND\n");
do
{
printf("Your choice: ",choice);
scanf("%f",&choice);
} while( choice != 1 && choice != 2);
printf ("Please enter amount of money:");
scanf("%f",&in_c);
if (choice == 1 )
{
out_c = in_c / ex_rate_into_vnd;
printf ("Your amount of money: %.2f",out_c);
}
else
{
out_c = in_c * ex_rate_into_vnd;
printf ("Your amount of money: %.0f",out_c);
}
//! End of Exchanging
printf ("\nWould you like to buy a beer (y/n) ?",buy);
scanf("%c", &buy);
if (buy == 'y')
{
if (out_c >= 7000)
{
out_c = out_c - 7000;
printf("Transactions success !\n");
printf("Your amount: %2.f",out_c);
}
}
printf ("\nWhy Stop ?");
return 0;
}

How to parse api response on table view?

How to parse api response on table view?

my json response data formate as :-
[{"0":"1","id":"1","1":"Pradeep","name":"Pradeep","2":null,"sender":null,"3":null,"
so to pharse the "name" on table view ?
my own implementation as:-
i am new i ios development please help me
i am new i ios development please help me i am new i ios development
please help me i am new i ios development please help me i am new i ios
development please help me i am new i ios development please help me i am
new i ios development please help me i am new i ios development please
help me i am new i ios development please help me
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSDictionary *allDataDictionary=[NSJSONSerialization
JSONObjectWithData:webData
options:0 error:nil]; // response saved in allDataDictionary
NSDictionary *feed=[allDataDictionary objectForKey:@"feed"]; // feeds entry
NSArray *feedforentry=[feed objectForKey:@"entry"];
for(NSDictionary *diction in feedforentry)
{
NSDictionary *title=[diction objectForKey:@"title"];
NSString *label=[title objectForKey:@"label"];
[array addObject:label];
}
[[self JustConfesstable]reloadData]; // reload table
}