小编Aus*_*inT的帖子

Django:CSS不是没有用

我还是django的新手,我的CSS工作有问题.
我已经按照链接的方向:Django Static Link教程,处理静态文件.但它仍然无法正常工作.

设置

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = '/Users/a9austin/Development/sites/AlphaSocks/src/static_root/'

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even …
Run Code Online (Sandbox Code Playgroud)

html css python django web

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

检测音量按钮按下

未调用音量按钮通知功能.

码:

func listenVolumeButton(){
    // Option #1
    NSNotificationCenter.defaultCenter().addObserver(self, selector: "volumeChanged:", name: "AVSystemController_SystemVolumeDidChangeNotification", object: nil)
    // Option #2
    var audioSession = AVAudioSession()
    audioSession.setActive(true, error: nil)
    audioSession.addObserver(self, forKeyPath: "volumeChanged", options: NSKeyValueObservingOptions.New, context: nil)
}

override func observeValueForKeyPath(keyPath: String, ofObject object: AnyObject, change: [NSObject : AnyObject], context: UnsafeMutablePointer<Void>) {
    if keyPath == "volumeChanged"{
        print("got in here")
    }
}

func volumeChanged(notification: NSNotification){
   print("got in here")
}
Run Code Online (Sandbox Code Playgroud)

listenVolumeButton() 正在viewWillAppear中调用

"got in here"在任何一种情况下,代码都没有进入print语句.

我正在尝试两种不同的方法来实现它,两种方式都不起作用.

我跟着这个:检测iPhone音量按钮向上按?

ios swift ios8

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

Request,Session和ServletContext中属性之间的差异

我无法理解这三种设置属性的方法之间的差异:

// String as attribute of request
req.setAttribute("name", "Sluggo");

// Integer as attribute of session
req.getSession().setAttribute("age", 10);

// Date as attribute of context
getServletContext().setAttribute("today", new Date());
Run Code Online (Sandbox Code Playgroud)
  1. 有什么区别?
  2. 你应该什么时候使用?

java jsp servlets web

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

如何在打开的xml上摆脱我的"After Spacing"

在开放XML中,我的word文档默认为"Spacing After:10 pt"如何将其更改为0,因此没有间距.

这是我的代码,它几乎从数据库中获取信息并将其放在word文档上以便能够打印出来.但是间距使得文档太大了.

