IamCalvinBrown.com a Blog Site

Code Examples, Consulting Advice and lots of other cool things

How to query using linq to objects in .net

Want to query a collection without writing a loop in .NET? Here's a linq expression, and the sample code to help.

// our custom object of data

int[] listOfNumbers = { 12345678910 };

 // use LINQ to get all even numbers

    var result = from number in listOfNumbers
        where (number % 2) == 0
         select number;


To download the sample project, please visit http://bit.ly/2vGZriL

How to Remote Desktop To Hardware

Connecting back to older laptops, old server, etc can be a serious task. If you're like me, you've spent countless dollars on tools like LogMeIn.com or tried other free tools. The free tools, ultimately my experience, stopped working when my IP changed or there was a hiccup on the network. Well, as always, Google saves the day.

Say hello to Google Chrome Remote Desktop. A long title but definitely worth the short installation. Without going through all the details of how to install, go to Extensions in your Chrome Browser and add it. Here's a short video on how to set it up once you've installed the extension.

YouTube

https://www.youtube.com/watch?v=BCiTB15K5E4


How to implement GetDate() in SQLite

When inserting records, we often want to timestamp them. SQLite has the ability, however it's slightly different.

Use the keyword: datetime()

It can be used as a default value for a table, or in the Query Editor window. I'm using DB Browser for SQLite.



CSSMERR_TP_NOT_TRUSTED codesign error

This error happens in Xamarin when you have a newly setup environment, or you've recently downloaded your Apple Developer Certificate. Here are the steps you take to correct it.

1. First, thank your luck stars that you found this post

2. Go to KeyChain Access on your Mac

3. (select the Lock icon to unlock these items so that you can make changes)

4. Ensure the login section is selected on the left

5. Click each item individually and change the "When using this certificate" to Use System Defaults. Specifically make sure you change these: iPhone Developer, Mac Developer and Apple Worldwide Developer Relations Certification Authority

6. Close and Restart Xamarin and you should be apple to deploy.


Happy coding.

Enable SharePoint Developer Dashboards

SharePoint Developer Dashboards are easy to use and follow. Think of these dashboards as Fiddler Lite. For more information you can go here for SharePoint 2010 and here for SharePoint 2013.

The overall steps to start the Developer Dashboard are

1) If you have not already, configure and enable your Usage and Health Data Collection Service. For more info click here

2) Once you have your app up and running, execute the following PowerShell Script
$svc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dds = $svc.DeveloperDashboardSettings
$dds.DisplayLevel = "On"
$dds.Update()

3) If everything worked you will see

4) From there you can find out page information, SQL query calls, etc.


An extremely useful tool especially if you are troubleshooting performance.



Navigating to External Drives In Terminal (MAC)

Accessing external drives (volumes) on a MAC isn't the same as on a PC. This can be accomplished with a few easy commands.

1. Open a Terminal Windows (and type the commands below)

2. cd /

3. cd Volumes

4. ls

There you have it. All the drives attached on on your MAC. You can navigate to any by name.

Hint: Use single quotes around folders with spaces in the name


How to clone a project from GitHub


Once you know the location of the project in GitHub, it's easy to create a version to begin work on locally. Simply follow these steps.

1. Open Terminal (Mac Users)

2. Navigate to the root folder (ex: lets go to our desktop): cd ~/Desktop

