w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Umbraco - Contour - Saving a multi part form
Here is a link to the discussion on this topic on the forum. https://our.umbraco.org/forum/umbraco-pro/contour/44630-Contour-Saving-a-multi-part-form-for-later-editing To answer your questions, yes it can be achieved in Contour ("relatively easy" and "extensive coding" would depend upon your perspective and experience). I hope you find the information useful. Edit your question after reviewing the link and I will see if I can answer any more specific inquiries.

Categories : Forms

In Umbraco 6.1.1 MVC 4, how can I do a form post back to a surface controller using a model that inherits from Umbraco's RenderModel?
Ok, I've had no responses to this question but am now in a position to answer it myself. Maybe it was a fundamental oversight, but not that obvious imho, and information on the Umbraco forum etc about inheriting from RenderModel is fairly limited. Essentially the answer, as was my first instinct, is to solve the original exception "No parameterless constructor defined for this object" by providing a paramaterless constructor. The difficulty is working out what to put inside the parameterless constructor for my model, since it inherits from the Umbraco RenderModel which requires an IPublishedContent instance passed to it's constructor. Luckily while browsing around I happened across this post on the Umbraco forum: http://our.umbraco.org/forum/developers/api-questions/40754-Getting-Curre

Categories : Asp Net Mvc

Umbraco not rendering IE box shadows
I'm guessing the link to your css is relative or something, it's got absolutely nothing to do with umbraco - you have full control over the html. Perhaps paste a link to your website or your html code. also for cross browser drop shadows you need something like this -moz-box-shadow: 3px 3px 4px #444; -webkit-box-shadow: 3px 3px 4px #444; box-shadow: 3px 3px 4px #444; -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#444444')"; filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#444444');

Categories : HTML

Image rendering in umbraco
So when it doesn't display the images does it not display the whole <li> element? From the piece of code you've given there's nothing there about different logic for the different languages. What if in your XSL template you remove this whole chunk of code and just take it back to basics. <li>test</li> I suspect that the language choice is messing something else up somewhere else in the page. Just try simplifying the page one step at a time by removing the Macros.

Categories : Asp Net

rendering html content from umbraco
The information that you receive from your program is in the JSON format whereas with Firefox you are receiving it in the XML format. If you read the documentation on umbraco, which I have not used, there is most likely a parameter you can add to the GET URL to ask for either JSON or XML.

Categories : C#

Python: find contour lines from matplotlib.pyplot.contour()
You can get the vertices back by looping over collections and paths and using the iter_segments() method of matplotlib.path.Path. Here's a function that returns the vertices as a set of nested lists of contour lines, contour sections and arrays of x,y vertices: import numpy as np def get_contour_verts(cn): contours = [] # for each contour line for cc in cn.collections: paths = [] # for each separate section of the contour line for pp in cc.get_paths(): xy = [] # for each segment of that section for vv in pp.iter_segments(): xy.append(vv[0]) paths.append(np.vstack(xy)) contours.append(paths) return contours Edit: It's also possible to compute the contours without plotting

Categories : Python

Building a contact form in Umbraco 6
In this scenario, instead of rendering as a child action: @Html.Action("ContactForm","ContactFormSurface") you should render the view as a partial view: @Html.Partial("ContactFormSurface/ContactForm") ... pointing to where the view is located.

Categories : C#

How to add a single new contour to a contour plot in Lattice
Load the latticeExtra library. Then: Part1<-contourplot( Male ~ Year * Age, data=this.ds, region=T, col.regions=rev(heat.colors(200)), cuts=50, main="", sep="") Part2<-contourplot( Male ~ Year * Age, data=this.ds, region=F, labels=F, lwd=2, at=c(0, 0.01, 1)) Plot.Final<-Part1+Part2 That should combine the graphs as you wish. If needed you may need to set xlim, ylim and labels so that everything looks OK.

Categories : R

