Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Fmdpa

  1. Fmdpa

    The right editor

    Every code editor I've used does this.
  2. Check out this page. You are specifying how many columns should be displayed. Pixel values are only used for properties that specify the size of something.
  3. Basically the only way you can become a successful programmer is if you are highly motivated. Most of the time, that motivation is a love for programming. The attraction to something so methodical and precise is not common among women. Now that you mention it, I actually can't think of one female advanced programmer... Women, however, are much more common in the web design field because it is more creative and artistic.
  4. Fmdpa


    This is a useful post from which I got most of my SEO knowledge: http://net.tutsplus.com/tutorials/other/se...timization-101/
  5. If this is the folder structure: root +images -picture.pngmyfile.html Then do this:images/picture.pngBut if this is your folder structure: root +images -picture.png +html -myfile.html Then you can include the image like this:../images/picture.png".." selects the parent directory.
  6. Fmdpa

    canvas element

    You could subtract the coordinates of the canvas element from the event.pageX & event.pageY properties. canvas.style.left and canvas.style.top won't work, however, if the element is being pushed around by previous elements.
  7. Yes, please let us see your code so we can help.
  8. Ruby on Rails (RoR) is a revolutionary web programming language. Once I started to read about it, it became quite obvious why. The goal of Ruby is to make the code closer to spoken language and less of curly braces and semi colons. The Rails framework extends Ruby to expedite the task of building web applications. Unfortunately, installation is what discourages some people from learning a language. I had my own problems installing it since most of the resources I found were either written from Mac perspective or old Ruby versions. Now I'll share with you how I installed a Ruby on Rails development environment on my Windows computer.Definition ListHere are some definitions that you will help you to better understand terms used within these instructions. Ruby - The base computer programming language from which the Rails framework is built. Rails - The most widely used Ruby framework used for web development. Gems - Ruby addons; like libraries in other languages. Bundle Installation PackageIf you don't want to mess with installing the components individually, then you can just install the Rails Installer package. However, I'd recommend that you still read this post so that you can become familiar with Rake, Gems, etc.InstallationNOTE: I used Ruby Installer in this example. It comes with Ruby and Gems packaged together. Through Gems, you can easily install Rails. The alternative is to individually install Ruby and Gems, which is much harder.The first step is to download the package from RubyInstaller.org (also download the newest devkit, which is shown lower on the page). I chose the version at the top of the list (Ruby 1.9.2, at the time of this writing). Run the installer. Make sure to select both checkboxes (regarding the file extension and executables). Finish the installation. Ruby is now installed in your hard drive's root directory. Now, open the self-extracting devkit package. Extract into a convenient location. I chose the hard-drive's root directory, so it is shown beside the "Ruby192" folder. The Ruby Devkit makes gems build on Windows. Without it, Windows gems installation is a pain. To install Devkit, open up the folder and locate the file, "dk.rb". It should open up the command line briefly, and then shut down again. Now open of the Windows Command Prompt. If you can't find it, open "Run", type "cmd", and hit ENTER. To ensure Gems is installed, type gem -v, which should display the current version of gems. If it runs successfully, enter this code into the command line: gem install rails Hit enter, and wait. The blinker will move to the next line, and it may be a little while before anything happens. It is downloading and installing certain files, about 2MB. Depending on your computer's speed and the speed of your Internet connection, you should see a long list of "Installing ...." statements. Make sure you are connected to the Internet during this installation process. Your First Rails AppNow you are ready to create a Rails web application. Open Command Prompt (if it isn't already). The command syntax to create a new Rails project is "rails new {appName}". A sample command to create a project named "weblog" in the Ruby192 root directory would be this: rails new "C:/Ruby192/weblog" If this was successful, you would see a list of "create...". Note that if you had just executed the command "rails new weblog", it also would have worked, BUT it would have created it in the directory the command line is in (the path listed before the "greater than" symbol on the console). If you wish the change the directory in which the command line is working, you can simply execute "cd directory name". Let's now navigate to the directory in which we created our app. In my case, that would be cd "C:/Ruby192/weblog". If you were in the Ruby192 directory, you could execute "cd weblog", since it is an immediate child folder. Now that we are in the app's root directory, we can start the Rails server: rails server After you enter the rails server command, you should see a couple lines appear such as "Booting WEBrick". After it is fully started, you can navigate to "http://localhost:3000", and if all went well, you should see the Rails welcome page!Running Multiple WEBrick Servers at OnceIf you are creating multiple Rails projects simultaneously, then you will probably want to run more than one server at a time. If you try to boot a second server with the "rails server" command, it will respond with an error. The error occurs because you cannot have multiple servers running on the same port (usually 3000, or maybe 8808). To get around this complication, simply specify on which port you want to run the server like this: rails server --port=port_number You can then access your application at http://localhost:port_number.Creating DatabasesAlthough there's much more I could talk about, for now I'll just mention how to create the database for your rails app. To see what databases will be created, open the folder containing your rails app, open the folder "config", then open the file "database.yml". You can open it in your favorite code editor (see my signature for my favorite programs). This is a listing of the databases to create, and their specs. Rails encourages the use of three different environments for your application. Each environment has its own database. They are listed in database.yml: # SQLite version 3.x# gem install sqlite3development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000# Warning: The database defined as "test" will be erased and# re-generated from your development database when you run "rake".# Do not set this db to the same as development or production.test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000 I'll go back to the command line now, and make sure I'm in the root directory of my app, in my case, cd "C:/Ruby192/weblog".Now we'll use a gem that was installed called "rake". You can see a listing of all valid commands by executing "rake -T". We are going to use the rake tool to create our database, as specified in "database.yml". rake db:create If the command is run successfully, it will respond with something like, "(in path)"Installation Complete!Now you're ready to getting rolling with Ruby on Rails. Buckle up and enjoy the ride!Here are some useful resources for learning Ruby on Rails: Getting started with Ruby on Rails Ruby for Newbies ASCIIcasts Railscasts
  9. Firstly, .click() is not a Javascript function. Also, setTimeout() is not the place for an expression. It is only supposed be a function call. These are valid setTimeout() function calls:setTimeout("myFunction('param1')", 10);setTimeout("myFunction()", 10);...etc...BTW, if you want to trigger a function on a click, this is the proper syntax: document.getElementById('scrollbar').onclick = function() { // code to execute when #scrollbar is clicked}
  10. MySQL & PostgreSQL are database programs. SQL is the langauage MySQL uses to manipulate the database. I haven't looked into PostgreSQL much, so I'm not sure if it uses SQL or what makes it different. MySQL is the most popular database program, and is often used alongside PHP and the Apache Web Server.
  11. Just add more methods in the controller class and remember to create views associated with each method.
  12. Fmdpa


    Probably the latter option. Search bots may not index pages with query strings like that.
  13. You might find this post interesting: http://net.tutsplus.com/articles/general/1...y-popular-blog/I also would recommend that your website be about what you know best.
  14. RewriteRule ^([0-9]+?)$ "test.php?number=$1" [R]
  15. That was a pretty good summary...
  16. By far the best tutorial I've seen is this one.
  17. I based my spam-blocking system off of a post here. I implemented a very similar system, but then I started getting manual spam (hint: they usually use ANCIENT browsers; One spammer on my site was using IE 2). Also, I block comments that have words like "money" in the name field, and when thename is more than two (or was it three?) words long. I haven't gotten any spam recently.
  18. Is this a joke? You linked to it from this web development forum...what do you think the overall votes will be for?
  19. You could do this with PHP, SQL and Javascript (using the jQuery framework would make things easier). Here's a good tutorial for the chat part: http://tutorialzine.com/2010/10/ajax-web-chat-php-mysql/
  20. ASP and PHP are competitors, so you do not need to learn both. I'd recommend you start with PHP. SQL is almost always taught alongside PHP, so almost any tutorial series you look at will put it at the proper place. You can get started with form data retrieval easily. W3Schools tutorials put it pretty near the beginning of their series. As for the database thing, you can install WAMPServer which bundles PHP, Apache and MySQL (the database program) for installation on Windows.
  21. Attached to this post is an HTML file of a project I did once to figure out CSS dropdown menus. You can ignore the jQuery if you just want a pure CSS menu. dropdown2.html
  22. You can check if the database is created like this: $query = mysql_query("CREATE DATABASE my_db");if ($query) { // $query is "true", so the database was successfully created} else { // the query failed to create the database}
  23. Try putting an "!important" declaration by the properties. Often email clients won't allow styles to be overridden unless you do that. a:link {text-decoration:none !important;} a:visited {text-decoration:none !important;} a:hover {text-decoration:underline !important;} a:active {text-decoration:none !important;}
  24. The Mozilla documentation center is probably the single best reference, but I also use the Opera Developer website. It has lots of very high quality, up-to-date tutorials that are extremely useful. There is also a mini javascript reference somewhere on Opera.com, but I can't find it ATM.
  25. Yes, it would take a lot of work to make it work securely. To make it more complex, you'd need the user to install a program that can access the computers webcam. Flash is installed on most browsers and it has access to the webcam, so that might help.
  • Create New...