One code Blog

go back to 10 years ago


  • Home

  • Tags

  • Categories

  • Archives

  • Sitemap

Redux 코드로 이해하기

Posted on 2017-06-21 | In js , lib , react

리덕스를 코드로 이해해보자

리엑트를 공부하다 보면 자연스럽게 리덕스를 접하게 됩니다.
리덕스를 이해하기 위해 많은 문서를 접하지만, 저 같은 경우에는 코드랑 연결이 되어 있을 때 가장 잘 이해하는 것 같습니다. 그래서 코드로 리덕스를 접근해보려고 합니다.

Read more »

React에서 컴포넌트 스타일링 하기

Posted on 2017-06-06 | In js , lib , react

컴포넌트 스타일 적용하기

리엑트는 컴포넌트들을 작성할때 어떤식으로 스타일을 입힐 수 있을까요?

Read more »

some note about Android components

Posted on 2017-05-28
  • create a service (started,bounded lifecycle startService(),stopService() )
  • recevice a broadcast or resig

some note about gradle

Posted on 2017-05-28
  • bulid a java application
  • bulid a kotlin application
  • some note about gradle’s components (plugin,task)

Some note about Android

Posted on 2017-05-27 | In Android

Today’s note 2017-05-27

  • Floating window in Android (WindowManager,Toast)
  • play m3u8 by Exoplayer
  • check installed app
  • check the permission
  • create a Popwindow
  • SharedPreferences

Floating window in Android

1
2
3
4
5
6
7
8
9
10
11
12
//1,get a WindowManager by using 
getApplication().getSystemService(Context.WINDOW_SERVICE)
//or using
Activity.this.getWindowManager() //it only can be used on the activity it belongs to

//2,set the WindowManager.LayoutParams :type(TYPE_SYSTEM_ALERT),format,flags,gravity and x,y ,width,height (LayoutParams.WRAP_CONTENT)

//3,then add the view
windowManager.addView(View,LayoutParams)

//4,remove when it no longer needed
windwoManager.removeView(View)

play m3u8 by Exoplayer

1
2
3
//1,prepare the TrackSelector  ..(BandwidthMeter,) about the newwork
//2,prepare the source ..() about the uri ,app which called it we can find some kind of source
//3,new a ExoPlayer and prepare the source

check installed packages

check permission

Floating Window in Android

Posted on 2017-05-27 | In Android

Underscore의 _.reduceRight

Posted on 2017-05-23 | In js , lib , underscore

Underscore 의 _.reduceRight

v1부터 현재까지 코드가 어떻게 변해왔는지 확인해봅니다.

Read more »

Some note about python

Posted on 2017-05-21 | In language note
  • generate some

Some note about java

Posted on 2017-05-21 | In language note

To review the knowledge of Java and have a grasp of amazing skills of the language,I write this article.

The Content of the article

  • basic usage
  • deal with string and other things
  • deal with File
  • deal with network
  • data structure
  • multihreading
  • Lambda
  • Json

1.basic usage

deal with files in a Android app

Posted on 2017-05-20

how to work when a app run

A app need to save some data After it achieve information and need to save something when user changed some settings.

the functions the app need

  • create app directory and some kinds of directories such as images,text and so on.
  • save some data when we download some data which will not be changed temporarily.And we should use individual names to distinguish the kind of data.
  • check whether the data has saved.If it has been saved, get it from the storage and deal with it.If it does not exist,download and save it.

Detail

permission

permission
1
2
3
4
5
// app should ask for the permission
<manifest ...>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>

To get external storage: Environment.getExternalStorageDirectory();
To create a file :

1
2
new File(String parent,String name), 
f.createNewFile()//check is existed and if existed delete it
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//To write file,use         
fos=new FileOutputStream(File)
bw=new OutputStreamWriter(fos,"UTF-8");
bw.write(content);

//To read file, use
fis=new FileInputStream(f);
fis.read(bs);

//To be effective,we should read the whole content from a small size file.And then decode the bytes to strings.
byte[] bs=new byte[(int) f.length()];
fis=new FileInputStream(f);
fis.read(bs);//we need close it.
String content= new String(bs,"UTF-8");

Underscore의 _.reduce

Posted on 2017-05-10 | In js , lib , underscore

Underscore 의 _.reduce

v1부터 현재까지 코드가 어떻게 변해왔는지 확인해봅니다.

Read more »

Some ways to get a word in the TextView (Android)

Posted on 2017-05-06

Today I try to make one of my app more interesting.I want to add a function to my app.When I click a word,I can see the definition of the word

I looked and finally find some way to implement it.

  • The TextView has a function called getOffsetForPosition(x,y),However it seems not work well.
  • We can try to use ClickableSpan in the textview.However I have not do it myself but I think the way is not effective.
  • Try to get get the line by y,and get y,which may improve the accuracy.
  • Not try to contain all the Strings in one TextView and make TextViews dynamically.
1
2
3
//use getOffsetForPosition(x,y)
TextView.getOffsetForPosition(x,y+scrollView.getScrollY());

Underscore의 _.map

Posted on 2017-04-29 | In js , lib , underscore

Underscore 의 _.map

v1부터 현재까지 코드가 어떻게 변해왔는지 확인해봅니다.

Read more »

Underscore의 _.each

Posted on 2017-04-24 | In js , lib , underscore

Underscore 의 _.each

v1부터 현재까지 코드가 어떻게 변해왔는지 확인해봅니다.

Read more »

Grunt, Gulp, Webpack

Posted on 2017-03-29 | In Tool

2017년에 Grunt와 Gulp를 언급하는 이유

현재 대세는 단연코 Webpack이라고 할 수 있습니다.
하지만 모든 새로운 것들에는 그들이 나오게 된 이유가 있다고 생각됩니다.

Webpack을 더 잘 사용하기위해서는 이전 Grunt와 Gulp에 대한 이해가 필요하다는 생각이 들어서 간단히 정리해보려고 합니다.

Read more »

cheat-list

Posted on 2017-03-25

visual studio:

  • shortkey
    | ctrl+k+d | format |
    | ctrl+shift+M | implement function|

Android Studio

  • shortcut
    | Quick documentation | Ctrl+Q |
    | shift file | Ctrl+Tab|
    | Parameter info | ctrl+p |
    | format code | ctrl+shift+L |

  • Live Template
    refer to this blog
    | make a toast | Toast |
    | quick make a TAG |logt |
    | make a const int | const |
    | make a const String |key |
    | println |soutp |
    | log a infomation | logd,loge,logi |
    | judge if it is null | ifn,inn |
    | make intent to startActicity|IntentView |

we can find the key word in Android Studio
Settings > Editor > Live Templates

My Great Progress

Posted on 2017-03-11

KEYWORDS: GitHub,Stackflow,search for the answer,wallpaper

Yesterday I finally finished a good function in my application.The function is to replace the wallpaper of the desktop of any video.The origin idea is from an application named Wallpaper Engine on the stream.The application sold on the stream is very pupolar around me. Sounds an amazing function but in fact it is very easy.And although maybe the code is simple and not like some big project,I think it is a goog beginning of my work.

As the preparation for the program,I kept looking up relevant information on the Interne.I searched on the stackflow for the answer but everything seems not esay.There is no distinct answer about how to actualize the function.It spent a lot of time searching for the answer.People on the stackflow only give the way to change the wallpaper which cannot actualize the function in my mind.So sadly.

I also searched the msdn for the answer.Unfortunately the approach is what I found on the satckflow.I had no idea where I can find the answer.What I could do is to try my fortune to search the code on the GitHub.I thought the chance is small because how could it be if I cannot find an answer on the stackflow.However it really surprises me that someone build it and show the code on the GitHub.Thanks to GitHUb for its help.And also thanks to the author for his code.

After I got the code,I start reading the project and tried to understand how the author did it.
The project is very simple and I quickly finished reading it.However it seems to make a window and set its size to suit the screen and then set the window’s parent to one window.The process is simple but I don’t know what the theory it is.So I keep search the reason why we code it like that.I try to find the answer on the ZhiHu ——Chinese bigest Ask-Answer community.As expected,the programmers give some answers.And finally I found the right anwer and the answer also provide a link to the CodeProject website where someone gave a prefect answer.The windows show on the Mircosoft Windows are piled up.And The “progam” is the lowest window.Above are other windows including the desktop’ icons.So we only need to set a window’s parent as the layer below the desktop’s icons and cover the wallpaper with my window and play the video on my window.So it works.

It is easy,isn’t it?However it occurs some other problems when I try to actualize it.But I really made it.So I think it is a great progress for me.

私のはじめの司会者

Posted on 2017-03-09

今日私ははじめで司会者になりました。

司会者として、クラスの会議を司会する。

今回、司会者をやらせていただいた周です。

japnese-cheat

Posted on 2017-03-08

私の手帳。

ブログの言葉:

ネットワーク
ネットショップ 
ブログ
パスワード
画像コード
数字の入力 
ログイン
記事を書く
タイトル 
文字サイズ
画像の追加
リンクの追加
顔文字、絵文字
限定公開、全員に公開 
下書き
記事の編集、削除
デザインの変更
コメントの管理
ルームの編集
投稿
ライター

animate Times

アニメ
声優
レポート
インタビュー
アプリ
ゲーム
コスプレ アニメヤゲームなどの登場人物のキャラクターにふんする行為をさす。
グッズ
コラム
ニュースカテゴリ
芸能
取り揃える

Japanese Page

Posted on 2017-03-04

こんにちは、じゃなくて、こんばんは。

私はzeusです。

ここは私のプログです。

今日から俺は日本語の勉強を記録する。

これからよろしくお願いいたします。

はい~~~以上です。

今日から俺の計画はこれです。

  • インターネットを使ってネットのよく使っている言葉を覚える。
  • サイトのいつも使う言葉を記録する。
  • 毎日のニュースを読んで会話を早くできる。
<1…456>

104 posts
22 categories
99 tags
© 2024 Laird Lau
Powered by Hexo
|
Theme — NexT.Muse v5.1.4