Posts

Showing posts from May, 2012

pandas - calculating top 10 products for a given query based on its priority in python -

suppose given dataframe like: query productid priority index 0 3ds 2125233 0.018946 1 rca 2009324 0.027599 2 nook 1517163 0.009443 3 rca 2877125 0.012054 4 rca 2877134 0.005557 5 flatscreentvs 2416092 0.011961 6 macbook 3108172 0.010459 7 3ds 2264036 0.165948 8 rca 8280834 0.004006 9 memorycard 2740208 0.013744 10 acpowercord 2584273 0.006865 11 zaggiphone 1230537 0.136073 12 watchthethrone 3168067 0.104679 13 remotecontrolextender 7997055 0.113058 14 camcorder 2009041 0.017809 15 3ds 1988047 0.031711 16 3ds 1686079 0.043783 17 wirelessheadphones 3770439 0.014714 18

how to do $filter with more then one expression and comparator in angularjs -

i want filter in angular controller 2 expression , 2 comparator function code loop working fine angular.foreach(vm.campaigndata, function (value) { if (value.starttime < today && value.endtime > today) { vm.campaignfiltereddata.push(value); } }); but want $filter not working vm.campaignfiltereddata =$filter('filter')(vm.campaigndata, {starttime : today , endtime: today} , function(actual, expected ) { return actual < expected;},function(actual, expected ) { return actual > expected;}); my data this [{ "name": "levis marketing event vadodra himalaya mall", "tenantid": 1, "locationid": 5, "createdbyname": "sg_area_manager", "starttime": 1462300200000, "endtime": 1462473000000, "description": "this event marketing levis vadodra himalaya mall", "metricids": [], &q

javascript - sinon.js stub - How to stub async.map -

i want test following function. var myfun = function (a, b, callback) { async.map(a, function (b, mapcallback) { //do b => code don't want execute mapcallback(null, res) }, function (err, output) { if (err) { logger.error(err); return callback(err, null); } return callback(null, output.filter(function(n){ return n != null })); }); } here using async.map, want stub. async.map takes 3 parameters, first array , second , third callback. want stub second callback , call third callback test values. how it? i tried: var mockasync = sinon.stub(async, "map") mockasync.yields("some error", null); but executes second function , not third function, tried using callsarg , did not help, not sure relevant here or not. see in sinon docs stub.callarg(argnum) stub.callargwith(argnum, [arg1, arg2, ...]) in context should be mockasync.callargwith(1, "some error",

javascript - Place amchart legend in a defined location -

by below code part create amchart (pie) on defined div var chart = amcharts.makechart( "chartdiv", {..... so find div id 'chartdiv' , create chart there. possible , have tried set div id legend. create div element anywhere want in our page , legend render there, rather position on top, or bottom or left or right. is possible ? if how ? :)

Python/FTPlib - return results of FTP transfer? -

i have function transfers file ftp server, possible store result of session? code below: .... tempfile.namedtemporaryfile() temp: temp.write(content) temp.seek(0) filename = temp.name session = ftplib.ftp('10.66.118.251','build','password') session.storbinary('stor {0}'.format(file_name), temp) session.quit() temp.flush() i have tried below results: ... tempfile.namedtemporaryfile() temp: ... temp.write(content) ... temp.seek(0) ... filename = temp.name ... session = ftplib.ftp('10.66.118.251','build','password') ... session.storbinary('stor {0}'.format(file_name), temp) ... session.quit() ... temp.flush() ... '226 transfer complete.' '221 goodbye.' >>> print session <ftplib.ftp instance @ 0x3018098> >>> print session.storbinary() traceback (most recent call last): file "<console>", line 1, in <module> typeerror: stor

javascript - ReactJS Error Button on click reference method not defined -

Image
i'm using reactjs create , render table button last column: var cols = [ { key: 'id', label: 'id'} , { key: 'revlock', label: 'revlock' }, { key: 'revision', label: 'revision' }, { key: 'name', label: 'name' }, { key: 'projectnumber', label: 'project number' }, { key: 'description', label: 'description' }, { key: 'createddate', label: 'created date' }, { key: 'language', label: 'language' } ]; var table = react.createclass({ getinitialstate: function () { return { data: [] }; }, componentdidmount: function () {

gensim - Python import error no module named bz2 -

i have libbz2-dev installed still getting following import error while importing gensim : >>> import gensim traceback (most recent call last): file "<stdin>", line 1, in <module> file "/home/krishna/gensimenv/lib/python2.7/site-packages/gensim/__init__.py", line 6, in <module> gensim import parsing, matutils, interfaces, corpora, models, similarities, summarization file "/home/krishna/gensimenv/lib/python2.7/site-packages/gensim/corpora/__init__.py", line 14, in <module> .wikicorpus import wikicorpus file "/home/krishna/gensimenv/lib/python2.7/site-packages/gensim/corpora/wikicorpus.py", line 21, in <module> import bz2 importerror: no module named bz2 you can try pip install bz2file

css - Prevent swipe page when menu toggled -

Image
i have push-left menu, when clicked hamburger icon, push menu slide in , “push” main content aside when toggled, can swipe page right. see : i want make main area unswipeable when push menu toggled. here code : html { position: relative; min-height: 100%; } body { font-family: 'titillium web', sans-serif; background-color: #fbfbfb; overflow-x: hidden; } #sidebar { height: 100%; padding-right: 0; padding-top: 20px; max-width: 300px; } #sidebar .nav { width: 95%; } /* collapsed sidebar styles */ @media screen , (max-width: 767px) { .row-offcanvas { position: relative; -webkit-transition: 0.25s ease-out; -moz-transition: 0.25s ease-out; transition: 0.25s ease-out; } .row-offcanvas-right .sidebar-offcanvas { right: -41.6%; }

matrix - Compare only pairwise comparisons BETWEEN two matrices using rcorr() in R -

hopefully post isn't duplicate, i've spent quite time searching , haven't been able find answer. i have 2 matrices trying make pairwise correlations between, this. matrix 1 gene1 gene2 gene3 id1 12 32 43 id2 94 34 95 id3 90 54 23 id4 43 76 65 matrix2 te1 te2 te3 id1 94 90 82 id2 23 46 94 id3 23 49 39 id4 39 34 46 i'm able table of r^2 values using base function cor(), makes comparisons between matrices, in pairwise way. result looks this: gene1 gene2 gene3 te1 0.98 0.48 0.45 te2 0.77 0.46 0.76 te3 0.45 0.56 0.76 which great! problem need p values too, can cut matrix down have p values less cutoff (because real matrices [30,800] , [30,1000] , need way cut down data intelligible). the rcorr() package great @ this, p

javascript - Capturing entire canvas as an image - Fabric JS -

i'm creating designer angular 2 using fabric js in user adds background image , overlays text, shapes etc. at stage, want able replicate canvas (in modal checkout screen) user can have thumbnail preview of design: preferably image. is there built in fabric function allow this? or plugin might better suited? here need var canvas = new fabric.canvas('canvascontainer'); var rect = new fabric.rect({ left: 100, top: 100, fill: "#ff0000", stroke: "black", width: 100, height: 100, strokewidth: 10, }); canvas.add(rect); canvas.renderall(); var converttoimage=function(){ canvas.deactivateall().renderall(); document.getelementbyid("ten").src=canvas.todataurl('png'); } converttoimage(); <script src="https://rawgithub.com/kangax/fabric.js/master/dist/fabric.js"></script> <canvas width="4

ios - Selection Indicator of tab bar not working -

Image
hi newbie ios. i have implemented tabbarcontroller along 4 tabbar items through storyboard. now, need customise tab bar shown in image below. have set background tab bar. + (uiimage *)imagefromcolor:(uicolor *)color { cgrect rect = cgrectmake(0, 0, 1, 1); uigraphicsbeginimagecontext(rect.size); cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextsetfillcolorwithcolor(context, [color cgcolor]); cgcontextfillrect(context, rect); uiimage *image = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return image; } - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { [[uitabbar appearance] settintcolor:[uicolor whitecolor]]; [[uitabbar appearance] setbackgroundimage:[appdelegate imagefromcolor:[uicolor blackcolor]]]; return yes; } the background tab bar set without problems. when try set colour selected tab bar item, not

user - Instagram Subscription -

i have followed instagram documentation ( https://www.instagram.com/developer/subscriptions/ ) on how create user subscription. this response after creating subscription: { "meta": { "code": 200 }, "data": { "object": "user", "object_id": null, "aspect": "media", "subscription_id": 0, "callback_url": "http://callback_url", "type": "subscription", "id": 0 } } some of users have authenticated app have posted media , yet i'm not seeing end, makes me think there might error subscription. subscription_id or id 0 not correct me. app still in sandbox mode, problem? also, have tried creating subscription object=tag , object_id=blah returns same response above. any advice appreciated. thank you! the subscription_id=0 looks weird it's normal in

ios - Swift Webview force landscape -

i create webview in xcode swift. want pages screen force rotates landscape. , pages auto orientation. how can this? update i did after answer of reinier: func loadaddressurl(){ let requesturl = nsurl(string: urlpath) let request = nsurlrequest(url: requesturl!) //url name show in landscape mode if(request.url?.absolutestring == baseurl + "dashboard") { print(request.description) if(uidevice.currentdevice().orientation != uideviceorientation.landscaperight) { let value = uiinterfaceorientation.landscaperight.rawvalue uidevice.currentdevice().setvalue(value, forkey: "orientation") } } webview.loadrequest(request) but doesn't work. when turn device portrait, app rotate portrait want force landscape. i had been working on question, , results, first of need notified when event of load new url happens method can achieve this, of course need set delegate of webv

bsp - Load u-boot.ldr in bf548 ezkit using sd card -

i working on bf548 ezkit lite , had done tftp booting in it. kernel , jffs2 file system loaded , got root prompt. but need use sd card booting, had made ext2 partition sd card , copy u-boot.ldr(boot loader) in it, when try load file after inserting sd card board had got error tranfering data failed ** ext4fs_devread read error - block failed mount ext2 filesystem... ** unrecognized filesystem type ** search on net not find , add log detail shows sd card detected. bfin> mmcinfo device: blackfin sdh manufacturer id: 3 oem: 5344 name: sd02g tran speed: 25000000 rd block len: 512 sd version 2.0 high capacity: no capacity: 1.8 gib bus width: 4-bit bfin> bfin> ext2load mmc 0 0x1000000 u-boot.ldr tranfering data failed ** ext4fs_devread read error - block failed mount ext2 filesystem... ** unrecognized filesystem type ** bfin> i had tried different sd card still got same problem, 1 have clue this? please share. u-boot version= 2014.07. linux ke

crystal reports - Filter items by last received date -

my report has summary items. want filter these items last received date. how can accomplish this? you can accomplish behavior in record selection. try like: {table.lastreceiveddate} >= date(2015, 1, 1) , {table.lastreceiveddate} <= date(2015, 12, 31) this assumes don't want records outside of date range appear anywhere in report. if that's not wanted, can instead use running total same logic in suppression section.

java - Format XMLGregorianCalendar -

below code gregoriancalendar gregory=new gregoriancalendar(); gregory.settime(new date()); xmlgregoriancalendar xmlgregoriancalendar=datatypefactory.newinstance().newxmlgregoriancalendar(gregory); system.out.println(xmlgregoriancalendar.tostring()); when printing sop in last line of above code getting output 2016-07-28t15:25:47.064+05:30 but iam trying output 2016-07-28+05:30 i have tried different formatters no luck. any suggestions helpfull me atleast can format using simpledateformat? by using simpledateformat iam able "2016-07-29+0530". can please let me know if can bring ":" in between "05" , "30". code below dateformat dateformat = new simpledateformat("yyyy-mm-ddz"); in java version 7 , 8 possible using below dateformat dateformat = new simpledateformat("yyyy-mm-ddxxx"); but not sure in java 6 version the easiest rebuild jdk7 functionality. have know new xxx calculation based on

javascript - Export HTML Table to MS Excel 2010 -

i trying html table in ms excel document , have tried many examples here , internet of them didn't work. can download .xls file , when excel opens file comes nothing (not standard excel grid). , when open .xls files notepad, can see file holds values. most of comments in previous questions telling work these question dates little bit old , can't tell if having version problems. for example javascript export html table excel , can download excel file can't see values in it. also this datatables example work me don't need stuff provide searching , listing. please let me know if of had such trouble , how did solve them. you have solution (by own admission): datatables. features don't need can turned off or not used.

asp.net mvc - "Create" View for parent-child relationship MVC 4 -

so have model: public class subthing { public virtual int subthingid { get; set; } public virtual int thingid { get; set; } public virtual string name { get; set; } public virtual int parentid { get; set; } public virtual subthing parent { get; set; } public virtual list<subthing> childs { get; set; } public virtual thing thing{ get; set; } } and want make create view introducing subthings related subthings. have controller: public actionresult criarmoresubthings(int id) { var x = db.subthings.firstordefault(e => e.subthingid == id); if (x == null) { return httpnotfound(); } var subthing = new subthing() { thingid = x.thingid, parentid = id //(also tried x.subthingid) }; return view("criarmoresubthings", subthing); } [httppost] [validateant

Android distance bar/radius -

i working on app can set radius can't work way want. have been told way want ios thing. can please confirm that? link short clip may can use 1 of these libs: https://github.com/yahoo/android-range-seek-bar https://github.com/anderweb/discreteseekbar https://github.com/bq/markerseekbar

azureservicebus - Azure service bus - Topic full -

i have process(process a) keeps sending events asb topic. there multiple consumers of topic , therefore multiple subscriptions. lets 1 of consumer's process down. , due topic gets full messages not consumed. mean process fails not able send messages asb topic full? two more things check: make sure dead letter queue not full counts towards size of entity. make sure have @ least 1 subscription works each message. example, if send message id=1, have subscription id=2, messages backed up.

Disable click and gray out Listview Items [Android] -

some items in listview need disabled in specific situations. disabled means grayed out, , not clickable more. positions need disabled stored in arraylist named positions_to_disable . i have done 1 part of task: have disabled clicking on these items overriding adapter's method boolean isenabled(int position); @override public boolean isenabled(int position) { (int j = 0; j < fromwhereactivity.positions_to_disable.size(); j++) { if (position == fromwhereactivity.positions_to_disable.get(j)) { return false; } } return super.isenabled(position); } however, haven't found way grey them out. if try same thing overriding adapter's method view getview(int i, view view, viewgroup viewgroup) , more items grayed out when scrolling, because method counts visible items instead of counting items in adapter. how can solve issue? you need set background of list item statelistdrawable has different color d

Rabbitmq and catch all queue -

Image
in company i'm running battery of tests running on different android devices. today tests (that tasks) running in single queue multiple workers. i want split single queue in multiple queue, 1 every device in order optimize tests launches according how many x devices company has (i.e. if company has 2 devices want send tests on devices in queue single worker --concurrency=2 can launch max 2 test in row). i don't want migrate in time i'm taking first step implement hybrid version , logic i'd implement following. device a (there 2 of them) , b (it's one) go on queue a , queue b while others in old legacy one. my problem legacy queue. if send test on device c, sending task queue c , since catch_all queue named legacy task not received. i'm searching way say: "please rabbitmq use queue legacy if existing queue name not match device name". there way achieve this? you can combination of alternate exchange ( https://www.rab

c++ - Build 32 bit libcurl on 64 bit OSX -

i trying build 32 bit lib of curl osx, on 64 bit osx installation (yosemite 10.10.5), according the documentation . i've tried calling ./configure number of different arguments, 1 expect cover bases: cflags='-m32 -arch i386' ldflags='-arch i386' ./configure --host=i386-apple i've tried different hosts well, such x86-apple, x86-apple-darwin, i386-apple-darwin, etc. build without issues, far can see, when try build other 32 bit project links resultant dylib, following error message warning: ignoring file [...]/libcurl.a, file built archive not architecture being linked (i386) and several variations on undefined symbols architecture i386: "_curl_easy_cleanup" [...] a call to lipo -info libcurl.a yields following result fatal error: [...]/lipo: archive no architecture specification: libcurl.a what doing wrong? ./configure call badly formed, missing flag or argument? according installation instructions , people have compiled i386 ma

How to create thumbnail image from high memory image url in php? -

hi friends want create thumbnail image url in php, finding 1 code generate thumb image url ,it's working low memory size image url, not working high memory size image url, please give solution problem. <?php // function created www.thewebhelp.com if(!function_exists("create_square_image")){ function create_square_image($original_file, $destination_file=thumb, $square_size = 96){ if(isset($destination_file) , $destination_file!=null){ if(!is_writable($destination_file)){ echo '<p style="color:#ff0000">oops, destination path not writable. make file or parent folder wirtable.</p>'; } } // width , height of original image $imagedata = getimagesize($original_file); $original_width = $imagedata[0]; $original_height = $imagedata[1]; if($original_width > $original_height){ $new_height = $square_size; $new_w

geoserver - WMS - Filter single layer -

i'm trying make wms call geoserver create image containing 2 layers foo & bar (foo layer group); bar should filtered based on featureid. when load single layer (e.g. bar) - can use filter method &featureid=bar.1 same method doesn't work when try load multiple layers (e.g. foo & bar). single layer filter http://localhost:8080/geoserver/foobar/wms?service=wms&version=1.1.0&request=getmap&layers=bar&featureid=bar.1&styles=&bbox=349335.379999999,248145.919999682,349354.569999999,248170.619999681&width=768&height=735&srs=epsg:27700&format=text%2fhtml%3b%20subtype%3dopenlayers#toggle when run: http://localhost:8080/geoserver/foobar/wms?service=wms&version=1.1.0&request=getmap&layers=foo,bar&featureid=bar.1&styles=&bbox=349335.379999999,248145.919999682,349354.569999999,248170.619999681&width=768&height=735&srs=epsg:27700&format=text%2fhtml%3b%20subtype%3dopenlayers#toggle i er

java - Trying to set up different profiles in Spring & Hibernate -

i need set different profiles in spring app in i'm using hibernate allow me switch different environments (dev/test/prd). below have issue have once create properties files, classes , set settings. application crash. below have dev properties file: profile.name=dev.profiles # database properties db.driverclass=com.mysql.jdbc.driver db.connectionurl=jdbc:mysql://localhost:3306/granojo_db db.username=root # db.password=dev_pss and dev class: @component public class devenv implements genericenv { private string envname = "dev"; @value("${profile.name}") private string profilename; public string getenvname() { return envname; } public void setenvname(string envname) { this.envname = envname; } public string getprofilename() { return profilename; } public void setprofilename(string profilename) { this.profilename = profilename; } @override public string tostring() {

c - struct look up table using string pointers issue -

i have written following code: unsigned char *cptr[] = { "first", "second", "third" }; typedef struct { int a; char *lut; /* or char lut[20]*/ }grp_t; const grp_t grp_st[]= { { 0, cptr[0] }, { 1, cptr[1] }, { 2, cptr[2] } }; when try compile code got following error: error: initializer element not constant error: (near initialization 'grp_st[0].lut[0]') but when replace *cptr[] cptr[][16] as unsigned char cptr[][16] = { "first", "second", "third" }; i able compile code. please can 1 explain me concept missing here. it limitation of c. 6.7.8.4 initialization : all expressions in initializer object has static storage duration shall constant expressions or string literals. and 6.6.9 constant expressions : an address constant null pointer, pointer lvalue designating object of static storage duration, or pointer function desig

Yii2 display multiple images in gridview row -

i want display multiple images in gridviews single row. example: have table a, table b , table c. table has my_id. in table b my_id foreign key. along my_id has c_id. table c has c_id in reference in table b. table c has filepath display images. in table a have my_id follows: 1, 2, 3, 4, 5, 6. in table b have my_id follows. 1 ,1 ,1 ,2 ,3, 3. in table b have c_id follows. 1, 2, 3, 4, 5, 6. in table c c_id's are: 1, 2, 3, 4, 5, 6. , these id's have filepath associated each of them. different images. now gridview should display 3 different images my_id because of foreign key constraints. displays 1 image. my code below: in model public function getpictogramsid() { $pictogramsid = sdsrefghspictograms::find()->where(['sdsref_id' => $this->sdsref_id])->all(); foreach ($pictogramsid $picid){ return $picid->pictogram_id; } } public function getpictogrampath() { $pictogramsid = ghsp

spring - beans.factory.BeanCreationException: Error creating bean with name 'dao': Injection of persistence dependencies failed -

i trying run project, these following exceptions: exception in thread "main" org.springframework.beans.factory.beancreationexception: error creating bean name 'dao': injection of persistence dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'entitymanagerfactory' defined in class path resource [applicationcontext.xml]: invocation of init method failed; nested exception javax.persistence.persistenceexception: [persistenceunit: my_p_u] unable build entitymanagerfactory @ org.springframework.orm.jpa.support.persistenceannotationbeanpostprocessor.postprocesspropertyvalues(persistenceannotationbeanpostprocessor.java:342) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1106) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:517)

asp.net - Plesk Panel Scheduled Task -

i want create scheduled task in plesk panel. i'll run .aspx file. how create scheduled task? should write command textbox in plesk panel? thank you! yes, can set following executable file. path executable file: c:\windows\system32\windowspowershell\v1.0\powershell.exe arguments: -c "(new-object system.net.webclient).downloadstring('http://domain.test/script.aspx') also, please check : https://kb.plesk.com/en/115292

ruby on rails - Request spec order dependent failure (wrong SQL created for devise user update on login) -

we face problem when request spec fails (typo or other exception) affects other request specs should unaffected. problem use many gems tried create minimal reproduction app (without success, https://github.com/tak1n/reproduction ) the problem in detail: we have request spec need login user. user authentication use devise , therefore use warden::test::helpers log in users in request specs. devise automatically updates user related attributes when user logs in (last_sign_in_at, last_sign_in_ip etc..). the problem here when tries save user doing changes end result insert user instead of update user , therefore crashes. here example spec our app: require 'rails_helper' rspec.describe 'suggestions api' let(:user) { factorygirl.create(:user, :professional) } before login(user) # same in https://github.com/tak1n/reproduction/blob/master/spec/support/request_macros.rb#l6 end describe '/suggestions.json', :vcr context 'with non saved

.net - Grant DefaultAppPool write permission to folders within wwwroot in EBS AWS -

i've been trying give iis apppool\defaultapppool user write permissions 2 folders under wwwroot folder using .ebextensions container_commands. there 2 scenarios need cover: be able grant defaultapppool user write permissions when publishing new ebs environment wwwroot folder does not contain solution when .ebextensions run. be able republish existing ebs environment , keep defaultapppool write permissions wwwroot folder does contain solution when .ebextensions run. i have been able perform latter not former. former fails because i'm specifying path folders under wwwroot who's permissions want change solution has yet deployed wwwroot resulting in error message: "the system cannot find file specified." i've tried other approach give defaultapppool write permissions whole wwwroot folder hoping when project extracted, newly added folders inherit permissions wwwroot. when this, , log file output of icacls command, can verify write permissions indee

reporting services - Add a Scroll box in SSRS -

i've searched internet , didn't come solution. well, have report client made in ssrs. the report display : col1 col2 num num i want add col3 scroll box client (user) set "valid" or "not valid". option ? thank's! if user validating data report , writing database, suggest using ms excel vba update database rather using ssrs, may not correct tool job in instance.

java - nested objects in thymeleaf -

i'm trying build form using thymeleaf, entity includes collection (list) of objects. i'm struggling build proper form case. this entity: @entity public class owner { @id @generatedvalue private int id; @column(name = "first_name") private string firstname; @column(name = "last_name") private string lastname; @onetomany(cascade = cascadetype.all, mappedby = "owner") private list<phone> phones; @onetomany(cascade = cascadetype.all, mappedby = "owner") private list<pet> pets; //getterss , setters this pet.class @entity public class pet { @id @generatedvalue private int id; @column(name = "pet_name") private string petname; @manytoone @joincolumn(name = "owner_id") private owner owner; //getters , setters and html file building form: <!doctype html> <html xmlns:th="http:/www.thymealeaf.org">

entity framework - asp.net core pass linq lambda to view -

i'm using asp.net core , when pass linq lambda query view error: an unhandled exception occurred while processing request. invalidoperationexception: model item passed viewdatadictionary of type 'system.collections.generic.list`1[<>f__anonymoustype7`1[system.int64]]', viewdatadictionary instance requires model item of type 'system.collections.generic.ienumerable`1[hrms.salaries]'. this query: public async task<iactionresult> index() { var salary = (from salaries in _context.salaries select new { salaries.id }); return view(await salary.tolistasync()); } and in view use: @model ienumerable<hrms.salaries> @foreach (var item in model) { <tr> <td>@item.id</td> </tr> } is there reason create object in query? if no, try instead : public async task<iactionresult> index() { var salary = (from salaries in _context.salaries sel