- Jan 06 Wed 2016 18:17
window python安裝cjson出現Unable to find vcvarsall.bat.
- Oct 07 Wed 2015 17:31
Unity 常見錯誤訊息
http://www.cg.com.tw/Unity/htm/Unity_030.asp
您是否曾經在使用 Unity 的過程遇到難以解決的問題?透過 Unity 顯示的錯誤訊息通常可以找出原因,並且進一步尋找解決的方法。此外,若遇到正常操作不該發生的問題,有時先存檔並關閉 Unity 程式,再重新開啟 Unity 或許就可以排除問題。
- Sep 10 Thu 2015 11:11
unity C# 判斷語系區域
如題,要判斷語系如cn, tw可以使用
string systemName = System.Globalization.CultureInfo.CurrentCulture.Name; // en-US
- May 13 Wed 2015 15:49
unity major version 51 is newer than 50, the highest major version supported by this compiler.
- May 13 Wed 2015 15:43
Unity3D Android Build Error WIN32 Exception ZipAlign
- May 04 Mon 2015 14:38
[apache]httpd.conf的參數說明
AllowOverride的屬性功能:
-- Limit 允許蓋掉原聯結屬性得範圍
-- Authconfig 可做密碼設定:如:藏密
-- Options 可將該目錄之Options 功能覆蓋
-- FileInfo 可將該目錄之任何文件型態覆蓋,如defaultType,ErrorType
-- Indexs 可將該目錄之顯式列印功能覆蓋,如:AddIcon,HeaderName.ReadName
Options的屬性功能:
-- Indexs 當無index.html可用列印目錄方式顯式,如:center3 homepage 若用 -Indexs 則看不見 listing
-- FollowSymLinks 加一屬性如+FollowSymLinks可允許使用symbol link 時,依舊可瀏覽
-- ExecCGI 當為 +ExecCGI可執行 CGI SCRIPT
-- Includes 可執行Server site include,若為 +Includes
-- IncludesNOEXEC 可執行Server site include,若為 +Includes,但不可執行CGI
-- None 沒有任何功能可用
-- All 均可
以 +, - 符號可加或刪減其功能,若未給符號,則只有初步功能
Limit的屬性功能:
-- GET 限定取得文件法,如:<Limit GET>
-- POST 限定cgi post方法,如:<Limit POST>
-- order 限定拒絕或允許的次序
-- deny 限定拒絕範圍,如deny from all 或 deny from .mycompany.com
-- allow 限定允許範圍,如:allow from all 或 allow from 192.153.22
AuthConfig 之方法 & .htaccess 範例:
<Files index.html>
#與Directory同,但在 .htaccess 只能用他 AuthName Members-only 設定僅 Member 才可入,
#僅為名稱 AuthType Basic 解碼方法 AuthUserFile /home1/users/center/center21/public_html/wwwclass/bau
#密碼表位置(絕對位置) AuthGroupFile /home1/users/center/center21/public_html/wwwclass/group
#同群表位置
<Limit GET>
#限制取件
require user center21
#bau的密碼表有很多user,但....
order allow,deny
#先允許在拒絕
allow from all
#允許全部
</Limit>
<Files>
密碼表之產生方法:
找到及取得htpasswd程式
執行htpasswd -c filename username (第一次,以後僅htpasswd filename username)
修改需要的 user (在 require 後)
require用法:
require user center21 center3
require group cc cv ee
‧參數語法一覽表
語法:ServerType [standalone/inted]
-- 說明:定義 httpd 的啟動方式
-- standalone:開機後立即執行,效率較高,http獨立執行,即使沒有瀏覽者連入本網站,
-- 都會啟動httpd以隨畤提供服務。
-- inted:需要時才臨時啟動,監聽所有進入本機請求的port,然後核對port所對應的服務,
-- 以決定要用哪一個服務,再執行httpd,當請求完結就將httpd結束。
語法:Port [編號]
-- 說明:指定 httpd 服務的閘道,一般是 80,2000 以後的 URL 就必須寫成 http://xx.xx.xx.xx:2000/
- Nov 17 Mon 2014 19:00
C#使用SharpSVN的例子 更新 提交检查版本都俱全
public class SVNUtils
{
public static bool Cancel;
private readonly SvnClient SC;
private string path;
private string prog;
private string svnurl;
public SVNUtils()
{
svnurl = "svn://127.0.0.1:" + TCS.Config.AppConfig.RunTime.SVNPort.ToString();
SC = new SvnClient();
SvnUriTarget rem = new SvnUriTarget(svnurl);
SC.Authentication.ClearAuthenticationCache();
SC.Authentication.Clear();
SC.Authentication.DefaultCredentials = new SvnCredentialProvider(
TCS.Config.AppConfig.RunTime.SVNUsername,
TCS.Config.AppConfig.RunTime.SVNPassword,
svnurl);//默认用户名密码
}
public bool Commit()
{
Console.WriteLine("开始检查是否需要提交新参数表...");
SvnCommitArgs ca = new SvnCommitArgs();
SvnStatusArgs sa = new SvnStatusArgs();
Collection<SvnStatusEventArgs> statuses;
SC.GetStatus(GetAppLoc(), sa, out statuses);
int i = 0;
foreach (var item in statuses)
{
if (item.LocalContentStatus != item.RemoteContentStatus)
{
i++;
}
if (!item.Versioned)
{
SC.Add(item.FullPath);
Console.WriteLine("新增加文件" + item.FullPath);
i++;
}
else if (item.Conflicted)
{
SC.Resolve(item.FullPath, SvnAccept.Working);
Console.WriteLine("处理冲突文件" + item.FullPath);
}
else if (item.IsRemoteUpdated)
{
SC.Update(item.FullPath);
Console.WriteLine("处理冲突文件" + item.FullPath);
}
else if (item.LocalContentStatus == SvnStatus.Missing)
{
SC.Delete(item.FullPath);
Console.WriteLine("处理丢失文件" + item.FullPath);
i++;
}
}
if (i > 0)
{
ca.LogMessage = "";
SvnCommitResult scr;
if (SC.Commit(GetAppLoc(), ca, out scr))
{
Console.WriteLine("提交完成");
}
else
{
Console.WriteLine("提交失败");
}
}
else
{
Console.WriteLine("无变化,无需检查");
}
return true;
}
/// <summary>
/// 获取本地工作副本svn路径
/// </summary>
/// <returns></returns>
public string GetAppLoc()
{
return Comm.parentPath + Comm.issuedPath;
}
/// <summary>
/// 检查版本号,如果版本号不符, 则更新
/// </summary>
/// <returns></returns>
public bool CheckVer()
{
bool result = true;
var repos = new SvnUriTarget(svnurl);
var local = new SvnPathTarget(GetAppLoc());
try
{
notiny = "正在检查服务器版本...";
ShowInfo();
SvnInfoEventArgs serverInfo;
bool oks = SC.GetInfo(repos, out serverInfo);
notiny = "正在检查本地版本...";
ShowInfo();
SvnInfoEventArgs clientInfo;
bool okc = SC.GetInfo(local, out clientInfo);
if (oks && okc) //如果客户端服务端都会成功, 则对比服务器版本, 否则返回true 执行更新命令
{
result = (serverInfo.Revision > clientInfo.Revision);
}
ShowInfo(string.Format("检查完毕,服务器版本{0}客户端版本{1}",
(serverInfo != null ? serverInfo.Revision.ToString() : "(未知)"),
(clientInfo != null ? clientInfo.Revision.ToString() : "(未知)")
));
}
catch (Exception)
{
ShowInfo("检查文件是出现错误...");
}
return result;
}
/// <summary>
/// 初始化 如果没有被管理,则签出
/// </summary>
/// <returns></returns>
public bool Init()
{
ShowInfo("正在初始化....");
bool result = true;
HandEvents();
if (!SvnTools.IsManagedPath(GetAppLoc()))//查看某目录是否是受svn管理的状态, 即是否为工作副本
{
notiny = "正在检出文件.";
ShowInfo();
result = SC.CheckOut(new SvnUriTarget(svnurl), GetAppLoc());
ShowInfo("文件检出完成.");
}
ShowInfo("初始化完毕.");
return result;
}
/// <summary>
/// 委托各种事件。
/// </summary>
private void HandEvents()
{
SC.Authentication.UserNamePasswordHandlers += Authentication_UserNamePasswordHandlers;
SC.Authentication.UserNameHandlers += Authentication_UserNameHandlers;
SC.Progress += SC_Progress;
SC.Processing += SC_Processing;
SC.Notify += SC_Notify;
SC.SvnError += SC_SvnError;
SC.Conflict += SC_Conflict;
SC.Cancel += SC_Cancel;
SC.Committed += SC_Committed;
SC.Committing += SC_Committing;
}
/// <summary>
/// 提交过程
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void SC_Committing(object sender, SvnCommittingEventArgs e)
{
ShowInfo("正在提交");
}
/// <summary>
/// 提交完成后
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void SC_Committed(object sender, SvnCommittedEventArgs e)
{
ShowInfo("提交完成" + e.Revision);
}
/// <summary>
/// 被取消
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SC_Cancel(object sender, SvnCancelEventArgs e)
{
e.Cancel = Cancel;
}
/// <summary>
/// 遇到文件冲突
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SC_Conflict(object sender, SvnConflictEventArgs e)
{
ShowInfo("文件冲突" + e.ConflictReason.ToString());
}
/// <summary>
/// 任何svn错误可以在这处理,也可以在这里处理是否取消
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SC_SvnError(object sender, SvnErrorEventArgs e)
{
e.Cancel = true;
WriteError(e.Exception);
}
/// <summary>
/// 输出错误
/// </summary>
/// <param name="e_Exception"></param>
public void WriteError(Exception e_Exception)
{
ShowInfo(e_Exception.Message + e_Exception.Source + "\r\n"
+ e_Exception.StackTrace + "\r\n"
);
}
/// <summary>
/// 处理某项操作
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SC_Processing(object sender, SvnProcessingEventArgs e)
{
Console.SetCursorPosition(0, Console.CursorTop);
Console.Write("正在处理操作" + e.CommandType.ToString() + ".......");
}
/// <summary>
/// 处理过程,进度,,比如传送的字节数等显示
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SC_Progress(object sender, SvnProgressEventArgs e)
{
if (e.Progress == 0)
{
prog = "";
}
else
{
if (e.TotalProgress ==
-1)
{
if (e.Progress > 1024)
{
prog = ((float)(e.Progress) / 1024F).ToString("0.00") + "KB";
}
else
{
prog = ((float)(e.Progress)).ToString("0.00") + "Bytes";
}
}
else
{
prog = (e.Progress).ToString("0.00");
}
}
ShowInfo();
}
public void ShowInfo()
{
Console.SetCursorPosition(0, Console.CursorTop);
Console.Write(notiny + (string.IsNullOrWhiteSpace(prog) ? "" : "(" + prog + ")"));
}
public void ShowInfo(string info)
{
Console.WriteLine(info);
}
public bool Update(int i)
{
bool ok = false;
try
{
var sua = new SvnUpdateArgs { Revision = new SvnRevision(i) };
events();
ok = SC.CleanUp(GetAppLoc());
ok = SC.Update(GetAppLoc(), sua);
}
catch (Exception ex)
{
ShowInfo("更新时遇到问题:" + ex.Message + "\r\n");
WriteError(ex);
}
ShowInfo("更新完成....");
return ok;
}
public bool Update()
{
ShowInfo("正在更新....");
SC.CleanUp(GetAppLoc());
bool ok = SC.Update(GetAppLoc());
if (!ok)
{
ShowInfo("未成功,正在清理...");
SC.CleanUp(GetAppLoc());
ShowInfo("清理完毕,正在更新....");
ok = SC.Update(GetAppLoc());
if (!ok)
{
ShowInfo("正在撤销本地修改....");
SC.Revert(GetAppLoc());
ShowInfo("正在清理....");
SC.CleanUp(GetAppLoc());
ShowInfo("正在更新....");
ok = SC.Update(GetAppLoc());
}
}
ShowInfo("更新操作完成");
return ok;
}
private void Authentication_UserNameHandlers(object sender, SvnUserNameEventArgs e)
{
e.UserName = TCS.Config.AppConfig.RunTime.SVNUsername;
}
private void Authentication_UserNamePasswordHandlers(object sender, SvnUserNamePasswordEventArgs e)
{
e.Password = TCS.Config.AppConfig.RunTime.SVNPassword;
e.UserName = TCS.Config.AppConfig.RunTime.SVNUsername;
}
#region 提示信息
private string notiny;
private void SC_Notify(object sender, SvnNotifyEventArgs e)
{
notiny = string.Format("{0}:{1}.", getstringact(e.Action), new FileInfo(e.FullPath).Name);
ShowInfo();
}
#endregion
#region 提示信息中文对照
public string getstringact(SvnNotifyAction act)
{
string result = null;
switch (act)
{
case SvnNotifyAction.Add:
result = "添加";
break;
case SvnNotifyAction.BlameRevision:
break;
case SvnNotifyAction.ChangeListClear:
break;
case SvnNotifyAction.ChangeListMoved:
break;
case SvnNotifyAction.ChangeListSet:
break;
case SvnNotifyAction.CommitAddCopy:
result = "提交添加副本";
break;
case SvnNotifyAction.CommitAdded:
break;
case SvnNotifyAction.CommitDeleted:
break;
case SvnNotifyAction.CommitModified:
break;
case SvnNotifyAction.CommitReplaced:
break;
case SvnNotifyAction.CommitReplacedWithCopy:
break;
case SvnNotifyAction.CommitSendData:
break;
case SvnNotifyAction.Copy:
break;
case SvnNotifyAction.Delete:
break;
case SvnNotifyAction.Excluded:
result = "要排除";
break;
case SvnNotifyAction.Exists:
result = "已存在";
break;
case SvnNotifyAction.ExternalFailed:
result = "外部失败";
break;
case SvnNotifyAction.FailedConflict:
result = "失败冲突";
break;
case SvnNotifyAction.FailedForbiddenByServer:
break;
case SvnNotifyAction.FailedLocked:
break;
case SvnNotifyAction.FailedMissing:
break;
case SvnNotifyAction.FailedNoParent:
break;
case SvnNotifyAction.FailedOutOfDate:
result = "已过期且失败";
break;
case SvnNotifyAction.FollowUrlRedirect:
break;
case SvnNotifyAction.LockFailedLock:
break;
case SvnNotifyAction.LockFailedUnlock:
break;
case SvnNotifyAction.LockLocked:
break;
case SvnNotifyAction.LockUnlocked:
break;
case SvnNotifyAction.MergeBegin:
break;
case SvnNotifyAction.MergeBeginForeign:
break;
case SvnNotifyAction.MergeCompleted:
break;
case SvnNotifyAction.NonExistentPath:
break;
case SvnNotifyAction.PatchApplied:
break;
case SvnNotifyAction.PatchAppliedHunk:
break;
case SvnNotifyAction.PatchFoundAlreadyApplied:
break;
case SvnNotifyAction.PatchRejectedHunk:
break;
case SvnNotifyAction.PropertyAdded:
break;
case SvnNotifyAction.PropertyDeleted:
break;
case SvnNotifyAction.PropertyDeletedNonExistent:
break;
case SvnNotifyAction.PropertyModified:
break;
case SvnNotifyAction.RecordMergeInfo:
break;
case SvnNotifyAction.RecordMergeInfoElided:
break;
case SvnNotifyAction.RecordMergeInfoStarted:
break;
case SvnNotifyAction.Resolved:
break;
case SvnNotifyAction.Restore:
result = "恢复";
break;
case SvnNotifyAction.Revert:
result = "还原";
break;
case SvnNotifyAction.RevertFailed:
result = "还原失败";
break;
case SvnNotifyAction.RevisionPropertyDeleted:
break;
case SvnNotifyAction.RevisionPropertySet:
break;
case SvnNotifyAction.Skip:
result = "跳过";
break;
case SvnNotifyAction.SkipConflicted:
result = "跳过冲突";
break;
case SvnNotifyAction.StatusCompleted:
result = "状态已完成";
break;
case SvnNotifyAction.StatusExternal:
break;
case SvnNotifyAction.TreeConflict:
result = "数冲突";
break;
case SvnNotifyAction.UpdateAdd:
result = "更新新增";
break;
case SvnNotifyAction.UpdateCompleted:
result = "更新已完成";
break;
case SvnNotifyAction.UpdateDelete:
result = "更新删除";
break;
case SvnNotifyAction.UpdateExternal:
result = "更新外部";
break;
case SvnNotifyAction.UpdateExternalRemoved:
result = "更新外部已删除";
break;
case SvnNotifyAction.UpdateReplace:
result = "更新替换";
break;
case SvnNotifyAction.UpdateShadowedAdd:
break;
case SvnNotifyAction.UpdateShadowedDelete:
break;
case SvnNotifyAction.UpdateShadowedUpdate:
break;
case SvnNotifyAction.UpdateSkipAccessDenied:
break;
case SvnNotifyAction.UpdateSkipObstruction:
break;
case SvnNotifyAction.UpdateSkipWorkingOnly:
break;
case SvnNotifyAction.UpdateStarted:
result = "更新已开始";
break;
case SvnNotifyAction.UpdateUpdate:
result = "更新修改";
break;
case SvnNotifyAction.UpgradedDirectory:
result = "更新目录";
break;
}
return result ?? (result = act.ToString());
}
#endregion
}
- Sep 06 Sat 2014 10:30
unity abstract template
- Sep 06 Sat 2014 10:22
unity Singleton 用法
- Aug 08 Fri 2014 19:19
Unity IEnumerator 傳回值
- Aug 05 Tue 2014 14:20
unity & android plugin Can't create handler inside thread that has not called Looper.prepare()
在整合unity 呼叫android 方法時,若出現如下錯誤
Can't create handler inside thread that has not called Looper.prepare()
- Aug 04 Mon 2014 23:18
顯示&隱藏 Mac 資料夾
- Jul 01 Tue 2014 16:58
UIApplication物件及其代理UIApplicationDelegate
- Jul 01 Tue 2014 12:06
xcode application:didFinishLaunchingWithOptions
Tells the delegate that the launch process is almost done and the app is almost ready to run.
(告訴delegate啟動進程即將完成,應用程式即將開始運行)
- Jun 25 Wed 2014 11:05
Xcode的Other Linker Flags
首先,要說明一下Other Linker Flags到底是用來幹嘛的。說白了,就是ld命令除了默認參數外的其他參數。ld命令實現的是連結器的工作,詳細說明可以在終端man ld查看。
如果有人不清楚連結器是什麼東西的話,我可以作個簡單的說明。
- May 09 Fri 2014 16:50
Python TimeZone Country List
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
- Apr 30 Wed 2014 12:34
Eclipse 中文亂碼解決方法
【Eclipse】中文亂碼解決方法:環境編碼設定改 UTF-8
- Apr 29 Tue 2014 14:37
解決Tortoise svn 衝突 方法 --node remains in conflict
svn remove --force filename
svn resolve --accept=working filename
svn commit