Demonstrate responsive web design
Filed Under (Others) by admin on 16-04-2012
Demonstrate responsive web design using jamus http://jamus.co.uk/demos/rwd-demonstrations/
Demonstrate responsive web design using jamus http://jamus.co.uk/demos/rwd-demonstrations/
We always encounter them on our JavaScript apps, the dynamic elements, most of the time they are in the form of new rows in the table <tr><td></td></tr> or a new list <li> from a <ul>.
So sometimes we need to capture an event to these newly loaded dynamic elements, and the solution in jquery is to use the live function.
Alternatively we can also use the covered by the parent technique, so if the parent of the dynamic element is loaded manually, we can just capture the event by this code.
$('ul').on('click','li',function(){
alert('Has been clicked.. Do something next');
})
With the code on top we have eliminated the use of making this line
$('li').live('click',function(){
alert('Has been clicked.. Do something next');
});
because the event for <li> has been covered by the parent <ul>.
To display the executed query using the codeigniter database class
insert the line of code below
echo $this->db->last_query();
$this->db->last_query(); //returns the last executed query
————————————————————————————————-
So if your code is like this
$this->db->select('*');
$this->db->from('sales');
$query = $this->db->get();
echo $this->db->last_query();
// Adding echo $this->db->last_query(); will output the query on the page like this
// SELECT * FROM sales;
Here we will use the find -mtime and xargs commands
Complete script:
find '/home/user/data/' -name '*.txt' -mtime +7 | xargs rm
Explanation:
find -mtime displays files made based on given number of days
find '/home/user/data/' -name '*.txt' -mtime +7
xargs captures the result of a previous command and pass it as an argument for another function
find '/home/user/data/' -name '*.txt' -mtime +7 | xargs rm
The result of the find command is passed to another function rm which then removes the files
mysqldump -u username -p Password database_name | gzip > database_backup.sql.gz
When we backup we want to add a date on the filename to know when the file was created
Try this line
tar -zcvf database_backup_$(date +%m-%d-%Y).tar.gz /DB/data
I have just stumbled on this performance tip so I tried and tested it, so far the results were good there are some speed improvement on my jquery codes.
Optimize selectors for Sizzle’s ‘right to left’ model
As of version 1.3, jQuery has been using the Sizzle Javascript Selector Library which works a bit differently from the selector engine used in the past. Namely it uses a ‘right to left’ model rather than a ‘left to right’. Make sure that your right-most selector is really specific and any selectors on the left are more broad:
var linkContacts = $(‘.contact-links div.side-wrapper’);
instead of:
var linkContacts = $(‘a.contact-links .side-wrapper’);
More tips from this website
http://dumitruglavan.com/jquery-performance-tips-cheat-sheet/
Example errors:
“Duplicate entry ’123711155′ for key ‘PRIMARY’” or “Duplicate entry ’14676163′ for key ’1′”
Most likely this happens for tables with more than 5 million records
THE FIX
The fix is to use repair table
REPAIR TABLE <TABLE_NAME>;
Note: Sometimes the duplicate error is also caused by your field type having the maximum value already, for example in tinyint which has the maximum value of 127 so it better to use bigint for your auto ids, if this is not the case you can try the solution above.
Use Java Array Length.
Example:
String months[] = {"Jan", "Feb", "Mar", "Apr", "May",
"Jun", "July", "Aug", "Sep", "Oct", "Nov", "Dec"};
System.out.println(months.length);
Value of months.length is equal to 12
Check if your laptop is fully compatible with ubuntu
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |
Source: Jobs at Lexmark |