四套不錯的影片剪輯(含線上操作)


以下是四款不同的剪輯軟喔 !~
蠻推薦最後兩款

-------------------------------------------------------------------------------------

Avidemux

Avidemux下載網址:http://0rz.tw/EQU7W

教學
http://www.techbang.com/posts/8002-190-cover-part2-easily-cut-editing-high-definition-movie-memories-scenes-jumping-on-january?page=2



















-------------------------------------------------------------------------------------



Free Video Dub

Free Video Dub下載網址:http://www.dvdvideosoft.com

教學
http://www.techbang.com/posts/8002-190-cover-part2-easily-cut-editing-high-definition-movie-memories-scenes-jumping-on-january?page=4






















-------------------------------------------------------------------------------------

影片剪輯雲端中文版 WeVideo
http://www.bnext.com.tw/ext_rss/view/id/680515





















-------------------------------------------------------------------------------------


yutube自己出的剪輯軟體
https://free.com.tw/tubechop/

剪完後 把網址丟到這裡 http://www.clipconverter.cc/ 就可以下載yutube剪完後的影片







flash轉格式在illustrator上開啟





此篇備忘錄 請參考圖片


底下這玩具叫太空飛球,小時候只能看別人玩,感覺好像很難的樣子
終於有時間自己買回來動手做做看,蠻有趣的,也真的蠻難的

困難的點主要都是在橋買回來的線要折或彎曲成自己要的路線
鋼珠要不斷的試跑路線看是否順暢,讓它成為一個迴流回到路線上
造成一個迴圈









moto 360 2nd(2代)介紹與實際應用


花了好些時間,透過美國代購 USBuy , 2個星期後入手moto360 2nd
這次選擇46mm 較大的錶框


















接著進行初始化工作,電力需保持50%以上,
而且一定要用moto自己的磁力充電,並且連結一隻手機
配對的軟體請指定使用 android wear
一般藍芽配對是無效的喔
(藍芽可以配對,但後續安裝app與一些相對應的功能安裝時會有異常)
如果不小心與藍芽配對造成的異常,可以重新factory reset




















接著進入手錶畫面就可以開始在手機上安裝app
安裝後的app會自動同步sync到手錶上

1.首先錶面選擇樣式是一定要的啦
除了原廠附的外,還有其他app可下載其他錶面做選擇
(google play搜尋 wear face)
註:不知是否有注意到,搜尋穿戴裝置時,關鍵字請加 wear



2.客製化錶面
客製化錶面的app也不少,這裡選一個我比較喜歡用的
Custom Photo Watch
在相簿裡選要放的照片.縮放到適合大小做剪裁動作

















3.地圖功能
其實我最關心就是地圖功能,希望可以看著手錶地圖在國外到處閒晃
不用拿著手機,目前使用的app可以小小滿足,但還有很多改進空間

底下這張圖是 mini map定位結果,大多路名還是英文




















底下這張則是city map定位結果,是目前wear map裡面最快速也是快好的






















原生的google就先不用想,非常難用,很多問題未解決



















即時透過語音搜尋中文地名,要看細部地圖操作上也是很困難























4.電池的使用量
電池在原本的moto360裡是找不到目前電量資訊
所以特地安裝了一個 Wear Battery Stats






















5.google 搜尋
搜尋結果呈現,結果表現是還可以,即使選擇46mm較大的螢幕
看起來還是很吃力,


























6.手機上圖片瀏覽
目前其實還沒有一個app真正做的好的,所以筆著先用 MyRoll這套來介紹

MyRoll的確真的可以搜尋手機上所有相簿內容
可惜是解析較高的圖片它無法縮放,導致在手錶上看會很不清楚























一般圖片解析度剛好的,瀏覽起來就還ok























7.moto其實內建很多關於人健康輔助的app
像是心率,每日步數之類


每日步數,目標是10000,他會顯示一週內的狀況,昨天的步數,還差幾步到達目標


















video 頻寬 bandwidth 較高時 buffer 異常


目前使用 video頻寬bandwidth 超過 800Kb
會造成 buffer 異常或暴量之情況

