My Experiments with Life

August 17, 2011

Vista, Trojan and File Association issues

Filed under: Tech — alanabraham @ 4:16 am
Tags: , , ,

2:00 AM

Cellphone ring cracked into my sleep.  “ahh..aww Hello…!”

“Da, it’s me Nayana.”

“Ha.. What’s the matter?”

“Nothing, my Laptop got a virus infection”

“OKaaay….”

“Some Program called Vista Antivirus tells it detected viruses on my Laptop. No I can’t access web”

“It’s a fake application, a trojan”

“What shall I do?”

“Go to Symantec site and Get norton trial”, I told the easy way.

“I can’t access internet.”

“Okay. Then can you bring it next day.”

“Yeah, sure.”

Two days later. She called again,”I removed the trojan with AVG.”

“Good , fine.”

“But I can’t open any programs by double clicking.”

“What happens when you do that?”

“It shows some error.”

“What error?”

“File Type….blah blah.”

I tried explaining methods to remove them, but as she said the trojan was already removed by AV. I assumed some left over piece of worm or any OS problems caused by the trojan.“OK. Bring it next day.”

“Sure.”

 

Next Day.

She told me that she installed AVG followed by Malwarebytes’ Anti-malware. Now I have to diagnose it considering the modification done by the AVs also. After a brief analysis, I found it was some problem with file association and began to check the regular file association Tools->Options as in Windows XP. Sadly, Vista abstracted that features(Win 7 also). Now I need to sail through the registry. I guessed it should be somewhere near the shell\open option for exe and my memory on some earlier reg tests points to somewhere in HKEY_CLASSES_ROOT. Normal .exe option was seen to be inappropriate. But searching through, I got to the key HKEY_CLASSES_ROOT\exefile

All other options except ‘open’ in the right click menu were working like ‘run as administrator’ etc. Observing the key I found HKEY_CLASSES_ROOT\exefile\shell\open has no ‘command’ key inside whereas HKEY_CLASSES_ROOT\exefile\shell\runas and HKEY_CLASSES_ROOT\exefile\shell\runasuser. I created a command key inside open key with values as below.

[HKEY_CLASSES_ROOT\exefile\shell\open]
"EditFlags"=hex:00,00,00,00

[HKEY_CLASSES_ROOT\exefile\shell\open\command]
@="\"%1\" %*"

which is same as in runas\command and runasuser\command.

Hurray, it worked.

Advertisements

May 31, 2011

Questions India ask to Google

Filed under: Tech — alanabraham @ 1:22 pm
Tags: , ,

Its quite interesting to know what other people are  thinking. Even more interesting to know their doubts. Google stands as the Wise Old Man who answers our doubts. We know what all kinds of questions we ask to Google. So what will be others asking? Google Zeitgeist is a feature tells what people were asking google in a year. They have all weird graph stuff to show what are the rising trends in search. But to know the top 10, you just need to look at the search autocomplete (or search suggestion) feature. Here are a few wh questions that Indians ask Google

 

1. Who

 

who 

 

2. What

what

 

3. Where

where

4. Why

why

5. Which

which

6. When 

when

7. How

how

 

 

Check out the first among top 10 how searches- ‘how to get pregnant’ LOL, its funny. That’s what is Indian women searching. Hmm, interesting, really interesting…. Smile

February 26, 2011

Fixing Volume Control Unit of Creative Inspire M2600 2.1 Speaker System

Filed under: Tech — alanabraham @ 11:29 am
Tags: , , , , , , ,

PROBLEM :

I have a creative inspire m2600 2.1 speaker system with desktop computer. Though the sub-woofer quality declined after an year after I bought it, the speakers are cool. Its volume control unit wasn’t working for 1-2 years. But I was adjusting by tightening the volume control knob. Whenever someone touch the knob, I need to go through the herculean task or re-adjusting.

 

Six months back, I went to a local electronic shop to repair the volume control unit. They said me that the resistor inside the chip went wrong and I need to get the chip or the unit to be replaced. You can see the chip here

Photo-0166

I know that would cost me so much for something that I’m not using frequently. So I left it as it is.

Today when I need to watch a movie, I found that knob is not at all working. So I just googled to know whether I can buy the chip from Creative or from Ebay. A lot of other people also had the same problem. Carefully reading through the forums, I got the solution.

SOLUTION : LUBRICATION

Some people solved their knob problem with a little lubricating oil or WD-40 or petrol (I don’t recommend petrol, cause their may be heat and petrol can ignite the knob… LOL)Since I can’t get any petrol or other similar lubricants, I used a lubricant made by mixing coconut oil and kerosene which was there in my store room and it worked like a charm.

Apply 2-3 drops of your lubricant on the knob after disconnecting it (as in figure) from the wires. Keep it open for 2 –3 minutes and then wipe off any lubricant spread over other parts of the chip. Connect the pins to the connector and check your sound system.

December 27, 2010

libwinmm in mingw using C-Free IDE

Filed under: Tech — alanabraham @ 6:12 am

It was Joe who started using C-Free IDE first in our friend circle. We were so much depended on the Turbo C++ for console programming earlier. When we migrated to Windows Vista and later, to Windows 7, we looked for some pretty Editor + Compiler for small programs in C/C++. We dont need Visual Studio because that is so big. All others werr also rejected due to some reason or another. So Joe came with C-Free with an old mingw inside it. But we were ok with it unless someone is using a conio.h which was there in our Turbo C++ library.

C-Free also facilitated using windows API to create some GUI Forms. This day, i started to play some WAV file from a form using PlaySound() function in the API ending up in lots of errors like

error : PlaysoundA@12

Then i added


#include<mmsystem.h>

#pragma comment(lib,"winmm.lib")

But error remains. I saw that in mingw of c-free, instead of winmm.lib,  libwinmm.a is used in Code::Blocks, DevC++ etc. When checked, i saw the same is true as mingw\lib had a libwinmm.a file. So changed to

#pragma comment(lib,”libwinmm.a”)

The error remains the same.

After taking a whole night, i found the real cause of all evil as a linker option

-lwinmm

If you need only for that Project go

Project->Settings->Linker

or for all C-Free programs

Build->Build Options->Linker

After reaching to this point

Linker->Linker Options

Add -lwinmm

The code main.cpp is as follows

#include
#include
#pragma comment(lib,"libwinmm.a")
const char g_szClassName[] = "myWindowClass";

// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CLOSE:
            DestroyWindow(hwnd);
        break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
        default:
            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
    WNDCLASSEX wc;
    HWND hwnd;
    MSG Msg;

    //Step 1: Registering the Window Class
    wc.cbSize        = sizeof(WNDCLASSEX);
    wc.style         = 0;
    wc.lpfnWndProc   = WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = g_szClassName;
    wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

    if(!RegisterClassEx(&wc))
    {
        MessageBox(NULL, "Window Registration Failed!", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    // Step 2: Creating the Window
    hwnd = CreateWindowEx(
        WS_EX_CLIENTEDGE,
        g_szClassName,
        "The title of my window",
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
        NULL, NULL, hInstance, NULL);

    if(hwnd == NULL)
    {
        MessageBox(NULL, "Window Creation Failed!", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    ShowWindow(hwnd, nCmdShow);
    PlaySound(TEXT("acidrain.wav"),NULL,SND_FILENAME);
    UpdateWindow(hwnd);

    // Step 3: The Message Loop
    while(GetMessage(&Msg, NULL, 0, 0) > 0)
    {
        TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }
    return Msg.wParam;
}

This doesnt really qualify for a post in a blog, but done this is the first step in another experiment. Wait for more.

May 13, 2010

Resume Rapidshare, Megaupload, Mediafire, Hotfile free downloads

Filed under: Tech — alanabraham @ 2:20 am

The major file hosting sites like Rapidshare, Megaupload, mediafire etc. dont allow the resuming of paused downloads.
This following trick will be working on any file that you stopped downloading (especially large size) in midway.

PROJECT R3SUME

Firefox

Mozilla Firefox

The Background Info

1. Firefox (im talking abt 3.5+) usually downloads a file when u click save button in two files

* the original file with size 0
* the .part file named as “FILENAME.EXTENSION.part” , where FILENAME.EXTENSION is the real file

2. When you download something from sites like Rapidshare, Megaupload etc or any other sites, the .part file keeps increasing its size. After the whole download completes, the original file is stored with the data in .part file and .part file is removed.

Trick

1. Restart download after saving the previous broken-downloaded .part file to another location
2. Pause download after few seconds (dont take more than 10 seconds for the following processes).
3. Delete the new part file and replace it with old .part file with the same name of new file
4. Resume download

Opera

Opera

This tip will help you to resume a download (especially large size) in the following cases:

* Accidentally removed transfer from the transfers tab.
* Closed Opera with an intention to resume download next day but transfer is missing when Opera is started.
* Resuming download with an another high speed mirror.

The following will work when web server allows resuming of broken downloads.

1. Start download again and save with another name.
2. Stop transfer after few seconds.
3. Delete new download file.
4. Rename old download file with new name.
5. Resume transfer.

Note : If you leech from here, pay the credits….LOL

Also check my post at  here and here

December 2, 2009

Polynomial Multiplication

Filed under: Uncategorized — alanabraham @ 5:13 am

Yesterday evening, Irshad came with some polynomial multiplication problem in C .

Q : Get the resultant polynomial after the multiplication of n polynomials

Thought lots of methods like matrix multiplication to implement this

I thought of creating a program by reducing the multiplication and use addition instead and over the condition of which to multiply appropriatly…..

There i got wrong….coz u can do that for a small values like 2 polynomials or 3 polynomials for which require as many loops as the polynomials. For an n polynomial condition, i felt it like the requirement of recursive function…..

Here it got messy….i got stuct in n times recursion in a Utopian space-time frame.

Then the Messiah of this problem appeared before me……Jomon chettan

He teared my logic apart and killed it……

He told me to use the temporary structure where you go on multiply with the next.

That was a good start but i did it like a n00b……got stuck n stuck till the sleep invited me to the warmth of her lap.

Morning. I know what to do. I started recoding not debugging  the first stuff.I know now that i am going the right way….logically right path

the right path…..

it took me to this code

i think its right…..still a code is never always 100% working….u can find more conditions where it cant work properly.


Go to this link to see the program file properly

or see here

NOTE : JUST DONT LOOK INTO COMMENTED CODES….

__________________________________________________________

//polynomial mltiplication


#include<stdio.h>

struct polynomial

{

      int degree;

      float  coeff[100];

}pol[100];

//simply output the argument

void out(struct polynomial a)

{

      int k; 

      for(k=a.degree;k>=0;k--)

      {

             if(k)

                   printf("%f(x^%d)+\t",a.coeff[k],k);

             else

                   printf("%f",a.coeff[k]);

      }

      printf("\n-------------------\n"); 

}

//return type is structure polynomial

struct polynomial multiply(struct polynomial pol1,struct polynomial pol2)

{

      int a,i,j;

      //declare t and initialise to zero;

      struct polynomial t;

      //initialising t

             //---------------

                   t.degree=0;

                   for(a=0;a<100;a++)

                         t.coeff[a]=0;

             //--------------- 

      for(i=0;i<=pol1.degree;i++)

      {

             for(j=0;j<=pol2.degree;j++)

             {

                   //printf("~~~~~~~~~%f~~~~~~~~",(pol1.coeff[i]*pol2.coeff[j]));

                   t.coeff[i+j] = t.coeff[i+j] + (pol1.coeff[i]*pol2.coeff[j]);

                   //printf("@@@@@%f@@@@@-%d-",t.coeff[j],j);

             }

      }

      t.degree=i+j-2;

      return(t);

} 

//input whole structure array

void input(int n)

{

      int i,j;

      for(i=0;i<n;i++)

      {

             printf("enter the degree of polynomial %d : ",i+1);

             scanf("%d",&pol[i].degree);

             for(j=0;j<=pol[i].degree;j++)

             {

                   printf("Enter coeff of x for degree %d : ",j);

                   scanf("%f",&pol[i].coeff[j]);

             }

      } 

} 

//main function

int main()

{

      int k,n;

      //declare resultant

      struct polynomial resultant;

      printf("Enter the number of polynomials to be multiplied : ");

      scanf("%d",&n);

      //input the polynomials

      input(n);

      //

      resultant=pol[0]; 

      for(k=1;k<n;k++)

             resultant=multiply(resultant,pol[k]);  

      //output the ultimate resultant

      out(resultant);  

}


_____________________________________________________

November 26, 2009

Google Chrome OS

Filed under: Uncategorized — alanabraham @ 2:27 am
Google Chrome OS – Chromium

Google Chrome OS is an open source operating system designed by Google to work exclusively with web applications. Announced on July 7, 2009, Chrome OS is set to have a publicly available stable release during the second half of 2010. The operating system is based on Linux and targets specifically designed hardware. The user interface takes a minimalist approach, resembling that of the Chrome web browser. Because the browser will be the only application residing on the device, Google Chrome OS is aimed at users who spend most of their computer time on the Internet.
Few days back, I got the Developer build of Google’s new operating system and so tried that on a virtual machine.

Simpler and faster boot up.
Login using google account


Logs in directly to your gmail inbox





It’s focussed on netbooks and i hope the cybercafe’s will also benefit from this OS if it has good LAN networking capabilities.

Note : This is just a Developer build and its not yet time for a review. So now it is nothing more than a browser. Not an OS with file manipulation abilities.

Syshacks rocks.(This is my second home)



October 18, 2009

Venom

Filed under: Literature — alanabraham @ 3:13 am

ECS period is so boring that it can bring the poet out of you. This i dedicate to all irresistible girls that i have ever met who added spice to my life.

—————————————————————————————-

Venom

She passed her venom onto my lips
Still I drank it in pleasurable sips
It tasted salty like her sweat
Its ecstacy float raging my blood
And I was raised and touched the heavens

My body trembled,my skin burnt
I can feel the venom in my veins
It conquered my hands,legs and my heart
And finally moved up to my head

It wasnt like the burn of marijuana
and not the intoxication of martini
I felt the hell burning,right inside my head
I tried to fight that burning thoughts

The venom carved her face inside the walls
And left that burning wounds inside
It pained only after she left
And i lost myself to the burning venom.

—————————————————————————————-
Written by :  Alan
Editted by : Vishwajeet
Reviewed by:  Prashant

“This is wild and has a sense of its own and coming right from heart.The best part is that you can feel the HELL.” – Prashant

All copyrights for me….LOL.

Tell me if you like this. Mail to me at alan.idea@gmail.com


October 11, 2009

Windows 7 rocks

Filed under: Uncategorized — alanabraham @ 9:41 pm

Although MS(Microsoft) is currently facing threats from all sides(Google, Symantec etc) , as always, it still comes up with something new, and more importantly, something very valuable. I’m talking about the product of the year “windows 7”.

Some people always dislike “The Mighty” and will always complain about it.This psychological phenomenon is expressed by the so-called Linux Fan Boys when someone says the word WINDOWS or Microsoft.There is no treatment for that. I’m too a Linux fan but not a windows hater. Its like spoon and fork. You need both to eat.Its just choose the best accordingly for your work.

Back to Windows 7.I wont say “its the best and it has no bugs or faults”.Even i had some Hard Disk problems(My two drives crashed due to some reasons and windows 7 restricted access for my parallel Windows XP into that drive.) and downward permission problems(user permission restriction of drives in windows 7 cant be altered in windows XP). These are something perfectly natural for a new OS.

But the point i’m gonna express is different.

My friend Rohan came with a 16 GB Kingston Datatraveler G2 USB flash Drive,corrupted and cannot be accessed or formatted. I tried windows XP disk management utility,windows Diskpart commands and some professional tools like Acronis Disk Management. Same error “Windows cannot complete formatting the following disk”. I tried to enter into Windows 7 after trying again with Acronis. It worked like magic with Windows 7 and windows successfully formatted.Thanks to Microsoft and the minds behind Windows 7. The apparant problems are solved now but i know some may exist because the flash drive has some hardware problems. But on the software side Windows 7 make it maximum available for use.

This is the villain of the story.

This is the villain of the story.

iExperiment

Filed under: Uncategorized — alanabraham @ 9:35 pm

Experiment is a method of investigating causal relationships among variables, or to test a hypothesis.

Here I’m beginning the journey through the variables which are randomly generated in this life. My journey through my life and my experiments will be expressed here. I’m not promising an output but the system will be modified by this effort. And for every action, there is a cause. I bow before the Cause.

Blog at WordPress.com.