padding

Add “padding” to a UITextView

六眼飞鱼酱① 提交于 2019-12-03 04:43:59
问题 as the title says i am trying to add padding-like behavior to a UITextView. The textview is generated when the view is pushed inside my navigation controller and the following code occurs: self.textView.layer.cornerRadius = 7; //pretty stuff is pretty NSString *description = appDelegate.productInDisplay.description; [self.textView setText:description]; //pretty stuff has content now CGRect frame = textView.frame; frame.size.height = textView.contentSize.height; textView.frame = frame; //set

Why does the HTML5 DOCTYPE mess with my padding?

我怕爱的太早我们不能终老 提交于 2019-12-03 04:10:16
问题 I have an html5 page with a navbar. Completely scratch coded. I just recently added a doctype to the item, and now I’m getting extra space under my navbar. If I remove the doctype declaration, it goes back to normal. I have completely reset padding, margins, etc. on everything, and cut it down to the a small amount of code that illustrates the issue. The page can be seen at http://hackthetruth.org/webdesign/broken Does anyone know why declaring the doctype is messing with the height of a div?

Node.js crypto key and iv to match java SecretKeySpec / IvParameterSpec

此生再无相见时 提交于 2019-12-03 03:46:17
I'm trying to to port a Java (simple) encryption algorythm to Node JS. I will need to be able to decrypt/encrypt stuff encrypted/decrypted from the Java side. I'm stuck at the very beginning, the initialization of the cipher. In Java, I get the key with SecretKeySpec , and the Initialization Vector with IvParameterSpec : public CryptStuff(String password) throws zillion_exceptions { if (password==null) throw new InvalidKeyException("No encryption password is set!"); key = new SecretKeySpec(password.getBytes("UTF-8"), "AES"); cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); ivSpec=new

NinePatchDrawable does not get padding from chunk

喜欢而已 提交于 2019-12-03 03:07:17
I need help with NinePatchDrawable: My app can download themes from the network. Almost all things work fine, except 9-Patch PNGs. final Bitmap bubble = getFromTheme("bubble"); if (bubble == null) return null; final byte[] chunk = bubble.getNinePatchChunk(); if (!NinePatch.isNinePatchChunk(chunk)) return null; NinePatchDrawable d = new NinePatchDrawable(getResources(), bubble, chunk, new Rect(), null); v.setBackgroundDrawable(d); d = null; System.gc(); getFromTheme() loads the Bitmap from the SD card. The 9-Patch PNGs are already compiled, that means they include the required chunk. The way

java aes javax.crypto.BadPaddingException: Given final block not properly padded

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: public class AES { public String getEncrypt(String pass){ String password = encrypt(pass); return password; } public String getDecrypt(String pass){ String key = "AesSEcREtkeyABCD"; byte[] passwordByte = decrypt(key,pass); String password = new String(passwordByte); return password; } private byte[] decrypt(String key, String encrypted) { try { SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(), "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(skeySpec.getEncoded(), "AES")); /

Possible? ― A div overlay which is completely ignored by mouse events (so that mouse events effect only the div below)

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a google map in an iframe and wrapped in a div. Above that div, i have another, which serves to create a recessed shadow effect. The problem is that this overlayed div will take priority of any mouse events, so it renders the interactive google map below useless. There must be a way I can make the overlayed div ignore mouse events, letting the div below get them. (please, please!) Or, is there another way to do it? here's the code being output: <div id = "pageWrapper" style = " display : block ; " > <div class = "page

Media queries not working in Chrome but in Firefox? [closed]

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The site I'm currently working on isn't picking up my styling for devices under 480px in chrome but is working in firefox, chrome is picking up the media queries for 800px and 1200px and I cannot for the life of me figure out why it isn't picking up the 480px media query. Please see the stylesheet below. @media screen and (max-width:1200px) { .ui-tabs .tab { clear:both; height:386px; width:550px; margin:0 auto; } .ui-tabs .groundFloor { background:url(img/groundFloor_550.jpg) top center; } .ui-tabs .firstFloor { background:url(img/firstFloor

Raphael js. Fill color along a curve

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have created a circle in which I can choose two points along the circumference of of circle. I want to fill the portion between those two points. Demo If you see the demo, I want to fill the angle between two points. JS: (function (Raphael) { Raphael.colorwheel = function (x, y, size, initcolor, element) { return new ColorWheel(x, y, size, initcolor, element); }; var pi = Math.PI, doc = document, win = window, ColorWheel = function (x, y, size, initcolor, element) { size = size || 200; var w3 = 3 * size / 200, w1 = size / 200, fi = 1

Getting error “data too large for key size” with Crypto Node.js

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting the error "Error: error:0406C06E:rsa routines:RSA_padding_add_PKCS1_type_1:data too large for key size" when I do: var crypto = require('crypto'); var fs = require('fs'); var first_keys = { public_key: fs.readFileSync('tests/public.key'), private_key: fs.readFileSync('tests/private.key') } var first_result = crypto.privateEncrypt({ key: first_keys.private_key }, new Buffer("Hello World!")); var second_result = crypto.privateEncrypt({ key: first_keys.private_key }, first_result); var second_plaintext = crypto.publicDecrypt({ key:

How to change the tab pane style

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use the default JavaFX tab pane layout I want to display new tabs below the old ones. I don't want to display the default context menu to select which tab to display. Are there any options to change this? 回答1: try this....change it according your need.this is default css for tab pane and their layout... i used it and work sucessfully .tab-pane { -fx-skin: "com.sun.javafx.scene.control.skin.TabPaneSkin"; /* -fx-tab-min-width: 4.583em; 55 */ /* -fx-tab-max-width: 4.583em; 55 */ -fx-tab-min-height: 2em; /* 24 */ -fx-tab-max-height: 2em; /* 24