All posts by pepesmith

Error code 9009 due to Missing ResGen.exe

I have this error :
When compiling a certain Asterisk.net.dll program, the error is showing :

The command “C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\ResGen.exe” “C:\Users\jojo\Desktop\project\Asterisk.NET.1.6.3.1\Asterisk.NET.Test\fastagi-mapping.resx” fastagi-mapping.resources” exited with code 9009. Asterisk.NET.Test

I’m using MS Visual Studio 2008, and please note that the location of Resgen now is in : C:\Program Files\Microsoft SDKs\Windows\v6.0A\

So changing the “C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\ResGen.exe”

to “@”%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bin\ResGen.exe”. fixes it.

HP Compaq PC that uses Intel 82566DM network problem in Linux

The problem of this pc is upon installation of Centos 5.7, the network is up but if you ping the other pc its just saying “Destination unreachable”.

The fix for this problem is this:

 

1) Download the  http://sourceforge.net/projects/e1000/ driver from that site. Note the e1000 not e100, this is gigabit..

2) tar xfz e1000-<x.x.x>.tar.gz

3) cd e1000-<x.x.x>/src/

4) make install

5) modprobe e1000

 

After doing the the #5, do the command service network restart in the CLI.

HTH

 

Google Chrome – No space between words in pdf

In my ubuntu Natty, the rendering of my php script  in google chrome  displays without spaces between words in pdf. But if i view that on other OS like win7 or winxp with google chrome, the script will just display fine.

It turns out that the problem is i need an MS true type core  fonts on my ubuntu. So here is the command:

apt-get install msttcorefonts
fc-cache -fv

This is free anyway, you just have to agree with the EULA during installation.

 

Short note of Javascript refresher

In the program i made, which tabulates the latest 20 call in a minute, I’ve found some good resource for it.
My setup, perl-cgi script is the one that generates the list of calls. This script is just called via an Ajax function.

The main important part of that is part that contains this setInterval.
I chose setInterval since the “Call Accounting System” i made needs a refreshing every minute to update
the user about the activity of PBX.

The code also requires to have an id “content” to have the content generated by “refresher.cgi” displayed.
An example of usage will be.

<div id=”content”>&nbsp;</div>

and i put the code at the bottom of the html page.

<script type=”text/javascript” src=”20records.js”></script>

Below is the content of the 20records.js file:

var xmlhttp;

function showList()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert (“Browser does not support HTTP Request”);
return;
}
var url=”refresher.cgi”;
url=url+”?sid=”+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open(“GET”,url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{

document.getElementById(‘content’).innerHTML = xmlhttp.responseText;
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject(“Microsoft.XMLHTTP”);
}
return null;
}
window.setInterval(“showList();”,60000)

A notes UTF8 in MySQL and PHP

According to Wikipedia, the Congo Region has 3 countries, the 2 Congo countries and the Angola.

I was tasked to list the countries all over the world and that includes the two (2) countries of Congo called Republic of the Congo (Congo-Brazzaville) and the Democratic Republic of the Congo (Congo-Kinshasa).

The addition of the dash – thing on the country to identify that separate country rendered some special unknown characters in both IE and Firefox browser. So upon seeing the content of the combo-box that contains the list of the country, this 2 country was rendered then as Congo <special character> Kinshasa and Congo <special character> Brazzaville. I thought that was just the result of the uploads via LOAD DATA INFILE command of Mysql yet when I browse the code via mysql client console, the dash stays there. Later I realize that this UTF8 thing really made that difference.

Thus using the command :
mysql_query("SET NAMES 'utf8'");
resolves that issue.