dynamic

Dynamic Linq & ICompare

社会主义新天地 提交于 2019-12-10 20:44:08
问题 I'm trying to make use of James McCormack's guide to using a custom IComparer with Dynamic Linq. - see http://zootfroot.blogspot.co.uk/2009/10/dynamic-linq-orderby.html?showComment=1347276236930#c11348033278810583 I use a query to pull back an Enumerable of string values: .Select("fieldname").Distinct() Then try to use .OrderBy(item=>item.GetReflectedPropertyValue("fieldname"),new myComparer()) GetReflectedPropertyValue is a helper method defined by James as public static string

One database that has a lot of items vs. many databases that are made dynamically

[亡魂溺海] 提交于 2019-12-10 20:34:37
问题 I am new to MySQL. I am creating some web services using MySQL but I am not sure what is the best way to use the database. One is the one database that has a lot of items and continually make row following query. Another one is making db database dynamically. Database database is consist of some questions for each user and the number of questions is not fixed. 回答1: Dynamically creating new tables in database is a well known antipattern. For one, it actually makes it more difficult to code,

Jquery iframe crossdomain dynamic height

…衆ロ難τιáo~ 提交于 2019-12-10 20:31:04
问题 Is this even possible with jquery only with no bulky plugins? I know there are lots of plugins and alternatives, i'm searching for the shortest, robustest & most cleanest (preferably relying on jquery) Here basic jsfiddle to tryout your thoughts: http://jsfiddle.net/3vPJd/ 回答1: I have to go with "This is not possible" due to the fact that the parent page cannot get the height of the 3rd party page since it is from a different domain than the parent page. Edit: It is possible to do this if you

How to concatenate results in T-SQL into column?

大兔子大兔子 提交于 2019-12-10 20:17:37
问题 I'm working on a query which should give me result like: |--Name--|--Surname--|--Language--|--Date-- | | James | Hetfield | en,gb,fr | 2011-01-01| | Lars | Ulrich | gb,fr,ca | 2011-01-01| but my select gets set of rows like: | James | Hetfield | en | 2011-01-01| | James | Hetfield | gb | 2011-01-01| | James | Hetfield | fr | 2011-01-01| | Lars | Ulrich | gb | 2011-01-01| | Lars | Ulrich | fr | 2011-01-01| | Lars | Ulrich | ca | 2011-01-01| Which best method you recommend to convert sets of

jquery pjax with php. no content at reload

纵然是瞬间 提交于 2019-12-10 19:32:38
问题 I try to use jquery pjax to load my contents in a div. this works fine, but if i reload the page i have no content. i think i need to put the page content in the else{ part, but i don't want to set the whole html in a php variable. how to fix this? index.php: <?php $title = 'Home'; if(isset($_SERVER['HTTP_X_PJAX']) && $_SERVER['HTTP_X_PJAX'] == 'true'){ ?> <div id="content"> <h1>home</h1> </div> <?php echo "<title>{$title}</title>"; }else{ include 'wrapper.php'; } ?> wrapper.php: <ul class=

Dynamic relative layout in android

帅比萌擦擦* 提交于 2019-12-10 19:23:14
问题 I am trying to have two images on tp of each other. I can have it work fine with an xml file but I would like to do this dynamically. ctdeasyone is a transparent image. So this works fine.. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/bck1" android:src="@drawable/fish2" android:layout_width="wrap_content" android:layout_height

dynamically generated select / options empty in IE but OK in other browsers

穿精又带淫゛_ 提交于 2019-12-10 19:13:20
问题 I'm generating a 'select' element then populating it with options and inserting it into the DOM of my page. Everything's fine in FF, Chrome, Chromium etc. but in IE no options show in the drop-down list but highlights show under the cursor and when I click in the blank list the event handler gets triggered and processes correctly. Here's the relevant HTML area: <span id="spn_fyear" style="position:absolute; top:7px; left:200px; height:24px; cursor:pointer; color:#000000;" onclick="spn_fyear

Using C# LINQ Expressions for both Value Types and Reference Types

社会主义新天地 提交于 2019-12-10 18:49:45
问题 I'm using MVC for REST so that I can take advantage of Razor for outputting different types. CSV is one of those outputs. Instead of writing this template for each input type: ID,Created,Content @foreach (var item in Model.TimeData) { <text>@item.ID,@item.Created,"@Html.Raw(item.Content.Replace("\"", "\"\""))"</text> } I wanted to make use of params and System.Linq.Expressions.Expression to write something like this: @{ Html.WriteCsv<TimeObject>(Model.TimeData, p => p.ID, p => p.Created, p =>

width equal to dynamic height square [duplicate]

限于喜欢 提交于 2019-12-10 18:49:07
问题 This question already has answers here : Use CSS (and maybe JavaScript) to make an element be square (or maintain a specific aspect ratio) (4 answers) Closed 6 years ago . Is it possible with either css or js to set the width of an element to match it's height when the height is a % of the parent div. The child div also needs to change size if browser window is resized. Example body, html {height: 100%} .parent {height: 100%; width: 960px;} .child { height: 50%; width: same as height; /* but

ToList method not available for TrackableCollection

徘徊边缘 提交于 2019-12-10 18:44:33
问题 We are working with Trackable Entities on top of EF 4.0. In order to delete an Entity with all its dependent entities I'm writing a generic DeleteDependentEntities to be called from the Delete method in the EntityManager. (We don't, or don't want to, rely on a CASCADE DELETE to be set on the relations in our database.) The DeleteDependentEntities scans recursevly all Children of the subjected entitySet. In order to keep it generic, so that it can be used for all entities throughout the