部分重复此
注意:我已经通过我编写的一个工具广泛使用 JSLint,该工具会定期扫描我当前项目目录中最近更新/创建的 .js 文件。它极大地提高了我的工作效率,我怀疑有什么比 JSLint 更好的价格(它是免费的)。
也就是说,是否有任何分析工具可以找到重复或接近重复的代码块,其目标是更容易找到合并大文件或中小型项目的机会?
Php新手.
1.这个PHP和MySQL代码有什么问题吗?
include_once "db_login.php" ;
$sql = "DROP TEMPORARY TABLE IF EXISTS temp_sap_id_select" ;
mysql_query ( $sql ) or ( "Error " . mysql_error () ) ;
$sql = " CREATE TEMPORARY TABLE temp_sap_id_select
(
`current_page` INT NOT NULL,
`total_pages` INT NOT NULL,
`select_date` DATE NOT NULL,
`select_schcode` CHAR(6) NOT NULL,
`select_user` CHAR(30) NOT NULL,
`select_id` CHAR(9) NOT NULL
) " ;
mysql_query ( $sql ) or ( "Error " . mysql_error () ) ;
Run Code Online (Sandbox Code Playgroud)
2.不可否认,我是一个沉闷的男孩,但无论如何我会问:如果我使用MySQL GUI并打开目标数据库,它是否会知道PHP/MySQL创建的上述临时表(如果临时表是否正确创建)?
我在做:
html = new WebClient().DownloadString(
"http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=" + biocompany);
Run Code Online (Sandbox Code Playgroud)
我收到错误:
Error 1 Operator '&' cannot be applied to operands of type 'string' and 'string'
但我甚至没有使用&!
请帮忙!
我无法使用以下代码同时播放多个声音/哔声.在我的onclicklistener
我已经加入:
public void onClick(View v) {
mSoundManager.playSound(1);
mSoundManager.playSound(2);
}
Run Code Online (Sandbox Code Playgroud)
但是这一次只播放一个声音,声音索引为1,声音索引为2.
每当有onClick()事件时,如何使用此代码同时播放至少2个声音?
public class SoundManager {
private SoundPool mSoundPool;
private HashMap<Integer, Integer> mSoundPoolMap;
private AudioManager mAudioManager;
private Context mContext;
public SoundManager()
{
}
public void initSounds(Context theContext) {
mContext = theContext;
mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
mSoundPoolMap = new HashMap<Integer, Integer>();
mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
}
public void addSound(int Index,int SoundID)
{
mSoundPoolMap.put(1, mSoundPool.load(mContext, SoundID, 1));
}
public void playSound(int index) {
int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, …
Run Code Online (Sandbox Code Playgroud) 一个cpp文件:
#include <iostream>
#include <jni.h>
#include "Hello.h"
#include "windows.h"
#include "stdafx.h"
typedef void(__stdcall *Print_)();
int main(){
HINSTANCE hDll; //DLL??
Print_ print_; //????
hDll = LoadLibrary("Hello.dll");
if (hDll != NULL)
{
print_ = (Print_)GetProcAddress(hDll,"Java_Hello_sayHello@8");
if(print_!=NULL)
{
print_();
}
FreeLibrary(hDll);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
//有错误,打印出来: http ://i983.photobucket.com/albums/ae311/keatingWang/c_wrong.png未声明的标识符表示:未声明的标识符
我发现了一个SOF http://www.codeproject.com/KB/library/SOF_.aspx,在C++中是否还有其他稳定的模块化框架?
我有一个头文件,列出了所有的枚举(#ifndef #define #endif构造用于避免多次包含该文件),我在我的应用程序中的多个cpp文件中使用.文件中的一个枚举是
enum StatusSubsystem {ENABLED,INCORRECT_FRAME,INVALID_DATA,DISABLED};
Run Code Online (Sandbox Code Playgroud)
应用程序中有一些功能被视为
ShowStatus(const StatusSubsystem&);
Run Code Online (Sandbox Code Playgroud)
在应用程序早期我调用上面的函数时就像
ShowStatus(INCORRECT_FRAME);
Run Code Online (Sandbox Code Playgroud)
我的应用程序用于编译完美.但是在添加了一些代码后,编译停止会发出以下错误:
File.cpp:71: error: invalid conversion from `int' to `StatusSubsystem'
File.cpp:71: error: initializing argument 1 of `void Class::ShowStatus(const StatusSubsystem&)
Run Code Online (Sandbox Code Playgroud)
我检查了代码中新代码中任何冲突的枚举,看起来很好.
我的问题是编译器显示为错误的函数调用有什么问题?
供您参考,函数定义是:
void Class::ShowStatus(const StatusSubsystem& eStatus)
{
QPalette palette;
mStatus=eStatus;//store current Communication status of system
if(eStatus==DISABLED)
{
//select red color for label, if it is to be shown disabled
palette.setColor(QPalette::Window,QColor(Qt::red));
mLabel->setText("SYSTEM");
}
else if(eStatus==ENABLED)
{
//select green color for label,if it is to be shown enabled
palette.setColor(QPalette::Window,QColor(Qt::green));
mLabel->setText("SYSTEM");
}
else …
Run Code Online (Sandbox Code Playgroud) 我想接受用户输入(有时这将是大段落)并生成LaTeX文档.我正在考虑一些简单的正则表达式来替换\
with的\textbackslash
所有实例{
或者}
用\}
或的所有实例\{
.
我怀疑这是否足够.我还需要做什么?注意:如果有一个特殊的库,我正在使用python.
为了澄清,我不希望任何东西被解析为LaTeX语法:$a$
应该替换为\$a\$
.
我有一个使用Fluent NHibernate 1.0 RTM和System.Data.SQLite 1.0.65的WPF应用程序在.Net 3.5中运行良好.当我尝试将其升级到.Net 4.0时,所有内容都会编译,但我得到一个运行时错误,其中最内层的异常是:
`The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found.`
Run Code Online (Sandbox Code Playgroud)
对项目进行的唯一更改是将Target Framework切换到4.0.
c++ ×3
.net ×1
android ×1
audio ×1
boost ×1
c ×1
c# ×1
const ×1
frameworks ×1
latex ×1
linux ×1
mysql ×1
nhibernate ×1
osgi ×1
parameters ×1
php ×1
python ×1
qt ×1
refactoring ×1
reference ×1
sanitization ×1
soundpool ×1
sqlite ×1
temp-tables ×1