Questions tagged [partial]

Existing only in part; incomplete.

Existing only in part; incomplete.

1478 questions
11
votes
1 answer

Pickling wrapped partial functions

I am trying to create a picklable decorator using partial functions. However, I keep getting pickling errors when trying to do that. The first naïve example is as follows: def decorator(func): def wrapper(**kwargs): return partial(func,…
Tarefet Nexus
  • 111
  • 1
  • 3
11
votes
3 answers

Rails partial locals not persisting when sent to another partial as its own local

I render a partial like so: <%= render :partial => 'widgets/some_partial, :locals => {:foo => 'bar'} %> So inside of _some_partial.html.erb I render two more partials like so: <% #foo.nil? #=> false %> <%= render :partial =>…
user94154
  • 16,176
  • 20
  • 77
  • 116
11
votes
3 answers

How to stream partial content with ASP.NET MVC FileStreamResult

We're using a FileStreamResult to provide video data to a Silverlight MediaElement based video player: public ActionResult Preview(Guid id) { return new FileStreamResult( Services.AssetStore.GetStream(id, ContentType.Preview), …
o_o
  • 938
  • 1
  • 9
  • 14
10
votes
2 answers

Best Practices for using partials in Rails

In keeping with the DRY-principle I try to use partials as soon as I am repeating a particular pattern more than once or twice. As a result, some of my views consist of ten or more different partials. I am worried that this might have a negative…
sdfx
  • 21,653
  • 4
  • 26
  • 34
10
votes
2 answers

TYPO3: Pass multiple arguments to a partial from a fluid template

I have a fluid template, from where I call an often used snippet (called "partial"): Template: Partial fbLikeBox.html:
Mateng
  • 3,742
  • 5
  • 37
  • 64
10
votes
1 answer

Python get arguments for partial functions

I am looking to do something similar to what was asked here Getting list of parameter names inside python function, but using partial functions. ie. I need to get the possible arguments for a partial function. I can get the keyword arguments…
Jim Jeffries
  • 9,841
  • 15
  • 62
  • 103
10
votes
6 answers

Partial class doesn't match to auto-generated class part

I've created entity model for my DB classes, here is one of them: [EdmEntityTypeAttribute(NamespaceName="SotiModel", Name="SKUPrice")] [Serializable()] [DataContractAttribute(IsReference=true)] public partial class SKUPrice : EntityObject { …
Budda
  • 18,015
  • 33
  • 124
  • 206
10
votes
3 answers

rails fields_for render partial with multiple locals producing undefined variable

All, I am experiencing a problem with a standard fields_for setup. In my "_form" partial I have:
<%= f.fields_for :comments do |cf| %> <%= render :partial => 'comments/comment_fields', :locals => {:f => cf, :tester…
astjohn
  • 2,922
  • 1
  • 22
  • 25
10
votes
4 answers

Render a template with a specific status code

Since I've read that Chrome is having trouble looping an HTML5 video if the response code isn't 206, I'd like to render my template with a 206 code. Yet I've not found anywhere how to specify an html code when rendering a template... Did anyone…
Michael De Keyser
  • 787
  • 1
  • 17
  • 45
10
votes
2 answers

Selenium: How to find element by partial href?

Working code 1: Driver.Instance.FindElement( By.XPath("//a[contains(@href,'" + PartialLinkHref + "')]" )); Working code 2: ReadOnlyCollection linkList = Driver.Instance.FindElements(By.TagName("a")); for (int i = 0; i < linkList.Count…
Andrew_STOP_RU_WAR_IN_UA
  • 9,318
  • 5
  • 65
  • 101
10
votes
1 answer

Reloading partial in an rails app

I want to reload a partial every 3 seconds on a 'new'-view in my rails app. I have this in my new.html.erb

Controller#new

This is my static content <%= render partial: 'dynamic' %> More Static content How do I get this partial reloaded…
9
votes
4 answers

How to automatically convert VS2003 classes to partial Designer.cs files?

I'm upgrading a project from Visual Studio 2003 to 2008 and wish to automatically generate XXX.Designer.cs files and update the corresponding XXX.cs original one. Any automatic way to do it? UPDATE: I'm referring to WinForms. Of course, I know the…
FerranB
  • 35,683
  • 18
  • 66
  • 85
9
votes
4 answers

passing parameters to zend paginationControl partial

I have a page that displays a lot of data, including Zend_Paginator. The page action is /po/fetch?id=someID. what i want to do is to pass the "id" parameter to zend paginationControl so the pagination links will be something like…
Boris C
  • 669
  • 2
  • 7
  • 14
9
votes
2 answers

Is there an alternative to Partial to accept only fields from another type and nothing else?

Given interfaces or classes A and B with a x1 field in common interface A { a1: number; x1: number; // <<<< } interface B{ b1: number; x1: number; // <<<< } And given the implementations a and b let a: A = {a1: 1, x1: 1}; let b: B = {b1:…
9
votes
2 answers

How to check if two string are a partial match in C#?

Possible Duplicate: Are there any Fuzzy Search or String Similarity Functions libraries written for C#? I am creating an application which will except user input of a Song or Artist or Album name and then will look through a String Array or…
Kamil Dhuleshia
  • 317
  • 2
  • 3
  • 12