cwarn23 387 Occupation: Genius Team Colleague Featured Poster

According to my extensive knowledge of math (below are the symbols at wikipedia) the two equations will yield two different results. The --> symbol is the same is the Assembly code "if xxxxxx then" where the xxxxxx is what is before the --> symbol. So by changing the if statement you are changing what the result will be which means there is no need to examine the rest.

http://en.wikipedia.org/wiki/List_of_mathematical_symbols

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

As I understand the tutorials section at the moment only for those who wish to have unique unpublished tutorials with no spelling errors checked by a moderator before posting which is fine and all but I have though of an idea which could get more tutorials while keeping existing implementations. Dani, what about if you setup a "Open Tutorials" category just like how there is a "Code snippets" category then the best tutorials in Open Tutorials can be published into the "Tutorials" category and a robots.txt can prevent bots from accessing the "Open Tutorials" category due to the quality of the community based tutorials. Does that sound like a good idea or what? I would publish a weekly tutorial and that adds up to 52+ a year. Please post comments on this idea here.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Provided you have a fluent understanding of php, html, css and javascript it is simple but time consuming. Provided you have a lot of time it can be done and quite easily even for a big cms if you have the experience.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Happy birthday to you
Happy birthday to you
Happy birthday dear dani
Happy birthday to you

Hip Hip
Hurray
Hip Hip
Hurray

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

At the start of the fight, C would open up with a flurry of super high speed punches. After a while though, the C program would start to bog down, because the developer used simplistic algorithms - lots of linear searches and the like.

C++ would maintain higher damage later in the fight, due to having lots of O(log(n)) performance containers. Therefore, C++ would win ;)

Using that theory c++ would be dead before it get's to use it's weapons. lol

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also if your on linux (I like ubuntu) then there is gedit. It is in many ways like the linux version of Notepad++ and usually comes pre-installed. Also if you want an equivalent for a Mac, then dual boot your mac with windows and you can get the benefits of the dark side of the force. Or alternatively you could use the mac as target practice at the fire range and buy a windows computer. But however you go about it perhaps you should use Notepad++. The ultimate text editor.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

No davy_yg it is as follows for those who can't work out my sample script.

<?php


class LongName {

	var $firstname = " ";
	var $middlename = " ";	
	var $lastname = " ";
	
	function firstname() {	
	echo "First Name :	". $this -> firstname;	
	}
	
	function middlename() {
	
	if ($middlename) {
	echo "Middle Name : ". $this -> middlename;
	} else {
	echo "Middle name, what is that? ";
	}
	
	function lastname() {
	echo "Last Name	: ". $this -> lastname;
	}
	
}

	// b)
	
	function firstname2 extends firstname() {
	
	echo "First Name: ".$param;
	
	}

	// c)

	function lastname2 extends lastname() {
	
	echo "Last Name: ".$param;
	
	}

	// d)
	
	firstname();
	middlename();
	lastname();	
?>

That should pretty much solve it. So please read next time before posting.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try replacing line 14 with the following

$db_selected = mysql_select_db("template");

Also remove the following function from your script as it may cause some problems further along.

mysql_close($con);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Please check my code again.

<xmp><?php 
$encrypted_string = "hello";
echo sha1($encrypted_string);
echo "\n";
echo bin2hex(mhash(MHASH_SHA1,$encrypted_string));
?></xmp>

The bin2hex function is used to get the sha1 hash.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I vote for C because C++ was written in C there for is limited to C's capabilities and is there by more recourse hungry than C as it another level of compilation of computer interpretation for reading the binary sequence. Things were sooo much simpler with punch cards.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Does it output any errors at all? If it does then could you please post them here.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well here is a example code of how to convert a mhash to a sha1 hash by the simple use of the bin2hex function.

<xmp><?php 
$encrypted_string = "some string";
echo sha1($encrypted_string);
echo "\n";
echo bin2hex(mhash(MHASH_SHA1,$encrypted_string));
?></xmp>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Normally in this case it means one of two things.
1) You mis-spelt the table name "kategori_berita" or
2) On older versions of Mysql you will need to change the query string to the below with the special quotes.

SELECT * FROM `kategori_berita`
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following on lines 16 to 21 as refered to my previous code

