I had the most irritating bug in PHP - or so I thought. I simply was unable to connect to the database. I spent the entire weekend recoding and simplifying until I gave up and made a simple connect statement. I kept getting the error message “Can’t connect to MySQL server on (Remote IP) (13)”.

(The “13″ is really confusing and led me down the wrong path. It is actually the result of error code 2003.)

Anyway to save you time, log into your Centos/SE Linux server and type in:

/usr/sbin/setsebool -P httpd_can_network_connect=1

This is basically a setting in SELinux that enables remote connections and is off by default. (Remind me to flay the guy who administers the network). Thanks to the OSCommerce user “ericp502″ who posted the solution.


Filed under: Work — Jawaad @ 8:56 pm
February 11, 2008

I’m a pretty decent PHP/MYSQL programmer. I’ve dealt with both for years and I have a decent understanding of the underlying advantages and disadvantages with working with them. However, in the real world, it seems like my knowledge of C++ and JAVA from college are more valuable. I’ve dealt with both JAVA and C++ on a few occasions since, but not enough for my own tastes. Now, with a job on the line that would require some understanding of C# and .NET, I’ve decided to take the plunge and give them both a try.

A friend of mine asked me to implement a program for her gas station. In short, a very simple database indexing program in which she could insert new customers and see when it is time for customers to renew their [i]shakken[/i] (something like the vehicle registry for a car). To be honest, this would take me less than a day (probably 5 to 6 hours) in PHP & MySQL (including the interface and everything), but I’m going to take my time and implement it (properly) in C# and MSSQL. I will be covering my frustrations and triumphs with the two in this space.


Filed under: PERL, Work — Jawaad @ 7:30 am
January 16, 2008

This is one of those strange things that sounds a lot easier to do than it is.

I originally handled this by exploding the character through this:

$array = preg_split('//u', $a);

This worked fine and the string was split into an array of unicode characters. The next part was converting it into a useful hexidecimal value.

$character = $array[0];
$value = hexdec(bin2hex($character));

I originally thought this was the way to do so - I was wrong, don’t do it. It turns out there is no real simple way to convert from UTF-8 to hex values. Instead, try the UTF8ToUnicode function here: http://hsivonen.iki.fi/php-utf8/

Include this function and use the author’s utf8ToUnicode function. It becomes simple then:

$value = utf8ToUnicode($character);
$value = $value[0];

I am only posting this because of the sheer amount of time it took for me to find this information. I hope it helps you out.


Filed under: Work — Jawaad @ 10:34 pm
December 11, 2007

I am hard at working improving this site. By the end of this week, a completely revamped news section will be out - hopefully upping the number of people who actually use my news site. (It will be located at ordisante.com/news.php, but it isn’t ready yet)


Filed under: Games, Work — Jawaad @ 2:12 am
November 20, 2007

So I was bored while waiting to find out about my fate (LOL) and looking at the Google Analytic stats, only to realize that there were a heck of a lot of people coming to this website. I think the least I could do was give you all something to do.

The Ordisante Arcade

Tetris is particularly fun.


Filed under: Work — Jawaad @ 12:04 pm
November 10, 2007

Well that is it I guess. Interview on Tuesday. I’m boning up on SQL Server 2005; we’ll see how it goes.

Hm, before boning up maybe I should first get something to eat v_v


Filed under: PERL, Work — Jawaad @ 9:40 am
May 16, 2007

Unfortunately, I have been stuck in a brutal losing battle against Blogger’s API. I have managed to get the authentication function working, but it stops when I try actually posting -_-

Functional Authentification Function

require_once "HTTP/Client.php";
require_once 'HTTP/Client/CookieManager.php';

$email = "blahblah";
$password = "blahblah";
$blog_id = "http://blahblah.blogspot.com/";
$source = "superman-bloggingbro-0.1";
$service = "blogger";

$login_url = "https://www.google.com/accounts/ClientLogin";
$login_params = array( "Email"=> "$email", "Passwd" => "$password", "source" => $source, "service" => $service);

$client =& new HTTP_Client();
$client->setDefaultHeader($headers2);
$client->post($login_url, $login_params);


Filed under: Work — Jawaad @ 3:19 am
March 6, 2007

Designing a website isn’t a quick or simple process. I just finished the design for Mishu’s restaurant tonight; although there are some bugs to be worked out, I think I will go with this.

Mishu's design

Found the leftside graphic in a google search and it doesn’t seem to have any legalities attached to it (thank God). Of course, this design took me quite a while to reach. Take a look at what I had to go through…
(more…)


Filed under: PERL, Work — Jawaad @ 2:02 am
February 1, 2007

First is my Nintendo DS site. Basically, a social web / meeting site that is mobile-enabled, it is the first time I’ve done an entire site on my own. Using the security experience I gained working for PCSafe, and the programming knowledge from Searching.com and a whole bunch of other people, I think I’ve put together something interesting/useful. Yeah, there is a lot of work yet to do, but who is to say?


