work

keyboardWillShow will only work from the second time on

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a UITextView that I need to move up when the user focuses on it. In the simulator I have set up 2 keyboards (English,Greek) Within keyboardWillShow function I change the UITextView's height to be less than the existing one, as in self.page_text.frame = CGRectMake(self.page_text.frame.origin.x, self.page_text.frame.origin.y, self.page_text.frame.width, (notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as NSValue).CGRectValue().origin.y - 180) The problem is that only each first time I focus on the text view the keyboard

Setting up secure WebSocket server with Jetty and JavaScript client

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to setup a secure WebSocket server with Jetty like the following: import java.util.ArrayList; import java.util.List; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SslConnectionFactory; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty

How does “final int i” work inside of a Java for loop?

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I was surprised to see that the following Java code snippet compiled and ran: for ( final int i : listOfNumbers ) { System . out . println ( i ); } where listOfNumbers is an array of integers. I thought final declarations got assigned only once. Is the compiler creating an Integer object and changing what it references? 回答1: Imagine that shorthand looks a lot like this: for ( Iterator iter = listOfNumbers . iterator (); iter . hasNext (); ) { final int i = iter . next (); { System . out . println ( i ); } } 回答2: See @TravisG for an

Does ProGuard work with JavaEE 6 applications?

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to get Proguard to obfuscate a simple .war file. According to the docs Proguard handles .war files, but when I try I get this: Warning: class [WEB-INF/classes/com/corp/gr/t2b/T2BChannel.class] unexpectedly contains class [com.corp.gr.t2b.T2BChannel] The docs mention something about Proguard not liking .war files with classes in the WEB-INF/classes directory. So I put all the .class files in their own .jar file in WEB-INF/lib. Then Proguard complains that it cannot find any of the JavaEE 6 classes, even though I've given it the

Laravel 5.4 event broadcasting not work with vuejs

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want create a chat with laravel 5.4, vuejs and pusher api with Echo. I did it two time to communicate with pusher but i have no callback and my vue. I work in local with MAPM if its can help. i have install composer require pusher/pusher-php-server npm install --save laravel-echo pusher-js and my blade i put this <meta name="csrf-token" content="{{ csrf_token() }}"> in my bootstrap.js i have uncomment Echo and i have entry my pusher key import Echo from "laravel-echo" window.Echo = new Echo({ broadcaster: 'pusher', key: 'my-push-key' });

Ajax render attribute don&#039;t work in a h:dataTable in JSF2

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have some problem's with a simple application in JSF 2.0. I try to build a ToDo List with ajax support. I have some todo strings which I display using a datatable. Inside this datatable I have a commandLink to delete a task. The problem is now that the datatable don't get re-rendered. <h:dataTable id="todoList" value="#{todoController.todos}" var="todo"> <h:column> <h:commandLink value="X" action="#{todoController.removeTodo(todo)}"> <f:ajax execute="@this" render="todoList" /> </h:commandLink> </h:column> <h:column> <h:outputText value="#

work around for dictation / custom text view bug

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a view that implements UIKeyInput and overrides shouldBecomeFirstResponder to return YES . When this view is tapped, the keyboard pops up. If the user taps the dictation button, pushes done, and then tries to dismiss the keyboard, the app crashes with: Fatal Exception: NSInternalInconsistencyException NSInternalInconsistencyException We were never set up properly to stream in this document. I was wondering if anyone knows a work around to fix this bug? I tried implementing UITextInput and leaving dictation related methods blank and

python-协程gevent的使用

白昼怎懂夜的黑 提交于 2019-12-03 03:56:27
import geventfrom gevent import monkeyimport timeimport random# 有耗时操作时需要monkey.patch_all() # 将程序中用到的耗时操作代码,换为 gevent 中自己实现的模块def work(name): for i in range(10): print(name, i) time.sleep(random.random())gevent.joinall([ gevent.spawn(work, 'work1'), gevent.spawn(work, 'work2')])# 等价于'''g1 = gevent.spawn(work, 'work1')g2 = gevent.spawn(work, 'work2')g1.join()g2.join()''' 来源: https://www.cnblogs.com/fuyouqiang/p/11775772.html

Spring MVC 解读——@RequestMapping (2)

拈花ヽ惹草 提交于 2019-12-03 03:13:09
Spring MVC 解读——@RequestMapping 上一篇文章中我们了解了Spring如何处理@RequestMapping注解,并将请求映射信息保存到系统中以处理客户端发送来的请求,但是Spring是怎样接受请求,并根据请求URL来匹配正确的处理器方法呢,更重要的是Spring允许我们定义签名灵活的处理器方法,也就是说你的参数类型,顺序,返回类型都可以自定义,只要你方便就好。真的很棒,但是他怎样做到的呢? 这篇文章我们就研究这个问题。 一、重要的类和接口 HandlerMethodArgumentResolver 一个策略接口,根据请求解析处理方法的参数值(这是重点),我们就是通过实现它来自定义我们的参数类型的。Spring默认提供了十多个类型的解析器来处理常见的方法参数,如@PathVariabe,@RequestParam, Model,@ModelAttribute等等。 HandlerMethodReturnValueHandler 一个策略接口,用来处理处理器方法的返回值(重点啊), 我们通过实现它来自定义我们的返回类型 RequestMappingHandlerAdapter 一个HandlerAdapter的实现类,用来处理HandlerMethod,它包含了上面两个接口一系列实现类的列表,用于处理不同的参数和返回类型

Why does this Javascript not work in Firefox?

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to manipulate a date with some simple Javascript. The code is as follows: var newDate = new Date("2013-07-23" + " 12:00:00"); console.log(newDate.toString()); newDate = new Date(newDate.getTime() - (24 * 60 * 60 * 1000)); console.log(newDate.toString()); var date = newDate.getFullYear() + "-" + ("0" + (newDate.getMonth() + 1)).slice(-2) + "-" + ("0" + newDate.getDate()).slice(-2); console.log(date); Essentially, I am converting 2013-07-23 -> Jul 22 2013 12:00:00 GMT+1000 -> 2013-07-22 It works fine in Chrome, you can test the