Posts

C# generic Excel exporter using reflection -

Image
i'm working on generic excel exporter in c#. point put collection of type , specify properties of class should exported using lambda expressions , have done that. problem i'm struggling when have complex property in class, property value exported "namespace.classname" (e.g. "myapp.viewmodels.myviewmodel"). here code: excel exporter class: public class excelexporter { public void exporttoexcel<t>(ienumerable<t> data, params expression<func<t, object>>[] columns) { datatable datatable = this.converttodatatable(data, columns); //export datatable object excel using library... } private datatable converttodatatable<t>(ienumerable<t> data, params expression<func<t, object>>[] columnsfunc) { datatable table = new datatable(); foreach (var column in columnsfunc) { string ...

javascript - typeahead.js doesn't display the dropdown using remote data -

i think have around 5 hours since i'm struggling typeahead.js library. i'm trying load data using remote functionality don't have luck on making working completely. these js libraries i'm loading: <script src="/scripts/jquery-2.1.4.js"></script> <script src="/scripts/handlebars-v3.0.3.js"></script> <script src="/scripts/typeahead.bundle.js"></script> <script src="/scripts/bootstrap.js"></script> <script src="/scripts/respond.js"></script> then, in order initialize typeahead feature, i'm using piece of code: $(function () { var cards = new bloodhound({ datumtokenizer: function (datum) { console.log(datum); return bloodhound.tokenizers.whitespace(datum.value); }, querytokenizer: bloodhound.tokenizers.whitespace, remote: { url: '/home/suggest?searchquery=%query', ...

angularjs - How to switch template in angular directive by the condition of `index` value -

i require change template according count of index getting ng-repeat how achieve that? in case if index 0, want change `template' here code : "use strict"; angular.module("tcpapp") .directive('programname', function () { return { restrict : 'ae', replace : true, scope : { name:'@', index:'@' }, template : '<h2 class="que t{{index}}" ng-click=callme()>{{name}}</h2>', link : function (scope, element, attr) { scope.callme = function () { console.log($(element).prop('class')); } } } }); i tried throws error: template : scope.index ? '<h2 class="que t{{index}}" ng-...

c# - create a outlook add-in to popup an input text field form for user info -

i develop outlook 2013 add-in can clicked , comes form asks user name, phone number etc. after information entered data can appended end of mail content signature. i don't know how call form input text field when clicking add-in. could give me ideas? you may treat vsto based add-in regular .net application. example, in ribbon's button click event handler can create new windows form instance , display users gathering required information. in same way in winforms applications. you may find outlook solutions section in msdn helpful.

php - How to change timeout in javascript dynamically -

good morning everyone! i've got question, not sure language should using. i'm assuming javascript since slideshow javascript. i need create slideshow user can change time in between slides. there 100 slides , want able set timing in between each individually. i've put pics on server , created db links them , slideshow works fine, except can't seem figure out way make timeout have different values. appreciated. here's code: <?php include_once 'includes/db_connect.php'; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>weather show</title> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="stylesheet" href="responsiveslides.css"> <link rel="stylesheet" href="demo.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"...

ReferenceError: event is not defined in my application when i am calling from jquery -

when calling function getting error: if (event.keycode == 46 || event.keycode == 8 || event.keycode == 9 || event.keycode == 27 || event.keycode == 13 || referenceerror: event not defined here code: $(".decimalonly").each(function () { $(this).keydown(function (e) { if (event.keycode == 46 || event.keycode == 8 || event.keycode == 9 || event.keycode == 27 || event.keycode == 13 || (event.keycode == 65 && event.ctrlkey === true) || ((event.keycode == 190 || event.keycode == 110) && $(this).val().indexof(".") == -1) || (event.keycode >= 35 && event.keycode <= 39)) { return; } else { keypress if (event.shiftkey || (event.keycode < 48 || ev...

java 8 - What is the elegant way to generate Map from List using streams -

i have students list database. applied predicates list , partition list valid, invalid students. invalid students want generate map student key , error message value. because need generate report each student.here doing don't know whether approach or not or there better way it. actually after getting invalid students list trying create function think code getting messy , may there better approach it. here doing private list<predicate<olccstudent>> getallpredicates() { list<predicate<olccstudent>> allpredicates = arrays.aslist( isvalidfirstname(), isvalidmiddleinitial(), isvalidlastname(), isvalidstreetaddress(), isvalidcity(), isvalidstate(), isvalidzip(), isvaliddateofbirth(), isvalidssn(), isvalidtestdate(), isvalidtestanswers(), isvalidprovidercode(), isvalidinstructorcode() ); retu...