inline

“set -o noglob” in bash shell script

元气小坏坏 提交于 2019-12-04 14:30:21
问题 I would usually write SQL statements inline in a Bash shell script to be executed in SQLPlus as- #! /bin/sh sqlplus user/pwd@dbname<<EOF insert into dummy1 select * from dummy2; commit; exit; EOF This would work just fine and will insert rows into dummy1 when executed. A colleague of mine came to me the other day with a script like below (simplified) #! /bin/sh sqlvar="insert into dummy1 select * from dummy2;commit;" echo $sqlvar|sqlplus user/pwd@dbname The issue with this is when executed

Why is F#'s Seq.sortBy much slower than LINQ's IEnumerable<T>.OrderBy extension method?

荒凉一梦 提交于 2019-12-04 12:33:00
问题 I've recently written a piece of code to read some data from a file, store it in a tuple and sort all the collected data by the first element of the tuple. After some tests I've noticed that using Seq.sortBy (and Array.sortBy) is extremely slower than using IEnumerable.OrderBy. Below are two snippets of code which should show the behaviour I'm talking about: (filename |> File.ReadAllLines |> Array.Parallel.map(fun ln -> let arr = ln.Split([|' '|], StringSplitOptions.RemoveEmptyEntries) |>

html--前端css常用属性

心已入冬 提交于 2019-12-04 12:17:11
1、颜色属性   <div style="color:blueviolet">ppppp</div> 输入颜色英文单词   <div style="color:#ffee33">ppppp</div> 16进制颜色样式   <div style="color:rgb(255,0,0)">ppppp</div> 红绿蓝三原色按顺序   <div style="color:rgba(255,0,0,0.5)">ppppp</div> a代指透明度 2、字体属性:   font-size: 20px/50%/larger 字体大小   font-family:'Lucida Bright' 字体样式   font-weight: lighter/bold/border/ 字体粗细   line-height:40px; 字体上下调到居中位置   <h1 style="font-style: oblique">老男孩</h1> 斜体 3、背景属性     margin-bottom: 2px; padding: 0px; box-sizing: border-box; color: rgb(85, 84, 84); font-size: 15px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color:

how are abs, sign etc implemented in F#

一个人想着一个人 提交于 2019-12-04 12:11:03
问题 I found that: abs -10 abs -10L both work. So I wondered how F# implemented this and did a search in the source code: type AbsDynamicImplTable<'T>() = let AbsDynamic x = AbsDynamicImplTable<_>.Result x [<CompiledName("Abs")>] let inline abs (x: ^T) : ^T = AbsDynamic x when ^T : ^T = absImpl x And I am confused with these. As I know in a function like abs , we must compare the input with 0, and there are different 0s for different types. Thanks. 回答1: To add some explanation to the code posted

inline and good practices [duplicate]

十年热恋 提交于 2019-12-04 12:07:08
Possible Duplicate: When to use inline function and when not to use it ? I have seen many source codes using different syntaxes regarding the inline directive. namespace Foo { class Bar { public: // 1 - inline on the declaration + implementation inline int sum1(int a, int b) { return a + b; } // 2 - inline on template declaration + implementation template <typename T> inline T sum2(T a, T b) { return a + b; } // 3 - Nothing special on the declaration... int sum3(int a, int b); }; // 3 - But the inline directive goes after // In the same namespace and still in the header file inline int Bar:

模板

人盡茶涼 提交于 2019-12-04 10:46:40
一.字符串 1.kmp #include<bits/stdc++.h> #define re return #define inc(i,l,r) for(int i=l;i<=r;++i) using namespace std; template<typename T>inline void rd(T&x) { char c;bool f=0; while((c=getchar())<'0'||c>'9')if(c=='-')f=1; x=c^48; while((c=getchar())>='0'&&c<='9')x=x*10+(c^48) ; if(f)x=-x; } const int maxn=1e6+6; int n,m,p[maxn]; char s[maxn],ss[maxn]; inline void pre() { int j=0; p[0]=-1; inc(i,0,m-1) { j=p[i]; while(j!=-1&&ss[i]!=ss[j])j=p[j]; p[i+1]=((~j)?(ss[i]==ss[j]?++j:0):0); } } inline void kmp() { int j=0; inc(i,0,n-1) { while(j!=-1&&s[i]!=ss[j])j=p[j]; ++j; if(j==m) { printf("%d\n",i+1

“Microsoft Edge PDF inline issue” Same Issue Again

佐手、 提交于 2019-12-04 10:35:16
问题 I'm still having the same issue that was previously reported and answered under Microsoft Edge PDF inline issue even though I'm not using the pre-release version of Win 10, but the latest downloaded though Windows Update. After upgrading my Win 8.1 Machine to Win 10, and tested my ASP.NET application, I faced an issue with displaying inline pdf files. Here's my C# code in my ASP.NET application: Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.ContentType =

css list inline is not listing items horizontally?

☆樱花仙子☆ 提交于 2019-12-04 10:16:58
问题 I don't know why this is not displayed right, the list is meant to display horizontally? Instead it is displaying vertically! this is my code: #stats li { display: inline; list-style-type: none; padding-right: 20px; } <ul id="stats"> <li> <h1>53</h1> </a> </li> <li> <h1>67</h1> </a> </li> </ul> 回答1: You forgot to add float: left property to your CSS: #stats li { display: inline; list-style-type: none; padding-right: 20px; float: left; } By the way, you are missing opening a tag in your HTML

Do c++11-compatible compilers always ignore inline hints?

社会主义新天地 提交于 2019-12-04 09:10:56
Reading an old answer on When should I write the keyword 'inline' for a function/method? that says: It is said that inline hints to the compiler that you think the function should be inlined. That may have been true in 1998, but a decade later the compiler needs no such hints. Not to mention humans are usually wrong when it comes to optimizing code, so most compilers flat out ignore the 'hint'. This answer was posted in 2009 so I want to figure it finally out: Do modern c++11-compatible compilers always ignore inline hints specified by user and do this only automatically? Do inline hints only

Replace part of a string in a Struts2 tag

情到浓时终转凉″ 提交于 2019-12-04 09:07:56
Is it possible to replace the value of a property in Struts2? I want to resolve a mimetype image, and it would be really useful to do something like: <img src="<s:property value='%{mimetype.replace("/", ".")}'/>" ... Can I do something on the fly like this? Thanks! <img src="<s:property value='%{mimetype.replace("/", ".")}'/> Yes it's possible ognl allows to use string mehthods directly 来源: https://stackoverflow.com/questions/6866514/replace-part-of-a-string-in-a-struts2-tag