Search Results

Search found 3471 results on 139 pages for 'docs'.

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

  • How to create a nested form in backbone relational?

    - by jebek
    I would like to be able to create nested models at the same time in backbone. I know how to use backbone relational to create the parent model. Then once it is saved, I can create child models through backbone relational. However, I want to be able to create both the parent and child models at the same time, which might not be possible because I can only create the child model once the parent model has already been created. For example, let's say I was creating a forum like the one from the awesome backbone relational tutorial - http://antoviaque.org/docs/tutorials/backbone-relational-tutorial/. I would want to create a thread and a message at the same time(through the click of a single button) rather than create a thread then a message. Is this possible? Is there a better way of doing this that I'm not thinking of?

    Read the article

  • Resizing uploaded images based on a maximum width in django (PIL)

    - by AndrewE
    I'm working on a simple message board app in Django that lets people upload images to be displayed in their posts. Since the div containing the posts is only 700px, I want to resize the uploaded images to a max width of something like 680px to save space rather than using css to display an image that's too large within the space constraints. I've been searching this site, google and the PIL docs for a while and haven't found any way of resizing an image on one dimension while maintaining the original aspect ratio. Given my inexperience, it's possible that I'm just not recognizing a solution that's plain to someone who knows what to look for.

    Read the article

  • How to debug PHP with netbeans and Xdebug

    - by Jon Winstanley
    I have recently tried to get going with Netbeans 6.5 after it rated so highly in the IDE review by Smashing magazine. http://www.smashingmagazine.com/2009/02/11/the-big-php-ides-test-why-use-oneand-which-to-choose/ My main reason for switching from Notepad++ is that I'd like to be able to debug my code and set through it. I have followed the instructions about how to install xdebug from both the vendor http://xdebug.org/ and the netbeans web site. http://www.netbeans.org/kb/docs/php/debugging.html#gettingReady but to no avail. How is it done, has anyone else got debugging working in netbeans? (My setup is: Windows XP, Wamp server 2.0, PHP 5, Netbeans 6.5.1)

    Read the article

  • Prototype - DOM Traversal with up()

    - by Jason McCreary
    I have the following structure: <form> <div class="content"> ... </div> <div class="action"> <p>Select <a class="select_all" href="?select=1" title="Select All">All</a></p> </div> </form> I am using Prototype's up() to traverse the DOM in order to find the <form> element in respect to the a.select_all. However the following doesn't work: select_link.up('form'); // returns undefined Yet, this does. select_link.up().up().up(); // returns HTMLFormElement Clearly this is an ancestor of a.select_all. The API Docs state Element.up() supports a CSSRule. What am I missing here?

    Read the article

  • Adding custom fields to users in django

    - by Gaurav
    I am the create_user() function that Django provides to create my users. Also I want to store additional information about the users. So I tried following the instructions given at http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users but I cannot get it to work for me. Is there a step-by-step guide that I can follow to get this to work for me? Also, once I have added these custom fields, I would obviously need to add / edit / delete data from them. I cannot seem to find any instructions on how to do this.

    Read the article

  • Drawing with GDI+ under IIS

    - by Zac
    I'm running a web application under IIS that we draw graphs with that are sent to the clients. We were previously running under iis6, while migrating to 2008 ( iis7 ) we have encountered some very weird issues with the graphing. I stumbled across the msdn docs for GDI+ stating that "GDI+ functions and classes are not supported for use within a Windows service." I suspect that my issues are probably related to further isolation of services http://msdn.microsoft.com/en-us/library/ms533798%28VS.85%29.aspx My question is how the heck are we supposed to draw graphics? Raw GDI? OpenGL - but doesn't that still require a DC?

    Read the article

  • When is NSEnumerator finished?

    - by samfu_1
    How do we know when enumeration is finished? The docs say: the return value of nextObject is nil when all objects have been enumerated. I was hoping to implement some "delegate-like" behavior whereby ... if (nextObject == nil) { do something because we're done! } But I see there is no such thing as: enumerationDidFinish: where in the following block could I check for the enumerator to be complete? NSArray *anArray = // ... ; NSEnumerator *enumerator = [anArray objectEnumerator]; id object; while ((object = [enumerator nextObject])) { // do something with object... }

    Read the article

  • How to save to two tables using one SQLAlchemy model

    - by Oatman
    I have an SQLAlchemy ORM class, linked to MySQL, which works great at saving the data I need down to the underlying table. However, I would like to also save the identical data to a second archive table. Here's some psudocode to try and explain what I mean my_data = Data() #An ORM Class my_data.name = "foo" #This saves just to the 'data' table session.add(my_data) #This will save it to the identical 'backup_data' table my_data_archive = my_data my_data_archive.__tablename__ = 'backup_data' session.add(my_data_archive) #And commits them both session.commit() Just a heads up, I am not interested in mapping a class to a JOIN, as in: http://www.sqlalchemy.org/docs/05/mappers.html#mapping-a-class-against-multiple-tables

    Read the article

  • Django template Path

    - by user74283
    Hi I m following the tutorial on http://docs.djangoproject.com/en/dev/intro/tutorial02/#intro-tutorial02 in windows 7 envoirement. my settings file is TEMPLATE_DIRS = ( 'C:/django-project/myapp/mytemplates/admin' ) i got the base_template from the template admin/base_site.html from within the default Django admin template directory in the source code of Django itself (django/contrib/admin/templates) into an admin subdirectory of myapp directory as the tutorial instructed. It doesn't seem to take affect for some reason. Any clue of what might be the problem? Do i have to do a sync db ?

    Read the article

  • Deploy PHP website to client server without showing PHP files

    - by ColmF
    I asked a recent question regarding the use of readfile() for remotely executing PHP, but maybe I'd be better off setting out the problem to see if I'm thinking the wrong way about things, so here goes: I have a PHP website that requires users to login, includes lots of forms, database connections and makes use of $_SESSION variables to keep track of various things I have a potential client who would like to use the functionality of my website, but on their own server, controlled by them. They would probably want to restyle the website using content and CSS files local to their server, but that's a problem for later I don't want to show them my PHP code, since that's the value of what I'd be providing. I had thought to do this with calls to include() from the client's server to mine, which at least keeps variable scope intact, but many sites (and the PHP docs) seem to recommend readfile(), file_get_contents() or similar. Ideally I'd like to have a simple wrapper file on the client's server for each "real" one on my server. Any suggestions as to how I might accomplish what I need? Thanks, ColmF

    Read the article

  • Exception and Inheritance in JAVA

    - by user1759950
    Suppose we have this problem public class Father{ public void method1(){...} } public class Child1 extends Father{ public void method1() throws Exception{ super.method1(); ... } } Child1 extends Father and override method1 but given implementation Child1.method1 now throws a exception, this wont compile as override method can't throw new exceptions. What is the best solution? Propagate the required exception to the Father.. to me this is against encapsulation, inheritance and general OOP ( the father potentially throw and exception that will never happen ) Use a RuntimeException instead? This solution wont propagate the Exception to the father but I read In Oracle docs and others sources states class of exceptions should be used when "Client code cannot do anything" this is not that case, this exception will b useful to recover blablabla ( why is wrong to use RuntimeException instead? ) Other.. thanks, Federico

    Read the article

  • Integrate Facebook Like button in website... With comments option

    - by Sebien
    Hello, Please see: http://developers.facebook.com/docs/reference/plugins/like I successfully integrated a [Like] button in my website using this link. On the developers website, when I click the [Like] button, a popup appears telling this: You like this. Share it on Facebook with a comment... [ ] [Post to Facebook] [Cancel] On my website, there is no such popup. I tested both iframe and FBML versions. Does anyone has a solution, or is this feature only reserved for www.facebook.com ? Thanks.

    Read the article

  • How do I use python wx:Config to access the Windows registry?

    - by GreenAsJade
    I've read http://wxpython.org/docs/api/wx.ConfigBase-class.html I've done some basic things like the appended. What I can see is that Config.Create() returns me some sort of configuration object, which has information about python in it. But clearly that's not what I'm looking for: I seem to be missing the magic to say "give me a Config that is the Windows Registry"... Thanks! GaJ import wx from wx import Config app=wx.App(False) config=Config.Create() config.HasGroup("HKEY_CURRENT_USER") False config.GetFirstEntry() (0, u'', -1) config.GetFirstGroup() (1, u'PythonCore', 1) config.GetNextGroup(1) (0, u'', -1) config.GetNumberOfGroups() 1 config.GetPath() u'' config.HasEntry("PythonCore") False config.GetFirstGroup() (1, u'PythonCore', 1)

    Read the article

  • Sqlalchemy: Many to Many relationship error

    - by 1001010101
    Dear everyone, I am following the Many to many relationship described on http://www.sqlalchemy.org/docs/mappers.html#many-to-many #This is actually a VIEW tb_mapping_uGroups_uProducts = Table( 'mapping_uGroups_uProducts', metadata, Column('upID', Integer, ForeignKey('uProductsInfo.upID')), Column('ugID', Integer, ForeignKey('uGroupsInfo.ugID')) ) tb_uProducts = Table( 'uProductsInfo', metadata, Column('upID', Integer, primary_key=True) ) mapper( UnifiedProduct, tb_uProducts) tb_uGroupsInfo = Table( 'uGroupsInfo', metadata, Column('ugID', Integer, primary_key=True) ) mapper( UnifiedGroup, tb_uGroupsInfo, properties={ 'unifiedProducts': relation(UnifiedProduct, secondary=tb_mapping_uGroups_uProducts, backref="unifiedGroups") }) where the relationship between uProduct and uGroup are N:M. When I run the following sess.query(UnifiedProduct).join(UnifiedGroup).distinct()[:10] I am getting the error: sqlalchemy.exc.ArgumentError: Can't find any foreign key relationships between 'uProductsInfo' and 'uGroupsInfo' What am I doing wrong?

    Read the article

  • simple JQuery example is causing me troubles for unknown reason

    - by cerr
    I'm relatively new to JQuery and would like to try something. I just followed a simple tutorial to start up with on http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery So I specified my script in the : <script type="text/javascript"> $(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); </script> and included a test link in the : <a href="">Link</a> however, when I refresh thet document my browser keeps saying TypeError: Property '$' of object [object Window] is not a function which I can understand for "normal" JavaScript but I believe this kind of function is new in JQuery. Can someone assist mer here, please? links:http://wittmerperformance.com/site/

    Read the article

  • How to define a new type (class) in Python using C API?

    - by ~mech
    Hi, I am trying to use the Python C API to define a new class inside a module that would expose certain functionality written in C to Python code. I specifically want to have it in the form of a class and not a set of module functions. However, I can't find anything regarding this particular task in the official documentation. The closest I could find is PyClass_New function (in the Python.h header) but it is not mentioned anywhere in the official docs, so I assume it is not supposed to be used. So, what is the proper way to define a new Python class from C code? Thanks.

    Read the article

  • Getting local My Documents folder path

    - by smsrecv
    In my C++/WinAPI application I get the My Documents folder path using this code: wchar_t path[MAX_PATH]; SHGetFolderPathW(NULL,CSIDL_PERSONAL,NULL,SHGFP_TYPE_CURRENT,path); One of the users runs my program on a pc connected to his corporate network. He has the My Documents folder on a network. So my code returns something like \paq\user.name$\My Documents Though he says he has a local copy of My Documents. The problem is that when he 'swaps VPN', the online My Documents becomes unavailable and my program crashes with the system error code 64 "The specified network name is no longer available" ( it tries to write to the file opened in the online my docs folder). How can I always get the local My Documents folder path using C++/WinAPI?

    Read the article

  • Getting the hang of CodeIgniter - Templating / loading views

    - by kilrizzy
    Attempting to learn CI and going through the docs to get a better understanding. Without getting a separate library, I could make a template by including a list of views like so: $this->load->view('header'); $this->load->view('navigation'); $this->load->view('sidenav_open'); $this->load->view('blocks/userinfo'); $this->load->view('blocks/stats'); $this->load->view('sidenav_close'); $this->load->view('content',$data); $this->load->view('footer'); This makes sense but would I actually have that on each of my controllers (pages)? Not sure if there is a way to include this in the initial controller (welcome) and then in the others somehow reference it? Or perhaps there is something I am missing completely

    Read the article

  • How does LocationManager work

    - by user2511882
    I have been going through the google docs for the locationManager API and specifically over the method locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000, 10, this); In the above line, the manager will check for location updates after each minute and distance of 10 meters. My question is does it actually take both the parameters into consideration? For example if you are driving along how will the method work? Will it start looking for updated locations since you are over the minimum distance between the two updates or will it wait for a minute irrespective? If someone can tell me its behavior, it would be great. Thanks.!!

    Read the article

  • Set the thumbImage and watch the slider-bar disappear?

    - by Roberta
    [sld1 setThumbImage:[UIImage imageNamed:@"Blue.png"] forState:UIControlStateHighlighted]; [sld1 setThumbImage:[UIImage imageNamed:@"Blue.png"] forState:UIControlStateNormal ]; Would that cause the slider-bar image to disappear? Mine are all gone. (The thumb-image displays just fine.) Apple's docs make it sounds like I can use any ONE of above 2 lines of code. (But I guess I really need both.) And I can't find anything about "you must always do all 4": Set the normal-state image. Set the highlighted-state image. Set the setMinimumTrackImage. Set the setMaximumTrackImage.

    Read the article

  • PHP, MySQL - can you distinguish between rows matched and rows affected?

    - by Renesis
    I am trying to write a PHP-MySQL database processor that is somewhat intelligent. When this processor decides it needs to make an update, I want to report if it was really successful or not. I thought I could use mysql_affected_rows... // Example: // After running query "UPDATE mytable SET name='Test' WHERE ID=1" $result = mysql_affected_rows(); if ($result >= 1) { /* Success */ } If, for example, there was no row with ID=1, then $result would be 0. However, it turns out that PHP's mysql_affected_rows is the actual affected rows, and may be still be 0 if the row exists but name was already "Test". (The PHP docs even say this is the case). If I run this in the command line, I get the following meta information about the query: Query OK, 0 rows affected (0.01 sec) Rows matched: 1 Changed: 0 Warnings: 0 Is there any way for me to get that "Rows matched" value in PHP instead of the affected rows?

    Read the article

  • Using AJAX to return SelectList selected value

    - by Adventure
    At risk of asking the obvious... I need to use AJax.ActionLink to send the current value of a SelectList back to my controller. How do I do that? Below is part of my current View. I need to replace "15" with the current value of the SelectList. <% If Model.ShoppingListNames IsNot Nothing Then%> <%: Html.DropDownList("ShoppingListNames", Model.ShoppingListNames)%> <%: Ajax.ActionLink("Add to List", "AdjustMaterials", "Docs", New With {.userDocId = 15, .prodId = Model.ID, .quantity = 1}, New AjaxOptions With {.OnSuccess = "handleUpdate"})%> <% End If%>

    Read the article

  • will destroyed() be emitted if the constructor of a class derived from QObject throws?

    - by PorkyBrain
    Ive seen Qt GUI syntax like the following all over the place: myDialog::myDialog(QWidget *parent, Qt::WFlags flags):QDialog(parent, flags) { QPushButton *button = new QPushButton("&Download", this); QVBoxLayout *layout = new QVBoxLayout(this); //something that can throw here layout ->addWidget(button ); setLayout(layout); } I've always wondered if this can leak in the event of an exception because the "this" I'm giving as a parent to button and layout is not fully constructed so it might not destroy its children. I tried it out in MSVC2010 Qt4.8.3 and it looks like as soon as the base QObject class is fully created (which is done first of course) it is ok to pass "this" to other objects in the constructor, they will destroyed correctly. I haven't found the spot in the Qt docs guaranteeing this though, can someone point me to it so I have assurance that this will not change in the future?

    Read the article

  • how does [<Literal>] differ from other constants in F#

    - by Mitzh
    I am a bit confused by the Literal keyword and why it is necessary in F#. Reading the docs, it sounds to me that [<Literal>] is used to define a constant, however I am a bit confused how this constant differs from all other constants in F#.. Values that are intended to be constants can be marked with the Literal attribute. This attribute has the effect of causing a value to be compiled as a constant. When I think of a constant, I think of something which is immutable.... let x = "a" + "b" //this is a immutable value, its value is constant [<Literal>] let y = "a" + "b" //this is also a immutable value, but why is this a special constant? Is it because the 'normal' F# values are evaluated lazily and the [<Literal>] is not evaluated lazily..? is that what they mean with 'compiled as constant'..? or is there something else to it?

    Read the article

  • In Blackberry's Application class what is the difference between hasEventThread() and isHandlingEven

    - by Eric Sniff
    In Blackberry's Application class what is the difference between hasEventThread() and isHandlingEvents(). I'm just curious, because I have only found hasEventThread useful. From BB's docs for Applicaiton: public boolean hasEventThread() Determines if this application has entered the event dispatcher. Returns: True if this application has entered the event dispatcher (i.e. has invoked Application.enterEventDispatcher()); otherwise, false. isHandlingEvents public final boolean isHandlingEvents() Determines if this application has entered the event dispatch loop. Returns: True if the application has entered the event dispatch loop; otherwise, false. My only guess is that isHandlingEvents most happen sometime after hasEventThread. But is that really that useful?

    Read the article

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