Updates

Mixing javascript with php

· Updates · Comments Off on Mixing javascript with php

After working on a big project.

I learned how to work with different langauges (mysql, javascript, and PHP).

First of all javascript can’t call mysql, but you can do some nifty tricks with php and javascript.

Samples bellow:

<script language=javascript>
var jsvar;

jsvar = <?php echo $phpvar;?>
</script>

OR

<script language=javascript>

<?php ?>

</script>

Example:

<?php if(isset($books)): ?>
<script type=”text/javascript”>
$(window).load(function()
{

$(‘.mydate1’).glDatePicker(
{
showAlways: true,
allowMonthSelect: true,
allowYearSelect: true,
prevArrow: ”,
nextArrow: ”,
selectableDateRange: [
{ from: new Date(),
<?php foreach($books as $book): ?>
<?php
$checks_in = date(‘Y, n, d’, strtotime(‘-1 month’, strtotime(‘-1 day’, strtotime($book->check_in))));
$checks_out = date(‘Y, n, d’, strtotime(‘-1 month’, strtotime(‘+1 day’, strtotime($book->check_out))));
?>
to: new Date(<?php echo $checks_in; ?>) },
{ from: new Date(<?php echo $checks_out; ?>),
<?php endforeach; ?>
to: new Date(2055, 8, 24) },
],
});
});
</script>
<?php endif; ?>

Slick 2d makes my java learning fun!

· My Projects, Programming, Updates · Comments Off on Slick 2d makes my java learning fun!

After dabbling with some more java I got into gaming to motivate my learning experience. On my journey I discovered a library that make game development faster called Slick 2d. With this library I do not need to reinvent the wheel in terms of coding sound classes, video vector complicated stuff, along with particle effects and sprite handling. With slick 2d I was able to just focus on programming and create things much faster making my java experience more pleasant. Bellow are some mini games I created. Feel free to check them out.

http://thewebsketch.com/portfolio/java/monster.zip http://thewebsketch.com/portfolio/java/raquet.rar http://thewebsketch.com/portfolio/java/rubenworld.rar

Encouragement for Future Programmers

· Updates · Comments Off on Encouragement for Future Programmers

I stumbled upon a cool video from Eli the computer guy and it gave me some encouragement and tips for applying for a programming job and I thought I share it with anyone reading my blog.

So if you’re discourage about getting a programming job I highly recommend watching this video.

Major Progress

· Programming, Updates · Comments Off on Major Progress

I got to say working on projects is really the key to programming.

After writing so much procedural coding I decided to take it
to the other level and work on object oriented programming.

I got to admit my programming has gotten 90% cleaner and easier to understand, not to mention once I write code in functions it can be shared throughout my other projects.

As soon as I learn the in’s and outs of OOP things will get more efficiently from now on.

At the same time I’ve been learning Java and playing around with swing for GUI. It’s all about taking those baby steps.procedural-many-changes

Deprecated mysql, mysqli warnings

· Updates · Comments Off on Deprecated mysql, mysqli warnings

It’s been a while that I worked with databases, but I recently picked up a new project that is heavily database driving (mysql, php) and it turns out that some mysql commands will later be depreciated in the newer versions of PHP.

I am now in the  journey to learn mysqli commands, which is very similar to the old ones, but I’m getting deprecated warnings messages left to right until I get familiar to the new ways of mysqli.

Bellow are some pros and cons:

Pros

  1. MySQLi’s interface is similar to the older MySQL interface. This versatility in using both object-oriented and procedural formats makes it easier for users of the older system to make the change to the improved one, as well as facilitating use for people that are completely new to the system. Using the old system, the user would enter a function looking like this: mysql_connect(), using the new system, this old code can be updated simply by changing the function to this: mysqli_connect().
  2. MySQLi has good support and maintenance, making the transition to and use of the new system safe and secure.
  3. The user has the ability to utilize new features available in the newest versions of MySQL servers. This is one of the biggest advantages of MySQLi. Other platforms are unable to take full advantage of MySQL’s newest capabilities.
  4. The installation process with MySQLi not only easy, but is automatic when the PHP5 MySQL package is installed in Windows or Linux.
  5. MySQLi performs (slightly) faster than its competition. With non-prepared statements, the system performs  ~2.5% faster, and ~6.5% faster with prepared ones. This is only a slight advantage and may only matter to certain users.

Cons

  1. MySQLi only works with MySQL databases, whereas PDO is flexible and able to work with multiple database systems, including IBM, Oracle and MySQL. If you have to switch databases, MySQLi is not the best option.
  2. MySQLi is not as portable as PDO.
  3. Binding parameters with MySQLi is not as easy or flexible as with PDO. MySQLi uses a numbered binding system and doesn’t support named parameters like PDO does

Like any software updates and improvements, there are bound to be bugs to be worked out in future versions as well as adherents to the older versions or alternates. Choosing MySQLi over PDO or the MySQL Extension depends on the user’s situation and preferences. While some options are objectively better than others, what it boils down to are the preferences of the user. MySQLi is a secure and versatile option to interacting with the classic MySQL database management system and in fact earns the little “i” at the end of its name.

source:  learn more about mysql vs mysqli.

Want to learn JQuery?

· Programming, Updates · Comments Off on Want to learn JQuery?

Been learning Jquery all last month. For those we want to learn JQuery my best advise is to not copy and paste coding. When looking at tutorials try typing things and seeing it work, I’m sure you will still run into problems, but that’s okay! Debugging makes you think! And Thinking makes you learn what your doing.

Here Are 2 play list videos that will steer you to the right path:

https://www.youtube.com/watch?v=6td5qaCtr9U&list=PLqEB9TT9wSdjkehApInY5cNuUV7ANMGfW

How To think like a programmer

· Updates · Comments Off on How To think like a programmer

It’s been 2 weeks now and I have gotten a good gist of how java-script and jquery works. But I’m trying to master on how to write from a blank screen. Did some research and stumbled upon this great video on how to think like a programmer.

I highly recommend watching this video if your a starting programmer who can’t code from scratch.

Welcome to my Blog

· Updates · Comments Off on Welcome to my Blog

I just set up my wordpress today, after a long day of work and of course after a long day of debugging my main website. The journey of learning bootstrap is fun but the debugging of getting headers, footers and containers to work together with out glitches is a pain. But I guess that’s part of programming.  Looking forward to what cool widgets bootstrap has to offer in the coming days.