tag:blogger.com,1999:blog-66058759872518031812024-02-06T20:38:29.318-08:00leon456 亂寫一通Kept simplified,make it ASAPUnknownnoreply@blogger.comBlogger80125tag:blogger.com,1999:blog-6605875987251803181.post-13502019158804938062017-03-25T08:41:00.000-07:002017-03-25T08:41:33.858-07:00【Spring Boot】Why using spring bootWhen I need to produce restful api using spring framework,I use Spring MVC4
,that I need to config spring structure as below
We saw in project have some config file(xml),in spring xml config file was
common usage for spring developer,everything look like well.
But in spring boot ,we don’t need config file anymore,and we don’t need to
deploy web app to container.
Lets take a look what theUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-46416426843462843872016-04-20T03:32:00.001-07:002016-04-25T21:00:25.858-07:00Building Flex app using gradlefx(some issue record)In Android development,now I used Android Studio for my IDE,so using gradle for building android must using gradle script.
In my another programing skill Flex,Most of programmers use ant for building script.Now I have a modern choice: gradlefx.
Below record is for what I encounter some issue:
1.Ambiguous method overloading for method java.io.File#. error
So I get starling sample code from Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-52839497041689490512015-10-04T22:45:00.001-07:002015-10-05T08:35:20.641-07:00【Android】Android Studio Support JNI(NDK)I google ndk + android studio,and get lots of infomation about how progragming ndk with android studio Lots of tutorial said that need to put Android.mk and Appliction.mk in jni folder Now I used Android Stuiod 1.4,and get an excited usage,we don’t need to put above files(Android.mk and Appliction.mk ),just follow below steps ,Android Studio can start programing ndk 1.Download NDK  Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-47342736774957163852015-05-21T02:31:00.001-07:002015-05-21T02:31:53.528-07:00【Egret Engine】自適銀幕大小做法修改launcher/egret_loader.js 1: egret.StageDelegate.getInstance().setDesignSize(document.body.clientWidth, Math.max(document.body.clientHeight,window.innerHeight));<!--CRLF--> 2: context.stage = new egret.Stage();<!--CRLF--> 3: var scaleMode = egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ? egret.StageScaleMode.SHOW_ALL : egret.StageScaleMode.NO_SCALE;<!--CRLF--> 4: Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-21063482188611920192015-05-21T02:28:00.001-07:002015-05-21T03:20:46.665-07:00【Egret Engine】整合PureMVCEgret 可以在專案中結合各式各樣的第三方javascript lib,目前先介紹對該lib有提供TSD的部份 PureMVC 算是Flash Developer都還蠻熟悉的一個MVC Framework 官方文件也有做了一個教學,如何使用第三方javascript lib,基於按照官方的教學,讓我摸索了一段時間,我這邊做個步驟整理以便以後若遇到問題時,可再次按圖操作 這個記錄我使用EgretVS新建出來的GUI專案來說明 新增專案完成後,在專案目前增加如下檔案 puremvc的TSD及JS檔案請至 github 下載 puremvc.json這個檔案,請自行增加,內容如下,source節點請依個人喜好填入 1: {<!--CRLF--> 2: "name": "puremvc",<!--CRLF--> 3: "source":"src/Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-627898559187858752015-05-13T03:34:00.001-07:002015-05-13T03:34:29.373-07:00【Ruby on Rails】has_many model using jbuilderTwo model as below group.rb 1: class Group < ActiveRecord::Base<!--CRLF--> 2: has_many :posts<!--CRLF--> 3: validates :title,:presence => true<!--CRLF--> 4: end<!--CRLF-->post.rb 1: class Post < ActiveRecord::Base<!--CRLF--> 2: belongs_to :group<!--CRLF--> 3: end<!--CRLF-->In view/group/index.json.jbuilder 1: json.groups (@groups) do |group|<!--CRLF--> 2: Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-70190317952008948252015-05-13T01:14:00.003-07:002015-05-29T17:56:55.854-07:00【Egret引擎】Adobe Flash/Flex 技術無痛移轉至 Html5 遊戲開發(App開發)上週聽到了可以把Flash直接轉至html5的名詞時,眼睛一亮
聽到了一個新的名詞 Egret ,搜尋了一下
當下以為可以把原本用Flash/Flex開發的應用,直接轉到html5,不需經過再次開發
也就是今天要介紹的開發工具 Egret Engine
官方網址如下:
http://www.egret.com/ => 英文版的官網,學習資源比較少
http://www.egret-labs.org/ => 中文版本的官網,學習及說明資源較齊全
http://bbs.egret-labs.org/portal.php => 討論區,上面有一群中國在Flash的專家們寫了很多的教學跟範例
不過當研究了一段時間後,發現要做到完全不用寫程移轉似乎是不太容易的
在官方的說明即己經提到
http://Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-33408647791254781912015-05-05T00:57:00.001-07:002015-05-05T00:57:09.867-07:00【Facebook API】Getting id of comments,retrieve all comments
Getting id of comments
http://stackoverflow.com/questions/21014855/getting-id-of-facebook-comments-plugin
Cut the prefix id,and paste to below url
http://graph.facebook.com/{prefix-id}/comments
Then we can get all comments as below
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-2956441960265237292014-09-24T01:23:00.001-07:002014-09-24T01:24:10.748-07:00【Android】Add Jars into Android Studio Project Android Studio will add you library to build.gradle script Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-47289123172436446952014-07-01T20:51:00.001-07:002014-07-01T20:51:05.118-07:00【Android】Add icon to FragmentPagerAdapterFragmentPagerAdapter 1: @Override<!--CRLF--> 2: public CharSequence getPageTitle(int position) {<!--CRLF--> 3: SpannableStringBuilder sb = new SpannableStringBuilder(" Page #"+ position); // space added before text for convenience<!--CRLF--> 4: <!--CRLF--> 5: Drawable main_create = getActivity().getResources().getDrawable(R.drawable.main_create);<!--CRLF--> 6:Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-91025000345642425012014-06-22T19:42:00.001-07:002014-06-25T07:57:05.708-07:00【Android】Android app error - Duplicate id 0x7f04000f, tag null, or parent id 0x0 with another fragment for com.google.android.gms.maps.SupportMapFragment 1: @Override<!--CRLF--> 2: public void onDestroyView() {<!--CRLF--> 3: super.onDestroyView();<!--CRLF--> 4: FragmentManager fm = getActivity().getSupportFragmentManager();<!--CRLF--> 5: Fragment fragment = (fm.findFragmentById(R.id.map));<!--CRLF--> 6: FragmentTransaction ft = fm.beginTransaction();<!--CRLF--> 7: ft.remove(fragment);<!--CRLF--> 8: Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-50195716135458882812014-05-13T23:39:00.001-07:002014-05-14T00:46:10.241-07:00【Android】Google Map Directions(Call Google Map App) LAT_POSITION and LONG_POSITION is source position lat and lon is target position 1: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=" + LAT_POSITION + "," + LONG_POSITION +"&daddr=" + lat + "," + lon));<!--CRLF--> 2: intent.setComponent(new ComponentName("com.google.android.apps.maps","com.google.android.maps.MapsActivity"))Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-56466889473094105152014-05-12T23:54:00.001-07:002014-05-12T23:54:04.512-07:00【Android】Open Gallary By AppstartActivity: 1: Button btn = (Button)rootView.findViewById(R.id.button1);<!--CRLF--> 2: btn.setOnClickListener(new OnClickListener(){<!--CRLF--> 3: <!--CRLF--> 4: @Override<!--CRLF--> 5: public void onClick(View v) {<!--CRLF--> 6: Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);<!--CRLF--> 7: Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-89381624217719610412013-07-09T21:48:00.001-07:002013-07-09T21:48:10.574-07:00【Spring】Test in Spring MVC3 1: package com.lywebii.goldprice;<!--CRLF--> 2: <!--CRLF--> 3: import static org.junit.Assert.*;<!--CRLF--> 4: <!--CRLF--> 5: import java.util.List;<!--CRLF--> 6: <!--CRLF--> 7: import org.junit.After;<!--CRLF--> 8: import org.junit.Before;<!--CRLF--> 9: import org.junit.Test;<!--CRLF--> 10: import org.junit.runner.RunWith;<!--CRLF--> 11: import Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-80365006195517664302013-05-12T07:41:00.001-07:002013-05-12T11:00:09.474-07:00【Parse.com】Why I like using Parse.comWhen I wrote android app,I usually need to write server side code.(I used AppFog for the backend)In my experience,before start coding sever side,I should design Model(or said Er model),then I will create data object correspond with design model.And then I start coding the controller for business logic.(My sever side framework using Spring MVC3)If I need to check the data producing from client.I Leon456http://www.blogger.com/profile/09898226283326947149noreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-198713546817215462013-04-23T03:37:00.000-07:002013-04-23T03:46:30.425-07:00【Android】Check or go to spacified app 1: String appPackage = "jp.naver.line.android";<!--CRLF--> 2: Intent intent = getPackageManager().getLaunchIntentForPackage(appPackage);<!--CRLF--> 3: if(intent!=null){<!--CRLF--> 4: startActivity(intent);<!--CRLF--> 5: }else{<!--CRLF--> 6: intent = new Intent(Intent.ACTION_VIEW);<!--CRLF--> 7: intent.setData(Uri.parse("market://details?id="+appPackage));<!--CRLF-->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-87865792105866807832012-09-14T21:54:00.001-07:002012-09-14T22:50:55.707-07:00【OAuth for plurk】Using plurk api(oauth)Link below website to register an app http://www.plurk.com/PlurkApp/http://www.plurk.com/PlurkApp/ (*Red block is required) Then we can click the test tool(test console) Next we should get Token Key first,click【Get Requet Token】directly. The action will link to http://www.plurk.com/OAuth/request_token and using get method to get Token Key and Token Secret Next step we click Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-82300052672288419442012-08-14T23:31:00.001-07:002012-08-15T01:14:37.355-07:00【Flex】Using resource bundlesWe know in flex,we will define different property file in different locale folder,usually we can get string by key as below: 1: hello=Hello<!--CRLF--> 2: you=You<!--CRLF--> 1: hello=你好<!--CRLF--> 2: you=你<!--CRLF-->In actionscript3 we will use resourceManager.getString('locale',’hello')  set to the value.and in mxml we will use text="@Resource(key='Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-42005297159830017952012-06-04T21:00:00.001-07:002012-06-05T02:47:33.435-07:00【BlazeDS】Message of customer adapter1.Create an adapter class in java source code,in my example,we will pass xml format data to client,if the data from producer is valid,the xml data will send to consumer client correctly,otherwise nothing happened(Console still print print stack trace). 1: package com.leon456.fake; 2: 3: import java.io.IOException; 4: import java.io.StringReader; 5: 6: import Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-27349285560743609332012-05-26T08:28:00.001-07:002012-05-26T08:33:52.096-07:00【JavaScript】replace all<script type="text/javascript">var visitorName = "Chuck";var myOldString = "Hello username! I hope you enjoy your stay username.";var myNewString = myOldString.replace(/username/g, visitorName);document.write("Old string = " + myOldString); document.write("<br />New string = " + myNewString);</script>Will output as belowOld Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-49861445707963447482012-05-10T22:47:00.001-07:002012-05-10T22:52:16.932-07:00【Android】Using Google Maps note Create project need to select 【Google APIs】         AndroidManifest.xml need to add below tag        Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-26784379288508736412012-04-27T07:57:00.001-07:002012-04-27T08:17:32.828-07:00【OpenCart】Add new languageGo to open cart  homepage,select 【Extension】 1.Select catalog lanaguage 2.Input what your language 3.Select your OpenCart version and License finally choose favorite pack Download it(mine is 1.5.2.1) Unzip the file,you will see two folders as below   Copy the these folder to your OpenCart folder,you can overwrite them directly Please check  language folder in Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-21750839949142783492012-04-20T08:42:00.001-07:002012-04-20T08:42:28.999-07:00【Java】 Convert a Hex String to an Integer and Back AgainHex String to an Integer  1: String hex = "2A"; //The answer is 42 <!--CRLF--> 2: int intValue = Integer.parseInt(hex, 16); <!--CRLF--> Integer to Hex String 1: String hex = Integer.toHexString(42); <!--CRLF--> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-50833919226586534232012-04-16T21:11:00.001-07:002012-04-16T21:11:03.318-07:00【Unity 3D】enable log for android platformFor now, this is what I am doing to get at least some information: Enable "logcat" profiler in the player settings, under Other Settings (Android tab) of Player Settings. Make sure USB debugging is enabled on the Android device (check under Settings | Development). Run adb through the command prompt (with command line argument logcat) that comesUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6605875987251803181.post-7387422994177075432012-04-01T03:56:00.001-07:002012-04-01T04:11:18.407-07:00【Android】add a layout file into current activityIf layout flie(e.g. layout.xml) need to add to acticity using hardcard,below code is ths example 1: controlInflater = LayoutInflater.from(getBaseContext()); 2: View viewControl = controlInflater.inflate(R.layout.control, null); 3: LayoutParams layoutParamsControl 4: = new LayoutParams(LayoutParams.FILL_PARENT, 5: LayoutParams.FILL_PARENT); 6:Unknownnoreply@blogger.com0