Search Results

Search found 129 results on 6 pages for 'fayer'.

Page 3/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • how to use ruby in the web?

    - by fayer
    so now (finally after 4 hours) i have installed ruby 1.9.1, rvm and passenger. but how do i use ruby with http? in php you just embed php with html in a .php file. how do you do it with ruby (note: i dont want to use frameworks for that, just pure ruby + html to learn how it works). thanks

    Read the article

  • remove the blank rows after i removed xml elements?

    - by fayer
    i removed some elements from a xml file with simpledom. the code: $this->xmlDocument->removeNodes("//entity[name='mac']"); here is the initial file: <entity id="1000070"> <name>apple</name> <type>category</type> <entities> <entity id="7002870"> <name>mac</name> <type>category</type> </entity> <entity id="7024080"> <name>iphone</name> <type>category</type> </entity> <entity id="7024080"> <name>ipad</name> <type>category</type> </entity> </entities> </entity> the file afterwards: <entity id="1000070"> <name>apple</name> <type>category</type> <entities> <entity id="7024080"> <name>iphone</name> <type>category</type> </entity> <entity id="7024080"> <name>ipad</name> <type>category</type> </entity> </entities> </entity> i wonder how i could also remove the blank lines that are left after i ran the removal code? thanks!

    Read the article

  • how to learn a library/framework structure?

    - by fayer
    a lot of people are contributing to open source libraries/frameworks. i wonder how these people learn the structure so that they can contribute? lets take doctrine and symfony as an example. is there a blueprint over these frameworks to give the developers an insight of the structure? or do they just download it and study the code? how does it work? please you contributors, share your learning strategies! thanks

    Read the article

  • how to handle exceptions/errors in php?

    - by fayer
    when using 3rd part libraries they tend to throw exceptions to the browser and hence kill the script. eg. if im using doctrine and insert a duplicate record to the database it will throw an exception. i wonder, what is best practice for handling these exceptions. should i always do a try...catch? but doesn't that mean that i will have try...catch all over the script and for every single function/class i use? Or is it just for debugging? i don't quite get the picture. Cause if a record already exists in a database, i want to tell the user "Record already exists". And if i code a library or a function, should i always use "throw new Expcetion($message, $code)" when i want to create an error? Please shed a light on how one should create/handle exceptions/errors. Thanks

    Read the article

  • netbeans autocompletion when using singleton to retrieve object instead of new operator?

    - by fayer
    when i use the 'new' operator to instantiate a class, netbeans has no problem to autocomplete the members of the object. $instance = new Singleton(); $instance-> // shows test() method but when i use a singleton to retrieve an object it cannot autocomplete the members in the object retrieved. the getInstance code looks like this: public function test() { echo "hello"; } public static function getInstance() { if ( ! is_object(self::$_instance)) { self::$_instance = new self(); self::$_instance->initialize(); } return self::$_instance; } so i use: $instance = Singleton::getInstance(); $instance-> // no autocompletion! does anyone have the same problem? how do i work around it? thanks!

    Read the article

  • ruby 1.9.1 in netbeans?

    - by fayer
    i have installed ruby 1.9.1 and when i in the command prompt type: ruby -v i see the latest version. however, in netbeans when i create a new project i can only select 1.8.7 version. how do i tell netbeans to use the latest ruby version that i have installed? thanks

    Read the article

  • what is the difference between plugin and library?

    - by fayer
    i wonder what the difference between a library and a plugin is? if a component creates a database (maybe comes with a .sql file or creates through a method) could it still be a library or is it called a plugin or module? cause i am creating a address book component and it provides methods to insert and read records in database. i don't know if i should put it in library folder or plugin folder. please shed a light on this. thanks

    Read the article

  • how to make objects globally accessible?

    - by fayer
    i have this code: class IC_Core { /** * Database * @var IC_Database */ public static $db = NULL; /** * Core * @var IC_Core */ protected static $_instance = NULL; private function __construct() { } public static function getInstance() { if ( ! is_object(self::$_instance)) { self::$_instance = new self(); self::initialize(self::$_instance); } return self::$_instance; } private static function initialize(IC_Core $IC_Core) { self::$db = new IC_Database($IC_Core); } } but when i wanna access IC_Database with: $IC = IC_Core::getInstance(); $IC->db->add() // it says that its not an object. i think the problem lies in self::$db = new IC_Database($IC_Core); but i dont know how to make it work. could someone give me a hand=) thanks!

    Read the article

  • dymanic columns in mysql tables?

    - by fayer
    i want to add dynamic columns in a mysql table. but i dont know exactly how. i want to let the user add some columns (fields) in a thread. eg. let him add a integer field and a value (eg. price: 199) or a string field and a value (eg. name: teddybear). the user can add as many field/value-pairs as he wants. i thought i could create a many-to-many table: thread <- thread_field <- field thread: id, title thread_field: field_id, thread_id, value field: id, name is this a good structure? but in this way i have to set a specific column type of thread_field.value. either its an integer or a string. i want to have the possibility to have it dymanic, let the user choose. how can i do this? thanks!

    Read the article

  • save 20 users with one sql query?

    - by fayer
    i save a user like this in doctrine: $user = User(); $user->name = 'peter'; $user->save(); is there a way to save 20 users in one sql query? or do i have to loop the above code 20 times hence creating 20 sql queries? thanks

    Read the article

  • how to get an objects property

    - by fayer
    ive got an object that looks like this with print_r(): SimpleDOM Object ( [0] => continent ) i wonder how i could get the continent as a string? i have tried gettype($object[0]); it still says its an object. i just want to get the string "continent".

    Read the article

  • which language to choose for a LIVE web application?

    - by fayer
    i want to create not only a web application, but a web application where everything is LIVE. eg. if someone posts a message and then another one replies, then the creator will get on his webpage a notification. and also i want to implement a chat in the web application. i want these features to be implemented using true server-push (no javascript polling)! because i only want to create web applications i don't think i will use java. i wonder if i should use python, ruby or php for this? thanks

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >