Islamica Community

The Programmers, Web designers Thread

You aren't logged in. Sign in below or register today!
Reply
 
LinkBack Thread Tools
  #46 (permalink)  
Old 08-26-2008, 05:06 PM
sixpakistan's Avatar
sixpakistan
Senior Member Offline
 

Join Date: May 2004
Rating: 10 Votes / 3.00 Average
Posts: 12,757
sixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond repute
Send a message via AIM to sixpakistan
Default Re: The Programmers, Web designers Thread

Quote:
Originally Posted by sally View Post
wow, i thought i was a loyal islamican after remaining active for 6 years (going on 7)

but i think fahmed and sixpakistan should get gold medals for being such incredibly dedicated islamicans and taking precious time out of their busy days to write CODE for extra features

i dont think anyone can top such fidelity.
that was a shell script i wrote in like 5 minutes ~3.5 years ago

-rwx------ 1 root screen 811 May 26 2005 msnconv*
Reply With Quote
  #47 (permalink)  
Old 08-26-2008, 05:09 PM
sally's Avatar
sally
Moderator Khala Offline
 

Join Date: Mar 2002
Rating: 16 Votes / 3.69 Average
Posts: 22,946
sally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond reputesally has a reputation beyond repute
Default Re: The Programmers, Web designers Thread

i want a feature that allows you to set your font color preferences for the forum..so i dont hvae to keep changing mine to pink

*sigh*
__________________
.
.
You might be a big fish
In a little pond
Doesn't mean you've won
Reply With Quote
  #48 (permalink)  
Old 08-26-2008, 05:13 PM
fahmed's Avatar
fahmed
Senior Member Offline
 

Join Date: Aug 2007
Rating: Not Rated
Posts: 109
fahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond repute
Send a message via AIM to fahmed
Default Re: The Programmers, Web designers Thread

Quote:
Originally Posted by sixpakistan View Post
not working.. it's making both nicks the same color
try this..msn is little tricky as it puts the name and text in different lines...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
HTML>
<
HEAD>
<
META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<
META name="GENERATOR" content="IBM WebSphere Studio">
<
TITLE>test.html</TITLE>
<script type="text/javascript">
<!--
function convert() {
var
lines;
var TA=document.form1.ta.value;
var out="";
var color="";
var im = "";
if(document.all) { // IE
lines=TA.split("\r\n");
}
else {
//Mozilla
lines=TA.split("\n");
}
if
(lines[0].indexOf("says:") != -1){
im="msn";
} else {
im="aim";
}
alert(im);
if(im=="msn"){
var
user1=lines[0].substr(0, lines[0].indexOf("says:"));
var name="";
for(var i=0; i<lines.length; i++) {
var
txt = "";
color=
"Red";
if(lines[i].indexOf("says:") != -1){
name = lines[i].substr(0, lines[i].indexOf("says:"));
if(name==user1){
color="Blue";
}else {
color="Red";
}
out = out+"[color="+color+"]"+name+"[\/color]"+":"
} else {
txt = lines[i].substr(0, lines[i].length);
out = out+
"[b]"+txt+"[\/b]"+"\n";
}
}
}
if(im=="aim"){
for
(var i=0; i<lines.length; i++) {
if
(i%2==0){
color="Red";
}else{
color="Blue";
}
var
name = lines[i].substr(0, lines[i].indexOf(":"));
var txt = lines[i].substr(lines[i].indexOf(":")+1, lines[i].length);
out = out+
"[color="+color+"]"+name+"[\/color]"+":"+"[b]"+txt+"[\/b]"+"\n";
}
}
//alert(out);
document.form1.outputtxt.value=out;
}
//-->
</script>
</script>
</
HEAD>
<
BODY>
<
form action="#" name="form1">
<
P>Put convo here : <TEXTAREA rows="20" cols="50" name="ta"></TEXTAREA></P>
<
button type="button" onclick="return convert();">convert</button>
<
br>
<
p><textarea rows="20" cols="50" name="outputtxt"></textarea></p>
</
form>
</
BODY>
</
HTML>
__________________
www.imanhub.org
Networking Indian Muslim NGOs with donor/volunteer community worldwide.
Reply With Quote
  #49 (permalink)  
