问题列表 - 第40505页

使用转换时,如何避免Chrome上出现这种紫色闪光?

问题在这里http://rohitarondekar.com/articles(以及网站的每个页面上)。当您在Chrome中加载页面时,链接会从紫色变为预期的颜色。如果看不到问题,请尝试进行强制刷新。我不知道这是我的CSS的错误还是问题。我提供了相关CSS的一小段内容,如下所示:

/*
* Reset
*/

* {
  margin: 0;
  padding: 0;
}

a {
  color:  #999;
  text-decoration: none;

  -webkit-transition-duration: 500ms;
  -webkit-transition-property: background, color;
  -webkit-transition-timing-function: ease; 

  -moz-transition-duration: 500ms;
  -moz-transition-property: background, color;
  -moz-transition-timing-function: ease;

  -o-transition-duration: 500ms;
  -o-transition-property: background, color;
  -o-transition-timing-function: ease;

  transition-duration: 500ms;
  transition-property: background, color;
  transition-timing-function: ease;
}

a:hover {
  color: #0077cc;
  padding-bottom: 2px;
  border-bottom: solid 1px #ccc;
}

h1 a {
  font-family: Georgia, "Nimbus Roman No9 L", Serif;  
  color: #6A6A6A;
} 

h1 a:hover {
  color: #0077cc;
  border-bottom: 0; …
Run Code Online (Sandbox Code Playgroud)

google-chrome css3

5
推荐指数
1
解决办法
974
查看次数

Eclipse环境变量

我用Eclipse.我为我的项目设置了一些环境变量.我可以从我的java代码中获取它System.getProperty("SOME_VAR")吗?

如何从Eclipse中的java代码中获取环境变量?

java environment-variables

3
推荐指数
1
解决办法
4255
查看次数

visual studio链接器警告LNK4098

我有一个dll项目,当在Release配置中构建项目时,我收到以下警告:

MSVCRT.lib(cinitexe.obj):警告LNK4098:defaultlib'msvcrtd.lib'与使用其他库冲突; 使用/ NODEFAULTLIB:库

这只是一个警告,但我不知道是否应该考虑到这一点.

对于我发现的,它们都是多线程库,正常版本和调试版本.我的DLL使用多线程,我可以调试它,虽然我使用boost:thread,所以我真的不知道如果我需要这个Windows特定的库进行调试或发布构建...

亲切的问候,Alex

好吧,我按照BuschnicK的建议并使用/ VERBOSE:LIB链接器标志我发现我在Debug配置中链接到这些库:

boost_filesystem-vc100-mt-gd-1_44.lib:libboost_system-vc100-mt-gd-1_44.lib:libboost_thread-vc100-mt-gd-1_44.lib:libboost_date_time-vc100-mt-gd-1_44.lib:

我在Release配置中也一样,主要是因为我没有明确指定"明确".因此,我在Release中将它们改为:

boost_filesystem-vc100-mt-1_44.lib:libboost_system-vc100-mt-1_44.lib:libboost_thread-vc100-mt-1_44.lib:libboost_date_time-vc100-mt-1_44.lib:

这似乎工作但我仍然得到第一个警告,直到我意识到我在我的发布配置中也有_DEBUG预处理器定义,删除它,它现在正在工作.

谢谢大家的帮助!!

c++ linker-warning

5
推荐指数
2
解决办法
1万
查看次数

如何序列化/反序列化pybrain网络?

PyBrain是一个python库,提供(除其他外)易于使用的人工神经网络.

我无法使用pickle或cPickle正确地序列化/反序列化PyBrain网络.

请参阅以下示例:

from pybrain.datasets            import SupervisedDataSet
from pybrain.tools.shortcuts     import buildNetwork
from pybrain.supervised.trainers import BackpropTrainer
import cPickle as pickle
import numpy as np 

#generate some data
np.random.seed(93939393)
data = SupervisedDataSet(2, 1)
for x in xrange(10):
    y = x * 3
    z = x + y + 0.2 * np.random.randn()  
    data.addSample((x, y), (z,))

#build a network and train it    

net1 = buildNetwork( data.indim, 2, data.outdim )
trainer1 = BackpropTrainer(net1, dataset=data, verbose=True)
for i in xrange(4):
    trainer1.trainEpochs(1)
    print '\tvalue after %d …
Run Code Online (Sandbox Code Playgroud)

python serialization pickle neural-network

9
推荐指数
1
解决办法
3842
查看次数

具有SelectList Design Decison的ViewModels

我创建了一个viewmodel

public VMPosition
{
        public VMPosition(){}//for model binder  
        public VMPosition(int EmployeeID)
        {
            PositionStatusList = new SelectList(_repo.getStatuses);
            //populate other properties
        }
        public int CurrentPositionID { get; set; }
        public int EmployeeID { get; set; }
        public int CurrentPositionHistoryID { get; set; }
        public bool AddingNew { get; set; }
        public bool ClosingCurrent { get; set; }
        public string CurrentPosition { get; set; }
        public DateTime CurrentPositionStartDate { get; set; }
        public string ReasonForDeparture { get; set; }
        public SelectList PositionStatusList { …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc viewmodel asp.net-mvc-2

4
推荐指数
1
解决办法
4556
查看次数

在哪里使用活动和代表?

我在很多项目中都使用过活动和代表,但我仍然怀疑在项目中使用事件和代表的地方以及委托和事件之间的区别.任何人都可以解释一下吗?

c# delegates

5
推荐指数
1
解决办法
2150
查看次数

当消息变大时,IpcChannel Remoting会变慢

我正在评估驻留在同一台机器上的几个.NET 2.0进程的各种进程间通信方法.当然,.Net Remoting是候选者,理论上最快的配置应该是IpcChannel(命名管道)+ BinaryFormatter.

我的基准测试确实表明,远程处理IpcChannel可能比TcpChannel更快,但IpcChannel显示吞吐量随着消息变大(大约30 MB)而急剧下降:

Message Size    30 MB       3 MB        300 KB      3 KB
Remoting / TCP  120 MB/s    115.4 MB/s  109.5 MB/s  13.7 MB/s
Remoting / IPC  55 MB/s     223.3 MB/s  218.5 MB/s  20.3 MB/s

有没有人知道为什么,或任何想法如何优化任一渠道的性能?我确实需要传递30 MB的BLOB,并且希望避免必须处理共享内存/内存映射文件.另外,我不能把这些写入磁盘(慢得多).


以下方法用于基准测试(重复调用,测量的总时间,按总时间划分的总有效负载大小).

private byte[] _bytes = null;

public byte[] HelloWorld(long size)
{
    if (_bytes == null || _bytes.Length != size)
        _bytes = new byte[size];
    return _bytes;
}
Run Code Online (Sandbox Code Playgroud)

remoting ipc named-pipes .net-2.0

9
推荐指数
1
解决办法
1731
查看次数

java数组改组

我注意到,根据列表的创建方式,底层的int数组会发生变化:

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;


public class Shuffling {

    static Integer[] intArr = {1, 2, 3, 4, 5};
    static Random random = new Random(7);
    public static void main(String[] args) {

        List<Integer> intList = new ArrayList<Integer>(Arrays.asList(intArr));
        Collections.shuffle(intList, random);
        System.out.println("List after shuffling: " + intList);
        System.out.println("intArr: " + Arrays.toString(intArr));
        //OUTPUT:
        //List after shuffling: [5, 4, 1, 3, 2]
        //intArr: [1, 2, 3, 4, 5]


        List<Integer> intList2 = Arrays.asList(intArr);
        Collections.shuffle(intList2, random);
        System.out.println("List2 after shuffling: " + intList2); …
Run Code Online (Sandbox Code Playgroud)

java arrays

5
推荐指数
1
解决办法
1万
查看次数

为什么有那么多编程语言?

您可能认为这个问题是愚蠢的,但作为一名新的IT学生,我认为当我学习一种语言(例如java)时,我倾向于忘记我之前学过的那种语言(ex c)...或者我混合了 - 语法....所以为什么不将所有内容合并为一个所以学生不需要学习多种语言...然后杀掉无用的编程语言...为什么不创建像sql这样的标准????

programming-languages

10
推荐指数
1
解决办法
4349
查看次数

Hibernate无法同时获取多个行李

Hibernate在SessionFactory创建期间抛出此异常:

org.hibernate.loader.MultipleBagFetchException:无法同时获取多个行李

这是我的测试用例:

Parent.java

@Entity
public Parent {

 @Id
 @GeneratedValue(strategy=GenerationType.IDENTITY)
 private Long id;

 @OneToMany(mappedBy="parent", fetch=FetchType.EAGER)
 // @IndexColumn(name="INDEX_COL") if I had this the problem solve but I retrieve more children than I have, one child is null.
 private List<Child> children;

}
Run Code Online (Sandbox Code Playgroud)

Child.java

@Entity
public Child {

 @Id
 @GeneratedValue(strategy=GenerationType.IDENTITY)
 private Long id;

 @ManyToOne
 private Parent parent;

}
Run Code Online (Sandbox Code Playgroud)

这个问题怎么样?我能做什么?


编辑

好吧,我遇到的问题是另一个"父"实体在我父母的内部,我的真实行为是这样的:

Parent.java

@Entity
public Parent {

 @Id
 @GeneratedValue(strategy=GenerationType.IDENTITY)
 private Long id;

 @ManyToOne
 private AntoherParent anotherParent;

 @OneToMany(mappedBy="parent", fetch=FetchType.EAGER)
 private List<Child> children;

}
Run Code Online (Sandbox Code Playgroud)

AnotherParent.java

@Entity …
Run Code Online (Sandbox Code Playgroud)

java hibernate jpa

428
推荐指数
8
解决办法
29万
查看次数