Posts

At the Start of My C# Research

This article is a list of resources that I used way back at the start of my career with C#. Since there are a lot of C# tutorials already out I just wanted to write out some of my experiences and topics that I was curious to learn when starting out. The main reason why I wanted to used C# for programming was for Asp.net MVC applications and toward the second year I discovered XNA. Getting Ready at the Start!     If you're a Java Developer the  using Statement  is much like a import and include in C++. Having experience with both languages doesn't hurt and speaking from my own experiences with both languages, C# is probably the easiest compared to all of them. And for multiple reasons, but mostly because of Visual Studio's Intellisense in my opinion.  C# language itself Random resources that I used, for multiple projects. Visual C# Resources Delegates Tutorial C# Short Type  - Sometimes its just good to compare  ( Java , C++ ) . Creating Custom Routes

HTML Select Placeholder

Update     Adding a selected and disabled attribute works as well and doesn't require any javascript, however refreshing the page does not reset the value. Doing a hard refresh does reset the value (for firefox) . However there seems to be a placeholder attribute in draft (as of november 2014).  " When there is no default option, a placeholder can be used instead". However in the example the placeholder value is still selectable after a choice has been made. This may not be what you want, so combining the two attribute and the javascript below  guaranty the behavior I'm looking for.  I could even support older browser with a little work.     The Purpose of this article is to make a placeholder in select that should help prevents bad selections with and make it easier to validate if no selection is made. In this article I will assume you have Jquery and the Jquery Validation plugin installed on your web application and similar html code displayed like the the fo

Flash Videos not in full view for the Chrome Browser

Image
     For a while I had issues with Adobe Flash in the Chrome Browser, immediately my assumption was that I had a incompatibility issue with Adobe Flash. So I started installing older version  of Adobe Flash from   11.9.900.170 and back on Window Plateforms.  This did not help so I soon started my research which I did not bother to install older versions of Chrome since it had never been a problem before.  Resources (weren't helpful) No video in full-screen mode | Flash Player Adobe - Flash Player Adobe Community: Full Screen Mode is not working for adobe flash player Full screen mode - YouTube Help Adobe - Flash Player : Help - Display Settings My Solution     Turns out my problem wasn't caused by an update but by me and my playing around with settings. Which I never took into consideration since I don't often watch videos in Flash. If I can help it I will watch Youtube videos in HTML5. Also I was at the time of playing with things look for ways to improve

My Introduction to TeamCity

    The purpose of this article is simply to record and document my experiences using Teamcity. I know later down the road I will have a lot more questions about TeamCity but for now just I wanted to write down what I already know and to describe some of the ways that I use it.     I first was introduced to TeamCity in June 2013, where it was setup to automate builds and stared builds based the changes in SVN. Using this setup on daily basis, I could see my commits and others as well. Depending on if it was developing or production code teamcity would build code accordingly and put those changes in a Pending state (or Build Queues). Much like TFS, TeamCity allows me to see the history of changes and who has committed what. One thing I liked the most was that TeamCity would not publish builds that failed. Which was a critical step when developing, especially when pushing to prod  since it gave me a quick double check before going live with my code. Future Questions      Down the r

My Introduciton to Nodejs

Image
Introduction  Much of the material here is based on the chapter 8 in the book:  Programming in HTML5 with Javascript and CSS3  and the  Nodes.js site . Getting started with Nodes.js "Nodes.js is built on the Google Chrome Javascript runtime" "The Platform implements an event-driven, non-blocking I/O model and is lightweight and efficient." "data-intensive,real-time applications that run across distributed devices." "executes your Javascript by using Google's V8 virtual machine" Download  Nodes.js and install, need to accept the licensing agreements.  HelloWorld.js var http= require('http') //" http module is a core built-in, low-level module highly optimized." http.createServer(function (request, response) { response.writeHead(200, {'Content-Type':'text/plain'}); response.end('Hello World from Nodes.js!\n'); console.log('Handled request'); }).listen(8080, '

MVC Excel Email Attachment with NPOI

    The First Question I had after successfully creating a Excel sheet was  how do I create an attachment from a stream?  A second to be more specific was  how do I add an attachment to an email using System.Net.Mail?  Ultimately I wanted to have the  Excel Exports in C# using NPOI  but I started small and thankfully others had already asked and answered these questions. After which was just a matter of knowing  What the correct content-type for excel files was? First Attempt MailMessage mail = new MailMessage(); HSSFWorkbook workbook = CreateExcel(OrderId); MemoryStream ms = new MemoryStream(workbook.GetBytes()); mail.Attachments.Add(new Attachment(ms, "example.xls", "application/vnd.ms-excel")); _emailService.SendEmail("example@example.com", "Email test", "Testing 123"); Changed it to.. MemoryStream ms = new MemoryStream(); workbook.Write(ms); This was based on the QA " NPOI -

MVC Data Exported to Excel with NPOI

This is an article for just writing an Excel file using  NPOI  and I want the quickest and easiest way to export a excel file from Asp.net MVC. To keep everything in work fluid motion I will keep the user on the same page and do a forced download within that page. This is a setup that I have seen in multiple times and I think works great in today's modern website designs. Creates excel files Leniel Macaferi's blog: Creating Excel spreadsheets .XLS and .XLSX in C# Create Excel Spreadsheets Using NPOI var workbook = new HSSFWorkbook(); var ExampleSheet = workbook.CreateSheet("Example Sheet"); var rowIndex = 0; var row = ExampleSheet.CreateRow(rowIndex); row.CreateCell(0).SetCellValue("Example in first cell(0,0)"); rowIndex++; Problems I faced XLS is not the same as CVS which is obvious but truthfully I did not know the difference between the two file types (other than their different extensions). So I asked myself what is the  Difference between CS

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql