问题列表 - 第45447页

Chrome无视我的字体选择

我让Chrome识别我的字体选择有点困难.我没有很多代码,因为我刚开始这个网站.

基本上我reset.css在网站上有一个,然后我的电话main.css被调用.在reset.css它下面几乎在sun下的每个html标签下都声明了下面的语句:

font-family:Arial, Helvetica, sans-serif;
Run Code Online (Sandbox Code Playgroud)

在main.css的同一语句下宣布html,bodyp,甚至一些特殊p标记,如p.headerTextp.newsDate

这是一个非常标准的设置.在Safari,IE和Firefox上,字体呈现为Arial/Helvetica,在Chrome上它呈现为Times New Roman.

真的很令人沮丧.有人可以帮忙吗?

UPDATE

Chrome上的计算风格显示了正确的规则,我甚至在矿山机器的朋友身上测试了它,它也是一样的.两者都在OSX 10.6.6上运行Chrome 8.0.552.237

干杯

html css fonts google-chrome

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

C#将List <ushort>转换为List <short>

我想做这个

List<ushort> uList = new List<ushort>() { 1, 2, 3 };
List<short> sList = uList.Cast<short>().ToList();
Run Code Online (Sandbox Code Playgroud)

但我得到InvalidCastException"指定的强制转换无效."

如何快速高效地投射上述系列?

谢谢.

.net c# collections casting

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

ASP.net MVC3 - 具有Ajax回发的Razor视图和PartialViews

让我的工作变得非常失败!

在一个视图中......

@model Project.Models.Account.ForgotPasswordModel

@{
    ViewBag.Title = "Forgot Password";
}

<h2>ForgotPassword</h2>

<span id='@ViewBag.ReplaceID'>
    @Html.Partial("_ForgotPasswordUserNameAjax", ViewData.Model)
</span>
Run Code Online (Sandbox Code Playgroud)

我渲染这个partialView ...

@model Project.Models.Account.ForgotPasswordModel

@{
    this.Layout = null;
}

@using (Ajax.BeginForm("ForgotPassword", new AjaxOptions() { UpdateTargetId = ViewBag.ReplaceID, InsertionMode = InsertionMode.InsertAfter }))
{
    @Html.ValidationSummary(true, "Forgot Password was unsuccessful. Please correct the errors and try again.")
    <div id="login" class="box">
            <fieldset>
            <h2>Account Information</h2>
            <div class="inside">
                <div class="editor-label">
                    @Html.LabelFor(m => m.Username)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.Username)
                    <br />
                    @Html.ValidationMessageFor(m => m.Username)
                    <br />
                </div>

                <p>
                    <input type="submit" …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc razor asp.net-mvc-3

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

ElementTree实例没有属性'fromstring'.那么,我做错了什么?

我正在尝试打开并解析一些HTML.到目前为止,没关系,我可以打开源并打印它.但是当涉及到解析时,我坚持使用"ElementTree实例没有属性'fromstring'"

这是我的Django view.py代码:

from django.template import loader, Context
from django.http import HttpResponse
import urllib
from xml.etree.ElementTree import ElementTree

def transform (request):
  opener = urllib.FancyURLopener({})
  f = opener.open("http://www.google.com/")
  r = f.read()
  f.close()
  tree = ElementTree()
  tree.fromstring(r)
  p = tree.find("body/h1")
  t = loader.get_template("transform.html")
  c = Context({'neco': p })
  return HttpResponse(t.render(c))
Run Code Online (Sandbox Code Playgroud)

Django版本:1.2.4 Python版本:2.6.5

请问有人有什么想法吗?

python django parsing elementtree

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

C#中简单的LINQ问题

我试图用来LINQ返回一个发生最大次数的元素及其发生的次数.

例如:我有一个字符串数组:

string[] words = { "cherry", "apple", "blueberry", "cherry", "cherry", "blueberry" };

//...
Some LINQ statement here
//...
Run Code Online (Sandbox Code Playgroud)

