programming

  • warning: Creating default object from empty value in /home/johnboker/antiyes.com/modules/taxonomy/taxonomy.pages.inc on line 33.
  • strict warning: Only variables should be passed by reference in /home/johnboker/antiyes.com/sites/all/modules/captcha/captcha.inc on line 61.
  • strict warning: Non-static method view::load() should not be called statically in /home/johnboker/antiyes.com/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of calendar_plugin_display_page::options_submit() should be compatible with views_plugin_display_page::options_submit(&$form, &$form_state) in /home/johnboker/antiyes.com/sites/all/modules/calendar/includes/calendar_plugin_display_page.inc on line 297.
  • strict warning: Declaration of calendar_plugin_display_page::options() should be compatible with views_object::options() in /home/johnboker/antiyes.com/sites/all/modules/calendar/includes/calendar_plugin_display_page.inc on line 297.
  • strict warning: Declaration of calendar_plugin_display_block::options() should be compatible with views_object::options() in /home/johnboker/antiyes.com/sites/all/modules/calendar/includes/calendar_plugin_display_block.inc on line 78.
  • strict warning: Declaration of calendar_plugin_display_attachment::options_submit() should be compatible with views_plugin_display_attachment::options_submit(&$form, &$form_state) in /home/johnboker/antiyes.com/sites/all/modules/calendar/includes/calendar_plugin_display_attachment.inc on line 242.
  • strict warning: Declaration of calendar_plugin_display_attachment::options() should be compatible with views_object::options() in /home/johnboker/antiyes.com/sites/all/modules/calendar/includes/calendar_plugin_display_attachment.inc on line 242.
  • strict warning: Declaration of calendar_plugin_display_ical::options_submit() should be compatible with views_plugin_display_page::options_submit(&$form, &$form_state) in /home/johnboker/antiyes.com/sites/all/modules/calendar/calendar_ical/calendar_plugin_display_ical.inc on line 217.
  • strict warning: Declaration of date_handler_field_multiple::pre_render() should be compatible with content_handler_field_multiple::pre_render($values) in /home/johnboker/antiyes.com/sites/all/modules/date/date/date_handler_field_multiple.inc on line 185.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/johnboker/antiyes.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/johnboker/antiyes.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/johnboker/antiyes.com/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 159.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/johnboker/antiyes.com/sites/all/modules/views/plugins/views_plugin_row.inc on line 134.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/johnboker/antiyes.com/sites/all/modules/views/plugins/views_plugin_row.inc on line 134.

Asp.Net MVC Calendar Helper

What it looks like

MVC3 Calendar

Recently while working on a project with Asp.Net MVC 3 there was a need for a small calendar similar to the asp.net calendar control. After some searching I decided that the easiest method to get this done would be to write a Html Helper. Below is the code that seems to work nicely. This works even if the browser does not support javascript. For added functionality you could add an extra parameter to show highlighted dates or extend it to fill a page and add content to the cells.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
 
namespace AntiYes.Helpers
{
    public static class CalendarExtensions
    {
        public static IHtmlString Calendar(this HtmlHelper helper, DateTime dateToShow)
        {
            DateTimeFormatInfo cinfo = DateTimeFormatInfo.CurrentInfo;
            StringBuilder sb = new StringBuilder();
            DateTime date = new DateTime(dateToShow.Year, dateToShow.Month, 1);
            int emptyCells = ((int)date.DayOfWeek + 7 - (int)cinfo.FirstDayOfWeek) % 7;
            int days = DateTime.DaysInMonth(dateToShow.Year, dateToShow.Month);
            sb.Append("<table class='cal'><tr><th colspan='7'>" + cinfo.MonthNames[date.Month - 1] + " " + dateToShow.Year + "</th></tr>");
            for (int i = 0; i < ((days + emptyCells) > 35 ? 42 : 35); i++)
            {
                if (i % 7 == 0)
                {
                    if (i > 0) sb.Append("</tr>");
                    sb.Append("<tr>");
                }
 
                if (i < emptyCells || i >= emptyCells + days)
                {
                    sb.Append("<td class='cal-empty'>&nbsp;</td>");
                }
                else
                {
                    sb.Append("<td class='cal-day'>" + date.Day + "</td>");
                    date = date.AddDays(1);
                }
            }
            sb.Append("</tr></table>");
            return helper.Raw(sb.ToString());
        }
    }
}

