Wednesday, 11 September 2013

Textarea Cutoff in PHP $_POST array

Textarea Cutoff in PHP $_POST array

My textarea on a webform [using POST method] is getting cutting off at
1024 characters.
The field does not have a max length attribute set and will allow over
1024 characters to be entered. However, when I view the $_POST array in
Eclipse and try to insert into Database, I can see it is not the entirety
of the user's input.
What is the root cause of this issue? Is there an inherent limitation that
I am unaware of? I can't seem to find any documentation on this issue. Any
advice is greatly appreciated.

How to get xml tag names in groovy

How to get xml tag names in groovy

can any one help me how to get tag names in my script.In below code i need
to get mbrSqncNum?help me out...
<Id>059A670</healthCardId>
<subscriberId>059A625</subscriberId>
<mbrSqncNum>10</mbrSqncNum>

Best practice - 'forgotten username' process

Best practice - 'forgotten username' process

I've currently been asked to implement a 'forgotten username'
functionality on a site I've inherited, and I'm curious what the best
practice is for the process. I'm already following best practice for
resetting the user's password (by sending an expiring, one use reset link)
- but there doesn't seem to be any best practice policy for a forgotten
username.
The options I've seen on other sites are:
1 Input email address and send it - this is the most straightforward, but
I'm uncomfortable about sending the username to the email address.
2 Input email address and send a single use, expiring link which displays
the username - but after it's expired or been used, it obviously won't
work anymore.
3 Similar to 3, but merge it with the change password process - if the
user forgets their username, they get to see their username, but they have
to reset their password too.
The user table doesn't have any other info set up within it (security
question, date of birth, etc) - so I can't ask for any of this information
without adding it retrospectively. But I'd appreciate any advice or views
others have on how they have either implemented it, or how they think it
should be implemented :).

Tuesday, 10 September 2013

Add Product to the Cart using Product ID Programmatically

Add Product to the Cart using Product ID Programmatically

I got this problem i cant solve it
I have an Array of name proidArray in this i have some products IDs
<?php for($i=0;$i<sizeof($proidArray);$i++){
echo $proidArray[$i];
} ?>
Its displaying all Product IDs in the array But actually my goal you can
see here
<?php for($i=0;$i<sizeof($proidArray);$i++) { ?>
<button type=-"button" class="button btn-cart" id="<?php echo
$proidArray[$i]; ?>" onclick="productAddToCartForm.submit(<?php echo
$proidArray[$i]; ?>)">
<span>Add To Cart</span>
</button>
<?php } ?>
Its displaying in Frontend like this

If i click first Add To Cart button means first product should add to the
cart ..
If i click second button means second product should be add to cart
Any thing wrong i did here ?
Any ideas ?

Issue viewing cells in excel vba

Issue viewing cells in excel vba

I have an excel sheet with macros in it. I face two issues here. 1. On
opening of the sheet I am selecting the cell A11. However, onve I move to
other cells the columns A, B and C disappear. In fact, if I do not select
A11 on opening of the sheet, the colums from A to C are not visible and
the sheet is moved to the left. Please suggest how to avoid this. 2.
Another problem that I have is when I go to sheet2 from sheet1 using the
following code Worksheets("sheet2").Select
sheet hangs for a second and the title text appears twice but as you
scroll down, everything is back to normal.

how to disable spring security authentication on just a few methods

how to disable spring security authentication on just a few methods

I have spring basic authentication implemented, but there are a few urls
which I don't want to be authenticated. For example,
http://www.mywebsite.com/rest/signUp
How to I make this unauthenticated?
@Transactional
@RequestMapping(value = "/signUp", headers =
"Accept=application/json", produces =
MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
public @ResponseBody String signUp(@RequestParam("user_name") String
login,
@RequestParam("pass_word") String passWord,
@RequestParam("first_name") String firstName,
@RequestParam("last_name") String lastName,
@RequestParam("network_name") String networkName,
@RequestParam("email") String email) {
if(!userDAO.loginExists(login)) {
User user = new User();
user.setLogin(login);
user.setFirstName(firstName);
user.setLastName(lastName);
user.setNetworkName(networkName);
user.setEmail(email);
user.setPassword(passWord);
sessionFactory.getCurrentSession().save(user);
return json("success");
}
return json("failure");
}

Add an object to a java arraylist only if it isn't already there

Add an object to a java arraylist only if it isn't already there

I have an arrayList that I want to add to, as long as the value isn't
already stored in it. For example if my array is like this:
H
LK
KL
LS
And I have the value LS, it wouldn't be added. But if the value was A, it
would be.
I was thinking that the code should look something like this:
value = A;
no = 0;
for (int o; arraylist.length; o++)
if (arraylist.get(o).equals(value)){
continue;
}else{
no++;
}
}
if (arraylist.length = no){
arraylist.add(value);
}
But there has to be an easier way to do it. Does anyone know a more
concise way to do this?