Monday, February 9, 2015

how to fix org.gradle.tooling.buildexception: could not run build action using gradle distribution in netbeans

On Windows I tried below two but nothing worked.
Java Control Panel / Java / Java Runtime Settings / View / User / Runtime Parameters -Dfile.encoding=UTF-8
set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
Java Console still prints out
file.encoding = MS949

Environment Variables may be? –  R.J Mar 21 '13 at 7:28
    
What is about running jconsole -J-Dfile.encoding=UTF-8 ? –  PeterMmm Mar 21 '13 at 8:00

2 Answers

Maybe you nedd a global JVM option:
try to add JAVA_OPTSto you windows environment.
set JAVA_OPTS=-Dfile.encoding=UTF-8 %JAVA_OPTS%

Thursday, February 5, 2015

php codeigniter html pivot table example

IN CONTROLLER

<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class home extends HO_Site {

    public function __construct() {
        parent::__construct();
    }

    public function index() {
        $this->load->model('article_model');
        $where = array();
        $where['limit'] = 5;
        $where['offset'] = 0;
        $model = $this->article_model->get_list($where, null, array('id,title,createddate'));
        $this->view(array('data' => $model));
    }

}

IN VIEW

<?php
header('Content-Type: text/html; charset=utf-8');
echo 'processing...<br>';
print_r($data);
?>
<table style="border:1px solid #000;padding:5px;">
    <thead>
        <tr>
            <?php
            echo '<th>Талбар:</th>';
            for ($i = 0; $i < count($data); $i++) {
                echo '<th>Хэрэглэгч-' . $i . '</th>';
            }
            ?>
        </tr>
    </thead>
    <tbody>
        <?php
        $fieldNames = array_keys($data[0]);
        for ($i = 0; $i < count($fieldNames); $i++) {
            echo '<tr>';
            for ($j = 0; $j < count($data); $j++) {
                $item = $data[$j];
                if ($j == 0) {
                    echo '<th>' . $fieldNames[$i] . '</th>';
                }
                echo '<td>' . $item[$fieldNames[$i]] . '</td>';
            }
            echo '</tr>';
        }
        ?>
    </tbody>
</table>

RESULT





Wednesday, February 4, 2015

android application exit with Activity.finish() when back pressed

@Override
    public void onBackPressed() {
        new AlertDialog.Builder(this)
                .setMessage(R.string.system_exit_confirm_message)
                .setCancelable(false)
                .setPositiveButton(R.string.btn_yes, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        finish();
                    }
                })
                .setNegativeButton(R.string.btn_no, null)
                .show();
    }