options

Select box with first option empty

妖精的绣舞 提交于 2019-12-03 06:41:16
问题 Does anybody know how can I set in my select box the first option to empty value? I'm getting the data from my DB, and I would like to set the option by default as "Please select one option". 回答1: I found that 'default'=>'Please select' doesn't work with the HTML5 required attribute. This does work: $listOfValues = [1 => 'Choice 1']; Form::select('fieldname',[null=>'Please Select'] + $listOfValues); If you don't like modern PHP syntax, $listOfValues = array(1 => 'Choice 1'); $listOfValues

Rule of thumb on when to use WITH RECOMPILE option

旧巷老猫 提交于 2019-12-03 05:46:25
I understand that the WITH RECOMPILE option forces the optimizer to rebuild the query plan for stored procs but when would you want that to happen? What are some rules of thumb on when to use the WITH RECOMPILE option and when not to? What's the effective overhead associated with just putting it on every sproc? As others have said, you don't want to simply include WITH RECOMPILE in every stored proc as a matter of habit. By doing so, you'd be eliminating one of the primary benefits of stored procedures: the fact that it saves the query plan. Why is that potentially a big deal? Computing a

how can I get all the abbreviations of vim's options?

与世无争的帅哥 提交于 2019-12-03 05:28:31
Such as I can use :set nu as :set number Where can I get the whole list of this kind of mapping (number -> nu) ? Or can I define new abbreviations? List of options in Vim 8.0 Grepping lines matching ^\s*\*'\w\+'\* in options.txt from vim help, and removing words not surrounded with quotes provides the following list. It has to be tweaked a bit because for conceallevel the help line is not like the others, for some options they span on two lines, etc so this list cannot, alas, be generated automatically. You can reach the help section for any option with :help 'optionname' . Note for all

How to implement options hashes in Ruby?

你。 提交于 2019-12-03 04:51:27
How can I implement options hashes? How is the structure of a class that has option hashes in it? Say I have a person class. I want to implement a method such as my_age that when called upon will tell me my age using options hashes. JtoTheGoGo You could do something like this: class Person def initialize(opts = {}) @options = opts end def my_age return @options[:age] if @options.has_key?(:age) end end and now you're able to call to the age like this p1 = Person.new(:age => 24)<br/> p2 = Person.new p1.my_age # => 24<br/> p2.my_age # => nil class Person def birth_date Time.parse('1776-07-04')

Stop default Autocomplete behavior when hitting spacebar in Visual Studio 2015

倖福魔咒の 提交于 2019-12-03 04:33:38
NOTE The keyword here is "default". I know I can hit escape and the default behavior gets aborted. I don't want to hit the escape key every time the IDE thinks it knows what I want. I didn't have to do this in 2013. ADDENDUM 2 It seems I'm still having difficulty communicating what I'm after here. What I want to happen is nothing when I press the space bar... I just want a space character to show up on my screen. The only time I want the IDE to actually insert a suggestion is when I hit the tab bar. I hope that's clearer? This is driving me nuts. 2013 and before allowed you to set completion

Adding optgroups to select using javascript dynamically

℡╲_俬逩灬. 提交于 2019-12-03 03:01:22
I have a dynamically populated (by ajax) select box with resulting options like that: <select id="destination" name="destination"> <option value="london-paris">London-Paris</option> <option value="paris-london">Paris-London</option> <option value="london-newyork">London-New-York</option> <option value="newyork-london">New-York-London</option> <option value="london-berlin">London-Berlin</option> <option value="berlin-london">Berlin-London</option> <option value="london-helsinki">London-Helsinki</option> <option value="helsinki-london">Helsinki-London</option> ... there are actually more of them

Select box with first option empty

风流意气都作罢 提交于 2019-12-02 20:22:06
Does anybody know how can I set in my select box the first option to empty value? I'm getting the data from my DB, and I would like to set the option by default as "Please select one option". I found that 'default'=>'Please select' doesn't work with the HTML5 required attribute. This does work: $listOfValues = [1 => 'Choice 1']; Form::select('fieldname',[null=>'Please Select'] + $listOfValues); If you don't like modern PHP syntax, $listOfValues = array(1 => 'Choice 1'); $listOfValues[null] = 'Please Select'; Form::select('fieldname', $listOfValues); But the point is to have a label for the

Possible to print more than 100 rows of a data.table?

跟風遠走 提交于 2019-12-02 17:51:40
The data.table has a nice feature that suppresses output to the head and tail of the table. Is it possible to view / print more than 100 rows at once? library(data.table) ## Convert the ubiquitous "iris" data to a data.table dtIris = as.data.table(iris) ## Printing 100 rows is possible dtIris[1:100, ] ## Printing 101 rows is truncated dtIris[1:101, ] I often have data.table results that are somewhat large (e.g. 200 rows) that I just want to view. The print method of data.table has an argument nrows : args(data.table:::print.data.table) function (x, nrows = 100L, digits = NULL, ...) You can use

Options, Settings, Properties, Configuration, Preferences — when and why?

偶尔善良 提交于 2019-12-02 13:49:31
There are several words with similar (in some sense) meaning: Options, Settings, Properties, Configuration, Preferences English is not my native language. Could you explain the difference in simple English please? I think the following template could be useful: Use XXX in your GUI in order to let people change behaviour of your application (maybe preferences or settings?) Use YYY in your GUI in order to let people change parts of an object (perhaps properties or options?) Use ZZZ in your code ... What are best practices? Tricky, this, as there's no one single consistent style followed by all

Is that possible to assemble several options and pass to the plot function in matlab

那年仲夏 提交于 2019-12-01 18:47:18
I am using matlab to plot several figures and hope these figure use the same plot options. To be more specific, it looks something like this. N = 20; Fs = 200; t = (0:N-1)/Fs; x = sin(2*pi*10*t); y = cos(2*pi*20*t); z = x + y; figure(1),clf; subplot(311); plot(t, x, 'bs-', 'MarkerFaceColor', 'b', 'LineWidth', 3); grid on; subplot(312); plot(t, y, 'bs-', 'MarkerFaceColor', 'b', 'LineWidth', 3); grid on; subplot(313); plot(t, z, 'bs-', 'MarkerFaceColor', 'b', 'LineWidth', 3); grid on; You can see the plot options are exactly the same. If I want to change the style, I have to change each of them.