FAQ Database Discussion Community


How to perform partial object serialization providing “paths” using Newtonsoft JSON.NET

json,serialization,json.net,partial
I have a situation in which I have a very large C# object, however, I only need to return a handful of properties (which can be on nested objects), allow for client-side JavaScript to modify those properties and then send the resulting object back to the server in order to...

Elasticsearch partial producttype names

search,elasticsearch,partial
On laptops there is often a "type name" eg. Lenovo T430 Lenovo T430P Lenovo T430S Aso The user expects to find all variants of T430 when searching for T430 But the standard analyzers in elasticsearch tokenizes on space/non-alfanumeric aso. So a search for T430 will only return the T430 variant...

Rails 4 partial with form not rendering

ruby-on-rails,forms,partial
I have partial file _form.erb.html: <p>Name: </p><%= f.text_field :name %> <p>Description: </p><%= f.text_field :description %> <p>Price: </p><%= f.text_field :price %> <p>Weight: </p><%= f.text_field :weight %> and view file items/new.html.erb: <h1>New item</h1> <%= form_for @item do |f| %> <% render partial: 'form', locals: { :f => f} %> <p><%= f.submit 'Create'...

Redirect to template not working after Foundation Framework installation

ruby-on-rails,zurb-foundation,partial
On my local host after having rails create a new object in the database (through a controller) I used to have my app render a template (if @object.save returns true). After installing zurb foundation the template doesn't show and neither does my flash message, the new object Investor is also...

Render a template with a specific status code

symfony2,partial,http-status-codes
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 already tried that and succeeded...

How NOT to deserialise a nested XML document with XStream

java,xml,serialization,partial,xstream
I have a document structure like this: <MyDocument> <MyChildDocument> <SubElement> ... </SubElement> </MyChildDocument> </MyDocument> I would like XStream to de-serialise this to the following object: @XStreamAlias("MyDocument") public class MyDocument { String myChildDocument; public String getMyChildDocument() { return myChildDocument; } public void setMyChildDocument(String str) { myChildDocument = str; } } The...

Using partial() to fix terms out of order

python,function,partial
Let's say I have a function: def my_function(a, b, c): # Some Code I can use: functools.partial(my_function, "hello") To get a callable of my_function where a="hello". But suppose I want to set the value of parameter b. How could I set the value of parameter b without doing something like:...

Download partial database from heroku

ruby-on-rails,database,postgresql,heroku,partial
I have a ruby on rails application hosted on heroku using postgresql as its database. Since the database is getting pretty large, I was wondering if there's a way to download only a specific part of it off of heroku. For example, is it possible to download only one specific...

Loading view from root of Codeigniter

php,codeigniter,partial
This question is related to this question Loading view outside view folder with CodeIgniter But the problem it is very old, and nobody looks it any more :( This is problem i have, i have created function based on @SpYk3HH answer like this MY_Loader.php <?php class MY_Loader extends CI_Loader {...

Are Javascript Procedures Partial or Total?

javascript,dynamic,partial
This question may be too specific; however, I believe the variety of answers from the knowledgeable might be immensely helpful with respect to understanding dynamic languages such as Javascript (the language basis for my question). Just to catch everyone reading up to a common place, here is some literature: Liskov's...

How to make a part of the picture grayscale in JES?

python,image,jython,partial,manipulation
Hi there I'm trying to play around with my code and can't really seem to figure out how to make part of my code into a grayscale. This is my code: def grayScale(picture): xstop=getWidth(picture)/2 ystop=getHeight(picture)/2 for x in range(0,xstop): for y in range(0,ystop): oldpixel= getPixel(picture,x,y) colour=getColor(oldpixel) newColor=(getRed(oldpixel),getGreen(oldpixel),getBlue(oldpixel))/3 setColor(picture,(newColor,newColor,newColor)) repaint(picture) nP=makePicture(pickAFile())...

highlight “partial” duplicates across entire sheet in Google Sheets using conditional formatting

formatting,duplicates,conditional,highlight,partial
Im trying to highlight partial duplicates in google sheets using conditional formatting. I need to highlight duplicates across multiple columns and rows in any matching cells. so far I'm using this... =countif(INDIRECT({"C2:Z18"}),C2)>1 Which works to a degree, but it only highlights exact matches. I need to find a way to...

HTML snippet in Angular partial missing in view

javascript,angularjs,partial-views,partial,partials
I have a block of HTML in an Angular partial that's not making it into the view for some reason. Every other line of HTML in the partial (including other lines with data-binding and references to my service and its methods) are making it in. Had a hard time locating...

Ruby on Rails: How to Render Partial in a view via Jquery

javascript,jquery,ruby-on-rails,ruby,partial
I have a 'project' form as a partial. I'm trying to use jquery to render the partial when user clicks a button: $('.projects').append("<%= render partial: 'projects/project') %>").html_safe But using the above code is literally rendering "<%= render partial: 'projects/project') %>" on the page instead of the actual partial....

Check for partial match in JavaScript if statement

javascript,jquery,regex,filter,partial
I've got elements set up something like this: <div class="cat" data-cat="example-cat, test-cat, test-category"> ... </div> <div class="cat" data-cat="test-category"> ... </div> <div class="cat"> ... <div class="cat" data-cat="example-cat, test-category"> ... </div> <div class="cat" data-cat="test-category, one-more-cat"> ... </div> </div> Using JavaScript, I need to check each bit of text between commas for a...

is not a Python function

python,partial,functools,rx-py
I'm trying to build a function which I can use as a handler for an RxPy stream that I'm mapping over. The function I have needs access to a variable outside the scope where that variable is defined which, to me, means that I need to use a closure of...

Partial content request in Google Chrome

javascript,google-chrome,video,nginx,partial
There are plenty of posts about Partial content issues with Chrome. But I'm really stuck and any suggestion doesn't help me so far. Here is my problem: ENV: On server side use Node with MongoDB and files storing in mongo. I use GridFS to pickup files and sent to the...

CSS Target Attribute Containing Partial Match

html,css,match,selector,partial
Using the following CSS, why am I not able to target the 3 following anchor tags? a[href~="checkout"] { /* Do something. */ } <a href="http://shop.mydomain.com/checkout/onepage/"> <a href="https://shop.mydomain.com/checkout/onepage/"> <a href="https://shop.mydomain.com/checkout/onepage/?___SID=S"> What am I doing wrong in my CSS selector? I'm trying to select a partial match using ~= for all URLs...

(solved) Selenium: How to find element by partial href?

c#,selenium,href,partial
Solution 1 (c# code for find element by partial href): Driver.Instance.FindElement( By.XPath("//a[contains(@href,'" + PartialLinkHref + "')]" )); Solution 2 (c# code for find element by partial href): ReadOnlyCollection<IWebElement> linkList = Driver.Instance.FindElements(By.TagName("a")); for (int i = 0; i < linkList.Count ; i++) { if (linkList[1].GetAttribute("href").Contains(PartialLinkHref)) { element.SetElement(linkList[i]); return element; break; }...