Search Results

Search found 6420 results on 257 pages for 'mathieu parent'.

Page 95/257 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • Better data-structure design

    - by Tempname
    Currently in my application I have a single table that is giving me a bit of trouble. The issue at hand is I have a value object that is mapped to this table. When the data is returned to me as an array of value objects, I have to then loop through this array and begin my recursion by matching the ParentID to parent ObjectID's. The column ParentID is either null (acts a parent) or it holds the value of an ObjectID. I know there has to be a better way to create this data structure so that I do not have to do recursive loops to match ParentID's with their ObjectID's. Any help with this is greatly appreciated. Here is the table in describe form: +----------------+------------------+------+-----+---------------------+-----------------------------+ | Field | Type | Null | Key | Default | Extra | +----------------+------------------+------+-----+---------------------+-----------------------------+ | ObjectID | int(11) unsigned | NO | PRI | NULL | auto_increment | | ObjectHeight | decimal(6,2) | NO | | NULL | | | ObjectWidth | decimal(6,2) | NO | | NULL | | | ObjectX | decimal(6,2) | NO | | NULL | | | ObjectY | decimal(6,2) | NO | | NULL | | | ObjectLabel | varchar(255) | NO | | NULL | | | TemplateID | int(11) unsigned | NO | MUL | NULL | | | ObjectTypeID | int(11) unsigned | NO | MUL | NULL | | | ParentID | int(11) unsigned | YES | MUL | NULL | | | CreationDate | datetime | YES | | 0000-00-00 00:00:00 | | | LastModifyDate | timestamp | YES | | NULL | on update CURRENT_TIMESTAMP | +----------------+------------------+------+-----+---------------------+-----------------------------+e

    Read the article

  • n how to show cascade windows in Splitcontainer panel2 c#

    - by user1875373
    In MdiParent toolstripmenuItem, I'm writing the code to show all the windows in cascade or Tile Horizontal style. My code is: this.LayoutMdi(MdiLayout.Cascade); this.LayoutMdi(MdiLayout.TileHorizontal); This code will work in mdi parent only. But now I'm using a Split container in my Parent Form. In Panel1 I have buttons to Show the Form. In Panel2 My Forms will display, as: Forms.paymentPaid paidFm = new SalesandPurchases.Forms.paymentPaid(); paidFm.MdiParent = this; paidFm.Left = (this.myPanel.Width - paidFm.Width) / 2; paidFm.Top = (this.myPanel.Height - paidFm.Height) / 2; myPanel.Controls.Add(paidFm); paidFm.Show(); Now Because of my Split Container my code( this.LayoutMdi(MdiLayout.Cascade)) is not working for cascade the windows in Panel2. Please tell me any other way.

    Read the article

  • jprogressbar visible and working on button click

    - by Jisson
    public NewJDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); jProgressBar1.setVisible(false); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { jButton1.setEnabled(false); jProgressBar1.setVisible(true); repaint(); for(int i=0;i<=100;i+=5){ jProgressBar1.setValue(i); // jProgressBar1.setIndeterminate(false); try{ jProgressBar1.paintImmediately(0, 0, 100, 100);//0, 1, 100, 10 Thread.sleep(100); jProgressBar1.setStringPainted(true); }catch(Exception e){} } I use above code for using a Jprogressbar in a JDialog,If I use this I can see a progressbar aftercompleting its process(100 %) and also I want to hide progressbar upto buttonclick.Can any one help me?

    Read the article

  • Are protected constructors considered good practice?

    - by Álvaro G. Vicario
    I'm writing some little helper classes to handle trees. Basically, I have a node and a special root node that represents the tree. I want to keep it generic and simple. This is part of the code: <?php class Tree extends TreeNode{ public function addById($node_id, $parent_id, $generic_content){ if( $parent = $this->findNodeById($parent_id) ){ $parent->addChildById($node_id, $generic_content); } } } class TreeNode{ public function __construct($node_id, $parent_id, $generic_content){ // ... } protected function addChildById($node_id, $generic_content){ $this->children[] = new TreeNode($this->node_id, $node_id, $generic_content); } } $Categories = new Tree; $Categories->addById(1, NULL, $foo); $Categories->addById(2, NULL, $bar); $Categories->addById(3, 1, $gee); ?> My questions: Is it sensible to force TreeNode instances to be created through TreeNode::addById()? If it's so, would it be good practise to declare TreeNode::__construct() as private/protected?

    Read the article

  • Format form fields for bootstrap using rails+nokogiri

    - by user1116573
    I have the following in an initializer in a rails app that uses Twitter bootstrap so that it removes the div.field_with_errors that rails applies when validation fails on a field but also the initializer adds the help/validation text after the erroneous input field: require 'nokogiri' ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe form_fields = [ 'textarea', 'input', 'select' ] elements = Nokogiri::HTML::DocumentFragment.parse(html_tag).css("label, " + form_fields.join(', ')) elements.each do |e| if e.node_name.eql? 'label' html = %(#{e}).html_safe elsif form_fields.include? e.node_name if instance.error_message.kind_of?(Array) html = %(#{e}<span class="help-inline">&nbsp;#{instance.error_message.join(',')}</span>).html_safe else html = %(#{e}<span class="help-inline">&nbsp;#{instance.error_message}</span>).html_safe end end end html end This works fine but I also need to apply the .error class to the surrounding div.control-group for each error. My initializer currently gives the following output: <div class="control-group"> <label class="control-label" for="post_message">Message</label> <div class="controls"> <input id="post_message" name="post[message]" required="required" size="30" type="text" value="" /><span class="help-inline">&nbsp;can't be blank</span> </div> </div> but I need something adding to my initializer so that it adds the .error class to the div.control-group like so: <div class="control-group error"> <label class="control-label" for="post_message">Message</label> <div class="controls"> <input id="post_message" name="post[message]" required="required" size="30" type="text" value="" /><span class="help-inline">&nbsp;can't be blank</span> </div> </div> The solution will probably need to allow for the fact that each validation error could have more than one label and input that are all within the same div.control-group (eg radio buttons / checkboxes / 2 text fields side by side). I assume it needs some sort of e.at_xpath() to find the div.control-group parent and add the .error class to it but I'm not sure how to do this. Can anyone help? PS This may all be possible using the formtastic or simple_form gems but I'd rather just use my own html if possible. EDIT If I put e['class'] = 'foo' in the if e.node_name.eql? 'label' section then it applies the class to the label so I think I just need to find the parent tag of e and then apply an .error class to it but I can't figure out what the xpath would be to get from label to its div.control-group parent; no combination of dots, slashes or whatever seems to work but xpath isn't my strong point.

    Read the article

  • Is there a way to refactor this javascript/jquery?

    - by whyzee
    switch (options.effect) { case 'h-blinds-fadein': $('.child').each(function (i) { $(this).stop().css({opacity:0}).delay(100 * i).animate({ 'opacity': 1 }, { duration: options.speed, complete: (i !== r * c - 1) || function () { $(this).parent().replaceWith(prev); options.cp.bind('click',{effect: options.effect},options.ch); } }); }); break; case 'h-blinds-fadein-reverse': $('.child').each(function (i) { $(this).stop().css({opacity:0}).delay(100 * (r * c - i)).animate({ 'opacity': 1 }, { duration: options.speed, complete: (i !== 0) || function () { $(this).parent().replaceWith(prev); options.cp.bind('click',{effect: options.effect},options.ch); } }); }); break; ....more cases } I have alot of similiar other cases. One way i could think of is to write functions ? i'm not sure i'm still fairly new to the language

    Read the article

  • Is it weird or strange to make multiple WCF Calls to build a ViewModel before presenting it?

    - by Nate Bross
    Am I doing something wrong if I need code like this in a Controller? Should I be doing something differently? public ActionResult Details(int id) { var svc = new ServiceClient(); var model = new MyViewModel(); model.ObjectA = svc.GetObjectA(id); model.ObjectB = svc.GetObjectB(id); model.ObjectC = svc.GetObjectC(id); return View(model); } The reason I ask, is because I've got Linq-To-Sql on the back end and a WCF Service which exposes functionality through a set of DTOs which are NOT the Linq-To-Sql generated classes and thus do not have the parent/child properties; but in the detail view, I would like to see some of the parent/child data.

    Read the article

  • Can I attach a .NET TraceListener to an externally running process?

    - by BBlake
    I am developing an application scheduling program that will run other applications using System.Diagnostics.Process. The external applications are of various types (some .NET and some not). For those external apps that have trace logging enabled, is there a way that I can attach the tracelistener of the parent/calling application to listen to and record all the trace output from the child/called application to the parent application's trace output? This is not primarily for debugging purposes. This is more to track trace output from all the various scheduled applications by collecting it into one place as much as possible. The scheduler app is still in the early design stages, but will be .NET, and I'm trying to clear up potential design issues before I get into it too far.

    Read the article

  • Properly Repaint a Custom Control

    - by serhio
    I am doing a custom control, that should be painted like as standard one, but also having a Icon displayed near it. So, I jet overrided OnPaint like this: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) {     base.OnPaint(e);     e.Graphics.DrawIcon(theIcon, X1, Y1 - iconSize.Width / 2); } Now, everything is OK, but when my control moves, the icon still remains drawn on the ancient place. What should I add to manage it properly? In the image we can see that after moving from top to bottom the line(custom control) even is not properly redrawn. I tried to do public override void Invalidate() {     base.Invalidate();     if (Parent != null) {         Parent.Invalidate(new Rectangle( X1, Y1 - iconSize.Width / 2, iconSize.Width, iconSize.Height));     } } but this does not work - when changing location the Invalidate is not even called. If it matter the custom control inherits from VisualBasic.PowerPacks.LineShape component.

    Read the article

  • arboroaks.net/lakelandhills verse lakelandhillsatarboroaks.com , which is best for SEO?

    - by Roeland
    I am trying to decide what is the best way to approach a site I built with SEO in mind. The site has a parent site (sort of a splash page) (arboroaks.net) and the 3 children sites. Parent site is one page, and each of the 3 child sites is about 8-10pages. Right now I have the 3 child sites set up as folders under arboroaks.net. For example, lakelandhills, a child site, would be arboroaks.net/lakelandhills. I have the full domain, arboroaksatlakelandhills.com redirect to this url (arboroaks.net/lakelandhills). My question is whether I should have the child sites be contained on their own domain or not. Think lakelandhillsatarboroaks.com/about-us.php verse arboroaks.net/lakelandhills/about-us.php. The main reason is obviously for SEO consideration. Thanks!

    Read the article

  • Is MDI Form focused?

    - by Vercas
    I've had so much luck developing my application... until now. My application's main form is a MDI parent, and I didn't think of adding any MDI children in my tests until tonight. To my surprise, the MDI parent seems to never "get focus" now. The Focus event and the OnFocus method are never called! I mean... it appears focused but none of the in-code focusing events/methods work. Instead a MDI child reports the focus. How do I fix this?

    Read the article

  • How to make item view render rich (html) text in PyQt?

    - by Giorgio Gelardi
    I'm trying to translate code from this thread in python: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * __data__ = [ "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.", "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." ] def get_html_box(text): return '''<table border="0" width="100%"><tr width="100%" valign="top"> <td width="1%"><img src="softwarecenter.png"/></td> <td><table border="0" width="100%" height="100%"> <tr><td><b><a href="http://www.google.com">titolo</a></b></td></tr> <tr><td>{0}</td></tr><tr><td align="right">88/88/8888, 88:88</td></tr> </table></td></tr></table>'''.format(text) class HTMLDelegate(QStyledItemDelegate): def paint(self, painter, option, index): model = index.model() record = model.listdata[index.row()] doc = QTextDocument(self) doc.setHtml(get_html_box(record)) doc.setTextWidth(option.rect.width()) painter.save() ctx = QAbstractTextDocumentLayout.PaintContext() ctx.clip = QRectF(0, option.rect.top(), option.rect.width(), option.rect.height()) dl = doc.documentLayout() dl.draw(painter, ctx) painter.restore() def sizeHint(self, option, index): model = index.model() record = model.listdata[index.row()] doc = QTextDocument(self) doc.setHtml(get_html_box(record)) doc.setTextWidth(option.rect.width()) return QSize(doc.idealWidth(), doc.size().height()) class MyListModel(QAbstractListModel): def __init__(self, parent=None, *args): super(MyListModel, self).__init__(parent, *args) self.listdata = __data__ def rowCount(self, parent=QModelIndex()): return len(self.listdata) def data(self, index, role=Qt.DisplayRole): return index.isValid() and QVariant(self.listdata[index.row()]) or QVariant() class MyWindow(QWidget): def __init__(self, *args): super(MyWindow, self).__init__(*args) # listview self.lv = QListView() self.lv.setModel(MyListModel(self)) self.lv.setItemDelegate(HTMLDelegate(self)) self.lv.setResizeMode(QListView.Adjust) # layout layout = QVBoxLayout() layout.addWidget(self.lv) self.setLayout(layout) if __name__ == "__main__": app = QApplication(sys.argv) w = MyWindow() w.show() sys.exit(app.exec_()) Element's size and position are not calculated correctly I guess, perhaps because I haven't understand at all the style related parts from original code. Can someone help me?

    Read the article

  • iphone/ipad with 2 side by side tables

    - by jesse001
    I want to create a view with 2 tables side by side, where selecting the row on 1 table effects the content of the other and vice versa (not parent child). My problem is how to send the request. I started with a utility app using core data, and added 2 table view controllers. I added these to the main view nib and moved the tables to the view. One table controls a list from Core Data, then on selecting a row I want it to move to the other table which is based on a mutable array. On didselectrow I want to tell the other table to update, however I can only find samples that are parent/child so involves initializing. Does anyone know of a way to do this for an active view? Thanks heaps for your help.

    Read the article

  • Is there any way to get all the controls on a container control?

    - by Mason Wheeler
    I've got a form with a bunch of controls on it, and I wanted to iterate through all the controls on a certain panel and enable/disable them. I tried this: var component: TComponent; begin for component in myPanel do (component as TControl).Enabled := Value; end; But that did nothing. Turns out all components are in the form's component collection, not their parent object's. So does anyone know if there's any way to get all the controls inside a control? (Besides an ugly workaround like this, which is what I ended up having to do): var component: TComponent; begin for component in myPanel do if (component is TControl) and (TControl(component).parent = myPanel) then TControl(component).Enabled := Value; end; Someone please tell me there's a better way...

    Read the article

  • Replace the surround of an html element with another document

    - by KvanteTore
    I have an html page with (among other things) a Unity3D window. I would like to replace everything on the page without causing the Unity window to reload. I have tried the following jquery-tastic function replaceSurround(keepElem, newElem) { keepElem.siblings().remove(); keepElem.prepend(newElem.prevAll()); keepElem.append(newElem.nextAll()); var keepParent = keepElem.parent(); var newParent = newElem.parent(); if (keepParent && newParent) { replaceSurround(keepParent, newParent); } } where keepElem is an element in the original document and newElem is the corresponding element in the new document, but it did not work very well.

    Read the article

  • Using indentation to make CSS more readable? (making parents and children more identifiable in CSS)

    - by janoChen
    I've been always guiding myself with the following CSS structure: #nav { } #nav li { } #nac li a { } This structure tells me clearly who is the parent and the child. But in a recent article (I think it was CSS Trick) someone said that CSS is read from right to left. So the more tags I had the slower it will be (and sometimes I think its unnecessary to write every single tag involve in the selector). So it may be something like this: #nav { } #special-link { } where #special-link is #nav's child. I know this is not a big problem in a simple stylesheet but in a big one I always would get confused about who is who's parent and child. Another solution would be: #nav { } #special-link { } Indentation How do you solve with this CSS dilemma?

    Read the article

  • Model's method not being recognized when called

    - by Brian Roisentul
    I'm using ruby on rails 2.3.2 and also using the acts_as_taggable_on puglin. That generated me two db tables: tags and taggings. As I didn't need anything more from those, I didn't create a Tag model, for example. Now the project is more mature, I need to create some methods for tags, so I created a Tag model with some methods in it. The model looks something like this: class Tag < ActiveRecord::Base def self.get_parent parent = Tag.find(self.parent_id) return parent end end When I call it from a controller, it won't find the method. This is the code: tag = Tag.find(tag_id) the_parent = tag.get_parent This will throw an error saying: undefined method `get_parent' for #<Tag id: 13, name: "Historia", parent_id: 12> I don't know what's wrong. Any help will be appreciated.

    Read the article

  • What jquery based table plugin can hide sub rows?

    - by user1458290
    I'm in the need to convert excel macros into jquery code, the function is that you need to click on the plus sign to unfold and show the sub rows to modify column2 if you want to type values in column2, the other columns can't be modified. You can't straightly modify values of column2 until you unfold the parent row, because there are many sub rows belonging to parent row,say Car. The values of Name, Model, Code are existing, they are master data, no need to type or modify. please see the snapshot at folded and unfolded, besides modifying values in sub rows , I need to be able to know which sub rows are modified and values of those rows.Initially the editable columns are blank. And when you click on the minus sign, the sub rows can be folded again,but the modified values won't be lost,they are still there when unfolded again. One last requirement is it's cross devices, the code must run well on pc,mobile phone,pad. Is that possible? Many thanks.

    Read the article

  • Condor job using DAG with some jobs needing to run the same host

    - by gurney alex
    I have a computation task which is split in several individual program executions, with dependencies. I'm using Condor 7 as task scheduler (with the Vanilla Universe, due do constraints on the programs beyond my reach, so no checkpointing is involved), so DAG looks like a natural solution. However some of the programs need to run on the same host. I could not find a reference on how to do this in the Condor manuals. Example DAG file: JOB A A.condor JOB B B.condor JOB C C.condor JOB D D.condor PARENT A CHILD B C PARENT B C CHILD D I need to express that B and D need to be run on the same computer node, without breaking the parallel execution of B and C. Thanks for your help.

    Read the article

  • Java Custom exception throw behaves differently between different Projects

    - by Pablo
    I am attempting to call the following in my code: public void checkParticleLightRestriction(Particle parent) throws LightException { if ( parent == null ) { throw new LightException("quantum-particle-restrict.23", this); } In one Project the exception is thrown and the effect is similar to calling "return" whereby I am returned back to the point immediately succeeding where this method was called. However in another Project I get thrown completed out of the current package and to a point way prior to the point preceeding this method. It likes instead of being kicked out of a bar I am being deported all the way out of the country. My option are the wrap the throw in a try / catch but I am wondering why this difference in behaviour beween the 2 projects ?

    Read the article

  • [JS] How to manipulate a PHP Array in javascript?

    - by rasouza
    I have an Array in PHP which contains data from database. And it prints out also as a table in the same page which has an AJAX delete function. Trying to explain better The array contains debt sums related to many people, it is the application's main function. In the same page, there is a table containing every debt record related to the array, which can be deleted or edited using AJAX. I have coded the part of deleting the record and removing the TR entry, but it's not enough: I'd like to change also the debt sum using AJAX which is an PHP Array. What I have I have the JS function which removes the TR when the delete button is clicked // TR Fading when deleted $('.delete') .click(function() { $.ajax({ type: 'GET', url: 'history/delete/id/'+$(this).attr('id') }); $(this).parent().parent().fadeOut(); return false; }); and I have the PHP array (image)

    Read the article

  • C++: How to use types that have not been defined?

    - by Jen
    C++ requires all types to be defined before they can be used, which makes it important to include header files in the right order. Fine. But what about my situation: Bunny.h: class Bunny { ... private: Reference<Bunny> parent; } The compiler complains, because technically Bunny has not been completely defined at the point where I use it in its own class definition. This is not sufficient: class Bunny; class Bunny { ... private: Reference<Bunny> parent; } Apart from re-writing my template class Reference so it takes a pointer type (in which case I can use the forward declaration of Bunny), I don't know how to solve this. Any suggestions?

    Read the article

  • Rails object inheritence with belongs_to

    - by Rabbott
    I have a simple has_many/belongs_to relationship between Report and Chart. The issue I'm having is that my Chart model is a parent that has children. So in my Report model I have class Report < ActiveRecord::Base has_many :charts end And my Chart model is a parent, where Pie, Line, Bar all inherit from Chart. I'm not sure where the belongs_to :report belongs within the chart model, or children of chart model. I get errors when I attempt to access chart.report because the object is of type "Class" undefined local variable or method `report' for #< Class:0x104974b90 The Chart model uses STI so its pulling say.. 'Pie' from the chart_type column in the charts table.. what am I missing?

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >