所以我已经用C++编程了将近2年,而且我有幸使用IDE(VS)和可爱的项目设置以及自动链接等.我总是远离任何需要我通过makefile编译的外部库,或者至少是那些用于linux环境/其他编译器的库.
无论如何我现在想要使用一个超级方便的实用程序(Bob Jenkins Perfect Minimal Hash),但它需要我通过makefile编译,不仅如此,而是使用g ++编译器.
我继续前进并获得了mingW32-make实用程序,现在正试图让它工作.我现在在哪里:
我得到的错误是:
C:\ gen_progs\pH值>的mingw32-MAKE
mingw32-make:***没有规则来制作目标
lookupa.c', needed bylookupa.o'.停止.
和makefile本身:
CFLAGS = -O
.cc.o:
gcc $(CFLAGS) -c $<
O = lookupa.o recycle.o perfhex.o perfect.o
const64 : $(O)
gcc -o perfect $(O) -lm
# DEPENDENCIES
lookupa.o : lookupa.c standard.h lookupa.h
recycle.o : recycle.c standard.h recycle.h
perfhex.o : perfhex.c standard.h lookupa.h recycle.h perfect.h
perfect.o : perfect.c standard.h lookupa.h recycle.h perfect.h
Run Code Online (Sandbox Code Playgroud)
现在错误似乎是合理的,至少从我对makefile的最小理解,我有所有引用的.c,.h文件,但是我没有.o文件,似乎没有关于如何制作的任何说明这些.所以我的问题是:
我调用make实用程序错了吗?或者我是否需要先编译目标文件?或者......我需要在make文件中添加一些内容吗?
我再次提到所有引用的.c和.h文件.
编辑:对不起,我实际上错过了那个特定的文件似乎已经消失了.但是,将其添加回来就是我现在得到的错误:
c:\gen_progs\ph>mingw32-make
cc -O -c -o …Run Code Online (Sandbox Code Playgroud) MSDN并没有真正用简单的英语解释确切的差异,或者何时选择其中一个的信息.
返回通过表的行或表达式列表计算的校验和值.CHECKSUM旨在用于构建哈希索引.
返回通过表的行或表达式列表计算的二进制校验和值.BINARY_CHECKSUM可用于检测对表行的更改.
它确实暗示应该使用二进制校验和来检测行更改,但不是为什么.
我想通过透明地包含它们来进一步简化我的JSP.例如,这是我要删除的行:
<%@ include file="/jsp/common/include.jsp"%>
Run Code Online (Sandbox Code Playgroud)
include.jsp文件基本上声明了我正在使用的所有标记库.我在WebSphere 6.0.2上运行它我相信并且已经尝试过这个配置:
<!-- Include this for every JSP page so we can strip an extra line from the JSP -->
<jsp-config>
<jsp-property-group>
<url-pattern>*.htm</url-pattern>
<!--<include-prelude>/jsp/common/include.jsp</include-prelude>-->
<include-coda>/jsp/common/include.jsp</include-coda>
</jsp-property-group>
</jsp-config>
Run Code Online (Sandbox Code Playgroud)
无论是include-prelude和include-coda没有工作.
我读到其他WebSphere用户无法启动并运行; 但是,tomcat用户能够.
我经常发现我的项目中有文件需要从文件系统和用户浏览器访问.一个例子是上传照片.我需要访问文件系统上的文件,以便我可以使用GD来改变图像或移动它们.但我的用户还需要能够从URL访问文件example.com/uploads/myphoto.jpg.
因为上传路径通常对应于我构成了一个似乎在大多数时间都可以工作的函数的URL.以这些路径为例:
文件系统/var/www/example.com/uploads/myphoto.jpg
如果我将变量设置为类似的东西,/var/www/example.com/我可以从文件系统路径中减去它,然后将其用作图像的URL.
/**
* Remove a given file system path from the file/path string.
* If the file/path does not contain the given path - return FALSE.
* @param string $file
* @param string $path
* @return mixed
*/
function remove_path($file, $path = UPLOAD_PATH) {
if(strpos($file, $path) !== FALSE) {
return substr($file, strlen($path));
}
}
$file = /var/www/example.com/uploads/myphoto.jpg;
print remove_path($file, /var/www/site.com/);
//prints "uploads/myphoto.jpg"
Run Code Online (Sandbox Code Playgroud)
有谁知道更好的方法来处理这个?
在我看来,无论何时我遇到内部呼叫或类型,就像我遇到了一个障碍.
即使它们可以像开源这样的代码访问,它仍然认为它们不是API代码本身的可用部分.也就是说它们好像不鼓励被修改.
除非绝对必要,否则应该让自己不使用内部关键字?
我问这是一个开源API.但仍然不是每个人都想要更改API,但主要是使用它来为应用程序本身编写自己的代码.
如何创建正则表达式以匹配字符串开头的单词.我们希望stop在字符串的开头匹配,任何东西都可以跟随它.
例如,表达式应匹配:
stop
stop random
stopping
Run Code Online (Sandbox Code Playgroud)
谢谢.
假设您有一个包含大量变量,函数和子例程的Fortran 90模块.在您的USE陈述中,您遵循哪种惯例:
, only :语法显式声明您正在使用哪些变量/函数/子例程,例如 USE [module_name], only : variable1, variable2, ...?USE [module_name]?一方面,该only子句使代码更加冗长.但是,它会强制您在代码中重复自己,如果您的模块包含许多变量/函数/子例程,那么事情就会开始变得难以驾驭.
这是一个例子:
module constants
implicit none
real, parameter :: PI=3.14
real, parameter :: E=2.71828183
integer, parameter :: answer=42
real, parameter :: earthRadiusMeters=6.38e6
end module constants
program test
! Option #1: blanket "use constants"
! use constants
! Option #2: Specify EACH variable you wish to use.
use constants, only : PI,E,answer,earthRadiusMeters
implicit none …Run Code Online (Sandbox Code Playgroud) 我正在使用ColdFusion 8.做这样的事情:
<cfheader name="content-disposition" value="attachment; filename=abc.xlsx">
<cfcontent type="application/msexcel">
<html>
Run Code Online (Sandbox Code Playgroud)
但我得到一个像abc.xlsx.XLS.
我试图获得一个原因的原因XLSX是因为有时XLS版本太大而且Office 2007被卡住打开它或者需要很长时间.
现在只有解决方法是等待,XLS在Office 2007中打开,另存为.XLSX然后再打开它.
任何帮助表示赞赏!
.net ×2
c ×1
c# ×1
coldfusion ×1
conventions ×1
excel ×1
excel-2007 ×1
filesystems ×1
fortran ×1
fortran90 ×1
gcc ×1
java ×1
jsp ×1
linux ×1
macos ×1
makefile ×1
mime-types ×1
mingw ×1
module ×1
mono ×1
pdfsharp ×1
php ×1
recursion ×1
regex ×1
sql-server ×1
url ×1
websphere ×1