Posts

c# - How can i create a filter by with Linq? -

Image
my mvc view displays following i perform filtering linq based on user selection can display filtered results only. my controller var products = db.products.asqueryable(); public class filterpageviewmodel { public int?[] man { get; set; } public int?[] size { get; set; } public int?[] color { get; set; } public decimal? minprice { get; set; } public decimal? maxprice { get; set; } public sorting sorting {get ; set; } public order order {get; set; } } public actionresult index(int? categoryid = 0, int? page = 0, filterpageviewmodel model = null) { //manufacturer ############################################# if (model.man != null) { foreach (int? in model.man) { if (i.hasvalue) { //do here } } } //size ###################################################### if (model.size != null) { ...

c++ - How can I optimise this to run in an efficient manner? -

the link question follows: http://codeforces.com/problemset/problem/478/c you have r red, g green , b blue balloons. decorate single table banquet need 3 balloons. 3 balloons attached table shouldn't have same color. maximum number t of tables can decorated if know number of balloons of each color? your task write program given values r, g , b find maximum number t of tables, can decorated in required manner. input: single line contains 3 integers r, g , b (0 ≤ r, g, b ≤ 2·10^9) — number of red, green , blue baloons respectively. numbers separated 1 space. output: print single integer t — maximum number of tables can decorated in required manner. so, did was, in greedy manner, searched maximum , minimum value each time , subtracted 2 , 1 respectively if possible. here code: int main (void) { int ans=0,r,g,b; cin>>r>>g>>b; while (1) { int a1 = maxfind(r,g,b); int a2 = minfind(r,g,b); //ans++; if (a1 ...

javascript - Remove the first character of the first index of an array? -

question: how remove first character of first index of array. var arr = ['/a','b','c','r']; i output var arr = ['a','b','c','r']; use below code arr[0] = arr[0].substr(1);

Why does Chrome on iOS 8.4 say indexedDB is null? Safari has it -

on ios 8.4 (ipad air), able use indexeddb in safari, in chrome, says it's null. instead has websql. why case? there way indexeddb on chrome ios or not added? (it's odd returns null , not undefined ). //returns null console.log( window.indexeddb ); console.log( window.webkitindexeddb ); //returns undefined console.log( window.mozindexeddb ); console.log( window.oindexeddb ); console.log( window.msindexeddb ); it because chrome uses webview , not new wkwebview new in ios8. ios webview doesn't support indexeddb (and readonly there polyfills enable indexeddb on websql don't work) you can find more info on chrome issue tracker here: https://code.google.com/p/chromium/issues/detail?id=423444

Introduce branching to existing project best practice for TFS 2013 -

we have tfs 2013, team project working don't have branches, plain folder structure various solutions in them. with goal introduce release management, intention create several branche, e.g. development/main/releases as told cannot 'disturb' project team developers day day work since there other projects being worked on, question, best practice this? create separate team project? how can adopt branching practice without asking developers. please point direction or share thought on this, appreciated!! unfortunately you'll have "disturb" development team. have 2 options. 1. come process in isolation , disturb them when goes live. 2. collaborate them on process , work meet requirements. (being able release code production key requirement project, sadly it's obvious never gets added backlog / project plan , treated afterthought) i recommend option 2. without collaboration you're going end causing resentment you're imposing on devs , ...

windows - Formating output from bat file -

wmic product name,version > "c:\myinformation.txt" echo. >> "c:\myinformation.txt" echo %username% >> "c:\myinformation.txt" i'm trying write batch file generate software installed on users computer username id purposes. code above works individually. however, when try write out file, †਍敨瑣牯洮牡楴敮⁺਍ instead of " john.doe " my question is, how can software dump wmic followed username without spitting out garbage. i've flipped order of commands. doing results in getting username not software, in neat output ways. creating 2 files not want do. i'd 1 file per user. thanks in advance. use /append:"myfile.txt" output wmic in file. i.e. echo. >"c:\myinformation.txt" wmic /append:"c:\myinformation.txt" product name,version >nul echo. >> "c:\myinformation.txt" echo %username% >> "c:\myinformation.txt"

sql server - SSRS truncating parameter -

Image
i have ssrs report populates parameter stored procedure. query works expected. when parameter used in running report, parameter being truncated. choose value abcd, report returns values abc. stored procedure passing parameter runs in ssms , returns abcd data. when test query in query designer or run report, abc data. how ssrs pass in entire parameter? parameters strings without set length. there's nothing truncate values. have checked values make sure value , label same? the label see (abcd) while value passed in parameter. don't know if problem if works on local machine though. if doesn't work can try deleting parameter , recreating - shouldn't work has before.