问题列表 - 第46811页

使用CSS类

<td class="blue">
    <a href="lnk1.aspx">Hi1</a> 
    <a href="lnk2.aspx">Hi2</a> 
    <a href="lnk3.aspx">Hi3</a>
    <div>Not Blue</div>
</td>
Run Code Online (Sandbox Code Playgroud)

我希望标签中的类("蓝色")使Hi1,Hi2和Hi3变为蓝色.

那个班的主管应该是什么?

????
{
    color:blue;
}
Run Code Online (Sandbox Code Playgroud)

css asp.net css-selectors

0
推荐指数
1
解决办法
68
查看次数

从字符串中提取第一个单词 - 正则表达式

我有以下字符串:


str1 = "cat-one,cat2,cat-3";
OR
str1 = "catone,cat-2,cat3";
OR
str1 = "catone";
OR
str1 = "cat-one";
Run Code Online (Sandbox Code Playgroud)

这里的要点是可能/可能没有" - "的词

使用正则表达式:我怎样才能提取第一个单词?

感谢任何帮助.

谢谢,L

regex

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

使用套接字C#的POST请求

我正试图为一个网站制作一个拍卖狙击手.要进行出价,您需要将4个参数(当然还有Cookie)发送到/ auction/place_bid.我需要使用套接字,而不是HttpWebRequest.这是代码:

        string request1 = "POST /auction/place_bid HTTP/1.1\r\nHost: *host here*\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)\r\nAccept: /*\r\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\r\nX-Requested-With: XMLHttpRequest\r\n" + cookies +"\r\n";
        string request3 = "token=" + token + "&aid=" + aid + "&bidReq=" + ptzReq + "&recaptcha_challenge_field=" + rcf + "&recaptcha_response_field=" + rrf+"\r\n\r\n";
        string request2 = "Content-Length: " + (Encoding.UTF8.GetByteCount(request1+request3)+23).ToString() + "\r\n";
        byte[] dataSent = Encoding.UTF8.GetBytes(request1+request2+request3);
        byte[] dataReceived = new byte[10000];
        Socket socket = ConnectSocket(server, 80);
        if (socket == null)
        {
            return null; …
Run Code Online (Sandbox Code Playgroud)

c# sockets post

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

无法在XNA4中加载spriteFont

我和XNA一起玩耍,我来到了需要加载字体的部分.够简单吧?

Font1 = Content.Load<SpriteFont>("Arial");
Run Code Online (Sandbox Code Playgroud)

是我用来加载字体的代码.

<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
  <Asset Type="Graphics:FontDescription">

    <!--
    Modify this string to change the font that will be imported.
    -->
    <FontName>Arial</FontName>

    <!--
    Size is a float value, measured in points. …
Run Code Online (Sandbox Code Playgroud)

c# xna

6
推荐指数
1
解决办法
7724
查看次数

Magento设计模式

Magento,恕我直言,代表了一个基于深思熟虑的编码原则的PHP系统 - 可重用的设计模式就是其中之一.就PHP系统的一个例子而言,我认为它可以被认为是非常前沿的,因此从架构的角度来看值得考虑.

据我了解,OOP开发人员可以使用许多设计模式.看到在Magento这样的开源系统中使用的这些模式允许开发人员在实际使用和原位查看这些模式的示例,而不是在有时可能相当麻烦,甚至有点误导的示例中.

因此,我想知道除了下面列出的模式之外,Magento程序员在为Magento开发时使用了哪些模式.

作为一个注释,我理解这些模式中的一些是由于构建在Zend框架上的结果,MVC /前端控制器是其中的几个,

显而易见的是:

厂:

$product = Mage::getModel('catalog/product');
Run Code Online (Sandbox Code Playgroud)

辛格尔顿:

$category = Mage::getSingleton('catalog/session');
Run Code Online (Sandbox Code Playgroud)

注册地:

$currentCategory = Mage::registry('current_category');
Run Code Online (Sandbox Code Playgroud)

php design-patterns zend-framework magento

34
推荐指数
4
解决办法
7805
查看次数

按名称获取ActiveRecord的属性

我有一个部分,将用于项目的许多地方.

它呈现与指定标记相关的项目,如:

@tag.articles.each do |a|
    # render articles
end
Run Code Online (Sandbox Code Playgroud)

我需要这个部分不仅可以呈现文章,还可以呈现与标签相关的任何其他项目.

所以,这个partial有一个参数association_name,如下所示:

@tag[association_name].each do |a|
    # render articles
end
Run Code Online (Sandbox Code Playgroud)

我通过以下方式称之为偏:

# to render articles
render :partial => "items", :locals => {:association_name => "articles"}

# to render videos
render :partial => "items", :locals => {:association_name => "videos"}

# etc.
Run Code Online (Sandbox Code Playgroud)

问题是 - 我不能以某种方式引用Article模型的字段:

@article[association_name]
Run Code Online (Sandbox Code Playgroud)

怎么做以及它为什么不起作用?

ruby attributes ruby-on-rails object

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

组装时大吃一惊

我在汇编中实现了strlen的自己的实现,但没有返回正确的值。它返回字符串长度+4。因此。我不明白为什么..我希望任何你...

大会来源:

section .text
    [GLOBAL stringlen:] ; C function

stringlen:  
    push ebp
    mov ebp, esp        ; setup the stack frame

    mov ecx, [ebp+8]

    xor eax, eax        ; loop counter


startLoop:
    xor edx, edx
    mov edx, [ecx+eax]
    inc eax

    cmp edx, 0x0 ; null byte    
    jne startLoop
end:    
    pop ebp

    ret
Run Code Online (Sandbox Code Playgroud)

和主要例程:

#include <stdio.h>

extern int stringlen(char *);

int main(void)
{
  printf("%d", stringlen("h"));

  return 0;
}
Run Code Online (Sandbox Code Playgroud)

谢谢

linux x86 assembly nasm strlen

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

使用jQuery选择和操作CSS伪元素,例如:: before和:: after

有没有办法使用jQuery 选择/操作CSS伪元素,如::before::after(以及带有一个分号的旧版本)?

例如,我的样式表具有以下规则:

.span::after{ content:'foo' }
Run Code Online (Sandbox Code Playgroud)

如何使用jQuery将'foo'更改为'bar'?

javascript css jquery jquery-selectors pseudo-element

897
推荐指数
14
解决办法
59万
查看次数

如何从mysql5中的触发器中的select查询中获取值?

如何从触发器中的select查询中获取值并在表中插入该值?

mysql sql triggers

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

除了autoconf之外,m4还有值得注意的用途吗?

有人知道m4除autoconf之外的任何用途(最好是在ac或c ++环境中),这不仅仅是一个学术上的延伸,因为它有助于解决一个问题,否则(例如使用"标准"预处理器)难以解决.

我问这个是因为我正在考虑用c ++做一个项目的方法,我希望通过使用脚本,预处理器,whatevers来减少或减少冗余.

c c++ autoconf preprocessor m4

8
推荐指数
2
解决办法
1885
查看次数