ResolveVideoURL("rtmp://url");


function asyncErrorHandler(event:AsyncErrorEvent):void 
{ 
    trace(event.text); 
} 


function doPlay1() 
{
    //if( vns1 !=null )vns1.close(); vns1 = null ;

    vns1 = new NetStream(vnc1);
    vns1.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); 


    mv1.attachNetStream(vns1);
    //mv1.smoothing = true;
    vns1.bufferTime = 1 ;
    vns1.play(CVL2);

}

function ResolveVideoURL( Url: String  )
{
    var tmpLOC : int = Url.lastIndexOf("/");

    CVL1 = Url.slice( 0 , tmpLOC ); 
    CVL2 = Url.slice( tmpLOC + 1 ); 

    vnc1.connect(CVL1);
}


has anybody ever get video return bufferLength overflow? like below image
it should be very close to 1 , but get a large amount of it
it's encoding use vp6 , 800Kb(flow)
http://i.stack.imgur.com/CO2Ww.png 
shareimprove this question
   
It shouldn't always be 1, because pausing the NetStream can increase the NetStream.bufferLength but it's really weird to get that value ! Could you add more details about the problem ? What did you exactly did to get that behavior ? Is it a recurrent behavior ? Did you tried different streams ? ... – akmozo Oct 29 at 12:56
   
I tried to use lower bandwith 400k , 200k , it was not happened , mostly in 800k , now I detect higher buffer happen , try to reconnect or connect another stream until buffer back to normal – nlstudio Oct 30 at 6:10

提升分頁搜尋效能


拿 45000 筆資料
搜尋分頁 1500 , 每頁 100
比較搜尋所需時間


 $sql="Select * from table  limit 1500 , 100";
 //傳桶寫法 




 $sql = "Select * From table Where uuid >=( Select uuid From table Order By uuid limit 1500,1) limit 100 ";
 //排除某一範圍以外的uuid ,再做一次搜尋

利用JS 模擬 php timer 觸發事件



<script type="text/javascript">

var milliSeconds = 2000;
//milliSeconds 設定定時觸發毫秒數
setInterval( function() {

 var xmlhttp;

 if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
 {
         xmlhttp=new XMLHttpRequest();
 }
 else{
         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); // code for IE6, IE5
        }

 xmlhttp.onreadystatechange=function()
 {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
  {
   console.log ( xmlhttp.responseText );
  } 
 }

 xmlhttp.open("POST","http://your.url.php",true);
        //要觸發開啟的php位置
 xmlhttp.send();

        }, milliSeconds);
  
</script>

websocket for SmartFoxServer




底下要介紹 SmartFoxServer 支援多種各種不同的 client(客戶單)提供使用
再接下來部份 , 介紹其中 SFS for websocket(html5)使用時,整個環境安裝


1.首先到官網下載適合自己os(作業系統)SFS版本
http://www.smartfoxserver.com/download/sfs2x#p=installer




































2.下載 websocket for SFS 範例 , 在同頁找到example頁籤
找到 HTML5 examples pack 選擇 Download







































3.安裝 SFServer , 將下載下來的 SFS2X_windows-x64_2_9_0.exe
 
 進行安裝



4.安裝
webService
   這裡可以自行選擇想使用的webservice 
   這裡提供最簡單作法直接安裝 apache 

   http://www.appservnetwork.com/


5.若您是使用apache安裝完後會在C:\AppServ (視當時安裝目錄調整路逕 )
將剛才的websocket 範例放置在網頁目錄下(參考下圖)





















6.在瀏覽器測試一下,剛才放置的範例是否正常顯示
http://127.0.0.1/AdvancedChat/
若正確,應該如下圖所呈現


























7.接著進入 SFS 後台對 webSocket 服務開啟
   在瀏覽器輸入 http://127.0.0.1:8080/admin/ 進入控制後台
   帳密預設都是 sfsadmin


















8.點擊左側 Admin modul , 再選擇 Server Configurator



