Codestock 2011

When: 
Friday, June 3, 2011 (All day) - Saturday, June 4, 2011 (All day)

http://codestock.org

Always in motion is the future

Smartphones, tablet computers, and televisions running applications; the future is in motion.  The technology landscape is changing and it can be hectic for developer and IT professionals to keep up.  At the same time, opportunities for technology entrepreneurs are huge and it has never been easier for small independent startups to reach the consumer market.

CodeStock is a two day event for technology and information exchange.  Created by the community, for the community – this is not an industry trade show pushing the latest in marketing as technology, but a gathering of working professionals sharing knowledge and experience.  Join us at CodeStock 2011 and move into the future.

Lights Out v2

I've upgraded my Lights Out game to include preferences for the grid size. Now you can select anywhere from 3x3 to 8x8.

In addition to the new preferences I cleaned up the code a lot and changed the color of the lights.

Code PaLOUsa

When: 
Friday, March 4, 2011 (All day) - Saturday, March 5, 2011 (All day)

http://www.codepalousa.com/

What is Code PaLOUsa

 

Code PaLOUsa is a two-day, eight track software development conference to be held March 4 and 5, 2011 at the historic Seelbach Hilton Hotel in downtown Louisville, KY.  The conference is designed to to cover all aspects of software development regardless of technology stack.  We will have sessions revolvoing around Microsoft, Java, and other development platforms; along with session on higher levels that are platform agnostic.  The conference schedule will feature presentations from well-known professionals in the software development community.  We are planning on conducting sixty seventy-minute-long technical presentations and panel discussions, plus a keynote speech during the first evening of the event.

Along with the planned sessions, there will be space reserved for an exhibition hall where attendees will be able to interact with the leading companies in the software development realm.

For the Win: Window 7 Development Boot Camp

When: 
Tuesday, January 25, 2011 - 8:30am - 5:00pm

https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032472059&C...

Event ID: 1032472059
Microsoft Columbus Office
MPR 1 & 2
8800 Lyra Dr
Polaris Center, Suite 400 Columbus Ohio 43240
United States

Register by Phone: 1-877-MSEVENT (9AM-7PM EST. M-F)
Meal: Yes
Presenter(s): Jennifer Marsman
Language(s): English.
Product(s): Windows and Windows 7.
Audience(s): Pro Dev/Programmer.
Event Overview

Web and cloud may be all the rage, but many developers are still doing hardcore client development. If you are among them, this Boot Camp is for you!

In this full-day event, we will explore how to maximize your impact on the Windows client. Our interactive sessions will include topics from throughout the Windows development platform. We will look at application compatibility and transitioning your applications to Windows 7, integrating with the Windows taskbar, developing for IE9, utilizing the cool functionality in the Sensors and Location Platform so that your application better responds to its current environment, leveraging the multitouch capabilities (especially in kiosk scenarios), and creating Silverlight 4 out of browser applications.

This event is a unique opportunity, partnering classroom learning with hands-on-labs and leveraging experts to advise you so we can help you “win” with Windows 7.

Please bring a laptop with the following software installed:

• Windows 7
• Visual Studio 2008 or 2010: http://www.microsoft.com/express/Downloads/
• Windows API Code Pack: http://bit.ly/bGKULt
• Windows 7 Training Kit for Developers: http://bit.ly/cXaJ1u
• IE9 (note that this is a pre-release build): http://bit.ly/b9HBZu
• Silverlight 4 (optional): http://bit.ly/dvR7Hb

Syndicate content