The Big Programming Thread - Page 291
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
![]()
white_horse
1019 Posts
| ||
Rannasha
Netherlands2398 Posts
On April 26 2013 02:07 white_horse wrote: Ok thanks for the information guys. Then is it better to learn HTML with php, or learn HTML with css? I've taken classes in c++/c so I'm pretty familiar with "actual" programming. Depends on what you want to do. HTML is just a language to mark different parts of content ("this bit is a paragraph", "this bit is an image", "this bit is a table", etc...). CSS is a language to assign style (colour, font, etc...) to the different HTML elements to create a good looking page. PHP is a serverside language that allows you to generate HTML pages (and other stuff) dynamically, often in combination with a database. So CSS is for looks, PHP is for (dynamic) functionality. They're not comparable and a good website uses both, | ||
Deleted User 101379
4849 Posts
On April 26 2013 02:07 white_horse wrote: Ok thanks for the information guys. Then is it better to learn HTML with php, or learn HTML with css? I've taken classes in c++/c so I'm pretty familiar with "actual" programming. Depends on what you want to learn. If you want to make pretty websites you only need HTML, CSS and probably javascript, no need to learn PHP. If you want to develop interactive websites, e.g. blogs, shops, etc., then you need to learn a server side language so you might as well start with both and combine PHP & HTML learning. HTML is quite simple as long as you don't go too deep into it, so learning it on-the-fly while writing PHP should be no problem. | ||
obesechicken13
United States10467 Posts
On April 26 2013 02:07 white_horse wrote: Ok thanks for the information guys. Then is it better to learn HTML with php, or learn HTML with css? I've taken classes in c++/c so I'm pretty familiar with "actual" programming. PHP and C look very similar to each other and it's very easy to get started with PHP. It's a major attraction. That said, you can use Ruby too if you'd prefer or some other server side language. Web development needs some server sided language. I disagree that you can't use PHP and you should use Ruby. You can if you want to. | ||
CecilSunkure
United States2829 Posts
![]() | ||
Sufficiency
Canada23833 Posts
| ||
billy5000
United States865 Posts
Can someone explain how this site works, specifically how it allows the user to listen to music while moving from page to page? I have a very limited knowledge on single page apps, let alone front-end programming--is the site a hybrid or something? | ||
WolfintheSheep
Canada14127 Posts
On April 26 2013 09:59 billy5000 wrote: http://hypem.com/ Can someone explain how this site works, specifically how it allows the user to listen to music while moving from page to page? I have a very limited knowledge on single page apps, let alone front-end programming--is the site a hybrid or something? While I can't really say the exact system from a brief skim, the obvious answer is that you're not moving from page to page. The header, player, etc. are all static and clicking on the links simply changes the content display. | ||
FreezingAssassin
United States455 Posts
I would like to be able to step through an array and while doing that, assign each number to an image. So for instance dim countCards as integer dim currentcard as string Private cardsNum as integer = {1, 2, 3, 4, ....52} private cardValue as string = {AceSpades, AceDiamond, AceHeart.....} for each x in cardsNum x = currentCard countcards += 1 next and then output as something like this currentCard(1) currentCard(2) ...currentCard(52) is this the right logic and thinking? I am a bit lost as to how to do it. I know I can go through and do a select case for every situation and that is easy. but SOO long. | ||
![]()
tofucake
Hyrule18982 Posts
| ||
FreezingAssassin
United States455 Posts
So for the first time through the loop, x = current cards, x will be 1 since it is pulling 1 from the array. It then holds this value into current card. and count cards will be counted each time the loop is processed so i can call that instance of the loop so to speak, and pull back the index. so if i wanted to display 1, I would use currentCard(0) to display 1, or if i wanted 10 i would use currentCard(9) and so on. Atleast that is what I am thinking but its not right. I was wondering what was wrong with my process. Also the variables datatypes are probably wrong, i dont think currentCard should be string. *EDIT: ![]() | ||
obesechicken13
United States10467 Posts
On April 26 2013 09:59 billy5000 wrote: http://hypem.com/ Can someone explain how this site works, specifically how it allows the user to listen to music while moving from page to page? I have a very limited knowledge on single page apps, let alone front-end programming--is the site a hybrid or something? It uses Ajax probably. Javascript that can run without a page refresh. | ||
WolfintheSheep
Canada14127 Posts
On April 26 2013 12:46 FreezingAssassin wrote: Well the for each will make x step through cardsNum, So for the first time through the loop, x = current cards, x will be 1 since it is pulling 1 from the array. It then holds this value into current card. and count cards will be counted each time the loop is processed so i can call that instance of the loop so to speak, and pull back the index. so if i wanted to display 1, I would use currentCard(0) to display 1, or if i wanted 10 i would use currentCard(9) and so on. Atleast that is what I am thinking but its not right. I was wondering what was wrong with my process. Also the variables datatypes are probably wrong, i dont think currentCard should be string. I'm having a lot of trouble understanding what it is you're trying to do, and I have very, very little experience with VB.net, but it sure sounds like you're putting in 5x the amount of effort and code required. So, instead of saying what you want your code to do, what is it that you're actually trying to accomplish with the code? | ||
FreezingAssassin
United States455 Posts
So i have a method made that randomizes numbers between 1 - 52. Whenever say 5 is chosen, 10 of diamonds will display, or 51 two of hearts and so on. I would love to hear nay easier and better ways to do it. | ||
WolfintheSheep
Canada14127 Posts
On April 26 2013 12:53 FreezingAssassin wrote: use an array to assign a numeric value to a variable, then assign that variable to a image. So i have a method made that randomizes numbers between 1 - 52. Whenever say 5 is chosen, 10 of diamonds will display, or 51 two of hearts and so on. Okay, once again, no real experience with VB.net, but wouldn't it be far simpler to do this? (Psuedo-code) Cards = {AceDiamonds, AceHearts, ...} PickCard(){ x = rand(1-52) display(Cards[x]) } | ||
FreezingAssassin
United States455 Posts
I would like to step through the array, and while i do that assign a value to that position in the array and call that exact position. | ||
WolfintheSheep
Canada14127 Posts
On April 26 2013 13:13 FreezingAssassin wrote: hmm, maybe it sounds more clear in my head. I would like to step through the array, and while i do that assign a value to that position in the array and call that exact position. Here's the thing...array's already have positions assigned. 0 is the first entry, 2 is the third, 51 is the fifty-second. So if "Cards" is your array, then "Cards[51]" calls the value stored in the fifty-second position. | ||
FreezingAssassin
United States455 Posts
| ||
WolfintheSheep
Canada14127 Posts
On April 26 2013 13:33 FreezingAssassin wrote: ok thanks a lot, I was just making it sound so much more confusing than what was. No problem. In general, it's a good idea to skim documentation and see what tools already exist for functions you want to use. | ||
tec27
United States3690 Posts
On April 26 2013 09:59 billy5000 wrote: http://hypem.com/ Can someone explain how this site works, specifically how it allows the user to listen to music while moving from page to page? I have a very limited knowledge on single page apps, let alone front-end programming--is the site a hybrid or something? They're just making AJAX requests with JS and replacing the content with the response, pretty simple. Its an older form of 'single page app' really. If you want a better example with better tech/code: http://soundcloud.com | ||
| ||