EF's Blog

Archive for the ‘Computer’ Category

you can add this

//remove title bar


make sure the line is before layout declaration or your app will crash

create new class

public class basicdisplayoption {
public static void toggleStatusBar(Activity myActivityReference, boolean boolYesNo) {
if(boolYesNo == true)
WindowManager.LayoutParams attrs = myActivityReference.getWindow().getAttributes();
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
WindowManager.LayoutParams attrs = myActivityReference.getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;

at activity onCreate, to turn on status bar, call
basicdisplayoption.toggleStatusBar(sinarmasmsiglife.this, true);
to turn off :
basicdisplayoption.toggleStatusBar(sinarmasmsiglife.this, false);

Yesterday, I got a project to handle with MySQL and Visual Foxpro. I’m used to MySQL, and so does with Visual Foxpro. The trouble is that I’ve never work on both of them in the same time. Usually I’m using Foxpro integrated DBMS when using Visual Foxpro, and MySQL used to be a DBMS when I’m using PHP, C#, or ASP.Net.
I got a little problem on connecting those software, but after multiple tries, it did works.
How that happen? here’s the simple tutorial:

Note : I’m using Microsoft Windows XP SP 3, Visual Foxpro 9, and WAMP server 1.7.3, I’m working on a single desktop pc. I’m sorry i didn’t include the images example on doing this, hope with just the texts you would understand how it works.

First, create a database on MySQL. The database is quite important, because when you install and configure ODBC, there’s an option of which databases you want to use. I’m also using PHPmyadmin for the GUI of the database application. here’s for example.

> CREATE TABLE `dbfarmasi`.`tb_brg` (`kdbrg` CHAR( 6 ) NOT NULL ,`nmbrg` VARCHAR( 50 ) NOT NULL , PRIMARY KEY ( `kdbrg` )) ENGINE = INNODB
> INSERT INTO `dbfarmasi`.`tb_brg` (`kdbrg` ,`nmbrg`) VALUES ( ‘00001’, ‘First item’ );
> INSERT INTO `dbfarmasi`.`tb_brg` (`kdbrg` ,`nmbrg`) VALUES ( ‘00002’, ‘Second item’ );

i’m named the database “dbfarmasi” and the table “tb_brg”. So here, we got a database and a table, rock!

Then you download a software called MySQL ODBC Connector. I’m using mysql-connector-odbc-3.51.25-win32.exe, which is free, and can be downloaded by visit mysql site. You can try to google it.

Install. After installation has done, you should go to “Control Panel” > “Administrative Tools” > “Data Sources (ODBC)”. And then there’s pop-up window of ODBC. In “User DSN” tab, right side, press “Add” button”, and select “MySQL ODBC 3.51 Driver” as the data source, and “Finish”.

Another windows will appear, it is a configuration window for ODBC. Try this :

Data source name : koneksi
Description : connect foxpro and mysql
Server : localhost
User : root
Database : dbfarmasi

The DSN name is up to you, so does the description.
The default Server is localhost, ’cause I’m not using remote database.
Default user name is root, as the first super user name in mysql.
I’m using no password on mysql (it is set to none by default when you’re install WAMP)
and the database I’m using is dbfarmasi, as i’ve created before.

Ta-da. The connection has been made.

Now, for the visual foxpro. here is a simple one :
Create a project, whatever the name is, save it. on “Project Manager” window, choose “Code” tab.
Press “New” on Program.
Here is the code:

STORE SQLCONNECT(‘koneksi’, ‘root’) TO P1

close and save it to name :  “setdatabase

now, back to “Project Manager” window, choose “Document” tab, press “New” button to create a new form, and pick the “New Form”, not the “Form Wizard” thing.
After that, an empty form will appear. create a two Textboxs.
named the first textbox to : txtkdbrg and the second textbox to : txtnmbrg.
Add a grid to form. named it as gridContainer. 

Now double-click the form,  select the object form1 and the procedure init, and add this code:

DO setdatabase
SQLEXEC(P1,”select * from tb_brg”,”tb_brg”)
IF NOT USED(“tb_brg”)
USE tb_brg ALIAS tb_brg
SELECT tb_brg

Save the form and run it. TA-DA. It works, its connected. The content of table “tb_brg” is showed by the form by the gridContainer.

It means that the ODBC works. Here the connection thing :
do setdatabase
SQLEXEC(P1,”select * from tb_brg”,”tb_brg”)
means :
run program code “setdatabase” (which we’ve created before, for connection)
select P1 as ODBC connection DNS, (connection name variable in setdatabase (replace SQLCONNECT(bla bla bla))
“select * from tb_brg”, the sql query, select all from table tb_brg
“tb_brg”, is a cursor in visual foxpro, that used for alias.

So, with SQLEXEC([connection name],”[sql query]”,[cursor name]), you can do sql command: SELECT. Don’t forget to add cursorname/alias when you’re using SELECT.

You don’t have to add cursorname if you’re using INSERT or DELETE query.
example :

SQLEXEC(P1,”insert into tb_brg (kdbrg,nmbrg) values (‘”+thisform.txtkdbrg.value+”‘,'”+thisform.txtnmbrg.value+”‘)”)

means you insert value from textbox (txtkdbrg and txtnmbrg).
for delete command example :

SQLEXEC(P1,”delete from tb_brg where kdbrg ='”+thisform.txtkdbrg.Value+”‘”)

Once again, i’m sorry i’m not using images for this tutorial.
Hope you understand what i meant in this simple tutorial, and hope it help you.

If you want to download Google’s new web browser “Chrome”, you’ll need to download a small 474 KB installer from its official website and then it’ll download the required files of approx. 7 MB from Google server.

Its annoying and painful when you want to install Chrome in more than one computer. You’ll have to download the required setup files in each system.

Now no need to worry, Google is providing a standalone installer which doesn’t require net connection while installing the browser. So you can download it once and then install it in as many systems as you want without any problem.

Download Full Standalone Offline Installer for Latest Google Chrome

There is also another benefit in downloading this standalone installer. It doesn’t contain the Google Update EXE file.

This page was taken from : 


I’ve also downloaded this file from the page, and it works..

Microsoft .NET Framework 3.5

Many new windows applications requires latest version of Microsoft .NET framework which is version 3.5 at the time of of writing of this post.

If you go to Microsoft download center, then by default you will get live installer of approximately 2-3 MB’s while complete .NET framework requires 50-200 MB. Actually on the same page they are links to complete setup but they are placed in a way that anyone can hardly notice them. Seems like Microsoft wants you to download live installer but there are problem with live installer…

  1. It may hang forever if you have slow internet connection like dial-up, GPRS, etc.
  2. You can not use it at all if your computer is not connected to internet -(
  3. Also if you are running pirated Windows better not to use any software/installer from Microsoft which connects to Internet

So here I am giving you links to complete Microsoft .NET Framework 3.0 & 3.5 setups which are gathered from Microsoft pages (links: v3.5 & v3.0)

# Microsoft .NET Framework 3.5 Setup

# Microsoft .NET Framework 3.0 Setup

Do not worry about authenticity of above links as they are from Microsoft’s server only!

There’s some people who couldn’t turn on their hibernation option on Windows XP SP3, like my past experience. If you was trying to turn on hibernation, and there’s pop-up windows similar like this :

Windows can’t reserve your hibernation file
Hibernation file can not be written because it is still used
by other program

| OK |


After i disscuss it with support.microsoft.com, there’s a possibilities that i had installed Alcohol 120% before i did turned hibernate on. So, if u had some problem with me, u can uninstall Alcohol 120% first, restart and turn on hibernation, and then you can install Alcohol 120% again.

Okay then, good luck 😀

Lately, storage needs become bigger and bigger. Long time ago we use a cd and we’re pretty satisfied..Now,DVD which can keep about 4.5 Gb sometimes is not enough. Now Pioneer Japan is trying to develop a disk that able to store 400Gb. It claims that d disk contain 16 layers that keep 25Gb each.  D disk can be read with BluRay hardware.

EF’s Blog

I'm just ordinary people who lived in an extra-ordinary world.

EF's Blog Stats

  • 151,005 hits
May 2020