MikeScott8 Programming Thoughts

My musings, ponderings, and other posts on programming. And maybe gadgets and other nerd stuff.


Leave a comment

Recreating NWVDNUG site

This is the second post about the website for the user group I help run. You can go read the first post if you are interested in the attempt at manually upgrading the MVC website to the latest version of the MVC framework.

The article I referenced in the previous post said “The simplest way to upgrade is to create a new ASP.NET MVC 4 project and copy all the views, controllers, code, and content files from the existing MVC 3 project to the new project…” but then also listed steps to manually upgrade the site’s solution/project. Those steps didn’t quite match up with my situation and didn’t work, so now I am trying the “simplest way”. This is a reference of how simple this simple way is.

Steps I did to try this simple way will be listed below. There will probably be some ripping out of code as one of the updates needed for the site is to stop trying to host the meeting information on our servers and point visitors to the meetup.com page for signing up for the meeting and to see what the meeting topics are.

  • In Vs2015 did “File” “New Project…”
  • From the first dialog box that comes up I chose “ASP.NET Web Application” under “Installed\Templates\Visual C#\Web”
  • I entered the names for the project and the solution and clicked “Ok”
  • In the next dialog box I chose “MVC” from the ASP.NET 4.5.2 Templates section
  • I also checked the Web API references. I will probably not need them but added them in case I do keep some API endpoint on the site.
  • Set it to “No Authentication” as the site has no user login needed.
  • and then clicked “Ok” and let VS create the base solution.
  • next up was clearing out the views and controllers, and adding the ones from the old project.
  • then it was removing all references to the MeetingsService that the old site had to get the Meeting info from the database
  • Next was removing the DTO and domain entities references

I tried viewing the home page, and ran into some issues with the layout page and how it was doing the left navigation with passing HTML partial string to RenderSection. This was resolved by just moving the HTML from the partial into the main layout page. Now I could view the site. The various pages came up, it wasn’t pretty yet as I didn’t have any images for the site or the bootstrap referenced properly yet.

So after I got the images and bootstrap files added to the project, I tried publishing it to the web hosting provider. Unfortunately I ran into some small issues with this. I had to upgrade the server the hosting was on to latest IIS, and then the webdeploy tool didn’t have permissions to remove the previous files correctly so I had to manually delete all the files and then publish again and now the site is back up.

http://nwvdnug.org


Leave a comment

Quick Unit Testing Thought

Just a quick thought I had the other week while driving to work.

I was driving to work and thinking about a unit test I had been in process of writing the previous night and what assertions I had to add to it. And just from that realized I had written my service that was being tested with multiple database calls that could be reduced to one, and then some local filtering in the service.

So just the THINKING of my unit tests, led me to some reduction in the service to database calls.

That’s all just a quick random development thought I wanted to pass on.


Leave a comment

Desert Code Camp Presentation Oct 2014 Slides and Code

Last weekend I presented a session at Desert Code Camp named “Using BreweryDb.com API with Xamarin Forms” I am redoing it tonight for my user group.

Here are the Slides for the presentation, not that there was much in the slide deck but it’s here in case someone wants it 🙂

The code is posted to my GitHub :
https://github.com/mikescott8/DCC2014-02presentation/

The code at the end of the presentation is the second commit and that night I added the next step I was going to do but didnt have time to do and that’s the third commit. I hope to add the last item I wanted to do in the presentation with some Xamarin Forms Labs and Geolocation to the project and will add that to the repo as well when I do.


2 Comments

Building native cross platform apps using C# and Xamarin

So last week Xamarin developer evangelist James Montemagno was in Phoenix giving several presentations. Two of which I attended, the first one I went to was at the user group I started in the Northwest Phoenix Valley, NWVDNUG (Northwest Valley .Net User Group) when he gave an overview of Xamarin and it’s capabilities. Then a few days later, on Saturday I went to a workshop arranged by Joe Guadagno which he went deeper into the Xamarin tools, and walked through some of the newest functionality they recently introduced, Xamarin Forms.

