
Search In
In update records can be updated using write(), it takes a list of records to update and a mapping of updated fields to values similar to create() .for example code is like below.
models.execute_kw(db, uid, password, 'res.partner', 'write', [[id], {
Remove text from a textbox on focus and getting the text again after loosing focus
Use below .aspx code to make a textbox remove the default text on focus and again get the default text if the user leaves the textbox blank.
<asp:TextBox ID="txtS
Below is the code to get remaining months between two dates
date1 = '2011-03-31'
date2 = '2011-02-25'
(date1.to_date.year * 12 + date1.to_date.month) - (date2.to_date.year * 12 + date2.to_date.month)
Above will gi
To copy the image on NSPasteBoard following code can be used:
- (IBAction)paste:sender
{
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
NSArray *classArray = [NSArray arrayWithObject:[NSImage class]];
NSDiction
During User registration it is very necessary to check that entered email id is valid or not. To check that following code will help you.
- (BOOL)validateEmailWithString:(NSString*)email
{
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za
The following code will get the cookies form the sever and will store in the array.
Get the appropriate cookie from the array by its name.
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage s
Sometime we don't know name of the method at compile time. So pass the method name as argument and use the following lines of code.
NSString *methodname=@"calltest";
SEL aSelector = NSSelectorFromString(methodname);
NSInvocation *inv = [NSInvocatio
If you are unable to get newly added database column in cakephp, then use the below code.
Go to app / Config.php then set
Configure::write('debug',0);
to
Configure::write('debug',2);
Refresh you window and again set
Hello all,
If you want to delete all directory and files recursively by using php script, for this please follow the below mentioned code.
<?php
function deleteDirectory($filename) {
if(is_dir($filename))
$handle = opendir($filename);
i
Inline styles have the highest priority of all CSS. In general, I would recommend you avoid using them and place your CSS declarations in external files. However, you may not have that luxury if you are working on a legacy system or do not have direc
