CSS Format Source Code in blog articles - blogger, wordpress
CSS script to format source code in blog posting in blogger, wordpress... articles.
The working css script : Source Code Formatter CSS Script
The working css script : Source Code Formatter CSS Script
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace;
color: #000000; background-color: #eee;
font-size: 12px; border: 1px dashed #999999;
line-height: 14px; padding: 5px;
overflow: auto; width: 100%">
<code style="color:#000000;word-wrap:normal;">
<<<<YOUR CODE HERE>>>>
</code>
</pre>
HTML/XML Tag Parsing using Regex in Java
This time, I am going to show how to parse the html tags like :
xx <tag a ="b" c= 'd' e=f> yy </tag> zz
xx <tag a ="b" c= 'd' e=f> yy </tag> zz
(Did you noticed the single,double and no-quote attribute
values and spaces ? It is important to consider all these variations.)
Android Reverse Engineering - decompile .apk-.dex-.jar-.java
By reverse engineering of android app (.apk file) we can get following :
NTC Nepal Telecom gprs setting via sms - free
Activating GPRS in NTC (for both prepaid and postpaid service) FREE
- Type vgprs (in your Message Box) & Send to 1400 for GPRS Activation. :)
To get GPRS configuration for your mobile set : FREE
- Send SMS to 1404 - you need to enter following different code according to your mobile set and send it to 1404
- Type gprs (nokia, lg, motorolla, indian etc) (in your Msg Box)
- Type sagprs (samsung mobiles) (in your Message Box)
- Type segprs (sony ericsson mobiles)
- Type chgprs (chinese mobiles)
- After few minutes you will get setting and save it using pin code 1234.
- You might need to restart your set. Enjoy Browsing !!!
Java- extract / unzip a zip file - working code example
How to Extract / unzip a zip file in Java - complete source code example .
import java.io.*;
import java.util.zip.*;
public class UnzipTest {
public static void unzipFile(File f) throws ZipException, IOException {
ZipInputStream zin = new ZipInputStream(new FileInputStream(f));
System.out.println(f.getAbsoluteFile());
String workingDir = f.getPath() + File.separator + "unziped";
byte buffer[] = new byte[4096];
int bytesRead;
Java: using recursion to read a folder and its content in tree format sub-folders/files in tree format
Java CODE: Using recursion to read a folder and its content - sub-folders/files in tree format.
public class TreeTest {
public static void main(String[] args) {
showDir(1, new File("D:\\test"));
}
static void showDir(int indent, File file) {
for (int i = 0; i < indent; i++)
System.out.print(' ');
System.out.println(file.getName());
if (file.isDirectory()) {
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++)
showDir(indent + 4, files[i]);
}
}
}
Java : Generate JTree from XML dynamically - code example
In this post, i am going to describe how to generate JTree in swing according to an XML document dynamically.
Used XML File : catalog.xml
Used XML File : catalog.xml
Java : Html form parser return map of (name,value) pair of input attribute
Simple HTML Form Parser which parses the given string of HTML and returns Map of (name,value) pair of form's input attribute.
CODE : MyHtmlFormParser class
Java : Counting frequency of word in a string using Map
Use a Map to map Map<String,Integer> the words with frequency.
Then you can find out for a particular word with:
String SPACE =" ";
String [] words = input.split(SPACE);
Map<String,Integer> frequency = new HashMap<String,Integer>();
for (String word:words){
Integer f = frequency.get(word);
frequency.put(word,f+1);
}
Then you can find out for a particular word with:
frequency.get(word);
Subscribe to:
Posts
(
Atom
)