FAQ Database Discussion Community


How Vaadin translates &Address to Alt+A using shortcut by a shorthand notation in AbstractField.FocusShortcut?

java,keyboard-shortcuts,vaadin,textfield,shorthand
reading this page of the Book of Vaadin: https://vaadin.com/book/vaadin7/-/page/advanced.shortcuts.html You can also specify the shortcut by a shorthand notation, where the shortcut key is indicated with an ampersand (&). // A field with Alt+A bound to it, using shorthand notation TextField address = new TextField("Address (Alt+A)"); address.addShortcutListener( new AbstractField.FocusShortcut(address, "&Address"));...

PHP: do this || that (like javascript)

javascript,php,short,shorthand
In javascript we can use || to perform a second action if the first one fails, like: function getObject(id_or_object) { var obj = document.getElementById(id_or_object) || id_or_object; return obj; } How can we do this in PHP? If we can't, I can swear I have seen this || used like this...

Is there a shorter (non-repetitive) way to create a list of the same float?

python,numpy,shorthand
Is it possible to write in shorthand the following: x = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] as say x = ([0.5]*12)? ...

Using in PHP [duplicate]

php,echo,shorthand
This question already has an answer here: What does '<?=' mean in PHP? 8 answers I was upgrading a client's site the other day and noticed that the previous developer had used <?=$foo?> to echo out variable $foo in the code. I know from my days in VBScript that...

shorthand for .load() ajax links with loader

javascript,jquery,html,ajax,shorthand
here's the structure of the code: http://jsfiddle.net/ss1ef7sq/ although it's not really working at js fiddle but the code itself is working as i've tested it locally through firefox. this is where i've based this on: http://html.net/tutorials/javascript/lesson21.php jquery/ajax: $('#ep-101').click(function(){$('.main-container').load('link.html #ep101').hide().fadeIn(800);}); $('#ep-102').click(function(){$('.main-container').load('link.html #ep102').hide().fadeIn(800);});...