Questions tagged [partial]

Existing only in part; incomplete.

Existing only in part; incomplete.

1478 questions
31
votes
2 answers

TypeScript Partial type without undefined

How to create a kinda-Partial type, that doesn't allow undefined values? Here's an example: interface MyType { foo: string bar?: number } const merge = (value1: MyType, value2: KindaPartial): MyType => { return {...value1,…
Benjamin M
  • 23,599
  • 32
  • 121
  • 201
30
votes
4 answers

Rendering partial from another folder from another partial in Rails 3

For example: I'm have two models: Task and List. Task belongs_to List. I'm render lists/_form.html.erb partial within lists/show.html.erb view. Now I need to render tasks/_fields.html.erb partial within lists/_form.html.erb partial: <%= render…
aetaur
  • 336
  • 1
  • 3
  • 8
29
votes
6 answers

Differences between functools.partial and a similar lambda?

In Python, suppose I have a function f that I want to pass around with some secondary arguments (assume for simplicity that it's just the first argument that remains variable). What are the differences between doing it these two ways (if any)? #…
ely
  • 74,674
  • 34
  • 147
  • 228
28
votes
2 answers

Create new column in dataframe based on partial string matching other column

I have a dataframe with 2 columns GL and GLDESC and want to add a 3rd column called KIND based on some data that is inside of column GLDESC. The dataframe is as follows: GL GLDESC 1 515100 Payroll-Indir…
user2948714
  • 671
  • 2
  • 9
  • 13
28
votes
3 answers

how to render partial on everything except a certain action

I have a _header.html.erb partial which is where I put my navbar on my launch page I don't want to display the navbar. this is the body of application.html.erb <%= render 'layouts/header' %>
<%= yield…
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
27
votes
3 answers

How to support Partial Updates (PATCH) in REST

I want to implement the partial updates for my resource as i have large resource and want to update the partial information from it.I have gone through the following links but not able to figure out whether to use HTTP POST or PATCH methods. HTTP…
prashant
  • 2,181
  • 2
  • 22
  • 37
27
votes
2 answers

Python functools partial efficiency

I have been working with Python and I set up the following code situation: import timeit setting = """ import functools def f(a,b,c): pass g = functools.partial(f,c=3) h = functools.partial(f,b=5,c=3) i =…
user2515310
  • 357
  • 3
  • 8
27
votes
7 answers

How can I pass a part of a vector as a function argument?

I'm using a vector in a C++ program and I need to pass a part of that vector to a function. If it was C, I would need to do the following (with arrays): int arr[5] = {1, 2, 3, 4, 5}; func(arr+2); // Pass the part of the array {3, 4, 5} Is there…
mohit
  • 5,696
  • 3
  • 24
  • 37
26
votes
5 answers

Rails 3, passing local variable to partial

Possible Duplicate: Rails: confused about syntax for passing locals to partials I want to pass local variable(which doesn't have relevant field in model) to partial. # infos/index.html.erb <%= render :partial => 'info', :locals => {:info =>…
nothing-special-here
  • 11,230
  • 13
  • 64
  • 94
25
votes
3 answers

Setting attributes of a property in partial classes

I have an employee class generated by Entity Framework (EF). public partial class employee { private string name; public string Name { get{return name;} set{ name = value;} } } Now I want to put a required attribute…
yrahman
  • 960
  • 5
  • 15
  • 33
23
votes
3 answers

Relative Paths From Partials Referencing Other Partials

I am using a (primary) partial: <%= render partial: 'shared/page/head' %> Which makes use of other (secondary) partials: <%= render partial: 'shared/page/head/title' %> <%= render partial: 'shared/page/head/meta' %> ... <%= render…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
23
votes
3 answers

Download file using partial download (HTTP)

Is there a way to download huge and still growing file over HTTP using the partial-download feature? It seems that this code downloads file from scratch every time it executed: import urllib urllib.urlretrieve…
Konstantin
  • 6,061
  • 8
  • 40
  • 48
23
votes
4 answers

Resuming rsync partial (-P/--partial) on an interrupted transfer

I am trying to backup my file server to a remove file server using rsync. Rsync is not successfully resuming when a transfer is interrupted. I used the partial option but rsync doesn't find the file it already started because it renames it to a…
Glitches
  • 742
  • 2
  • 8
  • 18
22
votes
4 answers

Rendering Partial View in code MVC Razor

I'm using MVC 3 Razor to make a simple CMS for practice purposes, and the idea is that I'm creating a few partial views. I'm wanting to do a database lookup, and see that 3 partial views need rendering to the page. How would I do this? In…
Paul
  • 3,072
  • 6
  • 37
  • 58
22
votes
1 answer

View PDF as part of the page

I am trying to view a PDF document in my MVC web page, but I cant make it to work. I would like the PDF to be displayed as a part of the other stuff on the page (header, footer etc.). Currently I have a solution where the PDF is shown, but on the…
Peter
  • 253
  • 1
  • 2
  • 6
1
2
3
98 99