Jump to content
xisto Community

demolaynyc

Members
  • Content Count

    325
  • Joined

  • Last visited

Everything posted by demolaynyc

  1. Ok, here's the code I tried: <?php# make an example xml document to play with$xmlstr = "<" . "?" . "xml version=\"1.0\"" . "?" . ">";$xmlstr .="<employee> <name>Matt</name> <position type=\"contract\">Web Guy</position></employee>";# load xml data ($doc becomes an instance of # the DomDocument object)$doc = xmldoc($xmlstr);# get root node "employee"$employee = $doc->root();# get employee's children ("name","position")$nodes = $employee->children();# let's play with the "position" node# so we must iterate through employee's# children in search of itwhile ($node = array_shift($nodes)){ if ($node->name == "position") { $position = $node; break; }}# get position's type attribute$type = $position->getattr("type");# get the text enclosed by the position tag# shift the first element off of position's children$text_node = array_shift($position->children());# access the content property of the text node$text = $text_node->content;# echo out the position and typeecho "position: $text<BR>";echo "type: $type";?> And this is the output I get when I load it:
  2. So, could someone please show me a script using PHP DOM because I tried that one too and still doesn't work.
  3. So I started taking a tutorial on PHP DOMXML which is said to be part of the PHP Core. However, when I tried it out in Xisto server (I used the exact script and file so I know it should work) It didn't work...Is DOM XML part of the PHP Core of Xisto because I see it in the phpinfo().Must I enable something in the php.ini file?
  4. I've taken a peek at both these programs and haven't really dove deep into either of these and so I want your opinions on both or either.I think ASP is very good and easy at manipulating XML data because of it's easy to use DOM XML. However, from the looks of it, the code is very Visual Basic like, which I look down on because of it's wordy functions trying to make things easier such as: "THEN, to," and other words that I think should be replaced with symbols such as "{ and ;"I think PHP is great for getting variables and displaying them. It's got good programming functionality. However, I find it hard to manipulate and even Parse XML data in this language.Now, I'm planning on using both these languages but how would I be able to obtain data from MySQL Database (using PHP) and obtain data from XML (using ASP) in just one single page? Is there use for include function from php? Is it possible to include an ASP page in PHP file?
  5. Hi, I'm currently looking for a header file I really need. It's a random.h header file. Is there a way that someone can send it to me? I know there is a rand() function in stdlib.h but I prefer to use the random.h one because it's being used for my school.
  6. I just found out that Microsoft has these open source projects. They are Visual C++, Web Developer, J# and a few other open-source software. I find it really interesting that Microsoft is offering these programs for free. I'm specifically interested in Visual C++, not because of its beginner friendly GUI but because it's the program we use for school.I just want to know your thoughts and opinions on this program. I haen't downloaded them yet so I'm asking you now before I may waste lots of HD space. Does anyone here use it?
  7. Yea, I agree but since I'm still learning C++, I wouldn't really know how to do it. Even if, my instructor would get a little suspicious. Hey pyost, can you put what you just said into the C++ coding because I understand better if i see the code. Thanks PS: I think this exercise is stupid I mean will it even be useful in real programming? When would be the time to put this into application, does anyone know? I'm not talking about C++ in general, it's just this exercise specifically. ---Hold up--- So is part B a separate program? I should just use the formula from part A? This exercise is really confusing. --- Alright here's the code that I came up with: /* Chapter 4 Exercise 9 by Albert Villaroman 11-20-06 */#include <iostream.h>int main() { long MaxDigits = 100000000, sum = 0, num = 10; //sum of all digitswhile (num < 9999) { while (num < 50) { int numBeforeCalc = num; cout <<"this is num: " <<num <<endl; while (MaxDigits > num) { //while loop to get how many digits num has MaxDigits /= 10; } while (MaxDigits >= 1) { long digit = num / MaxDigits; //get digit cout <<"digit: " <<digit <<endl; sum += digit*digit*digit; num = num % MaxDigits; //enter new value for numValue MaxDigits /= 10; //ex: 100 => 10 } cout <<sum <<" " <<numBeforeCalc <<endl; if (sum == numBeforeCalc) cout <<"Number that equals original number. " <<numBeforeCalc <<endl; num = numBeforeCalc; num += 1; } //end big while int q; cin >>q; return(0);}
  8. Ok I need someone to help me tackle this program. Here's the question: Exercise 9 a) Write a program that displays the sum of the cubes of the digits of any non-negative integer. Two program runs are shown below: Enter an integer: 145 Sum of digits is 10 Enter an integer: 8888 Sum of the cubes of the digits is 2048 Modify the program to determine what integers of two, three, or four digits are equal to the sum of the cubes of their digits. ----source file for part A----- /* Chapter 4 Exercise 9 by Albert Villaroman 11-20-06 */#include <iostream.h>int main() { long numValue; //user input cout <<"Enter an integer: "; cin >>numValue; long MaxDigits = 100000000; while (MaxDigits > numValue) { //while loop to get how many digits numValue has MaxDigits /= 10; } long sum = 0; //sum of all digits while (MaxDigits >=1) { long digit = numValue / MaxDigits; //get digit sum += digit*digit*digit; numValue = numValue % MaxDigits; //enter new value for numValue MaxDigits /= 10; //ex: 100 => 10 } int counter = 10; while (counter < 90000) { if (sum == numValue) { cout <<numValue; } counter++; } cout <<"Sum of the cubes of the digits is " <<sum <<endl; return(0);} What I need help with is part B. Can someone paraphrase the part B question for me because it just doesn't make sense to me. I'd appreciate a full source file of the second part if you can. Thank you.
  9. So... when are we going to be able to manage our files in Xisto?
  10. Gateway PII 433MHz ProcessorWin2k Professional OS128MB RAM4 USB 1.1 PortsBusted 3.5" Floppy disk4.5GB Hard DriveCD-ROM DriveHell yeah!
  11. I can login to my cpanel but I an't seem to modify my files, or upload. I tried via FTP but still doesn't let me, is it just me? What's wrong?Here's what it says after I try to save a file using the editor:[a fatal error or timeout occurred while processing this directive]
  12. I like the use of colors for appropriate theme. It's good layout but the thing is that this template would only be used for blogs. I don't see this being used for --like the guy above me said "serious people"-- but it's alright. It'd be a good xanga template or something to that nature. Keep up the good work.
  13. I have been having troubles with this but I found out a solution to this. The problem is to declare variables inside a function and retrieve its value from another function--but that doesn't work. Here is an example of the wrong thing to do: function firstFunc () { var aVariable = oneValue;}function getVariable () { trace (aVariable);} The trace would return (undefined) because it is undefined in that exact function. Solution: do not declare variables inside a function. If you have to, use _root.variableName instead of var variable Name Here's a sample code: function firstFunc () { _root.aVariable = oneValue;}function getVariable() { trace(_root.aVariable);} So, tell me what you think. And if there's a better alternative please do post it.
  14. Hi, i'm trying to send my xml file "xmlDoc" to a php page so I can save it. Does anyone have the code for this?
  15. wow. no experience in c++ yet you have the answer. such skill. Thanks a lot man, ill go try that out.
  16. Hey, I need help! Can someone code this problem in C++ The instructions are: An interesting problem in number theory is sometimes called the "necklace problem." This problem begins with two single-digit numbers. The next number is obtained by adding the first two numbers together and saving only the ones-digit. This process is repeated until the "necklace" closes by returning to the original two numbers. For example, if the starting numbers are 1 and 8, twelve steps are required to close the "necklace": 1 8 9 7 6 3 9 2 1 3 4 7 1 8 Here's another program: It says to... modify the program to determine what integers of two, three, or four digits are equal to the sum of the cubes of their digits Here's the code: /* Chapter 4 Exercise 9 by Albert Villaroman 11-20-06 */#include <iostream.h>int main() { long numValue; //user input cout <<"Enter an integer: "; cin >>numValue; long MaxDigits = 100000000; while (MaxDigits > numValue) { //while loop to get how many digits numValue has MaxDigits /= 10; } long sum = 0; //sum of all digits while (MaxDigits >=1) { long digit = numValue / MaxDigits; //get digit sum += digit*digit*digit; numValue = numValue % MaxDigits; //enter new value for numValue MaxDigits /= 10; //ex: 100 => 10 } cout <<"Sum of the cubes of the digits is " <<sum <<endl; return(0);}
  17. Wow... very easy looking at those sample pictures. I've used these softwares before (haven't made any models recently) and all you'll need is POSER 5+ & BRYCE 5+ If you want to make props then I recommend you get 3DS Max 6+ along with it. It's a very expensive investment but if you put all your hard work in it, it shouldn't be so bad. By the way, these are great softwares for beginners. I was a beginner myself when I started out and I already used these professional 3D Modelling programs. The only prerequisites you'll need are: time to learn, and most of all creativity and imagination of course. I've tried Maya, Cinema4D and all the other expensive programs but they're very hard to learn putting aside the fact that they are really good software. I just wouldn't recommend them to any beginner artist. So good luck with that!
  18. I agree with all of you. Even though wireless power technology sounds great and all but when you look at the flipside, there are a lot of risks to take. In my opinion, not all technology should be used. Nuclear bombs is an example because these days, one Nuke is all we need to destroy ourselves, and the whole world. This is because one bomb threat triggers another launch of a bomb, then obviously more so it's really a lose-lose situation.I think wireless power is great, but if the consequences to face are even worse then what's the point. I guess it's better to stay wired than lose your life to some disease caused by electromagnetic waves (if that is to happen)
  19. Wow, I've never thought of a wireless power but it would be really grounbreaking news. Without wires, things would really be much better. Can you link the page where you got the source from? I wanna read more about it because I don't quite understand the reasoning behind it.Wireless internet, now wireless power. wow, think of all the room you would gain if you lose all the annoying wires.
  20. My friend and I are trying to find a way to load an .as file in a similar way to loading xml. The idea is to store an actionscript inside an xml file but it doesn't seem to work. I tried making an .as file and importing it to flash document the way it imports it is that it just places all the script in the actions panel. This is a flowchart of what we want to do:[make an external file which contains ACTIONSCRIPTS] |[make a script that loads external file w/o pasting code into panel] |[call a function from external file]
  21. that's true, it is possible to run WinXp with 128 RAM I tried it but loading 2 or more programs such as Flash and Photoshop which are pretty big on RAM won't work too well. I went back to win2k but it's still the same. So I think it should be RAM that should be upgraded for you. If you think your computer is running too slow for you then it's more memory you need. I think that 1G ram should do. Can anyone tell what the difference between DDR and DDR2 and would they be compatible with motherboards that support DDR?
  22. Are you sure this is HTML? Is this supposed to be a new tag because all I know is the <embed> tag. I've never heard of a BGsound tag. Anyway, I think the best way is to use the <embed> tag. it goes like this: <embed src="yoururlname" hidden=false loop=true autoplay=true></embed> Don't forget to put in "hidden" attribute because the player won't show.
  23. I think the best place to find some good bg loops is at http://www.flashkit.com/ They got thousands of songs for flash websites over there so go check it out.
  24. I prefer Yahoo! Mail over GMail when discussing Email but when it comes to service, I prefer Google Services over anything. Google, I think, has a reliable Calendar, SpreadSheet, Word Processor, and much more including open-source API's. So, if you just want email, I recommend Yahoo! Mail. It has a very user-friendly and quick loading interface and also has a big space to store messages.But if you want other services such as Spreadsheet and all that other stuff, then go to Gmail.
  25. I don't know if this is a fact or just a rumor but it's quite interesting. I was in a web design class today when I overheard about the restrictions and cons about Vista. I know it didn't come out yet so that's why I am not sure if this is correct. One of the guys said that Microsoft is making Vista more strict than the previous versions. He said that if one was to practice copyright infridgement for music or videos and whatnot then the information would then be sent to microsoft and to the authorities and let them do what they have to do. The other guy said that microsoft will know when an OS is installed and what computer and the OS can only be installed into 2 computers max. My preferred OS is Windows because of its user-friendly programs and GUI but with the new OS that I think is coming out with these limitations, I might have to move to a different OS like MAC or just stay with XP.Can someone please verify or confirm this rumor?
×
×
  • 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.