3. Create a folder for our project (ex: let's name it GitProject): mkdir GitProject

4. Go to the folder we just created: cd GitProject

5. Download the Git Project into our folder: git clone --bare (url of the project -- no parenthesis)


That's it. You now have a local working version of the GIT project. Happy coding.


How to host a static website using Amazon S3

I know that I've raved many times about the power of Amazon AWS, and this article will be no different. Amazon S3 provides a nearly free option to host static websites within their S3 product. S3 is, as Amazon describes it, Scalable Storage in the cloud. What this means, it that S3 is essentially a CDN (content delivery network). I host all types of images for websites, high scale emails and even promotional advertisements.

For my developer friends, S3 is a solution that can significantly, if not all together eliminate the cost of having a place to put websites before their completed for your clients to see on the internet.

For one of my attorney clients, I edited their layout locally, created a folder in my existing S3 environment and enabled the option to make the content a static website. The image below shows you exactly how to do this.

Voila! You have a valid website to email to your clients for approval. Obviously, this is free (as long as it doesn't get a lot of traffic - gigs I mean).

Happy coding.




SharePoint Recruiters ... please learn how to treat us SharePoint professionals

Ring..ring...ring... "Hello"..."Yes my name is [fill in the blank] and I am inquiring about an open SharePoint position in Alpharetta, GA". Here we go again and my standard response "I'm currently not in the market right but please email me the job description and I will forward to other people in my network". I then immediately go to indeed.com see the latest "SharePoint Architect" positions.

Those are the calls I can not stand. Look I understand that cold callers' job are to gather leads to feed to their "account managers" so my resume can be put in the stack of candidates that get submitted to the client. But as a SharePoint professional that has strived to be the best I could be, it is so disheartening to treated like a piece of cattle, no interest in how I am doing, how my day is, and definitely no interest in having a conversation about the position.

I would hope that one, the person calling me would have as much interest in me as I would have for the position. Also, before you call, please read my resume so you know a little about my experience in relation to the position. If the contract requires, 10 years of SharePoint development experience and I have been doing SharePoint admin for 6 years, it's not a good fit. If I have over 10 years of experience like myself, please don't call me about a $35/hour contract. I am worth more than that. Once you decide that I'm a good fit, please know something about SharePoint so I can share my experience. If the fit is a good one, have a thorough job description that you can send, that way the resume can be tailored to the job description. Most importantly, when you receive the resume, have the professionalism to follow up. At least keep me in the loop about the process so I know what's going on.

Remember recruiters, we are professionals, SharePoint professionals, but most importantly, we are people who need you just as much as you need to close the position.


 

Hey nothing big … I just need a SharePoint site

A site, just a team site right, no big deal? Such a simple request that causes the beginning of the end for SharePoint environments across organizations. Without a plan of attack, a repeatable plan of attack for your SharePoint sites, what starts off as a small intranet turns into an unmaintainable disaster. So now that I have your attention, the next question is what should be the plan of attack? A SharePoint site request should be treated as any other application request. If there was a request for a complex application, the first thing that would be done is to gather requirements, right? Well the same approach should be taken for any SharePoint requests.

 

Approach to SharePoint Requirement Gathering

Below is are some questions and a good place to start, obviously you can cater for your environment. These questions are designed to do three things:


  • Show the users that SharePoint is more than a document repository and showcase more of
  • Get the users take ownership of the site and decide on a point of contact
  • Assist in minimizing as many risks as possible

 

Question

Response

Business Owner

Portfolio Owner

Budget Holder

Business Objective(s)

Desired Outcome(s)

Number of proposed users

Geography(ies) of proposed users

Will users be internal only, external or both?

What user roles do you expect the solution to accommodate?

Are there any local language requirements associated with this solution?

Are there any specific device platforms you need to support e.g. tablet/mobile?

Will the solution contain secure data (personal, financial or client)?

What type of data do you require the solution to store?

What are the likely volumes of data objects (e.g. documents) to be stored per year and over the lifetime of the solution?

Do you expect the solution to require workflow?

Is data migration required? (Outside of the SharePoint)

Will the solution require integration with another system or data source?

     - If yes, is this integration for inbound, outbound data or both?

     - If yes, what is the name/type/technology of the integration system?

What is the requested Implementation Date?

Why has this date been identified/defined?

Will this replace an existing solution, if so what is the name/platform of that solution?

Will the solution/enhancement consolidate & simplify a current solution/process/activity?

Will the solution/ehnancement improve the delivery of information?

Will the solution/enhancement realise individual/team/business efficiencies?

Describe the new/existing business processes

Will user training be required?

What is the backup procedures?

Is there a Dev, QA, Staging environment?

 

Conclusion

I would be remiss if I did not say that we at King Strategy Solutions specialize in analyzing the proper requirements and determining the best approach from a development perspective.