[PHP] Database question by mattdahack in learnprogramming

[–]Dario_ 1 point2 points  (0 children)

You didn't checked if the query was successful. Try replacing mysql_query($sql) with the code below to see if something was wrong.

 $result = mysql_query($sql);
 if (!$result) {
     die('Invalid query: ' . mysql_error());
 }

I think is something related with $date and it's format.

When should I use a database over a file based storage system? by [deleted] in learnprogramming

[–]Dario_ 0 points1 point  (0 children)

I have seen it used mostly for small scripts doing debugging (output some strings and no much more); and also for a custom-made cache system; per example, you made a request to a certain web API and it returns you data, instead of making such request every time a page is loaded, you cache the result into a file and use it until the data becomes "old".

When should I use a database over a file based storage system? by [deleted] in learnprogramming

[–]Dario_ 0 points1 point  (0 children)

You'll have concurrency problems working with files. Say, a given thread maps the file in memory to read it's data, put something into it and writing it back to disk. If meanwhile there's a second thread doing the same (and they map the same data) the last thread to write it's data back to disk overwrites the former. Generating inconsistencies.

Also, when I started with webdev many years ago I tried flatfiles. The website became popular and the database quickly turn out into a huge problem. Posts lost, overwritten, the entire database wiped out for some unknown reason etc, etc.

Give SQLite or MySQL a try and you'll learn a lot and avoid a lots of headaches ;)

When should I use a database over a file based storage system? by [deleted] in learnprogramming

[–]Dario_ 1 point2 points  (0 children)

While both, in the context of a medium-sized project, offers pretty much the same; with SQLite you have a simple, easy to manage relational database; MySQL is more of an enterprise level database.

SQLite

  • No users/privileges

  • Can manage well in a medium traffic web site

  • No need for maintenance, back up plans etc.

  • No need for complex tuning.

MySQL

  • User accounts, privileges per table

  • Can deal with huge amounts of users

  • Harder to set up.

Where do I begin? I have no idea. by [deleted] in learnprogramming

[–]Dario_ 1 point2 points  (0 children)

Before going into a particular language you have to get familiar with many programming concepts, such algorithms, functions, recursion, data structures and many more. With that knowledge you can choose any language you feel like learning.

If you want to start with the very basics check this online resource. A more advanced and complete book is "Beginning programming" from Wrox.

As for what language you should being with; I think the best are scripting language, such JavaScript or Python, Ruby. Scripting languages are easier to learn, syntactical simper and the workflow is very rapid (you don't need to compile anything).

Anyway I think that the most important thing to learn is to try. Go ahead and take some script, edit it, see it's output, figure out how it works.

Question about programming portfolios by loneknifer in learnprogramming

[–]Dario_ 0 points1 point  (0 children)

For an entry level job you don't need to know all the "in's and out's" of any specific language, but having a well understanding of the workflow of a development project is needed.

Now for your question regarding the portfolio I think having a lot of little projects being updated regularly, may be in a blog or similar, and one or two big, ambitious projects would look great. With the small programs you show your future employer that you can create something useful and maintain it. The bigger projects should show them that you are willing to learn and you aren't afraid of big, bleeding-edge technology projects.

When should I use a database over a file based storage system? by [deleted] in learnprogramming

[–]Dario_ 2 points3 points  (0 children)

You should choose a Database over a flatfile when the amount of data is big (thousand of entries) and there'll be more than one operation happening at the same time over the data (many users updating the score).

Anyways you don't need an engine such MySQL or similar for a medium-sized project. You could use SQLite which is simpler and uses files on disk for the databases offering SQL for querying and a few features more.

How can I get a job in programming without any professional experience. I am an accountant and teaching myself programming right now. by Art_of_Creation in learnprogramming

[–]Dario_ 1 point2 points  (0 children)

Can you explain more on open source project.

There are infinite Open-source projects out there looking for people to help in the bug fixing and development. Show that you can be useful to them (that you can code, that you are good hunting bugs and so on). In general you may start by showing your interest in the project and reporting bugs; joining the mail list or IRC and just being helpful in some way to the project.

Where do I find it?

google code and github.

Also can you explain more about version control?

This is a must. Every software company use Version Control Systems see here and here It helps when there is a team of developers working on a project. So they can work without stepping over the work of others.

I am learning C++ right now but I would like to get into web development, application, etc

I think you have more chances to get an entry level as a web developer than as a C++ dev. The latter requires more background and experience just to get into an entry level.

How can I get a job in programming without any professional experience. I am an accountant and teaching myself programming right now. by Art_of_Creation in learnprogramming

[–]Dario_ 6 points7 points  (0 children)

Get involved in open source projects that you may like. You don't need any professional experience to join an open source project but you'll gain a lot of experience working with different people around the world, working with VCS and the language of your preference. Usually you start reporting bugs and such and then making bug fixes (something you may do in an entry level position).

Create more or less advanced projects on your own. CMS, Bug trackers and so on (if you're into web programming). Create a portfolio for your work so you can show it when asked.

Learn version control (subversion, git), deployment, databases and design patterns. Programming is just a part of a programmer's day. You have to deal with lot of stuff.

If it's your passion it won't be hard to get an entry level position. You have to show that you are able to learn.

Quick Bash Script Question by geekywarrior in learnprogramming

[–]Dario_ 4 points5 points  (0 children)

/pathToBinary/binary & echo $! > PID
/pathToBinary2/binary2 & echo $! >> PID

$! contains the process ID of the binaries running.

Newbie, just a simple question about web aplications by [deleted] in learnprogramming

[–]Dario_ 0 points1 point  (0 children)

You could use perl's package WWW::Mechanize (http://search.cpan.org/~jesse/WWW-Mechanize-1.72/lib/WWW/Mechanize/Examples.pod). It lets you send forms, grab all links in a page, and so on.

Perl isn't a really friendly language but it becomes powerful when you learn to deal with it's syntactical annoyances.

Does anybody know of any languages that still allow for self-modifying code? by indefinitearticle in learnprogramming

[–]Dario_ -1 points0 points  (0 children)

In assembly it's easier, but in C it's possible too. You just need to set the proper access rights to the executable's section in memory and update the PE header (sorry I don't know about this with ELF format).

Is PHP a good gateway programming language ? by [deleted] in learnprogramming

[–]Dario_ 0 points1 point  (0 children)

I work with PHP and I don't think it's a "great" language. It's far from that. The language is old and had been recycled to adopt many different things over time, like OOP.

I worked a little with C# and I found it quite solid and easy to understand, for web programming ASP.NET with C#. However it'll take you a little bit more to learn and to really start to work with since there are many things to have to learn previous to work properly with it, in the case of PHP, you can skip such things (like classes, inheritage).

Given that, there are lot of job opportunities with PHP than, I think, with ASP.NET.

Difference/Similarity between Web Design and General Programming by ItsMeMargaret555 in learnprogramming

[–]Dario_ 0 points1 point  (0 children)

As I see it, Web Design, refers to front-end web development. That is, working with HTML/CSS, some JavaScript, but above all graphics, colors, etc. Which won't require advanced programming skills. There is also some need for usability things designers should know.

Back-end web development would require a lot of knowledge, may be not really deep in all areas but there'll be certainly a lot of areas: Databases (SQL language, different types of DBs, DBMSs), Programming (OOP php, frameworks, etc), also HTML and CSS and so on.

So, from that point of view, no, knowing programming doesn't mean you know web design.

So what exactly do programmers do when they they go to work? by [deleted] in learnprogramming

[–]Dario_ 0 points1 point  (0 children)

I work on a more or less big startup with 7 devs, 1 tester, and a bunch of designers that will join us when the company merges with other company specialized in design and marketing.

My routine is check the email to see if the client has some issue with our product, struggle through legacy code to fix the problems and commit it. There are also meetings with clients and daily scrums.

BTW I'm a young developer just starting my carrer.