if ($middlename) {
echo "Middle Name : ". $this -> middlename;
} else {
echo "Middle name, what is that? ";
}

I just realized the brackets in that section are all messed up for all of our sample codes.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well one could argue that it makes no difference at all to the SEO however others could argue the opposite. But really it comes down to the search engine your optimizing for. For instance, google rates words at the beginning of the address such as "www" and "test" with more points than it does with other parts such as "country" and "php". So in the end when optimizing url's put the important stuff to the left side of the url and the not so important stuff to the right side of the url.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following

<?php


class LongName {

	var $firstname = " ";
	var $middlename = " ";	
	var $lastname = " ";
	
	function firstname() {	
	echo "First Name :	". $this -> firstname;	
	}
	
	function middlename() {
	
	if (middlename){	
					    {
                          echo "Middle Name :  ". $this -> middlename;
                        } else echo "Middle name, what is that? ";
					}
	}
	
	function lastname() {
	echo "Last Name	: ". $this -> lastname;
	}
	
}

	// b)
	
	function firstname2 extends firstname() {
	
	echo "First Name: ".$param;
	
	}

	// c)

	function lastname2 extends lastname() {
	
	echo "Last Name: ".$param;
	
	}

	// d)
	
	firstname();
	middlename();
	lastname();
	
	
	
	
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You may place before any html/browser output the following function.

<?php

header('Location: http://www.example.com/'); //redirects user
/*
no echo's print's or ?> before here and <?php starts at the
beginning of the file before here as shown so this may be
in an if statement to check if the user get's redirected.
*/
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The more recourse efficient method would be to use the following on line 109.

<?php echo (!isset($confirmation))?$confirmation='':$confirmation; ?><br/>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

