Blogging moved
Kindly update your bookmarks.
Things I learn, observe and try out
00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 04)
Subsystem: Hewlett-Packard Company Device 309d
Flags: bus master, medium devsel, latency 0, IRQ 17
I/O ports at 1c00 [size=256]
I/O ports at 18c0 [size=64]
Memory at b0040800 (32-bit, non-prefetchable) [size=512]
Memory at b0040400 (32-bit, non-prefetchable) [size=256]
Capabilities:
Kernel driver in use: Intel ICH
Kernel modules: snd-intel8x0
options snd-intel8x0 ac97_quirk=1 buggy_irq=1 buggy_semaphore=1
ac97_quirk=1
doesn't work, try 0,2,3 or 4 as value.Labels: AC'97, AC97, ac97_quirk, fix, HP dv4000, snd-intel8x0, sound, sound bug, sound error, Ubuntu
import java.net.*;
import java.io.*;
/*
* This class acts as a simple Ident server
* usage: sudo java jident [<fakeid>]
* fakeid is optional, if not passed, nobody is used.
* It simply terminates once ident response is served.
* Best use is to run before connecting to an irc server.
* If on Linux, it should be called using 'sudo' since it
* runs on port 113.
* Use at your own risk.
* @author Usman Saleem
* @version 1.0
*/
public class jident {
public static void main(String args[]){
//create a server socket on port 113
try {
int port = 113;
System.out.println("Simple java based identd server by Uzi");
ServerSocket srv = new ServerSocket(port);
// Wait for connection from client.
Socket socket = srv.accept();
BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String msg = br.readLine();
//should be in format <port-on-server> , <port-on-client>
System.out.println("Request: "+msg);
if(msg != null) {
//send response back to server
msg+= " : USERID : UNIX : " + (args.length>=1?args[0]:"nobody");
System.out.println("Response: "+msg);
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
wr.write(msg);
wr.newLine();
wr.flush();
System.out.println("Response sent, waiting from server");
System.out.println("server:"+br.readLine());
}
socket.close();
srv.close();
System.out.println("Done.");
} catch (IOException e) {
e.printStackTrace();
System.exit(-1);
}
}
}
error: stdio.h: No such file or directory
then you need to install 'build-essential' package. This can be install using Synaptic Package Manager or apt-get.
Labels: wasabi modchip, wii, wii-clip
/**
* My Node
* @author usman
*/
public abstract class MyNode extends DefaultMutableTreeNode{
public MyNode () {
super("Title Of Node);
}
public abstract javax.swing.Icon getIcon();
}
/**
* Custom Node
* @author usman
*/
public class CustomNode extends MyNode{
public CustomNode() {
super("Title Of Node);
}
public
javax.swing.Icon
getIcon() {
return new javax.swing.ImageIcon(getClass().getResource("/icons/myicon16.png"));
}
}
import java.awt.Component;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;
public class CustomTreeCellRenderer extends DefaultTreeCellRenderer{
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
if((value instanceof MyNode) && (value != null)) {
setIcon(((MyNode)value).getIcon());
}
//we can not call super.getTreeCellRendererComponent method, since it overrides our setIcon call and cause rendering of labels to '...' when node expansion is done
//so, we copy (and modify logic little bit) from super class method:
String stringValue = tree.convertValueToText(value, sel,
expanded, leaf, row, hasFocus);
this.hasFocus = hasFocus;
setText(stringValue);
if(sel)
setForeground(getTextSelectionColor());
else
setForeground(getTextNonSelectionColor());
if (!tree.isEnabled()) {
setEnabled(false);
}
else {
setEnabled(true);
}
setComponentOrientation(tree.getComponentOrientation());
selected = sel;
return this;
}
}
getTreeCellRendererComponent
in which we call getIcon method of our sub classes and sets the icon of current node. We don't call super class method directly because it somehow mess up with default width calculation of our nodes and cause '...' in rendering the labels. The '...' is specially visible if we programmatically expand children of a node.
netsh interface ip set address "Local Area Connection" static 10.10.1.15 255.255.255.0 10.0.0.10 1
netsh interface ip set dns "Local Area Connection" static 10.90.1.1
netsh interface ip add dns "Local Area Connection" 10.90.1.2 index=2
<script language="Javascript">
function doSubmit() {
//asubmit is the name of the SUBMIT button in the form
document.yourForm.asubmit.click();
}
//auto submit after 5 second
setTimeout("doSubmit()",5000);
</script>
Clock Link provides fashionable clocks that you can easily embed in your web page. All you need to do is simply paste the tag on your web page. Our clock will display the city name of your choice if you choose. You can also choose a time zone for your clock so it will show the correct time. Decorate your website with our clocks.
import java.awt.*;
import javax.swing.*;
public class BasicDraw {
public static void main(String[] args) {
new BasicDraw();
}
BasicDraw() {
// Create a frame
JFrame frame = new JFrame();
// Add a component with a custom paint method
frame.getContentPane().add(new MyComponent());
// Display the frame
int frameWidth = 200;
int frameHeight = 200;
frame.setSize(frameWidth, frameHeight);
frame.setVisible(true);
}
class MyComponent extends JComponent {
// This method is called whenever the contents needs to be painted
public void paint(Graphics g) {
int style = Font.PLAIN;
int size = 24;
Font font = null;
font = new Font("Nafees Nastaleeq", style, size);
String text = "\u0639\u062b\u0645\u0627\u0646";
g.setFont(font);
// Draw a string such that its base line is at x, y
int x = 80;
int y = 40;
g.drawString(text, x, y);
}
}
}
The language itself is an imperative, stack based language. Each command consists of a series of tokens, beginning with the Instruction Modification Parameter (IMP). These are listed in the table below.
IMP Meaning
[Space] Stack Manipulation
[Tab][Space] Arithmetic
[Tab][Tab] Heap access
[LF] Flow Control
[Tab][LF] I/O
Annotated Example
Here is an annotated example of a program which counts from 1 to 10, outputting
the current value as it goes.
[Space][Space][Space][Tab][LF] Put a 1 on the stack
[LF][Space][Space][Space][Tab][Space][Space]
[Space][Space][Tab][Tab][LF]
Set a Label at this point
[Space][LF][Space]Duplicate the top stack item
[Tab][LF][Space][Tab]Output the current value
[Space][Space][Space][Tab][Space][Tab][Space][LF]
Put 10 (newline) on the stack...
[Tab][LF][Space][Space]...and output the newline
[Space][Space][Space][Tab][LF]Put a 1 on the stack
[Tab][Space][Space][Space]Addition. This increments our current value.
[Space][LF][Space]Duplicate that value so we can test it
[Space][Space][Space][Tab][Space][Tab][Tab][LF]
Push 11 onto the stack
[Tab][Space][Space][Tab]Subtraction. So if we've reached the end, we have a zero on the stack.
[LF][Tab][Space][Space][Tab][Space][Space]
[Space][Tab][Space][Tab][LF]If we have a zero, jump to the end
[LF][Space][LF][Space][Tab][Space]
[Space][Space][Space][Tab][Tab][LF]
Jump to the start
[LF][Space][Space][Space][Tab][Space]
[Space][Space][Tab][Space][Tab][LF]
Set the end label
[Space][LF][LF]Discard our accumulator, to be tidy
[LF][LF][LF]Finish
What could be simpler? The source code for this program is available
here. Have fun!
Turn off MS Word as editor from Tools->Options->Mail Format->Uncheck Use Microsoft Office Word ....
"Compose in this Message format" should be Plain Text.
[usman@isb-usman ~]$ cat /etc/issue
Fedora Core release 4 (Stentz)
Kernel \r on an \m
What is Remote System Management Tool?
Remote Server Management Tool is an Eclipse plug-in that provides an integrated graphical user interface (GUI) environment and enables testers to manage multiple remote servers simultaneously. The tool is designed as a management tool for those who would otherwise telnet to more than one server to manage the servers and who must look at different docs and man pages to find commands for different platforms in order to create or manage users and groups and to initiate and monitor processes. This tool handles these operations on remote servers by using a user-friendly GUI; in addition, it displays configuration of the test server (number of processors, RAM, etc.). The activities that can be managed by this tool on the remote and local server are divided as follows:
* Process Management: This utility lists the process running on UNIX and Windows® servers. One can start and stop processes. Along with process listing, the utility also provides details of the resources used by the process.
* User Management: This utility facilitates creation of users and groups on UNIX servers; it also provides options for listing, creating, deleting, and modifying the attributes of users and groups.
* File Management: This utility acts as a windows explorer for any selected server, irrespective of its operating system. One can create, edit, delete, and copy files and directories on local or remote servers. Testers can tail the remote files.
How does it work?
This Eclipse plug-in was written with the Standard Widget Toolkit (SWT). The tool has a perspective named Remote System Management; the perspective consists of test servers and a console view. The remote test servers are mounted in the Test Servers view for management of their resources (process, file system, and users or groups).
At the back end, this Eclipse plug-in uses the Software Test Automation Framework (STAF). STAF is an open-source framework that masks the operating system-specific details and provides common services and APIs in order to manage system resources. The APIs are provided for a majority of the languages. Along with the built-in services, STAF also supports external services. The Remote Server Management Tool comes with two STAF external services: one for user management and another for proving system details.
The Software Testing Automation Framework (STAF) is an open source, multi-platform, multi-language framework designed around the idea of reusable components, called services (such as process invocation, resource management, logging, and monitoring). STAF removes the tedium of building an automation infrastructure, thus enabling you to focus on building your automation solution.
STAX is an execution engine which can help you thoroughly automate the distribution, execution, and results analysis of your testcases. STAX builds on top of three existing technologies, STAF, XML, and Python, to place great automation power in the hands of testers. STAX also provides a powerful GUI monitoring application which allows you to interact with and monitor the progress of your jobs.
Other STAF services are also provided to help you to create an end-to-end automation solution. Other STAF services include: Event, EventManager, Cron, Email, HTTP, NamedCounter, FSExt (File System EXTension), and Timer.
Sun Microsystems (Quote, Chart) is quietly releasing the source code to the upcoming Java System Application Server, Platform Edition 9, under the GlassFish project, named after a semi-transparent aquarium fish.
The company is expected to release the source code for its Java-based application server under a new open source license as it kicks off its JavaOne conference in San Francisco today.
The title software engineer is worthy of further elaboration. IT professionals have a propensity for putting all manner of titles on business cards, from systems analyst and enterprise architect to quality specialist and IT consultant. The true software professional, however, is an extremely versatile individual who is fully capable of fulfilling many, but not necessarily all, of the predefined roles on a project. It is to this type of individual that I apply the term software engineer. Putting aside for a moment the technical description of the role and the associated computer scientist tag, a software engineer is someone who not only knows his or her profession but knows it well. He or she can effectively contribute in all project phases, whether analysis, design, implementation, or testing. Moreover, a software engineer continually looks for new ideas to improve what he or she does and how it is done. In short, a software engineer understands that self-improvement and continuous learning are fundamental activities for an IT professional.