在此数组中,查询将cherry作为发生的最大元素返回,并返回3它发生的次数.如果有必要,我也愿意将它们分成两个查询(第一个查询获取cherry,第二个返回计数3.

.net c# linq

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

为什么我的多线程效率不高?

我设计了一个类,使用不同数量的线程填充整数数组,以便了解多线程的强大功能.但根据我的结果,没有...

这个想法:这个想法太过于填充了100000000个整数,其值为"1".从1个线程开始(一个线程填充整个数组)并将其递增直到100个线程(每个线程填充一个大小为100000000/nbThreads的子数组)

示例:使用10个线程,我创建10个线程,每个线程填充10000000个整数的数组.

这是我的代码:

public class ThreadedArrayFilling extends Thread{
    private int start;
    private int partitionSize;
    public static int[] data;
    public static final int SIZE = 100000000;
    public static final int NB_THREADS_MAX = 100;


    public static void main(String[] args){
        data = new int[SIZE];
        long startTime, endTime;
        int partition, startIndex, j;
        ThreadedArrayLookup[] threads;

        for(int i = 1; i <= NB_THREADS_MAX; i++){       
            startTime = System.currentTimeMillis();
            partition = SIZE / i;
            startIndex = 0;
                threads = new ThreadedArrayLookup[i];
            for(j = 0; j …
Run Code Online (Sandbox Code Playgroud)

java performance benchmarking multithreading

10
推荐指数
2
解决办法
3604
查看次数

Cakephp - 从另一个模型中分页数据

我试图从住宿控制器进行分页,但是使用来自MemberWall模型的数据.

这是代码

Accommodation

$data = $this->Accommodation->Member->MemberWall->paginate('MemberWall');

MemberWall

var $paginate = array(
 'limit' => 4,
 'order' => array(
   'MemberWall.created' => 'asc'
 )
); 
Run Code Online (Sandbox Code Playgroud)

我收到这个错误

SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea....   Query: paginate 
Run Code Online (Sandbox Code Playgroud)

谢谢,亚历克斯

cakephp find

4
推荐指数
2
解决办法
9115
查看次数

在DataGridView中发出检测复选框状态的问题

我在.Net应用程序中有一个DataGridView控件,其中包含一个复选框列.我希望用户能够编辑复选框.我遇到的问题是我在用户检查后无法检测到复选框的状态.

如果最初选中该复选框,则一旦DataGridViewCheckBoxCell获得焦点,它将立即返回.但是,如果我再次单击该复选框并取消选中它,则它仍然会返回选中状态.从那时起,它将始终返回检查,无论复选框的实际状态如何,直到它失去焦点并再次获得它.

同样,如果复选框最初未选中,那么当它获得焦点时,无论复选框的实际状态如何,它都将在click事件中返回未选中状态.

这是我的代码.

    Private Sub grdTemplates_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grdTemplates.CellContentClick
    Dim strValue As String = ""
    Try
        If Me.grdTemplates.Columns(e.ColumnIndex).Name = "colCurrentTemplate" Then
            'The user clicked on the checkbox column
            strValue = Me.grdTemplates.Item(e.ColumnIndex, e.RowIndex).Value

            'THIS VALUE NEVER CHANGES WHILE THE DataGridViewCheckBoxCell HAS FOCUS
            Me.lblTemplates.Text = strValue
        End If

    Catch ex As Exception
        HandleError(ex.ToString)
    End Try

End Sub
Run Code Online (Sandbox Code Playgroud)

提前致谢,

麦克风

vb.net datagridview datagridviewcheckboxcell

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

你如何向非程序员分发Clojure程序?

我是Clojure的新手,但我正在学习它.我想知道将Clojure程序打包并分发给不一定是程序员的最终用户的最佳方法.我知道在Ruby中你可以告诉用户下载程序,gem install [program name]然后运行运行程序的命令.什么是Clojure计划的等价物?

clojure

15
推荐指数
1
解决办法
1091
查看次数

配置Django,Apache和Nginx

我在Apache + mod_wsgi上设置了我的Django应用程序.根据Django项目网站的建议,我正在使用Nginx提供静态文件.http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/

Apache在端口8081上运行,nginx在端口80上运行.现在有人建议我的配置错误,我应该反转Apache和Nginx的角色.我不确定为什么会这样.如果确实我的配置错了,为什么django网站会提出错误的方法呢?

apache django mod-wsgi nginx

8
推荐指数
1
解决办法
6305
查看次数