tushar kapila 2

Anyone can comment, so leave your views

Tuesday, December 8, 2009

Thursday, November 5, 2009

advanced comands in XP..... exes in the windows system32 folder that can be of use

blog moved to http://how2that.blogspot.com/

1- Private Character Editor This program is for designing icons and Characters(Alphapet) Click :start Then :run type : EUDCEDIT ..................................................
2- iExpress This Program is for conerting your files to EXCUTABLE files Click : start Then : run type : iexpress ..................................................
3-Disk Cleanup This program used for cleaning harddisk to offer space Click : start Then : run type : cleanmgr
..................................................
4-Dr Watson This program Is for repairing problems in Windows Click : start Then : run type : drwtsn32 .............................................
5-Windows Media Player 5.1 Opens the old media player Click : start Then : run type : mplay32 .............................................
Program ............. CODE __________ __________
Character Map = charmap
DirectX diagnosis = dxdiag
Object Packager = packager
System Monitor = perfmon
Program Manager = progman
Remote Access phone book = rasphone
Registry Editor = regedt32
File siganture verification tool = sigverif
Volume Contro = sndvol32
System Configuration Editor = sysedit
Syskey = syskey
Microsoft Telnet Client = telnet

Sunday, November 1, 2009

how would a mobile phone control a PC?

think about it
if u have
xyz installed on ur pc
then it sends control messages to a web site and gets same from that website
on ur ohoine u justhave an app thats gets images, icon pos , click , type ...
from phone message goes to website
from website to the app on ur PC
where it is translated to native API
pretty simple
 
 
  personal computer/ desktop
  3rd party api on their app on ur pc  
 
   internet     3rd part web site    internet    mobile phone with app




























http://stephenbrooks.org/muon1/ Volunteer computer idle time to science, is run by a friend; he has helped me with 2 algorithms. A child genius was in oxford at age 17
www.thehungersite.com , and www.bhookh.com feed hungry , its free. www.ecologyfund.com
Please add these to your start-up how to: http://tusharkapila.blogspot.com/2008/05/s.html or bookmark all in one folder in your browser and open all together so you remember to visit all! you can even bookmark the individual tabs of the hunger site like this for child health

Tuesday, August 18, 2009

MS Office excel VBA features

Instead of buttons: nice of a link could point to a macro. Click here to do this ... Can be dynamic create in scripts too.
 
Macro Security : keep a Code_Last_Modified_Date - if user trusts a code then a check box not to prompt to trust same file until code is modified.
 
Code Location: Keep code in a linked file - so can change classes etc via version control - in one go instead of having to go to the editor and pasting there. Anyway will be used by developers and when we distribute its our responsibility to tell the users to keep additional files in correct relative folders, or give an installer as with other programs.
 
Microsoft Office Macros are very powerful - and should be encouraged and new features added all the time.
 

Wednesday, February 25, 2009

Java Apache releasing new HttpComponents

http://hc.apache.org improved library and better code. bug fixes over earlier versions. but its a new set of packages so cannot port directly. but worth the time as its better than the earlier blokes. Quick Start Enjoy!

HttpComponents is used to make requests to a page web page as get/ post. site scraping etc. Contact us for a solution Sel2In

Monday, February 23, 2009

Low-Tech Fixes for High-Tech Problems

Dry Ink Cartridge

If your printer's ink cartridge runs dry near the end of an important print job, remove the cartridge and run a hair dryer on it for two to three minutes. Then place the cartridge back into the printer and try again while it is still warm.

"The heat from the hair dryer heats the thick ink, and helps it to flow through the tiny nozzles in the cartridge," says Alex Cox, a software engineer in Seattle. "When the cartridge is almost dead, those nozzles are often nearly clogged with dried ink, so helping the ink to flow will let more ink out of the nozzles." The hair dryer trick can squeeze a few more pages out of a cartridge after the printer declares it is empty.

Remote Car Key

Suppose your remote car door opener does not have the range to reach your car across the parking lot. Hold the metal key part of your key fob against your chin, then push the unlock button. The trick turns your head into an antenna, says Tim Pozar, a Silicon Valley radio engineer.

Mr. Pozar explains, "You are capacitively coupling the fob to your head. With all the fluids in your head it ends up being a nice conductor. Not a great one, but it works." Using your head can extend the key's wireless range by a few car lengths.

Credit Card wont swipe

