Error when trying to access XAMPP from a network

I have use XAMPP for my local webserver. When I try to open phpmyadmin from other computer (network), I get this error :

This is related with default “httpd-xampp.conf” config to allow access from local server. We can remove this error and open XAMPP phpmyadmin from network with some of modified in “httpd-xampp.conf”. This is steps how to access XAMPP phpmyadmin from network :
1. Stop Apache and Mysql from XAMPP Control Panel
2. Open “httpd-xampp.conf” from button “config” in XAMPP Control Panel
3. Search “<Directory “C:/xampp/phpMyAdmin”>”. I am use windows. So, that is how look phpmyadmin in my XAMPP config. This is original contents of “phpmyadmin tag”

This is after modified :

4. Save file and Start Apache and Mysql again.

Using this method, I can open XAMMP phpmyadmin from network.

source : http://stackoverflow.com/questions/6083323/error-when-trying-to-access-xampp-from-a-network

Android Sent Text To JavaScript

While developing Android application, sometimes we need to use webview and want our android (java code) communicate with html in webview. We can use javascript to communicate between java to html and vice versa. Dont forget to setting javascript enabled in our webview to true.

Please check code below to check how Android sent text to javascript :

Create file index.html code in assets directory. This is the contents from this html Android sent text to javascript file

Dont forget to create javascript file with name myscript.js and save to assets directory. This javascript is the important part, becuase used to communicate between java android and javascript (webview).

Please check below image for output Android sent text to javascript code :

Image. Sent Text From Android To JavaScript
Sent Text From Android To JavaScript
Image. Sent Text From JavaScript Android
Sent Text From JavaScript Android

This is a simple tutorial how Android sent text to javascript and how to javascript or webview sent text to Android. I hope this tutorial can help you solve your problem. You can download the compete code Android sent text to javascript in here.

Source : http://www.cuelogic.com/blog/simple-android-java-javascript-bridge/

Java Prevent BoxLayout From Expanding Children

I have created design GUI using java by programmatically. I want to add some of JPanel to my JFrame (mainwindow). I set JFrame layout using BoxLayout. I am use BoxLayout because want the children resize only width. But, when I resize the mainwindow (JFrame), children width and height is resized. BoxLayout expanding all children width and height.

This is code to add JPanel to my JFrame using BoxLayout :

Output using this code is like this :

java_jframe_resized_01Alternatively, we can use Box.Filler prevent BoxLayout resized the childen height. I have modified my code like this :

The result using this modified code (prevent BoxLayout expanding all children) is like this :

java_jframe_resized_02Add Box.Filler to our BoxLayout prevent all children expanding they height.

Source : http://stackoverflow.com/questions/14010864/keep-boxlayout-from-expanding-children

Matlab MEX create struct data type

I want creating MEX function in C/C++ and return struct data type to Matlab. This code can create struct data type with some of variable have int, double, string and matrix (array) data type. We need to use “mxCreateStructArray” matlab function to create struct data in C/C++ and return that struct data type to Matlab.

Please check my C/C++ code to create MEX with return struct data type in Matlab.

Save to mex_return_struct.cpp file (MEX with return struct data type). Compile from matlab command window with command :

Running our MEX with string parameter and string separator :

Sample result :

As you can see, creating struct data type in C/C++ and call from Matlab is very simple.