Old 08-26-2008, 05:42 PM
sixpakistan's Avatar
sixpakistan
Senior Member Offline
 

Join Date: May 2004
Rating: 10 Votes / 3.00 Average
Posts: 12,757
sixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond repute
Send a message via AIM to sixpakistan
Default Re: The Programmers, Web designers Thread

Awesome. You, sir, are a gentleman and a scholar. Now it just needs to be put up somewhere for public consumption, or be added as a feature on Islamica.
Reply With Quote
  #50 (permalink)  
Old 08-26-2008, 06:59 PM
ssalmanj's Avatar
ssalmanj
Senior Member Offline
 

Join Date: Jul 2008
Rating: 2 Votes / 5.00 Average
Posts: 252
ssalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond reputessalmanj has a reputation beyond repute
Default Re: The Programmers, Web designers Thread

I never understood what this line is for:
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

It seems to come up over and over again whenever I look at code. Can someone explain?
Reply With Quote
  #51 (permalink)  
Old 08-26-2008, 08:54 PM
Rida's Avatar
Rida
Mr.Brightside Offline
 
Join Date: Dec 2006
Rating: 8 Votes / 3.75 Average
Posts: 1,955
Rida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond repute
Send a message via MSN to Rida
Default Re: The Programmers, Web designers Thread

it has to do with the character encoding of the html page.
ISO-8859-1 is the encoding for english language.
__________________
"Sometimes in order to help He makes us cry.
Happy the eye that sheds tears for His sake.
Fortunate the heart that burns for His sake
."
- Mawlana Rumi (ra)
Reply With Quote
  #52 (permalink)  
Old 08-27-2008, 09:17 AM
fahmed's Avatar
fahmed
Senior Member Offline
 

Join Date: Aug 2007
Rating: Not Rated
Posts: 109
fahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond repute
Send a message via AIM to fahmed
Default Re: The Programmers, Web designers Thread

Quote:
Originally Posted by sally View Post
i think fahmed and sixpakistan should get gold medals for being such incredibly dedicated islamicans and taking precious time out of their busy days to write CODE for extra features
ha ha..the gold medal should goto sixpak. He wrote the logic in 8 lines which took me more than 40 lines.
__________________
www.imanhub.org
Networking Indian Muslim NGOs with donor/volunteer community worldwide.
Reply With Quote
  #53 (permalink)  
Old 08-27-2008, 09:22 AM
fahmed's Avatar
fahmed
Senior Member Offline
 

Join Date: Aug 2007
Rating: Not Rated
Posts: 109
fahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond repute
Send a message via AIM to fahmed
Default Re: The Programmers, Web designers Thread

Made one small change..

<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
HTML>
<
HEAD>
<
META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<
TITLE>Convert</TITLE>
<script type="text/javascript">
<!--
function convert() {
var
lines;
var TA=document.form1.ta.value;
var out=""; var color=""; var im = "";
if(document.all) { // IE
lines=TA.split("\r\n");
}
else {
//Mozilla
lines=TA.split("\n");
}
if
(lines[0].indexOf("says:") != -1){
im="msn";
} else {
im="aim";
}
if
(im=="msn"){
var
user1=lines[0].substr(0, lines[0].indexOf("says:"));
var name="";
for(var i=0; i<lines.length; i++) {
var
txt = "";
color=
"Red";
if(lines[i].indexOf("says:") != -1){
name = lines[i].substr(0, lines[i].indexOf("says:"));
if(name==user1){
color="Blue";
}else {
color="Red";
}
out = out+"[color="+color+"]"+name+"[\/color]"+":"
} else {
txt = lines[i].substr(0, lines[i].length);
out = out+
"[b]"+txt+"[\/b]"+"\n";
}
}
}
if(im=="aim"){
var
name="";
var user1=lines[0].substr(0, lines[0].indexOf(":"));
for(var i=0; i<lines.length; i++) {
name = lines[i].substr(0, lines[i].indexOf(":"));
var txt = lines[i].substr(lines[i].indexOf(":")+1, lines[i].length);
if(user1==name){
color="Red";
}else{
color="Blue";
}
out = out+"[color="+color+"]"+name+"[\/color]"+":"+"[b]"+txt+"[\/b]"+"\n";
}
}
document.form1.outputtxt.value=out;
}
//-->
</script>
</
HEAD>
<
BODY>
<
form action="#" name="form1">
<
P>Put convo here : <TEXTAREA rows="20" cols="50" name="ta"></TEXTAREA></P>
<
button type="button" onclick="return convert();">convert</button>
<
br>
<
p><textarea rows="20" cols="50" name="outputtxt"></textarea></p>
</
form>
</
BODY>
</
HTML>
__________________
www.imanhub.org
Networking Indian Muslim NGOs with donor/volunteer community worldwide.
Reply With Quote
  #54 (permalink)  