using (WordprocessingDocument wordDoc = WordprocessingDocument.Create(filepath,  WordprocessingDocumentType.Document)) {
    MainDocumentPart mainPart = wordDoc.AddMainDocumentPart();
    mainPart.Document = new Document();
    Body body = mainPart.Document.AppendChild(new Body());

    Paragraph para_main = body.AppendChild(new Paragraph());
    Run run_main = para_main.AppendChild(new Run());

    // Goes through all of the forms
    foreach (var form in forms) {
        Table table = new Table();
        // Initialize all of the table properties
        TableProperties tblProp = new TableProperties(
            new TableBorders(
                new TopBorder() { Val = new EnumValue<BorderValues>(BorderValues.BasicBlackSquares), Size = 16 },
                new LeftBorder() { …
Run Code Online (Sandbox Code Playgroud)

c# ms-word openxml

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

wpf:按钮,文本框,被切断

我真的很困惑为什么我的一些文本框和按钮被切断了,有人可以帮我解决这个问题吗?谢谢!!

XAML代码

<Grid>
        <TabControl>
            <TabItem Name="tabHome">
                <TabItem.Header>
                    <Label Content="Home" MouseLeftButtonDown="tabHome_Click"/>
                </TabItem.Header>
                <Grid>
                    <Button Content="Parse" Height="23" x:Name="btn_parse" Width="75" Click="buttonParse_Click" Margin="180,10,180,176"/>
                    <TextBox IsReadOnly="True"  x:Name="txtbox_filepath" Height="25" Width="135" Margin="151,52,150,132" />
                    <Button Content="Reset" Height="23" x:Name="btn_reset" Width="75" Margin="180,122,180,64" Click="buttonReset_Click"/>
                </Grid>
            </TabItem>
            <TabItem Name="tabConfig">
                <TabItem.Header>
                <Label Content="Configuration" MouseLeftButtonDown="tabConfig_Click"/>
                </TabItem.Header>
                <ScrollViewer>
                    <StackPanel Name="panelConfig">
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
<Grid>
Run Code Online (Sandbox Code Playgroud)

截图

截图

如您所见,按钮和文本框在角落处被切断.
感谢您的帮助,我很感激.

wpf xaml

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

下划线和粗体文字

如何让文字加下划线和粗体?我的文字变得大胆,但没有得到强调.
这是我的一些代码,非常直接使用运行属性来加粗并为给定文本加下划线.

Run run_header = para_main.AppendChild(new Run());
RunProperties runProps = new RunProperties();
Bold bold = new Bold();
Underline ul = new Underline();
runProps.Append(bold);
runProps.Append(ul);
run_header.AppendChild(new RunProperties(runProps));
//run_header.AppendChild(new RunProperties(new Bold(), new Underline()));

string username = form.Username;
string proces_header = form.HeaderTitle;

run_header.AppendChild(new Text(proces_header + " | " + username));
run_header.AppendChild(new Break());
Run Code Online (Sandbox Code Playgroud)

c# ms-word openxml

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

~0做什么?


〜0意味着它翻转000000000到1111111111?

printf("Check: %i", ~0);
Run Code Online (Sandbox Code Playgroud)

printf结果为-1,这就是为什么我感到困惑.
-1基本上与11111111111111111位的含义相同吗?

c c++ bit bitwise-operators

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

Rake Aborted,在add_index(:users,:email,{:unique => true})上

我目前正在研究michael hartl的ruby on rails 3教程.当我尝试调用db:migrate时,我遇到了这个问题.有人可以帮我弄清楚为什么会流产.谢谢!

** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:migrate == AddEmailUniquenessIndex: migrating ======================================== -- add_index(:users, :email, {:unique=>true}) rake aborted! An error has occurred, this and all later migrations canceled: SQLite3::ConstraintException: indexed columns are not unique: CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")

class AddEmailUniquenessIndex < ActiveRecord::Migration
  def up
    add_index :users, :email, :unique => true
  end

  def down
    remove_index :users, :email
  end
end …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails

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

iOS核心数据:对核心数据和数据库感到困惑

我真的很困惑核心数据实际上是什么.或者我想我的问题是,在处理数据库时,您会使用Core Data吗?就像我想从数据库访问值一样,我会使用Core Data来访问这些值吗?我该如何处理这个问题?

非常感谢你的帮助.

database iphone core-data ios

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

Windows C#表单:提示关注文本框

我想知道在Windows窗体上使用提示时如何自动选择文本框.我的代码显示了我尝试过的内容,但它仍然专注于按钮而不是文本框.提前感谢您的帮助和帮助.

            Form prompt = new Form();
            prompt.Width = 500;
            prompt.Height = 200;
            prompt.Text = caption;
            Label textLabel = new Label() { Left = 50, Top = 20, Text = text };
            TextBox textBox = new TextBox() { Left = 50, Top = 50, Width = 400 };
            Button confirmation = new Button() { Text = "Ok", Left = 50, Width = 100, Top = 90 };
            confirmation.Click += (sender, e) => { prompt.Close(); };
            textBox.Select();
            textBox.Focus();
            prompt.Controls.Add(confirmation);
            prompt.Controls.Add(textLabel);
            prompt.Controls.Add(textBox);
            prompt.ShowDialog(); …
Run Code Online (Sandbox Code Playgroud)

c# winforms

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

标签 统计

c# ×3

ios ×2

ms-word ×2

openxml ×2

web ×2

bit ×1

bitwise-operators ×1

c ×1

c++ ×1

core-data ×1

css ×1

database ×1

django ×1

html ×1

ios8 ×1

iphone ×1

java ×1

jsp ×1

python ×1

ruby-on-rails ×1

servlets ×1

swift ×1

winforms ×1

wpf ×1

xaml ×1