...he reaches beneath the counter for a black plastic bag. He wraps one layer of the plastic around the card and swipes it again. Success. The sale is rung up. "I don't know how it works, it just does," says Mr. Azar, who learned the trick years ago from another clerk. Verifone, the company that makes the store's card reader, would not confirm or deny that the plastic bag trick works. But it's one of many low-tech fixes for high-tech failures that people without engineering degrees have discovered, often out of desperation, and shared.

http://www.nytimes.com/2009/02/19/technology/personaltech/19basics.html?_r=2&pagewanted=1&no_interstitial

Tuesday, January 13, 2009

Java HTTP Client 4 beta2

SOLUTION
 
TO :
 
cannot determine the required jar files to compile samples/ own files
 
example org.apache.http.examples.client.ClientFormLogin
 
used
 
set CLASSPATH=P:\j\samples\httpClient\examples;j:\j\j5\h;P:\j\e\mysql.jar;P:\j\e\commons-logging-api-1.1.1.jar;P:\j\e\commons-logging-1.1.1.jar;P:\j\e\4\httpmime-4.0-beta2.jar;P:\j\e\4\httpclient-4.0-beta2.jar;P:\j\e\4\h\e\4\httpcore-4.0-beta3.jar;P:\j\e\4\httpcore-nio-4.0-beta3.jar
 
but still needs org.apache.http.*; ... where are these jars? a quick start guide / link to all jars for one version would help
 
- only known workaround - go back to old version 3.1
 

Regards
Tushar Kapila
santaletternow.com     http://sel2in.com


www.worldcommunitygrid.org Volunteer computer Cancer cures
www.thehungersite.com , and www.bhookh.com feed hungry , its free. www.ecologyfund.com
Please add these to your start-up how to: http://tusharkapila.blogspot.com/2008/05/s.html

Tuesday, November 25, 2008

Select Files & Folders: C# dotnet project excerpts

I recently had to do a MS Visual Studio DotNet C# project to mimic the back up tab of the Backup utility (attached image)
 
Two sites that helped : http://www.tangiblesoftwaresolutions.com/ and http://www.infragistics.com/ (tree view, over riding how a control is to be drawn, native support for 3 states of check boxes)
 
 
Interesting part is how it has to select parent nodes and gray them when you select a node whose parent/ grand parents are not selected.
 
Here is my altervative to using a image list and instead caching a few images
 
using System;
using System.Threading;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Collections.Generic;
 
using System.Data;
 
using System.Text;
using Infragistics.Win;
 
//using Infragistics.Win.UltraWinTree;
using Icons2;
 
using Infragistics.Win.UltraWinListView;
using Infragistics.Win.UltraWinTree;
using Infragistics.Shared.Serialization;
using FldrSel.draw;
using System.Runtime.InteropServices;
 
namespace Icons2
{
    /**
    * a holder for an icon and its ID
    * not required in all cases
    */
    public class IconInf
    {
        public Icon theIcon;
        public int id;
    }
    [StructLayout(LayoutKind.Sequential)]
    public struct SHFILEINFO
    {
        public IntPtr hIcon;
        public IntPtr iIcon;
        public uint dwAttributes;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
        public string szDisplayName;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
        public string szTypeName;
    };
 
    class Win32
    {
        public const uint SHGFI_ICON = 0x100;
        public const uint SHGFI_LARGEICON = 0x0; // 'Large icon
        public const uint SHGFI_SMALLICON = 0x1; // 'Small icon
 
        [DllImport("shell32.dll")]
        public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
    }
   
    public class Othr
    {
        private struct SHFILEINFO
        {
            public IntPtr hIcon; // : icon
            public int iIcon; // : icondex
            public int dwAttributes; // : SFGAO_ flags
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
            public string szDisplayName;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
            public string szTypeName;
        }
 
