inline

Align the beginning of second line of text to the first one

天大地大妈咪最大 提交于 2019-12-08 04:00:29
问题 I show on my website posts in list items like in the following image: But as you can see above, the text on the second line it's starting from the beginning of the row and I would like to start it as the first one: Here is the HTML code: <li class="showPosts"> <span class="greekCross">✚</span> <h5>Hvordan ser jeg statistik omkring besøgende?</h5> </li> And the CSS: .showPosts { cursor: pointer; } .greekCross { color: #00BFF3; font-size: 15px; } .showPosts > h5 { font-size: 15px; display:

G++ won't accept inline constructors in C++

蓝咒 提交于 2019-12-08 03:45:49
问题 I have a problem, may be dumb. The thing is, I am unable to inline a constructor in a class. Consider I have a class called Foo. If I write the implementation of Foo something like this: class Foo { int p; public: Foo() { p = 1; } }; or even like this: class Foo { int p; public: Foo(); }; inline Foo::Foo() { p = 1; } The program won't compile. I use the class using the standard method: Foo obj; Now when I run g++ main.cpp foo.cpp, I get: /tmp/ccyVtxvp.o: In function `main': main.cpp:(.text

pc端 移动端 CSS以及 js的兼容

ⅰ亾dé卋堺 提交于 2019-12-08 02:18:03
什么是浏览器的兼容 浏览器兼容性问题又被称为网页兼容性或网站兼容性问题,指网页在各种浏览器上的显示效果可能不一致而产生浏览器和网页间的兼容问题。所以在网站的设计和制作中,做好浏览器兼容,才能够让网站在不同的浏览器下都正常显示。 1 块属性标签float后,又有横行的margin情况下,在ie6显示margin比设置的大 解决办法 : 在float的标签样式控制中加入 display:inline;将其转化为行内属性 2 设置较小高度标签(一般小于10px),在ie6,ie7,遨游中高度超出自己设置高度 解决办法 : 给超出高度的标签设置overflow:hidden;或者设置行高line-height 小于你设置的高度。 3 行内属性标签,设置display:block后采用float布局,又有横行的margin的情况,ie6间距bug 解决办法 在display:block;后面加入display:inline;display:table; 4 图片默认有间距 解决办法 使用float为图片布局 5 标签最低高度设置min-height不兼容 决绝办法 如果我们要设置一个标签的最小高度200px,需要进行的设置为: {min-height:200px; height:auto !important; height:200px; overflow:visible;} 6

Remove inner space in h1 tag

若如初见. 提交于 2019-12-08 01:57:09
问题 Hi im a beginner in HTML and CSS! Im trying to get the proper alignment of a logo and a title . Both of them should be on the same line. The problem is that i cant remove the inner space of the h1 and there is always a margin on top of the text (if i color the bg for the h1, i see that it extends further above the text). Is there a way to solve this or am i doing it wrong? I want both of them to be exactly the same height and in the exact same horizontal position (the top of the "T" in title

Run Time Inlining in C#?

帅比萌擦擦* 提交于 2019-12-07 23:29:28
问题 A couple of questions on C# Does C# support runtime inlining? Does JIT's optimizate before or during the execution of the code? Can a virtual function be inlined? 回答1: C# the language doesn't do inlining, but the .NET CLR JIT compiler can. Virtuals might be inline-able in a sealed class, but I'm not sure about non-sealed classes. I would assume not. JIT optimizes before the execution of the code, when a function is first called. Because before the JIT goes to work, you don't have any code to

题解 [51nod1340]地铁环线

☆樱花仙子☆ 提交于 2019-12-07 22:37:39
题解 [51nod1340]地铁环线 题面 解析 本文参考这篇博客 一开始看到只有120行就打算写一写, 结果一刚就是三个星期 摆摆摆 本来是当查分约束入门学的. step 1 首先来考虑下如果已知总长度 \(s\) 如何判断是否合法. 显然差分约束 对于 \(dis(x,y)>=w\) 这个式子等价于 \(dis[x]+w<=dis[y]\) , 即 \(dis[y]+(-w)>=dis[x]\) . 因此, 若 \(x<y\) ,则 \(y\) 向 \(x\) 连一条边权为 \(-w\) 的边. 若 \(x>y\) ,则 \(y\) 向 \(x\) 连一条边权为 \(s-w\) 的边(要绕一圈,yy一下就知道了). 对于 \(dis(x,y)<=w\) 这个式子就是 \(dis[x]+w>=dis[y]\) . 若 \(x<y\) ,则 \(x\) 向 \(y\) 连一条边权为 \(w\) 的边. 若 \(x>y\) ,则 \(x\) 向 \(y\) 连一条边权为 \(s+w\) 的边. 又因为边权至少为 \(1\) ,即 \(dis[x]+1<=dis[y]\) . \(dis[y]+(-1)>=dis[x]\) . 因此 \(i+1\) 要向 \(i\) 连一条边权为 \(-1\) 的边(n-1要特判) 最后,跑n-1边Bellman_Ford, 若还能进行松弛操作

C++中的 .h 和 .cpp 区别详解

橙三吉。 提交于 2019-12-07 19:08:47
在C++编程过程中,随着项目的越来越大,代码也会越来越多,并且难以管理和分析。于是,在C++中就要分出了头(.h)文件和实现(.cpp)文件,并且也有了Package的概念。 对于以C起步,C#作为“母语”的我刚开始跟着 导师 学习C++对这方面还是感到很模糊。虽然我可以以C的知识面对C++的语法规范,用C#的思想领悟C++中类的使用。但是C#中定义和实现是都在一个文件中(其实都是在类里面),而使用C的时候也只是编程的刚刚起步,所写的程序也只要一个文件就够了。因此对于C++的Package理解以及.h文件和.cpp文件的总是心存纠结。 幸好有详细的 PPT 让我了解,一次对于Package的认识就明白多了。简单讲,一个Package就是由同名的.h和.cpp文件组成。当然可以少其中任意一个文件:只有.h文件的Package可以是接口或模板(template)的定义;只有.cpp文件的Package可以是一个程序的入口。 当然更具体详细的讲解,欢迎下载导师的教学 PPT-Package 来了解更多。 不过我在这里想讲的还是关于.h文件和.cpp文件 知道Package只是相对比较宏观的理解:我们在项目中以Package为编辑对象来扩展和修正我们的程序。编写代码时具体到应该把什么放到.h文件,又该什么放在.cpp文件中,我又迷惑了。 虽然Google给了我很多的链接

Metamorphic Example Code

a 夏天 提交于 2019-12-07 17:10:29
So I've been working on implementing the metamorphic code example from James Holderness found here: Metamorphic Code Examples . #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <time.h> #define PUSH 0x50 #define POP 0x58 #define MOV 0xB8 #define NOP 0x90 #define ADD 0x01 #define AND 0x21 #define XOR 0x31 #define OR 0x09 #define SBB 0x19 #define SUB 0x29 #define JUNK asm __volatile__(PUSH,NOP,NOP,NOP,NOP,NOP,NOP,NOP,NOP,POP) #define JUNKLEN 8 const unsigned char prefixes[] = {ADD, AND, XOR, OR, SBB, SUB, 0}; unsigned char *code; int codelen; void readCode

【模板】LCT

点点圈 提交于 2019-12-07 13:26:29
LCT: 动态维护一个森林。支持删边,加边,查询链信息等很多操作。 由若干棵$Splay$组成,每棵$Splay$维护一条链,以深度作为关键字。 也就是说$Splay$的中序遍历相当于从上到下遍历这条链。 $Splay$中的边是实边,将两个$Splay$相连的边是虚边。 实边的父亲有它这个儿子(双向关系),虚边的父亲没有它这个儿子(单向关系)。 组成$LCT$的基础操作: (以下均认为$LCT$中只有一棵树) $access(x)$:打通根到$x$的路径,使一棵包含且仅包含根到$x$这条链上点的$Splay$出现。 实现方法: 1.$splay(x)$:将$x$转到当前$Splay$的根。(此时$x$是该$Splay$中最深的点,没有右儿子) 2.$c[x][1]=y$:将$x$的右儿子设为刚才操作的$Splay$的根。 3.$x=f[x]$:继续操作$x$在原树中的父亲,若$x$已经为根则退出。 $makeroot(x)$:使$x$成为根。 实现方法: 1.$access(x)$。 2.$splay(x)$。 3.翻转整棵$Splay$。 为什么不能只翻转$x$的左右儿子:一个链提末端点当根之后整个链的深度顺序全部翻转。 如:$1-2-3$翻转后为$3-2-1$而不是$3-1-2$。 $findroot(x)$:找$x$所在原树的根。 实现方法: 1.$access(x)$。 2

<C++实践系列>C++中的模板(template)

馋奶兔 提交于 2019-12-07 13:04:31
1. 简介 模板是C++在90年代引进的一个新概念,原本是为了对容器类(container classes)的支持 [1] ,但是现在模板产生的效果已经远非当初所能想象。 简单的讲,模板就是一种参数化(parameterized)的类或函数,也就是类的形态(成员、方法、布局等)或者函数的形态(参数、返回值等)可以被参数改变。更加神奇的是这里所说的参数,不光是我们传统函数中所说的数值形式的参数,还可以是一种类型(实际上稍微有一些了解的人,更多的会注意到使用类型作为参数,而往往忽略使用数值作为参数的情况)。 举个常用的例子来解释也许模板就从你脑袋里的一个模糊的概念变成活生生的代码了: 在C语言中,如果我们要比较两个数的大小,常常会定义两个宏: #define min(a,b) ((a)>(b)?(b):(a)) #define max(a,b) ((a)>(b)?(a):(b)) 这样你就可以在代码中: return min(10, 4); 或者: return min(5.3, 18.6); 这两个宏非常好用,但是在C++中,它们并不像在C中那样受欢迎。宏因为没有类型检查以及天生的不安全(例如如果代码写为min(a++, b--);则显然结果非你所愿),在C++中被inline函数替代。但是随着你将min/max改为函数,你立刻就会发现这个函数的局限性 ——