9.選擇進入 HTML5 websocket 頁籤
   將 Activate WebSocket Protocol 開啟 , 再點擊 Submit 提交
  註 : 無法透過 websocket 連接 gameserver , 大多原因都是 webSocket listener 沒有開啟
  The great majority  Could't connect smartfox Server by websocket ,
   cause webSocket listener has not open 























提交後 , 記得再點擊右側 restart 重啟 sfs 服務




10.再到控制台服務開啟 sfs2x - service







11.再嘗試 進 http://127.0.0.1/AdvancedChat/
   
 試著登入,與是否能連接上 server 



將 win-flash 發佈(publish) dmg on Mac



原檔若是在windows製作,

1.先在mac版 flash 開新專案(for destop)桌面專案

2.複製內容至mac版flash貼上

3,在file -> publish 發佈為 dmg (下拉選擇格式) 可選 air

設定MariaDB語系UTF8




參考文章 :

http://codex.wiki/post/101589-424


http://bunkera.pixnet.net/blog/post/24326115-mysql%E8%AA%BF%E6%95%B4%E6%88%90%E5%85%A8utf-8%E8%AA%9E%E7%B3%BB

無法透過遠端連至MariaDB , Configuring MariaDB for Remote Client Access

MariaDB packages bind MariaDB to 127.0.0.1 (the loopback IP address) by default as a security measure using the bind-addressconfiguration directive. Old MySQL packages sometimes disabled TCP/IP networking altogether using the skip-networking directive. Before going in to how to configure these, let's explain what each of them actually does:
  • skip-networking is fairly simple. It just tells MariaDB to run without any of the TCP/IP networking options.
  • bind-address requires a little bit of background information. A given server usually has at least two networking interfaces (although this is not required) and can easily have more. The two most common are a Loopback network device and a physical Network Interface Card (NIC) which allows you to communicate with the network. MariaDB is bound to the loopback interface by default because it makes it impossible to connect to the TCP port on the server from a remote host (the bind-address must refer to a local IP address, or you will receive a fatal error and MariaDB will not start). This of course is not desirable if you want to use the TCP port from a remote host, so you must remove this bind-address directive (MariaDB only supports one bind-address, but binds to 0.0.0.0, or :: (every IP) if the bind-address directive is left out).

Finding the defaults file

To enable MariaDB to listen to remote connections, you need to edit your defaults file. See Configuring MariaDB with my.cnf for more detail.
Common locations for defaults files:
  * /etc/my.cnf                              (*nix/BSD)
  * $MYSQL_HOME/my.cnf                       (*nix/BSD) *Most Notably /etc/mysql/my.cnf
  * SYSCONFDIR/my.cnf                        (*nix/BSD)
  * DATADIR\my.ini                           (Windows)

Editing the defaults file

Once you have located the defaults file, use a text editor to open the file and try to find lines like this under the [mysqld] section:
 [mysqld]
    ...
    skip-networking
    ...
    bind-address = <some ip-address>
    ...
(The lines may not be in this order, and the order doesn't matter.)
If you are able to locate these lines, make sure they are both commented out (prefaced with hash (#) characters), so that they look like this:
 [mysqld]
    ...
    #skip-networking
    ...
    #bind-address = <some ip-address>
    ...
(Again, the order of these lines don't matter)
Save the file and restart the mysqld daemon or service (see Starting and Stopping MariaDB).

Granting user connections from remote hosts

Now that your MariaDB server installation is setup to accept connections from remote hosts, we have to add a user that is allowed to connect from something other than 'localhost' (Users in MariaDB are defined as 'user'@'host', so 'chadmaynard'@'localhost' and 'chadmaynard'@'1.1.1.1' (or 'chadmaynard'@'server.domain.local') are different users that can have completely different permissions and/or passwords.
To create a new user:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 5.5.28-MariaDB-mariadb1~lucid mariadb.org binary distribution

Copyright (c) 2000, 2012, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
  • if you are interested in viewing any existing remote users, issue the following SQL statement on the mysql.user table:
SELECT User, Host FROM mysql.user WHERE Host <> 'localhost';
+--------+-----------+
| User   | Host      |
+--------+-----------+
| daniel | %         |
| root   | 127.0.0.1 |
| root   | ::1       |
| root   | gandalf   |
+--------+-----------+
4 rows in set (0.00 sec)
(If you have a fresh install, it is normal for no rows to be returned)
Now you have some decisions to make. At the heart of every grant statement you have these things:
  • list of allowed privileges
  • what database/tables these privileges apply to
  • username
  • host this user can connect from
  • and optionally a password
It is common for people to want to create a "root" user that can connect from anywhere, so as an example, we'll do just that, but to improve on it we'll create a root user that can connect from anywhere on my local area network (LAN), which has addresses in the subnet 192.168.100.0/24. This is an improvement because opening a MariaDB server up to the Internet and granting access to all hosts is bad practice.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.%' IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;
(% is a wildcard)
At this point we have accomplished our goal and we have a user 'root' that can connect from anywhere on the 192.168.100.0/24 LAN.
For more information about how to use GRANT, please see the GRANT page.

Caveats

  • if your system is running a software firewall (or behind a hardware firewall or NAT) you must allow connections destined to TCP port that MariaDB runs on (by default and almost always 3306).
  • to undo this change, simply uncomment the bind-address line in your defaults file.
The initial version of this article was copied, with permission, from http://hashmysql.org/wiki/Remote_Clients_Cannot_Connect on 2012-10-30.
configuring-mariadb-for-remote-client-access(原文連結)

AdobeMediaServer 使用 H264 儲存



備忘錄 , 若使用 Adobe Meida Server4 (5) , 要做錄影(store ,record )
要儲存H264遇到的問題


Code path : //Adobe Media Server 5//applications//xtdRecorder//scriptlib//


( use vp6 )
NetStream.publish(fileName,"append");

( use h264 )
NetStream.publish("mp4:"+fileName+".flv","append");


flash 轉 html5


目前測試
 1.as2.0, as3.0基本語法(按紐動作都可被正常轉換)
2.限制1MB以下大小才可轉換


目前兩種方法:

1.使用google web線上轉換
developers.google.com/swiffy )


2.下載Adobe 輔助外掛在flash內轉換
(參考以下步驟)



步驟1.至 google develop  ( swiffy download )





步驟2.安裝Adobe Extension Manager CS6













步驟3.開啟flash,在 Commands 下拉選擇 HTML5轉換

php版本正負顏色千分號轉換


php版本正負顏色千分號轉換

在做網頁報表時,常用的格式轉換
此為php版本 , for laravel blade , 需要使用時可以依自己需求再修改

從外部參數傳遞給 $spend , 可接受 %


<style type="text/css">

    .LoseStyle{
 color:#E23636;
    }
</style>


<?php
       
     $spend02 = 0;
       
      if( substr($spend, -1) == "%" )
      (String)$spend02 = explode( substr($spend, -1) ,$spend  )[0];
      else 
      $spend02 = $spend;
        
      if( $spend02 >= 0 )
      {
            if( substr($spend, -1) != "%" )
            echo number_format($spend02,2);
            else 
            echo number_format($spend02,2).substr($spend, -1);
   
      }else{ 
?>
       
 <a class="LoseStyle">
 <?php 
       
      if( substr($spend, -1) != "%" )
      echo number_format($spend02,2);
      else
      echo number_format($spend02,2).substr($spend, -1);
       
 ?></a>
<?php } ?>

js 千分正負號顏色格式轉換


在做網頁報表時,常用的格式轉換


FormatNumber( 欲輸入的金額(可以是%數字) , 至小數點第幾位 , 欲修改之物件內容 , 是否開啟正負顏色);


ex :
FormatNumber( 1277.32 , 2 , BetScoreTag[i] , 1 );  


function FormatNumber(n , m , obj , c ) {
   
     var _tmpNum = n ; 
   
     if( String(n).substr(-1,1) == "%")
     {
         _tmpNum = Number(n.split("%")[0]);
     }
   
     _tmpNum = _tmpNum.toFixed(m);

     _tmpNum += "";
     var arr = _tmpNum.split(".");
  
     var re = /(\d{1,3})(?=(\d{3})+$)/g;
      
     var spend = arr[0].replace(re,"$1,") + (arr.length == 2 ? "."+arr[1] : "");
      
     if( parseFloat(spend) < 0 && c == 1 )
     {
           obj.style.color = "D81A1A";
     }
 
     obj.innerHTML = spend;
     
     if( String(n).substr(-1,1) == "%")
     obj.innerHTML = spend +(String(n).substr(-1,1));

}

jquery 拖曳 div 技術


在製作網站時,因某種需求要在
視窗特定範圍內可以拖曳,在某些範圍內不可













這邊做一個備忘錄



<!-- Javascript -->
<script>
$(function () {
        $("#drag").draggable({
                handle: "#handle"
        });
 
        $("#drag1").draggable({
                cancel: "#handle1"
        });
});
</script>
 
<!-- HTML -->
<div id="box" style="width:600px;height:200px;border:0px solid black;margin-bottom:5px">
    <div id="drag" class="drag">        
        <p id="handle">可拖曳</p>
        <p style="font-size:12px;">將滑鼠移到黃色區塊內即可拖曳此方框</p>
    </div>
   
        <div id="drag1" class="drag" style="cursor:pointer;">        
        <p id="handle1">不可拖曳</p>
        <p style="font-size:12px;">不在黃色區塊的範圍內都可拖曳此方框</p>
    </div>
</div>


參考文章 :
原文網頁連結

html 轉 pdf 教學

此篇為 html2pdf 備忘錄,

記載 :

1.將 html 內容轉換至 pdf
2.解決語系utf 問題
3.順道理解 ob_start() 緩存在php的作法

以下連結包含解決中文顯示的問題 , 搭配底下的 code 一起看
https://github.com/spipu/html2pdf


直接帶入code來看 , 分為兩部份


//Content.php
<table>

<?php for($i = 0 ; $i < 5 ; $i++ ){ ?>

 <tr>
 <td><?php echo "---->".$i."<br>"; ?></td>
 </tr>

<?php } ?>
</table>



<!-- 開始緩存 -->
<?php ob_start(); ?>

要轉成pdf的內容こんにちは世界

<!-- 取得緩存內容 -->
<?php $content = ob_get_contents(); ?>

<!-- 關閉緩存 -->
<?php ob_flush(); ?>

<!-- 關閉緩存 印出 -->
<?php ob_get_flush(); ?>

<!-- 關閉緩存 不印出 -->
<?php ob_end_clean(); ?>

<!-- 測試緩存內容 -->
<?php echo "<br>php Cache:".ob_get_contents()."<br>"; ?>

    <form method="post" action="html2pdf.php">
     <input type="hidden" name="Content" value=<?php echo $content; ?>
     <input type="submit" name="submit" value="Submit">
    </form>


整體的理解
1.整個 html 資源由上到下,若需轉成 pdf 部份 以 ob_start()為起始
2.執行 ob_start() 表由該行開始將內容記入 php 緩存
3.ob_get_contents 取出緩存內容放入變數 $Content 中
4.為什麼需要這麼做?網路上得到的解答是只有字串才能放入寫檔函式中
因此透過緩存返回的字串塞進轉換函式中

5.記入緩存的內容以下列兩種方式來清除
    5.1.ob_get_flush 清除緩存並且將緩存內容導致瀏覽器
    5.2.ob_get-_clean 只清除緩存




//html2pdf.php
<?php
    require_once(dirname(__FILE__).'../html2pdf.class.php');
    try
    {
     
     //freeserif
     $content = '<page style="font-family:javiergb">'.$_REQUEST['Content'].'</page>';
        $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0);
        $html2pdf->pdf->SetDisplayMode('fullpage');
        $html2pdf->setDefaultFont('javiergb');
        $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
        $html2pdf->Output('ticket.pdf');
    }
    catch(HTML2PDF_exception $e) {
        echo $e;
        exit;
    }
?>
html2pdf.php
這支檔案內容理解很簡單,單純將form post的內容傳送至此做轉換
唯一要注意是
$html2pdf->setDefaultFont('javiergb');
此字型支援 Utf 各種語系顯示,轉換出來的中文才會正常