Search Results

Search found 173 results on 7 pages for 'ajsie'.

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

  • mysql database design: thread and reply of a reply?

    - by ajsie
    in my forum i have threads and replies. one thread has multiple replies. but then, a reply can be a reply of an reply (like google wave). because of that a reply has to have a column "reply_id" so it can point to the parent reply. but then, the "top-level" replies (the replies directly under the thread) will have no parent reply. so how can i fix this? how should the columns be in the reply table (and thread table). at the moment it looks like this: threads: id title body replies: id thread_id (all replies will belong to a thread) reply_id (here lies the problem. the top-level replies wont have a parent reply) body what could a smart design look like to enable reply a reply?

    Read the article

  • help with using alias in bash shell

    - by ajsie
    i want to have an alias "t" to enter a folder and list the content there. i tried with: alias t="cd $1; ls -la" but it just listed the folder i typed but did not enter it. i wonder why? cause when i use this one: alias b="cd ..; ls" it went back to the parent and listed the content. so i want the "t" do enter the folder i type in too. someone knows how to do this right?

    Read the article

  • configure mod_rewrite to allow img, js and css files?

    - by ajsie
    in my .htaccess i've got these lines: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] i tried to include js files with this line: <script type="text/javascript" src="system/application/media/js/jquery/jquery.js"></script> but it doesnt work since the rules dont let it pass. it works when i turn the rewrite engine off. how can i change the rules so it allows url with a /js, /css and /img? thanks

    Read the article

  • help with generating models from database for many to many in doctrine

    - by ajsie
    im using doctrine and i have set up some test tables to be generated into models: I want a many-to-many relationship models (3 tables converted into 3 models) (things are simplified to make the point clear) mysql tables: user: id INT // primary key name VARCHAR group: id INT // primary key name VARCHAR user_group: user_id INT // primary and foreign key to user.id group_id INT // primary and foreign key to group.id i thought that it would generate these models (from the documentation): // User.php class User extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('id'); $this->hasColumn('name); } public function setUp() { $this->hasMany('Group as Groups', array( 'refClass' => 'UserGroup', 'local' => 'user_id', 'foreign' => 'group_id' ) ); } } // Group.php class Group extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('id'); $this->hasColumn('name); } public function setUp() { $this->hasMany('User as Users', array( 'refClass' => 'UserGroup', 'local' => 'group_id', 'foreign' => 'user_id' ) ); } } // UserGroup.php class UserGroup extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('user_id') ); $this->hasColumn('group_id') ); } } but it generated this: // User.php abstract class BaseUser extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('id'); $this->hasColumn('name'); } public function setUp() { $this->hasMany('UserGroup', array( 'local' => 'id', 'foreign' => 'user_id')); } } // Group.php abstract class BaseGroup extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('id'); $this->hasColumn('name'); } public function setUp() { $this->hasMany('UserGroup', array( 'local' => 'id', 'foreign' => 'group_id')); } } // UserGroup.php abstract class BaseUserGroup extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('user_id'); $this->hasColumn('group_id'); } public function setUp() { $this->hasOne('User', array( 'local' => 'user_id', 'foreign' => 'id')); $this->hasOne('Group', array( 'local' => 'group_id', 'foreign' => 'id')); } } as you can see, there is no 'refClass' in the 'User' and 'Group' models pointing to the 'UserGroup'. the 'UserGroup' table in this case is just another table from Doctrine's perspective not a reference table. I've checked my table definitions in mysql. They are correct. user_group has 2 columns (primary keys and foreign keys), each one pointing to the primary key in either User or Group. But i want the standard many-to-many relationship models in Doctrine models. I'd appreciate some help. I have struggled to figure it out for a half day now. What is wrong? Thanks!

    Read the article

  • CodeIgniter version 2.0 is stable enough to use?

    - by ajsie
    i want to port my application to CodeIgniter but i am wondering whether i should use their v2.0 or v1.72 (then when they release 2.0, upgrade it). i have never used a framework before so i don't exactly know what implies when upgrading a framework: what does it mean practically - i just move the folders and it will work? or do i have to change a lot of settings, file structure etc? could someone enlighten me about the upgrade process. and what would you use: v.1.72 or v2.0? if i'm using the latest version, is there a good documentation for it somewhere so you can read about how to use the new features: packages, drivers and so on. thanks

    Read the article

  • frameworks for coding a php library?

    - by ajsie
    there are plenty of frameworks for coding MVC web applications. this time im going to code a library (think of Doctrine or Solr) with a bunch of class files. u just include a bootstrap or a class file and you are ready to use my classes. i have never tried to code a library before and intend to code one for learning purpose so that i can use various design patterns i have learned. are there any great frameworks for this, how i should organize the different class files, where i can put configuration files and so on? tutorials or other information would be great too. thanks

    Read the article

  • could you build Stackoverflow with Drupal 7?

    - by ajsie
    im wondering if one can/should build a site like Stackoverflow with Drupal 7? we all know what Stackoverflow is and how it looks like. users <- threads <- tags and the openid stuff, validation etc. if you are going to build a site exactly as SO, will you use Drupal 6/7 or a MVC framework like CakePHP, CodeIgniter...? try to be realistic here and think about the actual work to do and how to implement with or without Drupal, not just "Drupal has nice features you can use and extend". would be helpful. thanks!

    Read the article

  • possible to show composition relationship in a diagram generated from PHP source code?

    - by ajsie
    i have tested several UML applications for whether they could show composition relationships in the UML diagrams generated form the PHP source code or not, and the result is they can't. i know that this is a typical problem for PHP cause we don't declare a data type when we code, so it's difficult for the UML applications to know if an instance variable is a reference to an object or not. i also tested nWire with the same result. will there never be applications that could show us a complete map over all object relationships more than just inheritance? i think it's a pity that you can't have a good view over all the relationships for an application. cause when i use an open source solution, i always want to know how the objects are related to each other. maybe we could make comments for the instance variable telling the software that this is an reference to an object? but that would mean that the mapping software is using this solution. i feel its a pity nWire/visual paradigm can't give us a complete map:(

    Read the article

  • change shell directory from a script?

    - by ajsie
    i want to make a script (to) that makes it easier for me to enter folders. so eg. if i type "to apache" i want it to change the current directory to /etc/apache2. however, when i use the "cd" command inside the script, it seems like it changes the path WITHIN the script, so the path in the shell has not changed. how could i make this work?

    Read the article

  • proper way of setting an attribute in Doctrine?

    - by ajsie
    in some tutorials they tell you to set up an attribute like this: $manager = Doctrine_Manager::getInstance(); Doctrine_Manager::getInstance()->setAttribute( Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true); and in the documentation it shows you this: $manager = Doctrine_Manager::getInstance(); $manager->setAttribute( Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true); i wonder which one i should use? isn't it the latter one? cause how can you set an attribute to a singleton class in the first one? isn't the second one more correct?

    Read the article

  • Show composition/aggregation/association relations between objects in Visual Paradigm UML diagrams?

    - by ajsie
    I have Netbeans installed with Visual Paradigm plugin. I have converted my php code into UML diagrams (modeling - instant reverse). I can see relations (drawn lines) between superclass and subclasses. However, i cannot see relations between objects inside objects (composition/aggregation/association)? The code looks like: class Thread { private $tag = ''; public function __construct($tagObject) { $this->tag = $tagObject; } } I know its possible using Java cause i've read about it. Im using PHP, is this still possible?

    Read the article

  • benefit os having a factory for object creation?

    - by ajsie
    im trying to understand the factory design pattern. i dont understand why it's good to have a middleman between the client and the product (object that the client wants). example with no factory: $mac = new Mac(); example with a factory: $appleStore = new AppleStore(); $mac = $appleStore->getProduct('mac'); how does the factory pattern decouple the client from the product? could someone give an example of a future code change that will impact on example 1 negative, but positive in example 2 so i understand the importance of decoupling? thanks

    Read the article

  • interact with an interface?

    - by ajsie
    from what i've read it seems that one can interact with an interface? eg. lets say that i've got an interface with an empty method "eat()" then 2 subclasses are implementing this interface. can my controller interact with only the interface and use it's eat() method? have a look at the picture in this link strategy

    Read the article

  • what is main focus for a developer when coding?

    - by ajsie
    i read a lot of books about how to code right and usually the are talking about all these techniques from a point of view i can't understand. eg. lets consider the singleton pattern. i'm restricting so the class can only be instantiated once. but since it's only me creating the application, if i know that the class only should be instantiated once, then why would i create it a second time? i feel like missing the big picture. what is my main goal when coding an application? how should i think? thanks

    Read the article

  • ubuntu 64 or 32 bit for macbook/vps?

    - by ajsie
    i've got macbook pro and wonder if i should use 64 or 32 bits ubuntu server? and then i've got a vps not hosted by med. how do i know what version to choose? how do you check how many bits your cpu i working with? can i use 64 on 32 and vice versa?

    Read the article

  • best way to create tables with Doctrine?

    - by ajsie
    assume that i start coding an application from scratch, is the best way to create tables when using Doctrine, to manually create tables in mysql and then generate models from the tables, or is it the other way around, that is to create the models in php and then generate tables from models? and if i already have a database, will the models created be optimal? cause i have heard some say that its best to create the database from scratch when using ORM, so that the relations are optimized for OOD. share your thoughts!

    Read the article

  • best way to create tables with ORM?

    - by ajsie
    assume that i start coding an application from scratch, is the best way to create tables when using an ORM (doctrine), to manually create tables in mysql and then generate models from the tables, or is it the other way around, that is to create the models in php and then generate tables from models? and if i already have a database, will the models created be optimal? cause i have heard some say that its best to create the database from scratch when using ORM, so that the relations are optimized for OOD. share your thoughts!

    Read the article

  • Session and cookie in same PHP file?

    - by ajsie
    Can't I set session and cookie in same PHP file? I get an error message if I set the cookie after I've set session telling me that the header is already sent. If I set session after cookie I get nothing but it seems not to work well.

    Read the article

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