问题列表 - 第35981页

如何在MVC的PHP页面之间传递值?

PHP程序如何在模型,视图和控制器页面之间传递值?例如,如果控制器有一个数组,它如何将它传递给视图?

编辑:

谢谢你的回答.我看到其中几个说明组件在同一页面,但是当我看到类似CodeIgniter的东西时,我看到三个单独的PHP页面用于模型,视图和控制器.

php model-view-controller

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

iOS - 检测屏幕上有多个手指

我正在寻找在屏幕上检测多个手指的最佳方法.我没有检测到水龙头或捏,只是发生了不止一次触摸的事实.似乎没有任何手势识别器.什么是最好的方式?

iphone gesture-recognition touch detection ipad

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

如何在Ruby on Rails中修补补丁?

让我们使用一个真实世界的例子.

我想修补一下WillPaginate :: LinkRenderer.to_html方法.

到目前为止,我尝试过:

  1. 在文件夹中创建了一个文件:lib/monkeys/will_paginate_nohtml.rb
  2. 在config/environments.rb中添加:在文件末尾需要'monkeys/will_paginate_nohtml'
  3. 在该文件中,这是我的代码:

Ë

module Monkeys::WillPaginateNohtml
  def to_html
    debugger
    super
  end
end

WillPaginate::LinkRenderer.send(:include, Monkeys::WillPaginateNohtml)
Run Code Online (Sandbox Code Playgroud)

但不知何故,调试器无法通过.看起来修补失败了.

任何帮助将不胜感激,谢谢!

monkeypatching ruby-on-rails

6
推荐指数
2
解决办法
6989
查看次数

为什么我从GHCi收到此警告?

模式匹配时我收到一个好奇的警告,但只有当OverloadedStrings被启用时...

$ ghci -Wall
GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> let f x = case (x :: [String]) of {[""] -> "root"; ["product", _] -> "product"; _ -> "unknown"}
Prelude> :q
Leaving GHCi.
$ ghci -Wall -XOverloadedStrings
GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... …
Run Code Online (Sandbox Code Playgroud)

warnings haskell case-statement ghc overloaded-strings

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

为查询字符串声明变量

我想知道在MS SQL Server 2005中是否有办法做到这一点:

  DECLARE @theDate varchar(60)
  SET @theDate = '''2010-01-01'' AND ''2010-08-31 23:59:59'''

  SELECT    AdministratorCode, 
            SUM(Total) as theTotal, 
            SUM(WOD.Quantity) as theQty, 
            AVG(Total) as avgTotal, 
            (SELECT SUM(tblWOD.Amount)
                FROM tblWOD
                JOIN tblWO on tblWOD.OrderID = tblWO.ID
                WHERE tblWO.Approved = '1' 
                AND tblWO.AdministratorCode = tblWO.AdministratorCode
                AND tblWO.OrderDate BETWEEN @theDate
            )
 ... etc
Run Code Online (Sandbox Code Playgroud)

这可能吗?

sql t-sql sql-server sql-server-2005 dynamic-sql

86
推荐指数
3
解决办法
58万
查看次数

如何在Windows Phone中获取应用程序版本?

在C#中,可以使用System.Version.Assembly来获取正在运行的应用程序的版本.但是,这似乎并不存在于Silverlight for Windows Phone中.还有其他选择吗?

c# silverlight windows-phone-7

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

从iPhone上的线性PCM中提取幅度数据

我很难从存储在audio.caf中的iPhone上的线性PCM中提取幅度数据.

我的问题是:

  1. 线性PCM将幅度样本存储为16位值.它是否正确?
  2. 振幅如何存储在AudioFileReadPacketData()返回的数据包中?录制单声道线性PCM时,不是每个样本(在一个帧中,在一个数据包中)只是一个SInt16阵列?什么是字节顺序(大端与小端)?
  3. 线性PCM幅度的每一步在物理上意味着什么?
  4. 当在iPhone上记录线性PCM时,中心点0(SInt16)还是32768(UInt16)?最大最小值在物理波形/气压中意味着什么?

还有一个问题:iPhone麦克风无法测量声音/气压波形吗?

我的代码如下:

// get the audio file proxy object for the audio
AudioFileID fileID;
AudioFileOpenURL((CFURLRef)audioURL, kAudioFileReadPermission, kAudioFileCAFType, &fileID);

// get the number of packets of audio data contained in the file
UInt64 totalPacketCount = [self packetCountForAudioFile:fileID];

// get the size of each packet for this audio file
UInt32 maxPacketSizeInBytes = [self packetSizeForAudioFile:fileID];

// setup to extract the audio data
Boolean inUseCache = false;
UInt32 numberOfPacketsToRead = 4410; // 0.1 seconds of data
UInt32 ioNumPackets …
Run Code Online (Sandbox Code Playgroud)

iphone core-audio ios

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

lime vs phpunit

令人惊讶的是,我没有在网络上的任何地方看到这个问题.

在石灰单元测试看起来那么简单得多比PHPUnit来写其所有额外的样板代码.

有没有明确的理由(除了"PHPUnit是事实上的标准")选择一个而不是另一个?

php phpunit unit-testing lime

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

AxisFault:Server.userException是什么意思?

以下AxisFault是什么意思?

这是否意味着:

  • 服务器和服务器发出和接收的请求会抛出(未捕获的)异常,因此异常将返回给客户端.

要么

  • 我的Web应用程序无法创建SOAP请求(因此甚至不从客户端应用程序发送请求)

NB.我是网络服务的新手

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1c) was found in the element content of the document.
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1c) was found in the element content of the document.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at …
Run Code Online (Sandbox Code Playgroud)

java axis soap web-services

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

ruby中的功能代码示例

我正在寻找ruby中的功能代码示例.也许你知道一些宝石,在哪里可以找到这样的代码?

ruby functional-programming rubygems

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