maybe
if($_SESSION .. instead of if(Session...

Indeed and he also forgot to use upper case null (NULL) along with the strictly not equal to match only the NULL although in some server setup's this is not necessary. So the corrected code will be as follows:

<?php

session_start(); 


 // makes an array 
 $colors=array('red', 'yellow', 'blue'); 
 // adds it to our session 
 $_SESSION['color']=$colors; 
 $_SESSION['size']='small'; 
 $_SESSION['shape']='round';
 $_SESSION['diameter']='10cm';
   
 print "Done";

 function fnCheckSession(){
 
 if ($_SESSION['LoggedIn'] !==NULL)
 		echo "Session variable exist.";
	else	
 		echo "Session variable does not exist.";
 } 

fnCheckSession();


?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If the size 480x360 is a too larger ratio for the battery then I am willing to go for 315x420 which will save 5.33% battery time and decrease the screen size by approximately 1 inch. Also note that figure is a 3:4 ratio and I thought I would ask is it possible to get PDA's custom built with an OS like XP desktop edition or even latest Ubuntu 32-bit?

Also as for how to transfer files, I mentioned a USB drive where I can plug in a flash memory stick to transfer any videos made and data collected. Also as per the Infrared, I live in Australia so taxes I don't think should be a problem or at least to my knowledge. Not that I mind paying that little bit extra.

So may I ask, what companies custom build PDA's and could do these specifications for reasonable prices. Note the screen resolution is 315x420. I hate how most companies force you to email them then you need to wait a few weeks for a reply. So are there any instant forms like on dells website but for PDA devices.
Thankyou
cwarn23

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi everybody,
I have a question about purchasing a product which I do not know the name of or where to buy from. I have the following requirements for a PDA but can somebody point me to a few links of where I can buy such a device.
My requirements are as follows:
* A Infrared camera on the PDA
* A video camera at the same angle as the infrared camera so they share the same view
* 480x360 sized touch screen where fingers can press the screen in addition to a plastic pen.
* A USB port for data transfer
* 16GB harddrive
* 1GB ram
* 1.26GHz single core cpu
* 4 to 5 hour battery life when turned on.
* wifi and internet enabled
* monotone speakers
* blue tooth enabled
* SD card slot
* Most importantly - An api that can be used on a Java compiler to make Java apps. Then the compiled result would be transfered to the pda and those Java apps need to be able to be executed on the pda.

Does anybody here know where I can find such a device. My budget is from $0 to $800 but may pay more if I'm impressed with what I see.
Thank you
cwarn23

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

THANKYOU SO MUCH!!!
You have solved two problems in one reply.
One problem was I was starting to get a long list of files which you stated could be put into a .jar file and the other was that Java refused to load the main class which after implementing the .jar file it seem to fix itself. Thankyou so much as it has saved me so many troubles. :)

kvprajapati commented: I'm glad you got it working. +14
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I have the following applet which works on my localhost server but when I upload it to my online server then the Java console spits out an error saying the following:

Exception in thread "thread applet-viewer.class-1" java.lang.NoClassDefFoundError: viewer$1 (wrong name: viewer)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(Unknown Source)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at viewer.downloadthread(viewer.java:465)
	at viewer.init(viewer.java:205)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-viewer.class-2" java.lang.NoClassDefFoundError: viewer$1
	at viewer.downloadthread(viewer.java:465)
	at viewer.init(viewer.java:205)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

The strange thing is when I run it from http://localhost/myfolder it doesn't have any of these errors at all. Below is the html used for the applet as I believe it is html related.

<applet code="viewer.class" archive="l.png,r.png,btn.png,viewer$1.class" width="689" height="456"> 
        <PARAM NAME="domain" VALUE="1001d01001dc1001e81001e41001aa10016910015e1001951001cb1001d71001e01001e41001d71001cd1001d11001c81001d21001dc1001da1001e21001e31001d71001dd1001ed1001f01001e01001d41001d410019710018f1001d61001a210015f1001601001911001d21001dc10019c1001951001d51001e11001d41001cb1001cd1001c81001c91001d310019d1001901001d31001d51001cb1001d11001df1001db100194"> 
        <PARAM NAME="fileid" VALUE="3"> 
        <PARAM NAME="numfiles" VALUE="48"> 
        <PARAM NAME="paperid" VALUE="0"> 
        <PARAM NAME="appid" VALUE="1001d51001d410019c1001981001c81001d91001dd1001de1001ed1001ef1001e81001eb1001b11001691001651001a31001e11001dd1001d91001d91001da1001a010016710016b10016610015d10015e10016410016310016310016c10017010016d10016f10016d100164">

Also the Java applet is made of 2 files (archive.class & archive$1.class) plus a few pictures. I have never dealt with multiple class files before so could somebody point out how I am meant to include multiple class files in an applet properly.

Thankyou.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have worked out the solution. I managed to write a script which uses Tesseract ocr for linux to translate the images to text then an algorithm which I wrote removes most of the junk which Tesseract ocr adds in from the pictures and poor quality. Thankyou to all those who replied as I have learnt a lot.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I am in need of a python ocr script that can convert images into text and for the script to work on BOTH windows and centos. All the scripts I have found seem to not be compatible with linux/centos or require an api to another server and I do not want these images to leave my server. So can somebody here point me in the right direction.
Thankyou greatly.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Come on guy's. Surly there is something out there.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also note that when using the header(), session_start() and set_cookie() functions, you may not have any html or text output before the functions appearance. So according to the error you are receiving you have echoed something or put a white space before <?php causing the header function not to work properly.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, I have used a program called Boinc but was wondering maybe I could make my job easier by using an api to a pre designed network processor like Boinc does. The only problem with Boinc is that I can't create my own jobs or at least not easily.

I need a program just like Boinc except instead of using a dedicated server or vps to host the jobs which in boinc are written in C, I want a program that can run purely off the local area network and the jobs to be programmed in an interpreter/api like python or rugby which would be integrated into the software. In other words the program would probably specify a folder or path or maybe even open a file to import and it would then debug and process on all available computers on the local area network.

Does anybody know where I can find such a program because I have searched and searched but still nothing.

Thanks

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

flickering :

- by using todays Container (JApplet, JFrame)
- udpate GPU driver(s)
- problems with HardwareAccelerations (its hard to set for Oldiest GPU correctly)

But the cause of that was having the repaint() function inside the paint() function. As soon as I deleted that the flickering disappeared.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I feel like such an idiot right now even if my occupation is Genius. The reason why the script wasn't reading some of the event methods is because I forget to add addMouseMotionListener(this); . After adding that line into the int, apart from frequent flickering it worked like a charm. Also I had another question but solved it too just this second. So all is solved and rep points are being rewarded.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

As far as I can see the T_ECHO isn't comming from the piece of code you have posted. the error normally means there is a missing ; symbol near an echo statement.
Also if you don't want people to willing nilling to view abc.php then use the following code:

<?php session_start(); //line 1
$_SESSION['securityid']=dechex(microtime());
?><object id="vlc" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" width="500" height="400" events="True">
        <param name="AutoLoop" value="-1">
        <param name="AutoPlay" value="-1">
        <param name="ExtentWidth" value="11641">
        <param name="ExtentHeight" value="10371">
        <param name="MRL" value="<?php echo 'http://mysite.com/abc.php?id='.$id.'&sec='.$_SESSION['securityid']; ?>">
        <param name="Visible" value="0">
        <param name="Volume" value="90">
        <param name="StartTime" value="0">

		<param name="vlc2.jpg"> 
        <param name="BaseURL" value="http://www.mysite.com">
        <embed pluginspage="#" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" width="500" height="400" target="<?php echo 'http://mysite.com/abc.php?id='.$id.'&sec='.$_SESSION['securityid']; ?>" autoplay="true" loop="yes" volume="90"></embed>
      </object>

Then in abc.php place the following at the very top:

session_start();
if (!isset($_SESSION['securityid']) || !isset($_GET['sec']) || $_GET['sec']!==$_SESSION['securityid']) {
exit ('No hackers allowed. sorry :)');
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have managed to fix the images and found was due to putting code in the wrong place. However one image is refusing to create itself. It is a cropped image that should appear after overing over its coordinates. My current code is below. At the moment I am very tired as it is 10:43PM so after this post I'll go to bed and tomorrow I will have another look at my code. Any help is appreciated.

Thanks for the great advice.

import java.awt.*;
import java.applet.*;

import java.net.*;
import java.io.*;
import java.awt.image.*;
import java.awt.event.*;
import javax.swing.ImageIcon;



public class viewer extends Applet implements MouseListener, MouseMotionListener
{
 // Your image name;
     Image my_gif;
     boolean is_init = true;
     Image img_arrowl;
     Image img_arrowr;
     Image img_btn;
     Image img_btnzoomin = null;

     boolean show_zoomin = false;
 // The applet base URL
     URL base;

     int wpos = 300;
     int hpos = 450;
     int xpos = 150;
     int ypos = 0;
     int zoom = 0;
     int xzoom[] = new int[10];
     int yzoom[] = new int[10];
     int wzoom[] = new int[10];
     int hzoom[] = new int[10];

 // This object will allow you to control loading
     MediaTracker mt;
    public static BufferedImage toBufferedImage(Image image,boolean hasAlpha) {
        if (image instanceof BufferedImage) {return (BufferedImage)image;}

        // This code ensures that all the pixels in the image are loaded
        image = new ImageIcon(image).getImage();


        // Create a buffered image with a format that's compatible with the screen
        BufferedImage bimage = null;
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        try {
            // Determine the type of transparency of the …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well that is what the original from google gave me.
http://www.exampledepot.com/egs/java.net/GetImage.html
So I'm not sure what is meant to be in those catch blocks because the sample code had empty catch blocks and I'm not the greatest Java programmer.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I just uncommented the lines with throw new UnsupportedOperationException... within the methods that contain no other code but still the same problem. Also I tried doing the same with the other methods that have the same commented line but then the error "Unreachable statement" came up which I am guessing means the method exits with the unsupported exception before it reaches that line. So although I currently have the empty blocks with unsupported exception line uncommented, still no change. :(

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

hi,
I have the following code and it compiles on Netbeans with no errors or warnings but when I load the applet in a browser the browser does not display all of the pictures that I got it to draw. The only picture it draws is my_gif. I have tried using the repaint() function and I have googled around but still no solution to this problem. Can somebody spot the bug which my compiler is unable to see? It would be much appreciated as I don't have a clue where the problem might be.

Thankyou

import java.awt.*;
import java.applet.*;

import java.net.*;
import java.io.*;
import java.awt.image.*;
import java.awt.event.*;
import javax.swing.ImageIcon;



public class viewer extends Applet implements MouseListener, MouseMotionListener
{
 // Your image name;
     Image my_gif;
     boolean is_init = true;
     Image img_arrowl;
     Image img_arrowr;
     Image img_btn;
     Image img_btnzoomin = null;

     boolean show_zoomin = false;
 // The applet base URL
     URL base;

     int wpos = 300;
     int hpos = 450;
     int xpos = 150;
     int ypos = 0;
     int zoom = 0;
     int xzoom[] = new int[10];
     int yzoom[] = new int[10];
     int wzoom[] = new int[10];
     int hzoom[] = new int[10];

 // This object will allow you to control loading
     MediaTracker mt;
    public static BufferedImage toBufferedImage(Image image,boolean hasAlpha) {
        if (image instanceof BufferedImage) {return (BufferedImage)image;}

        // This code ensures that all the pixels in the image are loaded
        image = new ImageIcon(image).getImage();


        // Create a buffered image with a format that's compatible with the screen
        BufferedImage bimage = null; …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well you could encode it with base64_encode then in your java or flash applet, edit the java/flash source so that it decodes the string upon receiving. So below is the php code but I'm not sure what the java or flash code would be.

echo '<param name="MRL" value="'
echo base64_encode('http://mysite.com/header.php?id='.$id);
echo '">';
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Is this code a javascript redirect or something because I need to see what context the link is used in for relevant encoding.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Thank you for your time ,i mean to encrypt that link like before

urlencode(base64_encode

is impossible?

Well that turns the link into a way that it cannot be clicked or read. I think what you are after is the apache mod rewrite. This will allow you to have all sorts of crazy url's using a .htaccess file. But it all depends how do you want the link to be displayed as?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To hide it you could just delete that line or use css to hide it. For example:

<span style="display:none;"><?php echo 'http://mysite.com/header.php?id='.$id; ?></span>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

or this one

http://download.oracle.com/javase/tutorial/2d/images/drawimage.html

Thankyou so much. Although I had read that article a million times I seemed to have skimmed by the solution in their code. But now I have worked out the secret trick. Thanks for refering me to that link for me to reread again. The code I ended up using is the following:

public Graphics2D transform(Image img, float alpha, Graphics2D g2d,int xx, int yy) {
    BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);
    bi.getGraphics().drawImage(img, 0, 0, null);
    RasterOp rop = new RescaleOp(new float[] { 1.0f, 1.0f, 1.0f, alpha }, new float[] { 0.0f, 0.0f, 0.0f, 0.0f }, null);
    //BufferedImage fImage = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());
    //Graphics2D g2d = (Graphics2D)g;
    g2d.drawImage(bi, (BufferedImageOp) rop,xx,yy);
    return g2d;
    }



     public void paint(Graphics g)
     {   
          g.drawImage(my_gif,150,0,300,450,this);
          float alpha;
          alpha = 0.66f;
          Image img_arrowl = getImage(base,"l.png");
          Image img_arrowr = getImage(base,"r.png");

          Graphics2D g2d = transform(img_arrowl,alpha,(Graphics2D) g,269,419);
          g2d = transform(img_arrowr,alpha,g2d,300,419);
          g = (Graphics) g2d;
      }

As complicated as it looks it's actually very expandable in design having use of multiple libraries. The above code is the solution which I managed to piece together and works very well. Now for the mouse integration which I hope won't be any harder. :)
Thankyou for all your posts as this was an interesting problem to solve.

*solved*

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

So that I can delete line 3 and have something like the following:

public Raster transform(Image img, float alpha) {
    BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);
    //bi.getGraphics().drawImage(img, 0, 0, null);
    RasterOp rop = new RescaleOp(new float[] { 1.0f, 1.0f, 1.0f, alpha }, new float[] { 0.0f, 0.0f, 0.0f, 0.0f }, null);
    Raster result;
    result = rop.filter(bi.getData(), null);
    return result;
    }
public void paint(Graphics g) {
Image source = retrieve_image();
source = transform(source, 0.5);
g.drawImage(source,300,419,31,31,this)
}

Basically I am trying to get an Image then set the opacity and display it at specified coordinates with a specified size. Each image will be at different coordinates with different sizes though. So as you can see that has a syntax error where a Raster is being assigned to an Image so are there any ways around it?
Thankyou

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi,
I have managed to assemble the following but how do I convert the Raster result to an Image type?

public Raster transform(Image img, float alpha) {
    BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);
    bi.getGraphics().drawImage(img, 0, 0, null);
    RasterOp rop = new RescaleOp(new float[] { 1.0f, 1.0f, 1.0f, alpha }, new float[] { 0.0f, 0.0f, 0.0f, 0.0f }, null);
    //BufferedImage fImage = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());
    Raster result;
    result = rop.filter(bi.getData(), null);
    return result;
    }
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

<?php echo 'http://mysite.com/header.php?id='.$id; ?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi,
I have 2 images stored in the variables Image img_arrowl; Image img_arrowr; and now I need a function or method to set the opacity of these two images. So the syntax I'm after would be something like the following:

img_arrowl = set_imgopacity(img_arrowl,0.75);
img_arrowr = set_imgopacity(img_arrowr,0.75);

The only thing is how do I create the set_imgopacity() function/method. I have spent all day searching the web with no straight forward answer. And Java isn't my major of all languages so could somebody help me with creating this function.

Any help is appreciated.
Thankyou

cwarn23

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The code you have submitted contains the base64_encode() function which turns the string into an encrypted result. Then you have encoded it for url variable/$_GET[] input. So as that code stands it is very unreadable without the help of php to decode it. And that would be why a number 7 may occur on the displayed string. Also if it is after it is decoded you see the number 7 than that is what $id contains at time of encode.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well in future could you please post the error. But assuming that it's the error I think it is then you will need to do the following. First of all make sure the page starts with <?php instead of <? for compatibility reasons. Also make sure the header() function has a lower 'h'. Then most importantley of all make sure there is no html or browser output before the header function. The header function is one of the few special functions that can not be used after an echo or print statement due to the way php is designed. Hope that solves it.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Agreed.
This can simply be achieved by a header redirect. For example:

<?php //line 1
if (isset($_POST) && !empty($_POST)) {
header('Location: http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
}

Then you can use the exit function after you have processed the $_POST code.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Checking a phone number is an integer could be problematic. Some start with 0 (not a problem in itself), some may have () or '-' included. Are these deemed invalid?

Ensure that you don't store them in a DB as integers though - you'll lose the preceeding 0 if there is one.

Well the long answer short to that those numbers with () and - will be valid. So what it does is basically filter all non numeric characters then returns the resulting string as an integer when using the (int) parameter and if it's an empty string then it returns 0. If however you want to echo formatted phone numbers this would be rather different and more like the following:

function validate_phone($in) {
$in=str_split($in,1);
$chars=array('0'=>true, '1'=>true, '2'=>true, '3'=>true, '4'=>true, '5'=>true, '6'=>true, '7'=>true, '8'=>true, '9'=>true, '('=>true, ')'=>true, '-'=>true, ' '=>true);
$res='';
foreach ($in AS $chr) {
if (isset($chars[$chr])) {
$res.=$chr;
}
}
return $res;
}

function invalid_phone($in) {
$in=str_split($in,1);
$chars=array('0'=>true, '1'=>true, '2'=>true, '3'=>true, '4'=>true, '5'=>true, '6'=>true, '7'=>true, '8'=>true, '9'=>true);
$res='';
foreach ($in AS $chr) {
if (isset($chars[$chr])) {
$res.=$chr;
}
}
return empty($res);
}
$_POST['phone']='(07) 54261746';
$phone = validate_phone($_POST['phone']);
if (invalid_phone($phone)==true) {
//invalid phone number
} else {
echo $phone;
}

So if your using non formatted numbers use my first example but if however the numbers may be formatted then use the above code.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I do not believe that you will be able to find a IDE that converts php code to assembly however you would be more likely to find a converter for php to C if you look hard enough since php was written in C. The reason why I say php to assembly converters probably don't exist is because of the shear amount of work to create such an IDE. However it would be rather simple to convert php code to its original C source so I'm sure there would be at least a couple out there.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

$phone = (int)$_POST['phone'];
if ($phone==0) {
//invalid phone number
} else {
echo $phone;
}