        [System.Runtime.InteropServices.DllImport("shell32.dll", EntryPoint = "SHGetFileInfo", ExactSpelling = false, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
        private static extern IntPtr SHGetFileInfo(string pszPath, int dwFileAttributes, ref SHFILEINFO psfi, int cbFileInfo, int uFlags);
 
        private const int SHGFI_ICON = 0X100;
        private const int SHGFI_SMALLICON = 0X1;
        private const int SHGFI_LARGEICON = 0X0; // Large icon
  
        public const string FOLDER_STR = "[folder]";
        public const string DRIVE_STR = "[folder]";
        Dictionary<string, IconInf> icons = new Dictionary<string, IconInf>();
 
        public Othr()
        {
        }
        public void init(){
            string sExtn = "txt";
            if (!icons.ContainsKey(sExtn))
            {
 
                DefaultIcon di = new DefaultIcon();
                IconInf oIconInf = new IconInf();
                oIconInf.theIcon = di.GetIcon(sExtn);
                oIconInf.id = icons.Count;
                icons.Add(sExtn, oIconInf);
            }
        }
 

        public IconInf getIcon(string sFileName)
        {
            return getIcon2(sFileName);
        }
        private IconInf getIcon2(string FileName)
        {
            lock (icons)
            {
                if (icons.Count > 1100)
                {
                    System.Collections.ArrayList keys = new System.Collections.ArrayList(icons.Keys);
                    for (int i = 700; i < 800; i++)//remove from the middle, hopefully they are less used
                    {                      
                        icons.Remove(keys[i].ToString());
                       
                    }
                    init();//reinit
 
                }
            }
           
            System.Drawing.Icon myIcon = null;
 

            IntPtr hImgSmall = default(IntPtr); //The handle to the system image list.
            IntPtr hImgLarge = default(IntPtr);
            string sExtn = null;
            sExtn = "txt";
 
 
 
            try
            {
               
                //FileName = "d:\Dev"
                if (!System.IO.Directory.Exists(FileName))
                {
                    sExtn = FileName.Substring((FileName.LastIndexOf(".") + 1));
                }
                else
                {
                    sExtn = FileName;
                }
                if (icons.ContainsKey(FileName))
                {
                    sExtn = FileName;
                }
                else if (icons.ContainsKey(sExtn))
                {
                    //do nothing
                }
                else
                {
                    DefaultIcon di = new DefaultIcon();
                    IconInf oIconInf =  new IconInf();
                    oIconInf.theIcon = di.GetIcon(sExtn);
                    oIconInf.id = icons.Count;
                    icons.Add(sExtn, oIconInf);
 
                }
 
            }
            catch (Exception ex)
            {
 
                try
                {
                    SHFILEINFO shinfo = new SHFILEINFO();
                    shinfo = new SHFILEINFO();
                    hImgSmall = SHGetFileInfo(FileName, 0, ref shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON | SHGFI_SMALLICON);
                    myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon);
                    //icons[sExtn] = myIcon;
                   
                    IconInf oIconInf = new IconInf();
                    oIconInf.theIcon = myIcon;
                    oIconInf.id = icons.Count;
                    icons.Add(sExtn, oIconInf);
                }
                catch (Exception ex2)
                {
                    //default
                    sExtn = "txt";
                }
            }
 
            IconInf oIconInf2 = icons[sExtn];           
            return oIconInf2;
 
        }
       
    }
}

Friday, September 19, 2008

StringTableModel1Col JAVA jtable table model for one column of data all of type string

/**
*

StringTableModel1Col JAVA jtable table model for one column of data all of type string

@author tushar.kapila at gmail .com

*/
package xmltagger.common;
 
import javax.swing.table.*;
import java.util.*; import javax.swing.*;
 

public class StringTableModel1Col extends AbstractTableModel{
 ArrayList<String> data = new ArrayList<String>();// need array of arrays for multi col
 
 public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex){
 
  if(rowIndex >= data.size()){
   int toAdd = rowIndex - data.size();
   for(int i = 0; i < toAdd; i++){
    data.add("");
   }
  }
  data.set(rowIndex,(String)aValue);
 }
 
  public int getRowCount(){
   return data.size();
  }
  public int getColumnCount(){
   return 1;
  }
  public Object getValueAt(int row, int column){
   return data.get(row);
  }
 
}

Wednesday, September 17, 2008

mocha host - bad www.MochaHost.com

I used mocha host for jsp / java servlets hosting - but they are bad - could not get jsps to work and they did not refund even though I asked for a cancel when I could not get it to work :

 Posted On: 05 Sep 2008 12:49 AM
i requested the restart 2 days back but i got no email informing me of restart ! nor does it seem to have worked the site is not working - jsp not appearing.
 
eatj gives better free service please cancel this account and refund as i asked for java but never got it
 

Sunday, September 7, 2008

IE DEFAULT PRINT

HEADER
 
&w&bPage &p of &P
 
FOOTER
&u&b&d
 

G
 
Forum
Ads by google:











Source code, testing article - one stop shop Software applications written in Java for cell phones, PHP, Java Dot net, PHP & Perl for the web and Vb6, Java, VB6, Perl and Excel VBA for the desktop .

- Tushar G Kapila
Bangalore India 2007 © Remaining page can be removed if you save on your pc or server.

Contributors