size

How to display fixed image height and width using xsl-fo with apache fop 0.95

北城余情 提交于 2019-12-04 16:51:12
问题 I am trying to fix the height and width of image in pdf generated using fop 0.95. Here is the code used for it <fo:external-graphic src="s\image.png" height="2.00in" width="2.00in"/> Following also does not work <fo:external-graphic src="s\image.png" content-height="scale-to-fit" height="2.00in" content-width="2.00in"/> These gives us the image that is governed by width . In summary I am trying to stretch the image rather than keeping the aspect ratio using fop 0.95.Does any one have idea for

Is there an alternative to background-size:cover?

佐手、 提交于 2019-12-04 14:40:02
问题 When using Chrome in particular, it creates a significant scrolling lag and also affects animations on the page and makes them stutter really badly. So is there an alternative to background-size:cover? I have tried a couple things including the plugin jQuery backstretch but it actually created just as much lag as background-size:cover. 回答1: I searched for this forever, and I finally figured this out. It's only a solution for mobile, however. (Sorry for reviving an old post): /* portrait */

System bar size on android tablets

谁都会走 提交于 2019-12-04 14:18:18
问题 I've got the problem that I need the height of the android tablet system bar. It's the same problem as over here, but I cant use this answer, because it gives me the same size as from the DisplayMetrics. At both ways I get the resolution with this bar allready calculated in it. (This problem doesnt appear at my smartphone, just on my tablet). 回答1: // status bar (at the top of the screen on a Nexus device) public static int getStatusBarHeight(Context context) { Resources resources = context

jqGrid and JQuery UI tabs showing grids expanded only on primary tab (div)

穿精又带淫゛_ 提交于 2019-12-04 13:46:52
I have added some grids (jqgrid) to a jQuery UI Tabs object. All the grids on the Tabs child that is expanded by default, displays perfectly. But the grids on the Tab children that are NOT expanded by default, permanently shows the jqGrid small (jqgrid with autowidth=true). Any ideas? Thanks! See http://www.revolucion7.com/wp-content/uploads/2009/10/jqgridp1.JPG On other words ... I have two tabs on a page with jqgrids on each one. Both jqgrids have autowidth property set, the problem is when page loads the first grid is adjusted to the size of the container but when i clicked the second tab

Casting structure pointers between structs containing pointers to different types?

你说的曾经没有我的故事 提交于 2019-12-04 13:40:39
I have a structure, defined by as follows: struct vector { (TYPE) *items; size_t nitems; }; where type may literally be any type, and I have a type-agnostic structure of similar kind: struct _vector_generic { void *items; size_t nitems; }; The second structure is used to pass structures of the first kind of any type to a resizing function, for example like this: struct vector v; vector_resize((_vector_generic*)&v, sizeof(*(v->items)), v->nitems + 1); where vector_resize attempts to realloc memory for the given number of items in the vector. int vector_resize (struct _vector_generic *v, size_t

How to handle the height of the tab title in JTabbedPane

依然范特西╮ 提交于 2019-12-04 13:07:49
I am preparing a window with some horizontal tabs using JTabbedPane, Tabs And window are prepared properly. Now I need to setup these tabs in level basis, based on my requirement (My logic returns integer value based on that I need to setup levels ). Levels look like : Can you please advise? Just the sight of screenshot: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TabHeightTest { public JComponent makeUI() { JTabbedPane tabbedPane = new JTabbedPane( JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT); tabbedPane.setUI(new javax.swing.plaf.basic.BasicTabbedPaneUI(

[转] C++ explicit关键字详解

北城以北 提交于 2019-12-04 12:21:26
本文转自 tiankong19999 首先, C++中的explicit关键字只能用于修饰只有一个参数的类构造函数, 它的作用是表明该构造函数是显示的, 而非隐式的, 跟它相对应的另一个关键字是implicit, 意思是隐藏的,类构造函数默认情况下即声明为implicit(隐式). 那么显示声明的构造函数和隐式声明的有什么区别呢? 我们来看下面的例子: 1 class CxString // 没有使用explicit关键字的类声明, 即默认为隐式声明 2 { 3 public: 4 char *_pstr; 5 int _size; 6 CxString(int size) 7 { 8 _size = size; // string的预设大小 9 _pstr = malloc(size + 1); // 分配string的内存 10 memset(_pstr, 0, size + 1); 11 } 12 CxString(const char *p) 13 { 14 int size = strlen(p); 15 _pstr = malloc(size + 1); // 分配string的内存 16 strcpy(_pstr, p); // 复制字符串 17 _size = strlen(_pstr); 18 } 19 // 析构函数这里不讨论, 省略... 20 }; 21

SQL Server - Is it possible to find the size actually used in an MDF or LDF file

假装没事ソ 提交于 2019-12-04 11:00:35
When adding a .MDF ( .NDF ) or .LDF file to a SQL Server, we have the option to set its initial size, auto-growth, and incremental (percent or absolute). After the database is in operation for a while, is it possible find how much of the actual size is used by the data? For example, if the actual size of the file is 5M, but only 2M is used to store the data, the file can still take 3M of data before it needs to grow. I need a way to find out the "2M" (used size) in the total current size (5M) of the file. Song Li After some research, I noticed the FILEPROPERTY function. SELECT FILEPROPERTY

How to present a view controller with smaller size

点点圈 提交于 2019-12-04 10:40:15
I want presented view controller vc2 in smaller size than the screen, how to do that in Swift 3 ?? Thanks for help. This is my code: @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "Controller2") as! ViewController2 vc2.modalPresentationStyle = .currentContext present(vc2, animated: true, completion: nil) } Try this.. @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "Controller2") as! ViewController vc2.providesPresentationContextTransitionStyle

File Upload Size Validation

心已入冬 提交于 2019-12-04 09:49:08
Validations are a big problem, as if i validate in php it has all the functions etc i need to make it work.. But it uploads the file first on a temporary location and then checks, which sucks. If someone uploads a file of 100mb he has to wait for the time just to get no error, but just some internal php screw up hanging the page. One Way: JS //file is id of input file alert(document.getElementById('file').files[0].fileSize); This works in firefox, safari, chrome i guess too, NOT: In opera, quite sure IE too but IE can be taken care of by ActiveX file size but Opera i am still stuck. So pretty