Tech and a few other things RSS 2.0
# Wednesday, June 30, 2010



Error Readout:
None, it's not an error silly.

The Problem:
When I debug, and look at a string that contains my file path I see 2 backslashs (escape characters) in my string when I only wanted 1.

The Solution:
It's nothing, don't worry about it, that's just the way Visual Studio "debug" shows your path when you catch it while debugging.  When the path is used in the code for the file system there will only be 1 backslash and it will work correctly.

This is such a stupid little thing, but for some reason every once in a blue moon, I forget and freak out on why it's doing this, thus wasting a solid five minutes of my life. I put this post up in hopes I will never forget again and that if someone happens to Google this, my post will pop up and help them move on quickly....maybe only wasting 1 to 2 minutes. :)

Wednesday, June 30, 2010 1:10:24 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
.Net | Visual Studio | Windows
# Friday, June 25, 2010

Apple expects to sell 1 million to 1.4 million iPhones this weekend, this is excluding the 900,000 pre-orders. It has the possibilty to be the biggest selling product release in history!

http://online.wsj.com/article/SB10001424052748704629804575325661775151320.html?mod=WSJ_Tech_LEADTop


UPDATE: They sold 1.7 million. Apple's most successful product release in it's history.

Friday, June 25, 2010 7:50:55 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
apple | iphone | Mac
# Wednesday, June 23, 2010


Error Readout:

Incorrect syntax near ')'

The Problem:
When I was trying to pass in getdate() as a parameter to execute a stored procedure i got the above error.

Example:
exec dbo.storedProcedure
    @param1 = '8D8DF077-7491-491B-AFA2-8F088821A073',
    @param2 = '8D8DF077-7491-491B-AFA2-8F088821A073',
    @param3 = 'Market: SAP 4 Eva',
    @param4 = getdate()


The Solution:
A sql execute statement can't pass a function such as getdate() in through a parameter. To fix this either:

  1. Put getdate() directly in your sql statement that resides in the stored procedure
  2. Pass a null if your table definition allows you to.
  3. Create a temp variable store the value of getdate() in that variable and pass in that variable through the datetime parameter.

Wednesday, June 23, 2010 11:41:51 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
SQL
# Saturday, June 12, 2010


It's a good question.

There are some types that are not derived from NSObject, these types are called "Primitive Types." Some examples of these types are
  1. int
  2. bool
  3. short
  4. long
  5. double
  6. char
Sooooo basically any type that is not derived from the NSObject class is a Primitive type and does not require a "*".

Now I bet you are wondering how do I figure out if it's a primitive type or not.
  1. An easy way is to look at the color of the syntax in xCode, is it deep blue or a sky blue? Deep blue = primitive type, but this is not entirely reliable as the standards for coloring syntax can fluctuate or change.



  2. You can option-click on the object after you have typed it in xCode, click the little book in the upper right hand corner, when the class reference viewer comes up, look and see if it inherits from NSObject. If it doesn't it's Primitive and you don't need a "*".






Note:
There are some alternatives to using the primitive type int, such as the reference type NSInteger, which has some nice baked in functionality of distinguishing between 32 bit and 64 bit, but not all primitive types have an alternative reference type in Objective C.


Just for fun:
In .Net they have primitive types too(I believe they call them value types), kinda. The compiler recognizes traditional primitive types and therefore lets you use the syntax

int i = 5;

But despite the compiler letting you do this, this type still maps back to System.Int32. All things in .Net are mapped back to System.Object. Everything is a reference type, but .Net lets you keep the traditional syntax instead of writing:

System.Int32 i = new System.Int32(5);

UPDATE: Enumerations types also do not use a * (star) and they have the sky blue coloration that may make you think you need a *.





Saturday, June 12, 2010 9:59:04 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
.Net | Mac | Mac OS X | Objective C | Windows
# Sunday, June 06, 2010

Accessorizer I have been told if you do any kind of serious development in Objective C this is the tool to use. At 15 bucks I'll be making it part of my Objective C toolbox especially since I hate typing out all those accessors (variables, @property @synthesize.) The time saved will surely out weigh the cost.

Sunday, June 06, 2010 7:12:06 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback

Navigation
About the author/Disclaimer
        

My name is Ben Coffman. Currently leading the release of Mobile into Canada for Capital One. I have a strong focus on mobile development, building effective development teams and a drive for rapid prototyping and continuous integration using nearly all SDLCs. When I turn the internet off I focus on my family, random hobbies, and sharing moments in life.

My pseudo provactive thoughts
--> Twitter @coffmanben

Learn About Me
--> Linkedin

Blogs I follow:
  1. Big Nerd Ranch
  2. Jeff Lamarche
  3. Scott Hanselman

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Ben Coffman

Archive
<June 2010>
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
All Content © 2013,

Sign In