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 HTML5 XML validator Misc

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