Filed under: Work — Jawaad @ 6:26 pm
December 18, 2006

Myspace is a nasty place to program. The entire setup of the site is based on tables, probably because of how easy it would be to screw up a system based on the css float command. (Actually, it is more likely because it was done in a week, and they are stuck on legacy code now that cannot be changed).

It isn’t all that simple to make any sort of code that will produce round corners on the table. For one, it is hard to seperate different tables within tables from each other. It is easy enough to end up with a “round border” within a table that is supposed to be one colour. More unfortunate is that there are some tables whose content you simply cannot edit; this includes the “contacting” table, as well as the URL for the website. It is possible to hide these, but the complexity in doing so is annoying. Finally, setting one fixed table width is nearly impossible; you can see my own profile for proof of that.

So can we make rounded borders for Myspace Profiles? I haven’t put more than 3 or 4 hours into this (I am too busy with work that makes money), but it is possible to curve one of the borders at least. I don’t like the colours I used, but they were easy to go with. (I wanted to go wtih a light blue and white, but it reminded me too much of this site :o)

This code is free to be redistributed as long as there is a link at the top of any page / post to this blog entry. I will post notes about it slowly over the next week or two.


<style type="text/css">
body {
background-color:white;
font-family: Verdana, Arial, sans-serif;
background-repeat: repeat-y;
background-position: left;
background-image: url("http://ordisante.com/pics/myspace/helix.jpg");
}
.masthead {
width: 800px;
height: 100px;
position: absolute;
margin-left: -400px;
left: 50%;
top: 170px;
color: 99E028;
font-size:12px;
text-align: center;
background-image: url("http://ordisante.com/pics/misc/banner.jpg");
background-color:99E028;
color: red;
}
body table {margin-top:114px;}
table {direction:rtl;}
table table table {direction:ltr;}
table, tr, td {background:transparent; border:0px;}
table table table {
background-position: top right;
background-image: url("http://ordisante.com/pics/myspace/roundright.jpg");
background-repeat: no-repeat;
background-color:99E028;
border:0px;
padding-top: 5px;
}
table table table tr {border:0px;}
table table table tr td {padding-left:5px; padding-right:5px; border:0px;}
table table table table {
background-image: url("");
background-repeat: no-repeat;
background-color:99E028;
border:0px;
padding: 0px;
}
table table table table table table{
background-image: url("");
background-repeat: no-repeat;
border:0px;
padding: 0px;
}
body td table, body div table {margin-top: 0;}
td.text td.text table table table td a img {width:100px;}
td.text td.text table table table td div img {width:80px;}
td.text td.text table table td img {width:280px; max-width:280px; width:auto;}
td.text td.text table table td div img {width:80px;}
* html td.text td.text table table td img {width:260px;}
* html td.text td.text table table td a img {width:90px;}
* html td.text td.text table table td div img {width:80px;}
input {background-color:transparent !important;}
td, span, div, input, a, table td div div font, body div table tbody tr td font {font-family:Verdana !important;}
td, span, div, input, table td div div font, body div table tbody tr td font {color:FFFFFF !important;}
.nametext, .whitetext12, .lightbluetext8, .orangetext15, .blacktext12, .redtext, .redbtext, .blacktext10, .btext {color:FFFFFF !important;}
a {
color:508202 !important;
text-decoration:none !important;
text-transform:none !important;
font-weight:bold !important;
font-style:normal !important;
}
a:hover {color:black !important; text-decoration:none !important; text-transform:none !important; font-weight:bold !important; font-style:normal !important;}
img {border:0px;}
div strong {display:none;}
table table table table table {background-image:url(url to the picture); background-position:center; display:block; width:300px; height:55px;}
td.text table {background-position: top left; background-image: url("http://ordisante.com/pics/myspace/roundleft.jpg"); background-repeat: no-repeat; background-color:99E028; border:0px; padding-top: 5px; }
td.text table table {background-image: url(""); background-color:99E028; border:0px; padding-top: 5px; }
td.text table table table {background-image:none; width:25%; height:auto; display:inline;}
.td.text table table table td:hover{
background-color:grey;
}
.blacktext12{color:transparent; display:none;visibility:hidden;}
</style>

Next Page »

Powered by WordPress

Archives 
August 2008 July 2008 June 2008 May 2008 April 2008 March 2008 February 2008 January 2008 December 2007 November 2007 October 2007 July 2007 June 2007 May 2007 April 2007 March 2007 February 2007 January 2007 December 2006 November 2006 October 2006 September 2006 August 2006 July 2006 June 2006 May 2006 April 2006 March 2006 February 2006 January 2006 December 2005 November 2005 February 2005 December 2004 November 2004 October 2004 September 2004

Creative Commons License
All text and images under 1024 x 768 pixels on this site are licensed under a Creative Commons Attribution 3.0 Unported License.
I require a link back to the original page of the article/image. If the image/article is not public (IE: It is not present in an article on the blog), you may not reproduce it without permission.