Exception raised during rendering: Circular dependencies cannot exist in RelativeLayout Exception details are logged in Window > Show View > Error Log
The problem is caused because there is a circular reference is the layout parameters. For example when view B is layout_below View A, view A can't reference view B anymore in it's below, alignRight etc. This can also exist between multiple views: A references B references C. In that scenario C can't reference A because of a circular dependency. You'll need to evaluate the references again. Does it give you a line number? Edit: When I remove these 2 from android:id="@+id/generate_seviye" it works: android:layout_above="@+id/generatetv1" android:layout_alignRight="@+id/destekimg" But you probable need to do some fixing of the layout and check the references. @+id/view2 has: android:layout_alignBottom="@+id/generatetv1" android:layout_alignTop="@+id/generatetv1" Which seems wrong

Categories : Java

Umbraco MVC Implementation - View does not depend on Umbraco implementations
No you can't. Simply because all requests pass through a single action. In order to retrieve a path to a CMS-managed page, you need to use the node/content traversal the @Model provides. See here for more details on this. Edit To clarify, the author of the article is suggesting that the Umbraco implementation should be more in line with a traditional MVC implementation with little or no logic in the views. Therefore, any querying of node data should happen prior to the view (e.g. in the Mappers). So this is where you would have to retrieve the links. Umbraco's default MVC implementation forces all requests to go via a single action on a single controller. The author's implementation allows the requests to be shared across one controller per document type - which is better IMO. But it st

Categories : Asp Net Mvc

Manipulation of data to form suitable for contour plotting
z is in a wrong format. The easiest way is to make a data.frame containing one row for each observation. my.data.frame <- expand.grid(x = 1:15, y = 1:14) my.data.frame$z <- with(my.data.frame, x ^2 + x + x * y + y ^ 2 + y) library(lattice) contourplot(z ~ x * y, data = my.data.frame)

Categories : R

Umbraco MediaService / Umbraco MediaItem not saving
To Save media, I found this method with MediaService. However, I think it's possible another method more refined [HttpPost] public JsonResult Upload(HttpPostedFileBase file) { IMedia mimage; // Create the media item mimage = _mediaService.CreateMedia(file.FileName, <parentId>, Constants.Conventions.MediaTypes.Image); mimage.SetValue(Constants.Conventions.Media.File, file); _mediaService.Save(mimage); return Json(new { success = true}); }

Categories : C#

Umbraco - error when using umbraco.library:NiceUrl(...)
Ok I found a solution: I added an extra check to this part: <!-- Return the url --> <xsl:if test="$i = $max"> <xsl:if test="$id != '' "> <xsl:value-of select="umbraco.library:NiceUrl($id)" /> </xsl:if> </xsl:if> this fixed my problem.

Categories : Xslt

Could not locate Razor Host Factory type: umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines
If you are trying to host the blogengine site within a virtual directory of the Umbraco site, then you will have to amend the blogengine web.config to "remove" all the Umbraco-specific handlers and modules, as these will be inherited by the blogengine application, causing this exception because the application can't find the relevant DLLs in its bin folder. I recently had a similar problem and I have posted the web.config I used in the virtual directory below. Mine was a very simple web application, so obviously this will not work by itself in your blogengine app. You will need to add the relevant parts into your web.config file. Also, this was for a v6 Umbraco install in IIS7.5, so you may have to experiment a little. <?xml version="1.0"?> <configuration> <configSecti

Categories : Iis

getting NPE exception on rendering of page
was just looking into webflow problems,and even if it is not your main concern, i may have found a partial explanation for the when your bug occurs and when not. The "on-entry" expression code is only executed when this view-state is accessed from the webflow logic, and is not if you access this flow state from a refresh or direct access to a previously rendered view (by typing directly in url .... = e1s5 for e.g.) It does not solve your problem but i think it could explain the conditions of its reproduction. Your actions are always leading to an unhandled error (to investigate in your java code), but your actions are not always executed. You could check on that by moving your actions to an "on-render" section instead, and then your error should show up every time you acces this view,

Categories : Spring

