레이블이 program인 게시물을 표시합니다. 모든 게시물 표시
레이블이 program인 게시물을 표시합니다. 모든 게시물 표시

2016. 2. 2.

Woking behind the proxy 각종 프로그램에서 프록시 설정하기

오늘 
I have troubled while using programs which use networks behinde proxy. So I summerized  how to configure proxy.
I found some similar document like mine. but a little different. 

nodejs & npm & ionic 


git
        git config --global http.proxy http://xxxxx
        or .gitconfig 
              [http]  
                 proxy = http://xxx.xxx.xxx:0000

curl
java
  • -Dhttp.proxyHost=xxx.xxx.xxx -Dhttp.proxyPort=0000


  • -Dhttps.proxyHost=xxx.xxx.xxx -Dhttps.proxyPort=0000
  • or using system proxy 
  • java -Djava.net.useSystemProxies=true
apt-get

python pip
  pip install --proxy http://xxx.xxx:000 modulename 
  cert error : 
       pip --cert certfile.pem install moduleName
      ** using config 
          pip/pip.conf
         [global]
         cert=/aaa/aaaa/certfile.pe

** when ssl error is occurred.
(pip version: 8.0.2)
pypi.python.org is download server.
pip install module_name --trusted-host pypi.python.org

gradle
gradle.properties
 systemProp.http.proxyHost=111.111.111.111
 systemProp.http.proxyPort=111
 systemProp.https.proxyHost=222.222.222.222
 systemProp.https.proxyPort=111






2015. 12. 6.

스위프트에서 세자리마다 쉼표찍기( Show comma on every 3 digit in swift -Number formatting)

//: Playground - noun: a place where people can play

import UIKit

func convertCurrency( money : NSNumber, style : NSNumberFormatterStyle ) -> String {
    
    let numberFormatter = NSNumberFormatter()
    numberFormatter.numberStyle = style
    
    return numberFormatter.stringFromNumber( money )!
}

let value = 12345678.123

convertCurrency(value, style : NSNumberFormatterStyle.DecimalStyle)
convertCurrency(value, style : NSNumberFormatterStyle.NoStyle)
convertCurrency(value, style : NSNumberFormatterStyle.CurrencyStyle)

#=========== Output  ===================
12,345,678.123     <-- decimalstyle="" font="">
12345678             <-- font="" nostyle="">
$12,345,678.12     <-- currencystyle="" font="">

2015. 8. 23.

Rounded square button in swift ( customizing shape and color in code)


override func viewDidLoad() {
        super.viewDidLoad()

     let TAG_BTN = 1001  // it is assigned to button which you want to change properties.
     let btn : UIButton  = self.view.viewWithTag(TAG_BTN) as! UIButton
     btn.layer.cornerRadius = 5
     btn.layer.borderColor = UIColor.grayColor().CGColor
     btn.layer.borderWidth = 1.5

     btn.backgroundColor = UIColor(red: 1.0, green: 0, blue: 0, alpha: 1)
}



2015. 8. 14.

Removing space of table seperator ( Drawing sperator full width)

http://www.malcontentboffin.com/2014/10/28/Make-iOS-8-Table-View-Cell-Separators-Full-Width



    override 
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
        //remove identation line ( draw full seperator.)
        cell.separatorInset = UIEdgeInsetsZero
        cell.layoutMargins = UIEdgeInsetsZero
        cell.preservesSuperviewLayoutMargins = false

    }

using image as x repeated background in swift

I found many solutions above title. but It is written in a objective-c  like that:

objView.backgroundColor = [[UIColor allocinitWithPatternImage:[UIImage imageNamed:@"background_image"]];


but in swift   it can be written like that:


 objView.backgroundColor = UIColor(patternImage: UIImage(named: "background_image")!)

2015. 8. 8.

Using UITableView in ViewController (iOS Swift)

When I make UIViewController,  I need to display list , so I think I can use UITableView in UIViewController , but I found it is not possible because of mechanism of iOS.

They provide  another way.  That is using UIContainerView.

In Storyboard,
1) Drag UIViewController
2) Drag  UIContainerView into UIViewController( step.1)
    segue and default view controller will be created.
3) Drag UITableViewController  ( not UITableView)
4) delete segue and default view controller (step.2)
5) Link container  to UITableViewController (step.3)
     - (how to link?: click container with control key and drag to UITableViewController)

** Additional step
    If you have a existing segue with other viewcontroller, you may meet error. So you must check segue.identifier.





2012. 4. 22.

python graph, chart library


matplotlib  :
graph library for python  : many kinds of graph , full examples.
http://matplotlib.sourceforge.net/


numpy :
numeric library for python
http://scipy.org/Numpy_Example_List_With_Doc

2012. 3. 12.

simple compile erlang

I read that  I must use 'c' to compile in erlang. but I met error 'write error'.
I  am googling and then  I know that I must change directory with 'cd' command.
It is simple. but before I found it  It was stress to statr to learn the erlang.



c("modulefilename").   % sometimes you will meet error ' writing error'


%% method 1: you need to change working directory.

cd("pathname"). %%  which includes module file
c("modulefilename").

%% method 2  

c("modulename", [{outdir, "output directory .."}]).  %% you can assign output directory option  by {outdir, "..."} .