Saturday, 1 June 2013
Mysql datadase to Excel Sheet convertsion PHP script
PHP script for mysql database to excel can convert automatically the file run in browser.
Database, User name, Password, Table Name are included/mention here. Consider user requirements.
<?php
ob_start();
mysql_connect('localhost','root','');
mysql_select_db('test');
$sql = "SELECT * from log_attempts";
$res = mysql_query( $sql) or die();
$count = mysql_num_fields($res);
// fetch table header from database
$header = '';
for ($i = 0; $i < $count; $i++){
$header .= mysql_field_name($res, $i)."\t";
}
// fetch data each row, store on tabular row data
while($row = mysql_fetch_row($res)){
$line = '';
foreach($row as $value){
if(!isset($value) || $value == ""){
$value = "\t";
}else{
$value = str_replace('"', '""', $value);
$value = '"' . $value . '"' . "\t";
}
$line .= $value;
}
$data .= trim($line)."\n";
$data = str_replace("\r", "", $data);
}
$name=date('d-m-y').'-list.xls';
header("Content-type:application/vnd.ms-excel;name='excel'");
header("Content-Disposition: attachment; filename=$name");
header("Pragma: no-cache");
header("Expires: 0");
// Output data
echo $header."\n\n".$data;
?>
HTML5 Offline Database Complete code
HTML5 Database
<!DOCTYPE html>
<html>
<head>
<title>OffLine Storage</title>
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.4.1");
</script>
<script>
var db = window.openDatabase("Student", "", "Previous Course", 1024*1000);
function insertSubject(subject_one, subject_two, course_id, email) {
db.transaction(function(tx) {
tx.executeSql('INSERT INTO Course (course_id, subject_one, subject_two, email) VALUES (?, ?, ?, ?)', [course_id, subject_one, subject_two, email]);
});
}
function renderResults(tx, rs) {
e = $('#previous_course');
e.html("");
for(var i=0; i < rs.rows.length; i++) {
r = rs.rows.item(i);
e.html(e.html() + 'id: ' + r['id'] + ', subject_one: ' + r['subject_one'] + ', subject_two: ' + r['subject_two'] + ', email: ' + r['email'] + '<br />');
}
}
function displayData(email) {
db.transaction(function(tx) {
if (!(email === undefined)) {
tx.executeSql('SELECT * FROM Course WHERE email = ?', [email], renderResults);
} else {
tx.executeSql('SELECT * FROM Course', [], renderResults);
}
});
}
$(document).ready(function() {
db.transaction(function(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Course(id INTEGER PRIMARY KEY, course_id INTEGER, subject_one TEXT, subject_two TEXT, email TEXT)', []);
});
$('#course_form').submit(function() {
course = { 1: $('#subject1').val(), 2: $('#subject2').val() };
insertSubject($('#subject1').val(), $('#subject2').val(), 1, $('#email').val());
displayData();
return false;
});
displayData();
});
</script>
</head>
<body>
<form method="get" id="course_form">
<div>
<label for="1">Subject 1</label> <input type="text" value=""
id="subject1" name="subject1" placeholder="subject" />
</div>
<div>
<label for="2">Subject 2</label> <input type="text" value=""
id="subject2" name="subject2" placeholder="subject" />
</div>
<div>
<input type="email" id="email" placeholder="Enter your email address"
size="40" />
</div>
<div>
<input type="submit" value="Upload Data" />
<input type="button" value="Fetch" onChange="displayData(email);" />
</div>
</form>
<div>
<h2>Previous Course</h2>
</div>
<div id="previous_course"></div>
</body>
</html>
<!--
table created: file one script
-----------------------------
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.4.1");
</script>
<script>
var db = window.openDatabase("Student", "", "Previous Course", 1024*1000);
$(document).ready(function() {
db.transaction(function(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Course(id INTEGER PRIMARY KEY, course_id INTEGER, subject_one TEXT, subject_two TEXT, email TEXT)', []);
});
});
</script>
insert data feilds; File two script
------------------------------------
<script>
var db = window.openDatabase("Student", "", "Previous Course", 1024*1000);
function insertSubject(subject_one, subject_two, course_id, email) {
db.transaction(function(tx) {
tx.executeSql('INSERT INTO Course (course_id, subject_one, subject_two, email) VALUES (?, ?, ?, ?)', [course_id, subject_one, subject_two, email]);
});
}
$(document).ready(function() {
db.transaction(function(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Course(id INTEGER PRIMARY KEY, course_id INTEGER, subject_one TEXT, subject_two TEXT, email TEXT)', []);
});
$('#course_form').submit(function() {
course = { 1: $('#subject1').val(), 2: $('#subject2').val() };
insertSubject($('#subject1').val(), $('#subject2').val(), 1, $('#email').val());
return false;
});
});
</script>
Fetch data file automatically: file three script
-------------------------------------------------
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.4.1");
</script>
<script>
var db = window.openDatabase("Student", "", "Previous Course", 1024*1000);
function insertSubject(subject_one, subject_two, course_id, email) {
db.transaction(function(tx) {
tx.executeSql('INSERT INTO Course (course_id, subject_one, subject_two, email) VALUES (?, ?, ?, ?)', [course_id, subject_one, subject_two, email]);
});
}
function renderResults(tx, rs) {
e = $('#previous_course');
e.html("");
for(var i=0; i < rs.rows.length; i++) {
r = rs.rows.item(i);
e.html(e.html() + 'id: ' + r['id'] + ', subject_one: ' + r['subject_one'] + ', subject_two: ' + r['subject_two'] + ', email: ' + r['email'] + '<br />');
}
}
function displayData(email) {
db.transaction(function(tx) {
if (!(email === undefined)) {
tx.executeSql('SELECT * FROM Course WHERE email = ?', [email], renderResults);
} else {
tx.executeSql('SELECT * FROM Course', [], renderResults);
}
});
}
$(document).ready(function() {
db.transaction(function(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Course(id INTEGER PRIMARY KEY, course_id INTEGER, subject_one TEXT, subject_two TEXT, email TEXT)', []);
});
$('#course_form').submit(function() {
course = { 1: $('#subject1').val(), 2: $('#subject2').val() };
insertSubject($('#subject1').val(), $('#subject2').val(), 1, $('#email').val());
displayData();
return false;
});
displayData();
});
</script>
-->
Thursday, 23 May 2013
Excel To Mysql using PHP through CSV file format.
PRELIMES: METHOD:1
--------
Excel to csv convertion . create table in mysql
----------
csv to mysql table data import: 100% succcess.
------------------------------- --------------->>
<?php
$sql=mysql_connect("localhost","root",""); //hostname,username,password
mysql_select_db("test",$sql); // employee is the database name.
$path = "list.csv"; // csv file in the same directory
if (($handle = fopen($path, "r")) !== FALSE)
{
$i=1;
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
echo $data[0],$data[1];
mysql_query("insert into t1(name,mailid) values('".$data[0]."','".$data[1]."')");//t1->table name and its files names
echo $i;$i++;
echo "<br >";
}
fclose($handle);
}
?>
------------------------------------------------------------------------------
METHOD : 2
===========
working : text file to mysql data insert
LOAD DATA INFILE 'c:/wamp/www/touch/text.txt' INTO TABLE t1 FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES(name,email)
Excel->csv,txt to mysql table data import 90% scuccess.
=================================================>
PRELIMES:
--------
Excel to csv convertion . create table in mysql
---------------------------------
Short and sweet solution for excel to mysql data import:
Working good for txt file formats. IN DETAIL:
tbl name=t1 feilds are= name varchar,email varchar;
text.txt file <<== this text file first lines table column names:
name, email "n1", "e1" "n2", "e2" "n3", "e3" "n4", "e4" "n5", "e5" "n6", "e6" "n7", "e7"
SQL query in wamp
LOAD DATA INFILE 'c:/wamp/www/touch/text.txt' INTO TABLE t1 FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES(name,email)
For this commnad run successfully we have create folders for separately.
Real one is
C:\wamp\mysql\data\wamp\www\touch\text.txt <<==pysical file path is.
But we mention c:/wamp/touch/text.txt
------------------------------------------------------------------------------------------------------------
Tuesday, 21 May 2013
Insert and Extract image in php mysql database
This post contain one create table data,2 html files and 2 php files for insert and extract image in database.
Table name=tbl_images database name=test,username=root,password=""
----------------------
mysql> CREATE TABLE tbl_images (
> id tinyint(3) unsigned NOT NULL auto_increment,
> image blob NOT NULL,
> PRIMARY KEY (id)
> );
upload image
===========
add.html
--------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form enctype="multipart/form-data" action="insertimage.php" method="post" name="changer">
<input name="MAX_FILE_SIZE" value="102400" type="hidden">
<input name="image" accept="image/jpeg" type="file">
<input value="Submit" type="submit">
</body>
</html>
insertimage.php
---------------
<?php
// Create MySQL login values and
// set them to your login information.
$username = "root";
$password = "";
$host = "localhost";
$database = "test";
// Make the connect to MySQL or die
// and display an error.
$link = mysql_connect($host, $username, $password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
// Select your database
mysql_select_db ($database);
// Make sure the user actually
// selected and uploaded a file
if (isset($_FILES['image']) && $_FILES['image']['size'] > 0) {
// Temporary file name stored on the server
$tmpName = $_FILES['image']['tmp_name'];
// Read the file
$fp = fopen($tmpName, 'r');
$data = fread($fp, filesize($tmpName));
$data = addslashes($data);
fclose($fp);
// Create the query and insert
// into our database.
$query = "INSERT INTO tbl_images ";
$query .= "(image) VALUES ('$data')";
$results = mysql_query($query, $link);
// Print results
print "Thank you, your file has been uploaded.";
}
else {
print "No image selected/uploaded";
}
// Close our MySQL Link
mysql_close($link);
?>
Show/display image in php mysql
================================
show.html
----------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>show image</title>
</head>
<body>
<form method="post" action="show.php">
Select employee id:<input type="text" name="id" />
<input type="submit" value="submit" />
</form>
</body>
</html>
show.php
---------
<?php
$username = "root";
$password = "";
$host = "localhost";
$database = "test";
mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$id =$_POST['id'];
/*
if(!isset($id) || empty($id) || !is_int($id)){
die("Please select your image!");
}else{*/
//echo $id;
$query = mysql_query("SELECT * FROM tbl_images WHERE id='".$id."'");
$row = mysql_fetch_array($query);
$content = $row['image'];
//$var_value = $_POST['$content'];
header('Content-type: image/jpg');
//header( 'Location: showw.php' ) ;
//
/*echo '<form method="POST" action="Page2.php?myVariable='.
urlencode($myVariable).'">";*/
echo $content;
// echo $content;
//}
?>
Table name=tbl_images database name=test,username=root,password=""
----------------------
mysql> CREATE TABLE tbl_images (
> id tinyint(3) unsigned NOT NULL auto_increment,
> image blob NOT NULL,
> PRIMARY KEY (id)
> );
upload image
===========
add.html
--------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form enctype="multipart/form-data" action="insertimage.php" method="post" name="changer">
<input name="MAX_FILE_SIZE" value="102400" type="hidden">
<input name="image" accept="image/jpeg" type="file">
<input value="Submit" type="submit">
</body>
</html>
insertimage.php
---------------
<?php
// Create MySQL login values and
// set them to your login information.
$username = "root";
$password = "";
$host = "localhost";
$database = "test";
// Make the connect to MySQL or die
// and display an error.
$link = mysql_connect($host, $username, $password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
// Select your database
mysql_select_db ($database);
// Make sure the user actually
// selected and uploaded a file
if (isset($_FILES['image']) && $_FILES['image']['size'] > 0) {
// Temporary file name stored on the server
$tmpName = $_FILES['image']['tmp_name'];
// Read the file
$fp = fopen($tmpName, 'r');
$data = fread($fp, filesize($tmpName));
$data = addslashes($data);
fclose($fp);
// Create the query and insert
// into our database.
$query = "INSERT INTO tbl_images ";
$query .= "(image) VALUES ('$data')";
$results = mysql_query($query, $link);
// Print results
print "Thank you, your file has been uploaded.";
}
else {
print "No image selected/uploaded";
}
// Close our MySQL Link
mysql_close($link);
?>
Show/display image in php mysql
================================
show.html
----------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>show image</title>
</head>
<body>
<form method="post" action="show.php">
Select employee id:<input type="text" name="id" />
<input type="submit" value="submit" />
</form>
</body>
</html>
show.php
---------
<?php
$username = "root";
$password = "";
$host = "localhost";
$database = "test";
mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$id =$_POST['id'];
/*
if(!isset($id) || empty($id) || !is_int($id)){
die("Please select your image!");
}else{*/
//echo $id;
$query = mysql_query("SELECT * FROM tbl_images WHERE id='".$id."'");
$row = mysql_fetch_array($query);
$content = $row['image'];
//$var_value = $_POST['$content'];
header('Content-type: image/jpg');
//header( 'Location: showw.php' ) ;
//
/*echo '<form method="POST" action="Page2.php?myVariable='.
urlencode($myVariable).'">";*/
echo $content;
// echo $content;
//}
?>
Saturday, 18 May 2013
The requested URL /phpmyadmin was not found on this server in windows
I tried to open my phpmyadmin with IP address.
The error thrown "The requested URL /phpmyadmin was not found on this server in windows"
solution is
Check firewall is off,
put your wamp in Onlilne mode,
Edit the php alias file.This one new one.
Install Wamp,
exit it
Run notepad as administrator
go to C:\wamp\alias\phpmyadmin.conf
edit this line of code
AllowOverride all
Order Allow,Deny
Allow from all
Allow from 127.0.0.1
by default it was the problem:
-------------------------
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
The error thrown "The requested URL /phpmyadmin was not found on this server in windows"
solution is
Check firewall is off,
put your wamp in Onlilne mode,
Edit the php alias file.This one new one.
Install Wamp,
exit it
Run notepad as administrator
go to C:\wamp\alias\phpmyadmin.conf
edit this line of code
AllowOverride all
Order Allow,Deny
Allow from all
Allow from 127.0.0.1
by default it was the problem:
-------------------------
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Monday, 6 May 2013
Showing Splash Screen At The Start Of Android PhoneGap Application
If you want to disaplay a splash screen at the beginning of Phonegap based Android application you need to put splash screen image(splash.png) inside res\drawable-hdpi, res\drawable-mdpi, res\drawable-idpi which can be located inside your project directory.
The splash screen image size should be different for different size of Android devices.
(same size image also worked)
For large screens size (hpdi) image size should be at least 640dp x 480dp
For normal screens size (mdpi) image size should be at least 470dp x 320dp
For small screens size (idpi) image size should be at least 426dp x 320dp
|
After putting the images in respective directory you need to add the the following code in your main Activity.java file before super.loadUrl method.
super.setIntegerProperty("splashscreen", R.drawable.splash);
Then modify the super.loadUrl method to display the splash screen for 10 seconds before starting of the Phonegap application like this
super.loadUrl("file:///android_asset/www/index.html", 10000);
So after modification your main Activity.java will look like this
package com.mindfire.HelloWorld;
import android.os.Bundle;
import org.apache.cordova.*;
public class RemindMeActivity extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html", 10000);
//No need three line code
}
}
120
down vote accepted
--------------------
In order to have a splash screen in a PhoneGap Android application you need to put your splash.png file into res/drawable-ldpi, res/drawable-mdpi, res/drawable-hdpi,
res/drawable-xhdpi.
Where those directories represent low, medium, high and extra large dots per inch. You'll need to resize you slash.png for each directory or
Android will stretch it for you.
xlarge (xhdpi): at least 960 x 720
large (hdpi): at least 640 x 480
medium (mdpi): at least 470 x 320
small (ldpi): at least 426 x 320
Then in your main Java class, the one that extends DroidGap, you'll need to add one line and modify another. First add:
super.setIntegerProperty("splashscreen", R.drawable.splash);this line should show up under super.onCreate but before super.loadUrl. Then you'll need to modify your loadUrl method to pause for 5 seconds before loading up the main page. It would look like this:
|
Wednesday, 24 April 2013
Forbidden You don't have permission to access / on this server While IIS and WAMP installed i faced
I have configure my Apache by myself and try to load phpMyAdmin on
virtual host, but received "403 Forbidden You don't have permission to
access / on this server".
ANS
ANS
Are you using Wamp Server then try this...
*Single click on the WAMP server icon at taskbarTo run in both ways http://localhost/phpmyadmin/ http://192.168.136/phpmyadmin/ Edit this file. Previously localhost or Machine_IP permission do't consider. Best Solution
Change the file content of
c:\wamp\alias\phpmyadmin.conf to the following.
Here my WAMP installation is in the c:\wamp folder. Change it according to your installation.Previously, it was like this:
Restart your Apache server after making these changes.-------------------------------------------------------------------------------------------------- http://stackoverflow.com/questions/8366976/wamp-error-forbidden-you-dont-have-permission-to-access-phpmyadmin-on-this-s solution :1 Wamp server 2.4 Installed and test for machine IP address 192.168.1.36 Error: Forbidden You don’t have permission to access /mysql/ on this server.
httpd.config file
---------------------
# "c:/wamp/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "c:/wamp/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
-----
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
Solution 1.2
I have installed wamp on machine A. When I am on the local server that I installed it on I can access PHPMyAdmin from [127.0.0.1] or [localhost]
But I want to be able to access it from my computer and when I type in IP address of the Server I can see the pages I have put in but when I type [192.168.0.3], PHPMyAdmin comes up saying Forbidden You don’t have permission to access /mysql/ on this server. Solution: Go to C:\wamp\alias. Open the file phpmyadmin.conf and add Options Indexes FollowSymLinks MultiViews Allow Override all Order Deny,Allow Deny from all Allow from 127.0.0.1 Allow from MACHINE_IP
solution : 2
httpd.conf (restarted it afterwards)
Though localhost/phpmyadmin works fine.. I got this in my httpd.conf
solution 3
|
Thursday, 11 April 2013
Android: Save your apk files from Google Play Store and reverse engg / Determine Android published App
Determining if my app was published
One tip that helped me in determining if my app was published or not was knowing what the URL looked like to access the app in the market, because Google won't tell you how to reach it from the Developer Console. This is the format
https://play.google.com/store/apps/details?id=app.package.name where app.package.name is your application package.
------------------------------------------------------------------------------------------------
- Method 1: Use SaveAPK + OI File Manager
- Install OI File Explorer from Google Play Store
- Install SaveAPK from Google Play Store
- Run SaveAPK and select the application(apk) you want to save, then select the directory to store the apk (on SD card)
- Method 2: Use Astro File Manager
- Install Astro File Manager from Google Play Store
- Start Astro File Manager then select Application Backup, backup the applications and the apk files will be store in backups/ directory on SD car
- Procedure for decoding .apk files, step-by-step method:
Step 1:
Make a new folder and put .apk file in it (which you want to decode). Now rename the extension of this .apk file to .zip (eg.: rename from filename.apk to filename.apk.zip) and save it. Now you get classes.dex files, etc. At this stage you are able to see drawable but not xml and java files, so continue.Step 2:
Now extract this zip apk file in the same folder (or NEW FOLDER). Now download dex2jar from this linkhttp://code.google.com/p/dex2jar/ and extract it to the same folder (or NEW FOLDER). Now open command prompt and change directory to that folder (or NEW FOLDER). Then writedex2jar classes.dexand press enter. Now you get classes.dex.dex2jar file in the same folder. Then download java decompiler from http://java.decompiler.free.fr/?q=jdgui and now double click on jd-gui and click on open file. Then open classes.dex.dex2jar file from that folder. Now you get class files and save all these class files (click on file then click "save all sources" in jd-gui) by src name. At this stage you get java source but the xml files are still unreadable, so continue.Step 3:
Now open another new folder and put these files- put .apk file which you want to decode
- download apktool v1.x AND apktool install window using google and put in the same folder
- download framework-res.apk file using google and put in the same folder (Not all apk file need framework-res.apk file)
- Open a command window
- Navigate to the root directory of APKtool and type the following command:
apktool if framework-res.apk apktool d "fname".apk("fname" denotes filename which you want to decode)
now you get a file folder in that folder and now you can easily read xml files also.Step 4:
It's not any step just copy contents of both folder(in this case both new folder)to the single oneand now enjoy with source code...REVERSE ENGG PROCESSHow to avoid reverse engineering of an APK file?
http://stackoverflow.com/questions/13854425/how-to-avoid-reverse-engineering-of-an-apk-file?lq=1 this link help you to avoid decoding 100%.
HOWTO: Extract APK into readable Java source code and XML files
Recently, I discovered how to convert an APK file into readable Java source code and XML files. There are three tools you will need: apktool, dex2jar, and jd-gui (or any other java decompiler, JD Gui happens to be the best one I’ve found so far). You can download them from the following URLs:
http://code.google.com/p/dex2jar/
http://code.google.com/p/android-apktool/
http://java.decompiler.free.fr/?q=jdguiMake sure you follow the installation instructions for APKTool. Windows users will have to download two files to get it working.Once you have these downloaded and installed, the next thing you will need is an APK. With a bit of googling you can easily find APKs for just about anything (e.g. Facebook, Twitter, Amazon App Store).Now, that you have everything you will need to do the following:
1) Extract the APK using APKTool. Run: apktool d <apk>
2) Extract the classes.dex file found in the APK file. Run: jar xvf <apk> classes.dex
3) Extract the classes from classes.dex file. Run: dex2jar classes.dex
4) Extract the classes.dex.dex2jar.jar. Run: jar xvf classes.dex.dex2jar.jarYou now have the raw data available to you. You can use JD-Gui to peruse the extracted classes and even save the source down as Java. All of the layouts, manifest, strings, images, and assets are also available to you in the appropriate folders.Some things I’ve discovered while playing around with this:
1) Hardly anyone actually runs Proguard on their source code.
2) Some developers (e.g. Rovio) have encoded much of their assets into proprietary files. This leads me to my next topic: safe guarding your applications.There are several things you can do to help safeguard your application against hackers:
1) Run Proguard on your release APK. This obfuscates all class names, method names, and variables to make it more difficult for hackers to read.
2) Sensitive data should be encoded in a proprietary binary format.
3) If you have sensitive logic (e.g. encoding / decoding mechanisms), I would suggest writing native code and calling it from Java.These safeguards aren’t 100% fool proof, but it will at least slow down hackers from easily gaining access to sensitive information.EDIT: I’ve written another article on how to pull APKs from non-rooted Android devices. Give it a read if you are curious.THESE ARE REFERENCE POST. THANKS for sharing these ideas . Wel come to to that corresponding bloggers.
Pearl Getting start guide Reference link
Install pearl in window step by step guide:
--------------------------------------------
http://perl.about.com/od/gettingstartedwithperl/ss/installperlwin.htm
Run pearl first programm in windows:
---------------------------------------
http://www.editrocket.com/articles/perl_windows.html
run command for pearl script:
------------------------------
C:\Pearlscripts>C:\Pearl\bin\perl hello.pl
Hello World!
C:\Pearlscripts>
---========================================
http://www.activestate.com/activeperl/
Click on the appropriate download link. You can leave the registration form blank and just hit continue to proceed. Download the windows msi installer. Run the installer. The areas of interest in the installer are the install location. If you are only running Perl on Windows machines, you can use the default location. If you also have Perl programs running on Linux or Mac OS X, you may want to change the install location to C:\usr. This will allow you to maintain portability in your programs. You can also check the box so that Perl gets added to the path, and check the box to create the perl file extension association. After the installer completes, you now have Perl on your machine.
Perl programs can be created using any text editor such as EditRocket. Perl programs and scripts typically end with the .pl extension. EditRocket will automatically recognize files with the .pl extension as Perl programs, and will color the syntax accordingly.
To create a Perl program, simply create a new file, such as hello.pl. In the file, place the following:
The above script can be executed using the EditRocket Tools -> Perl -> Execute Program option, or you can execute it from a command prompt. To execute the script in the command prompt, use the cd command to cd to the directory where the hello.pl file was saved, such as
cd C:\scripts
If when installing Perl, you selected the option for Perl to be added to the path, type the following:
perl hello.pl
Hello World! should then be printed to the screen.
If Perl is not in your Path, you will need to type the full location of the perl executable to run the program, such as C:\Perl\bin\perl hello.pl
--------------------------------------------
http://perl.about.com/od/gettingstartedwithperl/ss/installperlwin.htm
Run pearl first programm in windows:
---------------------------------------
http://www.editrocket.com/articles/perl_windows.html
run command for pearl script:
------------------------------
C:\Pearlscripts>C:\Pearl\bin\perl hello.pl
Hello World!
C:\Pearlscripts>
---========================================
http://www.activestate.com/activeperl/
Click on the appropriate download link. You can leave the registration form blank and just hit continue to proceed. Download the windows msi installer. Run the installer. The areas of interest in the installer are the install location. If you are only running Perl on Windows machines, you can use the default location. If you also have Perl programs running on Linux or Mac OS X, you may want to change the install location to C:\usr. This will allow you to maintain portability in your programs. You can also check the box so that Perl gets added to the path, and check the box to create the perl file extension association. After the installer completes, you now have Perl on your machine.
Perl programs can be created using any text editor such as EditRocket. Perl programs and scripts typically end with the .pl extension. EditRocket will automatically recognize files with the .pl extension as Perl programs, and will color the syntax accordingly.
To create a Perl program, simply create a new file, such as hello.pl. In the file, place the following:
#!/perl/bin/perl print "Hello World!";Notice the first line of the file. Perl scripts should start with the path to Perl on the first line. The path to Perl should be the location where you installed Perl on your Windows machine.
The above script can be executed using the EditRocket Tools -> Perl -> Execute Program option, or you can execute it from a command prompt. To execute the script in the command prompt, use the cd command to cd to the directory where the hello.pl file was saved, such as
cd C:\scripts
If when installing Perl, you selected the option for Perl to be added to the path, type the following:
perl hello.pl
Hello World! should then be printed to the screen.
If Perl is not in your Path, you will need to type the full location of the perl executable to run the program, such as C:\Perl\bin\perl hello.pl
Saturday, 6 April 2013
Python Development with PyDev in Eclipse
2.1. Python
Download Python from http://www.python.org. Download version 2.6.x from Python. If you are using Windows you can use the native installer for Python.
The following assume that you have already Eclipse installed. For an installation description of Eclipse please seeEclipse IDE for Java .
For Python development under Eclipse you can use the PyDev Plugin which is an open source project. Install PyDev via the Eclipse update manager via the following update site. http://pydev.org/updates .
You also have to maintain in Eclipse the location of your Python installation. Open in the menu Window -> Preference and select Pydev-> Interpreter Python
Press new and maintain the path to "python.exe" in your installation directory.
The result should look like the following.
3. Your first Python program in Eclipse
Select File -> New -> Project. Select Pydev -> Pydev Project.
Create a new project with the name "de.vogella.python.first". Select Python version 2.6 and your interpreter.
Press finish.
Select Window->Open Perspective ->Other. Select the PyDev perspective.
Select the "src" folder of your project, right-click it and select New -> PyDev Modul. Create a module "FirstModule".
Create the following source code.
''' Created on 18.06.2009 @author: Lars Vogel ''' def add(a,b): return a+b def addFixedValue(a): y = 5 return y +a print add(1,2) print addFixedValue(1)
Right-click your model and select Run As -> Python run.
able 1. Debugging Key bindings
| Command | Description |
|---|---|
| F5 | Goes to the next step in your program. If the next step is a method / function this command will jump into the associated code. |
| F6 | F6 will step over the call, e.g. it will call a method / function without entering the associated code. |
| F7 | F7 will go to the caller of the method/ function. So this will leave the current code and go to the calling code. |
| F8 | Use F8 to go to the next breakpoint. If no further breakpoint is encountered then the program will normally run. |
Python = Getting start with python install and Run sample program
Getting Started with Python Programming for Windows Users
I tried in windows:
Installation of Python
- Download the current production version of Python (3.0) from the Python Download site.
- Double click on the icon of the file that you just downloaded.
- Accept the default options given to you until you get to the Finish button. Your installation is complete.
Setting up the Environment
- Starting at My Computer go to the following directory C:\Python30. In that folder you should see all the Python files.
- Copy that address starting with C: and ending with 30 and close that window.
- Click on Start. Right Click on My Computer.
- Click on Properties. Click on Advanced System Settings or Advanced.
- Click on Environment Variables.
- Under System Variables search for the variable Path.
- Select Path by clicking on it. Click on Edit.
- Scroll all the way to the right of the field called Variable value using the right arrow.
- Add a semi-colon (;) to the end and paste the path (to the Python folder) that you previously copied. Click OK.
Writing Your First Python Program
- Create a folder called PythonPrograms on your C:\ drive. You will be storing all your Python programs in this folder.
- Go to Start and either type Run in the Start Search box at the bootom or click on Run.
- Type in notepad in the field called Open.
- In Notepad type in the following program exactly as written:
# File: Hello.py print "Hello World!"
- Go to File and click on Save as.
- In the field Save in browse for the C: drive and then select the folder PythonPrograms.
- For the field File name remove everything that is there and type in Hello.py.
- In the field Save as type select All Files
- Click on Save. You have just created your first Python program.
Running Your First Program
- Go to Start and click on Run.
- Type cmd in the Open field and click OK.
- A dark window will appear. Type cd C:\ and hit the key Enter.
- If you type dir you will get a listing of all folders in your C: drive. You should see the folder PythonPrograms that you created.
- Type cd PythonPrograms and hit Enter. It should take you to the PythonPrograms folder.
- Type dir and you should see the file Hello.py.
- To run the program, type python Hello.py and hit Enter.
- You should see the line Hello World!
- Congratulations, you have run your first Python program.
Getting Started with Python Programming for Mac Users
Writing Your First Python Program
- Click on File and then New Finder Window.
- Click on Documents.
- Click on File and then New Folder.
- Call the folder PythonPrograms. You will be storing all class related programs there.
- Click on Applications and then TextEdit.
- Click on TextEdit on the menu bar and select Preferences.
- Select Plain Text.
- In the empty TextEdit window type in the following program, exactly as given:
# File: Hello.py
print ("Hello World!")
- From the File menu in TextEdit click on Save As.
- In the field Save As: type Hello.py.
- Select Documents and the file folder PythonPrograms.
- Click Save.
Running Your First Program
- Select Applications, then Utilities and Terminal.
- In your Terminal window type ls and Return. It should give a listing of all the top level folders. You should see the Documents folder.
- Type cd Documents and hit Return.
- Type ls and hit Return and you should see the folder PythonPrograms.
- Type cd PythonPrograms and hit Return.
- Type ls and hit return and you should see the file Hello.py.
- To run the program, type python Hello.py and hit Return.
- You should see the line Hello World!
- Congratulations, you have run your first Python program.
Starting IDLE on Mac
- In a Terminal window, type python. This will start the Python shell. The prompt for that is >>>
- At the Python shell prompt type import idlelib.idle
- This will start the IDLE IDE
Using IDLE on either Windows or Mac
- Start IDLE
- Go to File menu and click on New Window
- Type your program in
- Go to File menu and click on Save. Type in filename.py This will save it as a plain text file, which can be opened in in any editor you choose (like Notepad or TextEdit).
- To run your program go to Run and click Run Module
Subscribe to:
Posts (Atom)
Claude Code worflow
The Claude code task cycle 1. Gater context Reads files, explore projec structure, code base 2. Plan Break the task in to steps 3. Exe...
-
Top 10 Web Application Security Risks There are three new categories, four categories with naming and scoping changes, and some consolidat...
-
Cross browser testing - automation framework-cypress,playwrite; CloudBorwser -saucelabs browserstackEvaluating cross-browser testing for a React application involves assessing both functional consistency (JavaScript/API behavior) and v...