我为什么要使用"严格"的doctype vs"Transitional"?似乎"严格"就像它说的那样,更严格.我似乎很难适应工作(css)与使用过渡.
什么时候应该使用信号量,什么时候应该使用条件变量(CondVar)?
multithreading synchronization operating-system semaphore mutual-exclusion
例如:
StudentRegistrationService<>c__DisplayClass1<>f__AnonymousType56`2DocShareClassification<GetErrors>d__2我很确定这StudentRegistrationService<>c__DisplayClass1是一个闭包,并且<>f__AnonymousType56`2在指定匿名类型时生成,但我以前从未见过这个d__类.除了这些还有吗?
我正在创建一个应用程序,它采用许多大小相等的矩形并将它们放在屏幕上的网格中.我有大部分逻辑用于调整单元格中矩形的大小和居中,但我遇到了定义矩形必须符合的网格的实际部分的问题.
理想情况下,最后我会有这样的函数(伪代码):
function getGridDimensions (rect surface, int numItems, float hwRatio) {
// do something to determine grid-height and grid-width
return gridDimensions;
}
Run Code Online (Sandbox Code Playgroud)
我最初的抨击涉及到这样的事情:
gridHeight = surface.width / sqrt(numItems);
gridWidth = surface.height / sqrt(numItems);
Run Code Online (Sandbox Code Playgroud)
如果我的项目都是完美的正方形,这将很好地工作,但由于它们是矩形,每个单元格中有很多未使用的空白区域.
谷歌的任何想法或条款都可能指向我正确的方向?
我有一个小型的Spring MVC webapp(它嵌入了ActiveMQ),它设计用于在本地Tomcat中运行,并可靠地向远程ActiveMQ上的队列发送消息.
除了"可靠"之外,所有这些都已到位.目前,如果远程站点出现故障,则发送失败.我的发送配置:
<!-- Connection setup -->
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory"
p:brokerURL="tcp://backend-server-box:61616" />
<bean id="cachedConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory"
p:targetConnectionFactory-ref="connectionFactory"
p:sessionCacheSize="10" />
<!-- Bean that represents the correct destination on the backend server -->
<bean id="backendDestination" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="jmsQueueName" />
</bean>
<bean id="backendTemplate"
class="org.springframework.jms.core.JmsTemplate"
p:connectionFactory-ref="cachedConnectionFactory"
p:defaultDestination-ref="backendDestination" />
<!-- Bean that sends to the correct destination on the backend server -->
<bean id="simpleSender" class="uk.co.mycompany.client.messaging.SimpleSender">
<property name="jmsTemplate" ref="backendTemplate" />
</bean>
Run Code Online (Sandbox Code Playgroud)
我认为我需要的是一个本地的,持久的代理,connectionFactory(上面定义的第一个bean)指向,它知道远程代理(JMS到JMS桥?)如果有一些清晰的文档来处理这个问题我很高兴被指出,但我不得不把事情拼凑在一起,主要来自非常有帮助的BruceBlog.或任何直接的帮助都会很棒.
谢谢
更新.一些修复:
考虑一个PHP Web应用程序,其目的是接受用户启动通用异步作业的请求,然后创建一个工作进程/线程来运行该作业.作业不是特别占用CPU或内存,但预计会经常阻塞I/O调用.每秒应该启动不超过一个或两个作业,但由于运行时间长,可能会同时运行许多作业.
因此,工作并行运行至关重要.此外,每个作业都必须由负责杀死挂起的工作人员,根据用户请求中止工作人员等的经理守护程序进行监控.
实现这样的系统的最佳方法是什么?我可以看到:
我试图转置列表清单; 我的评论表明了思考过程.
(setq thingie '((1 2 3) (4 5 6) (7 8 9))) ;;test case
(defun trans (mat)
(if (car mat)
(let ((top (mapcar 'car mat)) ;;slice the first row off as a list
(bottom (mapcar 'cdr mat))) ;;take the rest of the rows
(cons top (trans bottom)))) ;;cons the first-row-list with the next-row-list
mat)
(trans thingie)
=> ((1 2 3) (4 5 6) (7 8 9)) ;;wait what?
Run Code Online (Sandbox Code Playgroud)
但是,我真的希望它成为
((1 4 7) (2 5 8) (3 6 9))
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
除了谷歌地图API之外,是否有任何网络服务(付费或免费)允许您反转地理编码?
我的特定应用程序将可以访问经度和纬度,我需要能够获得美国邮政编码或州.
我无法使用Google的原因是,服务条款似乎表明,如果您使用Google Maps API,则需要使用这些数据来显示Google地图.
我正在使用C#.Net框架,以防相关.
想象两个服务器(每个服务器在一个自己的jvm进程中)使用某种形式的消息进行通信(例如简单的生产者/消费者)
我想编写单元测试来测试这两个服务器的行为.
我的问题是:
这个问题是否有一些框架(或junit插件)?
我想在不同的进程中运行junit测试类(甚至是单个测试)?如果一个单元测试可以使用某种进程间通信轻松访问另一个测试的变量(在不同的进程中),那将会很酷.
例如,我想检查生产者是否真的生产了我预期的东西,然后,如果消费者消费它们.(也许做一些模糊测试来发现一些与种族有关的问题)
这种测试有一些最佳实践吗?
如果没有类似于单元的测试方法,那么在连续集成期间如何测试这些东西呢?
注意:
我不想使用线程,因为这可能会改变行为(如果你想到线程安全问题)
我已经创建了一个自定义管理模块,但是现在,我想要像管理客户一样拥有一个网格,具有相同的功能,这是为了维护后端中所有内容之间的标准,我发现我看起来越少......拜托,这里需要一只手
php ×2
.net ×1
algorithm ×1
asynchronous ×1
c# ×1
common-lisp ×1
gearman ×1
grid ×1
html ×1
java ×1
jms ×1
junit ×1
lisp ×1
magento ×1
math ×1
semaphore ×1
spring ×1
spring-mvc ×1
task-queue ×1
tomcat ×1
unit-testing ×1