Author Archives: Yash

QShortcut , QKeySequence and variable name as SLOT example code

QShortcut , QKeySequence and variable name as SLOT example code QShortcut *m_shortcutHiddenFunct = new QShortcut(QKeySequence(tr("Ctrl+M")),this); // m_shortcutHiddenFunct->setKey(key);   connect(m_shortcutHiddenFunct,SIGNAL(activated()) ,this, SLOT(on_shortcut_HiddenFunc_triggered()));   // m_shortcutHiddenFunct->setKey( QKeySequence(tr("Ctrl+m")));   QHash< QString, QHash<QString,QString> > mapper;   QHash<qstring , QString> bookmark; bookmark.insert("Next","Ctrl+N"); bookmark.insert("Previous","Ctrl+J");   mapper.insert("bookmark",bookmark); … Continue reading

Posted in Qt Tagged ,

Mootools form submit error

Mootools form submit error : %5Bobject%20Object%5D. You should set send before sending, like this: $(’form’).set(’send’,{ onFailure:function(){console.log(’Error’)}, onComplete: function() { console.log(’Data saved sucessfully!’) }   });   $(’form’).send();

Posted in Javascript, MooTools

How to Import export MySQL database from command line

export mysqldump -u username -p databasename > filename.sql import mysql -u username -p databasename < filename.sql

Posted in MySQL

Check for undefined JavaScript variable

The typeof operator The “typeof” operator in JavaScript allows you to probe the data type of its operand, such as whether a variable is string, numeric, or even undefined. The below simple example alerts the data type of the variable … Continue reading

Posted in Javascript

Set html in all elements having same ids using Jquery

  //sets html in all ids across the page $(’[id^="'+id+'"]‘).html();

Posted in Javascript, Jquery

My Bookmark links

General http://adapt.960.gs/ http://speckyboy.com/2011/04/11/50-free-psd-ui-kits-and-templates-for-web-designers/ http://www.designkindle.com/category/graphics/ http://speckyboy.com/ http://javascriptmvc.com/ http://getqualitycontrol.com/ http://code.google.com/p/sigil/ http://code.google.com/p/fop-miniscribus/ HTML5 http://www.whatwg.org/specs/web-apps/current-work/multipage/index.html#contents XML validator http://www.validome.org/xml/validate/ Misc https://github.com/mleibman/SlickGrid/wiki https://github.com/rnavarro/CakePHP-cPanel-API-Component/ http://www.openfaces.org/demo/treetable/TreeTable_basicFeatures.jsf http://nicolasgallagher.com/css-background-image-hacks/ http://www.smashingmagazine.com/2010/12/09/journalcrunch-wordpress-3-0-theme-free-theme-for-portfolios-and-magazines/ http://www.smashingmagazine.com/2010/12/23/free-icon-set-for-web-developers-coded/ http://procssor.com/process https://github.com/rnavarro/CakePHP-cPanel-API-Component/ https://github.com/mleibman/SlickGrid/wiki http://www.openfaces.org/demo/treetable/TreeTable_basicFeatures.jsf http://biasecurities.com/blog/2010/have-jquery-autocomplete-behave-like-google-suggest/

Posted in Featured

Get values inside JavaScript object

  //data is javascript object with unknown ids   //This loop with fetch all index name as well as their values for (var i in data) { alert(’theStatus[\''+i+'\'] is ‘ + data[i]) }

Posted in Javascript

Get multiple arrays values simultaneously in single loop

$a = array(1,2,4); $b = array(’a’,’b’,’c’);   foreach (array_map(null, $a, $b) as $v) { list($v1, $v2) = $v; echo $v1 . $v2 ; }

Posted in PHP, PHP-Tips

Set value in radio using jquery

$(“input:radio[name='name'][value=1]“.attr(‘checked’, true);

Posted in Javascript, Jquery

QMap in reverse order using QMapIterator

//Here’s how to iterate over the elements in reverse order: QMapIterator<int , QWidget *> i(map); i.toBack(); while (i.hasPrevious()) { i.previous(); qDebug() < < i.key() << ": " << i.value(); }   //If you want to find all occurrences of a … Continue reading

Posted in Qt Tagged