灯角

文章 0 评论 0 浏览 23

灯角 2024-11-06 18:03:04

正如罗马人所说,您可以将自己的文件放在 /templates/default/css 文件夹中(在 4.0 中称为 jui,但在 4.1 中称为默认),这些文件应该由路径查找器拾取。

您还可以通过将其他目录添加到 Frontend.php 中来将其添加到搜索列表中,如下所示。

$this->addLocation('atk4-addons',array(
             'php'=>array(
                   'mvc',
                   'misc/lib',
                   'sterling/jqplot/lib',
                   ),
             'css'=>array(
                   'sterling/jqplot/templates/js/jqplot',
                   ),

所以现在路径查找器还将在指定的目录中搜索 css 脚本,我可以将以下行添加到我的页面代码中。

$p->api->template->append('css_include', '<link type="text/css" href="'.$this->api->locateURL('css','mysite.css').'" rel="stylesheet" />'."\n");

As romans said, you can put your own files in the /templates/default/css folder (It's called jui in 4.0 but default in 4.1) and these should be picked up by the pathfinder.

You can also add additional directories to the list searched by adding them in Frontend.php like this.

$this->addLocation('atk4-addons',array(
             'php'=>array(
                   'mvc',
                   'misc/lib',
                   'sterling/jqplot/lib',
                   ),
             'css'=>array(
                   'sterling/jqplot/templates/js/jqplot',
                   ),

so now the pathfinder will also search for css scripts in the directory specified and i can add the following line into my page code.

$p->api->template->append('css_include', '<link type="text/css" href="'.$this->api->locateURL('css','mysite.css').'" rel="stylesheet" />'."\n");

ATK4 - 页面文件夹下的子文件夹和js/css问题

灯角 2024-11-05 21:32:26

您可以使用与画布相同的方法。

在 html 代码中创建 div 元素,给每个元素一个不同的 id。
您可以使用 paper=new Raphael('elementId',width,height) 在现有元素上初始化 Raphael。

这使得将 CSS 规则应用到元素成为可能。
文章中一样设置CSS:

应用position:absolute; 到所有元素并使用 z-index 按您想要的顺序堆叠元素。

CSS 定位

You can use the same method as they used with canvas.

Create div elements in the html code, give each a distinct id.
You can initialize Raphael on an existing element by using paper=new Raphael('elementId',width,height).

This makes is possible to apply css rules to the elements.
Set the css just like in the article:

Apply position: absolute; to all elements and use z-index to stack the elements in the order you want.

CSS positioning

如何使用Raphael画布库创建多层图像?

灯角 2024-11-05 14:44:40

不要用代码构建文档,而是在 Word 中将其创建为模板或邮件合并模板,并使用代码来合并或替换字段数据。

在这里查看这个答案
MS Word Office Automation - 填写文本表单字段和复选框表单字段以及邮件合并

并从母舰上查看此内容:

http://msdn.microsoft.com/en-us/library/ff433638.aspx

Don't build the document in code, create it in Word as template or mail merge template and the use code to merge or replace the fields data.

See this answer here
MS Word Office Automation - Filling Text Form Fields And Check Box Form Fields And Mail Merge

And See this from the mothership:

http://msdn.microsoft.com/en-us/library/ff433638.aspx

如何使用C#编写的html创建word文档

灯角 2024-11-05 13:46:05

我推荐一个基于 Codan 框架的免费插件,称为 Artemis。您可以从 ecliplse 市场获取它。还有其他检查器,但只有集成到 Codan 中的插件(例如这个)可以在 Eclipse 中执行实时分析。

I suggest a free plugin based on Codan framework called Artemis. You can get it from ecliplse marketplace. There are other checkers but only plugins integrated into Codan, like this one, can perform real-time analysis in Eclipse.

C++、Eclipse CDT代码分析?

灯角 2024-11-05 03:07:09

只是一个更新,以及同步问题的答案:iCloud 似乎实际上会同步应用程序。我还没有尝试过,但正在计划实施。然而,由于用户只有有限的免费 iCloud 存储空间,而且许多人不愿意付费,因此我还实施了 Dropbox 来进行备份/恢复(仅)。希望这有帮助!

Just an update, and an answer to the syncing issue: iCloud seems like it will actually app syncing. I haven't tried it yet, but am planning to implement it. However, since users will only have limited free iCloud storage, and many won't want to pay, I am also implementing Dropbox for Backup/Restore (only). Hope this helps!

需要在 iPhone/iPad/iPod Touch 等之间同步 iPhone 应用程序。如何实现?云?兹同步? Dropbox?

灯角 2024-11-05 02:17:24

如果您为 google.com 设置了 cookie,并且在浏览器中使用

If you have a cookie set for google.com and you load foo.com in your browser with a <script src="http://google.com/xxx></script> in the HTML, your browser will send the google.com cookie when fetching that script.

登录 google.com/analytics 后,谷歌分析如何知道在自己的域上加载叠加层?

灯角 2024-11-05 00:42:31

我对答案做了一些扩展;也通过更新父级。 [catch 中的 DisplayException 方法只是我经常使用的弹出窗口;你可以自己做]

    private bool _busy = false;  

    private void treeViewPassFail_AfterCheck(object sender, TreeViewEventArgs e)
    {
        try
        {
            if (_busy)
            {
                return;
            }

            _busy = true;

            CheckNodes(e.Node, e.Node.Checked);

            CheckParent(e.Node.Parent);
        }
        catch(Exception ex)
        {
            DisplayException(ex);
        }
        finally
        {
            _busy = false;
        }
    }

    private void CheckNodes(TreeNode node, bool check)
    {
        foreach(TreeNode child in node.Nodes)
        {
            child.Checked = check;
            CheckNodes(child, check);
        }
    }

    private void CheckParent(TreeNode parent)
    {
        if (parent != null)
        {
            bool allChecked = true;

            foreach (TreeNode node in parent.Nodes)
            {
                allChecked &= node.Checked;
            }

            parent.Checked = allChecked;
        }
    }

I expanded on the answer a little; by updating the parent as well. [The DisplayException method inside the catch is just a popup window that I always use; you can do your own]

    private bool _busy = false;  

    private void treeViewPassFail_AfterCheck(object sender, TreeViewEventArgs e)
    {
        try
        {
            if (_busy)
            {
                return;
            }

            _busy = true;

            CheckNodes(e.Node, e.Node.Checked);

            CheckParent(e.Node.Parent);
        }
        catch(Exception ex)
        {
            DisplayException(ex);
        }
        finally
        {
            _busy = false;
        }
    }

    private void CheckNodes(TreeNode node, bool check)
    {
        foreach(TreeNode child in node.Nodes)
        {
            child.Checked = check;
            CheckNodes(child, check);
        }
    }

    private void CheckParent(TreeNode parent)
    {
        if (parent != null)
        {
            bool allChecked = true;

            foreach (TreeNode node in parent.Nodes)
            {
                allChecked &= node.Checked;
            }

            parent.Checked = allChecked;
        }
    }

C# 中带有复选框的 TreeView

灯角 2024-11-04 00:21:21

问题是您的 while 循环正在获取一行,然后在您的 json_encode 调用中,代码正在获取新行。

您应该使用在 json_encode 调用中获取的 $row

while ($row=mysql_fetch_array($res_Data,MYSQL_NUM)) {
    echo json_encode($row)." ";
}

Problem is that your while loop is fetching a row and then in your json_encode call, the code is fetching a new row.

You should use the $row that you fetched in the json_encode call.

while ($row=mysql_fetch_array($res_Data,MYSQL_NUM)) {
    echo json_encode($row)." ";
}

JSON 编码正在删除所有其他值

灯角 2024-11-03 09:43:46

数据:

df <- c(rep("Your category choice is correct", 3),
        rep("Your category choice is incorrect", 5),
        rep("Your category choice is correct", 2))

这会将您的df 更改为factor

df2 <- factor(df, labels = c(1,0))   

在开始时,因子的处理可能会有点混乱。因此,如果您更愿意将其保留为类 numericinteger 您可以这样做

df3 <- df
df3[df3 == "Your category choice is correct"] <- 1
df3[df3 == "Your category choice is incorrect"] <- 0
df3 <- as.integer(df3)

data:

df <- c(rep("Your category choice is correct", 3),
        rep("Your category choice is incorrect", 5),
        rep("Your category choice is correct", 2))

This will change your df into a factor

df2 <- factor(df, labels = c(1,0))   

In the beginning the handling of factors may get a bit confusing. So if you rather prefer to keep it as class numeric or integer you can e.g. do

df3 <- df
df3[df3 == "Your category choice is correct"] <- 1
df3[df3 == "Your category choice is incorrect"] <- 0
df3 <- as.integer(df3)

重新编码字符变量

灯角 2024-11-03 09:08:11

在编写递归函数时,最好的方法通常是决定一个基本情况(:像“”是回文,尽管“a”也是回文......),然后设计一种方法来获取任何状态并移动它到基本情况。

因此,在回文的情况下,它的基本思想与以前相同,如果第一个字符和最后一个字符相同,则返回 true 并检查字符串的其余部分(从而更接近基本情况),如果它们是那么你就不会返回 false 。

您的堆栈溢出来自于在每种情况下调用 isPalindrome ,而不是当您需要继续解决问题时,不要忘记,如果两个字符意味着某些内容不是回文,则其余字符将变得无关紧要(因此不必递归)

When writing a recursive function the best way to go about this is usually to decide on a base case (:like "" is a palindrome, though so is "a" ... ) and then devise a method to take any state and move it to the base case.

So in the case of the palindrome, it's the same basic idea as before, if the first character and the last character are the same you return true and check the rest of the string ( thus moving closer to the base case ) and if they are not then you return false.

Your stack overflow comes from calling isPalindrome in every case rather than when you need to continue solving the problem, don't forget that if two characters mean that something isn't a palindrome, the rest is rendered irrelevant ( and thus needn't be recursed on )

需要一些帮助来为我的回文应用程序编写递归实现

灯角 2024-11-03 04:10:17

Since your containing <a> have a set height value, you can use the ol' line-heighttrick of setting it to the same value, in this case:

a { 
    height:35px; 
    line-height:35px; 
}

This will only work, though, if your <span> isn't wider than your <li>. In the case with the double line, you'd need to set the <line-height> to half the <a>'s height (35px height divided by 2 lines), so around 17px. If you had three lines, it would work with 35px/3 ~ 11px. But as you can imagine, it will look smooshed at one point.
So depending on the content you might have to with the relative/absolute positioning, a smaller font, or just less content ;)

垂直对齐标签中的跨度

灯角 2024-11-03 01:45:46

它无法在ARM设备上运行,例如一些目前非常罕见x86 运行移植的 Android 版本的上网本。

It won't run on non-ARM devices, like some currently very rare x86 netbooks that have a ported Android version running on them.

AndEngine + Android 上的 Box2D - 它的便携性如何?

灯角 2024-11-02 23:24:00

好吧,我承认我用一个可能的替代方案来避免你的直接问题。您可能需要考虑使用 XStream 进行解析,而不是让它用更少的代码处理大部分工作。下面的粗略示例使用 64MB 堆解析 XML。请注意,它还需要 Apache Commons IO 才能轻松读取输入,从而允许黑客将 转换为

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.commons.io.FileUtils;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;

public class CentroidGenerator {
    public static void main(String[] args) throws IOException {
        for (Centroid centroid : getCentroids(new File("PjrE.data.xml"))) {
            System.out.println(centroid.title + " - " + centroid.description);
        }
    }

    @SuppressWarnings("unchecked")
    public static List<Centroid> getCentroids(File file) throws IOException {
        String input = FileUtils.readFileToString(file, "UTF-8");
        input = input.replaceAll("collection>", "list>");

        XStream xstream = new XStream();
        xstream.processAnnotations(Centroid.class);

        Object output = xstream.fromXML(input);
        return (List<Centroid>) output;
    }

    @XStreamAlias("doc")
    @SuppressWarnings("unused")
    public static class Centroid {
        private String id;
        private String title;
        private String description;
        private String time;
        private String tags;
        private String latitude;
        private String longitude;
        private String event;
        private String geo;
    }
}

Ok, I'll admit I'm avoiding your direct question with a possible alternative. You might want to consider parsing with XStream instead to let it deal with the bulk of the work with less code. My rough example below parses your XML with a 64MB heap. Note that it requires Apache Commons IO as well just to easily read the input just to allow the hack to turn the <collection> into a <list>.

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.commons.io.FileUtils;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;

public class CentroidGenerator {
    public static void main(String[] args) throws IOException {
        for (Centroid centroid : getCentroids(new File("PjrE.data.xml"))) {
            System.out.println(centroid.title + " - " + centroid.description);
        }
    }

    @SuppressWarnings("unchecked")
    public static List<Centroid> getCentroids(File file) throws IOException {
        String input = FileUtils.readFileToString(file, "UTF-8");
        input = input.replaceAll("collection>", "list>");

        XStream xstream = new XStream();
        xstream.processAnnotations(Centroid.class);

        Object output = xstream.fromXML(input);
        return (List<Centroid>) output;
    }

    @XStreamAlias("doc")
    @SuppressWarnings("unused")
    public static class Centroid {
        private String id;
        private String title;
        private String description;
        private String time;
        private String tags;
        private String latitude;
        private String longitude;
        private String event;
        private String geo;
    }
}

OutOfMemoryError异常:Java堆空间,如何调试...?

灯角 2024-11-02 18:25:27

我认为创建一个类来隐藏 > 是解决该问题的相当标准的方法。干得好!无需在 > 上使用 showhide 函数,它也同样容易使用 CSS 方法时,请使用 addClassremoveClass。此外,如果需要在页面加载时应用该类,可以使用 PHP 显示 > 的初始状态。

<div <? if($thisvolneed=='specify'){echo 'class="specify"';} ?>><p>Some info...</p></div>

I think creating a class to hide the <div> is a fairly standard way to approach the problem. Well done! Instead of using the show or hide function on the <div>, it is just as easy to use addClass or removeClass when using the CSS approach. Also, the initial state of the <div> can be shown by using PHP to apply the class if necessary on page load.

<div <? if($thisvolneed=='specify'){echo 'class="specify"';} ?>><p>Some info...</p></div>

php/jQuery 根据数据库中的单选按钮设置更改是否显示/隐藏

灯角 2024-11-01 22:53:51

这是一个老问题,但我不确定为什么人们不建议使用事件对象来检索信息,而不是再次搜索 DOM。

只需浏览函数 onChange 中的事件对象,请参阅下面的示例

function test() {
console.log(event.srcElement.value);
}

http://jsfiddle.net/Corsico/3yvh9wc6/5/

如果这不是 7 年前的默认行为,那么今天查找此内容的人可能会有用

This is an old question, but I am not sure why people didn't suggest using the event object to retrieve the info instead of searching through the DOM again.

Simply go through the event object in your function onChange, see example bellow

function test() {
console.log(event.srcElement.value);
}

http://jsfiddle.net/Corsico/3yvh9wc6/5/

Might be useful to people looking this up today if this wasn't default behavior 7 years ago

从“更改时选择”中获取选定的值/文本

更多

推荐作者

书间行客

文章 0 评论 0

神妖

文章 0 评论 0

undefined

文章 0 评论 0

38169838

文章 0 评论 0

彡翼

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文