I have been learning Xamarin development the past few months, and even submitted my first iOs app done using C# and Xamarin (which did get approved and is in the app store – it isn’t the best looking app as I am a programmer and not a designer). And within a few days (as I recall) of that submission Xamarin announced version 3 and Xamarin Forms. From the announcement it seemed that Xamarin Forms would have been very useful, as well as some of the newer design tools introduced in version 3, as I struggled with some of the Xcode tools trying to get the colors set for the app.

At that workshop, James walked all the attendees through our first Xamarin Forms app. I really liked the ease of use in creating cross platform USER INTERFACES (yes the UI) in C# code, or even using XAML to build the screens to be used across the various platforms. These screens use custom controls that are abstractions of native controls used on the various platforms. Read more about Xamarin Forms over at their site.

Well, originally I started this post to talk about my experience since that work shop, redoing my iOs app using Xamarin Forms, and at the same time creating my first Android app, and also replacing the old WP7/8 app I had created in the past. All these apps will have feature parity with each other and look similar but not exactly the same thanks to Xamarin. Each platform will use native controls and paradigms for the respective platforms while I write the User Interface just one time.

But since I got kind of long winded on this background post, I will hold off on the details of my journey on this trek for future posts. Well I might write one or two tonight, but schedule them to post in the future. Or I might go back to coding, as it’s such fun to so rapidly iterate over the screens and see them on various emulators.

Hope you come back to read future posts in this “series”


Leave a comment

Testing in various versions of Internet Explorer

I found today a nice page with various Virtual machines for testing with various versions of Windows and Internet explorer. If I had my choice I wouldn’t have to test against older versions of IE, or not at all, but we have to honor our clients requirements for their internal IT specifications.

So I thought this might be useful page to others in this situation, so here is the page.

https://www.modern.ie/en-us/virtualization-tools

and as an easter egg, scroll down the page to some of the Windows XP VMs and see if you can find the game to “end XP”


Leave a comment

JSON echo test service(s)

So recently I got an email from a friend asking for some help with making some JSON requests to a webservice. Of course since they were in development the service they were trying to hit wasn’t something I could hit from my computer. But that wasn’t really the issue I had as the issue my friend had was with the client not even sending the request.

I was playing with the code they sent in a JS Fiddle (jsfiddle.net) and tried using the JSON echo service js fiddle provides. I got the data to get sent to the service, but couldn’t seem to get a response from it. So whats a lazy developer to do? “google it with bing” and my searching wasn’t productive. I found plenty of JSON test CLIENTS but not any services that would do a simple echo back of the data sent to it.

Of course being a programmer, I whipped up a quick and dirty simple service that did that and moved the JavaScript code from my JSFiddle into a test page in the local test site with the service. I then got it working to a point enough I sent the sample I built back to my friend.

THEN…being disappointed with my “google-fu”, I tried some more searches. And of course after I had rolled my own THEN I found some links that would have worked for me. Actually I found a blog post by Brian Cantoni that covered the same/similar issues he was having. And from that blog post he mentioned two services (both provided FREE by RunScope).

I am listing them here for future reference (for me, and maybe if someone else finds this post)

  • http://respondto.it/ – which they(RunScope) designed to use to inspect what data you would get sent back by webhooks (callback requests from another service), before pointing the other service to your real application.
    • You create a unique url for your endpoint
    • then setup JSON or XML data for the response the test service should respond with when it gets hit
    • then you take that endpoint url and enter it into the other service
    • test send to the service and when it sends a request post-processing to you
    • go to the resondto.it site and see what was sent to the endpoint
  • http://requestb.in/– which is almost identical to the first one in the list.
    • the biggest difference is not being able to set what response is sent for the endpoint
    • another is not being able to choose the url. You get a random one.

So I hope this helps someone, or me, in the future.