Jump to content
xisto Community

saga

Members
  • Content Count

    235
  • Joined

  • Last visited

Everything posted by saga

  1. You need a book. Online resources are needed too to develop your skills. Sample working programs that you can study and learn are abundant online. Try reading C++ codes so that you may learn some programming techniques. One book is not enough if you are really serious about C++ programming. The most important book you need is a reference book. C++ programming has a lot of standard classes that are useful and these classes has lots of methods and properties and it would be impossible for you to memorize all of it. Thats why you need a book of reference. is a good book in understanding the nature of C++ and it can also serve as a reference book becuase in this book the author (the developer of C++ itself) discusses the standard libraries of C++. If you are into graphics you need to buy a different book for it, the same if you are into mathematical problems. There is no one book that explains all the standard libraries in details since it will consume 10,000 pages or more. THe best approach is buy a book that will teach you the basic of C++ and the basic of the concept of object oriented programming. After you have gained enough knowledge about the basic buy a reference book and some books that discusses advance C++ programming technique. From here on start creating small size programs (1000 lines) or read codes from programs found online and try to understand them. THis will help you develop your programming skills. Reading is one thing but practicing is another thing. A good free tool for C++ programming is the Bloodshed Dev-C++ IDE with compiler. This package comes with a WIN32 API library which is use in Windows GUI programming. THere is also the NetBeans IDE with compiler which is primarily for Java but you can download an expansion pack that will enable the IDE to work in C, C++. THe expansion pack comes with a C, C++ compiler. But of course you need to install the latest version of Java to run NetBeans.
  2. Ive been busy lately with some programming stuffs... well i guess the problem lies in the thumbnail becuase they are just instances of the image object that I pre-loaded then resize it. So I guess I have to make thumbnail size image for every image. As I have noticed IE is slow in generating display of images that are resized. I just dont have time right now, the whole site is not even quite done. THe guestbook and contact section is a mess yet and there is no good content. Does anyone of you know any technique to make the browser load images fast?
  3. The question is who are the people behind this campaign? What are there motives to say tha we are jus doing fine, that pollution caused by CO2 from cars and manufacturing company is no to be blame and even suggest that there is no such thing as Global Warming? a very funny thing to say... who will be unemployed? the researchers? how many of them? this is just plain attact to the group rather than the issue by that it is very suspicious.
  4. if he is not cheating he is not interested in you anymore.i know its unfairbut you have to look sexy and beautifulbut if you havent taken care of yourselfmaybe what he likes about you is gonestress is an excuseconfront him, ask him why.or maybe the two of you are not really compatibleand it took 1 year and 5 months for that to sink into each otherdo you like him or love him the way you use tois it sex that you missed the mostor the initmate affection?
  5. out of topic:what about a container in a state of vacuum but holds an anti-matter in the center?..........well... if vacuum is define as void of matter so i guess its ok for a vacuum to have anti-matter in it...
  6. saga

    Mysql Query

    $query = "insert into templates (tuid,tname,tdescription,template,archivedefault) values (1,'Sample Archive Template','A sample archive template that only shows the name of the article with a link to the default article viewer.','<a href='viewarticle1.php?aid=[id]'>[articletitle]</a>',FALSE)"; the whole code is correct for PHP but datebase will have problem parsing your query becuase of the single quotes used in the 2nd to the last value. and by the way should there be a dollar sign in id and article? like $id, $article?
  7. saga

    God

    I was once a catholic, no i am still a catholic but i am a non believer. it have to be that way or my society will persecute me. ive read the whole old testament, its a great story, there is moral to it but it is a story, nothing more. Like the parable of Jesus it gives us enlightenment, it answers our questions and cast our fears for the moment but it is not true. An illusion that we have to create so that the belief in god can be substantiated in someway. i do not distinquish the pagan gods and the one God that modern believers worship they are the same. in fact the one god comes from pagan gods. as our maturity turns into teenage we decided, no we believe that there should only be one god for god is to be absolute and if there are many of them then it would make them a lesser god so we cast aside our pagan gods and created a god of all gods jews are not the first believer of a one god they just borrowed it from an egyptian pharaoh once there was this egyption pharaoh who ordered that the worship of all the gods will stop for he believed there is only one god, the sun god. but since during that time we are at our babyhood, our understanding is too young such concept can not yet be accepted that when he died, the pharaoh next to him erased the belief in one god. do we need a god? why do we struggle. why do we protect our belief in god? are we too weak to seek protection from an almighty god? we are being murdered in many forms becuase of god. wars are fought, children are mutilated women are raped becuase of god. is it not true that one god should have united us all? but why are we divided when all of us believe in one god? is it not enough already that we used god from time to time to enslave people and capture their lands like the Spanish did and Portuguese. if god existed the world would have been striked by a lightning hundreds of years ago for we have violated the first rule an of almighty god "not to use his name in vain" but yet we continue to do so. when will we free ourselves from the shackles of slavery from our belief in god? when will we cast our fears away and accept that we are what we are, a part of nature like the trees and humming birds. weve created god to make us very special, different from nature but we are nature. we do not need god to be special. we are already special we are the only specie that have developed wisdom and that is special. we are the only specie that have the power to protect ourselves and everything around us and that is very special.
  8. saga

    God

    In our desperate moments,we hoped for a god to exist,we want god to exist,we wished for it,and finally when our fear is closing in,we created god.it gives us strength,it inspires us and keeps us moving,it gives us hope,but a false hope,for god is our creation,our consciousnes of this worldand the world around us is youngthus we have to create a godto provide us hope and answers.man as individual and as a raceis too young to comprehend everything.there will be a timein which our understanding of ourselvesand the spaces around us will growand we will no longer havethe desire for a god to existour fear will be replaced byacceptance and understandingthen like the pagansour worship of god will ceased to existand become a historyi too want a god to existto end the cruelty of this worldi am desperatei wished for iti hoped for iti want god to existbut we are the source of our despairthus we must create the answer: god
  9. if you want to create not so complicated games like arcade kind of games or applet games then try learning Flash or Java. These two are the common tools for small games like the one you will find in Teagames.com or Miniclip.com.
  10. Mac is great as what everybody says and I think its true, but when it comes to selling itself to the market and the users it is poor. To run Mac u need a different set of hardwares. Meaning you have to buy it as a package. And when it breaks no one can help you. Too few people knows how to repair it or diagnose it. With pc, I can customize the hardwares and stuffs. If only Mac runs on pc machines . Here in my cuontry Mac is a ghost. To own a Mac here for personal use is being stupid. You can not find stores that sells software for Mac, not even in the black market. Too few softwares to work with. For businesses its bad also becuase there are no good programming tools for fast system development like Visual Basic for Windows. THe only option I guess is using Java in creating programs. Mac, when it comes to entertainment, its boring, too few games. In WIndows I can even play arcade game using emulators. Play Marios Bros, Battle City and other arcade games or even gameboy games.To cut it short, Mac is for selected users (5% of all the computer user heheheh) while Windows is for everybody. And the winner would be the OS which everybody can work with easily. When I said everybody not all of us but most of us.
  11. the actual content will be inserted wherever you put the include(). include() is like inserting the content of the file. Take note that both include() and require() functions treats the inserted text from a file as HTML text. Meaning if you want the include() and require() function to insert the text as PHP codes you have to enclose it with the PHP tag <?PHP ?>.
  12. Ok i totally changed the whole design. This its more simple but more dynamic specially in the menu. So? saga.trap17.com
  13. I think it is, but I havent tried connecting to an online MySQL server. Theoritically you can connect to an online MySQL server like the way we connect a local machine. When we connect to the local machine MySQL server we used 'localhost' instead of the IP address. mysql_connect('localhost','user','password'); maybe i will try tomorrow running the php script here in my computer and connect to the online MySQL server of Xisto.com. Lets just say what happened.
  14. We dont need to fear robots. What we should fear is the men who created these said robots. What are there purpose and intentions. Is it for good or for thier own greed. Robots are just tools, as a rule we should not blame the tools for destruction but the men who used and created these tools.But I believed there will be a day that we will have to fear robots. WHen the level of AI of robots is so high that they develop self awareness then this maybe the time we will somehow fear robots. But for now fear not since robots just perform task base on conditions which is encoded and programed by man. Whatever robots do they are always bound to the commands and conditions its programmer supplied. Humans have created giant robots but they are far from the intelligent of an ant. Independent and aware of itself. An ant will bite with free will while a robot cant.
  15. There is no need to update religion. It will go extinct. Like the pagans it will be just a part of human history. Religion is an idealistic idea, subjected not objective. As our understanding of ourselves grows and matures we will set aside the idealistic way of thinking that religion offers us. To update religion this only means that religion itself will have to embrace the materialistic way of thinking and set aside the idealistic path. It means that we have to rewrite the book of Genesis and a lot of idealist way of thinking will change. And this is difficult for religion. Religion basically is base on idealistic nature. Some religion might be able to do that with ease specially those religion who focuses on spiritualism. But those like the Roman Catholic, I dont think so. But time is changing and they are being left behind. Religion being passive it will have a time that it will cease to exist. But of course not in our lifetime, maybe we will give it 1 thousand years. It maybe hard to accept today since we are groomed and raised as believers. But havent you noticed that the devoted believers are decreasing. Karl Marx was right when he said that religion is an opium in our society. It slows and hinders the progress of our society. The people behind religion doesnt want us to change and progress since they will be left behind and might be out of bread.
  16. Recently I made my website with the same approach. One php page that will display different content depending on what the viewers want. As I was on the process on developing it I found out that the php page will become cumbersome as the content it will display will increase. In your case, when the steps reaches step20 or more. So instead of using switch() statement and encode all the information needed to display in one php page with respect to each steps (steps 1 to 20 for example) in your case you could use one instruction that will do it all: require("file"); the above function basically will insert the content of "file" as HTML. To understand how it works we will create an example. First let say that we have a file named one which is save in the same folder with your page.php one <h3>This is Step 1</h3><?PHP print "\nPHP things to do in step 1";?> above is the content of the file one. As you notice we use the <?PHP ?> php tag. Whatever text file require() will insert it consider it as an HTML texts not PHP thus it is neccessary to use the PHP tag when adding php code. page.php <html><head></head><body> <?PHP if(isset($_GET['step'])) require($_GET['step']); ?></body></html> above is the page.php file. As you can see its pretty neat but it works fine and better than the swtich() statement. Heres how it works: For example we use the page.php as page.php?page=one. So what happened is the variable $_GET['step'] contains the string "one" which is basically the name of our file for the first step. In that case when we code require($_GET['step'); its just the same as require("one"); which will insert whatever content the file one. But be sure that one file is the same directory with the page.php file. But if it is not or if you want to use extensions like one.txt or one.inc use this technique: assuming that we have a file one.inc which is saved in the folder myfolder/steps page.php <html><head></head><body> <?PHP $location = 'myfolder/steps/'; $extension = '.inc'; //I like to use inc as extension coz it could mean include file if(isset($_GET['step'])){ $file = $location . $_GET['step'] . $extension; require($file); } ?></body></html> The final HTML code output of your page.php if we use it like this page.php?page=one is <html><head></head><body><h3>This is step 1</h3>PHP things to do in step 1</body></html> Basically becuase of the require() function whatever the content of one.inc it is inserted in the area where we called the funtionc require(). With this technique you can have as many steps you want to take. You just have to create the files two.inc, three.inc ... twenty.inc. The best thing about this is each steps instructions and data are saved in individual file which means mentaining and debugging is easy and not cumbersome. As you can see there are few codes in the page.php as opposed to swtich() statement in which you will crease a list of case value:.
  17. I like dark and vivid colors. But there is just one problem, well its just me, Im having a hard time reading the text (links) becuase of the text color. I mean I have to focused first on the texts before I can read it. But overall I love it.
  18. I got bored and lazy working on the things that I should do... so I end up creating this tree menu for anyone to use if they find it interesting. Well the idea is to create a tree menu in a webage. Instead of those linear menu it would be better to add more dynamic to your webpage with a tree menu. Others use image rollovers. As expecte the tree menu should behave like the one in Windows Explorer. When you click a node depending on its state it will pull down or pull up its chlid nodes. I have achieved by exploiting one style sheet property, display. Basically this style sheet property has 3 values: inline, block , list-item and none. We are more interested in the value block and none. The block value displays the content in block form as opposed to inline in which it will display elements in one line. The none value hides the elements but it is not the same witht he visibility: hidden which hides the element but still takes up space in your page. The javascript part There are 2 functions for this tree menu to work. The first function is the initNodes() which is used in <body onload="initNodes()". What this function do is to set the all the nodes display to none except the root node so that when the page load only the root node is shown and all the child nodes are hidden. The second function clickNode(id) is responsible in hiding or showing the child node of the node that is being clicked. It takes one function parameter which is the element id of its child node. It uses the chlid node id to set the display to block or none depending on the current state. If the child node current display is none then it will change it to block and vice versa. <head> <script type="text/javascript"> <!-- function initNodes(){ var uls = document.getElementsByTagName("ul"); var i; for(i = 0; i < uls.length; i++) if(uls[i].id != "root") uls[i].style.display = "none"; } function clickNode(id){ var node = document.getElementById(id); if(node.style.display == "none") node.style.display = "block"; else node.style.display = "none"; return false; } --> </script> </head> The HTML Code I used <ul></ul> (unordered list) tag becuase you dont need to indent it. If you want more styles you could use <div></div> container tag and you will have to indent it yourself depending on the level of the nodes. But I suggest you use the <ul></ul>, just apply some styles on it to fit your desired look like putting some icons which will change when the its child node of a node is hidden or not. This can be achieved by putting an image just before the nodes name and using the javascript rollover technique to change the image source. Like in windows explorer when you click a node the image changes from a normal folder to an open folder or vice versa. But for the simplicty of this discussion I did not include it. I might loss interest and not be able to finnish this one. <body onload="initNodes()"> Example of a tree menu <ul id="root"> <li><a href="" onclick="return clickNode('r1n1')">Root 1</a> <ul id="r1n1"> <li>Node 1 </li> <li>Node 2 </li> <li>Node 3 </li> </ul> </li> <li><a href="" onclick="return clickNode('r2n1')">Root 2</a> <ul id="r2n1"> <li><a href="" onclick="return clickNode('r2n1n1')">Node 1</a> <ul id="r2n1n1"> <li>Node 1 </li> <li>Node 2 </li> <li>Node 3 </li> <li>Node 4 </li> <li>Node 5 </li> <li>Node 6 </li> <li>Node 7 </li> <li>Node 8 </li> <li>Node 9 </li> </ul> </li> <li>Node 2 </li> <li>Node 3 </li> <li><a href="" onclick="return clickNode('r2n4n1')">Node 4</a> <ul id="r2n4n1"> <li>Node 1 </li> <li>Node 2 </li> <li><a href="" onclick="return clickNode('r2n4n1n3')">Node 3</a> <ul id="r2n4n1n3"> <li>Node 1 </li> <li>Node 2 </li> <li>Node 3 </li> <li>Node 4 </li> </ul> </li> </ul> </li> <li>Node 5 </li> </ul> </li> </ul> using style sheet and javascript. </body>Maybe next time I will add the icons on each node which will show the state of the nodes. But for now that will be all coz Im getting bored again.
  19. Well... the art work is not really mine... im poor when it comes to visual art... i got it from some of my old collection of wallpaper and edit it a little bit. Anyway.. thanx for ur comments and suggestion... i will test it and see if i like it.. I guess i have to create a new button
  20. I believe its fake. For obvious reason, during the cold war they dont want to get behind with the socialist Russia becuase if they do then a lot of countries might consider joining the socialist block. And US as an capitalist country that would be a tragedy. So they faked the moon landing to look good on the world and to send a message that they are much more advance because they follow the capitalist way. Ever wonder why Russia didnt dare to follow? One good reason is its hard back then. Hell its impossible back then with the limited technology. Ive seen once in natinal geographic or was it discovry channel that they discussed this matter. Thier argument about the moon landing (all of the moon landing is pretty strong). If I remember it correctly here are some of it. Lighting, There were many instances where in the pictures of moon landing or any picture which it shows that an astraunot (how do u spell it?) is on the moon there were many light references. Some NASA picture shows a rock on the ground on the moon casted two shadows when in fact there should be only one source of light the earth. THere is no street lamp in the moon. the pictures - some pictures shows an astronot with its back on the earth (source of light) but its visor shows a perfect reflection of a fellow astronot. In photography that shouldnt be the case since you are againts the source of light. This picture in NASAs website tells it all. As you can see the astronot is climbing down the ladder and you may notice that the shadow casted is to the left which suggest that this astronot is should be very dim or almost black if taken a picture since he is in the shadow of the space craft. And the most unbeliavble thing about the picture is you can see the details of some hidden corners of the space craft when there should be no light. Even with a camera with a flash this should not be as clear as it is shown. Its a few feet away from whoever took the picture. But in this picture you can see the details of the suit of this guy. It really is not surprising that US Government would lie. Remember Iraq?
  21. Ok here is the whole HTML and Javascript code for a calculator with a validation... its the same code from the one I posted before but I added one function.. isNumber(str) .. which is used to validate the entered string. <html><head> <script type="text/javascript"> <!-- function isNumber(str){ var index; var charCode; var numDash; var numPeriod; var numNumeric; numDash = 0; numPeriod = 0; numNumeric = 0; for(index = 0; index < str.length; index++){ charCode = str.charCodeAt(index); if(charCode >= 48 && charCode <= 57){ numNumeric++; } else if(charCode == 45){ numDash++; if(numDash > 1) return false; if(index != 0) return false; } else if(charCode == 46){ numPeriod++; if(numPeriod > 1) return false; } else return false; } if(numNumeric == 0) return false; return true; } function process(task){ var f1 = document.getElementById("field1"); var f2 = document.getElementById("field2"); var ans = document.getElementById("field3"); ans.value = ""; if(!isNumber(f1.value) || !isNumber(f2.value)) alert("Invalid field entry!"); else{ if(task == "multiply") ans.value = f1.value * f2.value; if(task == "divide") ans.value = f1.value / f2.value; if(task == "reset"){ ans.value = ""; f1.value = ""; f2.value = ""; } } } --> </script></head><body><br />Field 1<input type="text" id="field1" /><br />Field 2<input type="text" id="field2" /><br />Field 3<input type="text" id="field3" /><br /><input type="button" value="Multiply" onclick="process('multiply')" /><input type="button" value="Divide" onclick="process('divide')" /><input type="button" value="Reset" onclick="process('reset')" /></body></html> Explaination on the validator: First and foremost, the ASCII code for the characters 0 to 9 is 48 to 57, the period * is 46 and the dash (minus sign) is 45. I used the character code in my condition instead of the actual characters becuase its much more easy and straight forward. the variables var numDash; var numPeriod; var numNumeric; are used to count how manu dashes, periods and numeric characted in the string. This is useful since the string migt contain more than 1 dash (negative sign) or more than 1 period (floating point) which must not be the case. There is also a need to count the number of numeric characters since the string might contain only a dash (- ) or a period (-). The numNumeric variable is used to check that there must be at least one numeric character in the string. the process of validating the string begins in the for..loop. The loop scans the whole string one character at a time. Every character is checked. If the character is numeric then the numNumeric variable is incremented by one. if the character is a minus sign (-) then numDash variable is increment by one if numDash is greater than 1 which means there is more than 1 dash in the string then the function exit and return value of false signifying that the given string is not a valid number if the position of the minus (-) is not in the begining of the string ( at index 0) then the function exit and return a value of false since the minus sign must of course be in the begining if the character is a period (. ) then numPeriod varible is inrecmented by one if numPeriod is greater than 1 meaning more than one decimal piont which is not allowed in a number then the function exit and return the value of false signifying that the given string is not a valid number if the 3 condition above is not executed then it only means that the character is not a valid character then the function exit and return the value of false signifying that the given string is not a valid number after the loop finnishes from running the numNumeric is then check if it is greater than 0 becuase if it is not then the function exit and return the value of false signifying that the given string is not a valid number If the condition above evaluated that a character is not valid then the last code return true; which means that the string is a valid number will not be exucted Sorry for the long discussion, its a good way to practice my english
  22. The 72 hours is more like an inmate in death row. THe question is what is the critiria for a dangerous program or application? It would have been better if the user can choose or can specify the criteria for a program to be dangerous.But what the heck why kill in 72 hours? If its design for monopoly and profit its a great idea. I mean, so that your newly developed application will not belong to the 72 hour death row you should have to call Microsoft and pay them to add you in thier friendly application list and the next online update you are application is off from the death row.
  23. <html><head> <script type="text/javascript"> <!-- function process(task){ var f1 = document.getElementById("field1"); var f2 = document.getElementById("field2"); var ans = document.getElementById("field3"); if(task == "multiply") ans.value = f1.value * f2.value; if(task == "divide") ans.value = f1.value / f2.value; if(task == "reset"){ ans.value = ""; f1.value = ""; f2.value = ""; } } --> </script></head><body><br />Field 1<input type="text" id="field1" /><br />Field 2<input type="text" id="field2" /><br />Field 3<input type="text" id="field3" /><br /><input type="button" value="Multiply" onclick="process('multiply')" /><input type="button" value="Divide" onclick="process('divide')" /><input type="button" value="Reset" onclick="process('reset')" /></body></html> I hope that this one will work for you.... that is if i get you correctly.. this kind of calculator will have errors on it.. like what happened if the user will input letters instead of numbers.. you can have a validator that will check if the given field is correct or not.. but the best way is to make 0 - 9 buttons that the user will click... the idea is a calculator like the calculator provided by microsoft...
  24. I need critic for my website.. its actualy my portfolio or something.... its only a week old so its no big deal if i have to do some major changes... here is the address Saga - Portfolio
  25. You can not use or it will return an error if you try to use a form element or any object that belongs to the body section of an html until it is instantiated unless you load the code on the opening <body> tag using the onload="" event.So if you want to set the value of the checkbox do so by using the event onload="" in the <body> tag.By the way the attribute name="" is not supported by XHTML 1.0
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.