Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Fine

About Nihilith

  • Rank
    Chromium Defender
  • Birthday 01/16/1978

Previous Fields

  • Favorite pizza topping
    Mozzarella, olives and thin bacon
  • Why do you want to join DarkMatters?
    Whisky (Jack Daniel's)
  • All time best video game ever played
    Final Fantasy 7 - Diablo 1 - Diablo 2 - Sacred UW
  • Real Name
  • Platform
  • Country

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Gender
  • Location
    Tours - France
  1. A general guide to programming

    @moo : sadly, at school, they don't insist enough on paper work, because of a major lack of time...
  2. Blender 3D - Free 3D design application

    @moo : download and install python 2.6. blender scripts are made in python, and you need to hzve installed for scirpts to work well.
  3. A general guide to programming

    Major update
  4. A general guide to programming

    To be exact Brad, even for a pro dev, the pen/paper combo is an absolute need. I should say, it is more and more needed as you grow up in coding, because you have to deal with enormous projects with a lot of constraints. When dealing with databases, there are points like foreign key constraints or dependencies that need a lot of thinking before getting coded. A pro dev, most of the time works in a team, or directly with the customer (my case), so coding roughly from a customer idea is suicide, and coding without a plan in a team is genocide ! Dealing with the Hello World app isn't such a pain, you can start it from scratch in any language. But even for such a simple prog, getting used to write down what it takes is a good habit to have. For the roster, if you want to get a graphical layout, you can go either into flash with action script or php with the image plugin which handle a lot of functions as it inherites its code from imagemagick, the most powerful image library right now. Php image module can resize, insert watermarks (so text overlay isn't a problem), crop images and so on. You can achieve a sig generator and a classy roster layout with just php and html. Write, draw, archive, but don't either erase nor trash your drafts. This is the key to success. Coding is just icing on the cake (or the chocolate nugget in da cookie), the binary expression of your hard "mind" work, your award, not your weapon. Coding is so easy when everything is planned, imagined, written. If you can't see the way to do it, do it differently, but there's always a solution. Don't think about optimization first, think about result. Once you got what you want you can get it faster, but fill the blanks, reach the goal first. It's like practicing an instrument (and as a beginner guitar player I can only approve it). Start slowly, like a snail, and go through all the song to the end. It sounds like crap. Start again, slowly, till the end. Yes 1 chord is ok now... once again, 2 chords right... the whole slowly paced song... then the song, at full speed. But everytime, you reach the goal, playing the song slowly, badly, better, well, fast... You already did wonders with the forum and the wiki Brad. If you give yourself enough time to plan your project, it will be a piece of cake ! Thanks for the sticky !
  5. A general guide to programming

    This is my point of view, the way I do it. Certainy not the only nor the best way, but mine, and believe me or not, it never betrayed me. These explanations are as language independant as possible, even if I sometimes rely on code to explain some stuff What do I need to start a project : a whole pile of blank paper a whole pack of pencils patience time and calm ! did you notice that no computer is involved ? How do I start a project : Take a sheet of paper, draw an horizontal line in the middle of itin the upper part, write project goals in the lower part, write the needs (any need for a database, a particular library such as image manipulation ?) Coffee making : goal : I must make coffee . -------------------------- . needs : a coffee machine a filter water coffee . methods : fill the machine with water put coffee in filter switch on the machine switch off the machine next revision : Coffee making : goal : I must make coffee . -------------------------- . needs : a coffee machine a filter water coffee . methods : . fill the machine with water . empty the coffee machine bottle (english name for the recipient the coffee goes to, please ? ) (if not empty) wash the coffee machine bottle (if not clean) place the coffee machine bottle (if clean) . put coffee in filter (only if filter is in the machine and filter is a new one) open the filter compartment remove filter (if filter is not a new one) place new filter in machine (if old filter not present) . switch on the machine (only if everything is ok to proceed) switch off the machine (when coffee is done) In this revision, conditions start to appear in the parenthesis... I generally draw a process schema to put everything in the correct order, with forks wheter a condition is satisfied or not. It's called modeling a program. Anyway, stay in the general approach of the project. For example, write down that you need an image library, not that you need this particular image library. The others sheets are here to go into further details of the different aspects of the projectsDrawing a raw blueprint of the gui (graphical user interface) if any Writing down what inputs the user should need Writing down what you may offer the user to speed up the use of the program (choice list instead of full input etc.) [*]if you got support of a database, write the tables description, the fields of the tables, the way they're in relation with each other. [*]Never throw the sheets to the bin... instead of it, keep them as revisions (keep them in groups, write down a revision number and a date on the groups). You could then refer to them later to pick up some previous ideas. [*]Always use natural language, never use a programming language on these documents. This paper work can be replaced by a "word" file, but always have some paper next to you, sometimes, ideas pop when you don't expect them. I often use the recorder function of my GSM... Scanning the notes to some files can be a good and portable idea on an USB Key. I always got my 8GB USB key on me, with "portable openoffice" installed on it so I can work my files on any pc even if this pc doesn't have openoffice installed. I also got portable thunderbird and portable firefox on it... but this is another subject. Once the project almost completely written down in natural language, it's time to give the project a new go by choosing the tools. Choosing the tools : Which language ? one you're cumfortable with, except if you started this project to give a new language a go one that may make it easy. if the project is web oriented, go for a web oriented language such as PHP, Java or HTML if the project is a game, you may want to go deeper into the control you have on the machine, so C++ could be a good choice. if the project is a simple script, use a simple language such as Python (even if python can handle big projects as well). [*]if your project must run on different OS, go for a portable language (avoid Microsoft Visual studio for example) The good question is : Is it of any use writing a simple ftp back-up tool in 300 lines in C++ if python only needs 30 lines...? Which IDE (Integrated development environment) ? this will depend mostly on the language even if IDE like Eclipse can support many languages. most of programs can be written within the notepad, but an IDE offers more tools to speed up your coding the "look & feel" of the IDE. If you're not cumfortable with it, you won't go far. some IDE features : Syntax highlighting is really useful, even more with language that are case sensitive. Taking an example in Python and Idle (minimalist IDE), if you type 'TRUE', it will not be highlighted, as the right typo for this constant is 'True' in Python. if correctly typed, it will appear in purple under Idle IDE. Auto code completion : some IDE scans the libraries you're using and most of them offers expression completion. For example, you start typing "gtk.req" and it shows "gtk.require" which is completed by hitting the "Return" key instead of typing it down completely. Embeded compiler : No need to go through complex command lines to get your program running, just a click away. Embeded debuger : shows you the error, the line it's in, and so on. Graphical User Interface ? Go for a GUI Designer, embeded or not in you IDE. It is possible to code the GUI, but prepare to spend a real lot of time for this ! How I setup my project workspace : File Organization From my point of view, the success of a project is, for a part, in the directory structure of your project. Here are some of my rules of thumb. And these rules can be applied to other projects such as Photoshop projects or even a "word" project. A folder for each project. Two projects cannot share a same root folder. If you need shared resources for 2 projects, copy paste them between the project folders. Storage isn't an issue nowadays. A sub folder for each type of file. Resources are in a folder, libraries in another, and so on. Sub-sub-folders for sub types. In the resources folder for ex., make a folder for images, source text files, video, sounds and so on. A sub folder for working sheets. Put your word, excel work documents in it. Don't be too greedy though, and don't get a 10 level deep directory tree... 3 levels is ok Here a simple overview, pretty self explanatory (an image is worth a thousand words) This may be quite confusing at the beginning but believe me, soon, when dealing with big projects, this will prevent from dealing with hundreds of files in a single directory. Some rules : Try to always name the directories the same way from a project to another and in lower case, this way you will avoid a lot of mistakes in the program. (create an empty folder template, and copy/paste it so you don't have to do all the structure again each time you start a project) Instead of typing the whole file path every time, include (c++) or import (python) a file with CONSTANTS which contains the pathes. Example, my constant IMG_PATH contains "res/images/" IMG_PATH = 'res/images/' so to load an image, I usually type : image.load(IMG_PATH+<filename>) As the resources don't really change along with the versions of your program, the revisions folder will only contain subfolders with a copy of the files in the parent directory (your working files, your code !). More pointers : Databases Working with databases implies working with queries. When building a query, and for optimization reasons, you won't always do a SELECT * FROM TABLE this query means : stock every value of every column of every row of the table 'TABLE' into the memory. But most of the times you'll go for something like that SELECT c_name, c_lastname, c_address, c_zip, c_town from CUSTOMERS where c_country='US' which means : stock only name, last name, address, zip code and town of the customers living in USA. When browsing the results, you will have to access the fields of the rows by a number (index) of the element in the row, this being relative to the order you've SELECTed them. So it's a really good habit to always keep track of your queries in a chart. For example: QUERY NAME : qry_us_customers TYPE : SELECT (if it is such a query, UPDATE, DELETE OR INSERT for the major other ones.) TABLE : CUSTOMERS FIELDS: 0:c_name 1:c_lastname 2:c_address 3:c_zip 4:c_town CONDITIONS c_country = 'US' ORDER None so wherever you're in your code, when you use this query, a quick peek at your charts reminds you that to access the zip code, you'll have to pick index #3 (count starts at 0) : zipCode = result[3] Excel makes wonders for this Did you notice that the fields are prefixed with a c_ like CUSTOMERS ? Many languages offers some functions which returns an 'evoluted' charts with the values in it. You can then call the value you need by specifying the name of the column (the name of the field in the database), in this case, "c_zip" like this : echo $result[`c_zip`]; (php) Naming conventions These are the most often used : CONSTANTS IN UPPER CASE ! Variables in Capitalized words except the first one always starting with a letter, no accent, no special character except underscore "_"customerName is ok customerName2 is fine 2customerName is wrong (some languages can't handle a variable name starting with a number) CustomerName will work but isn't really normalized (who cares !) customer_Name is ok the_Name_Of_The_Customer is stupid because it's really too long and will make you waste a lot of time when coding cN is also stupid, because it is not self explanatory enough. My conventions : string variable names start with a s_ : s_Name = 'Nihilith' integer variable names start with a n_ : n_Age = 31 float variable names start with a f_ : f_AccountBalance = 0.10 (time to get some more work...) a database table field starts with a letter or two reminding the table name : 'c_zip' in 'CUSTOMERS' table a database table names are prefixed with a reminder of the database name. not used in the previous examples, to simplify the reading ! It can occur that 2 databases used in the same project, and thus, merged into a unique database, have tables that have the same name. Imagine you merge a blog database with a 'comment' table with a photo gallery database with a 'comment' table... all the tables coming from the blog database will be prefixed with b_ (b_comment) and all the tables from the photo gallery with pg_ (pg_comment) so the 2 'comment' tables can exist together Prefixing is a really good habit (one more) because, you know where the data comes from, and regarding variables, you know what type of data you're dealing with, and thus, won't try to divide a float by a string ! and so on when using widgets (GUI objects) such as with gtk widgets and python, I use a prefix reminding the type of widget : btn_ for a button : btn_Quit ent_ for a text entry : ent_Login win_ for a window : win_MainWindow tv_ for a tree view : tv_CustomerList There are standards, but once you've found a naming convention that fits your needs, always be strict and make a rigorous use of it. Never, never go fancy with naming convention. When browsing 15000 lines of code for all the calls to the button widgets, you just have to search "btn_" and even notepad can handle such a difficult search. Libraries I often talk about libraries. Here's a quick description of what they are, and what they do. Libraries are programs that have been build to be used by others programs, meaning they can't be run by themselves, you must invoke it in your program and access its functions in your program. The library will then send you a result back, in the form of a variable or a process (printing, displaying, controling a robot). DLLs are library, offering the system some functions and called by other programs. You can't run a dll directly. One famous dll is directx.dll (voluntarily mispelled) which offers 3D management to Windows and which is used by almost all your favorite games. You graphic card driver is a library, a dll, that translates a standard order given by the OS into a language that your CG card understands, resulting in displaying something on the screen. A game sends a command to directx.dll, redirected to the OS then to your CG card driver and resulting in displaying something on the screen... We're talking about layers, to be exact, these are called abstraction layers. You don't have to know what your CG card understands, and you don't have to know what your CG driver is waiting for. You just have to know what directx is waiting for. You can make abstraction of the rest. When you ask directx to display a cube, that's a hundred of commands at directx level that are involved (creating the points, the edges, the faces, the color, placing it in a 3D coordinates system), maybe a hundred commands at the os level, the same amount at the driver level... More than offering abstraction, libraries also simplify the code ! When coding, never try to invent the wheel again (sorry, but this my own translation of a french quote). Try to find a library that does what you want for you, instead of typing lines and lines of code. You'll save time, coffee and your nerves. Be careful as libraries may be protected by copyrights and can't be used for a commercial purpose for instance. Engines It's difficult to talk about libraries without leaving a note about engines. Engines are 'super' libraries that offer a pack of libraries to handle several functions. A game engine for instance will take care of : Inputs (keyboard, mouse) Display Sound Video Collision between the objects Networking ... I won't go any further about engines. It's a subject on its own, and I'm not really familiar to engines... Conclusion Ok, this is a quick overview of what I should call a quick start to organized programming. Feel free to comment and ask questions. I may update this guide often and according to the relevant questions. Patience over everything else is the first key... Cream for wrist injuries... No rough coding... Slowly but fully... Strict respect of the conventions YOU have choosed ! Use libraries, and study them if you got access to the source code. They will work for you, and can teach you the way to fix a bug, or teach you things you never ever thought about. Hope it helps [Edit] : Typos ! grrrrrr and also fixed the crappy lists ! And major update with more naming convention + highlighting + bold + whatever... this finally looks like a guide + notes about libraries and engines... abstraction layers...
  6. Do you rinse your pasta?

    Ah Pasta ! My two cents about pasta cooking. Put them in the boiling water with a spoon of olive oil, but don't cook them completely, remove them 1-2 minutes before the time it would normally take to get them "al dente". Immediatly shower them with cold water to stop the cooking. Once cold, take oil and swirl the pasta with some oil. Then you can put them in the fridge for a day if you want. When you want to eat them, boil some water and put them in for the 1-2 minutes missing from the first cooking. My 2 cents
  7. Blender 3D - Free 3D design application

    To get a nice render with the texture, and apply multiple textures on a single mesh, you can work with vertex groups or UV Mapping. By the way, UV maps and textures must be a power of two wide and high (1024*1024 for instance). It would be great if you could provide the first texture in 512*512 for example. This way, after the mesh unfolding, this texture could be applied the inner part of the top surface. Then, I'm pretty sure we can play with the texture coordinates to animate it. To get a render like the one I posted here, it's really simple. For the mesh, I used a blueish material with some specularity and hardness. The plane is light grey with no spec. Then I deleted the default light and added Ambient Occlusion. I played a bit with the mesh size instead of moving the camera to make it fit the screen. settings : 640*480, OSA 16, F12 (render), F3 (save render) @DB : my mesh is rounded cause I added a subsurf modifier. But there's a lil secret about getting harder corners. If you only extrude once and apply the subsurf mod, you'll get a really rounded shape (talking about the side of the mesh) I will show you what I mean with screenies. The basic shape and a pointer to subsurf settings The subsurf applied (visually) to the mesh in edit mode Extrusion Render with subsurf... so awful add a loop (CTRL-R in side view, move the mouse till you get the purple line, then click to validate the cut, and place it with the mouse. click again to validate the placement. Step 1 : Adding the loop (CTRL-R, move till the section comes across the side faces, then click) Step 2 : place the loop close to the upper edge and click, repeat the 2 steps for the bottom face. Render with subsurf and loops added. From a mathematical poin of view, simplified to the maximum : Subsurf rounds the corners. The wider the length between the corner and the next vertex, the longer the radius. By placing a loop close to the corner, this shortens the radius of the "rounding"
  8. Hi ws. You should have a look at services running on your comp. There's a lot of them which aren't needed for everyday use such as bluetooth service, dhcp (just setup the network card to a static ip adress) and so on. Which cg card does this comp have. Maybe a swap between two machines could be helpful. For example if you got a powerful pc with a powerful cg card and this one handling a low end card, you could improve this machine by using the high perf card and the powerful pc may not be hurt much by a less powerful card...
  9. Blender 3D - Free 3D design application

    This looks real nice. Could you please post a full screen static render of the mesh. I'd love to get a snapshot from the blender window with your mesh on also. You should add some scenery @Schot : I'm pretty sure you should open a blender 3d sub forum First raw work on the logo. Now that the shape is almost ok, I can work around the scenery
  10. Blender 3D - Free 3D design application

    You can also go for particles, transforming each vertex of the mesh into a particle emitter. The logo can then spray sparkles all over the screen to then fade to the normal model ang light up... just an idea, among many others... Bezier curves are another approach to modeling, but at last, everything is converted to a mesh made of polygons, so any way is fine. I prefer what's called "box modelling" (extruding from a starting primitive) than bezier curves, but they show really convenient when going for spinning shapes (glasses, bottles but not gears, as an array modifier is much more convenient) or extruding along a path (making a road for example, or a spring). @Schot : I'll give the logo a go asap
  11. Wants a head start on Programming

    Ok. Upgrade is not possible, you must download the version on this page. Once installed, go to your start menu and launch "idle". This is the python interpreter and it's also a code editor with syntax highlighting. You could go for version 2.6, but f you want to go for GTK Gui, you'll encounter problems. Start off with python right out of the box and if you go around a project, expose it here so we can discuss the way to code it efficiently. What's really nice about python is that you can test functions right into the python interpreter, without having to make a python program and run it. here is the official tutorial from python site : here. This is for v2.6, but still good for 2.5. Others tutorial I didn't use but you could have a look : - Here - Here also I also have some pdf about python, I you want them, just ask by personnal message with your mail adress and I will send them, or put them on a server to download. Do you know how to make coffee ? Then you know how to code with python Have a nice trip
  12. Wants a head start on Programming

    Hi Moo Ok, let's talk about prgramming. Here are some pointers. Language generation : the higher the generation, the easiest, but not really the more insteresting. Among the common languages, I would order them this way from low-level programming to high level programming. The lower the level, the closer to the machine you are, but the more complex it becomes to code... memory management, more risks of bugs, memory overflow and so on. Assembly (back to dinosaurs) C/C++ (low level enough to manage threads, mostly employed for game programming (diablo2 for instance) as it allows a lot of memory management) PHP (web oriented, many wrappers (plug ins) to get access to easy functions such as MySQL database and so on) VB (gui oriented language, with a gui builder embedded, easier than c/c++ but microsoft oriented also....) Java (web/desktop programming, close to C++, object oriented programmation language, powerful) Python (interpreted language yesterday reserved to scripting but a real powerful language and really easy to learn with a lot of wrappers toward Databases, gui, game programming, image manipulation) I actually use Python with GTK for the gui (the gui libraries used by Gimp and most of Linux Gnome applications) Professionaly speaking I use windev, a all in one french language database oriented. Now it depends on what you want to learn : Easy way to get fast results --> Python --> you'll learn basics and get quick results, lacking some more inner fundamentals, but anyway, as python is based on C++, you'll get a really nice overview of programming fundamentals Hard way but the language every programmers must use at least once in his life --> C/C++ --> hard learning curve but you'll know the machine as well as the language when you start to master it. I'd like to say this is your choice, but if you need some help, you can rely on me. If going Python, download the lastest 2.5 version, not 2.6 or 3.0 as the wrappers are compatible with 2.5 mainly, and you won't miss many things with this version comparing to newest ones. If you need ressources in python or code samples, I can send you a lot Hope it helps MAJOR EDIT : just forgot to say that to become a real programmer you need : Patience Taste for challenge A computer running A language A dozen of pencils and a big (should I say enormous) rubber A lot of paper The first two and the last two are the most important !! You won't get far if you start coding from scratch ! Always write down what you : Want to achieve The way you think you"ll take to get there (this will change during the programming session) This will lead you to write down what you need ! Once you know what you need to get what you want, you can start coding ! One last note : No code on paper first, only words expressed in your language. Example : My program must copy a file to a chosen directory do I need a graphical user interface or is the command line enough ? are the destination directory and the source file written in stone or must I offer the possibility to input the data ? No input needed, always the same file which always go to the same dest. folder. so, no gui needed. so I need a file management library or a language that embed this support (in case you haven't choosed your language yet)... details the program will : test if the file exist 1 - the file exists : it must check if the dest. folder exists 1 - a : the dest folder exists : copy the file 1 - b : the dest folder doesn't exist : create it and go back to step 1 2 - the file doesn't exist : alert the user and exit the program And besides of books, tutorials, your best weapons are : testing and discussing Just think of a programming language as a foreign language, as you would learn french, german or any other language. The computer is the person you want to get info from, you must discuss with it in a language it understands. it understands bits (0 and 1). You can't speak binary, but you got a nice translator from "chosen language" to binary. You just have to learn this chosen language. A computer is Stupid. Its raw calculating power based on 2 fundamentals (1 and 0). Its intelligence depends on 2 things. The way it has been programmed and the way you speak with it ! You are the superior being ! It doesn't understand poetry, just commands translated into functions in the programming language. No way to ask it "on the screen my eyes stare at, the words I choosed would you display at" . Print "the words I choosed" is much more efficient !
  13. Buying/building a new PC

    For the monitor, you get two choices : A flat panel full hd (1080p) lcd TV (€1000 here in france for a 127cm screen) with hdmi input if the video card is hdmi capable. Believe me, Sacred2 in full hd on a big big big screen is godly, and thunder strikes flashes are.... amazing. A 24" monitor (1920x1200). Some are hdmi compliant and embed speakers if you plan on plugin' a PS3 or X360 on your monitor. just my 2 cents
  14. Blender 3D - Free 3D design application

    The major blender revolution started with version 2.3 as far as I remember. Everything is matter of key-binding and mouse gestures in blender, where other software make you click on a far far away button, you can grab, rotate scale, extrude and so on just by moving the mouse over the model or hitting a key. E G S are the 3 keys to know first, as you can extrude, grab and scale. What's really nice about other bindings are the constraint. hit G then X and you will only grab around X axis (same for Y and Z and works with extrusion, rotation and scaling) You can also hit N to get numeric inputs for transformation. By the time I tried some mechanical modeling, I turned on the "edge length" options, and each edge is labeled with its length, corners with their angles and so on. @Schot : to start with the FDM logo, I would lay it down as a background image in the front view (NUMPAD 1) and set a plane (rotate it "RX90" 90° around X axis) over it. Then extrude along the general shape... Here are some screenies to illustrate : bg img adding plane going to wireframe mode to see through the plane extruding, rotating & scaling (set back to solid mode to see the raw result) This is a 2 minutes work... just to show how I'd do it. then add loop cuts (CTRL-R --> loop cut), to refine the model. Once the shape done, go to side view extrude and play along with it (add subsurf etc...) I would only draw the blue part of the logo then extrude it back a little, then inflate it to match the black border. This way you'll have a "stair" shaped border which, once "subsurfed" will look like a rounded inner chamfer seeing from a side point of view blue surface _____ | | |______ black border will result in _____ | \ round inner chamfer \______ Can't really tell if you'll catch my mind lol Last note for today : when modelling, try to keep your faces as quads, as they react really well to subsurf, where triangles sometimes mess up. And the cross edges must always follow the flow of the general shape... Wrong Right If you want me to make a full try on FDM logo, just ask I got quite a few ideas around it already lol
  15. Blender 3D - Free 3D design application

    I used blender3d some time ago. there's a ray tracing renderer called yafray that is fully integrated within blender gui. Just download yafray and you can render blender mesh through it. This app is really great, quite hard to get used to, not really intuitive at first, but once you know the basic key bindings, it's really fast. visit blendernation, and google for blenderart magazine. These sites are really helpful. @Schot : for materials, the hard point, blender really shines with node compositing. It's also a great video editor (believe it or not). Using nodes, you can mix textures on different channels such as normal mapping, alpha, specular, diffuse and so on. If I got time sometimes, I'll probably throw myself once again into 3D modeling.