Symfony, error: An exception has been thrown during the rendering
In FooBlogBundle:Article:articles.html.twig template you have something like {{ path(FlickBlogBundle_articles) }} (can not tell exactly because I do not see a template). This route requires additional parameter id. So change it to {{ path(FlickBlogBundle_articles, {'id':article.id}) }}

Categories : Symfony2

Form rendering in object's method
You are not echoing out the contents (like you are in your test). Do either public function index(){ echo $this->view->showForm(); } or public function showForm(){ echo '<form method="post"> <h3>Shipping Information</h3> <p> <label for="name"> Title Name </label> <input type="text" id="name" name="Title" autofocus> </p> <p> <button type = "submit"> Save </button> </p> </form>'; } // end of showForm() Frankly, I would not make View_Shipping a class. Just make it a standard php file

Categories : PHP

Django Form not rendering in template
Any error page or just blank page? Actually I just try your code and get form rendering correct(I don't know how to insert local result image here) Please make sure DEBUG=TRUE in settings.py while it's not the problem. @Burhan I think indent problem only happens because he edits it in stackoverflow. Btw, your form doesn't have a submit button, maybe add it in html like

Categories : Python

Django "Instance" Form Fields Not Rendering
Form.fields holds the fields themselves, what you want for rendering are the BounFields that you can get directly from the form itself, ie: def iter_email(self): for k in sorted(self.fields.keys()): if k.startswith('email_'): yield self[k]

Categories : Python

CakePHP Form Validation rendering error
Go there http://diveintohtml5.info/forms.html and scroll down to form validation. This is HTML5 built in form validation for the browser you're using, inspect the input element. Honestly I'm not sure if you can style them different but to me it looks like the browser is doing this by adding some markup and CSS to the DOM tree that might conflict with whatever else you have there. I personally haven't had the case before. Knowing your markup and CSS might help by the way.

Categories : Validation

Rendering Error Messages in Rails Form with Javascript
You might look into using toastr for displaying javascript notifications. Here's an SO question I answered before that may help set it up: Rails 4 - Toaster notifications rather than flash notifications -- you would just need to make your flash notification be flash.now[:toastr] and then be sure to call the initializer for that in the JS returned by the AJAX request.

Categories : Javascript

Symfony2 form: repated type and his rendering in twig
The labels are appearing twice as a result of outputting the password controls using form_row() rather than form_widget(). The form_row() method outputs the field errors, label and widget all in one go. If you want to output the field errors yourself you can use e.g. form_errors(form.password.first).

Categories : Forms

TextBox not displayed when rendering form with Html.BeginForm
It turns out that for the correct form you need only the following. The controller for the create method can be like this: public ActionResult Create() { return View(); } My working view looks like this, your fields of course will be slightly different: @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <fieldset> <legend>Book</legend> <div class="editor-label"> @Html.LabelFor(model => model.Author) </div> <div class="editor-field"> @Html.EditorFor(model => model.Author) @Html.ValidationMessageFor(model => model.Author) </div> <div class="editor-label"> @Html.LabelF

Categories : C#

Active Admin has_many through table not rendering in form - have tried everything
I added this to my ActiveAdmin.register Content do page f.input :subcategory, :as => :check_boxes, :collection => Subcategory.all Now all of the subcategories are showing in Active Admin page as check boxes. However, if anyone has advice as to how to make them appear as the subcategories names vs. ids, please let me know. Thank Fivell for the lead!

Categories : Ruby On Rails

Rendering individual fields in template in a custom form
{{ form.fieldname }} will render only the field widget by its name. Check out Customizing the form template.

Categories : Django

Defining custom twig form block for errors rendering
Actually it works by defining the block text_errors or textarea_errors only and still use {{ form_errors(field.name) }} in your template. If a block named after the type of your field exists (according to form field types) it will be used instead of form_errors. !! But you can't use directly {{ text_errors(field.name) }} in your twig template !! The same way you can have a custom row for a specific type like this {% block textarea_row %}{% spaceless %} <div class="textarea l-field {{ (form_errors(form)?'error':'') }}"> {{ form_label(form) }} {{ form_widget(form) }} {{ form_errors(form) }} </div> {% endspaceless %}{% endblock textarea_row %} and use it in your template as follow : {# message has textarea field type #} {{ form_row(form.

Categories : Symfony2

Drupal 7 - Rendering Exposed Form Elements as Icons via Custom Module, outputting string instead of html
I decided to pull this off using jQuery, as achieving the desired affect using a custom module was not pragmatic and may have, in fact, been overkill. Following is the poorly refactored but working code which got me there: (function($) { $(document).ready(function(){ var link = '<a href="http://project.local/blog-posts?field_blog_post_type_tid=', id = '#edit-field-blog-post-type-tid-'; $(id + 'all').html(link + 'All"><span class="icon-container"><i class="icon-undo"></i></span></a>'); $(id + '3').html(link + '3"><span class="icon-container"><i class="icon-music"></i></span></a>'); $(id + '2').html(link + '2"><span class="icon-container"><i class="icon-camera"></i></sp

Categories : Drupal

Rendering openGL texture: Class function causes rendering to fail
I did see your mistake within one second. So you didn't waste anyone's time (except your own ;) ). Anyway doing it like this: void CControl::RenderChildren() { for( int i = 0; i < Children.size(); i++ ) { Children[i]->X(Children[i]->X()+_X); //offset child _X with parent's _X Children[i]->Y(Children[i]->Y()+_Y); //offset child _Y with parent's _Y Children[i]->OnRender(); Children[i]->X(Children[i]->X()-_X); Children[i]->Y(Children[i]->Y()-_Y); } } is not optimal. In your case you're using integers where you're experiencing any problems. But say at one point you decide to use floats: The problem is, that every operation happening on floating point numbers creates round off error. Doing it iteratively (li

Categories : C++

return to form on occurance of exception
Simply don't catch the exception anywhere, except in your form.... void FunctionInForm() { try { LogicLayer.DoStuff(); //This function and any function it calls should not handle exceptions } catch { //an exception occured, and you are back in your form } }

Categories : C#

C# transmit exception from class to Form
Why would ThreadSafeLog be concerned with what the form that uses it is doing? How is it even supposed to know it's being used by a form? Catch the exception in the form instead. class ThreadSafeLog { public ThreadSafeLog() { if (!File.Exists(Path_)) { using (File.Create(Path_)) { } } } } Form: try { ThreadSafeLog log = new ThreadSafeLog( @"R:projectThreadSafeLogThreadSafeLogTestThreadSafeLogTestin"); } catch (Exception ex) { MessageBox.Show(e.Message); } Though, as Adriano points out, you may also want to question why you're displaying internal error details directly to users.

Categories : C#

Simple Contour map
The problem of plotting a 3D surface using only a small sample of unequally spaced lat/long points and a height z (or equivalent) variable is non-trivial -- you have to estimate the values of z for all of the lat-long grid coordinates you do not have, for example using loess() or kriging to create a smooth surface. Take a look at Methods for doing heatmaps, level / contour plots, and hexagonal binning, case #5. For a geoR example see http://www4.stat.ncsu.edu/~reich/CUSP/Ordinary_Kriging_in_R.pdf

Categories : R

work with form in mvc and error null exception
@using (Html.BeginForm("send", "default", FormMethod.Post)) { <input type="text" id="txtNumber" /> <button type="submit" name="btn" value="btn1">submit 1</button> <button type="submit" name="btn" value="btn2">submit 2</button> } and then: [HttpPost] public HtmlString send(FormCollection frm) { string _data = frm["txtNumber"]; string btn = frm["btn"]; if (btn == "btn1") { // submit 1 was clicked } else { // submit 2 was clicked } return new HtmlString(_data); }

Categories : Asp Net Mvc

Rendering Rails partial form in another partial
Are both partials in the same view? You will also have to pass the @project object to the partial and every partial that uses @project. Example: <%= render @tests, project: @project %>

Categories : Ruby On Rails

Opencv Contour Error
I had a similiar problem. But there are two implicit situations. The first one is a Drawing issue, that I copied the way the official documentation contains to solve: findContours( src, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE ); // iterate through all the top-level contours, // draw each connected component with its own random color int idx = 0; for( ; idx >= 0; idx = hierarchy[idx][0] ) { Scalar color( rand()&255, rand()&255, rand()&255 ); drawContours( dst, contours, idx, color, CV_FILLED, 8, hierarchy ); } This worked for me for drawing different colors for each contour. EDIT: This function "drawContours" can draw a color for a contours and all children. To understand this better, read thi

Categories : C++

How can I draw the contour of a segment
This is pretty messy, but I threw it together anyway. draw.rect <- function(x1=0.9,y1=0.1,x2=0.8,y2=0.3,width=0.05){ ang <- atan((y2-y1)/(x2-x1)) xshift <- width*sin(ang) yshift <- width*cos(ang) polygon(x=c(x1,x2,x2-xshift,x1-xshift),y=c(y1,y2,y2+yshift,y1+yshift),col="pink") } It would allow you to use your same coordinates. You can adjust the size of the rectangle with the width argument. I think @VincentZoonekynd has a great idea with drawing the segment twice. This rough function does not center the rectangle on the coordinates provided, although you could pretty easily adjust it to do so.

Categories : R

Make contour of scatter
contour expects regularly gridded data. You thus need to interpolate your data first: import numpy as np from scipy.interpolate import griddata import matplotlib.pyplot as plt import numpy.ma as ma from numpy.random import uniform, seed # make up some randomly distributed data seed(1234) npts = 200 x = uniform(-2,2,npts) y = uniform(-2,2,npts) z = x*np.exp(-x**2-y**2) # define grid. xi = np.linspace(-2.1,2.1,100) yi = np.linspace(-2.1,2.1,100) # grid the data. zi = griddata((x, y), z, (xi[None,:], yi[:,None]), method='cubic') # contour the gridded data, plotting dots at the randomly spaced data points. CS = plt.contour(xi,yi,zi,15,linewidths=0.5,colors='k') CS = plt.contourf(xi,yi,zi,15,cmap=plt.cm.jet) plt.colorbar() # draw colorbar # plot data points. plt.scatter(x,y,marker='o',c='b',s=

Categories : Python

Save contour to image
This should work. drawing = np.zeros(img.shape) for i in xrange(len(contours)): if (cv2.contourArea(contours[i]) > 15000): # just a condition cv2.drawContours(drawing, contours, i, (255, 255, 255), 1, 8, hierarchy)

Categories : Python

Need Help in Contour Plot in Matlab
There are a few things to note: 1.) As Jacob Robbins pointed out correctly in his comment, you should avoid using names from Matlab functions as variable names (in your case min and max). One very easy way to do this, is to use only upper case letters for variable names. 2.) You are correct in saying that your fis only one output (though one output in this case is not a single number, but a vector). That is, because you don't assign any indexing to it within the loop. 3.) Yes, both contour and surfc need at least 2x2 - because they plot information on a grid, which is itself at least 2x2 in nature. 4.) In your particular case, two loops may not be necessary. You seem to only be manipulating the x-vector and your grid is regular. Hence you might want to try this loop: for I=1:le

Categories : Algorithm

Is it possible to have different contour ranges for contourf?
Sure it is – just specify a vector in the second argument, e.g.: Z = peaks; contourf(Z,[-10 -5 -1 0 1 5 10]); You can even use Inf and -Inf at the to extremes to make sure that you capture the extrema (or min(Z(:)) and max(Z(:))). In your case, use [-7000 -5000 -1000 -100 10] as the second vector to get the ranges that you want. Not sure why you want to go to +10 when you said the range of data only goes to 0...

Categories : Matlab

Using contour to plot function
Are x and y properly defined as 2x2 matrices? If so then the "power" operator needs to be done on a component-wise basis (.^3 instead of ^3). This works: [x,y] = meshgrid(-2:.2:2,-2:.2:2); contour(3*y+y.^3-x.^3-5)

Categories : Matlab



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.