Old 08-27-2008, 09:28 AM
sixpakistan's Avatar
sixpakistan
Senior Member Offline
 

Join Date: May 2004
Rating: 10 Votes / 3.00 Average
Posts: 12,757
sixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond repute
Send a message via AIM to sixpakistan
Default Re: The Programmers, Web designers Thread

what was the change? alert removed?
Reply With Quote
  #55 (permalink)  
Old 08-27-2008, 09:44 AM
fahmed's Avatar
fahmed
Senior Member Offline
 

Join Date: Aug 2007
Rating: Not Rated
Posts: 109
fahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond reputefahmed has a reputation beyond repute
Send a message via AIM to fahmed
Default Re: The Programmers, Web designers Thread

Quote:
Originally Posted by sixpakistan View Post
what was the change? alert removed?
Apart from that, for AIM, I was just giving the colors alternatively. I changed that to give each user a different color.
__________________
www.imanhub.org
Networking Indian Muslim NGOs with donor/volunteer community worldwide.
Reply With Quote
  #56 (permalink)  
Old 08-27-2008, 10:09 AM
elysium's Avatar
elysium
Senior Member Offline
 

Join Date: Jun 2005
Rating: Not Rated
Posts: 200
elysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond reputeelysium has a reputation beyond repute
Default Re: The Programmers, Web designers Thread

mmm.. bash scripts make me feel all warm and fuzzy inside. although I use tcsh as regular shell preference.

i just can't explain or elaborate why. at my last job, i'd sit and write/edit bash atleast twice a week, for hours on end, into the wee hours of the night. php couldn't give me the same feeling ( although i did spend just as many hours on php a number of years back )

sed and awk are my babies.

in retrospect, that'd be fun, to name kids 'sed' and 'awk'. hah.
Reply With Quote
  #57 (permalink)  
Old 08-27-2008, 10:25 AM
sixpakistan's Avatar
sixpakistan
Senior Member Offline
 

Join Date: May 2004
Rating: 10 Votes / 3.00 Average
Posts: 12,757
sixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond reputesixpakistan has a reputation beyond repute
Send a message via AIM to sixpakistan
Default Re: The Programmers, Web designers Thread

Quote:
Originally Posted by elysium View Post
mmm.. bash scripts make me feel all warm and fuzzy inside. although I use tcsh as regular shell preference.

i just can't explain or elaborate why. at my last job, i'd sit and write/edit bash atleast twice a week, for hours on end, into the wee hours of the night. php couldn't give me the same feeling ( although i did spend just as many hours on php a number of years back )

sed and awk are my babies.

in retrospect, that'd be fun, to name kids 'sed' and 'awk'. hah.
That's just regular Bourne.. it's an old habit of mine to not get attached to any custom or platform specific tools, and to make everything as portable as possible. So I always just used /bin/sh & occasionally ksh for scripting.

I'm a bit spoiled as of the past few years when it comes to using tcsh for commandline, though.. but I still consider csh acceptable.

Partially as a result of the "don't get attached to tools you might not always have access to" mentality, I never really had any use for perl, either. I've traditionally always done everything in c or /bin/sh.

I've done a lot of app dev in c++ & a little bit of C# & Java, but I never really got into the whole OO paradigm (though it's definitely a lot nicer for team development). :dinosaur:

This convo probably belongs in another thread..
Reply With Quote
  #58 (permalink)  
Old 08-27-2008, 12:12 PM
Rida's Avatar
Rida
Mr.Brightside Offline
 
Join Date: Dec 2006
Rating: 8 Votes / 3.75 Average
Posts: 1,955
Rida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond reputeRida has a reputation beyond repute