Code:aroFreq[k] = ofTemp;
Code:<?xml version="1.0" encoding="ISO-8859-1"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <channel> <title>CodeCall Programming Forum</title> <link>http://forum.codecall.net</link> <description>Community for Programmers and Developers with experts in C++, C#, Visual Basic, Java, Javascript, CGI, HTML and More!</description> <language>en</language> <lastBuildDate>Sun, 14 Dec 2008 13:49:37 GMT</lastBuildDate> <generator>vBulletin</generator> <ttl>60</ttl> <image> <url>http://forum.codecall.net/images/misc/rss.jpg</url> <title>CodeCall Programming Forum</title> <link>http://forum.codecall.net</link> </image> <item> <title>Hi..</title> <link>http://forum.codecall.net/introductions/12567-hi.html</link> <pubDate>Sun, 14 Dec 2008 11:29:31 GMT</pubDate> <description><![CDATA[Hi.. I'm new here.. I like to learn very much! ^_^.. Like this active forum even I just started in. ^_^]]></description> <content:encoded><![CDATA[<div>Hi.. I'm new here.. I like to learn very much! ^_^.. Like this active forum even I just started in. ^_^</div> ]]></content:encoded> <category domain="http://forum.codecall.net/introductions/">Introductions</category> <dc:creator>akiratoya13</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/introductions/12567-hi.html</guid> </item> <item> <title>Weird Java Problem, Cannot Implements .....</title> <link>http://forum.codecall.net/java-help/12566-weird-java-problem-cannot-implements.html</link> <pubDate>Sun, 14 Dec 2008 11:26:09 GMT</pubDate> <description><![CDATA[ Code: --------- import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; import java.util.Scanner; public class Puzzle implements ActionListener, MouseListener { JFrame frame = new JFrame("Puzzle"); JFrame reg; JFrame alertreg; JFrame regsuccess; JFrame login; JFrame opt; int defaultDif; File fFile; String loginName = new String(""); //reg component JLabel userLabel = new JLabel("Username"); JTextField userText = new JTextField(10); JLabel passLabel = new JLabel("Password"); JTextField passText = new JTextField(10); JButton submit = new JButton("Submit"); JButton reset = new JButton("Reset"); JButton cancel = new JButton("Cancel"); JButton al = new JButton("Ok"); JButton al2 = new JButton("Ok"); --------- What's wrong with my implements command? Why It gives me an error like this: D:\java\testing>javac Puzzle.java Puzzle.java:7: Puzzle is not abstract and does not override abstract method mous eExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener public class Puzzle implements ActionListener, MouseListener Anyone can help me? thank you..]]></description> <content:encoded><![CDATA[<div><div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">import java.awt.*;<br /> import javax.swing.*;<br /> import java.awt.event.*;<br /> import java.io.*;<br /> import java.util.Scanner;<br /> <br /> public class Puzzle implements ActionListener, MouseListener<br /> {<br /> JFrame frame = new JFrame("Puzzle");<br /> JFrame reg;<br /> JFrame alertreg;<br /> JFrame regsuccess;<br /> JFrame login;<br /> JFrame opt;<br /> <br /> int defaultDif;<br /> <br /> File fFile;<br /> String loginName = new String("");<br /> //reg component<br /> JLabel userLabel = new JLabel("Username");<br /> JTextField userText = new JTextField(10);<br /> <br /> JLabel passLabel = new JLabel("Password");<br /> JTextField passText = new JTextField(10);<br /> <br /> <br /> JButton submit = new JButton("Submit");<br /> JButton reset = new JButton("Reset");<br /> JButton cancel = new JButton("Cancel");<br /> <br /> JButton al = new JButton("Ok");<br /> JButton al2 = new JButton("Ok");</code><hr /> </div>What's wrong with my implements command? Why It gives me an error like this:<br /> D:\java\testing>javac Puzzle.java<br /> Puzzle.java:7: Puzzle is not abstract and does not override abstract method mous<br /> eExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener<br /> public class Puzzle implements ActionListener, MouseListener<br /> <br /> <br /> Anyone can help me? thank you..</div> ]]></content:encoded> <category domain="http://forum.codecall.net/java-help/">Java Help</category> <dc:creator>akiratoya13</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/java-help/12566-weird-java-problem-cannot-implements.html</guid> </item> <item> <title>Hello everyone!</title> <link>http://forum.codecall.net/introductions/12561-hello-everyone.html</link> <pubDate>Sun, 14 Dec 2008 01:47:52 GMT</pubDate> <description>Hello my name is Cardon Fry, I am currently learning VB6 and AS2, I found this site by google when I was looking for some help and I decided I should register because of all the tutorials and help that can come from here. ^^</description> <content:encoded><![CDATA[<div>Hello my name is Cardon Fry, I am currently learning VB6 and AS2, I found this site by google when I was looking for some help and I decided I should register because of all the tutorials and help that can come from here. ^^</div> ]]></content:encoded> <category domain="http://forum.codecall.net/introductions/">Introductions</category> <dc:creator>Cardon Fry</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/introductions/12561-hello-everyone.html</guid> </item> <item> <title>Job Universe: Computer Programmers</title> <link>http://forum.codecall.net/programming-news/12558-job-universe-computer-programmers.html</link> <pubDate>Sat, 13 Dec 2008 23:01:16 GMT</pubDate> <description>The job: Computer programmers write, test, and maintain the detailed instructions, called programs, that computers follow to perform their functions. More... (http://www.topix.net/tech/programming-languages/2008/12/job-universe-computer-programmers?fromrss=1)</description> <content:encoded><![CDATA[<div>The job: Computer programmers write, test, and maintain the detailed instructions, called programs, that computers follow to perform their functions.<br /> <br /> <br /> <br /> <a href="http://www.topix.net/tech/programming-languages/2008/12/job-universe-computer-programmers?fromrss=1" target="_blank">More...</a></div> ]]></content:encoded> <category domain="http://forum.codecall.net/programming-news/">Programming News</category> <dc:creator>Kernel</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/programming-news/12558-job-universe-computer-programmers.html</guid> </item> <item> <title>Jumping metagame</title> <link>http://forum.codecall.net/general-programming/12557-jumping-metagame.html</link> <pubDate>Sat, 13 Dec 2008 22:25:11 GMT</pubDate> <description><![CDATA[Hi everybody, I would like to proprose something like a metagame. If anyone is interested in testing himself in algorithm analysis and programming performance (and have some fun too :)) will be welcome. These are the rules of my invented game: - You will have a board of N x N squares. - Each square can have a number or can be empty. If it has a number, it will show the number of squares to jump from that square to any other (horizontal and vertical directions); if it is empty you can't jump to that square. - Everytime you jump to a square the value of the square changes to the difference between the previous square value and the actual square value (absolute value). - There will always be an initial square and a final square. There also a few obvious things, like: - The value of the final square is irrelevant, - You can't jump to a square with the same value as the one you are jumping from, because it will produce a zero-jump, - etc... I don't know if the rules of the game are clear. If you have any question, please, ask. An example: *C*| - 0 - *B*| 3 2 3 *A*| 3 - 1 -------- _| *1 2 3* Initial square: A3 Final square: C2 Here we have a 3x3 board and we need to go from the initial square to the final one. The shortest path will be this one: A3-B3, B3-B1, B1-B2, B2-C2 (4 jumps). There is also a 7 jump path: A3-B3, B3-B1, B1-A1, A1-A3, A3-B3, B3-B2, B2-C2. So here is the metagame: Whoever gets the *6x6* board where the shortest path to solve it is the highest wins (the initial and final square can be anyone in the board). Well... Actually there is nothing to win but my congratulations, and, since I haven't decided a name for this stupid game, the winner can do it. Let's say that the final date to post results is *01 January 2009 00:00 (GMT +01:00)*, just to put a limit. So, if you want to give it a try, choose your favourite programming language, and whenever you have a good board, post it here and I will validate it. That's all. Thank you for your time.]]></description> <content:encoded><![CDATA[<div>Hi everybody,<br /> <br /> I would like to proprose something like a metagame. If anyone is interested in testing himself in algorithm analysis and programming performance (and have some fun too :)) will be welcome.<br /> <br /> These are the rules of my invented game:<br /> <br /> - You will have a board of N x N squares. <br /> - Each square can have a number or can be empty. If it has a number, it will show the number of squares to jump from that square to any other (horizontal and vertical directions); if it is empty you can't jump to that square.<br /> - Everytime you jump to a square the value of the square changes to the difference between the previous square value and the actual square value (absolute value).<br /> - There will always be an initial square and a final square.<br /> <br /> There also a few obvious things, like: <br /> <br /> - The value of the final square is irrelevant,<br /> - You can't jump to a square with the same value as the one you are jumping from, because it will produce a zero-jump,<br /> - etc...<br /> <br /> I don't know if the rules of the game are clear. If you have any question, please, ask.<br /> <br /> An example: <br /> <br /> <b>C</b>| - 0 -<br /> <b>B</b>| 3 2 3<br /> <b>A</b>| 3 - 1<br /> --------<br /> _| <b>1 2 3</b><br /> <br /> Initial square: A3<br /> Final square: C2<br /> <br /> Here we have a 3x3 board and we need to go from the initial square to the final one. The shortest path will be this one: A3-B3, B3-B1, B1-B2, B2-C2 (4 jumps). There is also a 7 jump path: A3-B3, B3-B1, B1-A1, A1-A3, A3-B3, B3-B2, B2-C2.<br /> <br /> So here is the metagame:<br /> <br /> Whoever gets the <b>6x6</b> board where the shortest path to solve it is the highest wins (the initial and final square can be anyone in the board).<br /> <br /> Well... Actually there is nothing to win but my congratulations, and, since I haven't decided a name for this stupid game, the winner can do it. Let's say that the final date to post results is <b>01 January 2009 00:00 (GMT +01:00)</b>, just to put a limit.<br /> <br /> So, if you want to give it a try, choose your favourite programming language, and whenever you have a good board, post it here and I will validate it.<br /> <br /> That's all. Thank you for your time.</div> ]]></content:encoded> <category domain="http://forum.codecall.net/general-programming/">General Programming</category> <dc:creator>tachyon</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/general-programming/12557-jumping-metagame.html</guid> </item> <item> <title>height = 100% ?</title> <link>http://forum.codecall.net/html-programming/12556-height-100-a.html</link> <pubDate>Sat, 13 Dec 2008 22:02:07 GMT</pubDate> <description><![CDATA[Hey guys, I am working on a site and there is a "bar" on the left hand side consisting of 6 (now 7) cells. They are spaned by a cell that holds the main content to be displayed on the page. The original 6 cells on the left "bar" all have heights asigned to them in pixels from a css document. On the seventh and last cell on the left bar i asigned it a class in the css caled .heightsaver I made it set so that it looks like this - height:100%; The fuctionality of this cell is so that when the maincontent cell expands beond my original design the other 6 cells on the left bar stay the height I want and only the 7th cell gets taller. This did not work. I took the height attribute out of the .heightsaver class and instead tried to go old school in the html and put HTML: --------- <tr><td class="heightsaver" height=100%> --------- I also tried puting the 100% in qoutes. This did not work eaither. Any body know how I can get the cell to behave like i want it to? Thanks in advanced ~Zero]]></description> <content:encoded><![CDATA[<div>Hey guys, <br /> <br /> I am working on a site and there is a "bar" on the left hand side consisting of 6 (now 7) cells. They are spaned by a cell that holds the main content to be displayed on the page. The original 6 cells on the left "bar" all have heights asigned to them in pixels from a css document. On the seventh and last cell on the left bar i asigned it a class in the css caled .heightsaver I made it set so that it looks like this - height:100%; The fuctionality of this cell is so that when the maincontent cell expands beond my original design the other 6 cells on the left bar stay the height I want and only the 7th cell gets taller. This did not work. I took the height attribute out of the .heightsaver class and instead tried to go old school in the html and put <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">HTML Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left"><span style="color:#008080"><tr></span><span style="color:#008080"><td class=<span style="color:#0000FF">"heightsaver"</span> height=100%></span></code><hr /> </div> I also tried puting the 100% in qoutes. This did not work eaither. Any body know how I can get the cell to behave like i want it to?<br /> <br /> Thanks in advanced<br /> ~Zero</div> ]]></content:encoded> <category domain="http://forum.codecall.net/html-programming/">HTML Programming</category> <dc:creator>zeroradius</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/html-programming/12556-height-100-a.html</guid> </item> <item> <title>C++ Multi-dimensional arrays</title> <link>http://forum.codecall.net/c-tutorials/12555-multi-dimensional-arrays.html</link> <pubDate>Sat, 13 Dec 2008 20:29:14 GMT</pubDate> <description><![CDATA[Earlier,I talked about 1-dimensional arrays, arrays with one index. There is nothing that says an array has to be limited to 1 dimension. In fact, you can have an arbitrary number of dimensions in an array. 2 dimensional arrays are quite common, especially for storing things like screen coordinates or tables of data. Higher dimensions are used when you have more aspects that are required to specify a unique item (3-D coordinates, for example). An important thing to understand about arrays is this: technically, there is no such thing as a multi-dimensional array. All arrays are 1-dimensional, but some of them contain arrays, or arrays of arrays. What this means is that when you see Code: --------- int multiarray[4][2] --------- you are probably thinking of it as a grid of integers like this: Code: --------- 0 1 0 [0][0] [0][1] 1 [1][0] [1][1] 2 [2][0] [2][1] 3 [3][0] [3][1] --------- In reality, the computer cannot store a “grid”, because memory is one long line of addresses. C++ treats each row as a 2 element array, which is a single element of a 4 element array. In other words, multiarray has 4 elements. Each element is an array, which contains 2 elements. So multiarray[0] is an array of 2 elements, multiarray[1] is an array of 2 elements, etc. That also means that multiarray[0] is a pointer! The type of multiarray[0] is int*. Since multiarray is a pointer to multiarray[0], that means multiarray has type int (*)[2]!!! If you think this is getting messy, you're right. If you think there's a lot of room for errors in code based on this, you're very right. Let's add to the mess. I said that the array cannot be stored as a grid, so let's look at how it is store. multiarray has three elements, so it looks something like this: Code: --------- | whatever's in 0 || whatever's in 1 || whatever's in 2 || whatever's in 3 | multiarray[0] multiarray[1] multiarray[2] multiarray[3] --------- Since each element of multiarray is an array of five ints, that means the “whatever's in..” is five consecutive ints, like this: Code: --------- memory: |[int0] [int1]||[int0] [int1]||[int0] [int1]||[int0] [int1]| multiarray: [0] [1] [2] [3] multiarray: [0][0] [0][1] [1][0] [1][1] [2][0] [2][1] [3][0] [3][1] --------- What this means is that you have two ways to deal with multiarray: either as an array of 2 element arrays, or as a single array with 8 elements. Let's look at the two ways we can access this array with functions. Code: --------- #include <iostream> void setarray(int ma[][2],int size) { for (int i=0;i<size;i++) for (int j=0;j<2;j++) ma[i][j] = 10*i+j; } void printarray(int* ma,int dim1, int dim2) { for (int i=0;i<dim1;i++) { for (int j=0;j<dim2;j++) std::cout<<*(ma+(i*dim2+j))<<" "; std::cout<<"\n"; } } int main() { int multiarray[4][2]; setarray(multiarray,4); printarray(&multiarray[0][0],4,2); } --------- In function setarray(), the size of the subarray is hardcoded. but we can do the familiar easy call. The problem is that it is NOT flexible. On the other hand, printarray() is a lot more complicated to work with, but more flexible. Notice that that printarray simply takes the address of the first element and exploits the linear layout we've been talking about. I encourage you to step through the code and see how it produces this output: Code: --------- 0 1 10 11 20 21 30 31 --------- Needless to say, 3, 4, or higher dimensional arrays deal with either 1) increasingly less flexible function headers, or 2) increasingly nasty arithmetic. To think, some people think there's no math in programming :D!]]></description> <content:encoded><![CDATA[<div>Earlier,I talked about 1-dimensional arrays, arrays with one index. There is nothing that says an array has to be limited to 1 dimension. In fact, you can have an arbitrary number of dimensions in an array. 2 dimensional arrays are quite common, especially for storing things like screen coordinates or tables of data. Higher dimensions are used when you have more aspects that are required to specify a unique item (3-D coordinates, for example).<br /> <br /> An important thing to understand about arrays is this: technically, there is no such thing as a multi-dimensional array. All arrays are 1-dimensional, but some of them contain arrays, or arrays of arrays. What this means is that when you see <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">int multiarray[4][2]</code><hr /> </div>you are probably thinking of it as a grid of integers like this:<br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left"> 0 1<br /> 0 [0][0] [0][1]<br /> 1 [1][0] [1][1]<br /> 2 [2][0] [2][1]<br /> 3 [3][0] [3][1]</code><hr /> </div>In reality, the computer cannot store a “grid”, because memory is one long line of addresses. C++ treats each row as a 2 element array, which is a single element of a 4 element array. In other words, multiarray has 4 elements. Each element is an array, which contains 2 elements. So multiarray[0] is an array of 2 elements, multiarray[1] is an array of 2 elements, etc. That also means that multiarray[0] is a pointer! The type of multiarray[0] is int*. Since multiarray is a pointer to multiarray[0], that means multiarray has type int (*)[2]!!!<br /> <br /> If you think this is getting messy, you're right. If you think there's a lot of room for errors in code based on this, you're very right. Let's add to the mess. I said that the array cannot be stored as a grid, so let's look at how it <i>is</i> store. multiarray has three elements, so it looks something like this:<br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">| whatever's in 0 || whatever's in 1 || whatever's in 2 || whatever's in 3 |<br /> multiarray[0] multiarray[1] multiarray[2] multiarray[3]</code><hr /> </div>Since each element of multiarray is an array of five ints, that means the “whatever's in..” is five consecutive ints, like this:<br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">memory: |[int0] [int1]||[int0] [int1]||[int0] [int1]||[int0] [int1]|<br /> multiarray: [0] [1] [2] [3]<br /> multiarray: [0][0] [0][1] [1][0] [1][1] [2][0] [2][1] [3][0] [3][1]</code><hr /> </div>What this means is that you have two ways to deal with multiarray: either as an array of 2 element arrays, or as a single array with 8 elements.<br /> <br /> Let's look at the two ways we can access this array with functions.<br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include <iostream><br /> <br /> void setarray(int ma[][2],int size)<br /> {<br /> for (int i=0;i<size;i++)<br /> for (int j=0;j<2;j++)<br /> ma[i][j] = 10*i+j;<br /> }<br /> <br /> void printarray(int* ma,int dim1, int dim2)<br /> {<br /> for (int i=0;i<dim1;i++)<br /> {<br /> for (int j=0;j<dim2;j++)<br /> std::cout<<*(ma+(i*dim2+j))<<" ";<br /> std::cout<<"\n";<br /> }<br /> }<br /> <br /> int main()<br /> {<br /> int multiarray[4][2];<br /> setarray(multiarray,4);<br /> printarray(&multiarray[0][0],4,2);<br /> }</code><hr /> </div>In function setarray(), the size of the subarray is hardcoded. but we can do the familiar easy call. The problem is that it is NOT flexible. On the other hand, printarray() is a lot more complicated to work with, but more flexible. Notice that that printarray simply takes the address of the first element and exploits the linear layout we've been talking about. I encourage you to step through the code and see how it produces this output:<br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">0 1 <br /> 10 11 <br /> 20 21 <br /> 30 31</code><hr /> </div>Needless to say, 3, 4, or higher dimensional arrays deal with either 1) increasingly less flexible function headers, or 2) increasingly nasty arithmetic. To think, some people think there's no math in programming :D!</div> ]]></content:encoded> <category domain="http://forum.codecall.net/c-tutorials/">C Tutorials</category> <dc:creator>WingedPanther</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/c-tutorials/12555-multi-dimensional-arrays.html</guid> </item> <item> <title>linking rotating images</title> <link>http://forum.codecall.net/javascript-css/12554-linking-rotating-images.html</link> <pubDate>Sat, 13 Dec 2008 18:06:23 GMT</pubDate> <description><![CDATA[Hi, quick question. I tried to figure it out myself be couldn't. I have a image rotating code on my site, but i want to be able to link each image to an article (Each random image is a image interdiction for a article) He is the header code for the image rotating Code: --------- <script language="JavaScript"> <!-- // Set up the image files to be used. var theImages = new Array() // do not change this // To add more image files, continue with the // pattern below, adding to the array. Rememeber // to increment the theImages[x] index! theImages[0] = 'images/rotate/1.jpg' theImages[1] = 'images/rotate/2.jpg' theImages[2] = 'images/rotate/3.jpg' theImages[3] = 'images/rotate/4.jpg' theImages[4] = 'images/rotate/5.jpg' var j = 0 var p = theImages.length; var preBuffer = new Array() for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = theImages[i] } var whichImage = Math.round(Math.random()*(p-1)); function showImage(){ document.write('<img src="'+theImages[whichImage]+'">'); } //--> --------- And here is how i display the code in my index.html Code: --------- <p align="center"><script language="JavaScript"> <!-- showImage(); //--> </script></span --------- Any help would be great, thanks]]></description> <content:encoded><![CDATA[<div>Hi, quick question.<br /> I tried to figure it out myself be couldn't. I have a image rotating code on my site, but i want to be able to link each image to an article (Each random image is a image interdiction for a article)<br /> <br /> He is the header code for the image rotating<br /> <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left"><br /> <script language="JavaScript"><br /> <!--<br /> // Set up the image files to be used.<br /> var theImages = new Array() // do not change this<br /> // To add more image files, continue with the<br /> // pattern below, adding to the array. Rememeber<br /> // to increment the theImages[x] index!<br /> <br /> theImages[0] = 'images/rotate/1.jpg'<br /> theImages[1] = 'images/rotate/2.jpg'<br /> theImages[2] = 'images/rotate/3.jpg'<br /> theImages[3] = 'images/rotate/4.jpg'<br /> theImages[4] = 'images/rotate/5.jpg'<br /> <br /> <br /> var j = 0<br /> var p = theImages.length;<br /> <br /> var preBuffer = new Array()<br /> for (i = 0; i < p; i++){<br /> preBuffer[i] = new Image()<br /> preBuffer[i].src = theImages[i]<br /> }<br /> <br /> var whichImage = Math.round(Math.random()*(p-1));<br /> function showImage(){<br /> document.write('<img src="'+theImages[whichImage]+'">');<br /> }<br /> <br /> //--></code><hr /> </div>And here is how i display the code in my index.html<br /> <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left"><p align="center"><script language="JavaScript"><br /> <!--<br /> showImage();<br /> //--><br /> </script></span</code><hr /> </div>Any help would be great, thanks</div> ]]></content:encoded> <category domain="http://forum.codecall.net/javascript-css/">JavaScript and CSS</category> <dc:creator>dowdy</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/javascript-css/12554-linking-rotating-images.html</guid> </item> <item> <title>segmentation fault in ppm-software</title> <link>http://forum.codecall.net/c-c/12553-segmentation-fault-ppm-software.html</link> <pubDate>Sat, 13 Dec 2008 17:26:56 GMT</pubDate> <description><![CDATA[good old segmentation fault it comes with medium and big pictures but not with small ones why ? This is done in ANSI C basicly this part of code starts to load a ppm image into memory Code: --------- printf("memory allocation for %d bytes begins .. ",sizeof(PIXEL)*(imageDat->width)*(imageDat->height)); imageDat->pixeldata = malloc ( sizeof(PIXEL) * (imageDat->width) * (imageDat->height) ); if( (imageDat->pixeldata) == NULL ) { printf("failure\n"); return 4; } printf("success\n"); printf("reading image into memory .. "); status = 0; for(y=0;y<(imageDat->height);++y) { for(x=0;x<(imageDat->width);++x) { printf("x: %d, y: %d, status: %d\n",x,y,status); imageDat->ok = fread ( &imageDat->pixeldata[status++], sizeof(PIXEL), 1, fp ); if(imageDat->ok != 1) { printf("error\n"); return 5; } } } --------- and the struct definitions Code: --------- typedef struct { unsigned char R; unsigned char G; unsigned char B; } PIXEL; typedef struct { char raw_header[RH_RIVIT][RH_SARAKKEET]; char type[2]; int header_lines; int width; int height; int max; int ok; PIXEL *pixels; PIXEL **pixeldata; } IMAGE; --------- Any ideas ? the entire code can be found at : http://www.denarced.com/kuvafix/ppmfixer_20081210.c Thanks]]></description> <content:encoded><![CDATA[<div>good old segmentation fault<br /> it comes with medium and big pictures but not with small ones<br /> why ?<br /> This is done in ANSI C<br /> basicly this part of code starts to load a ppm image into memory<br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">printf("memory allocation for %d bytes begins .. ",sizeof(PIXEL)*(imageDat->width)*(imageDat->height));<br /> imageDat->pixeldata = malloc<br /> (<br /> sizeof(PIXEL) * (imageDat->width) * (imageDat->height)<br /> );<br /> if( (imageDat->pixeldata) == NULL )<br /> {<br /> printf("failure\n");<br /> return 4;<br /> }<br /> printf("success\n");<br /> printf("reading image into memory .. ");<br /> status = 0;<br /> for(y=0;y<(imageDat->height);++y)<br /> {<br /> for(x=0;x<(imageDat->width);++x)<br /> {<br /> printf("x: %d, y: %d, status: %d\n",x,y,status);<br /> imageDat->ok = fread<br /> (<br /> &imageDat->pixeldata[status++],<br /> sizeof(PIXEL),<br /> 1,<br /> fp<br /> );<br /> if(imageDat->ok != 1)<br /> {<br /> printf("error\n");<br /> return 5;<br /> }<br /> }<br /> }</code><hr /> </div>and the struct definitions<br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">typedef struct<br /> {<br /> unsigned char R;<br /> unsigned char G;<br /> unsigned char B;<br /> } PIXEL;<br /> <br /> typedef struct<br /> {<br /> char raw_header[RH_RIVIT][RH_SARAKKEET];<br /> char type[2];<br /> int header_lines;<br /> int width;<br /> int height;<br /> int max;<br /> int ok;<br /> PIXEL *pixels;<br /> PIXEL **pixeldata;<br /> } IMAGE;</code><hr /> </div>Any ideas ?<br /> <br /> the entire code can be found at : <a href="http://www.denarced.com/kuvafix/ppmfixer_20081210.c" target="_blank">http://www.denarced.com/kuvafix/ppmfixer_20081210.c</a><br /> <br /> Thanks</div> ]]></content:encoded> <category domain="http://forum.codecall.net/c-c/">C and C++</category> <dc:creator>denarced</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/c-c/12553-segmentation-fault-ppm-software.html</guid> </item> <item> <title>extended to integer</title> <link>http://forum.codecall.net/pascal-delphi/12552-extended-integer.html</link> <pubDate>Sat, 13 Dec 2008 13:32:56 GMT</pubDate> <description><![CDATA[Im trying to make a screensaver whit the option to support single and multiple images. this is the code for single images where im trying to make it fit large images to screen but no matter what of these conversion types ive used Round Rounds a floating point number to an integer Trunc The integer part of a floating point number it crashes whit - Incomplete types "Integer" and "Extended" and then im wondering if its because im yousing delphi 2009 .. maybe i should bye the 2005 if thats still possible. this is how my code looks Code: --------- form2.Image1.BringToFront; form2.Image1.Picture.LoadFromFile(edit1.Text); {Load the picture from the destination in edit1} if form9.RadioButton1.Checked = true then {If stretxh is true then} begin form2.Image1.Stretch := true; end else {if stretch isn true} begin form2.Image1.Stretch := false; if form9.RadioButton2.Checked = true then {IF resize large images = true} begin if form2.Image1.Picture.Height > screen.Height then {if the picture is bigger then screen} begin imageheightdiff := Trunc(form2.Image1.Picture.Height)- Trunc(screen.Height); imageprocent := imageheight * Trunc(form2.Image1.Picture.height) / 100 ; {here it crashes and says Integer and extended - like if it havent been convertet to int above} form2.image1.picture.height := imageprocent * 100 / Round(form2.Image1.Picture.Height); form2.image1.picture.width := imageprocent * 100 / Round(form2.Image1.Width); end end; end; --------- imageheightdiff & imageprocent is both integer variables i hope someone can give me an answer cause i simple cant understand what im doing wrong...]]></description> <content:encoded><![CDATA[<div>Im trying to make a screensaver whit the option to support single and multiple images. this is the code for single images where im trying to make it fit large images to screen but no matter what of these conversion types ive used<br /> <br /> Round Rounds a floating point number to an integer<br /> Trunc The integer part of a floating point number<br /> <br /> it crashes whit - Incomplete types "Integer" and "Extended" <br /> <br /> and then im wondering if its because im yousing delphi 2009 .. maybe i should bye the 2005 if thats still possible.<br /> <br /> this is how my code looks<br /> <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left"> form2.Image1.BringToFront; <br /> form2.Image1.Picture.LoadFromFile(edit1.Text); {Load the picture from the destination in edit1}<br /> <br /> if form9.RadioButton1.Checked = true then {If stretxh is true then}<br /> <br /> begin<br /> <br /> form2.Image1.Stretch := true;<br /> <br /> end<br /> <br /> else {if stretch isn true}<br /> <br /> begin<br /> <br /> form2.Image1.Stretch := false;<br /> <br /> if form9.RadioButton2.Checked = true then {IF resize large images = true}<br /> begin<br /> <br /> if form2.Image1.Picture.Height > screen.Height then {if the picture is bigger then screen} <br /> begin<br /> <br /> imageheightdiff := Trunc(form2.Image1.Picture.Height)- Trunc(screen.Height);<br /> imageprocent := imageheight * Trunc(form2.Image1.Picture.height) / 100 ; {here it crashes and says Integer and extended - like if it havent been convertet to int above}<br /> form2.image1.picture.height := imageprocent * 100 / Round(form2.Image1.Picture.Height);<br /> form2.image1.picture.width := imageprocent * 100 / Round(form2.Image1.Width);<br /> <br /> end<br /> <br /> end;<br /> end;</code><hr /> </div>imageheightdiff & imageprocent is both integer variables<br /> <br /> i hope someone can give me an answer cause i simple cant understand what im doing wrong...</div> ]]></content:encoded> <category domain="http://forum.codecall.net/pascal-delphi/">Pascal/Delphi</category> <dc:creator>Darkyere</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/pascal-delphi/12552-extended-integer.html</guid> </item> <item> <title>Tips On How To Effectively Use Article Marketing</title> <link>http://forum.codecall.net/marketing/12551-tips-how-effectively-use-article-marketing.html</link> <pubDate>Sat, 13 Dec 2008 12:09:44 GMT</pubDate> <description><![CDATA[Whether you are marketing a product or a service, you need to get visitors to your website. Then you realize that the likelihood of making a sale is directly related to the number of visitors to your website. What should you do? Viral marketing applies to e-books which can be too lengthy to write. Link exchanging is helpful, but link farms are to be avoided. Google doesn’t like your website for some strange reason. What is a website owner suppose to do? Article marketing. I am going to tell you all about article marketing. It's the fastest way of exposing your website to more people and getting the type of targeted traffic that really matters. Article marketing involves the submitting of an article to as many free article directory websites as possible. Search engines love free article directory websites. And best of all, you are allowed a resource box at the end of your article where you could prominently display your name as well as three links to your website. This would certainly generate some traffic to your website! The trick is in writing an article that people would love to read and to subtly market yourself, product, or a service that you offer through the article. Do consider the following article writing tips in planning your article marketing campaign: 1. Write the article well. By this, I mean that you should write the article in a proven style that has been established in article marketing. Web readers are usually more impatient. In the article keep the paragraphs short, the tone conversational, and the style friendly. Avoid using jargons in the article that average people wouldn’t recognize. But make sure that the article is grammatically sound, flows well, spelled right, and is factually correct. 2. Write the article with focus. Pinpoint a subject you want to discuss. The subject of the article should be moderately related to your product, service, or website, as the point here is to generate traffic to your website. Stick with that topic. 3. If you do not have the time to write the article, you could hire a ghostwriter to write the article for you. Fees for a 300-600 word article range from $5 to $50, but the money should not be a factor if you find a ghostwriter who is perfect for the article. Additionally, the very nature of a ghostwriting service is confidentiality, so choose one whom you could trust for the article. 4. The article should be informative. Article marketing should not be a direct sales pitch, or at the very least, a blatant one. Readers don’t like ads posing as articles. The purpose of article marketing is to provide the readers with something useful, something that they would want to read. 5. Strategically place within the article keywords that are relevant to your website as well as the subject of the article. Search engines love article directory websites, and more often than not, each page is indexed separately. Making the article keyword-rich would invite those search engine spiders like crazy! 6. Format the article resource box. What is needed is a short introduction of yourself. One or two lines is perfect. Don't go into great detail. Make it relate to your website and the article contents. Add links to different pages on your website. Most article directory websites will allow up to three links to your website. 7. Invite your readers to distribute the article by allowing them to republish the article on their website, to e-mail it to their friends, or to use it in their newsletters, provided that the article and resource box are kept intact. 8. Assemble a list of all the free article directory websites that you can find to submit to. Know the editorial requirements for each website, and if the article will suit them. Submit the article to as many article directory websites as possible. 9. Now don’t stop writing articles! Write or commission more articles and repeat the entire process. It’s still a numbers game. The more articles you have distributed, the more chances you will have of being read by a lot of people, and the more unique links back to your website you will have. 10. Practice patience. Writing articles can be difficult, but once your article is posted on multiple websites, more visitors will come. Give it time. The viral nature of article marketing will soon prove itself! So you see why article marketing is so important. It’s one of the easiest and cheapest ways to get more visitors to your website. Article marketing also improves your website rankings with the search engines by having more unique links back to your website. *Article Author*: Jenny M. *Article Source*: Depositarticles . com]]></description> <content:encoded><![CDATA[<div>Whether you are marketing a product or a service, you need to get visitors to your website. Then you realize that the likelihood of making a sale is directly related to the number of visitors to your website. What should you do? Viral marketing applies to e-books which can be too lengthy to write. Link exchanging is helpful, but link farms are to be avoided. Google doesn’t like your website for some strange reason. What is a website owner suppose to do?<br /> <br /> Article marketing. I am going to tell you all about article marketing. It's the fastest way of exposing your website to more people and getting the type of targeted traffic that really matters.<br /> <br /> Article marketing involves the submitting of an article to as many free article directory websites as possible. Search engines love free article directory websites. And best of all, you are allowed a resource box at the end of your article where you could prominently display your name as well as three links to your website. This would certainly generate some traffic to your website!<br /> <br /> The trick is in writing an article that people would love to read and to subtly market yourself, product, or a service that you offer through the article. Do consider the following article writing tips in planning your article marketing campaign:<br /> <br /> 1. Write the article well. By this, I mean that you should write the article in a proven style that has been established in article marketing. Web readers are usually more impatient. In the article keep the paragraphs short, the tone conversational, and the style friendly. Avoid using jargons in the article that average people wouldn’t recognize. But make sure that the article is grammatically sound, flows well, spelled right, and is factually correct.<br /> <br /> 2. Write the article with focus. Pinpoint a subject you want to discuss. The subject of the article should be moderately related to your product, service, or website, as the point here is to generate traffic to your website. Stick with that topic.<br /> <br /> 3. If you do not have the time to write the article, you could hire a ghostwriter to write the article for you. Fees for a 300-600 word article range from $5 to $50, but the money should not be a factor if you find a ghostwriter who is perfect for the article. Additionally, the very nature of a ghostwriting service is confidentiality, so choose one whom you could trust for the article.<br /> <br /> 4. The article should be informative. Article marketing should not be a direct sales pitch, or at the very least, a blatant one. Readers don’t like ads posing as articles. The purpose of article marketing is to provide the readers with something useful, something that they would want to read.<br /> <br /> 5. Strategically place within the article keywords that are relevant to your website as well as the subject of the article. Search engines love article directory websites, and more often than not, each page is indexed separately. Making the article keyword-rich would invite those search engine spiders like crazy!<br /> <br /> 6. Format the article resource box. What is needed is a short introduction of yourself. One or two lines is perfect. Don't go into great detail. Make it relate to your website and the article contents. Add links to different pages on your website. Most article directory websites will allow up to three links to your website.<br /> <br /> 7. Invite your readers to distribute the article by allowing them to republish the article on their website, to e-mail it to their friends, or to use it in their newsletters, provided that the article and resource box are kept intact.<br /> <br /> 8. Assemble a list of all the free article directory websites that you can find to submit to. Know the editorial requirements for each website, and if the article will suit them. Submit the article to as many article directory websites as possible.<br /> <br /> 9. Now don’t stop writing articles! Write or commission more articles and repeat the entire process. It’s still a numbers game. The more articles you have distributed, the more chances you will have of being read by a lot of people, and the more unique links back to your website you will have.<br /> <br /> 10. Practice patience. Writing articles can be difficult, but once your article is posted on multiple websites, more visitors will come. Give it time. The viral nature of article marketing will soon prove itself!<br /> <br /> So you see why article marketing is so important. It’s one of the easiest and cheapest ways to get more visitors to your website. Article marketing also improves your website rankings with the search engines by having more unique links back to your website.<br /> <br /> <b>Article Author</b>: Jenny M.<br /> <b>Article Source</b>: <font color="Blue">Depositarticles . com</font></div> ]]></content:encoded> <category domain="http://forum.codecall.net/marketing/">Marketing</category> <dc:creator>c0000w</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/marketing/12551-tips-how-effectively-use-article-marketing.html</guid> </item> <item> <title>Python X Library 0.14</title> <link>http://forum.codecall.net/programming-news/12550-python-x-library-0-14-a.html</link> <pubDate>Sat, 13 Dec 2008 10:51:04 GMT</pubDate> <description>The Python X Library is intended to be a fully functional X client library for Python programs. More... (http://www.topix.net/tech/programming-languages/2008/12/python-x-library-0-14?fromrss=1)</description> <content:encoded><![CDATA[<div>The Python X Library is intended to be a fully functional X client library for Python programs.<br /> <br /> <br /> <br /> <a href="http://www.topix.net/tech/programming-languages/2008/12/python-x-library-0-14?fromrss=1" target="_blank">More...</a></div> ]]></content:encoded> <category domain="http://forum.codecall.net/programming-news/">Programming News</category> <dc:creator>Kernel</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/programming-news/12550-python-x-library-0-14-a.html</guid> </item> <item> <title><![CDATA[php include & .htacess]]></title> <link>http://forum.codecall.net/php-forum/12548-php-include-htacess.html</link> <pubDate>Sat, 13 Dec 2008 00:40:36 GMT</pubDate> <description><![CDATA[I have a webpage which will include an html page based on the address PHP: --------- <?php if (empty($location)) { $location='index'; } switch ($location) { case "index": include ("aindex.html"); break; case "register": include ("register.html"); break; case "shoutbox": include ("shoutbox.html"); break; } ?> --------- This all works fine, but I wish to stop people from accessing the file if they type the address into the address bar. I believe that .htaccess file can prevent this from happening, but I am unsure how to do this. I think that I can only allow access by ip for instance, but I dont know the internal IP of that machines (thay are uni servers). Any help or suggestions on implementing this would be most appreciated! Thanks, Andy]]></description> <content:encoded><![CDATA[<div>I have a webpage which will include an html page based on the address<br /> <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">PHP Code:</div> <div class="alt2"> <hr /> <code style="white-space:nowrap"> <div dir="ltr" style="text-align:left;"> <!-- php buffer start --><code><span style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">if (empty(</span><span style="color: #0000BB">$location</span><span style="color: #007700">)) { </span><span style="color: #0000BB">$location</span><span style="color: #007700">=</span><span style="color: #DD0000">'index'</span><span style="color: #007700">; } <br /> switch (</span><span style="color: #0000BB">$location</span><span style="color: #007700">) { <br /> case </span><span style="color: #DD0000">"index"</span><span style="color: #007700">: include (</span><span style="color: #DD0000">"aindex.html"</span><span style="color: #007700">); break; <br /> case </span><span style="color: #DD0000">"register"</span><span style="color: #007700">: include (</span><span style="color: #DD0000">"register.html"</span><span style="color: #007700">); break; <br /> case </span><span style="color: #DD0000">"shoutbox"</span><span style="color: #007700">: include (</span><span style="color: #DD0000">"shoutbox.html"</span><span style="color: #007700">); break; <br /> } <br /></span><span style="color: #0000BB">?></span> </span> </code><!-- php buffer end --> </div> </code> <hr /> </div> </div>This all works fine, but I wish to stop people from accessing the file if they type the address into the address bar. I believe that .htaccess file can prevent this from happening, but I am unsure how to do this. I think that I can only allow access by ip for instance, but I dont know the internal IP of that machines (thay are uni servers). <br /> <br /> Any help or suggestions on implementing this would be most appreciated!<br /> <br /> Thanks,<br /> <br /> Andy</div> ]]></content:encoded> <category domain="http://forum.codecall.net/php-forum/">PHP Forum</category> <dc:creator>domestic</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/php-forum/12548-php-include-htacess.html</guid> </item> <item> <title><![CDATA[Subclasses & virtual functions]]></title> <link>http://forum.codecall.net/c-c/12547-subclasses-virtual-functions.html</link> <pubDate>Sat, 13 Dec 2008 00:36:32 GMT</pubDate> <description><![CDATA[I created a class that was a base class for two subclasses, let's say subclass1 and subclass 2. I want to create a dynamic array that can contain BOTH kinds of subclasses; so I tried creating a dynamic array of the base class. That worked, I could do things like Code: --------- base_array[0] = subclass1("your mom",28); base_array[1] = subclass2("your dad",29); --------- but trouble arises when I try calling a function included in both subclasses. My call looks something like this Code: --------- void blahblahblah() { base_array[0].subfunction(); } --------- I want it to call the subfunction based on whether or not base_array[0] is a base_class, a subclass1, or a subclass2, but it always calls the base_class::subfunction() one, which I never want used. How do I get it to work so that I can have a dynamic array with both kinds of subclasses and call the subfunction in the way described? Oh and the subfunction is virtual]]></description> <content:encoded><![CDATA[<div>I created a class that was a base class for two subclasses, let's say subclass1 and subclass 2. I want to create a dynamic array that can contain BOTH kinds of subclasses; so I tried creating a dynamic array of the base class.<br /> That worked, I could do things like<br /> <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">base_array[0] = subclass1("your mom",28);<br /> base_array[1] = subclass2("your dad",29);</code><hr /> </div>but trouble arises when I try calling a function included in both subclasses. My call looks something like this<br /> <br /> <div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px">Code:</div> <hr /><code style="margin:0px" dir="ltr" style="text-align:left">void blahblahblah()<br /> {<br /> base_array[0].subfunction();<br /> }</code><hr /> </div>I want it to call the subfunction based on whether or not base_array[0] is a base_class, a subclass1, or a subclass2, but it always calls the base_class::subfunction() one, which I never want used. How do I get it to work so that I can have a dynamic array with both kinds of subclasses and call the subfunction in the way described?<br /> <br /> Oh and the subfunction is virtual</div> ]]></content:encoded> <category domain="http://forum.codecall.net/c-c/">C and C++</category> <dc:creator>RobotGymnast</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/c-c/12547-subclasses-virtual-functions.html</guid> </item> <item> <title>If you can answer this you are a genius</title> <link>http://forum.codecall.net/c-programming/12546-if-you-can-answer-you-genius.html</link> <pubDate>Sat, 13 Dec 2008 00:01:10 GMT</pubDate> <description><![CDATA[Hi I wrote some code the other day which behaved in a very perculiar fashion. The compiler was telling me that I hadn't declared a variable, which in fact that I had declared. I am absolutely certain of this. My question is this - is it possible for some one to write some code ( perhaps using a language other than c ) that somehow corrupts the workings of the compiler and gets it to misreport any errors ( or correct statements as errors ). I do suspect some sort of foul play. I have seen this happen a number of times now. regards, Kareem]]></description> <content:encoded><![CDATA[<div>Hi<br /> <br /> <br /> I wrote some code the other day which behaved in a very perculiar fashion.<br /> <br /> The compiler was telling me that I hadn't declared a variable, which in fact that I had declared. I am absolutely certain of this. <br /> <br /> <br /> My question is this - is it possible for some one to write some code ( perhaps using a language other than c ) that somehow corrupts the workings of the compiler and gets it to misreport any errors ( or correct statements as errors ). I do suspect some sort of foul play. I have seen this happen a number of times now.<br /> <br /> regards,<br /> Kareem</div> ]]></content:encoded> <category domain="http://forum.codecall.net/c-programming/">C# Programming</category> <dc:creator>kareem100</dc:creator> <guid isPermaLink="true">http://forum.codecall.net/c-programming/12546-if-you-can-answer-you-genius.html</guid> </item> </channel> </rss>
Code:aroFreq[k] = ofTemp;
Code:http://i217.photobucket.com/albums/cc183/JeTSpice/BarElezar.jpg
Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!
Code:had max dead lift test today, stopped at 202 pounds.
Code:http://thegodfatherjannu.deviantart.com/gallery/
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks